[hidden] { display: none !important; }
:root {
  --bg0: #070a18; --bg1: #121a3a; --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.1);
  --line: rgba(255,255,255,.12); --text: #f8fafc; --muted: #94a3b8;
  --orange: #ff5a1f; --pink: #ec4899; --cyan: #22d3ee; --green: #22c55e; --yellow: #facc15; --red: #ef4444; --purple: #a855f7;
  --display: "Russo One", system-ui, sans-serif; --body: "Nunito", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #2a1660 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #3b0d2e 0%, transparent 55%), linear-gradient(180deg, var(--bg1), var(--bg0));
  background-attachment: fixed; color: var(--text); font: 600 16px/1.4 var(--body); overflow-x: hidden;
}
body::before { /* moving neon grid floor */
  content: ""; position: fixed; inset: 55% -50% -20% -50%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(236,72,153,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(34,211,238,.18) 1px, transparent 1px);
  background-size: 48px 48px; transform: perspective(500px) rotateX(62deg); animation: grid 2.4s linear infinite; mask-image: linear-gradient(transparent, #000 40%);
}
@keyframes grid { to { background-position: 0 48px; } }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h2 { font: 400 20px var(--display); margin: 0 0 12px; letter-spacing: .02em; display: flex; justify-content: space-between; align-items: baseline; }
h2 small, h3 { font: 700 13px var(--body); color: var(--muted); }
h3 { margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .08em; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; position: relative; }
.app.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(var(--shake), 0); } 40% { transform: translate(calc(var(--shake) * -1), 2px); } 60% { transform: translate(calc(var(--shake) * .6), -2px); } 80% { transform: translate(calc(var(--shake) * -.4), 0); } }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; align-items: center; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(180deg, rgba(7,10,24,.95), rgba(7,10,24,.7)); backdrop-filter: blur(10px); }
.lvl { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.lvl .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--yellow) calc(var(--p, 0) * 1%), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(circle, transparent 17px, #000 18px); mask: radial-gradient(circle, transparent 17px, #000 18px); }
.lvl b { font: 400 18px var(--display); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--pink)); box-shadow: 0 0 14px rgba(236,72,153,.6); }
.coinbox { flex: 1; display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; min-width: 0; transition: transform .1s; }
.coinbox.bump { transform: scale(1.08); }
.coinbox b { font: 400 20px var(--display); color: var(--yellow); text-shadow: 0 0 12px rgba(250,204,21,.5); }
.coinbox small { color: var(--green); font-weight: 800; font-size: 12px; margin-left: auto; white-space: nowrap; }
.event { font: 400 11px var(--display); background: linear-gradient(90deg, var(--orange), var(--pink)); padding: 4px 8px; border-radius: 8px; animation: glow 1.4s ease-in-out infinite alternate; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 20px; flex: none; }
.icon-btn i { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 99px; background: #475569; font: 800 12px/20px var(--body); font-style: normal; }
#crate-btn.has { animation: bob 1.2s ease-in-out infinite; } #crate-btn.has i { background: var(--red); }
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
@keyframes glow { from { box-shadow: 0 0 6px rgba(255,90,31,.5); } to { box-shadow: 0 0 18px rgba(236,72,153,.9); } }

/* view + nav */
.view { flex: 1; padding: 6px 12px 100px; }
.view.in > * { animation: rise .35s cubic-bezier(.2,1.2,.4,1) both; }
.view.in > *:nth-child(2) { animation-delay: .05s; } .view.in > *:nth-child(3) { animation-delay: .1s; } .view.in > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 25; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 10px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(7,10,24,.98), rgba(7,10,24,.85)); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 800 12px var(--body); color: var(--muted); padding: 6px 0; border-radius: 14px; position: relative; }
.nav button span { font-size: 22px; transition: transform .15s; }
.nav button.on { color: #fff; background: linear-gradient(180deg, rgba(255,90,31,.25), rgba(236,72,153,.12)); }
.nav button.on span { transform: translateY(-2px) scale(1.15); }
.nav button.dot::after { content: ""; position: absolute; top: 4px; right: 26%; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot { 50% { transform: scale(1.4); } }
.app.racing .nav, .app.racing .top { display: none; }
body:has(.app.racing) .toast { top: auto; bottom: 200px; }

/* cards + bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 12px 0; box-shadow: 0 10px 30px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.06); }
.label { font: 800 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.pbar { height: 8px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.pbar div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 99px; transition: width .4s; }

/* 3D buttons */
.btn-3d { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 400 16px var(--display); letter-spacing: .03em; padding: 12px 18px; border-radius: 16px; color: #fff;
  background: linear-gradient(180deg, #ff8a4c, var(--orange) 55%, #e2410c); box-shadow: 0 6px 0 #9a2a06, 0 10px 20px rgba(255,90,31,.35); transform: translateY(0); transition: transform .06s, box-shadow .06s; text-shadow: 0 2px 0 rgba(0,0,0,.25); user-select: none; }
.btn-3d:active { transform: translateY(5px); box-shadow: 0 1px 0 #9a2a06, 0 4px 10px rgba(255,90,31,.3); }
.btn-3d.big { width: 100%; font-size: 22px; padding: 16px; margin-top: 12px; }
.btn-3d.big small { font: 800 12px var(--body); background: rgba(0,0,0,.25); padding: 2px 8px; border-radius: 99px; }
.btn-3d.small { font-size: 13px; padding: 7px 10px; border-radius: 12px; box-shadow: 0 4px 0 #9a2a06; }
.btn-3d.ghost { background: linear-gradient(180deg, #334155, #1e293b); box-shadow: 0 6px 0 #0f172a; }
.btn-3d.off { filter: grayscale(.8) brightness(.7); }
.btn-3d.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 #9a2a06, 0 0 34px rgba(255,90,31,.85); transform: scale(1.02); } }

/* race hub */
.stage { position: relative; border-radius: 24px; margin-top: 8px; overflow: hidden; background: radial-gradient(circle at 50% 120%, rgba(255,255,255,.12), transparent 60%), linear-gradient(180deg, var(--c1), var(--c2)); border: 1px solid var(--line); }
.tier-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px; scrollbar-width: none; }
.tier-tabs::-webkit-scrollbar { display: none; }
.tt { font: 800 12px var(--body); padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.3); white-space: nowrap; }
.tt.on { background: #fff; color: #0b1020; }
.tt:disabled { opacity: .45; }
.hero-car { width: 100%; height: 170px; display: block; }
.car-name { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font: 400 15px var(--display); color: rgba(255,255,255,.85); letter-spacing: .08em; text-transform: uppercase; }
.rivals { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.rv { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,.07); border: 2px solid transparent; font: 400 16px var(--display); }
.rv.on { border-color: var(--rc); background: color-mix(in srgb, var(--rc) 35%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 60%, transparent); }
.rv.done { color: var(--green); }
.rv.boss { background: linear-gradient(135deg, rgba(250,204,21,.25), rgba(239,68,68,.25)); }
.rival-info { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; gap: 10px; }
.rname { font: 400 24px var(--display); }
.power { color: var(--muted); font-size: 13px; white-space: nowrap; } .power .up { color: var(--green); } .power .down { color: var(--red); }
.reward { font: 400 20px var(--display); color: var(--yellow); text-align: right; } .reward small { display: block; font: 800 11px var(--body); color: var(--pink); }
.tier-progress { height: 10px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.tier-progress div { height: 100%; background: linear-gradient(90deg, var(--orange), var(--pink)); border-radius: 99px; }
.tp-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mini-missions { cursor: pointer; } .mm-title { font: 400 15px var(--display); display: flex; justify-content: space-between; margin-bottom: 8px; } .mm-title span { color: var(--green); }
.mm { display: grid; grid-template-columns: 1fr 90px; gap: 10px; align-items: center; font-size: 13px; color: #cbd5e1; margin: 6px 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 6px; }
.stats-row b { display: block; font: 400 18px var(--display); } .stats-row span { font-size: 11px; color: var(--muted); }

/* race layer */
.race-layer { position: fixed; inset: 0; z-index: 40; background: #050714; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }
.race { position: relative; flex: 1; display: flex; flex-direction: column; }
.scene-wrap { position: relative; height: 52vh; min-height: 280px; touch-action: none; }
.scene { width: 100%; height: 100%; display: block; }
.race-top { position: absolute; top: 0; left: 0; right: 0; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.vs { font: 400 14px var(--display); text-align: center; text-shadow: 0 2px 6px #000; } .vs b { color: var(--yellow); margin: 0 6px; } .vs .me { color: var(--orange); } .vs .them { color: #e2e8f0; }
.dist { margin-top: 6px; display: grid; gap: 4px; } .bar { height: 5px; border-radius: 99px; background: var(--orange); width: 0; box-shadow: 0 0 8px var(--orange); } .bar.them { background: #94a3b8; box-shadow: none; }
.lights { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; padding: 10px 14px; background: rgba(0,0,0,.6); border-radius: 16px; transition: opacity .3s; }
.lights.off { opacity: 0; }
.lights i { width: 26px; height: 26px; border-radius: 50%; background: #3f0d0d; border: 2px solid #111; }
.lights i.on { background: radial-gradient(circle at 35% 35%, #fecaca, var(--red)); box-shadow: 0 0 20px var(--red); }
.lights i.g.on { background: radial-gradient(circle at 35% 35%, #bbf7d0, var(--green)); box-shadow: 0 0 26px var(--green); }
.race-banner { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font: 400 38px var(--display); opacity: 0; transform: scale(.6); pointer-events: none; text-shadow: 0 4px 0 rgba(0,0,0,.5); }
.race-banner.show { animation: banner .7s cubic-bezier(.2,1.6,.4,1) forwards; }
.race-banner.perfect { color: var(--green); text-shadow: 0 0 24px var(--green), 0 4px 0 #000; } .race-banner.good { color: var(--yellow); } .race-banner.bad { color: var(--red); } .race-banner.nitro { color: var(--cyan); text-shadow: 0 0 24px var(--cyan); } .race-banner.go { color: var(--green); font-size: 60px; }
@keyframes banner { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; transform: scale(1.15); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1) translateY(-20px); } }
.dash { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 6px 14px max(16px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 0%, #1e1b4b, #050714 70%); transition: background .1s; }
.dash.flash { background: radial-gradient(circle at 50% 0%, #14532d, #050714 70%); }
.shift-leds { display: flex; gap: 6px; margin: 8px 0 2px; } .shift-leds i { width: 18px; height: 8px; border-radius: 4px; background: #1f2937; }
.shift-leds i.g { background: var(--green); box-shadow: 0 0 10px var(--green); } .shift-leds i.y { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); } .shift-leds i.r { background: var(--red); box-shadow: 0 0 12px var(--red); }
.tacho { width: min(260px, 70vw, 26vh * 1.76); height: auto; }
.controls { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; width: 100%; margin-top: auto; }
.controls .btn-3d { font-size: 22px; padding: 22px 10px; border-radius: 22px; touch-action: manipulation; }
.controls .nitro { background: linear-gradient(180deg, #67e8f9, #06b6d4 55%, #0e7490); box-shadow: 0 7px 0 #164e63, 0 10px 24px rgba(34,211,238,.35); }
.controls .btn-3d:disabled { filter: grayscale(1) brightness(.5); }
.race-hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; } .race-hint .green { color: var(--green); }

/* results */
.result-panel { position: absolute; inset: auto 0 0 0; z-index: 5; background: linear-gradient(180deg, rgba(18,26,58,.97), #070a18); border-radius: 28px 28px 0 0; padding: 22px 18px max(20px, env(safe-area-inset-bottom)); text-align: center; transform: translateY(100%); transition: transform .45s cubic-bezier(.2,1.3,.4,1); border-top: 2px solid var(--line); }
.result-panel.in { transform: none; }
.res-title { font: 400 40px var(--display); } .win .res-title { color: var(--yellow); text-shadow: 0 0 30px rgba(250,204,21,.6); } .lose .res-title { color: #fda4af; }
.res-sub { color: var(--muted); margin-bottom: 14px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .res-grid div { background: var(--card); border-radius: 14px; padding: 10px 4px; } .res-grid b { display: block; font: 400 20px var(--display); } .res-grid span { font-size: 11px; color: var(--muted); }
.shift-chips { display: flex; gap: 6px; justify-content: center; margin: 12px 0; } .shift-chips i { width: 26px; height: 10px; border-radius: 5px; } .shift-chips .perfect { background: var(--green); box-shadow: 0 0 8px var(--green); } .shift-chips .good { background: var(--yellow); } .shift-chips .bad { background: var(--red); }
.res-coins { font: 400 32px var(--display); color: var(--yellow); margin: 6px 0; } .res-coins small { font: 800 14px var(--body); color: var(--purple); }
.res-crate { display: inline-block; margin: 6px 0; padding: 8px 14px; border-radius: 12px; font: 400 16px var(--display); background: color-mix(in srgb, var(--cc) 25%, transparent); border: 2px solid var(--cc); animation: bob 1s infinite; }
.res-tip { background: rgba(250,204,21,.12); border: 1px solid rgba(250,204,21,.35); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.res-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 12px; } .res-actions .btn-3d { margin: 0; width: 100%; }

/* garage */
.up { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.up:last-child { border: 0; }
.up-ico { font-size: 28px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, rgba(255,90,31,.25), rgba(168,85,247,.25)); }
.up-name { font: 400 16px var(--display); } .lv { font: 800 12px var(--body); color: var(--cyan); margin-left: 4px; }
.up-desc { font-size: 12px; color: var(--muted); }
.cards { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 12px; margin-top: 4px; color: #c4b5fd; } .cards .pbar div { background: linear-gradient(90deg, var(--purple), var(--pink)); }
.buy { font-size: 14px; padding: 10px 12px; min-width: 92px; }
.cars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.car-tile { background: rgba(0,0,0,.25); border: 2px solid transparent; border-radius: 16px; padding: 8px; text-align: center; }
.car-tile canvas { width: 100%; height: 70px; } .car-tile b { display: block; font: 400 13px var(--display); } .car-tile span { font-size: 11px; color: var(--muted); }
.car-tile.on { border-color: var(--orange); box-shadow: 0 0 18px rgba(255,90,31,.4); } .car-tile.locked { opacity: .6; }
.paints { display: flex; flex-wrap: wrap; gap: 10px; } .paint { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); } .paint.on { border-color: #fff; box-shadow: 0 0 12px #fff; }

/* empire */
.empire-hero { text-align: center; background: radial-gradient(circle at 50% 0%, rgba(250,204,21,.18), transparent 70%), var(--card); }
.big-num { font: 400 34px var(--display); color: var(--yellow); text-shadow: 0 0 20px rgba(250,204,21,.5); } .big-num small { font-size: 16px; color: var(--muted); }
.sub { font-size: 13px; color: var(--muted); margin: 4px 0; }
.wrench { margin: 14px auto 6px; width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; align-content: center; font-size: 56px; background: radial-gradient(circle at 35% 30%, #ffb38a, var(--orange) 55%, #9a2a06); box-shadow: 0 10px 0 #7c2306, 0 0 40px rgba(255,90,31,.5); touch-action: manipulation; user-select: none; }
.wrench span { font: 400 12px var(--display); letter-spacing: .06em; }
.wrench.hit { animation: squish .15s; } @keyframes squish { 50% { transform: scale(.92) translateY(6px); box-shadow: 0 4px 0 #7c2306, 0 0 60px rgba(255,90,31,.8); } }
.bld { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.b-ico { position: relative; font-size: 30px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: rgba(255,255,255,.08); }
.b-ico i { position: absolute; bottom: -6px; right: -6px; font: 800 12px var(--body); font-style: normal; background: var(--cyan); color: #04212a; border-radius: 99px; padding: 1px 7px; }
.b-main b { font: 400 15px var(--display); display: block; } .b-main span { font-size: 12px; color: var(--green); }
.bld.mystery { opacity: .5; } .bld.mystery .b-main span { color: var(--muted); }

/* rewards */
.cal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day { background: rgba(255,255,255,.06); border: 2px solid transparent; border-radius: 14px; padding: 8px 4px; text-align: center; }
.day span { font-size: 11px; color: var(--muted); display: block; } .day b { font-size: 24px; display: block; } .day small { font-size: 11px; font-weight: 800; color: var(--yellow); }
.day.got { opacity: .45; } .day.got::after { content: "✓"; display: block; color: var(--green); font-weight: 900; }
.day.now { border-color: var(--orange); background: rgba(255,90,31,.18); animation: glow 1s infinite alternate; }
.day.big { grid-column: span 2; background: linear-gradient(135deg, rgba(168,85,247,.3), rgba(236,72,153,.3)); }
.wheel-wrap { position: relative; width: min(300px, 80vw); margin: 0 auto; } .wheel-wrap canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
.pointer { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); font-size: 30px; color: var(--yellow); z-index: 2; text-shadow: 0 2px 6px #000; }
.mission { display: grid; grid-template-columns: 1fr 80px auto; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; } .mission small { color: var(--muted); } .mission.done span { color: var(--green); }
.ach { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .ach small { color: var(--muted); } .ach.got { opacity: .6; } .ach.ready { color: var(--yellow); }

/* modals */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(3,5,15,.75); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal.in { opacity: 1; }
.modal-card { width: 100%; max-width: 380px; background: linear-gradient(180deg, #1b2350, #0b1020); border: 1px solid var(--line); border-radius: 26px; padding: 22px; text-align: center; transform: scale(.85); transition: transform .3s cubic-bezier(.2,1.5,.4,1); }
.modal.in .modal-card { transform: none; }
.crate-stage { position: relative; overflow: hidden; padding: 20px 0; cursor: pointer; }
.crate { font-size: 110px; filter: drop-shadow(0 0 30px var(--cc)); transition: transform .3s; }
.crate.wobble { animation: wobble .3s; } @keyframes wobble { 25% { transform: rotate(-12deg) scale(1.08); } 75% { transform: rotate(12deg) scale(1.08); } }
.rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cc) 40%, transparent) 0 10deg, transparent 10deg 20deg); opacity: .25; animation: spin 8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.crate-stage.open .crate { transform: scale(.7) translateY(-10px); } .crate-stage.open .rays { opacity: .55; }
.crate-name { font: 400 22px var(--display); color: var(--cc); position: relative; } .tap-hint { color: var(--muted); animation: pulse-dot 1s infinite; position: relative; }
.crate-loot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; position: relative; }
.loot { width: 76px; padding: 8px 4px; border-radius: 14px; background: rgba(255,255,255,.1); animation: rise .4s cubic-bezier(.2,1.6,.4,1) both; } .loot span { font-size: 26px; display: block; } .loot b { font: 400 18px var(--display); display: block; } .loot small { font-size: 10px; color: var(--muted); }
.loot:nth-child(2) { animation-delay: .1s; } .loot:nth-child(3) { animation-delay: .2s; } .loot:nth-child(4) { animation-delay: .3s; } .loot:nth-child(5) { animation-delay: .4s; }
.lvl-badge { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font: 400 44px var(--display); background: linear-gradient(135deg, var(--purple), var(--pink)); box-shadow: 0 0 40px rgba(236,72,153,.7); animation: wobble .6s; }
.away-ico { font-size: 64px; } .warn { color: var(--yellow); font-size: 13px; }

/* fx */
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
.float-text { position: fixed; z-index: 81; pointer-events: none; font-family: var(--display); transform: translate(-50%, 0); text-shadow: 0 2px 0 rgba(0,0,0,.5); animation: floatup 1.1s ease-out forwards; }
@keyframes floatup { to { transform: translate(-50%, -70px); opacity: 0; } }
.toast { position: fixed; z-index: 90; left: 50%; top: 70px; bottom: auto; transform: translate(-50%, -20px); opacity: 0; max-width: 92vw; width: max-content; background: rgba(15,23,42,.95); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: all .3s cubic-bezier(.2,1.4,.4,1); text-align: center; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 0 96px; } .foot a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* highway race HUD */
.pos { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.place { font: 400 26px var(--display); color: #e2e8f0; text-shadow: 0 2px 6px #000; } .place.first { color: var(--yellow); text-shadow: 0 0 14px rgba(250,204,21,.7); }
.pos .left { font: 400 15px var(--display); text-shadow: 0 2px 6px #000; }
.pops { position: absolute; left: 0; right: 0; top: 46%; display: grid; justify-items: center; pointer-events: none; }
.pop { font: 400 18px var(--display); padding: 4px 12px; border-radius: 99px; animation: popup .9s ease-out forwards; }
.pop.nm { color: #04212a; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); } .pop.ot { color: #1a1300; background: var(--yellow); } .pop.ss { color: var(--cyan); background: rgba(0,0,0,.5); font-size: 14px; }
@keyframes popup { 0% { transform: scale(.5); opacity: 0; } 20% { transform: scale(1.15); opacity: 1; } 100% { transform: translateY(-50px); opacity: 0; } }
.lane-btn { position: absolute; bottom: 12px; width: 64px; height: 64px; border-radius: 50%; font-size: 26px; color: #fff; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.25); backdrop-filter: blur(4px); touch-action: manipulation; }
.lane-btn:active { background: rgba(255,90,31,.5); } .lane-btn.l { left: 10px; } .lane-btn.r { right: 10px; }
.nitro-meter { position: relative; width: 100%; max-width: 360px; height: 16px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; margin: 4px 0 10px; }
.nitro-meter .fill { height: 100%; width: 0; background: linear-gradient(90deg, #0e7490, var(--cyan)); transition: width .15s; }
.nitro-meter.ready .fill { box-shadow: 0 0 14px var(--cyan); }
.nitro-meter span { position: absolute; inset: 0; display: grid; place-items: center; font: 400 10px var(--display); letter-spacing: .2em; }
.race-hint .keys { display: none; }
@media (hover: hover) and (pointer: fine) { .race-hint .keys { display: inline; } }

/* ---------- laptop / desktop (phone layout above stays the default) */
@media (min-width: 900px) {
  .app { max-width: 1100px; }
  .top { border-radius: 0 0 20px 20px; }
  .view { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 20px; align-items: start; padding: 10px 20px 110px; }
  .view > .stage { grid-column: 1 / -1; }
  .hero-car { height: 260px; }
  .nav { max-width: 620px; border-radius: 22px 22px 0 0; border: 1px solid var(--line); }
  .cars { grid-template-columns: repeat(3, 1fr); }
  .race-layer { max-width: none; }
  .race { flex-direction: row; }
  .scene-wrap { flex: 1; height: 100vh; }
  .dash { flex: none; width: 400px; justify-content: center; border-left: 1px solid var(--line); }
  .tacho { width: 320px; }
  .controls { margin-top: 18px; }
  .lane-btn { width: 54px; height: 54px; opacity: .7; }
  .result-panel { left: 50%; right: auto; width: 520px; transform: translate(-50%, 110%); border-radius: 28px; bottom: 24px; border: 2px solid var(--line); }
  .result-panel.in { transform: translate(-50%, 0); }
  .toast { top: 84px; }
}

/* how to play + coaching */
.howto-link { display: block; margin: 12px auto 0; font: 800 14px var(--body); color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.howto { text-align: left; } .howto h2 { justify-content: center; font-size: 24px; }
.hstep { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hico { position: relative; font-size: 30px; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(255,90,31,.3), rgba(168,85,247,.3)); }
.hico b { position: absolute; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); font: 400 12px/22px var(--display); text-align: center; }
.hstep strong { font: 400 16px var(--display); } .hstep p { margin: 2px 0 0; font-size: 14px; color: #cbd5e1; }
.hnote { font-size: 13px; color: var(--yellow); text-align: center; margin: 12px 0 0; }
.coach { position: absolute; left: 50%; bottom: 86px; transform: translateX(-50%); width: max-content; max-width: 92%; text-align: center; font: 400 17px var(--display); color: #fff; background: rgba(15,23,42,.85); border: 2px solid var(--yellow); border-radius: 14px; padding: 8px 14px; box-shadow: 0 0 20px rgba(250,204,21,.35); pointer-events: none; }
.coach-pulse { animation: coachp .6s ease-in-out infinite !important; }
@keyframes coachp { 50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(250,204,21,.6), 0 0 30px rgba(250,204,21,.8); } }
