*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#101c2d;color:#f1f6f5;font-family:'Malgun Gothic',system-ui,sans-serif}button,input{font:inherit}button{border:1px solid #ffffff22;background:#26384b;color:#e8f2f4;border-radius:14px;min-height:46px;padding:10px 18px;font-weight:800;cursor:pointer;touch-action:manipulation;transition:background .15s,transform .15s}button:hover{background:#3d5266}button:active,button.held{transform:translateY(2px);background:#5c7180}button:focus-visible{outline:3px solid #9ef5dc;outline-offset:3px}button:disabled{opacity:.42;cursor:default}button[hidden],[hidden]{display:none!important}#game{height:100%;height:100dvh;display:flex;flex-direction:column;max-width:1440px;margin:auto;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));gap:8px}header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;padding:0 8px;min-height:49px}header small{font-size:9px;letter-spacing:2.5px;color:var(--accent,#ffbb88)}h1{font-size:18px;line-height:1.2;margin:4px 0 0}nav{display:flex;gap:7px}nav button{min-height:40px;padding:7px 12px;font-size:13px}.dashboard{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:9px 16px;background:#ffffff08;border:1px solid #ffffff0c;border-radius:12px;min-height:43px}.dashboard strong{font-size:19px;color:var(--accent,#ffbb88);white-space:nowrap}.dashboard span{font-size:13px;color:#cfdee5;font-weight:700}.dashboard b{color:#fdab86;letter-spacing:4px;white-space:nowrap}.stage{position:relative;flex:1;min-height:0;overflow:hidden;background:#182e44;border:1px solid #ffffff16;border-radius:20px;box-shadow:0 9px 40px #0003}canvas{width:100%;height:100%;display:block;outline:0;touch-action:none}#overlay{position:absolute;inset:0;display:flex;align-items:center}#poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.shade{position:absolute;inset:0;background:linear-gradient(90deg,#0c1727f5 0%,#0c1727d9 35%,#0c17273b 78%)}.panel{position:relative;padding:clamp(20px,4vw,54px);max-width:590px;max-height:100%;overflow:auto}.panel>small{color:var(--accent);font-size:13px;letter-spacing:2px;font-weight:800}.panel h2{font-size:clamp(27px,4vw,49px);line-height:1.12;letter-spacing:-2px;margin:16px 0}.panel p{color:#dce8ed;font-size:15px;line-height:1.8;max-width:430px;margin:12px 0}.panel .control-guide{font-size:13px;color:#a2c7d4;line-height:1.65;border-left:2px solid var(--accent);padding-left:12px}#record{font-size:12px;color:#e8d7b6;margin:17px 0}.menu-buttons{display:flex;gap:10px;flex-wrap:wrap}.primary{background:var(--accent,#ffbe88);color:#122134;min-height:51px;box-shadow:0 7px 25px #0002;padding:13px 25px}.primary:hover{background:#fff0bc}.garage{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.garage button{font-size:12px;min-height:38px;padding:8px 12px}.garage span{width:100%;font-size:12px;color:#bdd2df}.controls{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0;min-height:66px;padding:4px 8px}.steering,.actions{display:flex;gap:10px}.controls button{min-height:56px;min-width:64px;font-size:17px;border-bottom:3px solid #0a1424;user-select:none;-webkit-user-select:none;touch-action:none}.controls #action{background:var(--accent);color:#182738;min-width:115px;font-size:14px}.controls #nitro{background:#74dfe1;color:#152733;font-size:13px;min-width:74px}.controls p{font-size:11px;color:#9ab4c6;max-width:250px;text-align:center;line-height:1.6;pointer-events:none}#countdown{position:absolute;inset:0;display:grid;place-items:center;background:#0a152d44;font-size:100px;font-weight:950;text-shadow:0 5px 35px #0008;color:#fff1c9;pointer-events:none}dialog{border:1px solid #7a8fa3;border-radius:22px;background:#172b40;color:#f1f5f3;max-width:90vw;width:390px;padding:27px;box-shadow:0 20px 90px #0009}dialog::backdrop{background:#07101dbb}dialog h2{margin:0 0 24px}dialog label{display:grid;grid-template-columns:1fr auto;gap:13px;font-size:15px;margin:20px 0}dialog input{grid-column:1/-1;width:100%;accent-color:var(--accent);min-height:30px}dialog output{grid-column:2;grid-row:1;font-size:14px;color:var(--accent)}dialog p{font-size:12px;color:#a9c0cf}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:600px){#game{gap:5px;padding-left:6px;padding-right:6px}header{min-height:45px}h1{font-size:16px}header small{font-size:8px}nav button{padding:6px 10px}.dashboard{padding:8px 10px;gap:7px}.dashboard strong{font-size:15px}.dashboard span{font-size:11px}.dashboard b{font-size:12px;letter-spacing:2px}.stage{border-radius:15px}.panel{padding:22px;align-self:flex-end;padding-bottom:27px;max-width:100%}.panel h2{font-size:32px;margin:12px 0}.panel p{font-size:13px;line-height:1.65}.panel .control-guide{font-size:11px}.shade{background:linear-gradient(0deg,#0b1828fa 4%,#0b1828e8 45%,#0c172710 100%)}#poster{object-position:60% 20%}.controls{padding:4px 0;gap:6px}.controls p{display:none}.controls button{min-width:58px;min-height:58px;padding:10px}.steering,.actions{gap:7px}.controls #action{min-width:96px}.controls #nitro{min-width:68px}.primary{min-height:48px}.panel #record{margin:11px 0}}@media(max-height:480px){header{min-height:32px}header small{display:none}h1{font-size:14px}nav button{min-height:32px}.dashboard{min-height:30px;padding:4px 12px}.dashboard strong{font-size:15px}.controls{min-height:48px;padding:0}.controls button{min-height:44px}.panel{padding:15px 26px}.panel>small{font-size:10px}.panel h2{font-size:27px;margin:6px 0}.panel p{font-size:12px;line-height:1.4;margin:6px 0;max-width:480px}.panel #record{margin:7px 0}.primary{min-height:39px;padding:8px 20px}.garage{margin-top:6px}.panel .control-guide{font-size:10px}}

