:root {
  --bg: #07020f;
  --steel: #b9bfc9;
  --steel-dark: #2a2e38;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --yellow: #ffe600;
  --red: #ff1f3d;
  --green: #b6ff3b;
  --text: #e9f3ff;
  --muted: #8d97ab;
  --panel: rgba(10, 8, 22, 0.86);
  --cut: 18px;
  font-family: 'Rajdhani', system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
body { touch-action: none; user-select: none; -webkit-user-select: none; }

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

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 10; display: none;
  align-items: center; justify-content: center; padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; animation: screenIn 0.25s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }

#menu { background: linear-gradient(90deg, rgba(7,2,15,0.88) 0%, rgba(7,2,15,0.55) 45%, rgba(7,2,15,0) 75%); justify-content: flex-start; }
#garage, #board, #settings, #howto, #paused, #over { background: rgba(7, 2, 15, 0.55); backdrop-filter: blur(3px); }
body.daylight .scanlines { display: none; }

/* ---------- boot ---------- */
#boot { background: var(--bg); flex-direction: column; }
.boot-inner { width: min(320px, 80vw); text-align: center; font-family: 'Orbitron', sans-serif; letter-spacing: 0.2em; font-size: 12px; color: var(--cyan); }
.boot-bar { height: 4px; background: #1a1530; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--cyan), var(--magenta)); animation: boot 1s infinite ease-in-out; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- logo ---------- */
.menu-col { width: min(460px, 100%); margin-left: clamp(0px, 6vw, 90px); display: flex; flex-direction: column; gap: 14px; }
.logo { margin: 0; display: flex; flex-direction: column; line-height: 0.9; }
.logo-car { width: 230px; height: auto; overflow: visible; filter: drop-shadow(0 0 10px rgba(0,240,255,0.55)); }
.logo-car .plume { animation: plume 0.18s infinite alternate; transform-origin: 4px 34px; }
@keyframes plume { from { opacity: 0.6; transform: scaleX(0.85); } to { opacity: 1; transform: scaleX(1.05); } }
.logo-word {
  position: relative; font-family: 'Orbitron', sans-serif; font-weight: 900;
  font-size: clamp(38px, 9vw, 62px); letter-spacing: 0.02em; white-space: nowrap; padding-right: 12px;
  background: linear-gradient(180deg, #ffffff 0%, var(--steel) 48%, #5c6372 52%, #dfe4ea 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.35));
  transform: skewX(-8deg);
}
.logo-word::before, .logo-word::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  pointer-events: none;
}
.logo-word::before { background-image: linear-gradient(var(--cyan), var(--cyan)); animation: glitch1 3.2s infinite steps(1); }
.logo-word::after { background-image: linear-gradient(var(--magenta), var(--magenta)); animation: glitch2 3.2s infinite steps(1); }
@keyframes glitch1 { 0%, 92%, 100% { transform: translate(0); clip-path: inset(0 0 100% 0); } 93% { transform: translate(-4px, 1px); clip-path: inset(10% 0 55% 0); } 95% { transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); } }
@keyframes glitch2 { 0%, 92%, 100% { transform: translate(0); clip-path: inset(0 0 100% 0); } 94% { transform: translate(4px, 0); clip-path: inset(30% 0 40% 0); } 96% { transform: translate(-3px, 1px); clip-path: inset(75% 0 2% 0); } }
.logo-sub {
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: clamp(20px, 4.5vw, 32px);
  letter-spacing: 0.75em; color: var(--magenta); margin-left: 6px;
  text-shadow: 0 0 10px var(--magenta), 0 0 30px rgba(255, 43, 214, 0.6);
}
.tagline { margin: 0; font-family: 'Orbitron', sans-serif; font-size: 12px; letter-spacing: 0.22em; color: var(--muted); }
.tagline b { color: var(--yellow); font-weight: 700; }

