/* The approved coastal race: a clear view of the next jump, very little chrome. */
body.race{background:#f4ebdb;color:#263f37}
.race .game-shell{isolation:isolate;min-height:540px}
.race canvas{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;outline-offset:-4px}
.race .chase-wordmark{width:164px;top:18px;left:20px;z-index:3}
.race .game-shell:has(.start-panel:not([hidden])) .chase-wordmark{width:min(390px,75%);top:14px}
.race .start-panel{padding:12px 18px 10px;bottom:22px;background:#fff3dff5;max-width:390px}
.race .start-panel .primary-button{background:#b6472d;min-height:50px;font-size:17px}
.race .start-panel .watch-demo{min-height:40px;font-size:13px;margin:1px 0}
.race .start-panel .pill{font-size:12px;letter-spacing:.8px;line-height:1.4}
.crew-note{display:block;font-size:12px;line-height:1.4;color:#465e50}
.race #challenge-copy:not([hidden]){display:block;font-size:14px;line-height:1.4;margin:0 0 9px}
.race-hud{position:absolute;inset:0;pointer-events:none;z-index:4}
.race-place{position:absolute;right:76px;top:20px;display:flex;align-items:center;gap:10px;background:#263e37f5;color:#fff1d6;transform:rotate(3deg);padding:7px 17px;border-radius:4px;font-style:italic;box-shadow:3px 4px 0 #263e3720}
.race-place b{font-size:39px;line-height:1;color:#ffab80;font-weight:950}.race-place span{font-size:23px;font-weight:800;white-space:nowrap}
.race-pause{position:absolute;right:20px;top:23px;pointer-events:auto;width:44px;height:44px;background:#fff2dcf2;border:0}
.race-clock{position:absolute;left:22px;right:24px;top:91px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:850;color:#263f37}
.race-clock span,.race-clock time{background:#fff3dee8;border-radius:30px;padding:5px 10px;line-height:1.15}
.race-clock time{font-variant-numeric:tabular-nums;font-size:14px}
.race-progress{position:absolute;top:124px;left:27px;right:29px;height:5px;border-radius:4px;background:#fff1d7b8;box-shadow:0 0 0 1px #27453c33;overflow:visible}
.race-progress>span{position:absolute;inset:0;background:#c95032;border-radius:4px;transform-origin:left;transform:scaleX(0)}
.race-progress>i{position:absolute;top:-2px;left:33.3%;width:8px;height:8px;border-radius:50%;background:#fff4df;border:2px solid #557d69}
.race-progress>i:nth-of-type(2){left:66.6%}.race-progress>svg{position:absolute;right:-6px;top:-9px;width:20px;height:20px;fill:#fff3dd;stroke:#264a3b;stroke-width:2}
.race-order{position:absolute;left:22px;top:143px;display:flex;gap:5px;flex-wrap:wrap;max-width:calc(100% - 42px)}
.race-order span{background:#fff3dfed;border-radius:30px;padding:4px 8px;font-size:12px;line-height:1.2;color:#2d4f40}
.race-order span.you{background:#2c5545;color:#fff4dc}.race-order b{margin-right:3px;font-weight:900}
.race .play-coach{width:300px;bottom:24px;border:5px solid #fff4df;padding:9px 12px 7px;background:#fff1dcf5;border-radius:22px;box-shadow:0 5px 22px #473e2725}
.race #coach-action{font-size:12px;letter-spacing:1.3px;font-weight:900;line-height:1.3}
.race .charge-track{height:12px;margin-top:7px;background:#b6997055}.race .charge-track span{background:#ed784e;transition:transform 50ms linear}
.race #coach-detail{font-size:12px;line-height:1.4;margin-top:5px;color:#385642}
.race .play-coach.landing{background:#255243;border-color:#e9f5ce}.race .play-coach.landing #coach-detail{color:#effadf}
.race .feedback{top:31%;z-index:5;text-align:center;pointer-events:none;color:#24463b}
.race .feedback:not(:empty){left:50%;transform:translateX(-50%) rotate(-3deg);width:max-content;max-width:calc(100% - 30px);background:#fff1dce8;padding:9px 18px;border-radius:6px}
.race .feedback-title{font-size:26px!important;font-style:italic;font-weight:950;line-height:1.15;color:#254b3f;animation:none}
.race .feedback-sub{font-size:12px!important;color:#405b4a;margin-top:3px;font-weight:700}
.race-caption{display:flex;justify-content:space-between;align-items:center;padding:23px 5px 8px;gap:20px}
.race-caption h1{font-size:29px;letter-spacing:-.8px;margin:5px 0 0}.race-caption p{font-size:14px;line-height:1.65;color:#405c4a;text-align:right}
.race .result-panel{width:min(430px,calc(100% - 28px));padding:25px 24px;top:50%;max-height:calc(100svh - 30px);overflow-y:auto;background:#fff4e2f7;border:0;backdrop-filter:blur(12px)}
.race .result-panel h2{font-size:31px;line-height:1.05;margin:9px 0}.race .result-panel p{font-size:14px;line-height:1.5}
.race-result-time{font-size:51px;line-height:1.1;letter-spacing:-2px;font-variant-numeric:tabular-nums;font-weight:900;color:#284d40;margin:13px 0 2px}
.race .result-score-label{font-size:12px;letter-spacing:.7px}.race #new-best{color:#a93c25;font-size:12px;letter-spacing:0}
.finish-order{list-style:none;padding:0;margin:18px 0 12px;text-align:left}
.finish-order li{display:flex;align-items:center;gap:10px;min-height:43px;padding:6px 10px;border-bottom:1px solid #34534220;color:#36503f;font-size:14px}
.finish-order li.you{background:#2b5546;color:#fff4df;border-radius:7px;border:0;font-weight:800}
.finish-order .placing{width:18px;font-weight:900}.finish-order .rider-dot{width:9px;height:9px;border-radius:50%}.finish-order time{margin-left:auto;font-variant-numeric:tabular-nums}
.race .race-result-stats{font-size:12px;color:#405b49;margin:8px 0 15px}
.race .result-actions{display:flex;flex-wrap:wrap;gap:9px}.race .result-actions button{flex:1;min-height:46px;justify-content:center;font-size:14px}
.race .result-secondary{margin-top:7px;gap:10px;justify-content:space-between}.race .result-secondary button{font-size:12px;min-height:44px}
.race .pause-panel{width:min(380px,calc(100% - 28px));border:0}.race .pause-panel h2{font-size:30px}.race .pause-panel .text-button{min-height:44px}
.race .icon-button{min-width:44px;min-height:44px}.race .top-actions{gap:4px}
.race .crew-card{font-size:14px}.race .crew-status,.race .garage-status{font-size:13px}.race .crew-description{font-size:13px;line-height:1.5}
body.race.riding{overflow:hidden;overscroll-behavior:none}
body.race.riding .game-shell{position:fixed;inset:0;width:100%;height:100dvh;min-height:0;margin:0;border-radius:0;z-index:20}
body.race.riding .race-pause{top:max(20px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right))}
body.race.riding .race-place{top:max(18px,env(safe-area-inset-top))}
body.race.riding .play-coach{bottom:max(18px,env(safe-area-inset-bottom))}
body.race.riding .chase-wordmark{left:max(18px,env(safe-area-inset-left));top:max(20px,env(safe-area-inset-top))}
@media(max-width:600px){
 .race .topbar{height:60px;padding:0 9px}.race .brand-icon{display:none}.race .top-actions{gap:0}.race .crew-button,.race .garage-button{padding:0 8px}
 .race .game-shell,.race .game-shell:has(.start-panel:not([hidden])){height:calc(100svh - 60px);min-height:550px}
 .race .chase-wordmark{width:135px;left:17px;top:19px}.race .game-shell:has(.start-panel:not([hidden])) .chase-wordmark{width:79%;top:17px}
 .race .start-panel{bottom:14px;width:calc(100% - 28px);padding:11px 13px 8px}.race .start-panel .pill{font-size:12px;letter-spacing:.35px}.race .start-panel .primary-button{font-size:16px;min-height:48px}
 .race-place{right:66px;top:21px;padding:7px 13px;gap:7px}.race-place b{font-size:33px}.race-place span{font-size:22px}.race-pause{right:13px;top:22px}
 .race-clock{top:89px;left:18px;right:18px}.race-progress{top:119px;left:23px;right:23px}.race-order{top:134px;left:18px}
 .race .play-coach{width:282px;max-width:calc(100% - 38px);padding:8px 11px 6px}.race #coach-action{letter-spacing:1px}
 .race .feedback{top:32%}.race .feedback-title{font-size:22px!important}
 .race-caption{display:block;padding:20px 18px 6px}.race-caption h1{font-size:25px}.race-caption p{text-align:left;margin-top:9px}
 .race .result-panel{padding:21px 20px}.race .result-panel h2{font-size:28px}.race .result-actions{flex-direction:column}.race-result-time{font-size:44px}
}
@media(max-width:350px){.race .chase-wordmark{width:114px}.race-place{gap:5px;padding:8px 10px}.race-place b{font-size:29px}.race-place span{font-size:20px}.race .brand{letter-spacing:.2px}.race .scrap-counter{padding:2px 4px}.race-order{gap:3px}.race-order span{padding:4px 6px}}
@media(max-height:480px) and (min-width:600px){
 .race .game-shell{min-height:340px}.race .chase-wordmark{width:125px}.race-clock{top:79px}.race-progress{top:108px}.race-order{top:122px}.race .play-coach{width:250px;bottom:10px;padding:5px 10px}.race #coach-detail{display:none}
 .race .start-panel{left:auto;right:24px;bottom:18px;transform:none;width:285px}.race .game-shell:has(.start-panel:not([hidden])) .chase-wordmark{width:245px;left:22px;transform:none}
 .race .result-panel{padding:16px 22px;width:min(540px,calc(100% - 36px))}.race .feedback{top:35%}
}
@media(prefers-reduced-motion:reduce){.race .charge-track span{transition:none}.race-place,.race .feedback:not(:empty){transform:none}}

/* Swipe on the course; deliberate trick choices appear beside the boost in the air. */
.race .play-coach,body.race.riding .play-coach{left:50%;transform:translateX(-50%);bottom:calc(max(18px,env(safe-area-inset-bottom)) + 98px);width:310px;max-width:calc(100% - 28px);min-width:0;padding:9px 12px;border:0;border-radius:14px;pointer-events:none}
.race #coach-action{font-size:12px;letter-spacing:.7px}.race #coach-detail{font-size:12px;margin-top:3px}
.race .feedback{white-space:normal}
.trick-buttons{position:absolute;z-index:6;left:max(14px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));width:calc(100% - 120px);max-width:282px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.trick-buttons button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;height:78px;min-width:0;padding:7px 2px;border:3px solid #fff1d7;border-radius:18px;background:#284d46;color:#fff5de;touch-action:manipulation;cursor:pointer}
.trick-buttons span{font-size:12px;line-height:1.2;font-weight:800;white-space:nowrap}
.trick-buttons svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.trick-buttons button:disabled{cursor:default;background:#415e53;color:#fff5de;opacity:1}
.trick-buttons button[aria-pressed="true"]{background:#b6472d;border-color:#ffe2a6;color:#fff5de}
.trick-buttons button:active,.race-boost:active{transform:scale(.96)}
.trick-buttons button:focus-visible,.race-boost:focus-visible{outline:3px solid #fff;outline-offset:3px}
.race-boost{position:absolute;z-index:6;right:max(16px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));width:82px;height:90px;border:4px solid #fff1d7;border-radius:24px;background:#284d46;color:#fff5de;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden;box-shadow:0 4px 20px #263f372b;touch-action:manipulation;isolation:isolate;cursor:pointer}
.race-boost>span{position:absolute;inset:0;z-index:-1;transform-origin:bottom;background:#286574;transition:transform .12s linear}
.race-boost svg{width:26px;height:26px;fill:#ffdfa1;stroke:none}.race-boost b{font-size:13px;letter-spacing:.8px;line-height:1.2}.race-boost small{font-size:12px;font-weight:800;line-height:1.3;color:#fff2d0}
.race-boost:disabled{cursor:default;opacity:1}.race-boost.ready{background:#b94b2c;color:#fff4dc;border-color:#ffe2a6;box-shadow:0 0 0 3px #d66d3659,0 5px 18px #263f3730}.race-boost.ready>span{background:#b94b2c}.race-boost.active{border-color:#9ce5de}
.lesson-dialog{width:min(390px,calc(100% - 28px));padding:26px 24px 16px;background:#fff4e2;color:#264b3e;border:0;border-radius:24px;text-align:center;max-height:calc(100dvh - 28px);overflow:auto}
.lesson-dialog::backdrop{background:#132e2766;backdrop-filter:blur(2px)}
.lesson-dialog .lesson-paused{font-size:12px;line-height:1.5;color:#405b49;margin:0 0 10px}
.lesson-icon{display:block;width:48px;height:48px;fill:none;stroke:#b6472d;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;margin:10px auto}
.lesson-dialog h2{font-size:30px;line-height:1.1;margin:8px 0 16px}
.lesson-dialog p{font-size:15px;line-height:1.5;margin:10px 0;color:#36513f}
.lesson-dialog .lesson-action{font-weight:800;color:#254b3f}
.lesson-dialog .primary-button{width:100%;justify-content:center;min-height:50px;margin-top:14px;background:#b6472d;font-size:16px}
.lesson-dialog .text-button{min-height:44px;font-size:13px;margin:5px auto 0;color:#36513f}
.lesson-lanes{display:flex;justify-content:center;gap:5px;margin:8px 0 14px}.lesson-lanes span{display:grid;place-items:center;width:42px;height:38px;border-radius:6px;background:#e4d4b8;color:#36513f;font-size:22px}.lesson-lanes .target{background:#2c5545;color:#fff4dc}
@media(max-width:350px){.trick-buttons{width:calc(100% - 112px);gap:5px}.trick-buttons button{height:74px}.race-boost{width:76px}}
@media(max-height:480px) and (min-width:600px){
 .race .play-coach,body.race.riding .play-coach{bottom:max(18px,env(safe-area-inset-bottom));left:318px;transform:none;width:calc(100% - 424px);max-width:280px}
 .race #coach-detail{display:block}.lesson-dialog{padding:16px 24px 8px;width:470px}.lesson-icon{display:none}.lesson-dialog h2{font-size:25px;margin:6px 0 10px}.lesson-dialog p{font-size:14px}.lesson-dialog .primary-button{margin-top:8px}
}
@media(prefers-reduced-motion:reduce){.race-boost>span{transition:none}}

/* 6.0: the course owns the centre; information and actions live at the edges. */
.race-skill{position:absolute;left:max(18px,env(safe-area-inset-left));top:172px;padding:7px 11px;border-radius:8px;background:#23554bec;color:#fff5df;font-size:12px;line-height:1.3;font-weight:850;max-width:calc(100% - 36px)}
.race .play-coach{box-shadow:none;background:#fff2ddea}
.race .feedback-title{font-size:24px!important}.race .feedback:not(:empty){padding:8px 14px;box-shadow:0 5px 18px #28463b16}
.race .result-panel .result-tip{font-size:13px;line-height:1.5;color:#365342;background:#e8ecdd;padding:9px 12px;border-radius:8px;text-align:left}
.race .result-secondary{flex-wrap:wrap;justify-content:center;gap:4px 14px}
.replay-controls{position:absolute;z-index:9;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:20px;padding:10px 16px;background:#fff2dff2;border-radius:16px;width:max-content;max-width:calc(100% - 28px)}
.replay-controls>span{font-size:12px;font-weight:850;letter-spacing:.8px}.replay-controls>button{min-height:44px;font-size:13px;white-space:nowrap}
@media(orientation:landscape) and (max-height:600px){
 .race .game-shell{min-height:300px}
 body.race.riding .chase-wordmark,.race .chase-wordmark{width:104px;left:max(16px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top))}
 .race .game-shell:has(.start-panel:not([hidden])) .chase-wordmark{width:245px;left:22px;top:12px}
 .race-place,body.race.riding .race-place{left:calc(max(16px,env(safe-area-inset-left)) + 116px);right:auto;top:max(12px,env(safe-area-inset-top));gap:6px;padding:5px 11px;transform:none}
 .race-place b{font-size:27px}.race-place span{font-size:17px}
 .race-pause,body.race.riding .race-pause{top:max(8px,env(safe-area-inset-top));right:max(14px,env(safe-area-inset-right))}
 .race-clock{top:max(13px,env(safe-area-inset-top));left:calc(max(16px,env(safe-area-inset-left)) + 210px);right:calc(max(14px,env(safe-area-inset-right)) + 58px);font-size:12px;gap:8px}
 .race-clock span,.race-clock time{padding:4px 8px}.race-clock time{font-size:13px}
 .race-progress{top:48px;left:calc(max(16px,env(safe-area-inset-left)) + 218px);right:calc(max(14px,env(safe-area-inset-right)) + 68px);height:4px}
 .race-order{display:none}
 .race-skill{top:61px;font-size:12px;padding:6px 9px;max-width:210px}
 .trick-buttons{left:auto;right:max(16px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));width:252px;max-width:40%;gap:7px}
 .trick-buttons button{height:66px;border-width:2px;border-radius:16px;gap:3px}.trick-buttons svg{width:23px;height:23px}.trick-buttons span{font-size:12px}
 .race-boost{left:max(16px,env(safe-area-inset-left));right:auto;bottom:max(12px,env(safe-area-inset-bottom));width:78px;height:76px;border-width:3px;border-radius:21px}.race-boost svg{width:23px;height:23px}.race-boost b{font-size:12px}.race-boost small{font-size:12px}
 .race .play-coach,body.race.riding .play-coach{left:calc(max(16px,env(safe-area-inset-left)) + 94px);bottom:max(14px,env(safe-area-inset-bottom));transform:none;width:210px;max-width:calc(55% - 125px);padding:7px 10px;border-radius:10px}
 .race #coach-action{font-size:12px;letter-spacing:.45px}.race #coach-detail{font-size:12px;line-height:1.35;display:block}
 .race .feedback{top:71px}.race .feedback-title{font-size:21px!important}.race .feedback-sub{font-size:12px!important}
 .race .result-panel{width:min(720px,calc(100% - 32px));max-height:calc(100dvh - 20px);padding:14px 20px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:none;gap:4px 24px;align-items:start}
 .race .result-panel>*{grid-area:auto;min-width:0}
 .race .result-panel h2,.race .result-panel #result-description,.race .result-panel .race-result-time,.race .result-panel .result-score-label{grid-column:1;margin:3px 0}
 .race .result-panel h2{font-size:25px}.race .result-panel #result-description{font-size:13px}.race .race-result-time{font-size:39px}
 .race .finish-order{grid-column:2;grid-row:1/5;margin:0}.race .finish-order li{min-height:34px;font-size:13px}
 .race .result-panel .race-result-stats{grid-column:1/-1;margin:4px 0;font-size:12px}.race .result-panel .result-tip{grid-column:1/-1;margin:2px 0;font-size:12px;padding:7px 10px}
 .race .result-actions{grid-column:1/-1;flex-direction:row;margin-top:4px}.race .result-secondary,.race #share-status{grid-column:1/-1;margin:0}.race .result-secondary button{min-height:40px}
}
.race .finished .race-skill{display:none}
@media(orientation:landscape) and (max-width:690px){.race-clock span{max-width:165px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.race .play-coach,body.race.riding .play-coach{max-width:calc(54% - 112px);left:106px}.trick-buttons{max-width:42%;right:12px}.trick-buttons button{height:62px}.trick-buttons span{font-size:12px}}
@media(prefers-reduced-motion:reduce){.trick-buttons button:active,.race-boost:active{transform:none}}

/* A held toy gets its own thumb target; it never covers the trick choices. */
.race-item{position:absolute;right:max(16px,env(safe-area-inset-right));bottom:calc(max(18px,env(safe-area-inset-bottom)) + 102px);z-index:6;width:82px;min-height:78px;padding:7px 3px;display:flex;flex-direction:column;align-items:center;gap:3px;border:3px solid #fff0d2;border-radius:21px;background:#613653;color:#fff5e0;box-shadow:0 4px 16px #263f372b;touch-action:manipulation;cursor:pointer}
.race-item svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.race-item b{font-size:12px;letter-spacing:.5px}.race-item small{font-size:12px;line-height:1.3;font-weight:800}.race-item:disabled{background:#46564d;cursor:default;opacity:1}.race-item:active{transform:scale(.96)}.race-item:focus-visible{outline:3px solid white;outline-offset:3px}
.race .play-coach:has(~.race-item:not([hidden])),body.race.riding .play-coach:has(~.race-item:not([hidden])){left:max(14px,env(safe-area-inset-left));width:calc(100% - 124px);max-width:310px;transform:none}
@media(orientation:landscape) and (max-height:600px){
 .race-item{left:max(16px,env(safe-area-inset-left));right:auto;bottom:calc(max(12px,env(safe-area-inset-bottom)) + 87px);width:78px;min-height:72px;padding:5px 3px}.race-item svg{width:24px;height:24px}
 .race .play-coach:has(~.race-item:not([hidden])),body.race.riding .play-coach:has(~.race-item:not([hidden])){left:calc(max(16px,env(safe-area-inset-left)) + 92px);width:210px;max-width:calc(100% - 378px)}
}
