/* Three separate bands. Interaction and telemetry never stack over the race canvas. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
#game:not([data-state=ready]){
 --race-rail:clamp(62px,16dvh,88px);
 display:grid;grid-template-rows:auto minmax(0,1fr) var(--race-rail);
 width:min(100%,205dvh,1600px);height:min(100dvh,960px);min-height:0;aspect-ratio:auto;
 background:#11282c;
}
#game:not([data-state=ready]) .scene{position:relative;inset:auto;grid-row:2;min-height:0;overflow:hidden;height:100%;aspect-ratio:auto}
#game:not([data-state=ready]) .workshop-top{
 position:relative;inset:auto;grid-row:1;display:grid;grid-template-columns:auto minmax(0,1fr) auto;
 align-items:center;min-height:64px;padding:max(4px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left));
 gap:7px;background:#10282c;border-bottom:1px solid #33514c
}
#game:not([data-state=ready]) .workshop-top .brand{width:clamp(37px,7cqw,79px);grid-column:1;filter:none}
#game:not([data-state=ready]) .workshop-top .wallet{grid-column:3;grid-row:1;align-self:center;gap:4px}
#game:not([data-state=ready]) :is(.wallet-action,.record-chip){padding:2px 5px;min-height:32px;font-size:13px;text-shadow:none}
#game:not([data-state=ready]) .wallet-action b{width:auto;min-width:0}
#game:not([data-state=ready]) :is(.wallet-action,.record-chip) img{width:clamp(15px,3cqw,28px);height:clamp(15px,3cqw,28px);filter:none}
.activity-bar{
 grid-column:2;grid-row:1;display:grid;grid-template-rows:minmax(32px,auto) 15px;
 align-items:center;min-width:0;text-align:center;min-height:54px;line-height:1.2
}
.activity-bar :is(.launch-scene,.flight-hud,.notice){position:static;inset:auto;translate:none;transform:none;text-shadow:none;white-space:normal;margin:0;max-width:none}
.activity-bar .launch-scene,.activity-bar .flight-hud{grid-area:1/1}
.activity-bar .launch-scene{pointer-events:auto}
#game .activity-bar .stage-sign{
 position:static;inset:auto;transform:none;width:auto;min-width:0;max-width:none;padding:0;display:grid;grid-template-columns:minmax(0,1fr) auto;
 gap:1px 8px;align-items:center;border:0;border-image:none;border-radius:0;background:none;text-shadow:none;filter:none;text-align:left
}
#game .activity-bar .stage-sign h2{grid-column:1;margin:0;font-size:clamp(15px,2.45cqw,25px);font-weight:800;line-height:1.13}
#game .activity-bar .stage-sign :is(#stageRoute,#stageWheel,#roofGoal){grid-column:1;font-size:clamp(11px,1.4cqw,14px);letter-spacing:normal;font-weight:600;line-height:1.16;margin:0;overflow-wrap:normal}
#game .activity-bar .stage-sign #stageRoute{color:#b1d8cc}
#game .activity-bar .stage-sign #roofGoal{color:#ffe4aa}
#game .activity-bar .stage-sign #roofChange{grid-column:2;grid-row:1/span 4;min-height:44px;max-width:112px;margin:0;line-height:1.15;white-space:normal}
#game[data-state=staged] .activity-bar,#game[data-state=charge] .activity-bar{grid-template-rows:1fr;min-height:54px}
.activity-bar .flight-hud{display:flex;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:3px 7px}
.activity-bar .distance{font-size:clamp(19px,3.1cqw,35px);font-weight:850;line-height:1.12;color:#f7f7da}
.activity-bar .flight-stats{flex-wrap:wrap;gap:3px}
.activity-bar .flight-stats span{font-size:clamp(11px,1.7cqw,15px);padding:2px 5px;background:#1b3738;white-space:nowrap}
.activity-bar .flight-stats img{width:15px;height:15px}
.activity-bar #flightLesson{flex:0 0 100%;border:0;background:none;margin:0;padding:0;max-width:none;width:auto;font-size:11px;line-height:1.15;white-space:normal}
#game .activity-bar #notice{
 grid-area:2/1;background:none;padding:0;color:#ffde91;font-size:clamp(11px,1.52cqw,16px);line-height:1.14;
 font-weight:750;width:100%;overflow-wrap:normal;z-index:0
}
#game:not([data-state=ready]) .controls{
 display:grid;align-items:center;position:relative;inset:auto;grid-row:3;
 padding:4px max(7px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(7px,env(safe-area-inset-left));
 background:#11282c;border-top:1px solid #3e6257;min-width:0
}
#game:not([data-state=ready]) .controls :is(#stageControls,#flightControls,#roofControls){width:min(100%,940px);margin-inline:auto;min-width:0}
#game .controls #stageControls{grid-template-columns:clamp(64px,14%,150px) minmax(0,1fr) clamp(126px,25%,262px);gap:6px}
#game .controls #stageControls > :is(#backGarage,#rpmPanel){align-self:center;margin-block:0;text-shadow:none;filter:none}
#game .controls #stageControls #backGarage{min-height:44px;--edge:5px;line-height:1.1}
#game .controls #stageControls #rpmPanel{position:static;--edge:4px;min-width:0}
#game .controls #stageControls #hint{font-size:clamp(10px,1.46cqw,14px);line-height:1.12}
#game .controls #stageControls .rpm-label{font-size:clamp(11px,1.54cqw,16px)}
#game .controls #stageControls .meter{height:9px}
#game .controls #ignite{
 height:calc(var(--race-rail) - 10px);min-height:44px;max-height:76px;line-height:1.08;padding:2px 4px;gap:2px;
 background:linear-gradient(#ffe492,#ec9a2f);border:1px solid #ffe5a5;color:#321d0a;
 font-size:clamp(15px,2.3cqw,24px);text-shadow:none;filter:none;border-radius:10px
}
#game .controls #ignite[data-timing=ideal]{background:#bff28f;border-color:#dbffb8}
#game .controls #ignite small{font-size:clamp(10px,1.36cqw,13px)}
#game .controls .roof-copy{display:flex;align-items:baseline;gap:2px 6px;min-width:0}
#game .controls #roofCue{font-size:clamp(12px,1.8cqw,18px);font-weight:800}
#game .controls #roofTip{font-size:clamp(11px,1.5cqw,15px);line-height:1.13}
#game .controls :is(.roof-guide,#roofTap){box-shadow:none}
#game .controls :is(#roofTap,#tourBoost){min-height:44px}
#game .controls #roofTap{min-width:74px}
#game .controls #roofTap img{width:20px;height:20px}
#game .controls .roof-guide{padding:4px 6px;gap:3px}
#game .controls :is(#roofTap,#tourBoost,#boost){white-space:nowrap}
#game .controls button:active{translate:none}
#game :is(#rpmText,#distance,#record,#coins,#pickup){font-variant-numeric:tabular-nums}

@media (orientation:portrait){
 #game:not([data-state=ready]){width:100%;height:auto;min-height:100dvh;grid-template-rows:auto auto auto;align-content:start;--race-rail:64px}
 #game:not([data-state=ready]) .scene{height:auto;aspect-ratio:16/9}
 #game:not([data-state=ready]) .workshop-top{grid-template-columns:1fr 1fr;grid-template-rows:auto auto;gap:1px 7px}
 #game:not([data-state=ready]) .workshop-top .wallet{grid-column:2}
 .activity-bar{grid-column:1/-1;grid-row:2;grid-template-rows:minmax(31px,auto) 15px;min-height:46px}
 #game .controls #stageControls{grid-template-columns:40% minmax(0,1fr);grid-template-rows:auto auto}
 #game .controls #stageControls #rpmPanel{grid-row:1;grid-column:1/-1}
 #game .controls #stageControls #backGarage{grid-row:2;grid-column:1}
 #game .controls #stageControls #ignite{grid-row:2;grid-column:2}
 #game:not([data-state=ready]) .controls{min-height:var(--race-rail)}
}
@media (orientation:landscape) and (max-height:530px){
 #game:not([data-state=ready]) .controls{--race-rail:62px}
 #game:not([data-state=ready]) .workshop-top{min-height:62px}
 #game .activity-bar .stage-sign #stageWheel{display:none}
 #game .activity-bar .stage-sign #roofChange{padding-inline:5px}
}
@media (max-width:470px){
 #game .controls #roofTap img{display:none}
 #game .controls .roof-copy{gap:1px 4px}
}
@media (max-height:530px), (max-width:600px){
 #game,#game button{font-family:Roboto,system-ui,sans-serif}
 #game :is(.wood,#launch,.profile-copy strong,.xp span,.wallet-action,.record-chip,.plus,.red-badge){text-shadow:none}
 #game :is(.wood,#launch,.motor-tab){filter:none}
 #game :is(.nameplate strong,.performance span,.side-rail button,.garage-tabs button){letter-spacing:normal}
 #game :is(.nameplate strong,.performance b,.side-rail button,.garage-tabs button,#launch){font-weight:800}
 #game button:hover:not(:disabled){filter:none}
}

@media (orientation:landscape) and (max-height:330px){
 #result{width:min(650px,calc(100vw - 18px));padding-block:6px}
 #result .result-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:1px 8px}
 #result .result-head h2{grid-area:1/1;font-size:19px;text-align:left}
 #result .result-head .eyebrow{grid-area:1/2;font-size:10px;letter-spacing:.04em;text-align:right}
 #result .result-head p{grid-column:1/-1;margin:1px 0}
 #result .result-stats div{padding-block:2px}
 #result .result-route{margin-block:1px}
 #result .result-bonuses{margin-block:1px 3px}
 #resultGoal{margin-bottom:3px}
}