.actions{margin-left:auto}

/* 2026 art edition: instrument panels and a full-width cinematic stage. */
body{background:radial-gradient(ellipse at 50% 0,#233345,#080e17 65%)}#game{max-width:1600px;gap:7px;padding-top:max(10px,env(safe-area-inset-top))}header{padding:2px 12px 6px;border-bottom:1px solid #ffffff12}header small{font-size:10px;font-weight:800;letter-spacing:3px}h1{font-size:20px;letter-spacing:-.7px}button{border-radius:7px;background:linear-gradient(160deg,#344657,#182536);box-shadow:inset 0 1px #ffffff14,0 3px 7px #0003}.dashboard{border-radius:6px;background:linear-gradient(110deg,#172333,#0c1623);border-color:#52627244;padding:10px 18px;box-shadow:inset 3px 0 var(--accent)}.dashboard strong{font-variant-numeric:tabular-nums;font-size:22px;letter-spacing:1px}.dashboard span{font-size:14px;color:#e3edf3}.stage{border-radius:9px;border-color:#7994aa44;box-shadow:0 16px 42px #0007}.shade{background:linear-gradient(90deg,#06101af2,#07121ac9 32%,#07121a14 76%)}.panel{max-width:660px}.panel>small{display:inline-block;padding:6px 10px;background:#061321bb;border:1px solid #d9ecf033;border-radius:3px;font-size:12px}.panel h2{font-size:clamp(31px,4.8vw,64px);letter-spacing:-3px;text-shadow:0 3px 20px #0008;max-width:550px}.panel p{font-size:16px;color:#edf4f5}.panel .control-guide{color:#d0e1e9;background:#07121b99;padding:10px 14px;border-radius:0 5px 5px 0}.primary{background:var(--accent);border-color:#ffffff66;font-size:16px;box-shadow:0 5px 24px #0005}.controls{background:linear-gradient(180deg,#1e2b39,#101a26);border:1px solid #60758938;border-radius:8px;padding:8px}.controls button{min-width:70px;border-bottom:3px solid #030912;border-radius:6px}.controls #action{box-shadow:inset 0 1px #ffffff77,0 3px 12px #0005}.controls p{color:#c8d8e4;font-size:12px;max-width:430px}#countdown{font-style:italic;letter-spacing:-6px;background:#0713261a;color:#fff;filter:drop-shadow(0 0 15px #0007)}
@media(max-width:600px){header{padding:0 6px 4px;min-height:43px}h1{font-size:16px}header small{font-size:8px}.dashboard{padding:8px 10px}.dashboard strong{font-size:16px}.dashboard span{font-size:11px}.stage{border-radius:7px}.panel{padding:22px 20px}.panel h2{font-size:38px;letter-spacing:-2px}.panel p{font-size:13px}.shade{background:linear-gradient(0deg,#06101afc,#06101ae0 40%,#06101a20 100%)}.controls{padding:6px}.controls button{min-width:55px;min-height:57px}.controls #action{min-width:92px}.controls #nitro{min-width:65px}.controls .actions,.controls .steering{gap:6px}}
@media(max-height:480px){#game{padding-top:4px;gap:4px}header{min-height:29px;padding:0 8px}.dashboard{padding:4px 12px;min-height:29px}.dashboard strong{font-size:15px}.controls{padding:3px}.controls button{min-height:40px}.panel{padding:12px 25px}.panel h2{font-size:31px;margin:8px 0}.panel p{font-size:12px}.panel .control-guide{padding:5px 10px}.panel>small{padding:3px 7px}.primary{min-height:40px;font-size:14px}}

/* Stage and objective instruments stay legible throughout play. */
.dashboard{display:grid;grid-template-columns:auto 1fr auto auto;gap:18px;min-height:62px}.dashboard small{display:block;font-size:10px;font-weight:800;letter-spacing:1.5px;color:#9db5c9;margin-bottom:3px}.dashboard #goal{font-size:16px;font-weight:800;line-height:1.45;text-align:center;color:#fff4ce}.dashboard .score-meter{text-align:right}.dashboard #score{font-size:25px;color:#fff;text-shadow:0 0 12px #b4e6ff44}.dashboard #stageLabel{color:var(--accent)}
#overlay.is-result #poster{display:none}#overlay.is-result .shade{background:#04131ac4}#overlay.is-result{justify-content:center}#overlay.is-result .panel{background:linear-gradient(145deg,#1a3049f5,#0c1728f5);border:1px solid #8edbff55;border-radius:18px;max-width:720px;width:95%;box-shadow:0 20px 80px #0008}#overlay.is-result #next{order:-1;min-width:240px}#overlay.is-result h2{font-size:clamp(28px,4vw,48px)}.car-shop{width:100%;display:grid;gap:6px}.garage .car-option{white-space:pre-line;text-align:left;font-size:12px;line-height:1.6;padding:9px 12px;border-color:#557184}.garage .car-option.selected{border-color:var(--accent);color:#fff0c9;background:#244259}.garage #wallet{font-size:14px;color:#fff0c9}.garage button{min-height:44px}.panel:has(.garage:not([hidden])){max-width:730px}.panel:has(#cars:not([hidden])) h2{font-size:35px;margin:8px 0}.panel:has(#cars:not([hidden])) p{font-size:13px;margin:6px 0}
@media(max-width:600px){.dashboard{grid-template-columns:auto 1fr auto;gap:6px;padding:8px;min-height:78px}.dashboard #goal{grid-column:1/-1;grid-row:2;font-size:13px;text-align:left}.dashboard .score-meter{grid-column:2;grid-row:1}.dashboard #health{grid-column:3;grid-row:1}.dashboard strong{font-size:17px}.dashboard #score{font-size:22px}.dashboard small{font-size:9px}.panel:has(#cars:not([hidden])){align-self:stretch;padding:14px}.panel:has(#cars:not([hidden])) .control-guide{display:none}.panel:has(#cars:not([hidden])) h2{font-size:28px}.panel:has(#cars:not([hidden])) .garage{margin-top:8px}#overlay.is-result .panel{align-self:center;padding:20px}.garage .car-option{font-size:11px;padding:7px 10px}.panel:has(#cars:not([hidden])) .menu-buttons{position:sticky;top:0;z-index:2;background:#0b1c2ce8;padding:4px 0}}
@media(max-height:480px){.dashboard{min-height:43px;grid-template-columns:auto 1fr auto auto}.dashboard #goal{grid-column:auto;grid-row:auto;font-size:12px}.dashboard small{font-size:8px}.dashboard #score{font-size:18px}.dashboard .score-meter,.dashboard #health{grid-column:auto;grid-row:auto}.panel:has(#cars:not([hidden])){max-width:100%;display:block}.car-shop{grid-template-columns:repeat(3,1fr)}}

/* Mobile controls and garage: keep actions reachable without covering the course. */
#game[data-state="menu"] .controls,#game[data-state="paused"] .controls,#game[data-state="over"] .controls{display:none}
.garage-tabs,.upgrade-options{display:flex;gap:8px;flex-wrap:wrap;width:100%}.garage-tabs button{flex:1;min-height:48px;font-size:13px}.garage-tabs [aria-pressed="true"]{border-color:var(--accent);background:#365267;color:#fff2d0}.upgrade-options button{min-height:48px;font-size:13px}.garage #purchaseStatus{color:#b0f4d4;line-height:1.5;font-size:13px;min-height:20px}.garage .car-option{font-size:13px;min-height:56px}.garage:has(#garageTabs:not([hidden])){margin-top:8px}
.panel{overscroll-behavior:contain;scrollbar-width:thin}#overlay.is-result .menu-buttons{position:sticky;top:0;background:#12263af5;z-index:3;padding:8px 0}#overlay.is-result .menu-buttons button{min-height:48px}
@media(max-width:600px){.panel:has(#garageTabs:not([hidden])){align-self:stretch;padding:14px}.panel:has(#garageTabs:not([hidden])) h2{font-size:28px;margin:8px 0}.panel:has(#garageTabs:not([hidden])) .control-guide{display:none}.panel:has(#garageTabs:not([hidden])) .menu-buttons{position:sticky;top:0;z-index:2;background:#0b1c2cf5;padding:5px 0}.garage .car-option{font-size:12px;line-height:1.5;padding:10px}.upgrade-options button{flex:1 1 130px}.panel h2{overflow-wrap:anywhere}.dashboard #goal{overflow-wrap:anywhere}.controls #nitro{min-width:85px}.controls #action{min-width:108px}.controls button{min-height:60px}#overlay.is-result #next{min-width:0;width:100%}#overlay.is-result .panel{padding:16px}}
@media(max-height:480px) and (min-width:601px){#game{position:relative;display:grid;grid-template-columns:minmax(180px,.8fr) minmax(0,2fr);grid-template-rows:48px minmax(0,1fr);padding:4px max(6px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));gap:4px}header{min-width:0;padding:0 4px;gap:6px;border:0}header h1{font-size:13px;margin:0}header nav{gap:4px}header nav button{min-height:44px;padding:6px 8px;font-size:12px}.dashboard{min-width:0;min-height:0;padding:4px 8px;gap:8px}.dashboard #goal{font-size:11px}.dashboard strong{font-size:14px}.dashboard #score{font-size:17px}.stage{grid-column:1/-1;width:100%;height:100%}.controls{position:absolute;inset:auto 8px max(8px,env(safe-area-inset-bottom));background:none;border:0;padding:0;pointer-events:none;min-height:0;z-index:2}.controls button{pointer-events:auto;min-height:54px;min-width:55px;padding:8px;opacity:.94}.controls .steering,.controls .actions{gap:5px}.controls #action{min-width:85px}.controls #nitro{min-width:80px}.controls p{display:none}.garage .car-option{min-height:60px}.panel{max-width:100%;width:100%}.panel h2{font-size:25px}.panel:has(#garageTabs:not([hidden])){max-width:100%}.garage-tabs{max-width:350px}.car-shop{grid-template-columns:repeat(3,minmax(0,1fr))}.panel:has(#garageTabs:not([hidden])) .control-guide{display:none}#overlay.is-result .panel{width:96%;max-width:none}.menu-buttons{gap:8px}}

@media(max-height:480px) and (min-width:601px){#game{grid-template-columns:230px minmax(0,1fr)}header h1{white-space:nowrap;font-size:12px;letter-spacing:-.4px}header #sound{font-size:0;min-width:44px}header #sound::after{content:"♫";font-size:17px}header #pause{min-width:44px}.controls .steering,.controls .actions{flex-direction:column}.controls #action,.controls #nitro,.controls .steering button{min-width:80px}}

@media(max-width:600px){header nav button{min-width:44px;min-height:44px}.garage-tabs button{min-width:0}}

/* Real vehicle and component artwork in the garage. */
.garage-image{display:block;width:100%;height:88px;object-fit:contain;pointer-events:none;margin:0 auto 7px}.garage .car-option{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;white-space:pre-line;line-height:1.55;padding:10px;border-radius:12px;background:linear-gradient(145deg,#263f54,#112335);min-width:0}.garage .car-option.selected{background:linear-gradient(145deg,#3c5567,#1d3346);box-shadow:inset 0 0 0 1px var(--accent)}.garage .car-option:disabled{opacity:.7}.upgrade-options .part-card{flex:1 1 170px;min-width:0;white-space:normal;line-height:1.5;padding:10px;background:linear-gradient(145deg,#263f54,#112335)}.part-card .garage-image{height:100px}
@media(max-width:600px){.car-shop{grid-template-columns:1fr}.garage .car-option{display:grid;grid-template-columns:115px 1fr;align-items:center;text-align:left;gap:8px;font-size:13px}.car-option .garage-image{width:115px;height:65px;margin:0}.upgrade-options .part-card{flex-basis:130px}.part-card .garage-image{height:85px}}
@media(max-height:480px) and (min-width:601px){.car-shop{grid-template-columns:repeat(3,minmax(0,1fr))}.car-option .garage-image{height:65px}.part-card .garage-image{height:70px}}

@media(min-width:601px) and (min-height:481px){.car-shop{grid-template-columns:repeat(3,minmax(0,1fr))}.panel:has(#garageTabs:not([hidden])){max-width:820px;padding:24px 30px}.panel:has(#garageTabs:not([hidden])) h2{font-size:35px;margin:8px 0}.panel:has(#garageTabs:not([hidden])) p{font-size:13px;margin:6px 0;max-width:650px}.garage .car-option{text-align:center}.part-card .garage-image{height:88px}}

/* Keep garage navigation reachable on short/touch screens without covering cards. */
.car-copy{display:flex;flex-direction:column;gap:3px;min-width:0;white-space:normal}.car-copy strong{font-size:14px;color:#f5f4e9;white-space:nowrap}.car-state{font-size:13px;word-break:keep-all;color:#fff0c5}.car-copy small{font-size:12px;line-height:1.45;word-break:keep-all;color:#dae7ed}
@media(max-width:600px),(max-height:480px){.panel:has(#garageTabs:not([hidden])) .menu-buttons{position:sticky;top:0;z-index:8;background:#0c2034;padding:5px 0;min-height:54px}.garage:has(#garageTabs:not([hidden])) #wallet{position:sticky;top:var(--garage-menu-h,66px);z-index:7;background:#0c2034;padding:5px 6px;border-radius:5px;line-height:1.5;min-height:30px}.garage-tabs{position:sticky;top:calc(var(--garage-menu-h,66px) + var(--garage-wallet-h,36px));z-index:6;background:#0c2034;padding:4px 0;max-width:none}.garage-tabs button{min-height:48px}.garage .car-option{scroll-margin-top:170px}.car-copy{width:100%}.part-card{scroll-margin-top:170px}}
@media(max-width:360px){.garage .car-option{grid-template-columns:90px minmax(0,1fr);gap:7px;padding:9px}.car-option .garage-image{width:90px;height:60px}.car-copy strong{font-size:13px}.car-state{font-size:12px}.car-copy small{font-size:11px}.panel:has(#garageTabs:not([hidden])) h2{font-size:24px}.panel:has(#garageTabs:not([hidden])) p{font-size:12px;line-height:1.6}}
