* { box-sizing: border-box; }
body { margin: 0; height: 100vh; overflow: hidden; font: 14px/1.4 system-ui, sans-serif; background: #0f1720; color: #e5e7eb; }
/* The panel floats over the game, which fills the whole window as in the Unreal client: see-through, only as tall as
   what it holds. */
aside { position: absolute; top: 12px; left: 12px; z-index: 4; width: 220px; max-height: calc(100vh - 24px); overflow-y: auto;
  padding: 8px 10px 10px; border-radius: 8px; background: rgba(8, 12, 18, .55); backdrop-filter: blur(3px); }
aside[hidden] { display: none; }
aside section:first-child h2 { margin-top: 0; }
main { position: absolute; inset: 0; overflow: hidden; }
#view { position: absolute; inset: 0; }
#view canvas { display: block; image-rendering: pixelated; }
#crosshair { position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: difference; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; }
#crosshair::before { left: 8px; top: 0; width: 2px; height: 18px; }
#crosshair::after { top: 8px; left: 0; width: 18px; height: 2px; }
#hurt { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 45%, rgba(220,0,0,.45) 100%); opacity: 0; transition: opacity .15s; }
#hud { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
#hearts { display: flex; gap: 1px; height: 20px; }
#hearts i { width: 18px; height: 18px; background: #3b0a0a; clip-path: polygon(50% 100%, 10% 55%, 0 35%, 10% 10%, 30% 0, 50% 15%, 70% 0, 90% 10%, 100% 35%, 90% 55%); position: relative; }
#hearts i.full { background: #e0201c; }
#hearts i.half { background: linear-gradient(90deg, #e0201c 50%, #3b0a0a 50%); }
#hotbar { display: flex; gap: 2px; padding: 2px; background: rgba(0,0,0,.55); border: 2px solid #8b8b8b; pointer-events: auto; }
#hotbar .slot { width: 44px; height: 44px; position: relative; border: 2px solid #555; background: rgba(139,139,139,.35); }
#hotbar .slot.selected { border-color: #fff; outline: 2px solid #fff; }
#hotbar .slot img { width: 100%; height: 100%; image-rendering: pixelated; }
#hotbar .slot.empty img { opacity: .3; }
#hotbar .slot b { position: absolute; right: 2px; bottom: 0; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; }
#hud.holding #hotbar { opacity: .55; }
#held { align-self: center; color: #fff; text-shadow: 1px 1px 0 #000; font-weight: 600; height: 18px; }
#inventory { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.45); cursor: default; }
#inventory[hidden] { display: none; }
.inv { background: #c6c6c6; border: 3px solid; border-color: #fff #555 #555 #fff; padding: 8px; box-shadow: 0 0 0 2px #000; color: #3f3f3f; user-select: none; }
.inv-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.inv-doll { width: 104px; height: 168px; background: #000; border: 2px solid; border-color: #373737 #fff #fff #373737; display: flex; align-items: center; justify-content: center; }
.inv-doll canvas { width: 64px; height: 128px; image-rendering: pixelated; }
.inv-title { font-size: 14px; font-weight: 600; padding-top: 4px; }
.inv-title small { display: block; font-weight: 400; font-size: 11px; color: #5a5a5a; margin-top: 4px; max-width: 300px; }
.inv-grid { display: grid; grid-template-columns: repeat(9, 44px); gap: 2px; }
#inv-main { margin-bottom: 8px; }
.inv-grid .slot { width: 44px; height: 44px; position: relative; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; cursor: pointer; }
.inv-grid .slot:hover { background: #a8a8a8; }
.inv-grid .slot.selected { outline: 2px solid #fff; outline-offset: -2px; }
.inv-grid .slot img { width: 100%; height: 100%; image-rendering: pixelated; }
.inv-grid .slot.empty img { opacity: .3; }
.inv-grid .slot b { position: absolute; right: 2px; bottom: 0; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; }
#carry { position: absolute; width: 40px; height: 40px; pointer-events: none; image-rendering: pixelated; transform: translate(-50%, -50%); z-index: 2; }
#carry[hidden] { display: none; }
#menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.5); }
#menu[hidden] { display: none; }
#menu h2 { font-size: 28px; margin: 0 0 8px; color: #fff; text-transform: none; letter-spacing: 0; text-shadow: 2px 2px 0 #000; }
#menu button { width: 240px; font-size: 18px; padding: 8px 0; background: #595960; border: 2px solid #1a1a1a; border-radius: 0; color: #fff; }
#menu button:hover { background: #7380bf; color: #ffffa0; }
#barred { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); max-width: 80%; padding: 6px 14px; background: rgba(120,20,20,.8);
  border: 2px solid #1a1a1a; color: #fff; font-size: 16px; font-weight: 600; text-align: center; text-shadow: 1px 1px 0 #000; pointer-events: none; }
#barred[hidden] { display: none; }
#servers li small.barred { color: #fca5a5; }
#notice { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.65); }
#notice[hidden] { display: none; }
#notice h2 { font-size: 32px; margin: 0; color: #fff; text-transform: none; letter-spacing: 0; text-shadow: 2px 2px 0 #000; }
#notice p { margin: 0 0 8px; max-width: 560px; text-align: center; font-size: 18px; font-weight: 600; color: #cfd8e3; }
#notice button { width: 240px; font-size: 18px; padding: 8px 0; background: #595960; border: 2px solid #1a1a1a; border-radius: 0; color: #fff; }
#notice button:hover { background: #7380bf; color: #ffffa0; }
#death { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(120,0,0,.55); }
#death[hidden] { display: none; }
#death h2 { font-size: 36px; margin: 0; color: #fff; text-shadow: 2px 2px 0 #000; }
#death button { font-size: 18px; padding: 8px 32px; background: #6b6b6b; border: 2px solid #000; color: #fff; }
h1 { margin: 0 0 12px; font-size: 20px; }
h2 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8aa0b6; }
ul { list-style: none; margin: 0; padding: 0; }
#servers li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 8px; margin-bottom: 3px; border-radius: 4px; background: rgba(23, 36, 51, .6); border-left: 5px solid var(--c, #555); }
#servers li small { display: block; font-size: 11px; color: #cbd5e1; }
#servers li b { font-weight: 600; }
/* Here and Enter are one size, whichever a room shows. */
/* Before signing in there is nothing to list yet. */
#servers:empty::before, #players:empty::before { content: "Not connected"; color: #8aa0b6; font-size: 13px; }
#servers li.none { justify-content: flex-start; color: #8aa0b6; background: none; border-left: 0; padding-left: 0; }
button { font: inherit; color: inherit; background: #1e3a52; border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button:hover { background: #26506f; }
#players li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
/* A long name is cut short with an ellipsis rather than run into the health, as in the Unreal panel. */
#players .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
#players .you { flex-shrink: 0; margin-left: -4px; font-style: normal; }
#players span { margin-left: auto; font-size: 12px; color: #8aa0b6; white-space: nowrap; }
#players em { font-style: normal; font-size: 12px; white-space: nowrap; }
.hint { color: #8aa0b6; font-size: 11px; margin: 10px 0 0; }
.hint[hidden], #you[hidden] { display: none; }
#join { display: flex; gap: 6px; }
#join input { flex: 1; min-width: 0; font: inherit; color: inherit; background: #0f1720; border: 1px solid #26506f; border-radius: 6px; padding: 4px 8px; }
#join[hidden] { display: none; }
/* From Play until the player stands where the server put them the view is curtained, then it fades in: the world is never
   shown from the wrong place first (the Unreal client draws the same curtain). */
#curtain { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: #000; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
#curtain.shown { opacity: 1; pointer-events: auto; }
#curtain.lifting { transition-duration: .5s; }
#curtain h2 { margin: 0; font-size: 44px; color: #fff; text-transform: none; letter-spacing: 0; }
#curtain p { margin: 0; font-size: 18px; font-weight: 600; color: #cfd8e3; }
