* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; color: #e8e8e8; font-family: Inter, system-ui, sans-serif; }
#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }

.letterbox { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 1.2s ease; z-index: 2; }
#letterbox-top { top: 0; }
#letterbox-bottom { bottom: 0; }
body.cinematic .letterbox { height: 11vh; }

#objective {
  position: absolute; top: 22px; left: 50%; transform: translate(-50%, -8px);
  font-family: VT323, monospace; font-size: 24px; letter-spacing: 2px; text-transform: uppercase;
  color: #f3f3f3; text-shadow: 0 0 8px rgba(0,0,0,.9), 0 0 2px #000;
  padding: 4px 16px; border-top: 1px solid rgba(255,255,255,.25); border-bottom: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity .5s, transform .5s; white-space: nowrap; z-index: 3;
}
#objective.show { opacity: 1; transform: translate(-50%, 0); }
body.cinematic #objective { opacity: 0; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 3px #000; transition: transform .15s, background .15s; }
#crosshair.active { transform: scale(2.2); background: #fff; }
body.cinematic #crosshair, body.nocross #crosshair { opacity: 0; }

#prompt { position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); font-family: VT323, monospace; font-size: 22px; color: #fff; text-shadow: 0 0 6px #000; opacity: 0; transition: opacity .2s; }
#prompt.show { opacity: 1; }
#prompt b { display: inline-block; padding: 0 6px; margin-right: 6px; border: 1px solid #fff; border-radius: 3px; }

#subtitle { position: absolute; left: 50%; bottom: 13vh; transform: translateX(-50%); max-width: min(900px, 90vw); text-align: center; font-size: clamp(17px, 2.1vw, 24px); line-height: 1.4; padding: 8px 18px; background: rgba(0,0,0,.55); border-radius: 4px; opacity: 0; transition: opacity .25s; z-index: 3; }
#subtitle.show { opacity: 1; }
#subtitle .speaker { font-weight: 600; margin-right: 10px; letter-spacing: 1px; }
#subtitle .speaker:empty { display: none; }
#subtitle .text { color: #f4f4f4; }

#gps-hud { position: absolute; right: 24px; bottom: 24px; width: 250px; height: 250px; border-radius: 14px; overflow: hidden; border: 3px solid #222; box-shadow: 0 0 0 1px #555, 0 10px 30px rgba(0,0,0,.6); display: none; background: #000; }
#gps-hud.show { display: block; }
#gps-hud canvas { width: 100%; height: 100%; display: block; }

#hint { position: absolute; right: 22px; top: 22px; font-family: VT323, monospace; font-size: 19px; color: rgba(255,255,255,.65); text-shadow: 0 0 4px #000; z-index: 3; text-align: right; }

.eyelid { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 4; }
#eyelid-top { top: 0; border-radius: 0 0 50% 50% / 0 0 30% 30%; }
#eyelid-bottom { bottom: 0; border-radius: 50% 50% 0 0 / 30% 30% 0 0; }

#fade { position: absolute; inset: 0; background: #000; opacity: 1; z-index: 5; }

#title-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; transition: opacity 1.5s; z-index: 6; pointer-events: none; }
#title-card.show { opacity: 1; }
#title-card.interactive { pointer-events: auto; }
#title-card h1 { font-family: VT323, monospace; font-size: clamp(64px, 12vw, 160px); letter-spacing: 12px; font-weight: 400; color: #fff; text-shadow: 3px 0 #f0f, -3px 0 #0ff, 0 0 30px rgba(255,255,255,.3); }
#title-card h2 { font-family: VT323, monospace; font-weight: 400; font-size: 34px; letter-spacing: 6px; color: #ddd; margin-top: 10px; }
#title-card p { margin-top: 18px; color: #aaa; font-size: 16px; }
#title-card button { margin-top: 34px; }

/* ---------- Menus ---------- */
.screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(20,10,30,.88), rgba(0,0,0,.97)); }
.screen.hidden { display: none; }
.menu-inner { text-align: center; padding: 16px; max-width: 560px; width: 100%; }
.menu-inner h2 { font-family: VT323, monospace; font-weight: 400; font-size: 56px; letter-spacing: 8px; margin-bottom: 20px; }
.tagline { font-family: VT323, monospace; font-size: 22px; color: #9a9aa8; letter-spacing: 3px; margin-bottom: 34px; }
button { font-family: VT323, monospace; font-size: 28px; letter-spacing: 3px; color: #fff; background: transparent; border: 2px solid #fff; padding: 10px 34px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
button:hover { background: #fff; color: #000; box-shadow: 0 0 24px rgba(255, 80, 220, .6); }
.options { margin: 28px auto 0; display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 14px; color: #bbb; }
.options select { margin-left: 8px; background: #111; color: #ddd; border: 1px solid #444; padding: 4px 6px; font-size: 14px; }
.options .check { cursor: pointer; }
.controls { margin: 26px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 22px; font-size: 13px; color: #9a9a9a; text-align: left; max-width: 430px; }
.controls b { color: #ddd; font-weight: 600; }
.small { margin-top: 20px; font-size: 12px; color: #777; }

.glitch { position: relative; font-family: VT323, monospace; font-weight: 400; font-size: clamp(72px, 14vw, 150px); letter-spacing: 14px; color: #fff; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; right: 0; top: 0; overflow: hidden; }
.glitch::before { color: #0ff; transform: translate(-3px, 0); clip-path: inset(0 0 55% 0); animation: g1 3s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: #f0f; transform: translate(3px, 0); clip-path: inset(55% 0 0 0); animation: g2 2.4s infinite steps(1); mix-blend-mode: screen; }
@keyframes g1 { 0%, 92% { transform: translate(-3px, 0); } 93% { transform: translate(-9px, -2px); } 96% { transform: translate(4px, 1px); } }
@keyframes g2 { 0%, 88% { transform: translate(3px, 0); } 89% { transform: translate(10px, 2px); } 94% { transform: translate(-5px, 0); } }

@media (max-width: 640px) {
  .controls { grid-template-columns: 1fr; }
  #gps-hud { width: 170px; height: 170px; right: 12px; bottom: 12px; }
}
