/* Layout: page header, one 16:10 first-person stage with HUD layered on top, key legend below.
   Committed look: pixel-craft HUD (Silkscreen) over a bright daylight world; page chrome stays dark so the world glows. */
:root {
  --bg: #0f1a1c;
  --panel: #172629;
  --ink: #eef6ef;
  --muted: #94b0ab;
  --accent: #6fd36b;
  --accent2: #ffd25a;
  --line: #2d4649;
  --font-pixel: "Silkscreen", "Courier New", monospace;
  --font-body: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; padding-inline: 16px; padding-block: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
header { width: 100%; max-width: 1700px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h1 { font-family: var(--font-pixel); font-weight: 700; font-size: 1.4rem; letter-spacing: .04em; margin: 0; text-transform: uppercase; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
#stage { position: relative; width: 100%; max-width: 1700px; aspect-ratio: 16 / 10; max-height: calc(100vh - 84px); background: #8fd0ee; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; user-select: none; -webkit-user-select: none; }
#stage:fullscreen { max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; pointer-events: none; font-family: var(--font-pixel); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.55); }
#cross { left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
#cross::before, #cross::after { content: ""; position: absolute; background: rgba(255,255,255,.85); mix-blend-mode: difference; }
#cross::before { left: 10px; top: 0; width: 2px; height: 22px; }
#cross::after { top: 10px; left: 0; height: 2px; width: 22px; }
#info { left: 10px; top: 8px; font-size: 12px; line-height: 1.5; }
#mapwrap { right: 10px; top: 10px; width: 132px; height: 132px; border: 3px solid rgba(0,0,0,.6); background: #143; image-rendering: pixelated; }
#map { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
#hotbar { left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; background: rgba(0,0,0,.45); border: 2px solid rgba(0,0,0,.6); }
.slot { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); position: relative; }
.slot canvas { width: 100%; height: 100%; display: block; }
.slot b { position: absolute; left: 2px; top: 0; font-size: 9px; }
.slot.sel { border-color: #fff; background: rgba(255,255,255,.18); }
#under { inset: 0; background: rgba(20,80,160,.38); display: none; }
#overlay { z-index: 10; position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 10px; overflow-y: auto; background: rgba(8,20,24,.62); text-align: center; padding: 16px; cursor: pointer; font-family: var(--font-pixel); color: #fff; }
#overlay h2 { margin: 0; font-size: clamp(1.4rem, 5vw, 2.6rem); text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
#overlay p { margin: 0; font-size: clamp(.7rem, 2vw, .95rem); max-width: 34em; line-height: 1.6; }
#bar { width: min(320px, 70%); height: 14px; border: 3px solid #fff; background: rgba(0,0,0,.5); }
#bar i { display: block; height: 100%; width: 0; background: var(--accent); }
#go { display: none; background: var(--accent); color: #0b1a0c; border: 0; font-family: var(--font-pixel); font-weight: 700; font-size: 1rem; padding: 12px 24px; cursor: pointer; text-transform: uppercase; box-shadow: 4px 4px 0 #000; }
#fs { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.5); color: #fff; border: 2px solid rgba(255,255,255,.5); font-family: var(--font-pixel); font-size: 11px; padding: 6px 8px; cursor: pointer; }
.touch { display: none; position: absolute; inset: 0; pointer-events: none; }
@media (pointer: coarse) { .touch { display: block; } #hotbar { bottom: 74px; } }
#joy { position: absolute; left: 18px; bottom: 18px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.18); border: 3px solid rgba(255,255,255,.4); pointer-events: auto; touch-action: none; }
#joy i { position: absolute; left: 40px; top: 40px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.6); }
.tb { position: absolute; width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.5); color: #fff; font-family: var(--font-pixel); font-size: 12px; pointer-events: auto; touch-action: none; }
#tjump { right: 18px; bottom: 30px; }
#tbreak { right: 84px; bottom: 74px; }
#tplace { right: 18px; bottom: 96px; }
.help { width: 100%; max-width: 1000px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; text-align: left; font-family: var(--font-body); cursor: default; margin-top: 4px; }
.help section { background: rgba(10,26,30,.82); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; min-width: 0; font-size: 12.5px; line-height: 1.35; }
#overlay .help h2 { font-family: var(--font-pixel); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 6px; color: var(--accent2); text-shadow: none; }
#overlay .help dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.help dd { margin: 0; color: var(--muted); }
kbd { font-family: var(--font-body); font-weight: 600; font-size: .8rem; background: #22383b; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; }
button:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
