@font-face{font-family:Race;src:url('./assets/race-font.ttf') format('truetype');font-weight:900;font-display:swap}
:root{--navy:#103948;--navy-deep:#092c3c;--cream:#fff0c5;--coral:#fa6148;--teal:#22c5ca;--gold:#ffd266;--safe-left:max(20px,env(safe-area-inset-left));--safe-right:max(20px,env(safe-area-inset-right));--safe-top:max(16px,env(safe-area-inset-top));--safe-bottom:max(16px,env(safe-area-inset-bottom))}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#153c4b;color:var(--cream);font-family:Race,Arial,sans-serif;font-weight:900}body{touch-action:none;user-select:none;-webkit-user-select:none}button,input{font:inherit}button{border:0;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:4px solid var(--gold);outline-offset:4px}button:active{transform:translateY(3px) scale(.98)}button:disabled{cursor:default;opacity:.4}svg{width:1.15em;height:1.15em;fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}svg.svg-defs{position:absolute;width:0;height:0;pointer-events:none}[hidden]{display:none!important}
#world,#menu-art,#shade,#speed-lines{position:absolute;inset:0;width:100%;height:100%}#world{display:block}#menu-art{background:url('./assets/menu.webp') center center/cover no-repeat;opacity:0;pointer-events:none;transition:opacity .35s}body[data-state=menu] #menu-art{opacity:1}#shade{background:linear-gradient(90deg,rgba(4,29,45,.5),transparent 65%);opacity:0;pointer-events:none;transition:opacity .2s}body[data-state=menu] #shade{opacity:1}body[data-state=tracks] #shade,body[data-state=settings] #shade,body[data-state=help] #shade,body[data-state=pause] #shade,body[data-state=results] #shade{opacity:1;background:linear-gradient(180deg,#092d3cc9,#092d3cb8);backdrop-filter:blur(5px)}#app{position:absolute;inset:0;pointer-events:none}#app>*{pointer-events:auto}.button,.circle,.panel{background:linear-gradient(#194757,#0b3041);border:3px solid #092f40;box-shadow:inset 0 2px 0 #99bac46b,0 5px 0 #08283970}.button{display:inline-flex;align-items:center;justify-content:center;gap:.4em;padding:.48em 1em;min-height:48px;border-radius:999px;font-size:clamp(17px,2.2vw,30px);text-transform:uppercase;letter-spacing:-.6px;font-style:italic;text-shadow:0 2px #08273670;white-space:nowrap}.button.primary{background:linear-gradient(#ff805a,#ef503c);border-color:#123c49;box-shadow:inset 0 2px #ffbb86,0 5px 0 #062d3bcc}.button.primary svg{color:#fff3cc}.button.small{font-size:14px;min-height:38px}.button svg{color:var(--teal);font-size:1.1em}.circle{display:grid;place-items:center;width:50px;height:50px;border-radius:50%;font-size:25px;flex-shrink:0}.circle svg{width:25px;height:25px}.gold{color:var(--gold)}.teal{color:var(--teal)}.eyebrow{font-size:11px;letter-spacing:2.4px;color:#84d6d4;text-transform:uppercase}.display{font-style:italic;line-height:.99;letter-spacing:-2px;text-transform:uppercase;text-shadow:0 4px #0a2e3b}h1,h2,h3,p{margin:0}h1{font-size:clamp(26px,4.6vw,54px)}h2{font-size:clamp(24px,3.7vw,44px)}.menu{position:absolute;left:4.6vw;top:8%;width:43%;max-width:640px;height:85%;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:2.4vh}.wordmark{width:100%;height:auto;overflow:visible;filter:drop-shadow(0 6px 0 #062a3bd9);margin-bottom:1.5vh}.menu .race-big{font-size:clamp(32px,5.2vw,76px);min-height:16vh;border-width:4px}.menu-secondary{display:flex;gap:12px}.menu-secondary .button{flex:1;min-width:0;padding:.55em .5em;font-size:clamp(16px,2.2vw,32px)}.menu-footer{display:flex;align-items:center;gap:12px;margin-top:2vh}.menu .language{font-size:13px;min-height:37px;padding:.5em 1em}.menu .help{font-size:13px;min-height:37px}.top-settings{position:absolute;top:var(--safe-top);right:var(--safe-right)}.subtle-note{position:absolute;right:var(--safe-right);bottom:var(--safe-bottom);color:#ffefcfb0;text-shadow:0 2px #112e3b;font:700 11px Arial;letter-spacing:1px;text-transform:uppercase}
.screen{position:absolute;inset:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);display:flex;flex-direction:column;gap:16px}.screen-header{display:flex;align-items:center;gap:15px;flex-shrink:0}.screen-header .mode-label{margin-left:auto;font-style:italic;font-size:12px;background:var(--navy);padding:8px 14px;border-radius:25px;white-space:nowrap}.track-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(10px,2vw,25px);flex:1;min-height:0;padding:0 1vw}.track-card{position:relative;overflow:hidden;border:3px solid #062e3b;background:var(--navy);border-radius:24px;display:flex;flex-direction:column;box-shadow:0 7px 0 #072d3e80,inset 0 1px #ace0df;transition:transform .15s,border-color .15s;padding:0;text-align:center}.track-card.selected{border-color:var(--coral);box-shadow:0 0 0 2px var(--cream),0 7px 0 #08273890}.track-card .art{flex:1;min-height:0;width:100%;background-size:auto 150%;background-position:50% 46%;position:relative}.track-card .art:after{content:'';position:absolute;inset:0;background:linear-gradient(transparent 65%,#113947aa)}.track-card .check{position:absolute;right:10px;top:10px;width:35px;height:35px;background:var(--coral);border:3px solid var(--cream);border-radius:50%;display:none;place-items:center}.track-card.selected .check{display:grid}.track-card .check svg{width:21px;height:21px}.track-info{padding:10px 8px 13px}.track-info h3{font-style:italic;font-size:clamp(15px,2.3vw,30px);letter-spacing:-1px;line-height:1.1}.difficulty{font-size:10px;display:inline-block;margin-top:7px;padding:4px 16px;border-radius:20px;color:#143e49;background:#73d8b9;letter-spacing:.3px}.track-card:nth-child(2) .difficulty{background:#ffce66}.track-card:nth-child(3) .difficulty{background:#fa8977}.track-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:0 1vw}.race-format{font-size:13px;font-style:italic}.race-format span{display:block;color:#8dd0d0;font-size:10px;letter-spacing:2px;margin-top:4px}.track-footer .button{min-width:23%;font-size:clamp(20px,3vw,38px)}.cup-info{position:absolute;left:50%;transform:translateX(-50%);font-size:12px;color:var(--gold)}
.garage-layout{display:flex;flex:1;gap:24px;align-items:center;min-height:0}.garage-stage{flex:1;align-self:stretch;position:relative}.garage-stage .driver-portraits{position:absolute;bottom:0;left:0;display:flex;gap:8px}.driver-button{width:75px;height:75px;border:3px solid #a3cbc4;border-radius:17px;position:relative;background:linear-gradient(#4f8a8d,#183e4d);font-size:13px;overflow:hidden}.driver-button.selected{border-color:var(--coral);box-shadow:0 0 0 2px var(--cream)}.driver-button canvas{width:100%;height:100%;position:absolute;inset:0}.driver-button span{position:absolute;inset:auto 0 2px;font-size:10px;background:#123c49b0}.garage-detail{width:30%;max-width:360px;align-self:center;padding:25px;border-radius:25px}.garage-detail h2{margin-bottom:8px}.garage-detail .role{font-size:12px;color:#9fd4d2;margin-bottom:20px}.garage-detail hr{border:0;border-top:1px solid #699b9b6b;margin:18px 0}.swatches{display:flex;gap:12px;margin:12px 0 20px}.swatch{width:42px;height:42px;border-radius:50%;background:var(--swatch);border:2px solid var(--cream);box-shadow:0 0 0 2px #062e3b;display:grid;place-items:center}.swatch.selected{outline:3px solid var(--teal);outline-offset:3px}.garage-detail .button{width:100%;font-size:22px}.garage-note{font:600 12px/1.5 Arial;color:#cae3da;margin-top:15px}
.settings-layout{flex:1;display:flex;align-items:center;justify-content:center;gap:7vw;min-height:0}.pause-actions{width:36%;max-width:450px;display:flex;flex-direction:column;gap:14px}.pause-actions h1{font-size:clamp(36px,6vw,80px);margin-bottom:10px}.pause-actions .button{justify-content:flex-start;padding-left:1.2em}.settings-panel{width:44%;max-width:550px;padding:clamp(15px,2.5vw,32px);border-radius:26px}.settings-panel h2{display:flex;align-items:center;gap:10px;font-size:clamp(20px,2.9vw,34px);margin-bottom:12px;white-space:nowrap}.setting-row{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:12px 0;border-bottom:1px solid #699b9b4d;font-size:clamp(10px,1.5vw,17px);text-transform:uppercase;font-style:italic}.setting-row:last-child{border:0}.toggle{border-radius:30px;background:#325966;width:66px;height:29px;display:flex;align-items:center;justify-content:space-between;font-size:11px;padding:4px 6px;color:#b9cbca}.toggle i{width:20px;height:20px;background:var(--cream);border-radius:50%;order:-1}.toggle.on{background:#10a8b5;color:var(--cream)}.toggle.on i{order:1}.segmented{display:flex;border:2px solid #719b9e;border-radius:20px;overflow:hidden}.segmented button{border:0;background:#244957;font-size:10px;padding:6px 11px;color:#aacbcb}.segmented button.selected{background:var(--coral);color:var(--cream)}input[type=range]{width:43%;accent-color:var(--cream);height:5px;cursor:pointer}.settings-bottom{display:flex;justify-content:space-between;margin-top:12px}.settings-bottom .button{font-size:10px;padding:6px 10px;min-height:29px}.help-panel{width:90%;max-width:1100px;margin:auto;display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.help-card{padding:24px;border-radius:22px}.help-card strong{font-size:20px;font-style:italic;color:var(--gold);display:block;margin-bottom:12px}.help-card p{font:600 14px/1.65 Arial;color:#d8e6dd}.help-card svg{width:44px;height:44px;color:var(--teal);margin-bottom:10px}.help-footer{font:700 13px/1.7 Arial;text-align:center;color:#bfe0da;padding:15px}kbd{border-radius:5px;padding:3px 6px;background:#275563;color:#ffebc2;font:bold 12px Arial}
#hud{position:absolute;inset:0;pointer-events:none;font-style:italic}#hud button,#touch-steer{pointer-events:auto}.rank{position:absolute;left:var(--safe-left);top:var(--safe-top);display:flex;align-items:baseline;background:linear-gradient(#154756,#0b3040);border-radius:22px;padding:1px 15px 8px;border:2px solid #2d5c6850;box-shadow:0 3px 0 #072d3d40}.rank strong{font-size:clamp(48px,7.4vw,95px);line-height:1;letter-spacing:-4px;transform:skew(-6deg)}.rank small{font-size:clamp(17px,2.5vw,31px);letter-spacing:-1px}.race-top{position:absolute;right:var(--safe-right);top:var(--safe-top);display:flex;align-items:center;gap:12px}.lap{display:flex;align-items:baseline;gap:5px;font-size:clamp(15px,2.1vw,26px);padding:7px 15px;background:linear-gradient(#154756,#0b3040);border-radius:40px}.lap strong{color:var(--gold);font-size:1.5em;line-height:1}.race-time{position:absolute;left:var(--safe-left);top:calc(var(--safe-top) + clamp(62px,8.3vw,109px));font-size:12px;text-shadow:0 2px 2px #002c3b;opacity:.85}.touch-steer{position:absolute;left:var(--safe-left);bottom:var(--safe-bottom);width:clamp(140px,19vw,280px);height:clamp(52px,7vw,82px);border-radius:60px;background:linear-gradient(#1d495ddd,#0c2b3bd9);box-shadow:inset 0 0 0 7px #648a8d36,0 2px 0 #092c3a66;border:2px solid #102f3ea6;touch-action:none;display:flex;align-items:center;justify-content:space-between;padding:0 21px;color:#6e9cb0;font:900 55px/1 Arial}.touch-steer #steer-thumb{position:absolute;width:clamp(38px,5.1vw,63px);height:clamp(38px,5.1vw,63px);border-radius:50%;left:50%;top:50%;transform:translate(-50%,-50%);background:var(--cream);box-shadow:inset 0 0 0 3px #ffda96,0 3px 0 #082b3f55;pointer-events:none}.touch-steer.active{border-color:var(--teal)}.race-actions{position:absolute;right:var(--safe-right);bottom:var(--safe-bottom);display:flex;align-items:flex-end;gap:16px}.race-actions button{display:grid;place-items:center;position:relative;border-radius:50%;border:4px solid var(--navy-deep);box-shadow:inset 0 0 0 3px #ffdc9990,0 4px 0 #092c3a50}.race-actions #item-button{width:clamp(56px,7vw,94px);height:clamp(56px,7vw,94px);background:var(--cream);color:var(--navy);margin-bottom:6px}.race-actions #item-button svg{width:72%;height:72%}.race-actions #item-button.empty{opacity:.65;background:#153f4cd6;box-shadow:inset 0 0 0 2px #698e8e30}.race-actions #item-button.empty svg{opacity:.2}.race-actions #boost-button{width:clamp(82px,10vw,133px);height:clamp(82px,10vw,133px);background:linear-gradient(#ff7d55,#ec533e);font-size:clamp(16px,2vw,27px);font-style:italic;padding:0}.race-actions #boost-button.active{background:linear-gradient(#41d8db,#1687a4);box-shadow:inset 0 0 0 3px #6df1e4,0 4px 0 #092c3a50}.race-actions small{position:absolute;bottom:10%;font:bold 9px Arial;opacity:.6;letter-spacing:1px}.race-actions #item-key{bottom:-18px;color:var(--cream)}.charge-ring{position:absolute;inset:-4px;width:calc(100% + 8px);height:calc(100% + 8px);transform:rotate(-90deg);pointer-events:none;stroke-width:4}.charge-ring circle{stroke:var(--teal);stroke-dasharray:289;stroke-dashoffset:289;fill:none;transition:stroke-dashoffset .1s;stroke-linecap:round}.charge-ring.charged circle{stroke:var(--gold)}.speed{position:absolute;bottom:var(--safe-bottom);left:50%;transform:translateX(-50%);font-style:italic;text-shadow:0 2px 3px #0c334a;opacity:.85;display:flex;align-items:baseline;gap:4px}.speed strong{font-size:21px;letter-spacing:-1px}.speed span{font-size:10px}.driving-hint{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(var(--safe-bottom) + 33px);font:700 11px Arial;color:#fff2d1;white-space:nowrap;text-shadow:0 2px 4px #092d3b;opacity:.85}#callout{position:absolute;left:50%;top:23%;transform:translateX(-50%) rotate(-3deg);white-space:nowrap;font-size:clamp(24px,4.8vw,64px);color:var(--cream);text-shadow:3px 4px 0 #0b3c4d,-2px -2px #0b3c4d,2px -2px #0b3c4d;letter-spacing:-1px;text-align:center}#callout.countdown{font-size:clamp(90px,17vw,160px);top:29%;color:var(--gold)}#callout.boost{color:var(--gold)}#callout small{font-size:14px;display:block;letter-spacing:1px;text-shadow:0 2px 2px #0b3c4d}#item-name{position:absolute;bottom:calc(var(--safe-bottom) + clamp(100px,13vw,160px));right:var(--safe-right);font-size:12px;text-shadow:0 2px 4px #0b3544;color:var(--gold)}#incoming{position:absolute;right:var(--safe-right);top:34%;background:var(--coral);padding:6px;border:3px solid var(--navy);border-radius:15px;animation:warning .4s infinite alternate}#incoming svg{width:32px;height:32px}#incoming span{font-size:30px}#minimap{position:absolute;right:var(--safe-right);top:calc(var(--safe-top) + 65px);width:clamp(110px,16vw,200px);height:auto;opacity:.8}#speed-lines{pointer-events:none;background:radial-gradient(ellipse at center,transparent 45%,#ffe69a10 65%,#fff5d42a);opacity:0;transition:opacity .2s}body.boosting #speed-lines{opacity:1}
.results-layout{display:grid;grid-template-columns:1fr 1fr;gap:6vw;flex:1;min-height:0}.result-celebration{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;position:relative}.result-celebration h1{font-size:clamp(42px,8vw,108px);letter-spacing:-4px;z-index:1}.result-celebration .result-time{color:var(--gold);font-size:clamp(22px,3.8vw,48px);margin:12px 0}.result-celebration .best-lap{font-size:12px}.result-celebration .trophy{width:clamp(75px,12vw,160px);height:clamp(75px,12vw,160px);color:var(--gold);filter:drop-shadow(0 6px #724d23);margin-top:15px}.standings{border-radius:25px;padding:14px 18px;display:flex;flex-direction:column;gap:4px}.standings h2{font-size:clamp(20px,2.8vw,34px);font-style:italic;margin-bottom:6px}.standing{display:flex;align-items:center;padding:6px 12px;border:1px solid #668f9455;border-radius:30px;font-style:italic;font-size:clamp(12px,1.8vw,20px);gap:15px;flex:1}.standing strong{width:20px;color:var(--gold)}.standing time{margin-left:auto;font:700 11px Arial;color:#b7d4ce}.standing.player{background:var(--coral);border-color:#ffc393}.standing.player strong,.standing.player time{color:var(--cream)}.result-footer{display:flex;justify-content:flex-end;gap:16px}.result-footer .button{font-size:clamp(16px,2.7vw,32px)}.cup-score{font-size:12px;margin-top:12px;color:#72d5d1}.confetti{position:absolute;inset:-20px;overflow:hidden;pointer-events:none}.confetti i{position:absolute;width:7px;height:14px;top:-30px;animation:confetti 4s linear infinite}
#loading{position:absolute;inset:0;background:#113c4b;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;z-index:50;transition:opacity .3s}.loading-mark{font-size:80px;letter-spacing:-9px;font-style:italic;position:relative}.loading-mark span{color:var(--teal);position:absolute;top:-10px;right:-37px;font-size:45px}.loading-bar{width:180px;height:7px;background:#335c67;border-radius:20px;overflow:hidden}.loading-bar i{display:block;width:45%;height:100%;background:var(--coral);border-radius:20px;animation:load 1s infinite alternate}.loading p{font-size:12px}#error{position:absolute;inset:0;background:var(--navy);z-index:100;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:20px;text-align:center;padding:30px}#error h1{font-size:32px}#error p{max-width:650px;font:500 16px/1.6 Arial}#error button,#rotate-hint button{padding:12px 30px;background:var(--coral);color:var(--cream);border-radius:30px;font-size:20px}#rotate-hint{position:absolute;inset:0;background:#0b3041ef;z-index:55;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:25px;padding:30px;text-align:center}#rotate-hint>span{font:normal 100px Arial;color:var(--teal)}
@keyframes load{to{transform:translateX(125%)}}@keyframes warning{to{transform:scale(1.09)}}@keyframes confetti{to{transform:translateY(110vh) rotate(720deg)}}
@media(pointer:coarse){#item-key,#boost-key{display:none}.race-actions #item-button{margin-bottom:0}}
@media(max-height:500px) and (orientation:landscape){:root{--safe-top:max(10px,env(safe-area-inset-top));--safe-bottom:max(10px,env(safe-area-inset-bottom));--safe-left:max(14px,env(safe-area-inset-left));--safe-right:max(14px,env(safe-area-inset-right))}.screen{gap:10px}.circle{width:38px;height:38px}.circle svg{width:21px;height:21px}.screen-header{gap:10px}.screen-header h1{font-size:29px}.track-info{padding:7px}.track-info h3{font-size:17px}.difficulty{margin-top:4px;font-size:8px;padding:2px 12px}.track-card{border-radius:18px}.track-footer .button{font-size:22px;min-height:40px}.track-footer{min-height:42px}.race-format{font-size:10px}.race-format span{font-size:8px}.settings-panel{padding:12px 20px}.settings-panel h2{font-size:22px;margin-bottom:5px}.setting-row{padding:8px 0;font-size:11px}.pause-actions{gap:9px}.pause-actions h1{margin-bottom:6px}.pause-actions .button{font-size:21px;min-height:44px}.help-card{padding:17px}.help-card p{font-size:12px;line-height:1.5}.help-card strong{font-size:17px}.help-card svg{width:32px;height:32px}.help-footer{font-size:11px;padding:4px}.garage-detail{padding:15px 20px}.garage-detail h2{font-size:28px}.garage-detail .role{margin-bottom:8px}.garage-detail hr{margin:10px 0}.garage-note{font-size:10px}.driver-button{width:60px;height:60px}.swatches{margin:8px 0 15px}.swatch{width:30px;height:30px}.garage-detail .button{font-size:18px;min-height:38px}.garage-detail .eyebrow{font-size:9px}.rank strong{font-size:56px}.rank small{font-size:20px}.rank{padding:2px 12px 7px}.lap{font-size:18px;padding:5px 12px}.race-time{top:80px;font-size:10px}#minimap{top:60px;width:130px}.speed strong{font-size:17px}.driving-hint{font-size:10px}.result-celebration .trophy{width:64px;height:64px;margin-top:5px}.result-celebration .result-time{margin:5px 0}.standings{padding:10px 15px;gap:2px}.standing{padding:3px 8px;font-size:13px}.standings h2{font-size:22px;margin-bottom:2px}.standing time{font-size:10px}.result-footer .button{font-size:19px;min-height:42px}.settings-bottom{margin-top:6px}}
@media(orientation:portrait){.menu{width:85%;left:7.5%;height:53%;top:auto;bottom:5%;gap:12px}.menu .wordmark{width:87%;margin-bottom:0}.menu .race-big{min-height:78px;font-size:40px}.menu-secondary .button{font-size:20px}.menu-footer{margin-top:4px}#menu-art{background-position:64% center}body[data-state=menu] #shade{background:linear-gradient(transparent 20%,#092e3bd9 60%)}.top-settings{width:45px;height:45px}.subtle-note{display:none}.track-grid{grid-template-columns:1fr;gap:12px}.track-card{flex-direction:row;border-radius:18px;min-height:0}.track-card .art{width:44%;height:100%;flex:none;background-size:auto 165%}.track-info{flex:1;display:flex;flex-direction:column;justify-content:center}.track-info h3{font-size:21px}.track-card .check{width:25px;height:25px;left:10px;top:10px}.track-card .check svg{width:15px;height:15px}.track-footer{flex-wrap:wrap}.track-footer .button{min-width:45%;font-size:24px}.cup-info{position:static;transform:none;font-size:10px}.screen-header h1{font-size:26px;letter-spacing:-1px}.screen-header .mode-label{font-size:9px;padding:7px 10px}.screen{gap:17px}.settings-layout{flex-direction:column;gap:20px;justify-content:space-around}.pause-actions,.settings-panel{width:95%;max-width:500px}.pause-actions{gap:10px}.pause-actions h1{font-size:48px;margin:0 0 10px}.pause-actions .button{min-height:48px;font-size:23px}.settings-panel{padding:18px 22px}.settings-panel h2{font-size:23px}.setting-row{font-size:12px;padding:12px 0}.help-panel{grid-template-columns:1fr;gap:10px}.help-card{padding:16px 20px}.help-card p{font-size:13px;line-height:1.5}.help-card svg{float:left;width:35px;height:35px;margin-right:14px}.help-card strong{font-size:19px;margin-bottom:6px}.help-footer{font-size:12px;padding:0 10px}.garage-layout{flex-direction:column;gap:10px}.garage-stage{min-height:220px}.garage-detail{width:100%;max-width:none;padding:20px}.garage-detail .role{margin-bottom:8px}.garage-detail hr{margin:10px 0}.garage-detail .button{width:auto;float:right;margin-top:-58px}.garage-note{clear:both}.driver-button{width:65px;height:65px}.driver-portraits{right:0;justify-content:center}.results-layout{grid-template-columns:1fr;gap:15px}.result-celebration h1{font-size:46px;letter-spacing:-2px}.result-celebration .result-time{font-size:28px;margin:6px}.result-celebration .trophy{display:none}.result-celebration{flex:none}.standings h2{font-size:24px}.standing{font-size:14px;padding:7px 10px}.result-footer{gap:8px}.result-footer .button{font-size:16px;padding:.6em .7em;flex:1}.rank strong{font-size:54px}.lap{font-size:17px}.race-top{gap:7px}.race-top .circle{width:40px;height:40px}.touch-steer{width:151px;height:60px;padding:0 15px}.touch-steer #steer-thumb{width:43px;height:43px}.race-actions{gap:9px}.race-actions #boost-button{width:82px;height:82px;font-size:16px}.race-actions #item-button{width:53px;height:53px}.driving-hint{bottom:calc(var(--safe-bottom) + 102px);white-space:normal;text-align:center;width:80%;font-size:11px}.speed{bottom:calc(var(--safe-bottom) + 75px)}#minimap{width:125px;top:70px}.race-time{top:85px}.race-time{font-size:10px}#callout{font-size:32px;top:25%}.race-format{font-size:10px}}
@media(prefers-reduced-motion:reduce){*{animation-duration:.001ms!important;transition-duration:.001ms!important}#speed-lines{display:none}}
@media(max-height:500px) and (orientation:landscape){.menu{top:5%;height:90%;gap:2vh}.menu .wordmark{height:36vh;flex:none;width:100%;margin-bottom:0}.menu .race-big{min-height:17vh;font-size:5.3vw}.menu-secondary .button{min-height:45px}.menu-footer{margin-top:0}.menu .language,.menu .help{min-height:30px;font-size:10px;padding:5px 12px}}
/* The garage uses actual race models, lit on a dedicated rotating studio stage. */
.garage-screen{gap:12px}.garage-content{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(350px,1fr);flex:1;min-height:0;gap:3vw}.ride-showcase{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column}#racer-stage{flex:1;min-height:0;cursor:grab;touch-action:none}#racer-stage:active{cursor:grabbing}.showcase-label{padding:0 20px 14px;text-align:center;pointer-events:none}.showcase-label h2{font-size:clamp(30px,4vw,60px);margin:7px 0 4px}.showcase-label>p{font-size:clamp(13px,1.5vw,21px);color:#f8d37d;font-style:italic}.showcase-label .eyebrow{font-size:9px;letter-spacing:2px}.rotate-model{display:block;color:#9cc1c3;font:700 10px Arial;letter-spacing:1px;margin-top:9px}.ride-picker{min-height:0;display:flex;flex-direction:column;gap:12px;padding:16px 20px;background:linear-gradient(145deg,#164753,#0b2c3be8);border:1px solid #6caaaa55;border-radius:24px;box-shadow:0 6px 0 #05283670}.roster-tabs{display:flex;gap:8px;flex:none}.roster-tabs button{background:#204d59;border:2px solid #527e85;border-radius:12px;padding:11px 12px;flex:1;font-size:clamp(14px,1.8vw,24px);font-style:italic;text-align:left;white-space:nowrap}.roster-tabs button[aria-selected=true]{color:#153e48;background:#ffdc8d;border-color:#fff1c9}.roster-tabs small{float:right;font:700 11px Arial;border-radius:15px;padding:3px 6px;background:#092c3c22}.roster-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:9px;flex:1;min-height:0}.roster-card{position:relative;min-width:0;min-height:0;overflow:hidden;border:2px solid #4d7e86;background:#123e4b;border-radius:13px;padding:0;display:flex;flex-direction:column;isolation:isolate}.roster-card img{width:100%;min-height:0;object-fit:contain;flex:1;pointer-events:none;background:radial-gradient(ellipse at 50% 45%,#235563,#123e4b 75%)}.roster-card>span{font-size:clamp(10px,1.1vw,15px);line-height:1.15;min-height:26px;display:grid;place-items:center;text-align:center;padding:4px;background:#0b2d3b;z-index:1}.roster-card.selected{border-color:#ffce67;box-shadow:0 0 0 1px #ffefd2}.roster-card.selected>span{background:#f4c56a;color:#173d47}.choice-check{position:absolute;right:3px;top:3px;background:#ffd372;color:#153e4a;border-radius:50%;width:21px;height:21px;display:none;place-items:center}.choice-check svg{width:13px;height:13px}.selected .choice-check{display:grid}.roster-grid.karts{grid-template-columns:repeat(3,minmax(0,1fr))}.ride-details{flex:none;min-height:103px}.ride-details h3{font-size:clamp(13px,1.6vw,21px);color:#ffd27a;font-style:italic;margin-bottom:5px}.ride-details>p{font:600 clamp(11px,1.1vw,15px)/1.4 Arial;color:#cee3dc;min-height:32px}.kart-ratings{display:flex;gap:14px;justify-content:space-between;margin-top:10px}.kart-ratings>span{font:700 9px Arial;letter-spacing:1px;color:#99c4c6;flex:1}.kart-ratings b{display:flex;gap:3px;margin-top:5px}.kart-ratings i{height:5px;background:#335c64;flex:1;border-radius:2px}.kart-ratings .lit{background:#52d4cc}.ride-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}.ride-bottom .swatches{margin:0;gap:10px}.ride-bottom .swatch{width:30px;height:30px}.ride-bottom .button{font-size:clamp(17px,2vw,28px);min-width:48%}
@media(min-height:700px) and (orientation:landscape){.ride-picker{padding:24px;gap:18px}.roster-card>span{min-height:34px}.ride-details{min-height:122px}.ride-bottom{padding-top:6px}}
@media(max-height:500px) and (orientation:landscape){.garage-screen{gap:8px}.garage-content{grid-template-columns:minmax(0,1fr) minmax(330px,1.1fr);gap:16px}.ride-picker{padding:10px 13px;gap:7px;border-radius:18px}.roster-tabs button{font-size:16px;padding:6px 9px;border-radius:9px}.roster-grid{gap:6px}.roster-card{border-radius:9px}.roster-card>span{font-size:9px;min-height:21px;padding:3px}.ride-details{min-height:67px}.ride-details h3{font-size:12px;margin-bottom:2px}.ride-details>p{font-size:10px;min-height:14px}.kart-ratings{margin-top:5px;gap:12px}.kart-ratings>span{font-size:8px}.kart-ratings b{margin-top:3px}.kart-ratings i{height:4px}.ride-bottom .button{font-size:18px;min-height:37px}.ride-bottom .swatch{width:25px;height:25px}.showcase-label{padding:0 0 4px}.showcase-label h2{font-size:30px;margin:3px}.showcase-label>p{font-size:12px}.showcase-label .eyebrow{font-size:8px}.rotate-model{font-size:8px;margin-top:5px}.choice-check{width:16px;height:16px}.choice-check svg{width:11px;height:11px}}
@media(orientation:portrait){.garage-screen{gap:8px}.garage-content{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(170px,.8fr) minmax(320px,1.2fr);gap:9px}.ride-showcase{flex-direction:row}.ride-showcase #racer-stage{flex:1;min-width:0}.showcase-label{align-self:center;flex:0 0 36%;padding:0 4px}.showcase-label h2{font-size:28px;letter-spacing:-1px}.showcase-label>p{font-size:11px}.showcase-label .eyebrow{font-size:7px;letter-spacing:1px}.rotate-model{font-size:8px;letter-spacing:0}.ride-picker{padding:12px;gap:9px;border-radius:18px}.roster-tabs button{font-size:16px;padding:7px 10px}.roster-grid{gap:7px}.roster-card>span{font-size:10px;min-height:24px}.ride-details{min-height:83px}.ride-details h3{font-size:13px}.ride-details>p{font-size:11px;min-height:26px}.kart-ratings{margin-top:5px}.ride-bottom .button{font-size:21px;min-height:42px}.ride-bottom .swatch{width:27px;height:27px}.garage-screen .screen-header .mode-label{max-width:36%;overflow:hidden;text-overflow:ellipsis;font-size:8px}.garage-screen .screen-header h1{font-size:23px}}
@media(max-height:700px) and (orientation:portrait){.garage-content{grid-template-rows:minmax(130px,.55fr) minmax(300px,1.3fr)}.showcase-label h2{font-size:23px}.ride-details{min-height:72px}.ride-details>p{font-size:10px}.ride-picker{gap:6px;padding:9px}.roster-card>span{min-height:20px;font-size:9px}}
@media(max-width:390px) and (orientation:portrait){.garage-screen .screen-header .mode-label{display:none}.garage-screen .screen-header h1{font-size:23px}.showcase-label .eyebrow{letter-spacing:.5px;font-size:7px}}
#racer-stage{position:relative}.model-status{position:absolute;left:12px;bottom:8px;color:#d5efea;font:600 11px Arial;pointer-events:none;text-shadow:0 1px 3px #06212b}.model-status:empty{display:none}.model-retry{position:absolute;right:10px;bottom:5px;padding:7px 12px;border:1px solid #70b9b9;border-radius:10px;background:#174b58;color:#fff1d0;font:700 11px Arial}

/* Keep all sound controls reachable on short landscape phones. */
.settings-panel{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
.credit-entry{display:block;background:transparent;color:#9fdddd;text-decoration:underline;text-underline-offset:4px;min-height:40px;margin:6px auto 0;padding:8px 15px;font:700 12px Arial;touch-action:manipulation}
body[data-state=credits] #shade{opacity:1;background:#082d3bea;backdrop-filter:blur(5px)}
.credits-screen{gap:12px}.credits-scroll{overflow-y:auto;min-height:0;flex:1;overscroll-behavior:contain;touch-action:pan-y;padding:6px 12px 24px;scrollbar-color:#56c6c1 #103947;user-select:text;-webkit-user-select:text}
.credit-intro{max-width:1150px;margin:0 auto 22px}.credit-intro h2{font-size:clamp(24px,3.3vw,42px);font-style:italic;letter-spacing:-1.3px;margin:9px 0}.credit-intro p{font:400 15px/1.5 Arial;color:#c9e3dc}
.credit-columns{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:20px;max-width:1150px;margin:auto}.credit-side{display:flex;flex-direction:column;gap:20px}.credit-card{border:1px solid #558b9466;border-radius:22px;padding:22px;min-width:0}.credit-card h3{font-size:23px;color:#ffda82;font-style:italic;margin:0 0 12px}.credit-card p{font:400 14px/1.65 Arial;margin:9px 0;color:#e2ede3}.credit-card p.credit-muted{font-size:12px;color:#a6c9c9}.credit-card a{color:#77e1db;text-underline-offset:3px;display:inline-block;padding:2px 0;touch-action:manipulation}.credit-card a:focus-visible{outline:2px solid #ffda82;outline-offset:3px}
.credit-song{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;border-bottom:1px solid #65969944}.credit-song small{font:700 10px Arial;letter-spacing:1.3px;text-transform:uppercase;color:#a6c9c9}.credit-song h4{font:900 italic 22px Race,Arial;margin:5px 0;letter-spacing:-.8px}.credit-song p{margin:0}.credit-song button{min-width:90px;min-height:44px;font-size:12px}.credit-song button[aria-pressed=true]{color:#163e49;background:#ffda82;text-shadow:none}.credit-volume{display:flex;justify-content:space-between;align-items:center;gap:15px;font:700 12px Arial;color:#d5e6df;margin:22px 0 10px}.credit-volume input{width:45%;min-height:32px;accent-color:#f7ca70;touch-action:pan-x}.credit-samples{display:flex;flex-wrap:wrap;gap:7px;margin:16px 0}.credit-samples .button{font-size:12px;min-height:44px;padding:8px 12px}
@media(max-width:650px){.credit-columns{grid-template-columns:1fr;gap:14px}.credit-side{gap:14px}.credit-card{padding:17px}.credit-intro{margin-bottom:16px}.credits-scroll{padding:2px 3px 18px}.credit-song h4{font-size:20px}.credit-song p{font-size:12px}.menu-footer{gap:7px;flex-wrap:wrap}.menu .help{padding-left:10px;padding-right:10px}}
@media(max-height:500px) and (orientation:landscape){.settings-panel{padding:12px 20px}.settings-panel h2{font-size:20px;margin-bottom:4px}.setting-row{padding:7px 0}.settings-bottom{margin-top:8px}}

.race-actions #boost-button.recharging{background:linear-gradient(#385965,#183b4b);color:#d5e5df;box-shadow:inset 0 0 0 3px #789e9b66,0 4px 0 #092c3a50}.race-actions #boost-button:disabled{cursor:default}.race-actions #boost-button:focus-visible{outline:3px solid var(--gold);outline-offset:5px}#boost-status{position:absolute;top:18%;font:800 clamp(7px,.8vw,10px) Arial;letter-spacing:.4px;opacity:.85}#boost-label{padding-top:5px}

/* Generous thumb target; the neutral point follows the first touch. */
.touch-steer{width:clamp(190px,26vw,310px);height:clamp(70px,10vw,92px);background:linear-gradient(#244e60e8,#103548e8)}
.touch-steer #steer-thumb{left:var(--steer-origin,50%);width:clamp(46px,6vw,64px);height:clamp(46px,6vw,64px)}
@media(orientation:portrait){.touch-steer{width:clamp(165px,43vw,210px);height:74px;padding:0 15px}}
@media(max-width:359px) and (orientation:portrait){.touch-steer{width:145px}.race-actions{gap:5px}.race-actions #boost-button{width:74px;height:74px}.race-actions #item-button{width:47px;height:47px}}

/* Paint palette: two rows with a stable selected-name label. */
.ride-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;flex:none}.paint-picker{min-width:0;max-width:280px}.paint-heading{display:flex;align-items:baseline;justify-content:space-between;gap:6px;margin-bottom:5px;font:700 10px/1.2 Arial;color:#a9cccb}.paint-heading strong{color:var(--cream);font-size:11px;white-space:nowrap}.ride-bottom .swatches{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;margin:0}.ride-bottom .swatch{width:100%;height:36px;border:0;border-radius:8px;box-shadow:none;background:transparent;position:relative;isolation:isolate}.ride-bottom .swatch:before{content:"";position:absolute;inset:4px;border-radius:50%;background:var(--swatch);border:1px solid #fff5;z-index:-1}.ride-bottom .swatch.selected{outline:0;background:#ffffff24}.ride-bottom .swatch.selected:before{border:2px solid #fff0c5;box-shadow:0 0 0 1px #082b38}.ride-bottom .swatch:focus-visible{outline:2px solid var(--gold);outline-offset:0}.ride-bottom .swatch svg{width:16px;height:16px;color:white;filter:drop-shadow(0 1px 2px #102636) drop-shadow(0 0 1px #102636)}.ride-bottom .button{min-width:100px;padding-left:14px;padding-right:14px;justify-self:end}
@media(max-height:500px) and (orientation:landscape){.ride-bottom{gap:8px}.paint-heading{font-size:8px;margin-bottom:2px}.paint-heading strong{font-size:9px}.ride-bottom .swatches{gap:1px}.ride-bottom .swatch{height:28px}.ride-bottom .swatch:before{inset:3px}.ride-bottom .swatch svg{width:13px;height:13px}.ride-bottom .button{min-width:90px;padding:8px 10px}}
@media(orientation:portrait){.ride-bottom{gap:12px}.ride-bottom .swatch{height:32px}.ride-bottom .button{min-width:100px}}

/* Results actions must fit narrow portrait screens, including longer Danish labels. */
.results-screen .results-layout,.results-screen .standings{min-width:0}
.result-footer{flex:none}
@media(orientation:portrait){
 .result-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .result-footer #next{grid-column:1/-1;grid-row:1}
 .result-footer .button{min-width:0;width:100%;min-height:48px;white-space:normal;font-size:clamp(13px,3.8vw,16px);padding:10px 12px}
 .result-footer .button span{min-width:0;overflow-wrap:anywhere}
 .results-screen .results-layout{grid-template-rows:auto minmax(0,1fr)}
}
@media(orientation:portrait) and (max-height:650px){
 .results-screen{gap:10px}
 .results-screen .results-layout{gap:10px}
 .results-screen .result-celebration h1{font-size:34px}
 .results-screen .result-time{font-size:24px;margin:3px}
 .results-screen .cup-score{margin-top:6px;font-size:10px}
 .results-screen .standings{padding:10px;gap:2px}
 .results-screen .standings h2{font-size:20px;margin-bottom:3px}
 .results-screen .standing{padding:4px 8px;font-size:12px;gap:8px}
}

/* Give portrait paint choices their own full-width touch area. */
@media(orientation:portrait){
 .ride-bottom{grid-template-columns:minmax(0,1fr);gap:10px}
 .paint-picker{max-width:none;width:100%}
 .paint-heading{font-size:11px;margin-bottom:6px}
 .paint-heading strong{font-size:12px}
 .ride-bottom .swatches{gap:4px}
 .ride-bottom .swatch{height:44px;border-radius:10px}
 .ride-bottom .swatch:before{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:min(36px,calc(100% - 6px));aspect-ratio:1}
 .ride-bottom .swatch svg{width:19px;height:19px}
 .ride-bottom .button{width:100%;min-height:48px;justify-self:stretch}
}
@media(orientation:portrait) and (max-height:650px){
 .garage-content{grid-template-rows:90px minmax(0,1fr)}
 .ride-details{min-height:44px}
 .ride-details>p{display:none}
}
