
/* Startup gate: platform language/save state is resolved before the game interface is shown. */
.is-booting{overflow:hidden;background:#071018}
.is-booting #app{visibility:hidden;pointer-events:none}
.boot-screen{position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;background:radial-gradient(circle at 50% 42%,#12303b 0,#091720 38%,#050b11 100%);color:#eef7f7;font-family:Arial,Helvetica,sans-serif}
.boot-screen[hidden]{display:none!important}
.boot-logo{width:72px;height:58px;display:grid;place-items:center;border-radius:16px 5px 16px 5px;background:#ee6239;color:#fff8e7;font-size:35px;font-weight:950;letter-spacing:-2px;transform:skew(-7deg);box-shadow:0 0 34px #ee623948,inset 0 -4px 0 #b94326}
.boot-screen strong{font-size:17px;letter-spacing:2.2px}.boot-screen span{margin-top:5px;color:#88a9b5;font-size:10px;font-weight:900;letter-spacing:2px}
:root{font-family:Arial,Helvetica,sans-serif;color:#18383e;background:#eef1ed;font-synthesis:none;--ink:#18383e;--muted:#647773;--orange:#ee6239;--line:#dce3dc;--cream:#f8faf5;--teal:#19675f}*{box-sizing:border-box}body{margin:0}button{font:inherit;cursor:pointer}button:disabled{cursor:default}button:focus-visible{outline:3px solid #00999b;outline-offset:4px}button,input{-webkit-tap-highlight-color:transparent}button{touch-action:manipulation}button,canvas{-webkit-user-select:none;user-select:none}[hidden]{display:none!important}.game-shell{max-width:1680px;margin:auto;min-height:100dvh;display:flex;flex-direction:column}.topbar{position:relative;min-height:87px;background:#f8faf5;display:flex;align-items:center;padding:16px 3.1%;gap:28px;z-index:2;border-bottom:1px solid #d3ded7}.brand{display:flex;align-items:center;gap:13px;margin-right:auto;white-space:nowrap}.brand-badge{width:54px;height:44px;background:var(--orange);color:#fff8e7;font-size:28px;font-weight:950;letter-spacing:-2px;display:grid;place-items:center;border-radius:12px 3px 12px 3px;transform:skew(-7deg);box-shadow:inset 0 -3px 0 #cf4929}.brand>div{display:flex;flex-direction:column;gap:6px}.brand strong{font-size:20px;font-weight:900;letter-spacing:1.6px}.brand>div>span{font-size:12px;font-weight:700;letter-spacing:1.3px;color:var(--muted)}.wallet{display:flex;align-items:center;gap:9px;padding:11px 19px;border:1px solid #e0e6d9;border-radius:25px;background:#eef1e6}.wallet>span{color:#b38717;font-size:25px;line-height:1}.wallet b{font-size:21px;letter-spacing:-.4px;font-variant-numeric:tabular-nums}.wallet small{font-size:12px;color:#60736e}.top-actions{display:flex;gap:8px}.icon-btn{border:1px solid #d8e1da;background:transparent;border-radius:50%;width:36px;height:36px;color:var(--ink);font-size:19px;font-weight:bold;transition:.15s}.icon-btn:hover{background:#e7ece6}.icon-btn.active{color:#e45c36;border-color:#e45c36}.arena{position:relative;isolation:isolate;min-height:380px;height:clamp(380px,52dvh,620px);overflow:hidden;background:#b5d9d8}.arena canvas{width:100%;height:100%;display:block;touch-action:none}.world-label{position:absolute;top:29px;left:3.1%;display:flex;gap:12px;align-items:center;pointer-events:none}.section-mark{width:37px;height:37px;display:grid;place-items:center;font-size:14px;font-weight:800;border:1px solid #335e6560;border-radius:9px}.world-label>div{display:flex;flex-direction:column;gap:5px}.eyebrow{font-size:12px;font-weight:800;letter-spacing:1.8px;line-height:1.4}.world-label b{font-size:15px}.world-label .eyebrow{color:#47777a;font-size:12px}.record-box{position:absolute;right:3.1%;top:27px;text-align:right;pointer-events:none;display:flex;flex-direction:column;gap:4px}.record-box .eyebrow{font-size:12px;color:#47777a}.record-box>b{font-size:28px;letter-spacing:-1px;font-variant-numeric:tabular-nums}.record-box small{font-size:15px;color:#5f7878;letter-spacing:0}.start-hint{position:absolute;left:7%;top:24%;max-width:450px;pointer-events:none;transition:opacity .3s}.start-hint>.eyebrow{color:#497978;font-size:12px}.start-hint h1{font-size:clamp(30px,3.8vw,57px);font-weight:850;line-height:1.06;letter-spacing:-2.6px;margin:17px 0 15px}.start-hint h1 em{font-style:normal;color:#d95a34}.start-hint p{font-size:14px;line-height:1.7;color:#456f70;margin:0}.hud{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;gap:28px;align-items:center;padding:10px 20px;background:#eef4e9;border:1px solid #d8e2d6;border-radius:16px;box-shadow:0 3px 12px #1a434012;pointer-events:none;z-index:3}.hud>div{display:flex;flex-direction:column;gap:2px;min-width:70px}.hud span{font-size:12px;letter-spacing:1.4px;font-weight:800;color:#6c847e}.hud strong{font-size:28px;line-height:1.2;font-variant-numeric:tabular-nums}.hud small{font-size:12px;font-weight:500}.hud .star-counter{display:flex;flex-direction:row;align-items:center;gap:8px;color:#bb8014;font-size:24px;min-width:30px}.hud .star-counter b{font-size:20px;color:var(--ink)}.track-progress{position:absolute;bottom:19px;left:3.1%;right:3.1%;display:flex;gap:12px;align-items:center;pointer-events:none}.track-progress>span{font-size:12px;font-weight:800;letter-spacing:1.2px;white-space:nowrap;color:#f8f5e7;text-shadow:0 1px 4px #29392f66}.track-progress>div{height:3px;flex:1;background:#fff8}.track-progress i{display:block;height:100%;width:0;background:#ffe19b;transition:width .15s}.pit{padding:24px 3.1% 0;background:var(--cream);flex:1}.pit-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.pit-heading .eyebrow{color:#69847e;font-size:12px}.pit-heading h2{font-size:19px;letter-spacing:-.4px;margin:7px 0 0}.pit-heading>p{font-size:12px;color:#71837b;margin:0}.pit-layout{display:grid;grid-template-columns:1fr 235px;gap:26px;align-items:center}.upgrade-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.upgrade-card{border:1px solid var(--line);border-radius:13px;padding:14px 14px 12px;position:relative;background:#fffdfa;transition:transform .2s,border-color .2s,box-shadow .2s}.upgrade-card.affordable{border-color:#b4cbbb}.upgrade-card.bought{animation:card-bounce .35s ease;box-shadow:0 0 0 3px #47a98c44}.upgrade-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:13px}.part-icon{display:grid;place-items:center;width:36px;height:34px;border-radius:9px;background:#e7eeea;color:#3f6b60}.part-icon svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.upgrade-card:nth-child(2) .part-icon{background:#f2ead8;color:#9a7c40}.upgrade-card:nth-child(3) .part-icon{background:#e6edf1;color:#4d7589}.upgrade-card:nth-child(4) .part-icon{background:#f9e9df;color:#ba6135}.level-badge{font-size:12px;color:#648176;font-weight:700;letter-spacing:.6px}.upgrade-card h3{font-size:15px;margin:0 0 5px;font-weight:750}.upgrade-card .part-detail{font-size:12px;line-height:1.4;color:#738179;margin:0;min-height:30px}.upgrade-track{display:flex;gap:3px;margin:12px 0}.upgrade-track i{height:3px;flex:1;background:#e4e9e1;border-radius:1px}.upgrade-track i.filled{background:#438679}.buy-btn{width:100%;padding:9px 10px;border-radius:7px;border:none;display:flex;justify-content:space-between;align-items:center;gap:7px;color:#2c5549;background:#eaf0e6;font-size:12px;font-weight:800;transition:.2s}.buy-btn:not(:disabled):hover{background:#226a59;color:white}.buy-btn:disabled{color:#8b978e;background:#f0f2eb}.buy-btn b{white-space:nowrap;font-size:12px}.launch-panel{text-align:center}.launch-btn{width:100%;display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:18px;letter-spacing:1px;font-weight:900;color:#fff9e9;background:var(--orange);border:0;border-radius:12px;padding:22px 24px;box-shadow:0 5px 0 #be482b,0 12px 25px #cb592622;transition:.15s}.launch-btn:hover:not(:disabled){background:#fb7348;transform:translateY(-2px);box-shadow:0 7px 0 #be482b,0 16px 25px #cb592626}.launch-btn:active:not(:disabled){transform:translateY(4px);box-shadow:0 1px 0 #be482b}.launch-btn:disabled{opacity:.5;box-shadow:none}.launch-btn>span{font-size:30px;line-height:1}.launch-panel>span{display:block;font-size:12px;letter-spacing:1.4px;font-weight:800;margin-top:19px;color:#75877c}.save-state{font-size:12px;margin:16px 0 0;color:#809084;line-height:1.4}.bottomline{display:flex;justify-content:space-between;gap:16px;margin-top:24px;padding:17px 0;border-top:1px solid #e2e7df;font-size:12px;letter-spacing:1px;font-weight:700;color:#8b9a90}.bottomline i{font-style:normal;margin:0 8px;color:#b4bfb4}.bottomline span:first-child{color:#5f7d6e}.run-message{position:absolute;top:34%;left:50%;transform:translateX(-50%);text-align:center;color:#173d40;font-size:22px;font-weight:850;letter-spacing:-.5px;text-shadow:0 2px 4px #ffffefb0;pointer-events:none;white-space:nowrap}.driving-controls{position:absolute;left:3.1%;right:3.1%;bottom:47px;display:flex;justify-content:space-between;align-items:center}.tilt-controls{display:flex;gap:10px}.tilt-controls button{height:54px;width:64px;border:1px solid #ffffffb0;background:#f9fff1d9;border-radius:13px;color:var(--ink);font-size:32px;font-weight:700;touch-action:none;box-shadow:0 3px 0 #365e524d}.tilt-controls button.pressed{background:#b9e1cf;transform:translateY(2px)}.nitro-btn{position:relative;isolation:isolate;overflow:hidden;min-width:170px;height:55px;border-radius:13px;border:1px solid #feebcaaa;color:#fffbe4;font-size:18px;font-weight:900;letter-spacing:.5px;background:#293e3b;box-shadow:0 3px 0 #193c3260;touch-action:none}.nitro-btn>span{font-size:12px;letter-spacing:0;margin-left:10px;font-weight:700}.nitro-btn>i{position:absolute;inset:0;z-index:-1;transform-origin:left;background:linear-gradient(110deg,#ec7335,#ea5431);transition:transform .1s}.nitro-btn.pressed{box-shadow:0 0 24px #ffba52a6}.nitro-btn:disabled{opacity:.55}.modal{border:1px solid #cdddcf;border-radius:24px;background:#fcfff5;color:var(--ink);max-width:min(94vw,470px);width:470px;padding:33px;box-shadow:0 30px 120px #0b302e4d;max-height:90dvh;overflow:auto}.modal::backdrop{background:#193b3b77;backdrop-filter:blur(6px)}.modal h2{font-size:28px;line-height:1.12;letter-spacing:-1px;margin:14px 0 24px}.modal .eyebrow{color:#648279}.modal ol{padding-left:23px;font-size:14px;line-height:1.65}.modal li{padding-left:4px;margin:12px 0}.modal p{color:#708179;font-size:13px;line-height:1.65}.close-dialog{position:absolute;right:17px;top:13px;background:transparent;border:0;color:#58746b;font-size:28px}.primary,.secondary{display:block;width:100%;padding:15px 16px;border-radius:10px;font-size:13px;font-weight:850;letter-spacing:.7px;transition:.15s}.primary{margin-top:22px;background:var(--orange);color:#fffdeb;border:0;box-shadow:0 3px 0 #c2482e}.primary:hover{background:#fb7446}.secondary{margin-top:12px;background:transparent;border:1px solid #d6e1d2;color:#4b6f61}.secondary:hover{background:#e9efe3}.compact{text-align:center;width:360px}.result-modal{text-align:center;width:420px}.result-modal h2{margin:12px 0}.result-distance{margin:22px 0 24px;display:flex;flex-direction:column;gap:3px}.result-distance b{font-size:64px;font-weight:850;letter-spacing:-3px;line-height:1;color:#236853}.result-distance>span{font-size:12px;letter-spacing:1px;color:#7e9181}.result-stats{display:flex;justify-content:space-around;gap:12px;padding:18px 0;border-top:1px solid #dfe7d9;border-bottom:1px solid #dfe7d9}.result-stats>div{display:flex;flex-direction:column;gap:9px}.result-stats span{font-size:12px;color:#7c8c7f}.result-stats b{font-size:19px}.result-total{display:flex;justify-content:space-between;align-items:center;margin:22px 0}.result-total>span{font-size:12px;font-weight:800;letter-spacing:1px}.result-total>b{font-size:26px;color:#d68128}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:#153f36;color:#f4ffef;padding:14px 23px;font-size:14px;border:1px solid #96b698;box-shadow:0 10px 30px #17373033;border-radius:12px;z-index:10;max-width:90vw;text-align:center}.is-running .start-hint{opacity:0}.is-running .pit{background:#f4f7ef}.is-running .upgrade-card{opacity:.7}.is-running .pit-heading>p{color:#c0673e}.is-running .run-message:empty{display:none}.save-warning{color:#ad6b30}.is-running .world-label{opacity:.8}@keyframes card-bounce{50%{transform:translateY(-5px)}}
@media(min-width:1500px){.pit-layout{gap:32px;grid-template-columns:1fr 280px}.upgrade-card{padding:18px 20px}.pit{padding-top:27px}.start-hint{left:8%}.arena{height:54dvh}}
@media(max-width:1000px){.topbar{gap:18px;padding-left:25px;padding-right:25px}.brand>div>span{font-size:12px}.brand strong{font-size:17px}.pit-layout{grid-template-columns:1fr 180px;gap:16px}.upgrade-grid{gap:9px}.upgrade-card{padding:12px 10px}.upgrade-card h3{font-size:13px}.buy-btn{padding:9px 7px;font-size:12px}.buy-btn b{font-size:12px}.part-detail{font-size:12px!important}.launch-btn{font-size:15px;padding:20px 17px}.launch-panel>span{font-size:12px;letter-spacing:.7px}.start-hint h1{font-size:43px}.start-hint{left:6%;top:26%}.bottomline{font-size:12px;letter-spacing:.8px}.hud{gap:20px}.hud strong{font-size:24px}.pit-heading>p{font-size:12px}.arena{min-height:365px}}
@media(max-width:760px){.topbar{min-height:70px;padding:13px 18px;gap:15px}.brand-badge{width:43px;height:38px;font-size:23px}.brand{gap:10px}.brand strong{font-size:14px;letter-spacing:1px}.brand>div>span{display:none}.wallet{padding:8px 11px;gap:6px;margin-left:auto}.wallet>span{font-size:20px}.wallet b{font-size:17px}.wallet small{display:none}.top-actions{gap:5px}.icon-btn{width:30px;height:30px;font-size:17px}.pit{padding:21px 18px 0}.pit-heading>p{display:none}.pit-layout{display:flex;flex-direction:column;gap:19px;align-items:stretch}.upgrade-grid{gap:10px}.upgrade-card{padding:12px}.upgrade-card h3{font-size:14px}.upgrade-top{margin-bottom:10px}.part-icon{width:29px;height:29px}.part-icon svg{width:22px;height:22px}.level-badge{font-size:12px}.part-detail{min-height:34px!important}.buy-btn{flex-direction:column;padding:8px 3px;gap:4px;font-size:12px}.buy-btn b{font-size:12px}.upgrade-track{margin:9px 0}.launch-panel{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:7px 20px}.launch-btn{grid-row:1/3;min-height:62px;padding:18px 22px}.launch-panel>span{margin:0;align-self:end;font-size:12px;letter-spacing:.5px}.save-state{margin:0;align-self:start;font-size:12px}.bottomline{margin-top:20px;font-size:12px;line-height:1.5}.bottomline>span:nth-child(2){display:none}.arena{height:430px;min-height:360px}.start-hint{top:25%;left:6%}.start-hint h1{font-size:38px;letter-spacing:-1.8px}.start-hint p{font-size:12px}.start-hint>.eyebrow{font-size:12px;letter-spacing:1.2px}.world-label{top:20px;left:20px}.world-label b{font-size:12px}.world-label .eyebrow{font-size:12px}.record-box{top:20px;right:20px}.record-box>b{font-size:24px}.record-box .eyebrow{font-size:12px;letter-spacing:1px}.section-mark{width:30px;height:32px;font-size:12px}.hud{top:78px;border-radius:11px;padding:10px 18px;gap:20px}.hud strong{font-size:23px}.hud span{font-size:12px}.hud>div{min-width:65px}.track-progress{bottom:14px;left:20px;right:20px}.driving-controls{left:20px;right:20px;bottom:43px}.run-message{top:40%;font-size:18px}.is-running .arena{height:calc(100dvh - 70px);min-height:390px;max-height:850px}.is-running .pit{display:none}.is-running .game-shell{min-height:100dvh}}
@media(max-width:420px){.topbar{padding:12px;gap:8px}.brand strong{font-size:12px}.brand-badge{width:37px;height:33px;font-size:22px}.brand{gap:8px}.top-actions{gap:3px}.icon-btn{height:28px;width:28px}.wallet{padding:7px 8px}.wallet b{font-size:15px}.wallet>span{font-size:18px}.pit{padding:19px 13px 0}.pit-heading{margin-bottom:15px}.pit-heading h2{font-size:18px}.upgrade-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.upgrade-card{padding:12px}.upgrade-top{margin-bottom:8px}.part-detail{min-height:15px!important;font-size:12px!important}.buy-btn{flex-direction:row;padding:9px;font-size:12px}.upgrade-card h3{font-size:15px}.upgrade-track{margin:9px 0}.arena{height:410px}.start-hint{top:24%}.start-hint h1{font-size:35px}.launch-panel{grid-template-columns:1.2fr 1fr;gap:5px 12px}.launch-btn{font-size:14px;padding:17px 18px}.launch-panel>span{font-size:12px}.save-state{font-size:12px}.modal{padding:26px}.modal h2{font-size:24px}.modal ol{font-size:13px}.tilt-controls button{width:52px;height:51px}.nitro-btn{min-width:150px;height:51px;font-size:16px}}
@media(max-height:550px) and (orientation:landscape){.topbar{min-height:52px;padding:7px 18px}.brand-badge{height:32px;width:38px;font-size:23px}.brand strong{font-size:13px}.brand>div>span{display:none}.arena{height:300px;min-height:280px}.start-hint{top:27%}.start-hint h1{font-size:29px;margin:10px 0}.start-hint p{font-size:12px}.world-label,.record-box{top:14px}.hud{top:15px}.is-running .arena{height:calc(100dvh - 52px);min-height:250px}.is-running .pit{display:none}.run-message{top:35%}.modal{max-height:92dvh;padding:22px}.result-distance{margin:10px 0}.result-distance b{font-size:42px}.result-modal h2{font-size:22px}.result-stats{padding:10px 0}.result-total{margin:12px 0}.modal .primary{margin-top:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.part-detail{font-size:12px!important}.upgrade-card h3{font-size:16px}.buy-btn{font-size:12px;flex-wrap:wrap}.buy-btn b{font-size:14px}.start-hint p{font-size:16px}.modal p,.modal ol{font-size:16px}.modal .primary,.modal .secondary{font-size:14px}.top-actions .icon-btn:disabled{opacity:.35}.section-mark,.world-label b{font-size:14px}.hud span{font-size:12px}.hud .star-counter{white-space:nowrap}.bottomline{line-height:1.5}.pit-heading>p{font-size:12px}.primary:disabled{opacity:.6}
@media(max-width:1100px){.brand>div>span{display:none}.buy-btn{justify-content:center}.buy-btn>span{flex-basis:100%;text-align:center}.start-hint h1{letter-spacing:-1.6px}.world-label .eyebrow,.record-box .eyebrow{letter-spacing:.6px}}
@media(max-width:760px){.launch-panel{position:fixed;bottom:0;left:0;right:0;padding:12px 18px calc(12px + env(safe-area-inset-bottom));background:#f8faf5f5;border-top:1px solid #dbe3d8;z-index:3;box-shadow:0 -7px 24px #173d3110}.pit{padding-bottom:110px}.launch-panel>span{font-size:12px;letter-spacing:0}.launch-panel .save-state{font-size:12px}.start-hint p{font-size:14px}.start-hint>.eyebrow{display:none}.hud{gap:14px}.hud span{font-size:12px;letter-spacing:.6px}.hud>div{min-width:70px}.world-label .eyebrow{font-size:12px;letter-spacing:0}.record-box .eyebrow{font-size:12px;letter-spacing:0}.bottomline>span{font-size:12px;letter-spacing:0}.track-progress>span{font-size:12px;letter-spacing:.4px}.run-message{max-width:92%;white-space:normal;width:max-content}.modal ol,.modal p{font-size:14px}.record-box{right:15px}.world-label{left:15px}}
@media(max-width:600px){.upgrade-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.buy-btn{justify-content:space-between}.buy-btn>span{flex-basis:auto}.part-detail{min-height:32px!important}.pit-heading h2{font-size:20px}.start-hint{top:25%}.hud{padding:10px 14px}.world-label{gap:8px}.world-label b{font-size:13px}}
@media(max-width:360px){.brand strong{font-size:12px;letter-spacing:0}.topbar{gap:6px}.brand{gap:6px}.icon-btn{width:26px;height:28px}.world-label .eyebrow{display:none}.hud{gap:10px}.hud strong{font-size:22px}.hud>div{min-width:65px}.record-box .eyebrow{font-size:12px}.buy-btn{justify-content:center}.buy-btn>span{flex-basis:100%}}

/* Compact in-run readouts: keep the world view open and leave the record
   label at the top edge. Four small cards now include peak altitude. */
.hud{top:74px;left:auto;right:3.1%;transform:none;gap:14px;padding:9px 15px;background:#f8fff05e;border:1px solid #ffffff66;backdrop-filter:blur(5px);opacity:.87;box-shadow:0 4px 16px #1a434012}
.hud>div{min-width:64px}.hud strong{font-size:24px}.hud span{font-size:10px;letter-spacing:1.1px}.hud .star-counter{font-size:22px}
.result-modal{max-height:min(90dvh,680px)}
.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:9px 0 13px}
.result-actions .primary,.result-actions .secondary{margin:0;padding:12px 10px}
@media(max-width:760px){.hud{top:78px;right:18px;left:auto;transform:none;gap:9px;padding:8px 10px}.hud>div{min-width:52px}.hud strong{font-size:19px}.hud span{font-size:9px;letter-spacing:.6px}.hud .star-counter{font-size:20px}.hud .star-counter b{font-size:18px}}
@media(max-width:600px){.hud{right:12px;gap:7px;padding:8px}.hud>div{min-width:47px}.hud strong{font-size:18px}.hud small{font-size:10px}.result-actions{gap:7px}.result-actions .primary,.result-actions .secondary{font-size:12px;padding:12px 7px}}
@media(max-height:550px) and (orientation:landscape){.hud{top:15px;right:18px}}
.reward-offer{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.reward-earned{display:flex;align-items:center;justify-content:center;min-height:42px;margin:0 0 10px;padding:9px 12px;border:1px solid #d7c48d;border-radius:10px;background:linear-gradient(180deg,#fff7d6,#f6e7b6);color:#6d4b12;font-size:15px;font-weight:900;letter-spacing:.45px;text-align:center;box-shadow:inset 0 1px 0 #fff9}
.reward-btn{display:block;width:100%;min-height:52px;padding:13px 16px;border:1px solid #ffbe63;border-radius:12px;background:linear-gradient(135deg,#ffb43c,#ff7a38);color:#fffaf1;font-size:14px;font-weight:900;letter-spacing:.3px;line-height:1.45;overflow-wrap:anywhere;box-shadow:0 7px 20px #ff7a3840,inset 0 1px 0 #fff5d26b;text-shadow:0 1px 1px #8d351f66;transition:transform .15s,filter .15s,box-shadow .15s}
.reward-btn:hover:not(:disabled){filter:brightness(1.08);transform:translateY(-1px);box-shadow:0 10px 24px #ff7a3857,inset 0 1px 0 #fff7df85}
.reward-btn:disabled{opacity:.55;filter:saturate(.65);box-shadow:none}
.reward-offer p{margin:8px 0 0;font-size:14px;line-height:1.5}
.result-modal[aria-busy="true"] .primary,.result-modal[aria-busy="true"] .secondary{opacity:.6}
@media(max-height:550px) and (orientation:landscape){.reward-offer{margin-top:14px;padding-top:12px}}
.garage-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:8px}.garage-toolbar label,.ranking-modal label{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:700}select,.toolbar-btn{min-height:42px;border:1px solid #c7d8ca;background:#fffdf7;color:var(--ink);border-radius:9px;padding:9px 13px;font:inherit;font-size:14px}.toolbar-btn:hover:not(:disabled){background:#e6efe4}.toolbar-btn:disabled,select:disabled{opacity:.5}.mode-note{font-size:14px;line-height:1.5;color:#61786c;margin:8px 0 15px}.task-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:15px 0}.task-card{border:1px solid #c8dccd;background:#edf5e9;border-radius:12px;padding:15px 17px}.task-top{display:flex;justify-content:space-between;align-items:center;font-size:12px;letter-spacing:.6px}.task-top b{color:#91540c;font-size:14px;letter-spacing:0}.task-card h3{font-size:16px;line-height:1.35;margin:9px 0}.task-card>span,.daily-meta{font-size:14px;color:#547264}.task-card progress{width:100%;height:7px;margin:0 0 6px;accent-color:#337e65}.daily-card{background:#f1f0e2;border-color:#e0ddbd}.daily-meta{display:flex;justify-content:space-between;gap:10px}.location-goal{display:flex;gap:16px;align-items:center;font-size:14px;color:#516e63;margin:0 0 18px}.location-goal progress{flex:1;height:6px;max-width:260px;accent-color:#cf7b39}.workshop-modal{width:820px;max-width:min(94vw,820px);text-align:left}
.tuning-modal{width:900px;max-width:min(94vw,900px)}
.tuning-modal .tuning-upgrades{margin-top:16px}.workshop-modal h3{font-size:17px;margin:25px 0 12px}.collection-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.collection-card,.location-card{display:flex;flex-direction:column;gap:8px;align-items:stretch;text-align:left;min-width:0;padding:13px;border:1px solid #cfdcd0;background:#f5f9ef;border-radius:12px;color:var(--ink)}.collection-card b,.location-card b{font-size:15px;line-height:1.4}.collection-card span,.location-card span,.collection-card small{font-size:14px;line-height:1.45}.collection-card canvas{display:block;max-width:100%;height:auto}.collection-card:disabled,.location-card:disabled{opacity:.6}.selected{border-color:#318373!important;box-shadow:0 0 0 2px #31837330;background:#e9f3e7}.location-card img{width:100%;height:100px;object-fit:cover;object-position:center 75%;border-radius:8px}.paint-grid{display:flex;flex-wrap:wrap;gap:9px}.paint-choice{display:grid;grid-template-columns:24px 1fr;align-items:center;gap:6px 9px;border:1px solid #cbdacb;background:#f6faef;color:var(--ink);border-radius:9px;padding:10px;text-align:left;font-size:14px}.paint-choice i{width:23px;height:23px;border-radius:50%;border:1px solid #18383e20}.paint-choice small{grid-column:2;font-size:12px}.paint-choice:disabled{opacity:.55}.effects-setting{display:flex;gap:10px;align-items:center;font-size:14px;line-height:1.5;margin-top:25px}.effects-setting input{width:19px;height:19px;accent-color:#337e65}.ranking-modal{width:570px;max-width:min(94vw,570px)}.ranking-table{border-collapse:collapse;width:100%;font-size:14px}.ranking-table th,.ranking-table td{padding:11px 7px;border-bottom:1px solid #d7e4d5;text-align:left;overflow-wrap:anywhere}.ranking-table td:last-child,.ranking-table th:last-child{text-align:right;white-space:nowrap}.trick-counter{position:absolute;bottom:119px;left:3.1%;padding:9px 12px;background:#f8fff0e8;border:1px solid #ffffffb0;border-radius:10px;font-size:12px;font-weight:800;pointer-events:none}.trick-counter b{font-size:19px;margin-left:7px}.trick-counter span{display:block;font-size:12px;font-weight:500;margin-top:3px}.result-improvement{color:#2c7761!important;font-weight:700}.result-unlocks{white-space:pre-line;background:#e4f0dc;padding:12px;border-radius:10px;color:#356749!important}.is-record .result-distance b{animation:record-pop .65s ease}.night-track .world-label,.night-track .world-label .eyebrow,.night-track .record-box,.night-track .record-box .eyebrow{color:#eef8eb}.night-track .run-message{color:#fffce7;text-shadow:0 2px 5px #122239}.is-running .garage-toolbar,.is-running .task-grid,.is-running .location-goal,.is-running .mode-note{display:none}@keyframes record-pop{45%{transform:scale(1.12);color:#df8d21}100%{transform:scale(1)}}
@media(max-width:600px){.task-grid{grid-template-columns:1fr}.task-card{padding:13px}.garage-toolbar{gap:8px}.toolbar-btn{flex:1}.garage-toolbar label{width:100%}.garage-toolbar select{flex:1}.collection-grid{grid-template-columns:1fr}.collection-card{display:grid;grid-template-columns:100px 1fr;align-items:center}.collection-card canvas{grid-row:1/4}.collection-card small,.collection-card span{grid-column:2}.location-card{display:grid;grid-template-columns:100px 1fr;align-items:center}.location-card img{grid-row:1/3;height:74px}.location-goal{display:block}.location-goal progress{display:block;margin-top:9px;width:100%;max-width:none}.workshop-modal{padding:24px 19px}.trick-counter{font-size:12px;padding:7px 10px}.trick-counter span{display:none}}

.ranking-cta{background:#235a50;color:#fff7d8;border-color:#235a50;font-weight:750}.ranking-cta:hover:not(:disabled){background:#2d7364}
.ranking-summary{display:flex;justify-content:space-between;gap:12px;padding:18px 0 9px;font-size:16px}.ranking-target{background:#e4efdf;border-left:4px solid #ce9238;border-radius:9px;padding:14px;text-align:left;color:#264e40!important}.ranking-table .own-result{background:#d7e9d0;font-weight:800}.ranking-table th{font-size:13px;letter-spacing:.5px}.ranking-table td:first-child{width:68px}.ranking-modal .primary{margin-top:20px}.ranking-table td:nth-child(2){max-width:235px;word-break:break-word}
.trial-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}.trial-card{display:flex;flex-direction:column;gap:9px;text-align:left;background:#edf4e7;border:1px solid #cbdcc9;border-radius:12px;padding:16px;color:var(--ink)}.trial-card b{font-size:16px}.trial-card span{font-size:14px;line-height:1.5}.trial-card small{font-size:12px;line-height:1.5}.medal{display:inline-flex;align-self:flex-start;border-radius:20px;padding:6px 12px;font-size:13px;background:#e3e9df;color:#5b6b59;margin-top:auto}.medal-1{background:#efdbc2;color:#80502c}.medal-2{background:#dce6eb;color:#40566a}.medal-3{background:#fbe39d;color:#71510b}.result-trial{padding:12px;background:#f3e6b9;border-radius:9px;font-weight:bold;color:#664c17!important}.result-extras{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}.result-extras .toolbar-btn{flex:1;font-size:14px;padding:10px;white-space:nowrap}
.card-modal{width:720px;max-width:94vw}.card-modal canvas{width:100%;height:auto;display:block;border-radius:12px;margin-bottom:18px}.is-replaying .track-progress,.is-replaying .start-hint{display:none}.is-running #trial-picker{display:none}.trick-counter{max-width:min(90%,420px)}#combo-readout{display:block;line-height:1.45;font-weight:700}#ghost-readout{font-weight:500}
@media(max-width:600px){.trial-grid{grid-template-columns:1fr}.trial-card{gap:6px;padding:13px}.ranking-summary{flex-direction:column;gap:8px;font-size:15px}.ranking-modal{padding:25px 17px}.ranking-table th,.ranking-table td{padding:10px 5px}.card-modal{padding:24px 16px}.result-extras .toolbar-btn{flex-basis:40%}.trick-counter{bottom:125px;max-width:88%}#combo-readout{font-size:12px}.trial-card .medal{align-self:flex-end}}
.top-actions{flex-shrink:0}.top-actions svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.top-actions [aria-pressed="false"]{opacity:.52}.top-actions [aria-pressed="true"]{color:#efffef;background:#285f50}.top-actions [aria-pressed="false"]:hover{opacity:1}
@media(max-width:600px){.topbar .wallet{margin-left:auto}.top-actions{margin-left:auto}.top-actions .icon-btn{min-width:36px;min-height:36px}}
@media(max-width:480px){.topbar .brand>div{display:none}.topbar .brand-badge{width:32px}.topbar .wallet small{display:none}.topbar .top-actions{gap:4px}}
.mode-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;flex-basis:100%;margin-bottom:4px}.mode-button{min-width:0;min-height:78px;padding:14px 16px;display:flex;flex-direction:column;justify-content:center;gap:6px;text-align:left;border:1px solid #c7d8ca;border-radius:12px;background:#fffdf7;color:var(--ink);transition:background .15s,border-color .15s}.mode-button b{font-size:16px;line-height:1.3}.mode-button span{font-size:14px;line-height:1.4;color:#61786c}.mode-button:hover:not(:disabled){background:#e6efe4;border-color:#70a58b}.mode-button.is-selected{background:#235a50;border-color:#235a50;color:#fff7d8;box-shadow:inset 0 -3px 0 #efad62}.mode-button.is-selected span{color:#d7e9d4}.mode-button.is-selected:hover:not(:disabled){background:#2d7364}.mode-button:disabled{opacity:.55}
@media(max-width:600px){.mode-buttons{gap:6px}.mode-button{min-height:62px;padding:10px 7px;text-align:center;align-items:center}.mode-button b{font-size:14px}.mode-button span{display:none}}

/* Career follows the existing compact garage cards. */
.career-panel{margin:12px 0;padding:16px 18px;border:1px solid #6a9a7d;border-radius:14px;background:linear-gradient(110deg,#e9f5df,#d6eee5);color:#224b40}
.career-panel h3{margin:9px 0;font-size:18px}.career-panel p{margin:9px 0 6px;font-size:13px;font-weight:700}.career-panel small{display:block;line-height:1.5}.chapter-meter{display:flex;align-items:center;gap:14px}.chapter-meter progress{flex:1;min-width:50px;accent-color:#348c71;height:8px}.chapter-meter span{font-size:12px;white-space:nowrap}.career-panel .toolbar-btn{margin-top:10px}.collection-card:disabled canvas{opacity:.65}.career-panel[hidden],#chapter-medals[hidden]{display:none}
@media(max-width:560px){.career-panel{padding:12px}.career-panel h3{font-size:16px}.chapter-meter{gap:8px}.career-panel .task-top{gap:8px;font-size:11px}}

@media(max-width:1100px){.topbar .hud{gap:14px;padding:9px 13px}.topbar .hud>div{min-width:58px}.topbar .hud strong{font-size:22px}.topbar .hud span{font-size:10px}}
@media(max-width:820px){.topbar .hud{position:fixed;top:10px;left:50%;transform:translateX(-50%);z-index:20;max-width:94vw}.topbar{padding-top:74px}}
/* Keep the optional rewarded-ad action immediately visible below the two main result buttons. */
.result-actions + .reward-offer{margin:14px 0 4px}

/* HUD placement fix: keep the driving HUD in the top bar, centered on screen.
   These rules intentionally come last so legacy arena HUD rules cannot override them. */
.topbar .hud{
  position:absolute;
  top:50%;
  left:50%;
  right:auto;
  transform:translate(-50%,-50%);
  z-index:5;
  opacity:1;
  background:#eef4e9;
  border:1px solid #d8e2d6;
  backdrop-filter:none;
  box-shadow:0 3px 12px #1a434012;
}
.is-running .topbar .brand{visibility:hidden}
@media(max-width:820px){
  .topbar{padding-top:16px}
  .topbar .hud{
    position:absolute;
    top:50%;
    left:50%;
    right:auto;
    transform:translate(-50%,-50%);
    max-width:calc(100vw - 90px);
    gap:10px;
    padding:8px 10px;
  }
  .topbar .hud>div{min-width:50px}
  .topbar .hud strong{font-size:20px}
  .topbar .hud span{font-size:9px;letter-spacing:.6px}
  .is-running .topbar .wallet{visibility:hidden}
}
@media(max-width:760px){.topbar{padding-top:13px}}
@media(max-width:600px){
  .is-running .top-actions #music-btn,
  .is-running .top-actions #sound-btn,
  .is-running .top-actions #help-btn{display:none}
  .topbar .hud{gap:7px;padding:7px 8px;max-width:calc(100vw - 62px)}
  .topbar .hud>div{min-width:44px}
  .topbar .hud strong{font-size:18px}
  .topbar .hud small{font-size:10px}
  .topbar .hud .star-counter{font-size:19px}
  .topbar .hud .star-counter b{font-size:17px}
}

/* Progression attention markers: a small glowing dot appears when an upgrade is
   affordable or when a newly unlocked car/track has not been opened yet. */
.upgrade-card,.collection-card,.location-card,#workshop-btn,#tuning-btn{position:relative}
.upgrade-card.has-notice::after,.collection-card.has-notice::after,.location-card.has-notice::after,#workshop-btn.has-notice::after,#tuning-btn.has-notice::after{
  content:"";position:absolute;top:8px;right:8px;width:11px;height:11px;border-radius:50%;background:#ffd45f;border:2px solid #fff9db;
  box-shadow:0 0 0 3px #e6963455,0 0 13px 4px #ffc94d99;z-index:4;pointer-events:none;animation:notice-pulse 1.55s ease-in-out infinite;
}
#workshop-btn.has-notice::after,#tuning-btn.has-notice::after{top:4px;right:4px;width:9px;height:9px}
@keyframes notice-pulse{0%,100%{transform:scale(.9);opacity:.8}50%{transform:scale(1.18);opacity:1}}

.super-boost-box{display:grid;grid-template-columns:minmax(220px,auto) 1fr;gap:12px;align-items:center;margin-top:13px;padding-top:12px;border-top:1px solid #6a9a7d55}
.super-boost-box small{margin:0!important;color:#42695c;line-height:1.4}.super-boost-btn{font-weight:850;letter-spacing:.2px;border-color:#ce8b35;background:linear-gradient(180deg,#fff4bd,#f5d27d);color:#5c4316;box-shadow:0 3px 10px #a96d2630}
.super-boost-btn:hover:not(:disabled){background:linear-gradient(180deg,#fff8d2,#efc65d)}
.super-boost-btn.boost-recommended:not(:disabled){box-shadow:0 0 0 2px #e5a84455,0 5px 16px #c6883540;animation:boost-pulse 2.2s ease-in-out infinite}
.super-boost-btn.boost-ready{background:#d8efe3;border-color:#4d9b78;color:#225b48;box-shadow:0 0 0 2px #6fc49a33}
@keyframes boost-pulse{0%,100%{transform:translateY(0)}50%{transform:translateY(-1px)}}
@media(max-width:650px){.super-boost-box{grid-template-columns:1fr}.super-boost-btn{width:100%}}
.upgrade-card.has-notice::after{top:-5px;right:-5px}

.danger-btn{border-color:#dfb3a4;color:#9b4936;background:#fff7f2}.danger-btn:hover:not(:disabled){background:#fde7dc}.danger-primary{background:#b9563e!important;box-shadow:0 3px 0 #823c2d!important}.danger-primary:hover{background:#c76348!important}

/* === Full-screen garage + two-step launch flow (v10) === */
html,body{width:100%;height:100%;overflow:hidden;background:#142b30}
.game-shell{position:relative;max-width:none;width:100%;height:100dvh;min-height:520px;overflow:hidden;background:#b5d9d8}
.topbar{flex:0 0 78px;min-height:78px;padding-top:11px;padding-bottom:11px}
.arena{flex:1;min-height:0;height:auto;width:100%}

/* The old lower garage becomes a floating pre-run control deck. */
.pit{
  position:absolute;z-index:10;top:98px;left:50%;bottom:20px;
  transform:translateX(-50%);width:min(1220px,92vw);max-height:calc(100dvh - 118px);
  overflow:auto;overscroll-behavior:contain;padding:22px 24px 18px;
  background:rgba(250,252,246,.94);border:1px solid rgba(221,232,221,.9);border-radius:24px;
  box-shadow:0 24px 80px rgba(17,49,49,.28);backdrop-filter:blur(13px) saturate(1.08);
  transition:opacity .22s ease,transform .25s ease,visibility .22s;
  scrollbar-width:thin;scrollbar-color:#9eb4a9 transparent;
}
.pit-heading{margin-bottom:13px}.pit-heading h2{font-size:21px}.pit-heading>p{max-width:430px;text-align:right}
.pit .launch-panel{
  display:grid;grid-template-columns:minmax(270px,360px) minmax(220px,1fr);grid-template-rows:auto auto;
  gap:4px 20px;align-items:center;margin:0 0 16px;padding:13px;
  border:1px solid #efd2b6;border-radius:16px;background:linear-gradient(105deg,#fff7e9e8,#edf6e8df);
}
.pit .launch-btn{grid-row:1/3;min-height:72px;font-size:21px;padding:20px 25px}
.pit .launch-panel>span{margin:0;align-self:end;color:#4f6d62;font-size:12px}
.pit .save-state{margin:3px 0 0;align-self:start}
.pit-layout{display:block}.pit-layout .upgrade-grid{width:100%}
.pit .career-panel{margin:10px 0 11px;padding:13px 16px}
.pit .career-panel h3{margin:6px 0;font-size:17px}
.pit .task-grid{margin-top:10px}.pit .task-card{padding:12px 14px}
.pit .location-goal{margin:11px 0}.pit .bottomline{margin-top:15px;padding:13px 0 1px}

.is-staging .pit,.is-running .pit,.is-result .pit,.is-replaying .pit{
  opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,18px)
}

/* Track-ready card: garage is gone, scenery and launch ramp remain visible. */
.ready-panel{
  position:absolute;z-index:6;left:50%;bottom:58px;transform:translateX(-50%);
  width:min(560px,90vw);padding:20px 22px 16px;text-align:center;color:#f9ffef;
  border:1px solid rgba(226,245,225,.48);border-radius:20px;
  background:linear-gradient(145deg,rgba(20,54,52,.93),rgba(28,74,65,.88));
  box-shadow:0 20px 65px rgba(7,32,32,.36);backdrop-filter:blur(10px)
}
.ready-panel .eyebrow{color:#acd7c6}.ready-panel h2{margin:5px 0 5px;font-size:clamp(24px,3vw,34px);letter-spacing:-1px}
.ready-panel p{margin:0 0 14px;color:#d6e8db;font-size:13px;line-height:1.5}
.go-btn{width:100%;min-height:62px;border:0;border-radius:13px;padding:13px 18px;background:var(--orange);color:#fff9e9;font-size:21px;font-weight:950;letter-spacing:1.2px;box-shadow:0 5px 0 #b94329,0 12px 30px #071f1e35;transition:.15s}
.go-btn:hover{background:#ff7548;transform:translateY(-2px);box-shadow:0 7px 0 #b94329,0 16px 34px #071f1e40}.go-btn:active{transform:translateY(3px);box-shadow:0 2px 0 #b94329}
.go-btn span{display:inline-block;margin-left:14px;padding:5px 9px;border-radius:7px;background:#fff3d626;font-size:11px;letter-spacing:1px;vertical-align:2px}
.ready-back{margin-top:10px;border:0;background:transparent;color:#c4ddd2;font-size:12px;font-weight:800;letter-spacing:.8px;padding:7px 14px}.ready-back:hover{color:white;text-decoration:underline}
.is-staging .track-progress{bottom:22px}.is-staging .world-label,.is-staging .record-box{opacity:1}

/* Keep the large field visually clean while driving. */
.is-running .arena,.is-staging .arena,.is-result .arena{height:auto;min-height:0}
.is-running .topbar .brand{visibility:hidden}
.is-staging .topbar .brand{opacity:.82}
.is-result .topbar .brand{opacity:.82}

@media(max-height:760px) and (min-width:701px){
  .pit{top:88px;bottom:10px;padding:15px 18px 12px;max-height:calc(100dvh - 98px);border-radius:18px}
  .pit-heading{margin-bottom:8px}.pit .launch-panel{margin-bottom:9px;padding:9px}.pit .launch-btn{min-height:58px;padding:14px 20px}
  .pit .career-panel{padding:9px 13px;margin:7px 0}.pit .task-card{padding:9px 11px}.pit .bottomline{margin-top:9px;padding-top:9px}
  .upgrade-card{padding:10px}.upgrade-top{margin-bottom:7px}.upgrade-track{margin:7px 0}.upgrade-card .part-detail{min-height:0}
}
@media(max-width:820px){
  .game-shell{min-height:480px}.topbar{flex-basis:72px;min-height:72px;padding-top:10px;padding-bottom:10px}
  .pit{top:80px;bottom:8px;width:calc(100vw - 16px);max-height:calc(100dvh - 88px);padding:16px;border-radius:18px}
  .pit-heading{align-items:flex-start}.pit-heading>p{display:none}
  .pit .launch-panel{grid-template-columns:1fr;grid-template-rows:auto;gap:8px;padding:10px}
  .pit .launch-btn{grid-row:auto;min-height:62px}.pit .launch-panel>span,.pit .save-state{text-align:center}
  .upgrade-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ready-panel{bottom:60px;width:calc(100vw - 24px);padding:16px 16px 13px}.ready-panel h2{font-size:25px}.go-btn{min-height:56px;font-size:18px}
}
@media(max-width:560px){
  .pit{padding:12px}.pit-heading h2{font-size:18px}.pit-heading{margin-bottom:8px}
  .upgrade-grid{grid-template-columns:1fr 1fr;gap:7px}.upgrade-card{padding:9px}.upgrade-card .part-detail{font-size:11px;min-height:0}.upgrade-track{margin:7px 0}
  .bottomline span:nth-child(2){display:none}.bottomline{font-size:10px}
  .ready-panel p{font-size:12px}.go-btn span{margin-left:7px}
}


/* === Running objectives in the space normally occupied by the RC title (v12) === */
.run-objectives{display:none;position:absolute;left:3.1%;top:50%;transform:translateY(-50%);width:min(30vw,430px);max-height:66px;overflow:hidden;z-index:6;pointer-events:none;gap:3px;flex-direction:column}
.is-running .run-objectives{display:flex}
.run-objective{display:flex;align-items:baseline;gap:7px;min-width:0;line-height:1.15}
.run-objective span{flex:0 0 auto;font-size:9px;letter-spacing:1px;font-weight:900;color:#6b857d}
.run-objective b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#244d47;font-weight:800}
.run-objective.main b{font-size:11px;color:#173f3b}
.run-objective.main span{color:#d45b38}
.is-running .topbar .brand{visibility:hidden}
@media(max-width:1180px){.run-objectives{width:27vw}.run-objective.side b{font-size:9px}.run-objective.main b{font-size:10px}}
@media(max-width:900px){.run-objectives{width:24vw}.run-objective.side{display:none}.run-objective.main{display:flex;flex-direction:column;gap:2px}.run-objective.main b{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:9px}.run-objective.main span{font-size:8px}}
@media(max-width:700px){.is-running .run-objectives{display:none}}

/* === Main menu redesign: starfield command deck (v14) === */
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .topbar{
  background:linear-gradient(180deg,#0b141c 0%,#0e1b24 100%);border-bottom-color:#263744;color:#f5f7f2;box-shadow:0 10px 32px #07101845
}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .brand>div>span{color:#8598a3}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .wallet{background:#121f28;border-color:#2a3a44;color:#f6f1df}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .wallet small{color:#8296a0}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .icon-btn{border-color:#2d414d;color:#d6e2e5;background:#101d25}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .icon-btn:hover{background:#1a2d38;border-color:#49606c}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .icon-btn.active{color:#ff8b5c;border-color:#a95d40}

.pit{padding:14px 14px 18px;background:rgba(241,245,239,.97)}
.menu-hero{
  position:relative;isolation:isolate;overflow:hidden;min-height:415px;margin:0 0 16px;border-radius:20px;
  color:#f4f7f2;background:
    radial-gradient(circle at 78% 28%,rgba(255,111,55,.15),transparent 23%),
    radial-gradient(circle at 54% 112%,rgba(43,128,145,.20),transparent 34%),
    linear-gradient(122deg,#080f17 0%,#0e1d28 48%,#111b28 100%);
  border:1px solid #253946;box-shadow:inset 0 1px 0 #ffffff0c,0 18px 45px #06131b24
}
.menu-hero::before{
  content:"";position:absolute;inset:0;z-index:-2;pointer-events:none;opacity:.65;
  background:linear-gradient(90deg,rgba(7,14,21,.96) 0%,rgba(7,14,21,.84) 38%,rgba(7,14,21,.18) 69%,rgba(7,14,21,.36) 100%)
}
.menu-hero::after{
  content:"";position:absolute;left:-12%;right:-12%;bottom:-158px;height:260px;z-index:-1;border-radius:50%;
  border:1px solid rgba(100,190,205,.16);box-shadow:0 -24px 75px rgba(40,133,151,.12),inset 0 18px 55px rgba(18,68,80,.16);transform:rotate(-4deg)
}
.menu-stars{position:absolute;inset:-20%;z-index:-3;pointer-events:none;background-repeat:repeat;opacity:.8}
.menu-stars-a{background-image:radial-gradient(circle,#fff 0 1px,transparent 1.25px);background-size:47px 47px;animation:menu-star-drift 28s linear infinite}
.menu-stars-b{background-image:radial-gradient(circle,#9bc8d7 0 1px,transparent 1.4px);background-size:83px 83px;background-position:27px 13px;opacity:.38;animation:menu-star-drift 44s linear infinite reverse}
.menu-orbit{position:absolute;right:-125px;top:-205px;width:650px;height:650px;border-radius:50%;z-index:-2;border:1px solid rgba(134,195,207,.16);box-shadow:inset 0 0 90px rgba(45,111,128,.08);transform:rotate(-12deg)}
.menu-orbit::before,.menu-orbit::after{content:"";position:absolute;border-radius:50%;border:1px solid rgba(135,197,210,.09)}
.menu-orbit::before{inset:70px}.menu-orbit::after{inset:145px}
.menu-car-art{position:absolute;right:-4%;top:4%;width:min(64%,760px);height:90%;z-index:-1;pointer-events:none;display:flex;align-items:center;justify-content:center;transform:rotate(-4deg)}
.menu-car-art::before{content:"";position:absolute;right:7%;bottom:9%;width:68%;height:22%;border-radius:50%;background:radial-gradient(ellipse,rgba(255,92,31,.23),transparent 68%);filter:blur(16px)}
.menu-car-art img{width:100%;height:auto;display:block;mix-blend-mode:screen;filter:saturate(.9) contrast(1.04) brightness(.88);opacity:.92;transform:translate(9%,5%) scale(1.04)}
.menu-hero-content{position:relative;z-index:2;width:min(650px,61%);padding:31px 34px 27px}
.menu-kicker{display:flex;align-items:center;gap:10px;margin-bottom:12px;color:#8eabb8;font-size:11px;font-weight:900;letter-spacing:2.2px}
.menu-kicker>span{width:28px;height:2px;background:#f56b3f;box-shadow:0 0 12px #f56b3f99}
.menu-hero h1{margin:0 0 10px;font-size:clamp(33px,3.4vw,52px);line-height:.98;letter-spacing:-2.3px;font-weight:900;text-wrap:balance}
.menu-hero h1 em{font-style:normal;color:#ff7649;text-shadow:0 0 28px #ef613632}
.menu-lead{margin:0 0 18px;max-width:490px;color:#a7bbc2;font-size:13px;line-height:1.5;min-height:20px}
.pit .menu-launch-panel{position:static;display:grid;grid-template-columns:minmax(250px,360px) minmax(190px,1fr);grid-template-rows:auto;align-items:center;gap:11px 17px;margin:0 0 16px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.pit .menu-start-btn{grid-row:auto;position:relative;overflow:hidden;min-height:82px;padding:14px 18px 14px 22px;border-radius:16px;background:linear-gradient(105deg,#ef5c31 0%,#ff7e4b 55%,#ff9759 100%);box-shadow:0 7px 0 #a93b25,0 16px 38px rgba(239,83,43,.28),inset 0 1px 0 rgba(255,255,255,.28);border:1px solid rgba(255,186,145,.28);text-align:left}
.pit .menu-start-btn::before{content:"";position:absolute;inset:-80% 48% -80% -20%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);transform:rotate(18deg);transition:transform .55s ease}
.pit .menu-start-btn:hover:not(:disabled){background:linear-gradient(105deg,#ff6435,#ff8953 56%,#ffa266);transform:translateY(-2px);box-shadow:0 9px 0 #a93b25,0 20px 46px rgba(239,83,43,.34),inset 0 1px 0 rgba(255,255,255,.3)}
.pit .menu-start-btn:hover:not(:disabled)::before{transform:translateX(220%) rotate(18deg)}
.pit .menu-start-btn:active:not(:disabled){transform:translateY(5px);box-shadow:0 2px 0 #a93b25,0 10px 24px rgba(239,83,43,.25)}
.menu-start-copy{display:flex!important;flex-direction:column;align-items:flex-start;gap:2px;font-size:inherit!important;line-height:1!important}
.menu-start-copy small{font-size:9px;letter-spacing:2px;font-weight:900;color:#ffe3d3}
.menu-start-copy strong{font-size:29px;letter-spacing:1.3px;color:#fffaf2}
.menu-start-arrow{width:45px;height:45px;display:grid!important;place-items:center;border-radius:50%;background:#fff4e420;border:1px solid #fff5df4a;font-size:25px!important;line-height:1}
.menu-start-meta{display:flex;flex-direction:column;gap:6px;min-width:0}
.pit .menu-start-meta>#launch-sub{display:block;margin:0;color:#c4d3d8;font-size:10px;font-weight:900;letter-spacing:1.25px;line-height:1.35}
.pit .menu-start-meta>.save-state{margin:0;color:#6f8893;font-size:10px;line-height:1.4}
.menu-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0 0 11px}
.menu-mode-grid .menu-mode-card{position:relative;min-height:88px;padding:12px 10px;display:grid;grid-template-columns:35px minmax(0,1fr);grid-template-rows:1fr;align-items:center;gap:10px;text-align:left;border:1px solid #29404e;border-radius:14px;background:linear-gradient(150deg,rgba(20,36,47,.9),rgba(13,25,34,.96));color:#e9f2f4;box-shadow:inset 0 1px 0 #ffffff09;transition:transform .16s,border-color .16s,background .16s,box-shadow .16s;overflow:hidden}
.menu-mode-grid .menu-mode-card::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:2px;background:#6d8994;opacity:.45;transition:.16s}
.menu-mode-grid .menu-mode-card:hover:not(:disabled){transform:translateY(-2px);border-color:#486879;background:linear-gradient(150deg,#1a3342,#112733);box-shadow:0 10px 22px #02090d3d,inset 0 1px 0 #ffffff10}
.menu-mode-grid .menu-mode-card.is-selected{background:linear-gradient(150deg,#183c45,#15303a);border-color:#d76b43;color:#fff;box-shadow:0 8px 24px #0512184d,inset 0 -2px 0 #f0784b66}
.menu-mode-grid .menu-mode-card.is-selected::before{background:#ff7246;opacity:1;box-shadow:0 0 12px #ff7246}
.menu-card-icon{width:35px;height:35px;display:grid!important;place-items:center;border-radius:10px;background:#ffffff08;border:1px solid #ffffff0e;color:#7fa8b7!important}
.menu-mode-card.is-selected .menu-card-icon{color:#ff8a5f!important;background:#ff794215;border-color:#ff8c5b35}
.menu-card-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.menu-card-copy{display:flex!important;flex-direction:column;gap:4px;min-width:0;color:inherit!important}
.menu-card-copy>b{font-size:13px!important;line-height:1.15;color:inherit}
.menu-card-copy>span{font-size:9px!important;line-height:1.3;color:#77919d!important}
.menu-mode-card.is-selected .menu-card-copy>span{color:#a9c2ca!important}
.menu-mode-card>i{position:absolute;right:8px;top:7px;font-style:normal;font-size:9px;font-weight:900;letter-spacing:1px;color:#48616d}
.menu-garage-card.has-notice::after,.menu-tuning-card.has-notice::after{top:7px;right:8px}
.menu-mode-card.mode-unavailable{opacity:.46;filter:saturate(.55)}
.menu-mode-card.mode-unavailable .menu-card-copy>span{color:#60727a!important}
.menu-utility-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:1px}
.menu-selected-status{display:flex;align-items:center;gap:8px;color:#809aa5;font-size:9px;font-weight:900;letter-spacing:1.35px}
.menu-selected-status>i{width:6px;height:6px;border-radius:50%;background:#5ee1ad;box-shadow:0 0 10px #5ee1ad88}
.menu-ranking-btn{min-height:34px;padding:7px 12px;border-radius:10px;background:#111f29;border-color:#2b414d;color:#a8bec7;font-size:10px;font-weight:800}
.menu-ranking-btn:hover:not(:disabled){background:#18303d;color:#e9f3f5}

/* Keep the functional content below the hero calm and compact. */
.pit>#trial-picker,.pit>#mode-note,.pit>.career-panel,.pit>.task-grid,.pit>.location-goal,.pit>.pit-layout,.pit>.bottomline{margin-left:2px;margin-right:2px}
.pit>#mode-note{margin-top:4px}
.pit .bottomline{margin-top:12px}

@keyframes menu-star-drift{from{transform:translate3d(0,0,0)}to{transform:translate3d(42px,28px,0)}}
@media (prefers-reduced-motion:reduce){.menu-stars-a,.menu-stars-b{animation:none}.pit .menu-start-btn::before{display:none}}

@media(max-height:820px) and (min-width:821px){
  .menu-hero{min-height:354px}.menu-hero-content{padding:22px 28px 19px}.menu-hero h1{font-size:38px}.menu-lead{margin-bottom:12px}.pit .menu-start-btn{min-height:68px}.menu-start-copy strong{font-size:25px}.menu-mode-grid .menu-mode-card{min-height:75px;padding-top:9px;padding-bottom:9px}
}
@media(max-width:1000px){
  .menu-hero-content{width:68%}.menu-car-art{right:-13%;width:71%}.menu-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.menu-mode-grid .menu-mode-card{min-height:76px}.menu-card-copy>span{font-size:9px!important}
}
@media(max-width:820px){
  .pit{padding:9px}.menu-hero{min-height:430px;border-radius:15px;margin-bottom:10px}.menu-hero-content{width:72%;padding:24px 20px}.menu-car-art{right:-28%;top:13%;width:84%;opacity:.73}.menu-hero::before{background:linear-gradient(90deg,rgba(7,14,21,.98),rgba(7,14,21,.86) 50%,rgba(7,14,21,.2))}.pit .menu-launch-panel{position:static;grid-template-columns:1fr;gap:7px;margin-bottom:12px}.pit .menu-start-btn{min-height:70px}.menu-start-meta{display:none}.menu-mode-grid{gap:7px}.menu-mode-grid .menu-mode-card{min-height:70px}.menu-card-copy>span{display:block!important}.menu-utility-row{padding-bottom:1px}
}
@media(max-width:600px){
  .menu-hero{min-height:520px}.menu-hero-content{width:100%;padding:22px 16px 18px}.menu-hero h1{font-size:34px;max-width:85%}.menu-lead{max-width:76%;font-size:12px}.menu-car-art{right:-30%;top:3%;width:95%;height:62%;opacity:.44;transform:rotate(-5deg)}.menu-car-art img{transform:translate(9%,-2%) scale(1.03)}.menu-mode-grid{grid-template-columns:1fr 1fr}.menu-mode-grid .menu-mode-card{min-height:76px;text-align:left;align-items:center;padding:10px 8px}.menu-mode-grid .menu-mode-card span{display:flex}.menu-card-copy>span{display:none!important}.menu-start-copy strong{font-size:27px}.menu-start-arrow{width:41px;height:41px}.menu-selected-status{font-size:8px;letter-spacing:.9px}.menu-ranking-btn{padding:7px 9px}.pit>.bottomline{padding-bottom:4px}
}
@media(max-width:390px){
  .menu-hero{min-height:500px}.menu-hero h1{font-size:31px}.menu-lead{margin-bottom:14px}.menu-mode-grid .menu-mode-card{grid-template-columns:31px 1fr}.menu-card-icon{width:31px;height:31px}.menu-card-copy>b{font-size:12px!important}.menu-utility-row{align-items:flex-start}.menu-selected-status{max-width:60%;line-height:1.4}
}

/* Star Arena: fixed-screen competitive mode. */
.is-arena-run .track-progress{display:none}
.is-arena-run .world-label .eyebrow{color:#dffcff}
.is-arena-run .record-box{border-color:#6ecbd0;background:linear-gradient(180deg,#163842e6,#102731e8)}
.result-modal.is-arena-result .reward-offer,.result-modal.is-arena-result .result-stats,.result-modal.is-arena-result .result-total{display:none!important}
.result-modal.is-arena-result .result-distance b{color:#f5c65b}
.result-modal.is-arena-result .result-distance span{text-transform:uppercase;letter-spacing:1.4px}


/* === Mobile browser adaptation (v16) === */
html,body{overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{height:var(--app-h,100dvh);min-height:var(--app-h,100dvh)}
.game-shell{height:var(--app-h,100dvh);min-height:min(520px,var(--app-h,100dvh))}
.pit,.modal{touch-action:pan-y;-webkit-overflow-scrolling:touch}
.arena,.driving-controls,.tilt-controls,.nitro-btn{touch-action:none}
.rotate-overlay{display:none;position:absolute;inset:0;z-index:40;align-items:center;justify-content:center;padding:24px;background:rgba(7,17,23,.76);backdrop-filter:blur(8px);color:#f7fbf5;text-align:center;pointer-events:auto}
.rotate-card{width:min(330px,88vw);padding:24px 22px;border:1px solid rgba(211,239,234,.28);border-radius:22px;background:linear-gradient(145deg,rgba(18,49,53,.96),rgba(12,29,39,.97));box-shadow:0 22px 70px rgba(0,0,0,.34);display:flex;flex-direction:column;align-items:center;gap:8px}
.rotate-phone{font-size:42px;line-height:1;color:#ffd16b;letter-spacing:-5px;margin-bottom:5px}
.rotate-card strong{font-size:18px;letter-spacing:1.2px}
.rotate-card>span:last-child{font-size:13px;color:#bfd5d1;line-height:1.45}

@media(pointer:coarse){
  button,.icon-btn,.toolbar-btn,.mode-button{min-height:44px}
  .close-dialog{min-width:48px;min-height:48px;right:8px;top:5px}
  .menu-mode-grid .menu-mode-card{min-height:78px}
  .modal{max-height:calc(var(--app-h,100dvh) - 18px)}
  .menu-stars-a,.menu-stars-b{animation-duration:55s}
  .driving-controls{left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(16px,calc(env(safe-area-inset-bottom) + 10px));z-index:12}
  .tilt-controls{gap:12px}
  .tilt-controls button{width:72px;height:64px;border-radius:16px;font-size:36px;box-shadow:0 4px 0 #365e524d,0 10px 28px #16362f22}
  .nitro-btn{min-width:190px;height:64px;border-radius:16px;font-size:19px}
  .nitro-btn>span{font-size:13px}
  .topbar{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
  .toast{bottom:max(20px,calc(env(safe-area-inset-bottom) + 14px))}
}

@media(pointer:coarse) and (orientation:portrait){
  .is-running .rotate-overlay,.is-staging .rotate-overlay{display:flex}
  .is-running .driving-controls{visibility:hidden}
}

@media(pointer:coarse) and (orientation:landscape){
  .game-shell{min-height:0}
  .is-running .topbar,.is-staging .topbar{flex:0 0 56px;min-height:56px;padding-top:5px;padding-bottom:5px}
  .is-running .arena,.is-staging .arena,.is-result .arena{min-height:0;height:auto}
  .is-running .topbar .hud{top:50%;padding:6px 9px;gap:8px;max-width:calc(100vw - 150px)}
  .is-running .topbar .hud>div{min-width:48px}
  .is-running .topbar .hud strong{font-size:18px}
  .is-running .topbar .hud span{font-size:8px}
  .is-running .topbar .hud small{font-size:9px}
  .is-running .top-actions{margin-left:auto}
  .is-running .top-actions .icon-btn{display:none}
  .is-running .top-actions #pause-btn{display:inline-grid;place-items:center;width:44px;height:44px;min-height:44px}
  .is-running .wallet{display:none}
  .is-running .driving-controls{bottom:max(12px,calc(env(safe-area-inset-bottom) + 6px))}
  .is-running .tilt-controls button{width:78px;height:66px}
  .is-running .nitro-btn{min-width:205px;height:66px}
  .is-running .track-progress{bottom:max(87px,calc(env(safe-area-inset-bottom) + 82px));left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right))}
  .is-running .trick-counter{bottom:max(91px,calc(env(safe-area-inset-bottom) + 86px))}
  .run-message{top:28%;font-size:17px}
}

@media(pointer:coarse) and (orientation:landscape) and (max-height:430px){
  .is-running .topbar,.is-staging .topbar{flex-basis:50px;min-height:50px}
  .is-running .topbar .hud{padding:5px 7px;gap:6px}
  .is-running .topbar .hud>div{min-width:43px}
  .is-running .topbar .hud strong{font-size:16px}
  .is-running .tilt-controls button{width:70px;height:58px;font-size:32px}
  .is-running .nitro-btn{min-width:182px;height:58px;font-size:17px}
  .is-running .track-progress{bottom:max(77px,calc(env(safe-area-inset-bottom) + 72px))}
  .is-running .trick-counter{bottom:max(80px,calc(env(safe-area-inset-bottom) + 75px))}
  .world-label,.record-box{top:10px}
}

@media(pointer:coarse) and (max-width:600px) and (orientation:portrait){
  .pit{top:76px;bottom:max(8px,env(safe-area-inset-bottom));width:calc(100vw - 12px);max-height:calc(var(--app-h,100dvh) - 84px);padding:10px}
  .menu-hero{min-height:510px}
  .menu-hero-content{padding-bottom:12px}
  .menu-mode-grid .menu-mode-card{min-height:72px}
  .menu-utility-row{padding-bottom:8px}
}

/* === Mobile compact HUD pass (v17) === */
@media(pointer:coarse) and (orientation:landscape){
  /* Keep as much of the phone screen as possible for the actual flight. */
  .topbar{min-height:42px;flex:0 0 42px;padding-top:3px;padding-bottom:3px;gap:8px}
  .topbar .brand{gap:6px}
  .topbar .brand-badge{width:28px;height:24px;border-radius:7px 2px 7px 2px;font-size:14px;letter-spacing:-1px;box-shadow:inset 0 -2px 0 #cf4929}
  .topbar .brand>div{gap:1px}
  .topbar .brand strong{font-size:11px;letter-spacing:.7px;line-height:1}
  .topbar .brand>div>span{display:none}
  .topbar .wallet{padding:4px 8px;gap:4px;min-height:28px}
  .topbar .wallet>span{font-size:15px}.topbar .wallet b{font-size:13px}.topbar .wallet small{display:none}
  .topbar .icon-btn{width:30px;height:30px;min-width:30px;min-height:30px;font-size:15px}

  .is-running .topbar,.is-staging .topbar{min-height:42px;flex-basis:42px;padding-top:2px;padding-bottom:2px}
  .is-running .topbar .hud{
    top:50%;gap:4px;padding:3px 6px;max-width:calc(100vw - 118px);
    border-radius:9px;background:#eef4e9e8;box-shadow:none
  }
  .is-running .topbar .hud>div{min-width:35px;gap:0}
  .is-running .topbar .hud span{font-size:6.5px;letter-spacing:.45px;line-height:1.05}
  .is-running .topbar .hud strong{font-size:14px;line-height:1.05}
  .is-running .topbar .hud small{font-size:7px}
  .is-running .topbar .hud .star-counter{min-width:24px;gap:3px;font-size:14px}
  .is-running .topbar .hud .star-counter b{font-size:13px}
  .is-running .top-actions #pause-btn{width:32px;height:32px;min-width:32px;min-height:32px;font-size:14px}

  /* On phones the flip panel should be a tiny counter, not a text card. */
  .is-running .trick-counter{
    left:max(10px,env(safe-area-inset-left));bottom:max(72px,calc(env(safe-area-inset-bottom) + 68px));
    max-width:none;padding:4px 7px;border-radius:7px;font-size:8px;letter-spacing:.25px;
    background:#f8fff0c9;box-shadow:none
  }
  .is-running .trick-counter b{font-size:13px;margin-left:4px}
  .is-running .trick-counter span{display:none!important}
  .is-running .track-progress{bottom:max(70px,calc(env(safe-area-inset-bottom) + 66px))}
  .run-message{font-size:14px}
}

@media(pointer:coarse) and (orientation:landscape) and (max-height:430px){
  .topbar,.is-running .topbar,.is-staging .topbar{min-height:38px;flex-basis:38px}
  .topbar .brand-badge{width:25px;height:21px;font-size:12px}
  .topbar .brand strong{font-size:10px}
  .is-running .topbar .hud{padding:2px 5px;gap:3px;max-width:calc(100vw - 104px)}
  .is-running .topbar .hud>div{min-width:32px}
  .is-running .topbar .hud strong{font-size:13px}
  .is-running .topbar .hud span{font-size:6px}
  .is-running .topbar .hud small{font-size:6.5px}
  .is-running .topbar .hud .star-counter{font-size:13px}.is-running .topbar .hud .star-counter b{font-size:12px}
  .is-running .top-actions #pause-btn{width:28px;height:28px;min-width:28px;min-height:28px;font-size:13px}
  .is-running .trick-counter{bottom:max(65px,calc(env(safe-area-inset-bottom) + 61px));padding:3px 6px;font-size:7px}
  .is-running .trick-counter b{font-size:12px}
  .is-running .track-progress{bottom:max(63px,calc(env(safe-area-inset-bottom) + 59px))}
}

/* Desktop menu alignment cleanup: no numeric badges, tighter icon column, safe wrapping. */
@media (min-width:901px){
  .menu-mode-grid .menu-mode-card{grid-template-columns:30px minmax(0,1fr);gap:7px;padding-left:9px;padding-right:9px}
  .menu-card-icon{width:30px;height:30px}
  .menu-card-copy{min-width:0;max-width:100%;overflow:hidden}
  .menu-card-copy>b,.menu-card-copy>span{white-space:normal;overflow-wrap:break-word;word-break:normal;max-width:100%}
  .menu-card-copy>b{font-size:12px!important}
  .menu-card-copy>span{font-size:8.5px!important;line-height:1.25}
}

/* Compact desktop mode cards: keep long titles on one line. */
@media (min-width:1001px){
  .menu-mode-grid .menu-mode-card{grid-template-columns:30px minmax(0,1fr);gap:6px;padding-left:8px;padding-right:8px}
  .menu-card-icon{width:30px;height:30px;border-radius:9px}
  .menu-card-icon svg{width:18px;height:18px}
  .menu-card-copy>b{font-size:12.5px!important;letter-spacing:-.15px;white-space:nowrap}
  .menu-card-copy>span{font-size:8.5px!important}
}

/* === Garage / Tuning: separate service controls in the upper-right corner === */
.menu-service-tools{
  position:absolute;
  top:16px;
  right:16px;
  z-index:6;
  display:flex;
  gap:8px;
  align-items:stretch;
  pointer-events:auto;
}
.menu-service-btn{
  position:relative;
  width:150px;
  min-height:61px;
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  align-items:center;
  gap:9px;
  padding:9px 12px;
  border:1px solid rgba(129,173,191,.28);
  border-radius:12px;
  color:#eaf4f6;
  background:linear-gradient(145deg,rgba(12,27,37,.82),rgba(17,39,50,.72));
  box-shadow:0 7px 22px rgba(1,8,13,.26),inset 0 1px 0 rgba(255,255,255,.07);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  text-align:left;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease,opacity .16s ease;
}
.menu-service-btn:hover:not(:disabled){
  transform:translateY(-2px);
  border-color:rgba(129,203,220,.55);
  background:linear-gradient(145deg,rgba(18,45,57,.92),rgba(18,36,47,.88));
  box-shadow:0 11px 28px rgba(1,8,13,.34),inset 0 1px 0 rgba(255,255,255,.1);
}
.menu-service-btn:active:not(:disabled){transform:translateY(1px)}
.menu-service-icon{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:rgba(111,180,198,.09);
  border:1px solid rgba(131,193,208,.15);
  color:#8fc4d1;
}
.menu-service-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.menu-service-copy{display:flex;flex-direction:column;gap:2px;min-width:0;line-height:1.1}
.menu-service-copy b{font-size:13.5px;letter-spacing:.2px;color:#f3f8f9;white-space:nowrap}
.menu-service-copy small{font-size:9px;line-height:1.2;color:#7f9da8;white-space:nowrap}
.menu-service-btn.menu-tuning-card:not(:disabled){border-color:rgba(242,123,78,.28)}
.menu-service-btn.menu-tuning-card:not(:disabled) .menu-service-icon{color:#ff936d;background:rgba(255,118,70,.09);border-color:rgba(255,136,94,.15)}
.menu-service-btn.mode-unavailable,.menu-service-btn:disabled{opacity:.42;filter:saturate(.55);cursor:default}
.menu-service-btn.has-notice::after{
  content:"";
  position:absolute;
  top:6px;
  right:6px;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#ff784b;
  box-shadow:0 0 0 2px rgba(11,25,34,.9),0 0 12px rgba(255,120,75,.8);
}
/* Four gameplay modes now form a clean 2x2 block. */
.menu-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

@media(max-width:1000px){
  .menu-service-tools{top:12px;right:12px;gap:6px}
  .menu-service-btn{width:130px;min-height:53px;grid-template-columns:31px minmax(0,1fr);gap:7px;padding:8px 9px}
  .menu-service-icon{width:31px;height:31px}
  .menu-service-icon svg{width:17px;height:17px}
  .menu-service-copy b{font-size:12px}.menu-service-copy small{font-size:8.2px}
}
@media(max-width:820px){
  .menu-service-tools{top:10px;right:10px;flex-direction:column;gap:5px}
  .menu-service-btn{width:116px;min-height:43px;grid-template-columns:28px minmax(0,1fr);padding:6px 8px;border-radius:10px}
  .menu-service-icon{width:28px;height:28px;border-radius:7px}
  .menu-service-copy small{display:none}
  .menu-service-copy b{font-size:11px}
  .menu-hero-content{padding-right:132px}
}
@media(max-width:600px){
  .menu-service-tools{top:9px;right:9px}
  .menu-service-btn{width:103px;min-height:39px;grid-template-columns:25px minmax(0,1fr);gap:5px;padding:5px 7px}
  .menu-service-icon{width:25px;height:25px}
  .menu-service-icon svg{width:15px;height:15px}
  .menu-service-copy b{font-size:10.2px}
  .menu-hero-content{padding-right:121px}
  .menu-hero h1{max-width:100%}
}
@media(max-width:390px){
  .menu-service-tools{right:7px;top:7px}
  .menu-service-btn{width:94px;min-height:37px;grid-template-columns:23px minmax(0,1fr);padding:4px 6px}
  .menu-service-icon{width:23px;height:23px}
  .menu-service-copy b{font-size:9.6px}
  .menu-hero-content{padding-right:109px}
}


/* Short progression reveal: deliberately compact so it never blocks the result screen. */
.result-modal{position:relative;overflow-x:hidden}
.unlock-pop{position:absolute;z-index:4;left:18px;right:18px;top:18px;padding:12px 15px;border-radius:13px;background:linear-gradient(135deg,#163d37f2,#245e4ff2);border:1px solid #efd079;color:#fff9e6;box-shadow:0 13px 35px #102e2855,0 0 0 1px #ffffff12;pointer-events:none;transform:translateY(-18px) scale(.96);opacity:0}
.unlock-pop.show{animation:unlock-reveal 1.5s cubic-bezier(.2,.8,.2,1)}
.unlock-pop span{display:block;font-size:9px;font-weight:900;letter-spacing:2.2px;color:#f6be52;margin-bottom:4px}
.unlock-pop b{display:block;font-size:14px;line-height:1.28;letter-spacing:-.1px}
@keyframes unlock-reveal{0%{opacity:0;transform:translateY(-18px) scale(.96)}16%,76%{opacity:1;transform:translateY(0) scale(1)}100%{opacity:0;transform:translateY(-5px) scale(.99)}}
@media (prefers-reduced-motion:reduce){.unlock-pop.show{animation:none;opacity:1;transform:none}}


/* Compact cloud-save status now lives beside the game title, not under START. */
.brand-title-row{display:flex;align-items:center;gap:10px;min-width:0}
.brand-save-state{display:inline-flex;align-items:center;max-width:220px;padding:3px 7px;border:1px solid #b8ccc248;border-radius:999px;background:#e8f1ea;color:#6c8279;font-size:9px!important;font-weight:800!important;letter-spacing:.25px!important;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.game-shell:not(.is-running):not(.is-staging):not(.is-result):not(.is-replaying) .brand-save-state{background:#15262f;border-color:#34505d;color:#84a3ad}
.pit .menu-launch-panel{grid-template-columns:minmax(250px,360px);width:min(360px,100%)}
.menu-start-meta{display:none!important}

.daily-gift-btn{position:relative;width:39px;height:39px;display:grid;place-items:center;border-radius:12px;border:1px solid #d9b65a;background:linear-gradient(145deg,#fff6d5,#f7d97b);box-shadow:0 4px 12px #9a6b1c24;color:#5d4010;font-size:19px;line-height:1;padding:0}
.daily-gift-btn:hover{transform:translateY(-1px);box-shadow:0 7px 18px #9a6b1c35}
.daily-gift-btn i{position:absolute;right:-3px;top:-3px;width:10px;height:10px;border-radius:50%;background:#f05e3d;border:2px solid #f8faf5;box-shadow:0 0 9px #f05e3d99}
.daily-login-modal{width:500px;max-width:min(94vw,500px);text-align:center}
.daily-login-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:20px 0 8px}
.daily-login-day{position:relative;min-width:0;padding:12px 6px;border-radius:11px;border:1px solid #d8e3d3;background:#f3f7ee;display:flex;flex-direction:column;gap:6px;align-items:center}
.daily-login-day span{font-size:9px;font-weight:900;letter-spacing:.8px;color:#71857b}.daily-login-day b{font-size:13px;white-space:nowrap;color:#2c6557}
.daily-login-day.current{border-color:#e5a743;background:linear-gradient(180deg,#fff5ca,#f9e6a2);box-shadow:0 0 0 2px #f0bd5540,0 8px 22px #9c6b1a20;transform:translateY(-3px)}
.daily-login-day.current span{color:#9a671d}.daily-login-day.current b{color:#7c4d09}.daily-login-day.claimed{opacity:.62}.daily-login-day i{position:absolute;top:5px;right:6px;font-style:normal;color:#4f8b70;font-weight:900}
@media(max-width:620px){.brand-save-state{max-width:120px;font-size:7.5px!important;padding:2px 5px}.daily-gift-btn{width:34px;height:34px;font-size:16px}.daily-login-grid{gap:4px}.daily-login-day{padding:9px 3px}.daily-login-day span{font-size:7.5px}.daily-login-day b{font-size:10px}}

.effects-setting + .effects-setting{margin-top:10px}

/* === Wide desktop dialogs: keep the important controls in view without nested scrolling. === */
@media (min-width:901px) and (min-height:640px){
  .modal{max-height:min(88dvh,820px)}
  #help-dialog{width:1040px;max-width:min(92vw,1040px);padding:30px 38px}
  #help-dialog h2{margin-bottom:17px}
  #help-dialog ol{columns:2;column-gap:44px;column-rule:1px solid #e2e8df;padding-left:24px;margin:8px 0 16px}
  #help-dialog li{break-inside:avoid-column;margin:7px 0 10px;padding-right:18px;line-height:1.5}
  #help-dialog>p{margin:8px 0 0}
  #help-dialog .primary{width:360px;margin:18px auto 0}

  .workshop-modal{width:1180px;max-width:min(94vw,1180px);padding:28px 32px}
  .workshop-modal>p{max-width:860px;margin:8px 0 13px}
  .workshop-modal h3{font-size:16px;margin:17px 0 9px}
  .workshop-modal .collection-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}
  .workshop-modal .collection-card,.workshop-modal .location-card{padding:10px;gap:5px;border-radius:11px}
  .workshop-modal .collection-card b,.workshop-modal .location-card b{font-size:13px;line-height:1.25}
  .workshop-modal .collection-card span,.workshop-modal .location-card span,.workshop-modal .collection-card small{font-size:11px;line-height:1.3}
  .workshop-modal .location-card img{height:72px}
  .workshop-modal .paint-grid{gap:7px}
  .workshop-modal .paint-choice{padding:7px 9px;font-size:12px}
  .workshop-modal .effects-setting{display:inline-flex;width:32.5%;margin:15px 0 0;padding-right:14px;vertical-align:top;font-size:12px}

  .tuning-modal{width:1080px;max-width:min(94vw,1080px)}
  .tuning-modal .upgrade-grid{gap:14px}
  .tuning-modal .upgrade-card{padding:16px}

  .ranking-modal{width:760px;max-width:min(92vw,760px)}
  .result-modal{width:560px;max-width:min(92vw,560px);padding:28px 34px}
  .result-modal .result-distance{margin:14px 0 17px}
  .result-modal .result-distance b{font-size:58px}
  .result-modal .result-stats{padding:13px 0}
  .result-modal .result-total{margin:15px 0}
  .result-modal p{margin-top:8px;margin-bottom:8px}
  .card-modal{width:900px;max-width:min(92vw,900px)}
  .daily-login-modal{width:640px;max-width:min(92vw,640px)}
}


/* === Replay player: cinematic VCR-style controls === */
.replay-indicator{position:absolute;top:18px;left:18px;z-index:8;display:flex;align-items:center;justify-content:center;gap:7px;min-width:48px;height:34px;padding:0 11px;border-radius:9px;background:#191512c9;border:1px solid #e3c99f66;color:#f7e7c7;box-shadow:0 5px 18px #0006;pointer-events:none;backdrop-filter:blur(4px)}
.replay-indicator i{width:7px;height:7px;border-radius:50%;background:#ef5d43;box-shadow:0 0 10px #ef5d43;animation:replay-led .9s steps(1,end) infinite}
.replay-indicator b{font-size:18px;line-height:1;font-weight:950;letter-spacing:1.5px;animation:replay-r-blink .9s steps(1,end) infinite}
@keyframes replay-led{0%,48%{opacity:1}49%,100%{opacity:.15}}
@keyframes replay-r-blink{0%,48%{opacity:1}49%,100%{opacity:.46}}
.replay-bar{position:absolute;left:20px;right:20px;bottom:18px;z-index:8;display:grid;grid-template-columns:auto auto minmax(120px,1fr) auto auto;align-items:center;gap:12px;background:linear-gradient(180deg,#1b2728ee,#11191bee);color:#fff1d8;border:1px solid #c8ad7b7a;border-radius:14px;padding:10px 12px;box-shadow:0 12px 34px #0007,inset 0 1px 0 #fff1;backdrop-filter:blur(9px)}
.replay-heading{display:flex;flex-direction:column;gap:2px;min-width:126px}.replay-heading b{font-size:11px;letter-spacing:1.25px;color:#f0d8b0}.replay-heading span{font-size:11px;color:#aeb9b3;font-variant-numeric:tabular-nums}
.replay-transport{display:flex;align-items:center;gap:5px}.replay-control{height:34px;min-width:45px;padding:0 10px;border:1px solid #d0b78647;border-radius:8px;background:#293335d9;color:#f6e8cc;font-size:12px;font-weight:850;box-shadow:inset 0 1px 0 #fff1}.replay-control:hover{background:#394548;border-color:#d8c09280}.replay-play{min-width:42px;font-size:16px}.replay-speed{min-width:48px}.replay-exit{height:34px;white-space:nowrap;background:#e8d6b1;color:#273033;border-color:#e8d6b1;font-weight:850}.replay-exit:hover{background:#fff0d0}
.replay-scrubber{width:100%;min-width:90px;height:20px;accent-color:#dfa85d;cursor:pointer}.replay-scrubber::-webkit-slider-runnable-track{height:5px;border-radius:6px;background:#72746888}.replay-scrubber::-webkit-slider-thumb{margin-top:-5px}.replay-scrubber::-moz-range-track{height:5px;border-radius:6px;background:#72746888}
.is-replaying #game{filter:sepia(.32) saturate(.82) contrast(1.07) brightness(.96);transition:filter .18s ease}
.is-replaying .arena::after{content:"";position:absolute;inset:0;z-index:5;pointer-events:none;opacity:.16;background:repeating-linear-gradient(0deg,rgba(255,244,216,.12) 0 1px,rgba(24,20,16,.08) 1px 3px),linear-gradient(90deg,transparent 0 47%,rgba(255,255,255,.055) 49%,transparent 52%);mix-blend-mode:soft-light;animation:replay-ripple .24s steps(2,end) infinite}
@keyframes replay-ripple{0%{transform:translateY(0);background-position:0 0,0 0}50%{transform:translateY(.45px);background-position:0 2px,3px 0}100%{transform:translateY(0);background-position:0 4px,0 0}}
@media(max-width:720px){.replay-bar{left:8px;right:8px;bottom:8px;grid-template-columns:auto 1fr auto;gap:7px;padding:8px}.replay-heading{min-width:98px}.replay-heading b{font-size:9px}.replay-heading span{font-size:9px}.replay-transport{grid-column:1/2;grid-row:2}.replay-scrubber{grid-column:2/4;grid-row:1}.replay-speed{grid-column:2;grid-row:2;justify-self:start}.replay-exit{grid-column:3;grid-row:2}.replay-control{height:30px;min-width:36px;padding:0 7px;font-size:10px}.replay-play{font-size:14px}.replay-indicator{top:9px;left:9px;height:29px;min-width:42px;padding:0 8px}.replay-indicator b{font-size:16px}}

/* === Garage / Tuning: 1.5x desktop service controls, tight to top-right === */
@media(min-width:1001px){
  .menu-service-tools{top:8px!important;right:8px!important;gap:10px!important}
  .menu-service-btn{width:225px!important;min-height:91px!important;grid-template-columns:52px minmax(0,1fr)!important;gap:13px!important;padding:13px 17px!important;border-radius:16px!important}
  .menu-service-icon{width:52px!important;height:52px!important;border-radius:12px!important}
  .menu-service-icon svg{width:29px!important;height:29px!important}
  .menu-service-copy{gap:4px!important}
  .menu-service-copy b{font-size:19px!important;letter-spacing:.1px!important}
  .menu-service-copy small{font-size:11.5px!important}
  .menu-service-btn.has-notice::after{top:8px!important;right:8px!important;width:12px!important;height:12px!important}
}
