:root{color-scheme:dark;--ink:#11170f;--panel:#171d13;--cream:#f4f0d9;--muted:#c2c6ad;--line:#626950;--yellow:#f4db35;--green:#b7d45b;--orange:#ff9865;--display:"Arial Narrow","Avenir Next Condensed","Franklin Gothic Medium",sans-serif;--body:"Avenir Next","Noto Sans","Helvetica Neue",sans-serif;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--ink);color:var(--cream);font-family:var(--body);overscroll-behavior:none}body{font-size:16px}button,a,input,select{-webkit-tap-highlight-color:transparent}button,select{font:inherit;color:inherit}button,a,select,input{touch-action:manipulation}button{min-height:48px;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-weight:750;cursor:pointer;transition:background-color .12s,color .12s,border-color .12s}button:hover{background:#303a24;border-color:var(--cream)}button:active,button.pressed{background:var(--cream);color:var(--ink)}button:disabled{cursor:wait;opacity:.6}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,canvas:focus-visible{outline:3px solid var(--yellow);outline-offset:3px}button svg,a svg{width:24px;height:24px;flex:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;fill:none}a{color:inherit}button[hidden],[hidden]{display:none!important}p{line-height:1.5}h1,h2,h3,p{margin:0}.symbol-library{position:absolute;width:0;height:0;overflow:hidden}.icon-button{width:48px;height:48px;display:inline-flex;align-items:center;justify-content:center;flex:none}.primary-button{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--yellow);color:var(--ink);border-color:var(--yellow);padding:12px 18px;min-height:56px}.primary-button:hover,.start-button:hover{background:#ffea63;color:var(--ink);border-color:#ffea63}
#game-shell,#race-canvas{position:absolute;inset:0;width:100%;height:100%;height:100dvh}#race-canvas{display:block;touch-action:none;outline:none}.menu{position:absolute;inset:0;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) minmax(330px,390px);grid-template-rows:88px minmax(0,1fr) 40px;column-gap:32px;padding:var(--safe-top) calc(40px + var(--safe-right)) var(--safe-bottom) calc(40px + var(--safe-left));isolation:isolate}.key-art{position:absolute;z-index:-3;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 46%;pointer-events:none}.art-shade{position:absolute;z-index:-2;inset:0;background:linear-gradient(90deg,rgba(8,18,7,.35),rgba(8,18,7,.02) 50%,rgba(8,18,7,.55)),linear-gradient(0deg,rgba(8,18,7,.65),transparent 60%);pointer-events:none}.menu-toolbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;min-width:0;gap:12px}.back-link{display:inline-flex;gap:10px;align-items:center;min-height:48px;padding:0 12px;text-decoration:none;font-weight:800;background:var(--ink);border:1px solid var(--line);border-radius:6px}.back-link:hover{border-color:var(--cream)}.toolbar-buttons{display:flex;gap:12px}.masthead{grid-column:1;grid-row:2;align-self:center;padding-bottom:80px;min-width:0}.masthead h1{font-family:var(--display);font-weight:1000;text-transform:uppercase;line-height:.88;font-style:italic;letter-spacing:-.04em;paint-order:stroke fill;-webkit-text-stroke:3px #15200e;text-shadow:3px 4px 0 #15200e}.masthead h1>span{display:block}.title-mighty{font-size:clamp(24px,3.1vw,48px);color:var(--cream);letter-spacing:.035em;margin-bottom:10px}.title-banana,.title-racer{font-size:clamp(66px,8.7vw,150px)}.title-banana{color:var(--yellow)}.title-racer{color:var(--cream)}.menu-tagline{font-size:17px;font-weight:800;margin-top:22px;text-shadow:1px 2px 2px var(--ink)}.race-setup{grid-column:2;grid-row:2;align-self:center;display:flex;flex-direction:column;gap:14px;background:var(--ink);padding:24px;border-top:5px solid var(--yellow);border-bottom:1px solid var(--line);min-width:0}.picker{display:flex;align-items:center;min-height:78px;gap:6px;border-bottom:1px solid var(--line)}.picker-arrow{width:48px;min-width:48px;height:56px;display:flex;align-items:center;justify-content:center;background:transparent;border-color:transparent}.picker-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.picker-copy strong{font-size:19px;line-height:1.15;font-weight:900;overflow-wrap:anywhere}.picker-label{font-size:12px;color:var(--muted);font-weight:650}.picker-subtitle{font-size:12px;color:var(--muted);line-height:1.2}.driver-portrait{height:58px;width:48px;flex:none}.driver-portrait svg{height:100%;width:100%;overflow:visible}.driver-picker .picker-copy strong{font-size:17px}.mode-picker{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mode-button{font-size:14px;display:flex;justify-content:center;align-items:center;gap:8px;min-width:0;white-space:nowrap;padding:4px 8px}.mode-button svg{width:20px;height:20px}.mode-button[aria-pressed=true]{background:var(--cream);border-color:var(--cream);color:var(--ink)}.difficulty-row{display:flex;align-items:center;gap:12px;min-height:48px;justify-content:space-between}.difficulty-row label{font-size:13px;font-weight:700;flex:none}.difficulty-row select{height:48px;width:170px;min-width:0;border:1px solid var(--line);border-radius:6px;background:var(--panel);padding:0 10px;font-size:16px}.difficulty-row #free-note{font-size:14px;color:var(--muted)}.start-button{display:flex;align-items:center;justify-content:space-between;min-height:64px;gap:12px;padding:12px 20px;background:var(--yellow);color:var(--ink);border-color:var(--yellow);font-family:var(--display);font-size:25px;font-weight:1000}.start-button svg{width:32px;height:32px}.ready-message{font-size:12px;color:var(--muted);text-align:center;line-height:1.25}.ready-message:empty{display:none}.menu-credit{grid-column:1;grid-row:3;font-size:12px;align-self:center;color:var(--cream);text-shadow:1px 1px 2px var(--ink)}
.race-hud{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.race-topline{position:absolute;left:calc(24px + var(--safe-left));top:calc(20px + var(--safe-top));display:flex;align-items:center;gap:20px;background:var(--ink);padding:10px 16px;border-left:4px solid var(--yellow)}.standing{display:flex;align-items:baseline;gap:5px;white-space:nowrap}.standing>strong{font-family:var(--display);font-size:42px;line-height:1;color:var(--yellow);font-style:italic}.standing>strong span{font-size:20px;font-style:normal}.standing>span{font-size:13px;color:var(--muted)}.lap-counter{padding-left:18px;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:2px}.lap-counter>span{font-size:11px}.lap-counter>strong{font-size:25px;line-height:1.1}.lap-counter small{font-size:15px;color:var(--muted)}.track-heading{display:flex;flex-direction:column;gap:4px;padding-left:18px;border-left:1px solid var(--line)}.track-heading strong{font-size:13px}.track-heading time{font-size:18px;font-variant-numeric:tabular-nums}.race-toolbar{position:absolute;right:calc(24px + var(--safe-right));top:calc(20px + var(--safe-top));display:flex;gap:12px;pointer-events:auto}.race-gauges{position:absolute;bottom:calc(64px + var(--safe-bottom));left:50%;transform:translateX(-50%);display:grid;grid-template-columns:auto auto;gap:4px 18px;background:var(--ink);padding:10px 18px;min-width:156px;border-bottom:3px solid var(--yellow)}.speedometer{display:flex;align-items:baseline;gap:6px}.speedometer strong{font-family:var(--display);font-size:36px;line-height:1;font-style:italic;font-variant-numeric:tabular-nums}.speedometer span{font-size:10px;color:var(--muted)}.coin-counter{display:flex;align-items:center;gap:6px}.coin-counter>span{color:var(--yellow);font-weight:1000;font-size:18px;font-style:italic}.coin-counter strong{font-size:17px}.drift-gauge{grid-column:1/-1;display:flex;flex-direction:column;gap:5px}.drift-gauge>span{font-size:11px;color:var(--muted)}#drift-meter{height:5px;background:#41492f;overflow:hidden}#drift-fill{display:block;width:100%;height:100%;background:var(--yellow);transform:scaleX(0);transform-origin:left;will-change:transform}.race-message{position:absolute;left:50%;top:calc(120px + var(--safe-top));transform:translateX(-50%);text-align:center;max-width:70%;background:var(--ink);padding:8px 16px;color:var(--yellow);font-weight:800;font-size:16px}.race-message:empty{display:none}.countdown{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);font-family:var(--display);font-size:clamp(80px,16vw,150px);font-weight:1000;color:var(--yellow);font-style:italic;-webkit-text-stroke:3px var(--ink);paint-order:stroke fill;text-shadow:3px 3px 0 var(--ink)}.touch-controls{position:absolute;inset:0;pointer-events:none}.steering-controls,.action-controls{position:absolute;bottom:calc(24px + var(--safe-bottom));display:flex;flex-direction:column;gap:12px;pointer-events:none}.steering-controls{left:calc(24px + var(--safe-left));align-items:flex-start}.action-controls{right:calc(24px + var(--safe-right));align-items:flex-end}.steering-row,.action-row{display:flex;gap:12px}.drive-button{width:84px;height:84px;min-width:64px;min-height:64px;border:2px solid #84946d;background:rgba(17,23,15,.94);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer}.drive-button svg{width:30px;height:30px;stroke-width:2.5}.drive-button span{font-size:11px;font-weight:850}.steering-button svg{width:36px;height:36px}.boost-button{background:var(--yellow);border-color:var(--yellow);color:var(--ink)}.drift-button{border-color:var(--cream)}.brake-button{width:64px;height:64px;border-color:#adb995}.throttle-button{width:64px;height:64px}.throttle-button svg{transform:rotate(-90deg)}.drive-button.pressed{background:var(--cream);border-color:var(--cream);color:var(--ink)}.keyboard-hint{position:absolute;left:50%;bottom:calc(20px + var(--safe-bottom));transform:translateX(-50%);font-size:12px;white-space:nowrap;background:var(--ink);padding:6px 10px}.keyboard-hint span{color:var(--yellow);padding:0 5px}#minimap{position:absolute;right:calc(24px + var(--safe-right));top:calc(92px + var(--safe-top));width:120px;height:120px}
.game-dialog{width:min(460px,calc(100% - 32px));max-height:calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));padding:24px;background:var(--ink);color:var(--cream);border:1px solid var(--line);border-top:4px solid var(--yellow);border-radius:6px;overscroll-behavior:contain}.game-dialog::backdrop{background:rgba(3,8,3,.82)}.dialog-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.dialog-header h2{font-family:var(--display);font-size:36px;line-height:1;font-weight:1000;font-style:italic}.game-dialog>p{color:var(--muted);font-size:14px;margin-bottom:16px}.pause-actions{display:grid;gap:12px}.pause-actions>button{padding:10px 16px;text-align:left}.dialog-actions{display:grid;gap:12px;margin-top:16px}.settings-fields{display:flex;flex-direction:column}.setting-toggle{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:76px;padding:12px 0;border-bottom:1px solid var(--line);cursor:pointer}.setting-toggle span{font-weight:750;font-size:15px}.setting-toggle small{display:block;font-size:12px;color:var(--muted);font-weight:400;line-height:1.4;padding-top:4px}.setting-toggle input{width:26px;height:26px;accent-color:var(--yellow);flex:none;cursor:pointer}.mute-button{margin-top:16px;display:flex;align-items:center;justify-content:center;gap:12px;width:100%}.credits{border-top:1px solid var(--line);margin-top:20px;padding-top:16px}.credits h3{font-size:15px;margin-bottom:8px}.credits p{font-size:13px;margin-bottom:8px;color:var(--muted)}.credits strong{color:var(--cream)}.credits .credits-note{font-size:12px;margin-top:16px}.help-controls{margin:0 0 20px}.help-controls>div{display:grid;grid-template-columns:108px 1fr;gap:12px;border-bottom:1px solid var(--line);padding:12px 0}.help-controls dt{font-size:13px;font-weight:800}.help-controls dd{margin:0;font-size:13px;line-height:1.45;color:var(--muted)}.game-dialog>.primary-button{width:100%}.results-list{list-style:none;padding:0;margin:0}.results-list li{display:grid;grid-template-columns:28px 1fr auto;gap:10px;align-items:center;padding:12px 8px;border-bottom:1px solid var(--line);font-size:14px}.results-list li.player-result{background:var(--yellow);color:var(--ink);font-weight:800}.results-list time{font-variant-numeric:tabular-nums;font-size:13px}.results-best{padding-top:16px;color:var(--yellow)!important}.no-script{position:fixed;z-index:100;inset:20%;padding:24px;background:var(--ink);border:1px solid var(--yellow);line-height:1.6}.no-script a{display:block}
@media(pointer:coarse){.keyboard-hint{display:none}.race-gauges{bottom:calc(24px + var(--safe-bottom))}}
@media(min-width:1600px){.race-setup{margin-right:4vw}.menu{grid-template-columns:minmax(0,1fr) minmax(390px,480px);padding-left:7vw;padding-right:3vw}}
@media(max-width:800px) and (min-height:501px){.menu{grid-template-columns:1fr;grid-template-rows:64px minmax(100px,1fr) auto;gap:0;padding:var(--safe-top) calc(16px + var(--safe-right)) var(--safe-bottom) calc(16px + var(--safe-left))}.menu-toolbar{grid-column:1;grid-row:1}.back-link{padding:0 8px;font-size:13px;gap:6px}.toolbar-buttons{gap:8px}.masthead{grid-row:2;grid-column:1;padding:10px 0 8px;align-self:center}.masthead h1{-webkit-text-stroke:2px var(--ink);text-shadow:2px 3px 0 var(--ink)}.title-mighty{font-size:20px;margin-bottom:5px}.title-banana,.title-racer{font-size:clamp(44px,11vw,80px)}.menu-tagline{display:none}.race-setup{grid-column:1;grid-row:3;width:100%;max-width:480px;justify-self:center;gap:8px;padding:12px;margin-bottom:12px;border-top-width:3px}.picker{min-height:60px;gap:2px}.picker-arrow{height:48px}.picker-copy strong{font-size:17px}.picker-subtitle{display:none}.driver-picker .picker-copy strong{font-size:16px}.driver-portrait{width:38px;height:48px}.picker-label{font-size:11px}.mode-button{min-height:48px;font-size:13px;gap:6px}.mode-picker{gap:8px}.difficulty-row{min-height:48px}.difficulty-row select{width:158px}.start-button{min-height:56px;font-size:23px;padding:8px 16px}.menu-credit{display:none}.key-art{object-position:42% 40%}.art-shade{background:linear-gradient(0deg,rgba(8,18,7,.55),transparent 65%)}.race-topline{top:calc(12px + var(--safe-top));left:calc(12px + var(--safe-left));padding:8px 10px;gap:12px}.standing>strong{font-size:34px}.standing>strong span{font-size:16px}.standing>span{font-size:11px}.lap-counter{padding-left:12px}.lap-counter>strong{font-size:23px}.track-heading{position:absolute;left:-4px;top:100%;border-left:0;background:var(--ink);padding:5px 10px}.track-heading strong{display:none}.track-heading time{font-size:13px}.race-toolbar{right:calc(12px + var(--safe-right));top:calc(12px + var(--safe-top));gap:12px}.race-gauges{left:calc(12px + var(--safe-left));top:calc(104px + var(--safe-top));bottom:auto;transform:none;padding:6px 10px;min-width:140px;gap:3px 10px}.speedometer strong{font-size:27px}.speedometer span{font-size:9px}.coin-counter strong{font-size:14px}.drift-gauge>span{font-size:10px}.race-message{top:calc(180px + var(--safe-top));max-width:calc(100% - 24px);font-size:13px;white-space:normal;padding:7px 12px}.keyboard-hint{display:none}.steering-controls{left:calc(12px + var(--safe-left));bottom:calc(20px + var(--safe-bottom))}.action-controls{right:calc(12px + var(--safe-right));bottom:calc(20px + var(--safe-bottom))}.drive-button{width:72px;height:72px}.brake-button,.throttle-button{width:64px;height:64px}.countdown{top:43%}#minimap{top:calc(82px + var(--safe-top));right:calc(12px + var(--safe-right));width:104px;height:104px}}
@media(max-width:370px) and (min-height:501px){.menu{padding-right:calc(12px + var(--safe-right));padding-left:calc(12px + var(--safe-left))}.back-link{padding:0 6px}.back-link svg{width:20px}.toolbar-buttons{gap:6px}.masthead{padding:5px 0}.title-mighty{font-size:16px;margin-bottom:3px}.title-banana,.title-racer{font-size:42px}.race-setup{padding:8px;gap:6px;margin-bottom:8px}.picker{min-height:58px}.driver-portrait{width:28px}.picker-copy strong{font-size:16px}.driver-picker .picker-copy strong{font-size:14px}.difficulty-row label{font-size:12px}.difficulty-row select{width:153px}.start-button{min-height:54px}.drive-button{width:64px;height:72px}.brake-button,.throttle-button{height:64px}.race-topline{gap:8px;padding-left:8px;padding-right:8px}.standing>strong{font-size:30px}.standing>span{display:none}.lap-counter{padding-left:8px}.race-gauges{min-width:124px}.race-message{font-size:12px}}
@media(max-height:500px) and (min-width:500px){.menu{grid-template-columns:minmax(0,1fr) 320px;grid-template-rows:1fr;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);gap:0}.menu-toolbar{position:absolute;top:calc(8px + var(--safe-top));left:calc(8px + var(--safe-left));width:calc(100% - 336px - var(--safe-left) - var(--safe-right));gap:4px}.back-link{padding:0 10px}.back-link span{display:none}.toolbar-buttons{gap:6px}.menu-toolbar .icon-button{background:var(--ink)}.masthead{grid-column:1;grid-row:1;align-self:center;padding:45px 14px 0;min-width:0}.title-mighty{font-size:18px;margin-bottom:6px}.title-banana,.title-racer{font-size:clamp(40px,7vw,76px)}.masthead h1{-webkit-text-stroke:2px var(--ink);text-shadow:2px 3px 0 var(--ink)}.menu-tagline{font-size:12px;margin-top:14px;max-width:200px}.race-setup{grid-row:1;grid-column:2;align-self:stretch;justify-content:center;padding:10px 12px;gap:6px;border-top:0;border-bottom:0;border-left:3px solid var(--yellow)}.picker{min-height:48px;height:48px;gap:2px}.picker-arrow{height:48px}.picker-copy strong{font-size:16px}.picker-subtitle{display:none}.picker-label{font-size:11px}.driver-portrait{width:34px;height:44px}.driver-picker .picker-copy strong{font-size:15px}.mode-picker{gap:8px}.mode-button{font-size:13px}.difficulty-row{min-height:48px}.difficulty-row select{width:153px}.start-button{min-height:52px;padding:6px 16px;font-size:23px}.ready-message{font-size:11px}.menu-credit{position:absolute;bottom:12px;left:14px;display:block}.key-art{object-position:34% center}.race-topline{top:calc(10px + var(--safe-top));left:calc(12px + var(--safe-left));padding:6px 10px;gap:12px}.standing>strong{font-size:31px}.standing>strong span{font-size:15px}.standing>span{font-size:11px}.lap-counter{padding-left:12px}.lap-counter>strong{font-size:20px}.lap-counter>span{font-size:10px}.track-heading{padding-left:12px}.track-heading strong{display:none}.track-heading time{font-size:14px}.race-toolbar{top:calc(10px + var(--safe-top));right:calc(12px + var(--safe-right))}.steering-controls{left:calc(12px + var(--safe-left));bottom:calc(12px + var(--safe-bottom))}.action-controls{right:calc(12px + var(--safe-right));bottom:calc(12px + var(--safe-bottom))}.drive-button{width:68px;height:68px}.brake-button,.throttle-button{width:64px;height:64px}.race-gauges{bottom:calc(14px + var(--safe-bottom));padding:7px 10px;min-width:128px;gap:3px 8px}.speedometer strong{font-size:28px}.speedometer span{font-size:9px}.coin-counter strong{font-size:14px}.drift-gauge>span{font-size:10px}.keyboard-hint{display:none}.race-message{top:calc(76px + var(--safe-top));font-size:13px;padding:6px 12px}.countdown{top:43%;font-size:80px}#minimap{display:none}.game-dialog{padding:16px;max-height:calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom))}.dialog-header{margin-bottom:12px}.dialog-header h2{font-size:30px}.pause-actions{grid-template-columns:1fr 1fr}.pause-actions .primary-button{grid-column:1/-1}}
@media(max-height:370px) and (min-width:500px){.ready-message:not(:empty){position:absolute;left:12px;bottom:40px;max-width:200px;text-align:left;background:var(--ink);padding:6px}.race-setup{gap:4px;padding-top:8px;padding-bottom:8px}.menu-credit{bottom:8px}.menu-tagline{display:none}}
.setup-select-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px}.setup-select-row label{font-size:13px;font-weight:750}.setup-select-row select{height:48px;width:210px;min-width:0;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:16px;padding:0 10px}.pedal-row{display:flex;flex-direction:column;gap:12px;align-items:flex-start}.combat-row{display:flex;align-items:flex-end;gap:12px}.drive-button.fire-button{width:96px;height:96px;background:var(--orange);border-color:var(--orange);color:var(--ink)}.fire-button svg{width:38px;height:38px}.fire-button span{font-size:14px;font-weight:1000}.drive-button.rocket-button{width:64px;height:64px;border-color:var(--orange)}.rocket-button.recharging{border-color:var(--line);color:var(--muted)}.hp-gauge{grid-column:1/-1;display:flex;flex-direction:column;gap:4px;margin-top:2px}.hp-gauge>span{font-size:10px;color:var(--muted)}#hp-meter{height:5px;background:#41492f;overflow:hidden}#hp-fill{display:block;height:100%;width:100%;background:var(--green);transform-origin:left}#hp-meter.low-health #hp-fill{background:var(--orange)}.hud-objective{position:absolute;top:calc(102px + var(--safe-top));left:calc(24px + var(--safe-left));font-size:12px;line-height:1.4;background:var(--ink);padding:6px 10px;max-width:calc(100% - 200px)}.race-message{top:calc(148px + var(--safe-top))}
@media(max-width:800px) and (min-height:501px){.setup-select-row select{width:180px}.setup-select-row label{font-size:12px}.hud-objective{top:calc(210px + var(--safe-top));left:calc(12px + var(--safe-left));max-width:calc(100% - 24px);font-size:11px;padding:5px 8px}.race-message{top:calc(252px + var(--safe-top));font-size:12px}.race-gauges{gap:3px 10px}.drift-gauge{gap:4px}}
@media(max-width:370px) and (min-height:501px){.setup-select-row select{width:172px}.setup-select-row{gap:8px}.setup-select-row label{font-size:12px}}
@media(max-height:500px) and (min-width:500px){.setup-select-row select{width:182px}.setup-select-row label{font-size:12px}.hud-objective{top:calc(68px + var(--safe-top));left:calc(180px + var(--safe-left));font-size:10px;padding:4px 8px;max-width:calc(100% - 360px)}.race-message{top:calc(110px + var(--safe-top));font-size:12px;max-width:calc(100% - 340px)}.race-gauges{min-width:124px;padding:5px 9px}.hp-gauge>span{font-size:9px}.drift-gauge>span{font-size:9px}.drift-gauge{gap:3px}.race-gauges .speedometer strong{font-size:24px}.drive-button.fire-button{width:96px;height:96px}}
.dialog-header{position:sticky;top:0;background:var(--ink);z-index:2;padding-bottom:8px}
@media(max-width:800px) and (min-height:501px){.countdown{top:54%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}body.reduced-motion *,body.reduced-motion *::before,body.reduced-motion *::after{animation:none!important;transition:none!important}

/* Equipment is a real game screen, with the actual 3D kart visible between controls. */
.race-hud{overflow:hidden}.race-message{width:max-content}.hud-objective{max-width:min(32vw,420px)}.equipment-detail{scrollbar-color:var(--line) var(--ink);scrollbar-width:thin}.rocket-button.empty{color:var(--muted);border-color:var(--line)}
.equipment-row{gap:8px}.equipment-row select{flex:1;width:0}.equipment-row .icon-button{width:48px}.garage{position:absolute;inset:0;display:grid;grid-template-rows:68px 48px minmax(0,1fr) 64px;overflow:hidden;background:transparent;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left)}.garage-header{display:flex;gap:16px;align-items:center;padding:8px 20px;background:var(--ink);border-bottom:1px solid var(--line)}.garage-header h1{font:900 28px var(--display)}.garage-balance{margin-left:auto;text-align:right;display:flex;flex-direction:column;gap:3px}.garage-balance strong{color:var(--yellow);font-size:20px}.garage-balance span{font-size:12px;color:var(--muted)}.garage-tabs{display:flex;gap:8px;padding:0 20px;background:var(--ink);border-bottom:1px solid var(--line)}.garage-tabs button{min-width:90px;border:0;border-radius:0;background:none;font-size:14px;border-bottom:3px solid transparent}.garage-tabs button[aria-selected=true]{color:var(--yellow);border-bottom-color:var(--yellow)}.garage-workspace{display:grid;grid-template-columns:340px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 200px;min-height:0}.garage-list{grid-row:1/3;overflow-y:auto;overscroll-behavior:contain;background:var(--ink);padding:12px;scrollbar-color:var(--line) var(--ink);scrollbar-width:thin}.equipment-choice{display:flex;gap:12px;align-items:center;width:100%;padding:10px 12px;min-height:64px;margin-bottom:6px;text-align:left;border-color:transparent;background:transparent}.equipment-choice[aria-pressed=true]{border-color:var(--yellow);background:#28321b}.equipment-icon{display:flex;width:38px;height:38px;flex:none;align-items:center;justify-content:center;color:var(--yellow)}.equipment-icon svg{width:30px;height:30px}.equipment-choice>span:last-child{min-width:0;display:flex;flex-direction:column;gap:4px}.equipment-choice strong{font-size:15px;line-height:1.25;overflow-wrap:anywhere}.equipment-choice span span{font-size:12px;color:var(--muted);text-transform:capitalize}.garage-preview{position:relative;pointer-events:none}.garage-preview>span{position:absolute;left:16px;bottom:12px;font-size:12px;padding:4px 8px;background:var(--ink);color:var(--muted)}.equipment-detail{padding:14px 24px;background:var(--ink);border-top:1px solid var(--line);overflow-y:auto}.equipment-detail h2{font:900 25px var(--display);margin-bottom:6px}.equipment-detail>p{font-size:14px;line-height:1.4;max-width:64ch}.equipment-detail dl{display:flex;gap:24px;flex-wrap:wrap;margin:12px 0}.equipment-detail dl div{display:flex;flex-direction:column;gap:3px}.equipment-detail dt{font-size:12px;color:var(--muted)}.equipment-detail dd{font-size:16px;font-weight:800;margin:0;text-transform:capitalize}.equipment-detail #equipment-note{font-size:12px;color:var(--muted)}.equipment-detail #upgrade-buy{min-height:48px;margin-top:10px}.equipment-detail #garage-status{margin-top:8px;font-size:12px;color:var(--yellow)}.garage-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--ink);padding:8px 20px;border-top:1px solid var(--line)}.garage-footer p{font-size:14px;color:var(--muted)}.garage-footer button{min-height:48px}.garage-footer button svg{width:20px}body[data-screen=garage] #race-canvas{left:340px;top:calc(116px + var(--safe-top));width:calc(100% - 340px);height:calc(100dvh - 380px - var(--safe-top) - var(--safe-bottom))}
.weapon-readout{position:absolute;top:calc(102px + var(--safe-top));left:50%;transform:translateX(-50%);width:210px;pointer-events:auto;background:var(--ink)}.weapon-readout button{width:100%;display:flex;align-items:center;gap:8px;border-radius:0;padding:6px 10px;min-height:48px;text-align:left;border-color:var(--line)}#weapon-icon{display:flex;color:var(--yellow)}#weapon-icon svg{width:24px;height:24px}#hud-weapon{font-size:12px;flex:1;line-height:1.2}.cycle-glyph{font-size:22px;color:var(--muted)}#weapon-heat{height:4px;background:#41492f;overflow:hidden}#weapon-heat-fill{display:block;width:100%;height:100%;background:var(--orange);transform:scaleX(0);transform-origin:left}#weapon-state{display:block;font-size:11px;text-align:center;color:var(--orange)}#weapon-state:empty{display:none}.aim-reticle{position:absolute;left:50%;top:45%;width:26px;height:26px;transform:translate(-50%,-50%);opacity:.7}.aim-reticle i{position:absolute;width:7px;height:7px;border:1px solid #fff5d0}.aim-reticle i:nth-child(1){top:0;left:0;border-right:0;border-bottom:0}.aim-reticle i:nth-child(2){top:0;right:0;border-left:0;border-bottom:0}.aim-reticle i:nth-child(3){bottom:0;left:0;border-right:0;border-top:0}.aim-reticle i:nth-child(4){bottom:0;right:0;border-left:0;border-top:0}.aim-reticle.confirmed{opacity:1}.aim-reticle.confirmed i{border-color:var(--yellow);border-width:3px}.aim-reticle.elimination i{border-color:var(--orange)}#damage-flash{position:absolute;inset:0;border:0 solid transparent;pointer-events:none}#damage-flash.active{border-width:5px;border-color:#e78158}.encounter-message{position:absolute;left:50%;bottom:calc(205px + var(--safe-bottom));transform:translateX(-50%);background:var(--ink);color:var(--orange);padding:6px 12px;font-size:13px;text-align:center;max-width:70%}.encounter-message:empty{display:none}.contract-button{position:absolute;left:50%;bottom:calc(205px + var(--safe-bottom));transform:translateX(-50%);pointer-events:auto;background:var(--yellow);color:var(--ink);padding:8px 14px;max-width:70%;font-size:13px;min-height:48px}.results-reward{padding:12px 0;color:var(--yellow);font-weight:800}.results-reward:empty{display:none}.rocket-button span{font-size:10px;line-height:1.15;max-width:60px}.rocket-button svg{height:22px}
@media(max-width:800px) and (min-height:501px){.garage{grid-template-rows:64px 48px minmax(0,1fr) 60px}.garage-header{padding:8px 12px;gap:10px}.garage-header h1{font-size:24px}.garage-balance span{font-size:10px;max-width:148px}.garage-balance strong{font-size:18px}.garage-tabs{padding:0 8px;gap:4px;justify-content:space-between}.garage-tabs button{min-width:0;flex:1;font-size:13px}.garage-workspace{grid-template-columns:44% 56%;grid-template-rows:minmax(100px,1fr) 240px}.garage-list{padding:8px}.equipment-choice{min-height:60px;padding:8px 6px;gap:6px}.equipment-icon{width:24px}.equipment-icon svg{width:22px}.equipment-choice strong{font-size:12px}.equipment-choice span span{font-size:10px}.equipment-detail{padding:12px}.equipment-detail h2{font-size:21px}.equipment-detail>p{font-size:13px}.equipment-detail dl{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}.equipment-detail dd{font-size:14px}.equipment-detail dt{font-size:10px}.equipment-detail #equipment-note{font-size:11px}.garage-preview>span{left:8px;font-size:10px}.garage-footer{padding:6px 12px;gap:8px}.garage-footer p{font-size:11px;max-width:45%;line-height:1.3}.garage-footer button{font-size:13px;gap:8px;padding:8px 12px}body[data-screen=garage] #race-canvas{left:44%;top:calc(112px + var(--safe-top));width:56%;height:calc(100dvh - 412px - var(--safe-top) - var(--safe-bottom))}.weapon-readout{left:auto;right:calc(12px + var(--safe-right));top:calc(194px + var(--safe-top));transform:none;width:calc(100% - 176px);max-width:180px}.weapon-readout button{padding:5px 7px;gap:5px}#weapon-icon svg{width:20px;height:20px}#hud-weapon{font-size:11px}.cycle-glyph{font-size:18px}.hud-objective{top:calc(245px + var(--safe-top));max-width:calc(100% - 24px)}.race-message{top:calc(278px + var(--safe-top));max-width:calc(100% - 24px)}.contract-button{bottom:calc(200px + var(--safe-bottom));font-size:12px;max-width:calc(100% - 24px)}.encounter-message{bottom:calc(204px + var(--safe-bottom));font-size:11px}}
@media(max-height:500px) and (min-width:500px){.garage{grid-template-rows:56px 44px minmax(0,1fr) 52px}.garage-header{padding:4px 12px}.garage-header h1{font-size:24px}.garage-tabs{padding:0 12px}.garage-tabs button{min-height:44px}.garage-workspace{grid-template-columns:190px minmax(0,1fr) 210px;grid-template-rows:1fr}.garage-list{grid-row:1;grid-column:1;padding:6px}.garage-preview{grid-column:2}.equipment-detail{grid-column:3;grid-row:1;border-top:0;padding:8px 12px}.equipment-detail h2{font-size:20px}.equipment-detail>p{font-size:12px}.equipment-detail dl{gap:8px;margin:8px 0}.equipment-detail dt{font-size:10px}.equipment-detail dd{font-size:13px}.equipment-detail #equipment-note{font-size:10px}.equipment-choice{min-height:54px;padding:6px;gap:6px}.equipment-icon{width:24px}.equipment-choice strong{font-size:12px}.equipment-choice span span{font-size:10px}.garage-footer{padding:2px 12px}.garage-footer p{font-size:12px}.garage-footer .primary-button{min-height:44px;font-size:13px;padding:6px 12px}body[data-screen=garage] #race-canvas{left:190px;top:calc(100px + var(--safe-top));width:calc(100% - 400px);height:calc(100dvh - 152px - var(--safe-top) - var(--safe-bottom))}.weapon-readout{top:calc(76px + var(--safe-top));left:calc(12px + var(--safe-left));transform:none;width:154px}.weapon-readout button{min-height:48px;font-size:11px;padding:5px 7px}#hud-weapon{font-size:11px}.weapon-readout #weapon-icon svg{width:18px}.weapon-readout .cycle-glyph{font-size:18px}.race-message{top:calc(106px + var(--safe-top))}.contract-button{bottom:calc(164px + var(--safe-bottom));max-width:calc(100% - 360px);font-size:11px;min-height:44px}.encounter-message{bottom:calc(150px + var(--safe-bottom));font-size:11px;max-width:calc(100% - 360px)}}
/* Keep the driving view open on phones; status and equipment occupy two compact columns. */
#garage-open{flex-direction:column;gap:2px}#garage-open svg{width:20px;height:20px}#garage-open span{font-size:10px}
@media(max-width:800px) and (min-height:501px){.weapon-readout{top:calc(76px + var(--safe-top));right:calc(12px + var(--safe-right));max-width:180px}#minimap{top:calc(134px + var(--safe-top));width:64px;height:64px;right:calc(32px + var(--safe-right))}.hud-objective{top:calc(210px + var(--safe-top));max-width:calc(100% - 24px)}.race-message{top:calc(246px + var(--safe-top));max-width:calc(100% - 24px);font-size:12px}.contract-button{bottom:calc(204px + var(--safe-bottom))}}
@media(max-width:800px) and (min-height:501px){.race-hud[data-mode=free] .hud-objective{display:none}}
@media(max-width:800px) and (min-height:501px) and (max-height:650px){.hud-objective{display:none}}
@media(max-height:500px) and (min-width:500px){.weapon-readout{left:auto;right:calc(12px + var(--safe-right))}}
#roam-status{font-size:10px;line-height:1.2;color:#98f2db;white-space:nowrap;margin-top:3px}
.race-hud[data-mode=free][data-underground=true] .hud-objective{display:none}
@media(min-width:801px) and (min-height:501px){.race-message{top:calc(164px + var(--safe-top))}}
@media(max-width:370px) and (min-height:501px){#roam-status{font-size:9px}}
@media(max-width:800px) and (min-height:501px){.race-gauges{top:calc(112px + var(--safe-top))}}
@media(max-width:800px) and (min-height:501px){.race-hud[data-mode=free] .race-gauges{top:calc(124px + var(--safe-top))}}

/* Menu / showroom 2.2. One viewport, real preview, persistent exit controls. */
@font-face{font-family:Manrope;src:url('./assets/fonts/manrope-latin.woff2') format('woff2');font-style:normal;font-weight:400 800;font-display:swap}
.menu,.garage,.game-dialog,.operations{--menu-base:#171916;--menu-surface:#222620;--menu-raised:#30362b;--menu-line:#4e5648;--menu-text:#f4f0d9;--menu-muted:#c2c6ad;font-family:Manrope,var(--body);font-weight:500}
.menu button,.garage button,.game-dialog button{font-family:inherit;font-weight:700;border-radius:8px}
.menu svg,.garage svg,.game-dialog svg{stroke-width:1.8}
.menu{grid-template-columns:minmax(0,1fr) minmax(340px,400px);grid-template-rows:80px minmax(0,1fr) 48px;gap:0 48px;padding:var(--safe-top) calc(48px + var(--safe-right)) var(--safe-bottom) calc(48px + var(--safe-left));background:var(--menu-base)}
.key-art{opacity:1;object-position:40% center}
.art-shade{background:linear-gradient(90deg,rgba(12,18,9,.6),rgba(12,18,9,.08) 45%,rgba(12,18,9,.82)),linear-gradient(0deg,rgba(12,18,9,.88),transparent 45%)}
.menu-toolbar{grid-column:1/-1;grid-row:1;position:relative;inset:auto;width:auto;gap:16px}
.menu .back-link{background:var(--menu-base);border-color:var(--menu-line);padding:0 16px;min-height:48px;font-size:14px;border-radius:8px;font-weight:700}
.menu .back-link span{display:inline}
.toolbar-buttons{gap:12px}
.menu .icon-button{background:var(--menu-base);border-color:var(--menu-line)}
.masthead{grid-column:1;grid-row:2;align-self:end;padding:0 0 52px;max-width:620px}
.masthead h1{font-family:Manrope,var(--body);font-weight:800;font-style:normal;letter-spacing:-.055em;text-transform:none;line-height:.98;-webkit-text-stroke:0;text-shadow:none}
.masthead h1>span{display:block}
.title-mighty{font-size:clamp(28px,3.2vw,52px);letter-spacing:-.03em;margin-bottom:10px;color:var(--cream)}
.title-banana,.title-racer{font-size:clamp(64px,7.5vw,118px)}
.menu-tagline{display:block;font-size:17px;font-weight:500;margin-top:24px;text-shadow:none;color:var(--cream)}
.race-setup{align-self:center;gap:12px;margin:0;padding:24px;background:var(--menu-base);border:1px solid var(--menu-line);border-radius:10px;width:100%;max-width:none;grid-column:2;grid-row:2}
.world-picker{padding:0 0 16px;min-height:90px;height:auto;border-bottom:1px solid var(--menu-line);gap:8px}
.picker-arrow{width:48px;min-width:48px;height:48px;min-height:48px;background:var(--menu-surface);border-color:transparent}
.picker-copy{gap:5px}.picker-copy strong{font-size:20px;font-weight:800;line-height:1.25;overflow-wrap:normal}.picker-label,.picker-subtitle{font-size:12px;line-height:1.4;color:var(--menu-muted)}
.picker-subtitle{display:block}.mission-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.mission-options button{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:52px;padding:8px 12px;font-size:14px;text-align:left;background:var(--menu-surface);border:1px solid var(--menu-line);line-height:1.25}
.mission-options button svg{width:22px;height:22px}.mission-options button[aria-pressed=true]{color:var(--cream);background:var(--menu-raised);border-color:var(--yellow);box-shadow:inset 3px 0 var(--yellow)}
#missions-open{justify-content:space-between}.mission-description{font-size:13px;color:var(--menu-muted);line-height:1.5;min-height:38px}
#garage-open.menu-garage-button{display:flex;flex-direction:row;width:100%;align-items:center;gap:12px;min-height:68px;padding:12px 0;border:0;border-top:1px solid var(--menu-line);border-bottom:1px solid var(--menu-line);background:transparent;border-radius:0;text-align:left}
#garage-open.menu-garage-button>svg{width:26px;height:26px;color:var(--yellow)}
#garage-open.menu-garage-button>svg:last-child{width:22px;height:22px;color:var(--menu-muted)}
#garage-open .menu-garage-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
#garage-open .menu-garage-copy strong{font-size:16px;font-weight:800}
#garage-open .menu-garage-copy span{font-size:12px;line-height:1.4;color:var(--menu-muted);font-weight:500;overflow-wrap:anywhere}
.start-button{min-height:62px;padding:14px 18px;font:800 19px Manrope,var(--body);border-radius:8px}
.start-button svg{width:26px;height:26px}.ready-message{font-size:12px;line-height:1.5;color:var(--menu-muted)}
.menu-credit{position:static;grid-column:1/-1;grid-row:3;display:block;font-size:12px;line-height:1.4;color:var(--menu-text);text-shadow:none;align-self:center}.menu-credit span{margin:0 8px}
.menu button:hover,.garage button:hover,.game-dialog button:hover{background:var(--menu-raised);border-color:var(--cream)}
.menu .start-button:hover,.garage .primary-button:hover,.game-dialog .primary-button:hover{background:#ffea63;color:var(--ink);border-color:#ffea63}
.menu button:active,.garage button:active,.game-dialog button:active{background:var(--cream);color:var(--ink)}

.garage{grid-template-rows:80px 56px minmax(0,1fr) 76px;background:var(--menu-base);z-index:10;isolation:isolate}
.garage-header{gap:24px;padding:12px 24px;background:var(--menu-base);border-color:var(--menu-line)}
.garage-header h1{font:800 26px Manrope,var(--body);letter-spacing:-.04em}
.garage-back-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;min-width:100px;padding:0 14px;background:var(--menu-surface);border:1px solid var(--menu-line);font-size:14px}
.garage-balance{gap:4px}.garage-balance strong{font-size:20px;line-height:1.2}.garage-balance span{font-size:12px;line-height:1.4;max-width:none}
.garage-tabs{padding:0 24px;gap:24px;background:var(--menu-base);border-color:var(--menu-line)}
.garage-tabs button{min-width:96px;min-height:48px;height:56px;border-radius:0;border-bottom:3px solid transparent;background:none;padding:0 8px;font-size:15px}
.garage-tabs button[aria-selected=true]{color:var(--cream);border-bottom-color:var(--yellow)}
.garage-workspace{display:grid;grid-template-columns:minmax(230px,270px) minmax(0,1fr) minmax(260px,310px);grid-template-rows:minmax(0,1fr);min-height:0;min-width:0;overflow:hidden}
.garage-list{grid-column:1;grid-row:1;padding:12px;background:var(--menu-base);border-right:1px solid var(--menu-line);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scroll-padding:8px;scrollbar-color:var(--menu-line) var(--menu-base)}
.equipment-choice{display:flex;gap:12px;min-height:76px;padding:12px;margin:0 0 8px;background:transparent;border:1px solid transparent;border-radius:8px;text-align:left;width:100%}
.equipment-choice[aria-pressed=true]{background:var(--menu-raised);border-color:var(--menu-line);box-shadow:inset 3px 0 var(--yellow)}
.equipment-icon{width:36px;height:36px;color:var(--cream)}.equipment-icon svg{width:30px;height:30px}
.equipment-choice .equipment-copy{display:flex;flex-direction:column;flex:1;gap:4px;min-width:0}
.equipment-choice .equipment-name,.equipment-choice strong{font-size:14px;line-height:1.4;font-weight:750}
.equipment-choice .equipment-meta{font-size:12px;line-height:1.3;color:var(--menu-muted);text-transform:capitalize}
.equipment-choice .equipment-state{display:flex;align-items:center;gap:4px;font-size:11px;line-height:1.3;color:var(--yellow);white-space:normal}
.equipment-state svg{width:14px;height:14px;flex:none}
.garage-preview{position:relative;grid-column:2;grid-row:1;min-height:0;min-width:0;overflow:hidden;background:var(--menu-base);pointer-events:auto}
body[data-screen=garage] #race-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:auto}
.preview-controls{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:2;display:flex;gap:8px;pointer-events:auto}
.preview-controls .icon-button{width:44px;height:44px;min-height:44px;background:var(--menu-surface);border-color:var(--menu-line)}
.preview-controls svg{width:20px;height:20px}
.equipment-detail{grid-column:3;grid-row:1;background:var(--menu-base);border:0;border-left:1px solid var(--menu-line);padding:28px 24px;min-width:0;min-height:0;overflow-y:auto}
.equipment-detail h2{font:800 28px/1.15 Manrope,var(--body);letter-spacing:-.04em;margin-bottom:12px;overflow-wrap:anywhere}
.equipment-detail>p{font-size:14px;line-height:1.6;color:var(--menu-muted)}
.equipment-detail dl{display:grid;grid-template-columns:1fr 1fr;gap:20px 12px;margin:24px 0;padding:20px 0;border-top:1px solid var(--menu-line);border-bottom:1px solid var(--menu-line)}
.equipment-detail dt{font-size:12px;line-height:1.5;color:var(--menu-muted)}.equipment-detail dd{font-size:17px;line-height:1.4;color:var(--cream);font-weight:700;overflow-wrap:anywhere}
.equipment-detail #equipment-note{font-size:12px;line-height:1.5;color:var(--menu-muted)}
.equipment-detail #upgrade-buy{width:100%;min-height:48px;font-size:14px;margin-top:16px}
.equipment-detail #garage-status{font-size:12px;line-height:1.4;color:var(--yellow)}
.garage-footer{min-width:0;gap:16px;padding:12px 24px;background:var(--menu-base);border-color:var(--menu-line)}
.garage-footer p{font-size:13px;line-height:1.4;color:var(--menu-muted);max-width:65%}
.garage-footer .primary-button{min-height:48px;padding:12px 20px;font-size:14px;flex:none}
.garage button:disabled,.game-dialog button:disabled{cursor:not-allowed}

.game-dialog{width:min(520px,calc(100% - 32px));padding:24px;background:var(--menu-base);border:1px solid var(--menu-line);border-radius:10px;scroll-padding-top:88px}
.game-dialog::backdrop{background:rgba(8,12,7,.88)}
.dialog-header{position:sticky;top:-24px;padding:16px 0;margin-top:-16px;margin-bottom:8px;background:var(--menu-base);gap:16px;z-index:5}
.dialog-header h2{font:800 26px/1.2 Manrope,var(--body);letter-spacing:-.04em}
.game-dialog>p{font-size:14px;line-height:1.6;color:var(--menu-muted)}
.game-dialog button,.game-dialog select{background:var(--menu-surface);border-color:var(--menu-line)}
.game-dialog .primary-button{background:var(--yellow);color:var(--ink);border-color:var(--yellow)}
.pause-actions{gap:10px}.pause-actions>button{min-height:52px;padding:12px 16px;font-size:15px}
.game-dialog .setting-toggle{min-height:84px;gap:16px;border-color:var(--menu-line)}
.setting-toggle span{font-size:15px;font-weight:650}.setting-toggle small{font-size:13px;line-height:1.5;color:var(--menu-muted)}
.setting-toggle input{width:44px;height:44px;margin:0;flex:none;accent-color:var(--yellow)}
.difficulty-row select{width:190px}.credits{border-color:var(--menu-line)}.credits p,.help-controls dd{font-size:13px;line-height:1.6}
.help-controls>div{grid-template-columns:116px minmax(0,1fr);border-color:var(--menu-line)}
.mission-list{display:grid;gap:8px}.mission-list button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-height:76px;padding:14px 16px;text-align:left;border:1px solid var(--menu-line)}
.mission-list strong{font-size:16px}.mission-list span{font-size:13px;line-height:1.5;font-weight:500;color:var(--menu-muted)}
.mission-list button[aria-pressed=true]{border-color:var(--yellow);box-shadow:inset 3px 0 var(--yellow)}
.results-list li{padding:16px 12px;border-color:var(--menu-line)}

@media(max-width:1050px) and (min-height:501px){
  .menu{gap:0 24px;padding-left:calc(24px + var(--safe-left));padding-right:calc(24px + var(--safe-right));grid-template-columns:minmax(0,1fr) minmax(320px,360px)}
  .title-banana,.title-racer{font-size:clamp(64px,8vw,90px)}.race-setup{padding:20px}
  .garage-workspace{grid-template-columns:220px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 192px}
  .garage-list{grid-column:1;grid-row:1/3}.garage-preview{grid-column:2;grid-row:1}.equipment-detail{grid-column:2;grid-row:2;border-left:0;border-top:1px solid var(--menu-line);padding:16px 20px}
  .equipment-detail h2{font-size:23px;margin-bottom:6px}.equipment-detail dl{display:flex;gap:20px;margin:10px 0;padding:0;border:0}.equipment-detail #equipment-note{font-size:11px}
}
@media(max-width:700px) and (min-height:501px){
  .menu{grid-template-columns:1fr;grid-template-rows:64px minmax(100px,1fr) auto 32px;padding-left:calc(16px + var(--safe-left));padding-right:calc(16px + var(--safe-right));gap:0}
  .menu-toolbar{grid-row:1;grid-column:1;gap:8px}.menu .back-link{padding:0 10px;font-size:13px;gap:6px}.toolbar-buttons{gap:8px}
  .masthead{grid-column:1;grid-row:2;align-self:end;padding:16px 0 24px;max-width:none}
  .masthead h1{line-height:1}.title-mighty{font-size:22px;margin-bottom:6px}.title-banana,.title-racer{font-size:54px}.title-banana{color:var(--yellow)}
  .menu-tagline{display:none}.key-art{object-position:40% 20%}.art-shade{background:linear-gradient(0deg,rgba(12,18,9,.88),rgba(12,18,9,.12) 70%,rgba(12,18,9,.4))}
  .race-setup{grid-column:1;grid-row:3;padding:16px;gap:10px;margin:0;max-width:480px;justify-self:center}
  .world-picker{min-height:64px;padding-bottom:10px;gap:8px}.picker-copy strong{font-size:18px}.picker-subtitle{display:none}.picker-label{font-size:12px}.picker-arrow{min-height:48px;height:48px}
  .mission-options button{min-height:48px;font-size:13px;padding:8px 10px;gap:8px}.mission-options svg{width:20px;height:20px}
  .mission-description{min-height:0;font-size:12px;line-height:1.45}
  #garage-open.menu-garage-button{min-height:62px;padding:10px 0;gap:10px}.start-button{min-height:56px;font-size:18px;padding:12px 16px}
  .ready-message{font-size:11px}.menu-credit{grid-column:1;grid-row:4;font-size:10px;text-align:center}.menu-credit span{margin:0 6px}
  .garage{grid-template-rows:64px 52px minmax(0,1fr) 64px}
  .garage-header{padding:8px 12px;gap:12px}.garage-back-button{min-width:80px;padding:0 10px;gap:6px}.garage-header h1{font-size:22px}.garage-balance strong{font-size:17px}.garage-balance span{font-size:10px;max-width:128px}
  .garage-tabs{padding:0 8px;gap:8px;justify-content:space-between}.garage-tabs button{flex:1;min-width:0;font-size:13px;min-height:52px;height:52px;padding:0 4px}
  .garage-workspace{grid-template-columns:1fr;grid-template-rows:minmax(132px,1fr) 148px minmax(116px,1.1fr)}
  .garage-preview{grid-column:1;grid-row:1}.equipment-detail{grid-column:1;grid-row:2;padding:12px 16px;border-top:1px solid var(--menu-line);border-left:0}
  .equipment-detail h2{font-size:21px;line-height:1.2;margin-bottom:4px}.equipment-detail>p{font-size:12px;line-height:1.5}.equipment-detail dl{display:flex;justify-content:flex-start;gap:16px;flex-wrap:wrap;border:0;padding:0;margin:8px 0}.equipment-detail dt{font-size:10px}.equipment-detail dd{font-size:13px}.equipment-detail #equipment-note{font-size:11px;line-height:1.4}
  .garage-list{grid-column:1;grid-row:3;display:grid;grid-template-columns:1fr 1fr;gap:8px;align-content:start;border:0;border-top:1px solid var(--menu-line);padding:10px 12px}
  .equipment-choice{min-height:64px;margin:0;padding:8px;gap:8px}.equipment-choice .equipment-name,.equipment-choice strong{font-size:12px;line-height:1.4}.equipment-choice .equipment-meta{font-size:10px}.equipment-icon{width:26px;height:30px}.equipment-icon svg{width:26px;height:26px}.equipment-choice .equipment-state{font-size:10px}
  .preview-controls{left:auto;right:12px;bottom:10px;transform:none;gap:8px}.preview-controls .icon-button{width:44px;height:44px;min-height:44px}.preview-controls svg{width:18px;height:18px}
  .garage-footer{padding:8px 12px;gap:12px}.garage-footer p{font-size:11px;line-height:1.4;max-width:52%;overflow-wrap:anywhere}.garage-footer .primary-button{font-size:13px;padding:10px 14px;gap:10px}
  .game-dialog{padding:20px}.dialog-header{top:-20px}.dialog-header h2{font-size:24px}.game-dialog .difficulty-row select{width:170px}
}
@media(max-width:700px) and (min-height:501px) and (max-height:680px){
  .menu{grid-template-rows:56px minmax(78px,1fr) auto 24px;padding-left:calc(12px + var(--safe-left));padding-right:calc(12px + var(--safe-right))}
  .masthead{padding:8px 0 12px}.title-mighty{font-size:17px;margin-bottom:4px}.title-banana,.title-racer{font-size:40px}.race-setup{padding:12px;gap:8px}.world-picker{min-height:58px;padding-bottom:8px}.picker-copy strong{font-size:16px}.mission-options button{font-size:12px}.mission-description{font-size:11px;line-height:1.4}#garage-open.menu-garage-button{min-height:56px;padding:8px 0}#garage-open .menu-garage-copy strong{font-size:14px}#garage-open .menu-garage-copy span{font-size:10px}.start-button{min-height:52px;font-size:17px}.menu-credit{font-size:9px}.menu .icon-button,.menu .back-link{min-height:44px;height:44px}.menu .icon-button{width:44px}
  .garage{grid-template-rows:56px 48px minmax(0,1fr) 60px}.garage-tabs button{min-height:48px;height:48px}.garage-header h1{font-size:19px}.garage-balance span{display:none}.garage-header{gap:10px}.garage-back-button{min-width:76px;font-size:12px}.garage-workspace{grid-template-rows:minmax(116px,1fr) 126px minmax(110px,1fr)}.equipment-detail{padding:8px 12px}.equipment-detail h2{font-size:18px}.equipment-detail #equipment-note{display:none}.equipment-detail dl{gap:12px;margin:6px 0}.equipment-detail>p{font-size:11px}.garage-list{padding:8px;gap:8px}.equipment-choice{padding:8px 6px;gap:6px}.equipment-choice .equipment-name,.equipment-choice strong{font-size:11px}.equipment-icon{width:24px}.equipment-choice .equipment-meta{font-size:10px}
}
@media(max-height:500px) and (min-width:500px){
  .menu{grid-template-columns:minmax(0,1fr) minmax(292px,340px);grid-template-rows:56px minmax(0,1fr) 24px;gap:0 20px;padding:var(--safe-top) calc(16px + var(--safe-right)) var(--safe-bottom) calc(16px + var(--safe-left))}
  .menu-toolbar{grid-column:1;grid-row:1;width:auto;position:static;gap:8px;min-width:0}.menu .back-link{padding:0 8px;min-height:44px;height:44px}.menu .back-link span{display:none}.menu .icon-button{width:44px;height:44px;min-height:44px}.toolbar-buttons{gap:8px}
  .masthead{grid-column:1;grid-row:2;align-self:end;padding:12px 0 16px}.masthead h1{line-height:.97}.title-mighty{font-size:22px;margin-bottom:8px}.title-banana,.title-racer{font-size:clamp(36px,5.8vw,60px)}.menu-tagline{display:none}.menu-credit{grid-column:1;grid-row:3;font-size:9px;line-height:1.2;text-align:left;position:static}.menu-credit span{margin:0 4px}
  .race-setup{grid-column:2;grid-row:1/4;align-self:stretch;justify-content:center;margin:8px 0;padding:12px;gap:8px;border:1px solid var(--menu-line);overflow-y:auto;min-height:0}
  .world-picker{min-height:52px;padding-bottom:6px;gap:6px}.picker-copy strong{font-size:16px}.picker-label{font-size:10px}.picker-subtitle{display:none}.picker-arrow{height:44px;min-height:44px;width:44px;min-width:44px}
  .mission-options{gap:8px}.mission-options button{min-height:44px;padding:6px 8px;font-size:12px;gap:8px}.mission-options button svg{width:18px;height:18px}.mission-description{display:none}
  #garage-open.menu-garage-button{min-height:48px;padding:6px 0;gap:8px}#garage-open .menu-garage-copy strong{font-size:13px}#garage-open .menu-garage-copy span{font-size:10px}.start-button{min-height:48px;padding:8px 12px;font-size:16px}.ready-message:not(:empty){position:static;max-width:none;left:auto;bottom:auto;padding:0;font-size:10px;text-align:left;background:none}
  .garage{grid-template-rows:56px 48px minmax(0,1fr) 56px}.garage-header{padding:4px 12px;gap:16px}.garage-header h1{font-size:22px}.garage-back-button{min-width:88px;min-height:44px;font-size:13px}.garage-balance strong{font-size:16px}.garage-balance span{font-size:10px}.garage-tabs{padding:0 12px;gap:16px}.garage-tabs button{min-height:48px;height:48px;font-size:13px;min-width:80px}
  .garage-workspace{grid-template-columns:176px minmax(150px,1fr) 210px;grid-template-rows:minmax(0,1fr)}.garage-list{grid-column:1;grid-row:1;display:block;padding:6px}.equipment-choice{min-height:60px;padding:8px 6px;margin:0 0 6px;gap:6px}.equipment-choice .equipment-name,.equipment-choice strong{font-size:11px}.equipment-choice .equipment-meta,.equipment-choice .equipment-state{font-size:10px}.equipment-icon{width:24px}.equipment-icon svg{width:24px;height:24px}.garage-preview{grid-column:2;grid-row:1}.preview-controls{bottom:8px;gap:8px}.preview-controls .icon-button{width:44px;height:44px;min-height:44px}.equipment-detail{grid-column:3;grid-row:1;padding:12px;border:0;border-left:1px solid var(--menu-line)}.equipment-detail h2{font-size:20px;margin-bottom:6px}.equipment-detail>p{font-size:12px;line-height:1.45}.equipment-detail dl{margin:12px 0;padding:0;border:0;gap:10px;grid-template-columns:1fr 1fr}.equipment-detail dt{font-size:10px}.equipment-detail dd{font-size:13px}.equipment-detail #equipment-note{font-size:11px}
  .garage-footer{padding:4px 12px}.garage-footer .primary-button{min-height:44px;font-size:13px;padding:8px 12px}.garage-footer p{font-size:11px}
  .game-dialog{padding:16px;max-height:calc(100dvh - 16px - var(--safe-top) - var(--safe-bottom))}.dialog-header{top:-16px;margin-top:-12px;padding:12px 0;margin-bottom:8px}.dialog-header h2{font-size:23px}.pause-actions{grid-template-columns:1fr 1fr}.pause-actions .primary-button{grid-column:1/-1}.pause-actions>button{min-height:48px;font-size:13px;padding:10px 12px}
}
@media(max-width:620px) and (max-height:500px){
  .menu{grid-template-columns:minmax(0,1fr) 292px;gap:0 12px;padding-left:8px;padding-right:8px}.menu-toolbar{gap:4px}.toolbar-buttons{gap:6px}.menu .icon-button,.menu .back-link{width:44px;min-width:44px}.title-mighty{font-size:19px}.title-banana,.title-racer{font-size:36px}.menu-credit{max-width:200px;font-size:8px}.race-setup{padding:10px;gap:6px}.garage-workspace{grid-template-columns:160px minmax(150px,1fr) 180px}.equipment-detail{padding:10px}.equipment-detail h2{font-size:18px}.equipment-detail>p{font-size:11px}.garage-tabs{gap:8px}.garage-tabs button{min-width:76px}.garage-header{gap:12px}.garage-balance span{display:none}
}
.equipment-choice[aria-pressed=false] .equipment-state[aria-hidden=true]{display:none}
.garage-footer p{min-width:0;flex:1 1 0;overflow-wrap:anywhere}
.garage-header h1{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.garage{grid-template-columns:minmax(0,1fr)}
.garage-header,.garage-tabs,.garage-footer{min-width:0}
.garage-preview{container-type:size}
@media(max-width:700px) and (min-height:501px){
  @container (min-height:148px){
    .preview-controls{left:auto;right:12px;top:50%;bottom:auto;transform:translateY(-50%);flex-direction:column;gap:8px}
  }
}
.garage-back-button,.garage-balance{flex-shrink:0}
.garage-footer .primary-button{flex:0 1 auto;max-width:65%;min-width:0;overflow-wrap:anywhere}
.garage{grid-template-rows:minmax(80px,max-content) minmax(56px,max-content) minmax(0,1fr) minmax(76px,max-content)}
@media(max-height:500px) and (min-width:500px){.garage{grid-template-rows:minmax(56px,max-content) 48px minmax(0,1fr) minmax(56px,max-content)}}
.equipment-choice .equipment-copy .equipment-state{display:flex;flex-direction:row;align-items:center;gap:4px;line-height:1.4;color:var(--yellow);text-transform:none}
.equipment-choice .equipment-copy .equipment-state span{color:inherit;font-size:inherit}
.equipment-choice[aria-pressed=false] .equipment-copy .equipment-state[aria-hidden=true]{display:none}
.equipment-choice>span.equipment-state:last-child{flex-direction:row;align-items:center;gap:4px;min-width:0;line-height:1.4}
.menu .back-link{min-width:48px}
.menu .back-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.race-setup{max-height:100%;overflow:hidden;min-height:0}
.race-setup>*{flex-shrink:0}
.race-setup .setup-options{display:grid;gap:12px;min-height:48px;flex:0 1 auto;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-padding:8px;scrollbar-width:thin;scrollbar-color:var(--menu-line) var(--menu-base)}
@media(max-width:700px) and (min-height:501px){
  .menu{grid-template-rows:64px minmax(80px,1fr) minmax(0,auto) 32px}
  .race-setup .setup-options{gap:10px}
  .garage{grid-template-rows:minmax(64px,max-content) 52px minmax(0,1fr) minmax(64px,max-content)}
  .garage-tabs{overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:var(--menu-line) var(--menu-base)}
  .garage-tabs button{flex:1 0 auto;white-space:nowrap}
  .garage-footer p{display:none}
  .garage-footer .primary-button{width:100%;max-width:100%;justify-content:space-between}
}
@media(max-width:700px) and (min-height:501px) and (max-height:680px){
  .menu{grid-template-rows:56px minmax(70px,1fr) minmax(0,auto) 24px}
  .race-setup .setup-options{gap:8px}
  .garage{grid-template-rows:minmax(56px,max-content) 48px minmax(0,1fr) minmax(60px,max-content)}
}
@media(max-height:500px) and (min-width:500px){.race-setup .setup-options{gap:8px;min-height:44px}}
@media(max-width:700px) and (min-height:501px) and (max-height:680px){
  .garage-workspace{grid-template-rows:minmax(104px,168px) minmax(76px,116px) minmax(140px,1fr)}
}
@media(max-width:400px) and (min-height:501px){.garage-list{grid-template-columns:minmax(0,1fr)}}
@media(max-width:700px) and (min-height:501px){
  .equipment-choice{display:flex;gap:8px;align-items:center;height:max-content;align-self:start}
  .equipment-choice .equipment-icon{flex:none}
  .equipment-choice .equipment-copy{flex:1;min-width:0}
  .equipment-choice .equipment-state{flex-direction:row}
  .equipment-choice .equipment-name,.equipment-choice strong{font-size:13px}
  .equipment-choice .equipment-meta{font-size:11px;line-height:1.4}
  .equipment-choice .equipment-state span{font-size:10px;color:inherit}
}
/* Small screens keep the catalog concise; the selected item's full description
   and statistics remain in the independently scrollable detail panel. */
@media(max-width:400px) and (min-height:501px),(max-width:620px) and (max-height:500px){
  .equipment-choice .equipment-meta{display:none}
}
.help-controls dt,.help-controls dd{min-width:0;overflow-wrap:anywhere}
@media(max-width:400px){.help-controls>div{grid-template-columns:minmax(0,1fr);gap:6px}}
@media(max-width:620px) and (max-height:500px){
  .equipment-choice{padding-block:6px}
  .race-setup .setup-options{min-height:76px}
  #garage-open .menu-garage-copy span{display:none}
}

/* Standalone imagegen illustrations. Dimensions reserve space before decode. */
.illustrated-icon{display:block;object-fit:contain;flex:none;border-radius:6px;user-select:none;-webkit-user-drag:none;pointer-events:none}
.garage .equipment-icon{width:48px;height:48px;flex:none}
.equipment-icon .illustrated-icon{width:100%;height:100%}
.mission-options .illustrated-icon{width:32px;height:32px}
.mission-options{grid-template-columns:repeat(2,minmax(0,1fr))}
.mission-options button,.mission-options button>span{min-width:0}
.mission-options button>span{overflow-wrap:anywhere}
#garage-open.menu-garage-button>.illustrated-icon{width:44px;height:44px}
.mission-list button{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:12px}
.mission-list .illustrated-icon{width:48px;height:48px}
.mission-list .mission-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
.mission-list .mission-copy strong{color:var(--cream)}
#weapon-icon{width:28px;height:28px;flex:none}
#weapon-icon .illustrated-icon{width:100%;height:100%;border-radius:4px}
#secondary-icon{display:block;width:26px;height:26px;flex:none}
#secondary-icon .illustrated-icon{width:100%;height:100%;border-radius:4px}
@media(max-width:700px) and (min-height:501px){
  .garage .equipment-icon{width:44px;height:44px}
  .mission-options .illustrated-icon{width:28px;height:28px}
  #garage-open.menu-garage-button>.illustrated-icon{width:36px;height:36px}
  #missions-open>svg{display:none}
}
@media(max-width:400px){
  .mission-list button{grid-template-columns:32px minmax(0,1fr);gap:8px}
  .mission-list .illustrated-icon{width:32px;height:32px;grid-column:1;grid-row:1}
  .mission-list .mission-copy{display:contents}
  .mission-list .mission-copy strong{grid-column:2;grid-row:1}
  .mission-list .mission-copy>span{grid-column:1/-1;grid-row:2}
}
@media(max-height:500px) and (min-width:500px){
  .garage .equipment-icon{width:32px;height:32px}
  .mission-options .illustrated-icon{width:26px;height:26px}
  #garage-open.menu-garage-button>.illustrated-icon{width:32px;height:32px}
  #weapon-icon{width:22px;height:22px}
  #missions-open>svg{display:none}
}

/* The three-part name is a stack, never an inline sentence. Size to its own
   column (including landscape), and let enlarged/fallback text wrap. */
.masthead{container-type:inline-size;padding-top:4px}
.masthead h1{max-width:100%;line-height:1.08;letter-spacing:-.04em;overflow-wrap:anywhere}
.masthead h1>span{display:block;max-width:100%;margin-left:0}
.masthead .title-mighty{font-size:clamp(16px,5cqi,30px);line-height:1.2;letter-spacing:.01em;margin-bottom:6px}
.masthead .title-banana{font-size:clamp(40px,14cqi,90px);line-height:1.05}
.masthead .title-racer{font-size:clamp(24px,8cqi,50px);line-height:1.2;letter-spacing:-.04em;margin-top:4px}
@media(max-width:700px) and (min-height:501px){
  .menu{grid-template-rows:64px minmax(min-content,1fr) minmax(0,auto) 32px}
  .masthead{padding:12px 0 20px}
  .race-setup .setup-options{min-height:96px}
  .start-button{line-height:1.2;padding-block:8px}
  #garage-open .menu-garage-copy>span{display:none}
}
@media(max-width:700px) and (min-height:501px) and (max-height:680px){
  .menu{grid-template-rows:56px minmax(min-content,1fr) minmax(0,auto) 24px}
  .masthead{padding:4px 0}
  .masthead .title-mighty{font-size:12px;margin-bottom:3px}
  .masthead .title-banana{font-size:40px}
  .masthead .title-racer{font-size:24px;margin-top:2px}
}
@media(max-height:500px) and (min-width:500px){
  .masthead .title-mighty{font-size:14px}
  .masthead .title-banana{font-size:clamp(32px,14cqi,52px)}
  .masthead .title-racer{font-size:clamp(21px,8cqi,32px)}
}

/* The game view is the gesture surface. Pedals stay separate from steering. */
#drive-hint{display:none;position:absolute;margin:0;font-size:12px;font-weight:650;line-height:1.4;color:var(--cream);text-shadow:0 1px 2px var(--ink);pointer-events:none}
.setting-select,.setting-range{padding:16px 0;border-bottom:1px solid var(--menu-line);display:grid;gap:10px;min-width:0}
.setting-select label,.setting-range label{font-size:15px;font-weight:650;line-height:1.5}
.setting-select select{width:100%;height:48px;border:1px solid var(--menu-line);border-radius:6px;padding:0 12px;font-size:16px}
.setting-select p,.setting-range p{font-size:13px;line-height:1.5;color:var(--menu-muted)}
.setting-range label{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.setting-range output{color:var(--yellow);font-variant-numeric:tabular-nums}
.setting-range input{width:100%;height:48px;margin:0;accent-color:var(--yellow);cursor:pointer}
#tilt-controls{display:grid;gap:12px;min-width:0}
.tilt-actions{display:flex;flex-wrap:wrap;gap:8px}
.tilt-actions button{flex:1 1 130px;min-height:48px;padding:10px 12px;line-height:1.4;white-space:normal}
#tilt-status{overflow-wrap:anywhere}
.pause-run-info{margin:0 0 16px;padding:12px 0;border-block:1px solid var(--menu-line);font-size:14px;line-height:1.6;color:var(--menu-muted)}
.pause-run-info p+p{margin-top:6px}
.pause-run-info strong{color:var(--cream)}
.pause-run-info dl{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:8px 0 0}
.pause-run-info dl>div{min-width:0}
.pause-run-info dt{font-size:12px;color:var(--menu-muted)}
.pause-run-info dd{margin:0;font-weight:700;color:var(--cream);overflow-wrap:anywhere}
.pause-details{margin-top:16px;border-top:1px solid var(--menu-line)}
.pause-details summary{min-height:48px;padding:14px 4px;font-size:14px;font-weight:650;cursor:pointer;touch-action:manipulation}
.pause-details summary:focus-visible{outline:3px solid var(--yellow);outline-offset:2px}
.pause-details .pause-run-info{margin:0;padding:8px 0;border:0}
.pause-fullscreen{display:flex;align-items:center;justify-content:space-between;gap:12px}

@media(max-width:800px),(max-height:500px),(pointer:coarse){
  .race-hud{--thumb-width:144px;--thumb-bottom:calc(20px + var(--safe-bottom));--hud-gutter:12px}
  .race-hud .keyboard-hint,.race-toolbar .fullscreen-button{display:none}
  .race-toolbar{right:calc(var(--hud-gutter) + var(--safe-right));top:calc(12px + var(--safe-top))}
  .race-toolbar #pause-button{width:48px;height:48px;min-height:48px}
  .race-hud .action-controls{right:calc(var(--hud-gutter) + var(--safe-right));bottom:var(--thumb-bottom);width:var(--thumb-width);gap:8px;align-items:stretch}
  .race-hud .combat-row,.race-hud .action-row{width:100%;gap:8px;justify-content:space-between}
  .race-hud .drive-button{min-width:48px;min-height:48px;border-width:1px;border-radius:8px;gap:3px;background:rgba(17,23,15,.76)}
  .race-hud .drive-button svg{width:24px;height:24px}
  .race-hud .drive-button span{font-size:11px;line-height:1.2}
  .race-hud .drive-button.fire-button{width:72px;height:72px;background:var(--orange);color:var(--ink);border-color:var(--orange)}
  .race-hud .fire-button svg{width:30px;height:30px}
  .race-hud .fire-button>span{font-size:13px}
  .race-hud .drive-button.rocket-button{width:64px;height:64px;padding:4px;border-color:var(--orange)}
  .race-hud .rocket-button #secondary-icon{width:26px;height:26px}
  .race-hud .rocket-button #rocket-label{max-width:100%;font-size:10px;overflow-wrap:anywhere}
  .race-hud .drive-button.drift-button{width:64px;height:48px}
  .race-hud .drive-button.boost-button{width:72px;height:48px;background:var(--yellow);color:var(--ink);border-color:var(--yellow)}
  .race-hud .action-row .drive-button svg{width:19px;height:19px}
  .race-hud .drive-button.pressed{background:var(--cream);border-color:var(--cream);color:var(--ink)}
  .race-hud .steering-controls{left:calc(var(--hud-gutter) + var(--safe-left));bottom:var(--thumb-bottom);gap:8px;max-width:calc(100% - 180px - var(--safe-left) - var(--safe-right))}
  .race-hud .steering-row,.race-hud .pedal-row{flex-direction:row;gap:8px}
  .race-hud .steering-button{width:64px;height:64px}
  .race-hud .brake-button,.race-hud .throttle-button{width:64px;height:64px}
  .race-hud .throttle-button{border-color:var(--green);color:var(--cream)}
  .race-hud .pedal-row .drive-button span{font-size:12px}
  body:is([data-touch-steering=drag],[data-touch-steering=tilt]) .race-hud .steering-row{display:none}
  body:is([data-touch-steering=drag],[data-touch-steering=tilt]) #drive-hint{display:block;left:calc(var(--hud-gutter) + var(--safe-left));bottom:calc(96px + var(--safe-bottom));width:136px;padding:4px 0}
  body[data-touch-steering=buttons] #drive-hint{display:none}
  body[data-hud-layout=full] #minimap{top:calc(152px + var(--safe-top))}

  body[data-hud-layout=compact] .race-hud .race-gauges{left:calc(var(--hud-gutter) + var(--safe-left));right:auto;top:calc(12px + var(--safe-top));bottom:auto;transform:none;display:block;width:min(300px,calc(100% - 96px - var(--safe-left) - var(--safe-right)));min-width:0;padding:0;border:0;background:transparent}
  body[data-hud-layout=compact] .speedometer,body[data-hud-layout=compact] .coin-counter{display:none}
  body[data-hud-layout=compact] .hp-gauge{margin:0;gap:4px}
  body[data-hud-layout=compact] #hp-label{font-size:12px;line-height:1.2;font-weight:750;color:var(--cream);text-shadow:0 1px 2px var(--ink)}
  body[data-hud-layout=compact] #hp-meter{height:6px;border:1px solid rgba(17,23,15,.6);background:rgba(17,23,15,.75)}
  body[data-hud-layout=compact] .drift-gauge{margin-top:4px;gap:0}
  body[data-hud-layout=compact] #drift-label{display:none}
  body[data-hud-layout=compact] #drift-meter{height:3px;background:rgba(17,23,15,.6)}
  body[data-hud-layout=compact] .race-topline{left:calc(var(--hud-gutter) + var(--safe-left));right:calc(88px + var(--safe-right));top:calc(50px + var(--safe-top));padding:4px 6px;gap:10px;width:max-content;max-width:calc(100% - 100px - var(--safe-left) - var(--safe-right));min-height:28px;border:0;background:rgba(17,23,15,.75)}
  body[data-hud-layout=compact] .standing{gap:3px}
  body[data-hud-layout=compact] .standing>strong{font-size:22px;line-height:1}
  body[data-hud-layout=compact] .standing>strong span{font-size:12px}
  body[data-hud-layout=compact] .standing>span{display:none}
  body[data-hud-layout=compact] .lap-counter{padding:0;border:0;flex-direction:row;align-items:baseline;gap:4px;min-width:0}
  body[data-hud-layout=compact] .lap-counter>span{font-size:11px;white-space:nowrap}
  body[data-hud-layout=compact] .lap-counter>strong{font-size:14px;white-space:nowrap}
  body[data-hud-layout=compact] .lap-counter small{font-size:11px}
  body[data-hud-layout=compact] #roam-status{display:none}
  body[data-hud-layout=compact] .track-heading{position:static;left:auto;top:auto;padding:0;border:0;background:transparent}
  body[data-hud-layout=compact] .track-heading strong{display:none}
  body[data-hud-layout=compact] .track-heading time{font-size:12px;white-space:nowrap}
  body[data-hud-layout=compact] .hud-objective{display:none}
  body[data-hud-layout=compact] #minimap{display:block;top:calc(68px + var(--safe-top));right:calc(var(--hud-gutter) + var(--safe-right));width:64px;height:64px;opacity:.9}
  body[data-hud-layout=compact] .weapon-readout{left:calc(var(--hud-gutter) + var(--safe-left));right:auto;top:calc(88px + var(--safe-top));bottom:auto;transform:none;width:var(--thumb-width);max-width:none;border-radius:6px;background:rgba(17,23,15,.8)}
  body[data-hud-layout=compact] #cycle-weapon{height:48px;min-height:48px;padding:5px 7px;gap:6px;border-radius:6px 6px 0 0;background:transparent}
  body[data-hud-layout=compact] #weapon-icon{width:28px;height:28px}
  body[data-hud-layout=compact] #hud-weapon{font-size:11px;line-height:1.2;min-width:0;overflow-wrap:anywhere}
  body[data-hud-layout=compact] .cycle-glyph{font-size:18px}
  body[data-hud-layout=compact] #weapon-heat{height:4px;border-radius:0 0 6px 6px}
  body[data-hud-layout=compact] #weapon-state{position:static;width:100%;padding:3px 4px;background:var(--ink);font-size:12px;line-height:1.4;pointer-events:none}
  body[data-hud-layout=compact] .race-message{left:calc(var(--hud-gutter) + var(--safe-left));top:calc(176px + var(--safe-top));transform:none;text-align:left;font-size:12px;line-height:1.4;padding:6px 8px;max-width:calc(100% - 100px - var(--safe-left) - var(--safe-right))}
  body[data-hud-layout=compact] .contract-button{left:50%;bottom:calc(224px + var(--safe-bottom));width:max-content;max-width:calc(100% - 24px - var(--safe-left) - var(--safe-right));min-height:48px;font-size:12px;padding:8px 12px}
  body[data-hud-layout=compact] .encounter-message{bottom:calc(280px + var(--safe-bottom));font-size:12px;line-height:1.4;max-width:calc(100% - 32px - var(--safe-left) - var(--safe-right));padding:6px 10px}
  body[data-hud-layout=compact] .countdown{top:40%;font-size:80px}
}

@media(max-height:500px) and (min-width:500px){
  .race-hud{--thumb-bottom:calc(12px + var(--safe-bottom))}
  .race-toolbar{top:calc(8px + var(--safe-top))}
  body:is([data-touch-steering=drag],[data-touch-steering=tilt]) #drive-hint{bottom:calc(88px + var(--safe-bottom))}
  body[data-hud-layout=compact] .race-hud .race-gauges{top:calc(12px + var(--safe-top));width:164px}
  body[data-hud-layout=compact] .race-topline{top:calc(12px + var(--safe-top));left:calc(188px + var(--safe-left));right:calc(132px + var(--safe-right));max-width:calc(100% - 320px - var(--safe-left) - var(--safe-right));gap:8px;padding:4px 6px}
  body[data-hud-layout=compact] #minimap{width:48px;height:48px;top:calc(8px + var(--safe-top));right:calc(72px + var(--safe-right))}
  body[data-hud-layout=compact] .weapon-readout{left:calc(var(--hud-gutter) + var(--safe-left));right:auto;top:calc(56px + var(--safe-top));bottom:auto;width:136px}
  body[data-hud-layout=compact] .race-message{left:calc(188px + var(--safe-left));top:calc(50px + var(--safe-top));max-width:calc(100% - 320px - var(--safe-left) - var(--safe-right))}
  body[data-hud-layout=compact] .contract-button{bottom:calc(12px + var(--safe-bottom));max-width:calc(100% - 352px - var(--safe-left) - var(--safe-right));font-size:11px;padding:6px 8px}
  body[data-hud-layout=compact] .encounter-message{bottom:calc(68px + var(--safe-bottom));max-width:calc(100% - 352px - var(--safe-left) - var(--safe-right));font-size:11px;padding:5px 8px}
  body[data-hud-layout=compact] .countdown{top:45%;font-size:64px}
}

@media(max-height:340px) and (min-width:500px){
  /* Short, notched landscape: keep the optional arrow pair below the road.
     Pedals form the outer column; left/right remain in their natural order. */
  body[data-touch-steering=buttons][data-hud-layout=compact] .race-hud .steering-controls{flex-direction:row;align-items:flex-end;max-width:none}
  body[data-touch-steering=buttons][data-hud-layout=compact] .race-hud .pedal-row{order:-1;flex-direction:column}
  body[data-touch-steering=buttons][data-hud-layout=compact] .race-hud .steering-row{align-self:flex-end}
  body[data-touch-steering=buttons][data-hud-layout=compact] .contract-button,
  body[data-touch-steering=buttons][data-hud-layout=compact] .encounter-message{left:calc(50% + 32px);max-width:calc(100% - 392px - var(--safe-left) - var(--safe-right))}
}

/* Game front end. Home is a title scene; run configuration is a separate
   screen. These selectors intentionally do not affect the in-game HUD. */
#garage-back{min-height:48px;height:auto}
#menu.game-front{
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:48px minmax(0,1fr) 24px;
  gap:8px;padding:calc(12px + var(--safe-top)) calc(clamp(20px,3vw,48px) + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(clamp(20px,3vw,48px) + var(--safe-left));
  background:#090d09;
}
#menu.game-front .key-art{object-position:center;filter:none}
#menu.game-front .art-shade{background:linear-gradient(90deg,rgba(6,9,6,.02) 25%,rgba(6,9,6,.3) 55%,rgba(6,9,6,.91) 100%),linear-gradient(0deg,rgba(6,9,6,.86),transparent 30%)}
#menu.game-front .menu-toolbar{grid-column:1;grid-row:1;position:static;width:auto;gap:16px}
#menu.game-front .back-link{width:auto;min-width:48px;min-height:48px;height:auto;padding:0 8px;border:0;background:transparent;border-radius:2px;font-size:14px;color:var(--cream)}
#menu.game-front .back-link span{display:inline;overflow:visible;white-space:normal}
#menu.game-front .menu-toolbar .icon-button{width:48px;height:48px;min-height:48px;background:transparent;border:0;border-radius:2px}
#title-screen{
  grid-column:1;grid-row:2;display:flex;flex-direction:column;justify-content:center;gap:24px;
  width:min(42%,480px);min-width:320px;min-height:0;justify-self:end;padding:16px 0;
}
#title-screen .masthead{display:block;container-type:normal;width:100%;max-width:none;min-width:0;margin:0;padding:0;align-self:auto}
#title-screen #game-title{display:block;margin:0;padding:0;font-size:0;line-height:0;max-width:100%;font-style:normal;text-shadow:none;-webkit-text-stroke:0}
/* Black-matte generated wordmark, composited without destructive cutouts. */
#title-logo{display:block;width:100%;height:auto;max-height:32dvh;object-fit:contain;object-position:center;mix-blend-mode:screen}
#title-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:0 16px}
#title-actions .home-action{
  display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;
  min-width:0;min-height:60px;width:100%;height:auto;margin:0;padding:10px 18px;
  background:rgba(8,13,9,.7);border:0;border-bottom:1px solid #717460;border-radius:3px;
  color:var(--cream);font:750 22px/1.2 Manrope,var(--body);text-align:left;
}
#title-actions #garage-open{flex-direction:row;min-height:60px;max-width:none}
#title-actions .home-action>span,#title-actions #garage-open>span{flex:1;min-width:0;font:inherit;line-height:inherit;overflow-wrap:anywhere;text-transform:none}
#title-actions .home-action>svg,#title-actions .illustrated-icon{width:30px;height:30px;flex:none}
#title-actions .home-action>svg:last-child{width:24px;height:24px;transition:transform .15s ease}
#title-actions .home-play{min-height:76px;background:var(--yellow);color:#10160c;border:0;font-size:30px;font-weight:850}
#title-actions .home-action:focus-visible{outline:3px solid var(--cream);outline-offset:3px}
body[data-menu-input=gamepad] #menu button:focus,body[data-menu-input=gamepad] dialog button:focus{outline:3px solid var(--yellow);outline-offset:3px}
#title-status{font-size:13px;line-height:1.4;text-align:center;color:var(--cream);margin:0 16px;overflow-wrap:anywhere}
#title-status:empty{display:none}
#menu.game-front .menu-credit{grid-column:1;grid-row:3;position:static;align-self:center;text-align:right;font-size:11px;line-height:1.3;max-width:none;text-shadow:0 1px 3px #000}
#menu.game-front .menu-credit span{margin-inline:6px}
#run-setup{grid-column:1;grid-row:1/3;display:grid;grid-template-rows:auto minmax(0,1fr);gap:20px;min-width:0;min-height:0;width:min(100%,840px);justify-self:center;padding:16px 24px 24px;background:rgba(9,14,10,.96)}
#menu[data-menu-page=setup]>.menu-toolbar{visibility:hidden}
.setup-header{display:flex;align-items:center;gap:24px;min-width:0}
.setup-header h2{font:800 30px/1.2 Manrope,var(--body);letter-spacing:-.025em;min-width:0;overflow-wrap:anywhere}
.setup-back{display:flex;align-items:center;gap:8px;flex:none;min-width:48px;min-height:48px;padding:8px;background:transparent;border:0;border-radius:2px;font-size:15px}
#run-setup .race-setup{grid-column:auto;grid-row:auto;display:flex;flex-direction:column;align-self:stretch;justify-content:center;gap:20px;width:100%;max-width:none;max-height:100%;min-height:0;margin:0;padding:0;background:none;border:0;border-radius:0;overflow:hidden}
#run-setup .setup-options{display:grid;gap:20px;min-height:110px;flex:0 1 auto;overflow-y:auto;scroll-padding:8px;padding:2px;scrollbar-width:thin}
#run-setup .world-picker{height:auto;min-height:100px;padding:12px 0 20px;gap:16px;border-bottom:1px solid #626950}
#run-setup .picker-arrow{width:52px;height:52px;min-width:52px;min-height:52px;background:rgba(42,50,31,.8);border:1px solid #626950}
#run-setup .picker-copy{gap:8px;min-width:0}
#run-setup .picker-copy strong{font-size:30px;line-height:1.2;overflow-wrap:anywhere}
#run-setup .picker-label{font-size:13px;line-height:1.3;color:var(--yellow)}
#run-setup .picker-subtitle{display:block;font-size:14px;line-height:1.4}
#run-setup .mission-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#run-setup .mission-options button{min-height:76px;padding:12px 16px;gap:12px;background:#1d271a;font-size:18px;line-height:1.3;border:1px solid #667151;border-radius:4px}
#run-setup .mission-options button[aria-pressed=true]{background:#354026;border-color:var(--yellow);box-shadow:inset 4px 0 var(--yellow)}
#run-setup .mission-options .illustrated-icon{width:40px;height:40px}
#run-setup .mission-description{display:block;font-size:14px;line-height:1.5;min-height:0;color:var(--muted)}
#run-setup .start-button{width:100%;min-height:64px;flex:none;font-size:22px;line-height:1.2;padding:12px 18px;border-radius:4px}
#run-setup .ready-message{position:static;max-width:none;margin:0;padding:0;background:none;font-size:12px;line-height:1.4;text-align:center}
#menu[data-menu-page=setup] .art-shade{background:rgba(5,9,6,.7)}
@media(hover:hover){
  #title-actions .home-action:hover{background:#303b23;border-color:var(--cream)}
  #title-actions .home-play:hover{background:#ffec72;color:#10160c}
  #title-actions .home-action:hover>svg:last-child{transform:translateX(4px)}
}
@media(prefers-reduced-motion:no-preference){
  body:not(.reduced-motion) #title-screen:not([hidden]) #title-actions,body:not(.reduced-motion) #run-setup:not([hidden]){animation:front-enter .2s ease-out both}
}
@keyframes front-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(max-width:900px){
  #menu.game-front{padding-inline:calc(20px + var(--safe-left)) calc(20px + var(--safe-right))}
  #menu.game-front .key-art{object-position:36% center}
  #menu.game-front .art-shade{background:linear-gradient(180deg,rgba(7,10,6,.72),rgba(7,10,6,.6) 24%,transparent 46%,rgba(7,10,6,.3) 55%,rgba(7,10,6,.96) 88%)}
  #title-screen{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;width:min(100%,440px);min-width:0;justify-self:center;padding:8px 0;gap:16px}
  #title-screen .masthead{grid-column:1;grid-row:1;width:min(100%,360px);height:100%;max-height:30dvh;min-height:0;align-self:start;justify-self:center}
  #title-screen #game-title{height:100%}
  #title-logo{height:100%;max-height:30dvh;object-position:center top}
  #title-actions{grid-column:1;grid-row:2;padding:0;gap:8px;margin-top:auto}
  #title-actions .home-action,#title-actions #garage-open{min-height:56px;font-size:20px;padding:10px 16px}
  #title-actions .home-play{min-height:72px;font-size:28px}
  #title-actions .home-action>svg,#title-actions .illustrated-icon{width:28px;height:28px}
  #title-status{grid-column:1;grid-row:3;font-size:12px;margin:0}
  #menu.game-front .menu-credit{text-align:center;font-size:10px}
  #run-setup{width:100%;padding:12px;gap:16px}
  .setup-header{gap:16px}.setup-header h2{font-size:24px}
  #run-setup .race-setup,#run-setup .setup-options{gap:16px}
  #run-setup .world-picker{gap:12px;min-height:88px;padding:8px 0 16px}
  #run-setup .picker-copy strong{font-size:22px}
  #run-setup .picker-arrow{width:48px;height:48px;min-width:48px;min-height:48px}
  #run-setup .picker-subtitle{font-size:12px}
  #run-setup .mission-options{gap:10px}
  #run-setup .mission-options button{min-height:64px;font-size:15px;padding:10px;gap:8px}
  #run-setup .mission-options .illustrated-icon{width:28px;height:28px}
  #run-setup .mission-description{font-size:13px}
  #run-setup .start-button{font-size:20px;min-height:60px}
}
@media(max-width:400px){
  #menu.game-front{padding-inline:calc(16px + var(--safe-left)) calc(16px + var(--safe-right))}
  #title-screen{gap:10px;padding-block:4px}
  #run-setup{padding:10px;gap:12px}
  .setup-header{gap:10px}.setup-header h2{font-size:21px}
  .setup-back>span{display:none}
  #run-setup .race-setup,#run-setup .setup-options{gap:12px}
  #run-setup .picker-copy strong{font-size:20px}
  #run-setup .world-picker{gap:8px}
  #run-setup .mission-options button{font-size:14px;min-height:60px}
  #run-setup .mission-options .illustrated-icon{width:24px;height:24px}
}
@media(max-height:500px) and (min-width:500px){
  #menu.game-front{padding:calc(8px + var(--safe-top)) calc(20px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(20px + var(--safe-left));grid-template-rows:48px minmax(0,1fr) 20px;gap:4px}
  #menu.game-front .art-shade{background:linear-gradient(90deg,rgba(7,10,6,.2),rgba(7,10,6,.35) 50%,rgba(7,10,6,.92)),linear-gradient(0deg,rgba(7,10,6,.7),transparent 70%)}
  #title-screen{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.9fr);grid-template-rows:minmax(0,1fr) auto;align-items:center;justify-content:normal;width:100%;min-width:0;padding:4px 0;gap:8px 28px}
  #title-screen .masthead{grid-column:1;grid-row:1;align-self:center;justify-self:center;width:100%;height:auto;max-height:none;max-width:380px}
  #title-screen #game-title{height:auto}
  #title-logo{height:auto;max-height:54dvh;object-position:center}
  #title-actions{grid-column:2;grid-row:1;padding:0;gap:8px;margin:0}
  #title-actions .home-action,#title-actions #garage-open{min-height:48px;font-size:18px;padding:8px 14px}
  #title-actions .home-play{min-height:56px;font-size:24px}
  #title-actions .home-action>svg,#title-actions .illustrated-icon{width:26px;height:26px}
  #title-status{grid-column:1/-1;grid-row:2;margin:0;font-size:11px}
  #menu.game-front .menu-credit{font-size:10px}
  #run-setup{grid-row:1/3;align-self:stretch;width:100%;padding:8px 16px;gap:10px;z-index:1}
  #menu[data-menu-page=setup]>.menu-toolbar{visibility:hidden}
  .setup-header{gap:16px}.setup-header h2{font-size:22px}
  #run-setup .race-setup{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,.35fr);grid-template-rows:minmax(0,1fr);gap:16px;align-items:end}
  #run-setup .setup-options{min-height:0;max-height:100%;gap:12px;align-self:stretch;overflow-y:auto}
  #run-setup .world-picker{min-height:72px;gap:10px;padding:0 0 10px}
  #run-setup .picker-arrow{width:48px;height:48px;min-width:48px;min-height:48px}
  #run-setup .picker-copy strong{font-size:20px}
  #run-setup .picker-label{font-size:11px}
  #run-setup .picker-subtitle{display:none}
  #run-setup .mission-options{gap:8px}
  #run-setup .mission-options button{min-height:52px;font-size:13px;padding:8px;gap:8px}
  #run-setup .mission-options .illustrated-icon{width:26px;height:26px}
  #run-setup .mission-description{display:none}
  #run-setup .start-button{min-height:56px;font-size:18px;padding:12px;gap:8px;align-self:end}
  #run-setup .ready-message{grid-column:1/-1}
}
@media(max-height:350px) and (min-width:500px){
  #title-screen{column-gap:20px}
  #title-actions .home-action,#title-actions #garage-open{min-height:48px;padding:6px 12px;font-size:17px}
  #title-actions .home-play{min-height:52px;font-size:22px}
  #run-setup{padding:4px 8px;gap:6px}
  #run-setup .race-setup{gap:12px;grid-template-columns:minmax(0,1fr) 144px}
  #run-setup .setup-options{gap:8px}
}

/* Expansion screens retain the existing game palette and a single back path. */
#title-actions .home-action>svg:last-child{transition:none}
#title-actions .home-action:hover>svg:last-child{transform:none}
.garage-tabs{gap:12px}
.garage-tabs button{min-width:64px;padding-inline:8px}
.garage-category{display:none}
.garage-weapon-slots{display:grid;grid-template-columns:1fr 1fr;gap:8px;grid-column:1/-1;margin-bottom:8px;background:var(--menu-base);padding-bottom:8px}
.garage-weapon-slots button{min-width:0;min-height:64px;padding:8px;text-align:left;display:flex;flex-direction:column;gap:4px;background:var(--menu-surface)}
.garage-weapon-slots button span{font-size:12px;color:var(--menu-muted)}
.garage-weapon-slots button strong{font-size:12px;line-height:1.35;overflow-wrap:anywhere}
.garage-weapon-slots button[aria-pressed=true]{border-color:var(--yellow)}
#garage-test-drive{min-width:88px;min-height:48px;padding:8px 12px;flex:none;font-size:14px}
.garage-footer #garage-done{min-height:48px}
.preview-controls .icon-button{width:48px;height:48px;min-height:48px}
#garage-budget{border-top:1px solid var(--menu-line);padding-top:12px;margin-top:12px}
#garage-budget p{font-size:13px;line-height:1.5;color:var(--orange)}
#garage-budget dl{display:flex;justify-content:space-between;gap:12px;margin:8px 0;padding:0;border:0;flex-wrap:wrap}
#garage-budget dt{font-size:11px}#garage-budget dd{font-size:14px}
.preset-editor{display:grid;gap:8px;grid-column:1/-1;padding:8px}
.preset-editor label{font-size:14px;font-weight:700}
.preset-editor input,.operation-field input,#operations-content select,.hud-editor-fields input,.hud-editor-fields select{width:100%;min-width:0;min-height:48px;padding:8px 12px;border:1px solid var(--menu-line);border-radius:4px;background:var(--menu-surface);color:var(--cream);font:inherit}
.preset-editor .primary-button{font-size:14px;padding:8px 12px;min-height:48px}
.preset-editor p,.garage-empty{font-size:12px;line-height:1.5;color:var(--menu-muted)}
.preset-row{display:flex;gap:8px;padding:8px;grid-column:1/-1;min-width:0}
.preset-row>button:first-child{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px;padding:10px;text-align:left}
.preset-row>button:last-child{padding:8px;min-width:64px;font-size:12px}
.preset-row strong{font-size:14px;overflow-wrap:anywhere}.preset-row span{font-size:12px;color:var(--menu-muted);line-height:1.4}
.garage[data-active-tab=presets] .garage-list{display:block}
.setting-action{margin-top:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;text-align:left}
.operations{position:absolute;inset:0;z-index:10;background:var(--menu-base);display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);overflow:hidden}
.operations-header{display:flex;flex-wrap:wrap;align-items:center;gap:8px 24px;padding:16px 24px;border-bottom:1px solid var(--menu-line);min-width:0}
.operations-header h1{font:800 26px/1.2 Manrope,var(--body)}
#operations-back{min-width:48px;min-height:48px}
#race-message[data-priority=danger]{background:#27180f;color:#fff0bf;border:1px solid #f5ce78;border-left-width:4px;font-weight:800;pointer-events:none}
#race-message[data-priority=danger]::before{content:"!";display:inline-block;margin-right:.45em;font-weight:900;color:#f5ce78}
#race-message[data-priority=connection]{background:#171916;color:#f4f0d9;border:1px solid #c2c6ad;pointer-events:none}
.operations-tabs{display:flex;gap:16px;padding:0 24px;border-bottom:1px solid var(--menu-line);min-width:0}
.operations-category{display:none}
.operations-tabs button{min-height:56px;padding:8px 12px;background:transparent;border:0;border-bottom:3px solid transparent;border-radius:0;font-size:14px}
.operations-tabs button[aria-selected=true]{border-bottom-color:var(--yellow);color:var(--yellow)}
#operations-content{overflow:auto;min-width:0;min-height:0;padding:24px max(24px,calc((100% - 1040px)/2));scrollbar-width:thin;scroll-padding:16px}
.operation-section{max-width:1040px;margin:0 auto 32px}
.operation-section h3{font-size:24px;line-height:1.3;margin:0 0 8px}
.operation-section>p{font-size:15px;color:var(--menu-muted);line-height:1.6;margin-bottom:16px;max-width:72ch}
.operation-row{display:flex;flex-wrap:wrap;gap:16px 24px;align-items:center;justify-content:space-between;padding:16px 0;border-bottom:1px solid var(--menu-line);min-width:0}
.operation-row>div{min-width:0;flex:1 1 200px}.operation-row h4{font-size:17px;line-height:1.4;margin:0 0 4px;overflow-wrap:anywhere}.operation-row p{font-size:14px;line-height:1.5;color:var(--menu-muted);overflow-wrap:anywhere}
.operation-row button{flex:none;min-width:96px;min-height:48px;padding:8px 16px;font-size:14px}
.operation-row[aria-current=true]{border-bottom-color:var(--yellow)}.operation-row[aria-current=true] h4{color:var(--yellow)}
.operation-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.operation-actions button,.operation-section>button{padding:10px 16px;min-height:48px;font-size:14px}
.operation-field{display:grid;gap:8px;margin:16px 0;max-width:680px}.operation-field label,.operation-section>label{font-size:14px;font-weight:700}
#operations-content select{display:block;max-width:420px;margin:8px 0 16px}
.operation-checkbox{display:flex;align-items:center;gap:12px;min-height:48px;font-size:14px}.operation-checkbox input{width:48px;height:48px;accent-color:var(--yellow);margin:0}
.operation-standings{padding-left:24px;line-height:1.8;font-variant-numeric:tabular-nums}
#operations-status{font-size:13px;color:var(--yellow);line-height:1.5;padding:12px 24px;border-top:1px solid var(--menu-line);background:var(--menu-base)}
#operations-status:empty{padding:0;border:0}
@media(max-width:900px){
  .operations .operations-tabs{display:none}.operations-category{display:block;padding:8px 12px;border-bottom:1px solid var(--menu-line)}
  .operations-category select{display:block;width:100%;min-width:0;min-height:48px;padding:8px 12px;font:inherit;font-size:16px;background:var(--menu-surface);color:var(--cream);border:1px solid var(--menu-line);border-radius:4px}
}
.hud-editor-dialog.game-dialog{position:fixed;inset:0;margin:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;padding:0;border:0;border-radius:0;background:rgba(9,14,9,.86);overflow:hidden}
.hud-editor-tools{position:absolute;left:calc(8px + var(--safe-left));right:calc(8px + var(--safe-right));top:calc(4px + var(--safe-top));z-index:3;background:var(--menu-base);padding:4px 8px 8px;max-height:220px;overflow:auto;border:1px solid var(--menu-line)}
.hud-editor-tools .dialog-header{position:static;margin:0 0 4px;padding:0;min-height:48px}.hud-editor-tools .dialog-header h2{font-size:20px}
.hud-editor-fields{display:grid;grid-template-columns:minmax(100px,1.5fr) repeat(3,minmax(48px,1fr));gap:8px}
.hud-editor-fields label{font-size:12px;display:grid;gap:2px;min-width:0}.hud-editor-fields input,.hud-editor-fields select{padding:4px;font-size:14px}
.hud-editor-actions{display:flex;gap:8px;margin-top:8px}.hud-editor-actions button{min-height:48px;min-width:48px;flex:1;padding:8px 6px;font-size:12px;white-space:nowrap}.hud-editor-actions .primary-button{justify-content:center}
#hud-editor-status{font-size:12px;line-height:1.4;margin-top:4px;color:var(--menu-muted)}
#hud-editor-stage{position:absolute;inset:0;pointer-events:none}
.hud-edit-control{position:absolute;min-width:48px;min-height:48px;padding:4px;font-size:12px;line-height:1.3;border:1px solid var(--menu-line);background:var(--menu-surface);color:var(--cream);touch-action:none;pointer-events:auto;user-select:none}
.hud-edit-control[aria-pressed=true]{border:2px solid var(--yellow);color:var(--yellow)}
.race-hud .drive-button.hud-custom{position:fixed!important;inset:auto;min-width:48px;min-height:48px;max-width:none;max-height:none;margin:0;z-index:4}
@media(max-width:700px){
  .garage-tabs{gap:0;padding:0 4px}.garage-tabs button{min-width:48px;padding-inline:4px;font-size:11px;flex:1}
  .garage-footer{gap:8px}.garage-footer p{display:none}.garage-footer #garage-done{max-width:none;flex:1}.garage-footer #garage-test-drive{flex:1;font-size:13px}
  .garage-weapon-slots{margin-bottom:0}.garage-weapon-slots button{min-height:60px}
  .operations-header{padding:8px 12px;gap:16px}.operations-header h1{font-size:22px}
  .operations-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:0 8px;padding:0 12px}.operations-tabs button{min-width:0;min-height:48px;font-size:13px}
  #operations-content{padding:16px}.operation-section{margin-bottom:24px}.operation-section h3{font-size:21px}.operation-section>p{font-size:14px}
  .operation-row{gap:12px;padding:16px 0}.operation-row h4{font-size:15px}.operation-row p{font-size:13px}.operation-row button{min-width:80px;padding:8px;font-size:12px}
  #operations-status{padding:8px 16px;font-size:12px}
}
@media(max-width:700px) and (orientation:portrait){
  .garage{grid-template-rows:minmax(64px,max-content) minmax(64px,max-content) minmax(0,1fr) minmax(64px,max-content)}
  .garage-header{gap:12px;padding:8px 12px}.garage-header h1{font-size:22px}.garage-balance span{display:none}.garage-balance strong{font-size:18px}
  .garage-tabs{display:none}.garage-category{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;padding:8px 12px;border-bottom:1px solid var(--menu-line)}
  .garage-category label{font-size:14px;font-weight:700}.garage-category select{flex:1;min-width:0;min-height:48px;padding:8px 12px;border:1px solid var(--menu-line);border-radius:4px;background:var(--menu-surface);font:inherit;font-size:16px;color:var(--cream)}
  .garage-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(64px,1fr) minmax(80px,.65fr) minmax(96px,1fr)}
  .garage-preview{grid-column:1;grid-row:1}.equipment-detail{grid-column:1;grid-row:2;padding:12px 16px;border:0;border-top:1px solid var(--menu-line);overflow:auto}
  .equipment-detail h2{font-size:21px;line-height:1.2;margin-bottom:6px}.equipment-detail>p{font-size:13px;line-height:1.5}.equipment-detail dl{display:flex;flex-wrap:wrap;gap:12px;margin:8px 0;padding:0;border:0}.equipment-detail dt{font-size:11px}.equipment-detail dd{font-size:14px}
  .garage-list{grid-column:1;grid-row:3;display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:8px;border:0;border-top:1px solid var(--menu-line);padding:8px 12px}
  .equipment-choice{min-height:64px;padding:8px;margin:0;gap:8px}.equipment-choice .equipment-name{font-size:13px;line-height:1.4}.equipment-choice .equipment-meta{font-size:11px}.equipment-icon{width:28px;height:28px}
  .garage[data-active-tab=presets] .garage-list{display:block}.garage[data-active-tab=presets] .garage-workspace{grid-template-rows:minmax(64px,.7fr) minmax(64px,.35fr) minmax(120px,1.4fr)}
  .preview-controls{left:auto;right:12px;bottom:8px;top:auto;transform:none;flex-direction:row;gap:8px}.preview-controls .icon-button{width:48px;height:48px;min-height:48px}
  .garage-footer{padding:8px 12px}.garage-footer #garage-test-drive,.garage-footer #garage-done{font-size:14px;padding:8px}
}
@media(max-width:400px) and (orientation:portrait){
  .garage-header .garage-back-button{width:48px;min-width:48px;padding:8px}.garage-header #garage-back-label{display:none}
}
@media(max-height:500px) and (min-width:500px){
  #title-screen{padding:0;gap:0 28px}
  #title-actions{gap:8px}#title-actions .home-action,#title-actions #garage-open{min-height:48px;padding:6px 12px}#title-actions .home-play{min-height:52px}
  .operations-header{padding:4px 12px;gap:16px}.operations-header h1{font-size:22px}
  .operations-tabs{display:flex;justify-content:space-between;gap:8px;padding:0 12px}.operations-tabs button{min-height:48px;min-width:64px;padding:6px;font-size:12px}
  #operations-content{padding:12px 24px}.operation-section{margin-bottom:24px}
  .hud-editor-tools{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px;max-height:120px;padding:4px 8px;overflow:auto}
  .hud-editor-tools .dialog-header{grid-column:1;grid-row:1;margin:0}.hud-editor-fields{grid-column:2;grid-row:1/3;align-self:start}.hud-editor-actions{grid-column:1;grid-row:2;margin:0}.hud-editor-actions button{font-size:11px;padding:4px}
  #hud-editor-status{grid-column:2;grid-row:2;align-self:end;line-height:1.2;font-size:10px;margin-top:4px;pointer-events:none}
}
@media(prefers-reduced-motion:reduce){#title-actions .home-action{transition:none}}
@media(max-height:500px) and (min-width:500px){
  #title-screen{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:8px;padding:0}
  #title-screen .masthead{grid-column:1;grid-row:1;width:min(44vw,320px);height:100%;max-height:100%;justify-self:center;align-self:center}
  #title-screen #game-title{height:100%}#title-logo{height:100%;max-height:100%;object-position:center}
  #title-actions{grid-column:1;grid-row:2;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0;margin:0}
  #title-actions .home-action,#title-actions #garage-open{min-height:48px;padding:6px 12px;gap:8px}
  #title-actions .home-play{min-height:52px}
  #title-actions .home-action>.illustrated-icon,#title-actions .home-action>svg:not(:last-child){display:none}
  #title-status{grid-row:3;grid-column:1}
}

/* A persistent account entrance, not another main-menu panel. The account
   label can grow with text size; the title artwork yields the extra space. */
#menu.game-front{grid-template-rows:minmax(48px,max-content) minmax(0,1fr) 24px}
#menu.game-front .toolbar-buttons{min-width:0;flex:1;justify-content:flex-end;align-items:center;gap:8px}
#menu.game-front .menu-toolbar .icon-button{flex:none}
#menu.game-front .account-entry{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;min-width:96px;max-width:240px;min-height:48px;width:200px;padding:5px 12px;background:var(--menu-base);border:1px solid var(--menu-line);border-radius:6px;text-align:left;color:var(--menu-text);line-height:1.25;touch-action:manipulation}
#menu.game-front .account-entry-label{font-size:12px;font-weight:600;line-height:1.25;color:var(--menu-muted)}
#account-entry-status{display:block;width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:750;line-height:1.25}
#menu.game-front .account-entry[data-account-state=signed-in]{border-color:var(--yellow)}
#menu.game-front .account-entry:focus-visible{outline:3px solid var(--cream);outline-offset:3px}
#menu.game-front .account-entry:hover{background:var(--menu-raised);border-color:var(--cream)}
#menu.game-front .account-entry:active{background:var(--cream);color:var(--ink)}
#menu.game-front .account-entry:active .account-entry-label{color:var(--ink)}
.account-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
#operation-account{overflow-wrap:anywhere}
@media(max-width:600px){
  #menu.game-front .menu-toolbar{gap:8px}
  #menu.game-front .back-link{width:48px;flex:none;justify-content:center;padding:0}
  #menu.game-front .back-link span{display:none}
  #menu.game-front .account-entry{max-width:220px;width:100%;padding-inline:8px}
}

/* PATTALIUM LEGAL START */
/* Shared local privacy controls. Scoped so each experience keeps its own design. */
.ptl-legal{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;gap:4px 18px;width:100%;min-width:0;padding:12px 0;font:400 12px/1.5 system-ui,sans-serif;letter-spacing:normal;text-transform:none;color:inherit}
.ptl-legal>span{white-space:nowrap}.ptl-legal nav{display:flex;flex-wrap:wrap;align-items:center;gap:2px 14px}.ptl-legal a{display:inline-flex;align-items:center;min-height:32px;padding:2px 0;color:inherit;font:inherit;text-decoration:underline;text-underline-offset:3px}.ptl-legal a:focus-visible{outline:2px solid currentColor;outline-offset:4px}.ptl-legal--standalone{padding:16px 24px;flex:none}.ptl-legal--compact{width:auto;gap:4px 14px;padding:4px 0}.ptl-legal--compact a{min-height:32px}
.ptl-privacy-dialog{box-sizing:border-box;position:fixed;inset:0;z-index:2147483000;width:min(580px,calc(100% - 24px));max-width:calc(100% - 24px);max-height:calc(100dvh - 32px);height:auto;margin:auto;padding:24px;overflow:auto;overscroll-behavior:contain;border:1px solid #9b90a8;border-radius:4px;background:#f8f5fa;color:#251c30;font:400 15px/1.6 system-ui,sans-serif;letter-spacing:normal;text-transform:none;text-align:left;color-scheme:light;isolation:isolate}
.ptl-privacy-dialog::backdrop{background:rgb(12 8 18 / .7)}.ptl-privacy-dialog *{box-sizing:border-box}.ptl-privacy-dialog .ptl-privacy-heading{display:flex;align-items:start;justify-content:space-between;gap:16px}.ptl-privacy-dialog h2{margin:0;font:600 23px/1.3 system-ui,sans-serif;color:inherit;letter-spacing:-.025em}.ptl-privacy-dialog h3{margin:0 0 6px;font:600 16px/1.4 system-ui,sans-serif;color:inherit}.ptl-privacy-dialog p{margin:12px 0;max-width:none;font:inherit;color:inherit}.ptl-privacy-dialog .ptl-privacy-essential{padding:16px 0;border-block:1px solid #d6cedd;margin:16px 0}.ptl-privacy-essential p{margin:0}.ptl-privacy-dialog button{appearance:none;display:inline-flex;align-items:center;justify-content:center;position:static;width:auto;min-height:44px;margin:0;padding:9px 14px;border:1px solid #92839f;border-radius:4px;background:#eee7f3;color:#251c30;font:600 14px/1.4 system-ui,sans-serif;letter-spacing:normal;text-transform:none;cursor:pointer;transform:none;box-shadow:none}.ptl-privacy-dialog button:hover{background:#e1d6e9}.ptl-privacy-dialog button:focus-visible,.ptl-privacy-dialog a:focus-visible,.ptl-privacy-dialog input:focus-visible{outline:3px solid #684886;outline-offset:3px}.ptl-privacy-dialog .ptl-privacy-close{background:transparent;flex:none}.ptl-privacy-dialog .ptl-privacy-actions{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0 0}.ptl-privacy-dialog .ptl-privacy-actions button{flex:1 1 auto}.ptl-privacy-dialog .ptl-privacy-links{display:flex;flex-wrap:wrap;gap:0 18px;border-top:1px solid #d6cedd;padding-top:12px;margin-top:16px}.ptl-privacy-dialog a{display:inline-flex;align-items:center;min-height:40px;color:#50356c;font:500 14px/1.5 system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px}.ptl-privacy-dialog small{display:block;margin-top:12px;font:400 12px/1.5 system-ui,sans-serif}.ptl-privacy-dialog .ptl-privacy-option{display:flex;align-items:start;gap:12px;margin:16px 0;cursor:pointer}.ptl-privacy-option input{appearance:auto;flex:none;width:22px;height:22px;margin:2px 0;accent-color:#684886}.ptl-privacy-option span{display:block}.ptl-privacy-dialog .ptl-privacy-status:empty{display:none}
@media(max-width:420px){.ptl-privacy-dialog{padding:18px}.ptl-privacy-dialog .ptl-privacy-heading{gap:10px}.ptl-privacy-dialog h2{font-size:21px}.ptl-privacy-dialog .ptl-privacy-actions{flex-direction:column}}
@media(forced-colors:active){.ptl-privacy-dialog,.ptl-privacy-dialog button{border:1px solid CanvasText;background:Canvas;color:CanvasText}}

/* PATTALIUM LEGAL END */

.ptl-racer-footer{position:absolute;bottom:34px;left:24px;right:24px;z-index:5;color:#f7f3e8}.ptl-racer-footer .ptl-legal{justify-content:center}.ptl-racer-footer a{color:inherit}@media(max-width:600px){.ptl-racer-footer{position:relative;bottom:auto;left:auto;right:auto;margin:0 18px}.menu-credit{position:relative!important;bottom:auto!important}}

/* Keep legal actions above the controller connection hint. */
body:has(.ptl-pad-hint:not([hidden])) .ptl-legal{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))}
