
.edition-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 20px;background:#142a3b;border-bottom:1px solid #385365;font-size:12px}.edition-bar a{padding:7px 10px;border-radius:6px;border:1px solid #5b7380}.edition-bar small{letter-spacing:0}.keyboard-help{display:none}
body[data-edition=keyboard] .keyboard-help{display:block;position:absolute;bottom:20px;left:22px;padding:10px 14px;background:#102634e8;border-radius:8px;font-size:12px;pointer-events:none}
body[data-edition=keyboard] .touch [data-hold],body[data-edition=keyboard] #steering-pad{display:none}
body[data-edition=keyboard] .touch .steering-controls{left:auto;right:80px;bottom:0;transform:none;width:auto}
body[data-edition=keyboard] .touch .auto-options{display:flex;width:auto}
body[data-edition=keyboard] .touch #auto-speed{width:145px}
body[data-edition=keyboard] .touch>div:last-child{margin-left:auto}
body[data-edition=keyboard] .touch-instructions,body[data-edition=touch] .keyboard-instructions{display:none}
body[data-edition=touch] header{padding:8px 12px;gap:8px}
body[data-edition=touch] header small,body[data-edition=touch] h1 span{display:none}
body[data-edition=touch] h1{font-size:20px}
body[data-edition=touch] .tools{max-width:none}
body[data-edition=touch] .tools button{min-height:44px}
body[data-edition=touch] .edition-bar{gap:6px;padding:6px 10px}
body[data-edition=touch] .edition-bar strong{width:100%;font-size:11px}
body[data-edition=touch] .edition-bar small{display:none}
body[data-edition=touch] #stage{height:clamp(510px,76svh,900px);min-height:510px}
body[data-edition=touch] #world{height:calc(100% - 170px)}
body[data-edition=touch] .touch{height:170px;bottom:0;left:0;right:0;padding:94px 10px max(10px,env(safe-area-inset-bottom));background:#0b202e;gap:7px;align-items:flex-end;border-top:1px solid #527281}
body[data-edition=touch] .touch button{min-width:52px;min-height:62px;font-size:12px}
body[data-edition=touch] .touch .steering-controls{bottom:86px;left:10px;right:10px;width:auto;max-width:none;transform:none;gap:12px}
body[data-edition=touch] .touch .steering-controls #steering-pad{min-height:64px;min-width:130px;flex:1;font-size:11px}
body[data-edition=touch] .touch .auto-options{width:125px;min-width:125px;gap:4px}
body[data-edition=touch] .touch #auto-speed,body[data-edition=touch] .touch #auto-drive{min-height:36px;font-size:11px}
body[data-edition=touch] .hud{top:10px;left:10px;right:10px}
body[data-edition=touch] .hud>div{min-width:0;padding:7px 9px;max-width:54%}
body[data-edition=touch] .hud strong{font-size:30px}
body[data-edition=touch] #minimap{width:110px;height:85px}
body[data-edition=touch] #message{bottom:185px;font-size:11px}
body[data-edition=touch] .overlay{bottom:0;z-index:6}
body[data-edition=touch] .overlay>div{padding:20px}
body[data-edition=touch] .trip-controls{padding:8px;margin:0}
body[data-edition=touch] .trip-controls button{min-height:44px}
body[data-edition=touch] .trip-controls label{flex:1;min-width:140px}
#stage:has(.overlay:not([hidden])) .keyboard-help{visibility:hidden}
@media(max-height:520px) and (orientation:landscape){
body[data-edition=touch] header{padding:3px 10px}
body[data-edition=touch] .edition-bar{display:none}
body[data-edition=touch] #stage{height:calc(100svh - 56px);min-height:260px}
body[data-edition=touch] #world{height:100%}
body[data-edition=touch] .touch{height:78px;background:#0b202e66;padding:5px 10px;align-items:center}
body[data-edition=touch] .touch>div:first-of-type{position:static;transform:none;width:280px;max-width:45%;order:0}
body[data-edition=touch] .touch>div:nth-child(2){display:none}
body[data-edition=touch] .touch .auto-options{display:none}
body[data-edition=touch] .touch .steering-controls #steering-pad{min-height:60px}
body[data-edition=touch] .touch>div:last-child{margin-left:auto}
body[data-edition=touch] .hud strong{font-size:23px}
body[data-edition=touch] #minimap{width:90px;height:69px}
body[data-edition=touch] #message{bottom:86px}
}

/* Formula 47-style visible wheel and hold pedals, with distinct device layouts. */
#steering-pad{cursor:grab}
#steering-pad:active{cursor:grabbing}
.touch #steering-pad:after{display:none}
.touch .steering-controls #steering-pad{background:none;border:none;border-radius:0;flex:none;display:flex;flex-direction:column;gap:8px;width:130px;min-width:130px;height:140px;font-size:10px}
.wheel-rim{display:block;width:108px;height:108px;flex:none;position:relative;border:11px solid #4c6273;border-radius:50%;box-shadow:inset 0 0 0 3px #9cacb2,0 0 0 3px #071420;background:conic-gradient(transparent 0deg 80deg,#80939c 80deg 100deg,transparent 100deg 170deg,#80939c 170deg 190deg,transparent 190deg 260deg,#80939c 260deg 280deg);transform:rotate(var(--wheel-angle,0deg));pointer-events:none}
.wheel-rim:before{content:'';position:absolute;top:-10px;left:calc(50% - 4px);width:8px;height:12px;background:#f4d18a}
.wheel-rim b{position:absolute;inset:25px;border-radius:50%;background:#162e40;display:grid;place-items:center;color:#f4d18a;font-size:18px}
#steering-pad small{font-size:9px;letter-spacing:.05em;white-space:nowrap}
body[data-edition=keyboard] #stage{height:clamp(580px,78vh,950px)}
body[data-edition=keyboard] #world{height:calc(100% - 165px)}
body[data-edition=keyboard] .touch{height:165px;left:0;right:0;bottom:0;padding:8px 20px;background:#0b202e;border-top:1px solid #4c6575;align-items:center;justify-content:center;gap:18px}
body[data-edition=keyboard] .touch [data-hold]{display:block}
body[data-edition=keyboard] .touch .steering-controls{position:static;transform:none;width:auto;max-width:none;gap:18px}
body[data-edition=keyboard] .touch .auto-options{display:grid;width:135px}
body[data-edition=keyboard] .touch #auto-speed{width:135px}
body[data-edition=keyboard] .touch>div:last-child{margin-left:0}
body[data-edition=keyboard] .keyboard-help{bottom:170px;font-size:11px}
body[data-edition=keyboard] #message{bottom:220px}
.touch [data-hold=brake]{background:#703f43;border-color:#d59690;height:76px}
.touch [data-hold=gas]{background:#276859;color:white;border-color:#75c4a6;height:76px}
body[data-edition=touch] .touch{height:178px}
body[data-edition=touch] #world{height:calc(100% - 178px)}
body[data-edition=touch] .touch .steering-controls{position:static;transform:none;display:contents}
body[data-edition=touch] .touch .steering-controls #steering-pad{position:absolute;left:12px;bottom:16px;width:130px;min-width:0;height:140px}
body[data-edition=touch] .touch .auto-options{position:absolute;right:12px;top:10px;display:flex;width:calc(100% - 165px);min-width:0;gap:5px}
body[data-edition=touch] .touch #auto-speed{width:55%;min-width:0;font-size:10px;padding:3px}
body[data-edition=touch] .touch #auto-drive{width:45%;min-width:0;font-size:10px}
body[data-edition=touch] .touch>div:nth-child(2){display:none}
body[data-edition=touch] .touch>div:last-child{position:absolute;right:10px;bottom:14px;width:calc(100% - 165px);gap:5px}
body[data-edition=touch] .touch>div:last-child button{min-width:0;flex:1;padding:4px;font-size:11px}
body[data-edition=touch] #reverse-direction{max-width:none;font-size:10px}
@media(max-width:360px){body[data-edition=touch] .touch .steering-controls #steering-pad{left:6px;width:110px}.wheel-rim{width:94px;height:94px}.wheel-rim b{inset:19px}body[data-edition=touch] .touch .auto-options,body[data-edition=touch] .touch>div:last-child{width:calc(100% - 130px)}}
@media(max-height:520px) and (orientation:landscape){
body[data-edition=touch] #world{height:100%}
body[data-edition=touch] .touch{height:120px;background:#0b202e66;border:0}
body[data-edition=touch] .touch .steering-controls #steering-pad{height:102px;bottom:5px;width:110px;gap:4px}
body[data-edition=touch] .wheel-rim{width:82px;height:82px;border-width:8px}
body[data-edition=touch] .wheel-rim b{inset:17px;font-size:14px}
body[data-edition=touch] .touch .auto-options{display:none}
body[data-edition=touch] .touch>div:last-child{width:210px;bottom:12px}
body[data-edition=touch] #message{bottom:125px}
body[data-edition=touch] .hud>div{max-width:36%}
}

#wheel-control{position:relative;width:130px;height:140px;flex:none;pointer-events:auto}
#speed-dot{position:absolute;left:calc(50% - 22px);top:42px;width:44px;height:44px;border-radius:50%;background:radial-gradient(circle,#8cf2a1 0 20%,#36b76d 22% 30%,transparent 33%);cursor:ns-resize;touch-action:none;z-index:2}
#speed-dot:focus-visible{outline:2px solid #fff;border-radius:50%}
#speed-target{position:absolute;top:95px;left:0;width:100%;text-align:center;font:700 9px monospace;color:#a6ffc4;pointer-events:none}
body[data-edition=touch] #wheel-control{position:absolute;left:12px;bottom:16px}
body[data-edition=touch] .touch .steering-controls #steering-pad{position:static}
@media(max-width:360px){body[data-edition=touch] #wheel-control{left:6px;width:110px}body[data-edition=touch] #speed-dot{top:34px}body[data-edition=touch] #speed-target{top:84px}}
@media(max-height:520px) and (orientation:landscape){body[data-edition=touch] #wheel-control{height:102px;bottom:5px;width:110px}body[data-edition=touch] #speed-dot{top:24px}body[data-edition=touch] #speed-target{top:70px}}

body[data-edition=touch] .touch #auto-speed,body[data-edition=touch] .touch #auto-drive{min-height:44px}

/* Independent fingers: controls never turn a two-thumb gesture into page scrolling. */
.touch,#steering-pad,.touch [data-hold]{touch-action:none;user-select:none;-webkit-user-select:none}
@media(max-height:520px) and (orientation:landscape){
body[data-edition=touch] .touch .auto-options{display:flex;right:230px;top:auto;bottom:12px;width:100px}
body[data-edition=touch] .touch #auto-speed{display:none}
body[data-edition=touch] .touch #auto-drive{width:100%;min-height:50px}
}

body[data-edition=touch] .touch>div:last-child{bottom:28px}
body[data-edition=touch] .touch>div:last-child [data-hold]{height:108px}
@media(max-height:520px) and (orientation:landscape){
body[data-edition=touch] .touch>div:last-child{bottom:12px}
body[data-edition=touch] .touch>div:last-child [data-hold]{height:76px}
}
#game:fullscreen,#game.theater-mode{width:100vw;height:100dvh;max-width:none;margin:0;padding:0;display:flex;flex-direction:column;background:#0b202e;overflow:hidden}
#game.theater-mode{position:fixed;inset:0;z-index:2147483647}
#game:fullscreen>header,#game.theater-mode>header{flex:none;padding:8px 16px;min-height:56px}
#game:fullscreen>#stage,#game.theater-mode>#stage{flex:1;min-height:0;height:auto;margin:0;width:100%}
#game:fullscreen>.edition-bar,#game.theater-mode>.edition-bar,#game:fullscreen>.trip-controls,#game.theater-mode>.trip-controls,#game:fullscreen>.drive-status,#game.theater-mode>.drive-status,#game:fullscreen>details,#game.theater-mode>details{display:none}
#game:fullscreen>.status-bar,#game.theater-mode>.status-bar{display:none}
#game:fullscreen #full,#game.theater-mode #full{display:block;background:#9f7837;color:white;min-height:44px}
#game:fullscreen .overlay,#game.theater-mode .overlay{overflow:auto}

/* Dashboard-mounted essential controls; the 3D wheel is the steering graphic. */
body[data-edition] #world{height:100%}
body[data-edition] .touch{position:absolute;inset:0;height:auto;padding:0;background:none;border:0;display:block;pointer-events:none}
body[data-edition] .touch .steering-controls{display:contents}
body[data-edition] #wheel-control{position:absolute;left:31%;bottom:5%;width:23%;height:33%;pointer-events:none}
body[data-edition] .touch .steering-controls #steering-pad{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;pointer-events:auto;justify-content:flex-end;cursor:grab}
body[data-edition] .wheel-rim{display:none}
body[data-edition] #steering-pad small{padding:5px 9px;background:#07172499;border:1px solid #9cbac34d;border-radius:6px;color:#b7ced7;pointer-events:none}
body[data-edition] .touch>div:nth-child(2){display:none}
body[data-edition] .touch>div:last-child{position:absolute;right:8%;bottom:5%;width:23%;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0;pointer-events:auto}
body[data-edition] .touch>div:last-child [data-hold]{height:82px;min-width:0;font-size:16px;border-radius:12px;background:#172b35ed}
body[data-edition] .touch>div:last-child [data-hold=gas]{border-bottom:6px solid #49b78a}
body[data-edition] .touch>div:last-child [data-hold=brake]{border-bottom:6px solid #cc665e}
body[data-edition] #reverse-direction{grid-column:1/3;justify-self:end;min-height:32px;height:32px;min-width:70px;font-size:10px;padding:4px 10px}
body[data-edition] .keyboard-help{display:none}
body[data-edition] .tools #reset,body[data-edition] .tools #view{display:none}
body[data-edition=touch] #wheel-control{left:2%;bottom:3%;width:45%;height:32%}
body[data-edition=touch] .touch>div:last-child{right:3%;bottom:4%;width:45%;gap:6px}
body[data-edition=touch] .touch>div:last-child [data-hold]{height:92px;font-size:14px}
body[data-edition=touch] #message{bottom:40%;font-size:10px;max-width:80%}
body[data-edition=touch] #stage{height:clamp(510px,76svh,900px)}
@media(max-height:520px) and (orientation:landscape){
body[data-edition=touch] #stage{height:calc(100svh - 56px)}
body[data-edition=touch] #wheel-control{left:24%;bottom:2%;width:25%;height:38%}
body[data-edition=touch] .touch>div:last-child{right:3%;bottom:4%;width:25%}
body[data-edition=touch] .touch>div:last-child [data-hold]{height:62px}
}
#game:fullscreen>#stage,#game.theater-mode>#stage{height:auto;min-height:0}

#game:fullscreen>p,#game.theater-mode>p{display:none}

body[data-camera=chase] .wheel-rim,body[data-camera=high] .wheel-rim{display:block}

.tools #play-mode{max-width:160px;min-height:44px;background:#152d3c;color:#fff}
.route-settings{margin:10px 0}.route-settings>summary{padding:10px 14px;cursor:pointer;background:#142d3d;border-radius:8px}
body[data-edition=touch] .tools #play-mode{max-width:105px;font-size:11px}
@media(min-height:521px), (orientation:portrait){
body[data-edition=touch] .touch>div:last-child{right:3%;bottom:4%;width:22%;grid-template-columns:1fr;gap:6px}
body[data-edition=touch] #reverse-direction{grid-column:1;justify-self:stretch;min-width:0;font-size:9px}
body[data-edition=touch] .touch>div:last-child [data-hold]{height:76px;font-size:12px}
}