/* ---------- buttons ---------- */
.menu-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.btn {
  --c: var(--steel);
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 14px 20px; border: 0; cursor: pointer;
  font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 0.18em;
  color: #0b0b12; background: linear-gradient(180deg, #e9edf2, #9aa1ad);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform 0.08s, filter 0.15s;
}
.btn em { font-style: normal; color: #5a0f4e; font-size: 13px; }
.btn:hover, .btn:focus-visible { filter: brightness(1.15) drop-shadow(0 0 10px var(--cyan)); outline: none; transform: translateX(4px); }
.btn:active { transform: translateX(4px) scale(0.98); }
.btn.primary { background: linear-gradient(90deg, var(--cyan), #7af7ff); justify-content: center; font-size: 18px; box-shadow: 0 0 22px rgba(0,240,255,0.5); }
.btn.small { padding: 10px 14px; font-size: 12px; justify-content: center; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid #3a3f4d; clip-path: none; }
.btn.locked { background: linear-gradient(180deg, #3a3f4d, #262a34); color: var(--muted); }
.btn-row { display: flex; gap: 10px; }
.projects-btn { text-decoration: none; background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(0,240,255,0.55); gap: 8px; }
.projects-btn:hover, .projects-btn:focus-visible { color: #0b0b12; background: linear-gradient(90deg, var(--cyan), #7af7ff); }
.btn-row .btn { flex: 1; }

.menu-stats { display: flex; gap: 22px; font-family: 'Orbitron', sans-serif; }
.menu-stats small { display: block; font-size: 10px; letter-spacing: 0.3em; color: var(--muted); }
.menu-stats b { font-family: 'Rajdhani', sans-serif; font-size: 26px; color: var(--yellow); text-shadow: 0 0 10px rgba(255, 230, 0, 0.5); }

.controls ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font: 600 14px 'Rajdhani', sans-serif; color: #c9cfdb; letter-spacing: 0.04em; }
.controls li { display: flex; align-items: center; gap: 8px; }
.controls li > span { display: inline-flex; min-width: 62px; }
.controls kbd { margin-right: 3px; font-size: 13px; }
.controls kbd.wide { min-width: 56px; }
.controls .gest { justify-content: center; min-width: 34px; height: 26px; border: 1px solid rgba(0,240,255,0.5); border-radius: 13px; color: var(--cyan); font: 700 15px 'Orbitron', sans-serif; line-height: 24px; }
.controls .gest.nitro { color: #0b0b12; background: linear-gradient(180deg, #ffe600, #ff9f1c); border: 0; font-size: 13px; }
.ctl-touch { display: none !important; }
@media (hover: none) and (pointer: coarse) {
  .ctl-keys { display: none !important; }
  .ctl-touch { display: grid !important; }
}
.legal { position: fixed; bottom: max(10px, env(safe-area-inset-bottom)); left: 16px; right: 16px; font-size: 11px; color: #6c748a; letter-spacing: 0.05em; }
.legal a { color: var(--cyan); }

/* ---------- panels ---------- */
.panel {
  width: min(460px, 100%); max-height: 100%; overflow: auto;
  background: var(--panel); padding: 22px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  clip-path: polygon(24px 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%, 0 24px);
  box-shadow: inset 0 0 40px rgba(0, 240, 255, 0.08);
  display: flex; flex-direction: column; gap: 12px;
}
.panel.wide { width: min(860px, 100%); }
.panel.narrow { width: min(400px, 100%); text-align: center; }
.panel header { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { margin: 0; font-family: 'Orbitron', sans-serif; font-size: 22px; letter-spacing: 0.2em; color: var(--cyan); text-shadow: 0 0 12px rgba(0, 240, 255, 0.6); }
.x { background: none; border: 1px solid #3a3f4d; color: var(--text); width: 38px; height: 38px; font-size: 16px; cursor: pointer; }
.x:hover { border-color: var(--magenta); color: var(--magenta); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 12px; }

/* city preview: the city drives live behind a cyberpunk card */
#cities { background: linear-gradient(0deg, rgba(7,2,15,0.75) 0%, rgba(7,2,15,0.15) 45%, rgba(7,2,15,0) 70%, rgba(7,2,15,0.45) 100%); align-items: flex-end; }
.cp-top { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; align-items: center; gap: 14px; }
.cp-top h2 { margin: 0; flex: 1; font: 900 20px 'Orbitron', sans-serif; letter-spacing: 0.25em; color: var(--cyan); text-shadow: 0 0 12px rgba(0, 240, 255, 0.7); }
.cp-top .x { background: rgba(7, 2, 15, 0.7); }
.cp-count { font: 700 18px 'Rajdhani', sans-serif; color: var(--text); letter-spacing: 0.1em; }
.cp-arrow {
  position: absolute; z-index: 2; top: 42%; width: 54px; height: 72px; border: 0; cursor: pointer;
  font: 900 40px 'Orbitron', sans-serif; color: #0b0b12; background: var(--cyan);
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.6); transition: transform 0.12s, filter 0.12s;
}
.cp-arrow.prev { left: 16px; }
.cp-arrow.next { right: 16px; }
.cp-arrow:hover { filter: brightness(1.15); transform: scale(1.06); }
.cp-card {
  position: relative; width: min(560px, 100%); padding: 20px 24px 18px; margin-bottom: 6px;
  background: var(--panel); border-left: 3px solid var(--magenta);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  display: flex; flex-direction: column; gap: 8px;
}
.cp-card.swap { animation: cardIn 0.35s ease-out; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) skewX(-4deg); } to { opacity: 1; transform: none; } }
.cp-code { position: absolute; right: 22px; top: 10px; font: 900 56px 'Orbitron', sans-serif; color: transparent; -webkit-text-stroke: 1px rgba(0, 240, 255, 0.55); letter-spacing: 0.04em; }
.cp-card h3 { margin: 0; font: 900 clamp(26px, 6vw, 38px) 'Orbitron', sans-serif; letter-spacing: 0.12em; color: #fff; text-shadow: 0 0 16px var(--magenta); }
.cp-tag { margin: 0; font-size: 18px; color: #c6cde0; max-width: 80%; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chips span { font: 700 11px 'Orbitron', sans-serif; letter-spacing: 0.12em; padding: 5px 10px; color: var(--yellow); border: 1px solid rgba(255, 230, 0, 0.5); background: rgba(255, 230, 0, 0.08); }
.cp-foot { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.cp-foot .btn { flex: 1; }
.cp-best small { display: block; font: 700 9px 'Orbitron'; letter-spacing: 0.25em; color: var(--muted); }
.cp-best b { font: 700 26px 'Rajdhani', sans-serif; color: var(--yellow); }
.cp-dots { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.cp-dots button { background: none; border: 1px solid #3a3f4d; color: var(--muted); font: 700 10px 'Orbitron'; letter-spacing: 0.12em; padding: 5px 8px; cursor: pointer; }
.cp-dots button.on { color: #0b0b12; background: var(--magenta); border-color: var(--magenta); }

/* garage */
.paint-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.paint { border: 1px solid #333849; background: #0d0b19; color: var(--text); padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 600 12px 'Orbitron', sans-serif; letter-spacing: 0.08em; }
.paint .sw { width: 54px; height: 22px; clip-path: polygon(0 60%, 25% 20%, 70% 10%, 100% 45%, 100% 100%, 0 100%); }
.paint.selected { border-color: var(--yellow); box-shadow: 0 0 14px rgba(255, 230, 0, 0.35); }
.paint.locked { opacity: 0.6; }
.paint small { color: var(--muted); font-size: 10px; }
.bank { margin: 0; font-family: 'Orbitron', sans-serif; letter-spacing: 0.15em; font-size: 12px; color: var(--muted); }
.bank b { color: var(--yellow); font-family: 'Rajdhani', sans-serif; font-size: 18px; }

/* leaderboard */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: #11101f; color: var(--muted); border: 1px solid #2c3040; padding: 7px 12px; font: 700 11px 'Orbitron', sans-serif; letter-spacing: 0.15em; cursor: pointer; }
.tabs button.on { color: #0b0b12; background: var(--cyan); border-color: var(--cyan); }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.board-list li { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 12px; align-items: center; padding: 8px 12px; background: rgba(255,255,255,0.03); border-left: 3px solid transparent; font-size: 16px; }
.board-list li:nth-child(1) { border-left-color: var(--yellow); }
.board-list li:nth-child(2) { border-left-color: var(--steel); }
.board-list li:nth-child(3) { border-left-color: #c97a3a; }
.board-list li.me { background: rgba(0, 240, 255, 0.12); }
.board-list .pos { font: 900 15px 'Orbitron'; color: var(--muted); }
.board-list .nm { font-weight: 700; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .ct { font: 600 10px 'Orbitron'; color: var(--magenta); letter-spacing: 0.15em; }
.board-list .sc { font: 700 18px 'Rajdhani'; color: var(--yellow); }
.board-list .empty { display: block; color: var(--muted); text-align: center; padding: 30px; border: 0; background: none; }

/* settings */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #22263a; font: 700 13px 'Orbitron', sans-serif; letter-spacing: 0.15em; }
.row input:not([type]), .row select, .submit-form input {
  background: #0c0b18; color: var(--text); border: 1px solid #3a3f4d; padding: 9px 10px;
  font: 700 14px 'Orbitron', sans-serif; letter-spacing: 0.1em; text-transform: uppercase; width: 170px;
}
.row input:focus, .row select:focus, .submit-form input:focus { outline: none; border-color: var(--cyan); }
.toggle { appearance: none; width: 50px; height: 26px; background: #2a2e38; position: relative; cursor: pointer; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.toggle::after { content: ''; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.toggle:checked { background: rgba(0, 240, 255, 0.3); }
.toggle:checked::after { transform: translateX(24px); background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

/* how to */
.howto { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 17px; }
.howto.tips li { padding-left: 14px; position: relative; color: #c6cde0; }
.howto.tips li::before { content: '▸'; position: absolute; left: 0; color: var(--cyan); }
kbd { display: inline-block; min-width: 26px; padding: 2px 6px; margin-right: 4px; text-align: center; font: 700 12px 'Orbitron'; color: #0b0b12; background: var(--steel); clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px); }
b.c { color: var(--cyan); } b.m { color: var(--magenta); } b.y { color: var(--yellow); } b.r { color: var(--red); } b.g { color: var(--green); }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 8; pointer-events: none; display: none; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); flex-direction: column; justify-content: space-between; font-family: 'Lilita One', 'Rajdhani', sans-serif; color: #fff; --ink: 0 3px 0 rgba(0,0,0,0.28); }
.hud.active { display: flex; }
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hud-score { display: flex; align-items: center; gap: 8px; }
.hud-score b { font-weight: 400; font-size: clamp(30px, 6.5vw, 48px); padding: 2px 18px; border-radius: 999px; background: linear-gradient(180deg, #4cc9f0, #3a86ff); box-shadow: 0 4px 0 #2459c7, 0 8px 18px rgba(0,0,0,0.25); text-shadow: var(--ink); letter-spacing: 0.02em; }
.mult { display: inline-block; font-size: 22px; padding: 4px 12px; border-radius: 999px; background: #ffbe0b; color: #fff; box-shadow: 0 3px 0 #d68c00; text-shadow: var(--ink); transition: transform 0.15s; }
.mult.pop { transform: scale(1.4) rotate(-6deg); }
.hud-right { text-align: right; font-size: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-shadow: var(--ink); }
.hud-right b { font-weight: 400; }
.hud-right > div:nth-child(2) { padding: 3px 12px; border-radius: 999px; background: rgba(0,0,0,0.28); }
.sector { font-size: 15px; padding: 3px 12px; border-radius: 999px; background: #ff006e; box-shadow: 0 3px 0 #b8004f; letter-spacing: 0.05em; }
.pause-btn { pointer-events: auto; background: #ffffff; color: #3a86ff; border: 0; width: 44px; height: 40px; font-size: 14px; cursor: pointer; border-radius: 12px; box-shadow: 0 3px 0 #c9d6ea; }
.hud-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gauge { width: min(250px, 44vw); padding: 8px 12px 10px; border-radius: 18px; background: rgba(0,0,0,0.3); }
.gauge-label { font-size: 13px; margin-bottom: 5px; text-shadow: var(--ink); letter-spacing: 0.03em; }
.gauge-label b { font-weight: 400; font-size: 18px; color: #9bf6ff; }
.gauge-bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,0.25); overflow: hidden; }
.gauge-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, #06d6a0, #4cc9f0); transition: width 0.1s; }
.gauge.low .gauge-bar i { background: linear-gradient(90deg, #ef233c, #ff7b00); }
.gauge.low .gauge-label b { color: #ffb4a2; }
.powers { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.powers span { font-size: 14px; padding: 5px 12px; border-radius: 999px; color: #fff; text-shadow: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,0.2); }
.speedo { text-align: right; padding: 4px 14px; border-radius: 18px; background: rgba(0,0,0,0.3); }
.speedo b { font-weight: 400; font-size: clamp(30px, 6vw, 42px); color: #fff; text-shadow: var(--ink); }
.speedo small { display: block; font-size: 12px; margin-top: -4px; color: #ffd166; }

.countdown { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; pointer-events: none; font: 400 clamp(90px, 22vw, 180px) 'Lilita One', sans-serif; color: #fff; text-shadow: 0 6px 0 #ff006e, 0 12px 24px rgba(0,0,0,0.3); }
.countdown.go { font-size: clamp(44px, 11vw, 96px); color: #ffbe0b; text-shadow: 0 5px 0 #d64000, 0 12px 24px rgba(0,0,0,0.3); text-align: center; }
.countdown span { animation: count 0.9s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes count { from { transform: scale(0.3) rotate(-12deg); opacity: 0; } 25% { opacity: 1; transform: scale(1.1) rotate(3deg); } 70% { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.9); } }

.toasts { position: fixed; left: 0; right: 0; top: 20%; z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { font: 400 clamp(20px, 4.4vw, 32px) 'Lilita One', sans-serif; color: #fff; letter-spacing: 0.02em; text-shadow: 0 3px 0 #3a86ff, 0 6px 14px rgba(0,0,0,0.3); animation: toast 1.1s ease-out forwards; }
.toast.stunt { color: #ffbe0b; text-shadow: 0 3px 0 #d64000, 0 6px 14px rgba(0,0,0,0.3); }
.toast.good { color: #7bf1a8; text-shadow: 0 3px 0 #11865b, 0 6px 14px rgba(0,0,0,0.3); }
.toast.warn { color: #fff; font-size: clamp(16px, 3.2vw, 22px); padding: 2px 14px; border-radius: 999px; background: #ef233c; text-shadow: none; }
@keyframes toast { from { opacity: 0; transform: translateY(14px) scale(0.6) rotate(-4deg); } 15% { opacity: 1; transform: translateY(0) scale(1.12) rotate(2deg); } 25% { transform: scale(1) rotate(0); } 70% { opacity: 1; } to { opacity: 0; transform: translateY(-22px); } }

.banner { position: fixed; left: 0; right: 0; top: 46%; z-index: 9; text-align: center; pointer-events: none; font: 400 clamp(34px, 7vw, 60px) 'Lilita One', sans-serif; color: #fff; text-shadow: 0 5px 0 #ff006e, 0 10px 20px rgba(0,0,0,0.3); opacity: 0; }
.banner small { display: block; font-size: 0.45em; color: #ffbe0b; text-shadow: 0 3px 0 #d64000; }
.banner.show { animation: banner 2.4s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: scale(0.4) rotate(-6deg); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- game over ---------- */
.glitch { position: relative; font-size: 34px !important; color: var(--red) !important; text-shadow: 0 0 16px var(--red) !important; }
.over-score small { display: block; font: 700 10px 'Orbitron'; letter-spacing: 0.3em; color: var(--muted); }
.over-score b { font: 700 54px 'Rajdhani', sans-serif; color: #fff; text-shadow: 0 0 16px var(--cyan); }
.badge { display: none; margin: 4px auto 0; width: max-content; padding: 4px 10px; font: 900 11px 'Orbitron'; letter-spacing: 0.2em; color: #0b0b12; background: var(--yellow); animation: pulse 0.8s infinite alternate; }
.badge.on { display: block; }
@keyframes pulse { from { box-shadow: 0 0 4px var(--yellow); } to { box-shadow: 0 0 20px var(--yellow); } }
.over-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.over-stats div { background: rgba(255,255,255,0.04); padding: 8px 4px; }
.over-stats small { display: block; font: 600 8px 'Orbitron'; letter-spacing: 0.15em; color: var(--muted); }
.over-stats b { font: 700 20px 'Rajdhani'; color: var(--cyan); }
.submit-form { display: flex; gap: 8px; }
.submit-form input { flex: 1; width: auto; min-width: 0; }
.submit-form .btn { width: auto; font-size: 12px; padding: 10px 14px; }
.rank { margin: 0; min-height: 1.2em; font: 700 13px 'Orbitron'; letter-spacing: 0.1em; color: var(--yellow); }

.touch-hint { position: fixed; bottom: 18%; left: 0; right: 0; z-index: 9; text-align: center; font: 400 18px 'Lilita One', sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,0.35); pointer-events: none; display: none; }
.touch-hint.show { display: block; animation: toast 4s ease-out forwards; }

@media (max-width: 640px) {
  #menu { background: linear-gradient(180deg, rgba(7,2,15,0.85) 0%, rgba(7,2,15,0.55) 70%, rgba(7,2,15,0.2) 100%); align-items: flex-start; }
  .menu-col { margin-left: 0; margin-top: 4vh; }
  .logo-car { width: 170px; }
  .over-stats { grid-template-columns: repeat(2, 1fr); }
  .paint-grid { grid-template-columns: repeat(2, 1fr); }
  .cp-arrow { top: 28%; width: 44px; height: 56px; font-size: 30px; }
  .cp-code { font-size: 40px; }
  .cp-tag { font-size: 16px; max-width: none; }
  .hud-right { font-size: 15px; }
  .legal { position: static; margin-top: auto; }
  #menu { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .logo-word::before, .logo-word::after, .logo-car .plume { animation: none; }
}

/* ---------- mute ---------- */
.mute-btn { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; z-index: 2; width: 46px; height: 46px; padding: 10px; cursor: pointer; border: 1px solid #3a3f4d; background: rgba(7, 2, 15, 0.7); color: var(--cyan); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.mute-btn:hover { color: #fff; border-color: var(--cyan); box-shadow: 0 0 12px rgba(0, 240, 255, 0.5); }
.mute-btn svg { width: 100%; height: 100%; display: block; }
.mute-btn .cross { display: none; }
.mute-btn[aria-pressed="true"] { color: var(--magenta); }
.mute-btn[aria-pressed="true"] .cross { display: inline; }
.mute-btn[aria-pressed="true"] .waves { display: none; }

/* ---------- nitro booster ---------- */
.boost-btn { pointer-events: auto; position: relative; overflow: hidden; width: 86px; height: 86px; border-radius: 50%; border: 4px solid #fff; background: rgba(0,0,0,0.35); color: #fff; font: 400 16px 'Lilita One', sans-serif; text-shadow: 0 2px 0 rgba(0,0,0,0.35); cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,0.2); align-self: center; }
.boost-btn .nitro-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: linear-gradient(0deg, #ff006e, #ff7b00 60%, #ffbe0b); transition: height 0.2s; }
.boost-btn .boost-label { position: relative; }
.boost-btn.ready { animation: ready 0.6s infinite alternate; border-color: #ffbe0b; }
.boost-btn.ready .boost-label::after { content: ' GO!'; }
.boost-btn.on { border-color: #38d9ff; }
.boost-btn.on .nitro-fill { background: linear-gradient(0deg, #3a86ff, #38d9ff); }
@keyframes ready { from { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,190,11,0.7); } to { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(255,190,11,0); } }
.speedlines { position: fixed; inset: 0; z-index: 7; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,255,255,0.0) 0deg 4deg, rgba(255,255,255,0.35) 4deg 4.6deg);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, transparent 35%, #000 75%); mask-image: radial-gradient(ellipse at 50% 45%, transparent 35%, #000 75%); }
body.boosting .speedlines { opacity: 1; animation: lines 0.12s steps(2) infinite; }
@keyframes lines { from { transform: rotate(0deg) scale(1.02); } to { transform: rotate(1.5deg) scale(1); } }
@media (max-width: 640px) { .boost-btn { width: 72px; height: 72px; font-size: 14px; } .hud-bottom { align-items: flex-end; } }
