:root { --bg: #06080c; --ink: #eef2f7; --dim: #a5afbf; --blue: #3b8bff; --orange: #ff8a2b; --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace; --sans: Geist, Inter, system-ui, sans-serif; }
@font-face { font-family: Geist; src: url(../fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; }
* { scrollbar-width: thin; scrollbar-color: #2a3242 #0a0d13; }
*::-webkit-scrollbar { width: 10px; height: 10px; } *::-webkit-scrollbar-track { background: #0a0d13; } *::-webkit-scrollbar-thumb { background: #2a3242; border-radius: 6px; border: 2px solid #0a0d13; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 700px at 50% 60%, #0d1420 0%, #06080c 70%); z-index: 20; transition: opacity .5s; }
#loading.done { opacity: 0; pointer-events: none; }
.box { width: min(640px, 92vw); text-align: center; }
.title { font-size: clamp(34px, 6vw, 64px); font-weight: 800; letter-spacing: .14em; margin: 0 0 14px; }
.title span { color: var(--blue); }
.load-bar { width: 260px; height: 3px; margin: 10px auto; background: #1b2230; } .load-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.sub { color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

/* the start screen: a menu column over the live arena, the stadium flying by behind it */
#start { position: fixed; inset: 0; z-index: 20; background: linear-gradient(90deg, #06080cf2 0%, #06080cd9 38%, #06080c00 100%); overflow-y: auto; }
.menu { width: min(540px, 92vw); margin: 0 auto 0 clamp(20px, 6vw, 96px); padding: clamp(22px, 4vh, 44px) 0 28px; display: flex; flex-direction: column; gap: 18px; min-height: 100%; justify-content: center; }
.brand { display: flex; justify-content: flex-start; margin: 0 0 2px; }
.logo { width: min(250px, 60vw); height: auto; border-radius: 14px; box-shadow: 0 12px 40px #000000aa; }
.mark { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 6px 18px #3b8bff33); }
.word { display: flex; flex-direction: column; font: 900 clamp(30px, 4.2vw, 44px)/0.92 var(--sans); letter-spacing: -0.02em; }
.word .w2 { color: var(--blue); }
.tag { margin: 0; color: #b6c0d0; font-size: 13.5px; line-height: 1.5; max-width: 42ch; text-wrap: pretty; }
.cars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.car { position: relative; text-align: left; background: #0d131dcc; border: 1px solid #263040; border-radius: 12px; padding: 14px 16px 14px 44px; color: var(--ink); cursor: pointer; font-family: var(--sans); transition: border-color .18s, background .18s, transform .18s cubic-bezier(.2,.8,.2,1); }
.car i { position: absolute; left: 16px; top: 17px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #3a4658; transition: border-color .18s, box-shadow .18s; }
.car b { display: block; font: 800 12px var(--sans); letter-spacing: .1em; margin-bottom: 5px; }
.car span { display: block; font-size: 11.5px; line-height: 1.45; color: #a5afbf; }
.car:hover { border-color: #3a4658; transform: translateY(-1px); }
.car:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.car.sel { border-color: var(--blue); background: #0f1a2ce6; }
.car.sel i { border-color: var(--blue); box-shadow: inset 0 0 0 4px #0f1a2c, inset 0 0 0 10px var(--blue); }
.car.sel b { color: var(--blue); }
.actions { display: grid; grid-template-columns: 1.5fr 1.15fr 0.9fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; height: 50px; padding: 0 20px; border-radius: 10px; border: 0; background: var(--blue); color: #061020; font: 800 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: transform .16s cubic-bezier(.2,.8,.2,1), filter .16s; box-shadow: 0 1px 0 #ffffff33 inset, 0 -2px 0 #00000033 inset; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn.primary { background: var(--orange); color: #1a0d02; }
.btn.ghost { background: #121a26; color: var(--ink); box-shadow: 0 0 0 1px #2c3647 inset; }
.btn.ghost:hover { background: #18212f; }
.btn.small { height: 34px; padding: 0 14px; font-size: 11px; }
.online { display: flex; flex-direction: column; gap: 10px; }
.fields { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }
.fields label { display: flex; flex-direction: column; gap: 6px; }
.fields span { font: 600 10px var(--mono); letter-spacing: .14em; color: #a5afbf; text-transform: uppercase; }
.fields span em { font-style: normal; color: var(--orange); text-transform: none; letter-spacing: .04em; margin-left: 6px; }
.fields input { height: 42px; background: #0d131dcc; border: 1px solid #263040; border-radius: 10px; padding: 0 13px; color: var(--ink); font: 500 13px var(--mono); outline: none; transition: border-color .16s, box-shadow .16s; }
.fields input::placeholder { color: #6f7b8d; }
.fields input:hover { border-color: #3a4658; }
.fields input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #3b8bff33; }
.search { display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 14px; border: 1px solid #ff8a2b66; border-radius: 10px; background: #1a120acc; font: 700 11px var(--mono); letter-spacing: .18em; }
.search i { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px var(--orange); animation: blink 1s steps(2) infinite; }
.search span { flex: 1; }
.lb { border: 1px solid #263040; border-radius: 12px; background: #0d131dcc; padding: 12px 14px 10px; }
.lbhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.lbhead b { font: 800 12px var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.lbhead span { font: 500 10.5px var(--mono); color: var(--orange); text-align: right; }
.lbcols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lbcols small { display: flex; justify-content: space-between; font: 600 10px var(--mono); letter-spacing: .14em; color: #a5afbf; text-transform: uppercase; margin-bottom: 4px; }
.lbcols em { font-style: normal; color: var(--ink); text-transform: none; letter-spacing: .04em; }
.lbcols ol { margin: 0; padding: 0; list-style: none; }
.lbcols li { display: flex; justify-content: space-between; gap: 8px; font: 500 12px var(--mono); padding: 4px 0; border-top: 1px solid #1a2230; }
.lbcols li:first-child { border-top: 0; }
.lbcols li b { font-weight: 800; min-width: 28px; text-align: right; }
.lbcols li .w { color: #8a94a6; font-size: 10px; }
.lbcols li.top { color: var(--orange); }
.lbcols li.empty { color: #8a94a6; font-size: 11px; }
.lblast { margin-top: 8px; font: 500 10.5px var(--mono); color: #a5afbf; }
.controls { border-top: 1px solid #1d2532; padding-top: 10px; }
.controls summary { cursor: pointer; font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #a5afbf; list-style: none; display: flex; align-items: center; gap: 8px; }
.controls summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .18s; }
.controls[open] summary::before { transform: rotate(45deg); }
.controls summary::-webkit-details-marker { display: none; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; margin-top: 12px; font-size: 12px; }
.keys div { display: flex; gap: 10px; align-items: baseline; }
.keys b { font-family: var(--mono); font-size: 11px; background: #141a25; border: 1px solid #27303f; border-radius: 4px; padding: 2px 7px; min-width: 56px; text-align: center; }
.keys span { color: #a5afbf; }
.foot { margin: 0; font: 400 10.5px var(--mono); color: #6f7b8d; letter-spacing: .04em; }
@media (max-width: 760px) { .cars, .actions, .fields, .lbcols, .keys { grid-template-columns: 1fr; } .menu { margin-left: 4vw; } .tag { margin-left: 0; } #start { background: #06080cf2; } }
@media (prefers-reduced-motion: reduce) { .btn, .car, .search i { transition: none; animation: none; } }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.score { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; font-family: var(--mono); filter: drop-shadow(0 8px 24px #000a); }
.team { display: flex; align-items: center; gap: 12px; padding: 8px 18px; background: linear-gradient(180deg, #121925ee, #0b1018ee); border: 1px solid #1d2532; }
.team b { font-size: 32px; font-weight: 800; min-width: 38px; text-align: center; display: inline-block; }
.team b.bump { animation: bump .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.7); color: #fff; } 100% { transform: scale(1); } }
.team .name { font-size: 11px; letter-spacing: .14em; color: var(--dim); }
.team.blue { border-right: 0; border-radius: 12px 0 0 12px; box-shadow: inset 0 -3px 0 var(--blue); }
.team.orange { border-left: 0; border-radius: 0 12px 12px 0; box-shadow: inset 0 -3px 0 var(--orange); }
.clock { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px 20px; background: #121a26ee; border: 1px solid #1d2532; }
.clock b { font-size: 28px; font-weight: 800; letter-spacing: .04em; }
.clock span { font-size: 10px; letter-spacing: .14em; color: var(--orange); min-height: 12px; }
.clock.ot b { color: var(--orange); } .clock.late b { color: #ff4d4d; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
.boost { position: absolute; right: 28px; bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring { position: relative; width: 118px; height: 118px; transition: filter .15s; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { fill: none; stroke: #1b2230; stroke-width: 9; }
.ring .arc { fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 180; transition: stroke-dashoffset .08s linear, stroke .2s; }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 32px var(--mono); transition: color .2s; }
.boost.on .ring { filter: drop-shadow(0 0 14px #ff8a2bcc); } .boost.on .ring .arc { stroke: #ffb060; }
.boost.empty .ring .arc { stroke: #553322; } .boost.empty .ring b { color: #6a4a3a; }
.boost.full .ring .arc { stroke: #ffd080; }
.lab { font: 600 10px var(--mono); letter-spacing: .18em; color: var(--dim); }
.hudkeys { position: absolute; right: 28px; bottom: 176px; display: grid; grid-template-columns: auto auto; gap: 4px 10px; padding: 10px 12px; background: #0b1018b8; border: 1px solid #1d2532; border-radius: 10px; font: 500 10.5px var(--mono); color: #c3cbd8; }
.hudkeys div { display: contents; }
.hudkeys b { font-weight: 700; color: var(--ink); background: #141a25; border: 1px solid #27303f; border-radius: 4px; padding: 1px 6px; text-align: center; min-width: 44px; }
.hudkeys span { align-self: center; }
@media (max-width: 760px) { .hudkeys { display: none; } }
.lab.dim { margin-top: 6px; letter-spacing: .1em; text-transform: none; }
.fps { position: absolute; right: 28px; top: 22px; font: 500 11px var(--mono); color: var(--dim); letter-spacing: .1em; }
.speed { position: absolute; left: 28px; bottom: 30px; display: flex; flex-direction: column; align-items: flex-start; transition: filter .15s; }
.speed b { font: 800 48px/1 var(--mono); transition: color .15s; }
.speed.sonic b { color: var(--orange); } .speed.sonic { filter: drop-shadow(0 0 16px #ff8a2b99); }
.chips { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; gap: 8px; }
.chips span { font: 600 10px var(--mono); letter-spacing: .16em; padding: 6px 10px; border: 1px solid #27303f; border-radius: 6px; background: #0b1018cc; color: var(--ink); transition: opacity .15s, box-shadow .15s; }
.chips span.off { opacity: .28; }
#chipSonic:not(.off) { border-color: var(--orange); color: var(--orange); box-shadow: 0 0 18px #ff8a2b66; }
.banner { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; white-space: nowrap; }
.banner span { font: 800 clamp(40px, 8vw, 96px) var(--sans); letter-spacing: .12em; text-transform: uppercase; text-shadow: 0 6px 40px #000, 0 0 40px currentColor; }
.banner small { font: 600 clamp(11px, 1.2vw, 14px) var(--mono); letter-spacing: .24em; color: var(--ink); text-transform: uppercase; opacity: .85; }
.banner.blue span { color: var(--blue); } .banner.orange span { color: var(--orange); }
.banner.pop span { animation: pop .55s cubic-bezier(.2, 1.4, .4, 1) both; } .banner.pop small { animation: rise .6s .15s ease-out both; }
@keyframes pop { 0% { transform: scale(2.2); opacity: 0; letter-spacing: .4em; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: .85; } }
.countdown { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); font: 800 140px var(--mono); text-shadow: 0 8px 40px #000, 0 0 50px #3b8bff88; }
.countdown.tick { animation: tick .9s ease-out both; }
@keyframes tick { 0% { transform: translateX(-50%) scale(1.8); opacity: 0; } 15% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(.85); opacity: .3; } }
.touch { position: absolute; top: 56%; left: 50%; transform: translateX(-50%); font: 800 16px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--ink); text-shadow: 0 0 20px currentColor; }
.touch.blue { color: var(--blue); } .touch.orange { color: var(--orange); }
.touch.pop { animation: touchpop 1.4s ease-out both; }
@keyframes touchpop { 0% { transform: translateX(-50%) scale(1.5); opacity: 0; } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-20px); } }
.replay { position: absolute; top: 22px; left: 28px; display: flex; align-items: center; gap: 10px; font: 700 13px var(--mono); letter-spacing: .3em; color: var(--ink); padding: 8px 14px; background: #0b1018cc; border: 1px solid #27303f; border-radius: 8px; }
.replay i { width: 10px; height: 10px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 12px #ff4d4d; animation: blink 1s steps(2) infinite; }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, #0000 55%, #ff8a2b22 85%, #ff8a2b55 100%); opacity: 0; transition: opacity .3s; }
#vignette.on { opacity: 1; }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 14; opacity: 0; background: #fff; }
.flash.on { animation: flash 1.1s ease-out both; } .flash.blue { background: radial-gradient(circle at 50% 50%, #fff 0%, #3b8bff 55%, #06080c 100%); } .flash.orange { background: radial-gradient(circle at 50% 50%, #fff 0%, #ff8a2b 55%, #06080c 100%); }
@keyframes flash { 0% { opacity: .8; } 100% { opacity: 0; } }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 15; } #fade.on { opacity: 1; }
#credit { position: fixed; right: 14px; bottom: 6px; font: 400 10px/1 var(--mono); color: var(--dim); letter-spacing: .04em; z-index: 10; }
@media (max-width: 760px) { .speed b { font-size: 32px; } .ring { width: 84px; height: 84px; } .countdown { font-size: 90px; } }
