/* ============ SPACE INVADERS 3D — THREE.JS NEON ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(ellipse at 50% 30%, #0b0b2a 0%, #04040f 70%, #000 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

#wrap { width: min(96vw, 1060px); text-align: center; }

#title {
  color: #fff;
  font-size: clamp(20px, 3.4vw, 38px);
  letter-spacing: 0.55em;
  margin: 10px 0 8px;
  text-shadow: 0 0 6px #00ffff, 0 0 18px #00ffff, 0 0 42px #0088ff;
  animation: titlePulse 2.4s ease-in-out infinite;
}
#title span {
  color: #ff5ce1;
  text-shadow: 0 0 6px #ff00cc, 0 0 18px #ff00cc, 0 0 42px #ff0066;
}
#title em {
  font-style: normal;
  color: #b6ff00;
  font-size: 0.6em;
  vertical-align: middle;
  letter-spacing: 0.2em;
  text-shadow: 0 0 6px #b6ff00, 0 0 20px #66ff00;
}
@keyframes titlePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }

/* ---------- Stage (canvas WebGL + HUD + overlay) ---------- */
#stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(0, 255, 255, 0.35);
  border-radius: 12px;
  overflow: hidden;
  background: #02020a;
  box-shadow:
    0 0 18px rgba(0, 255, 255, 0.25),
    0 0 60px rgba(140, 0, 255, 0.22),
    inset 0 0 40px rgba(0, 0, 40, 0.8);
}
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- HUD ---------- */
#hud {
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: "Consolas", "Courier New", monospace;
  font-weight: bold;
}
#hud > div { position: absolute; }
#hud-score { top: 10px; left: 16px;  font-size: 18px; }
#hud-hi    { top: 12px; left: 50%; transform: translateX(-50%); font-size: 15px; }
#hud-lvl   { top: 11px; right: 16px; font-size: 16px; }
#hud-lives { bottom: 8px; left: 16px; font-size: 14px; color: #9fd8ff;
             display: flex; align-items: center; gap: 8px; }
#hud-lives svg { filter: drop-shadow(0 0 4px #0ff); }
#hud-audio { bottom: 10px; right: 16px; font-size: 12px; color: rgba(160, 220, 255, 0.5); }

.t-cyan { color: #00ffff; text-shadow: 0 0 6px #0ff, 0 0 16px #0ff; }
.t-pink { color: #ff5ce1; text-shadow: 0 0 6px #ff00cc, 0 0 16px #ff00aa; }
.t-lime { color: #b6ff00; text-shadow: 0 0 6px #b6ff00, 0 0 16px #66ff00; }
.t-red  { color: #ff3355; text-shadow: 0 0 8px #ff0033, 0 0 24px #ff0033; }
.t-white{ color: #ffffff; text-shadow: 0 0 6px #fff, 0 0 18px #88f; }
.t-yellow{ color: #ffee55; text-shadow: 0 0 6px #ffee55, 0 0 18px #ffaa00; }

/* ---------- Overlay screens ---------- */
#overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  font-family: "Consolas", "Courier New", monospace;
  font-weight: bold;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(2,2,14,0.55) 0%, rgba(2,2,14,0.82) 100%);
}
#overlay.hidden { display: none; }
#overlay .ov-big   { font-size: clamp(28px, 5vw, 56px); letter-spacing: 0.12em; }
#overlay .ov-mid   { font-size: clamp(15px, 2.2vw, 22px); letter-spacing: 0.18em; color: #fff; }
#overlay .ov-small { font-size: clamp(12px, 1.7vw, 16px); color: #9fd8ff; letter-spacing: 0.08em; }
#overlay .ov-row   { display: flex; align-items: center; gap: 14px; font-size: 15px; }
#overlay .ov-row .nm { width: 130px; text-align: left; }
#overlay .ov-row .pt { width: 130px; text-align: left; color: #fff; }
#overlay .blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

#hints {
  margin-top: 10px;
  color: rgba(160, 220, 255, 0.55);
  font-size: 13px;
  letter-spacing: 0.12em;
}
