* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05030c; color: #fff; }
body { font-family: 'Orbitron', 'Segoe UI', sans-serif; user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* Title screen */
#overlay {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh;
  background: radial-gradient(ellipse at 50% 60%, rgba(10, 4, 30, 0.2), rgba(5, 2, 15, 0.75));
  backdrop-filter: blur(3px); cursor: pointer; transition: opacity 0.8s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }
.title-wrap { text-align: center; }
.logo {
  font-family: 'Monoton', 'Orbitron', sans-serif; font-weight: 400; font-size: clamp(42px, 10vw, 150px); letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff6c8 0%, #ffcf6a 30%, #ff5fa2 55%, #b03cff 80%, #3ac8ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 70, 170, 0.65)) drop-shadow(0 0 40px rgba(120, 60, 255, 0.45));
}
.tagline { margin-top: 1vh; font-size: clamp(11px, 1.4vw, 18px); letter-spacing: 0.6em; color: #7fe3ff; text-shadow: 0 0 10px #29b6ff; }
.press { font-size: clamp(13px, 1.6vw, 22px); letter-spacing: 0.35em; color: #ffd36a; text-shadow: 0 0 12px #ff8a3a; animation: blink 1.4s steps(2, start) infinite; text-align: center; padding: 0 16px; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; max-width: 900px; padding: 0 16px; font-size: 12px; letter-spacing: 0.15em; color: #b9a6ff; }
.controls b { color: #fff; font-weight: 700; padding: 2px 6px; border: 1px solid rgba(160, 120, 255, 0.6); border-radius: 3px; box-shadow: 0 0 8px rgba(160, 120, 255, 0.35) inset; }
@keyframes blink { to { visibility: hidden; } }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; transition: opacity 0.5s; }
#hud.hidden { opacity: 0; }
.hud-logo {
  position: absolute; top: 22px; left: 28px; font-family: 'Monoton', sans-serif; font-size: 28px; letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ffe9a8, #ff5fa2 60%, #9b4bff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 80, 170, 0.7));
}
.now-playing { position: absolute; top: 64px; left: 30px; font-size: 11px; letter-spacing: 0.4em; color: #7fe3ff; text-shadow: 0 0 8px #29b6ff; display: flex; align-items: center; gap: 10px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: #ff5fa2; box-shadow: 0 0 6px #ff5fa2; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; } .eq i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.speedo { position: absolute; right: 34px; bottom: 30px; text-align: right; }
.speed-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; }
#speed { font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 10px #ff4fa8, 0 0 28px #ff2d8a; letter-spacing: 0.04em; }
.unit { font-size: 14px; letter-spacing: 0.3em; color: #ffd36a; text-shadow: 0 0 8px #ff8a3a; }
.bar { width: 260px; height: 6px; margin: 6px 0 8px auto; background: rgba(120, 80, 255, 0.18); border: 1px solid rgba(160, 120, 255, 0.45); transform: skewX(-20deg); }
#speed-bar { height: 100%; width: 0; background: linear-gradient(90deg, #3ac8ff, #b03cff 60%, #ff5fa2); box-shadow: 0 0 12px #ff5fa2; }
#odo { font-size: 13px; letter-spacing: 0.35em; color: #b9a6ff; }
#hint { position: absolute; bottom: 30px; left: 30px; font-size: 11px; letter-spacing: 0.25em; color: rgba(200, 190, 255, 0.75); transition: opacity 2s; max-width: 80vw; }
#hint.fade { opacity: 0; }

#toast {
  position: fixed; top: 22%; left: 50%; transform: translate(-50%, -10px); font-size: 18px; letter-spacing: 0.5em; color: #fff;
  text-shadow: 0 0 10px #3ac8ff, 0 0 26px #b03cff; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  .hud-logo { font-size: 20px; left: 16px; top: 14px; }
  .now-playing { left: 16px; top: 46px; }
  .speedo { right: 16px; bottom: 18px; }
  #speed { font-size: 44px; }
  .bar { width: 170px; }
  #hint { display: none; }
}
