:root {
  --neon-magenta: #ff2bd6;
  --neon-cyan: #22e6ff;
  --neon-amber: #ffb14d;
  --ink: #05060a;
  --hud-fg: #cfe9ef;
  --hud-dim: rgba(207, 233, 239, 0.55);
  --font: "Avenir Next", Futura, "Century Gothic", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: var(--font);
  color: var(--hud-fg);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }

.hidden { display: none !important; }

/* ---------- boot ---------- */
#boot {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, #0b0f1c 0%, #05060a 70%);
  transition: opacity 0.9s ease;
}
#boot.done { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-logo {
  font-size: 42px; font-weight: 700; letter-spacing: 0.45em; text-indent: 0.45em;
  color: var(--neon-cyan);
  text-shadow: 0 0 18px rgba(34, 230, 255, 0.7), 0 0 46px rgba(255, 43, 214, 0.35);
}
.boot-sub { margin-top: 10px; font-size: 11px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--hud-dim); }
.boot-bar { margin: 22px auto 0; width: 220px; height: 2px; background: rgba(207,233,239,0.15); }
#boot-fill { width: 5%; height: 100%; background: linear-gradient(90deg, var(--neon-magenta), var(--neon-cyan)); transition: width 0.25s ease; }

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

#compass {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: min(340px, 56vw); height: 26px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
#compass-strip {
  position: absolute; top: 0; height: 100%; white-space: nowrap;
  font-size: 11px; letter-spacing: 0.2em; color: var(--hud-dim);
  will-change: transform;
}
#compass-strip b { color: var(--hud-fg); font-weight: 600; }
#compass-strip span { display: inline-block; width: 30px; text-align: center; }
.compass-needle {
  position: absolute; left: 50%; top: 0; width: 1px; height: 100%;
  background: var(--neon-magenta); box-shadow: 0 0 6px var(--neon-magenta);
}

#mode-badge {
  position: absolute; left: 18px; bottom: 16px;
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid rgba(207,233,239,0.18);
  background: rgba(5, 6, 10, 0.45);
  backdrop-filter: blur(3px);
}
#mode-glyph { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); font-size: 9px; }
#mode-badge.drone #mode-glyph { color: var(--neon-magenta); text-shadow: 0 0 8px var(--neon-magenta); }

#vignette-prompt {
  position: absolute; left: 50%; bottom: 15%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid rgba(34,230,255,0.35);
  background: rgba(5, 6, 10, 0.55);
  box-shadow: 0 0 22px rgba(34,230,255,0.12);
  animation: prompt-pulse 2.2s ease-in-out infinite;
}
@keyframes prompt-pulse { 50% { box-shadow: 0 0 30px rgba(34,230,255,0.3); } }

.key {
  display: inline-block; padding: 2px 7px;
  border: 1px solid rgba(207,233,239,0.4); border-radius: 3px;
  font-size: 10px; color: #fff;
  background: rgba(207,233,239,0.08);
}

#hint {
  position: absolute; right: 18px; bottom: 16px;
  font-size: 10px; letter-spacing: 0.16em; line-height: 2.1;
  text-align: right; color: var(--hud-dim); text-transform: uppercase;
  transition: opacity 1.2s ease;
}
#hint.faded { opacity: 0.25; }

#toast {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--neon-amber); text-shadow: 0 0 10px rgba(255,177,77,0.6);
  padding: 8px 14px; background: rgba(5,6,10,0.5);
}

/* ---------- photo mode ---------- */
#photo-ui { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
#photo-ui .bar { position: absolute; left: 0; right: 0; height: 7.5vh; background: #000; }
#photo-ui .bar.top { top: 0; } #photo-ui .bar.bottom { bottom: 0; }
#postcard { position: absolute; left: 0; right: 0; bottom: 7.5vh; padding: 10px 0 12px; text-align: center; background: #000; }
#postcard-caption { font-size: 13px; letter-spacing: 0.4em; text-transform: uppercase; color: #e9f7fb; text-shadow: 0 0 12px rgba(34,230,255,0.5); }
#postcard-sub { margin-top: 5px; font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(207,233,239,0.4); }
.frame-corner { position: absolute; width: 26px; height: 26px; border: 1px solid rgba(34,230,255,0.7); }
.frame-corner.tl { top: calc(7.5vh + 12px); left: 14px; border-right: 0; border-bottom: 0; }
.frame-corner.tr { top: calc(7.5vh + 12px); right: 14px; border-left: 0; border-bottom: 0; }
.frame-corner.bl { bottom: calc(7.5vh + 52px); left: 14px; border-right: 0; border-top: 0; }
.frame-corner.br { bottom: calc(7.5vh + 52px); right: 14px; border-left: 0; border-top: 0; }

/* ---------- touch ---------- */
#touch-ui { position: fixed; inset: 0; z-index: 22; pointer-events: none; }
#stick-zone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; }
#stick-base {
  position: absolute; left: 46px; bottom: 76px; width: 96px; height: 96px;
  border: 1px solid rgba(207,233,239,0.25); border-radius: 50%;
  background: rgba(5,6,10,0.3);
}
#stick-nub {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px;
  margin: -20px 0 0 -20px; border-radius: 50%;
  background: rgba(34,230,255,0.25); border: 1px solid rgba(34,230,255,0.6);
}
#touch-buttons { position: absolute; right: 14px; bottom: 84px; display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
.tbtn {
  font-family: var(--font); font-size: 10px; letter-spacing: 0.25em;
  color: var(--hud-fg); padding: 12px 14px;
  background: rgba(5,6,10,0.55); border: 1px solid rgba(207,233,239,0.3);
  border-radius: 4px;
}
.tbtn:active { background: rgba(34,230,255,0.25); }

@media (max-width: 700px) {
  #hint { display: none; }
  #compass { width: 62vw; }
  .boot-logo { font-size: 30px; }
  #mode-badge { bottom: 12px; left: 12px; padding: 6px 9px; }
}
