#touchControls,.touch-ready{display:none}
.touch-ui body{min-width:0;overscroll-behavior:none;-webkit-user-select:none;user-select:none}
.touch-ui #game{touch-action:none}
.touch-ui #touchControls{display:block;position:absolute;inset:0;pointer-events:none;z-index:3}
.touch-ui #touchControls button,.touch-ui #steeringStick{pointer-events:auto;touch-action:none;-webkit-touch-callout:none}
.touch-ui .help,.touch-ui .keyboard-ready,.touch-ui .keys,.touch-ui .session{display:none}
.touch-ui .touch-ready{display:block}
.touch-ui header{left:max(16px,env(safe-area-inset-left));top:12px;gap:8px}
.touch-ui .brand-mark{width:26px;height:30px;font-size:20px}
.touch-ui .brand{gap:7px}.touch-ui .brand strong{font-size:16px}.touch-ui .brand small{font-size:8px;letter-spacing:1px}
.touch-ui #rearMirror{top:8px;width:clamp(150px,23vw,260px);height:65px}
.touch-ui .timing{right:max(14px,env(safe-area-inset-right));top:12px;gap:13px;padding:8px 10px}
.touch-ui .timing small{font-size:8px;letter-spacing:1px;margin-bottom:4px}.touch-ui .timing strong{font-size:16px}.touch-ui .timing .best{display:none}
.touch-ui #menuButton{top:65px;left:max(16px,env(safe-area-inset-left));padding:9px 12px;font-size:12px;min-height:38px}
.touch-ui #ready{top:29%;width:70%}.touch-ui #ready h1{font-size:25px;margin:7px}.touch-ui #ready>span{font-size:8px}.touch-ui #ready p{font-size:12px}
.touch-ui .map-panel{left:auto;right:max(16px,env(safe-area-inset-right));top:78px;bottom:auto;width:72px}.touch-ui .map-panel canvas{width:64px;height:70px}.touch-ui .map-panel>span{display:none}
.touch-ui .speedometer{width:124px;height:78px;bottom:max(18px,env(safe-area-inset-bottom));right:calc(50% - 62px)}
.touch-ui .speedometer svg,.touch-ui .pedals{display:none}.touch-ui .speed{top:0;left:0;width:87px}.touch-ui .speed strong{font-size:43px;letter-spacing:-2px}.touch-ui .speed>span{font-size:9px;margin-top:4px}.touch-ui .gear{right:0;top:17px;padding-left:9px}.touch-ui .gear b{font-size:22px}
.touch-ui #surface{right:50%;transform:translateX(50%);bottom:100px;font-size:10px}.touch-ui #toast{top:86px;font-size:12px;padding:7px 12px;max-width:50%}
#steeringStick{position:absolute;left:calc(max(26px,env(safe-area-inset-left)) + 24px);bottom:calc(max(20px,env(safe-area-inset-bottom)) + 20px);width:132px;height:132px;border-radius:50%;background:#132b3c88;border:2px solid #ffffff55;box-shadow:inset 0 0 0 18px #ffffff08}
#steeringKnob{position:absolute;left:40px;top:40px;width:48px;height:48px;border-radius:50%;background:linear-gradient(#f3f7f8b8,#7f98a3b8);border:2px solid #ffffffa0;box-shadow:0 5px 15px #0005;pointer-events:none}
.stick-label{position:absolute;bottom:10px;left:0;right:0;text-align:center;font-size:9px;letter-spacing:2px;pointer-events:none;color:#ffffffaa}
.touch-pedals{position:absolute;right:max(24px,env(safe-area-inset-right));bottom:max(24px,env(safe-area-inset-bottom));display:flex;align-items:flex-end;gap:14px}
.touch-pedals button{width:94px;height:80px;border-radius:20px;border:2px solid #ffffff65;background:#173040bb;color:white;font:700 17px Arial;box-shadow:0 5px 15px #0003}
.touch-pedals button span{display:block;font-size:9px;font-weight:400;margin-top:8px;opacity:.8}
.touch-pedals #touchGas{height:104px;width:102px;background:#ff792fdf;border-color:#ffb78c;color:#152631}
.touch-pedals #touchGas.pressed{background:#ffc397;transform:scale(.96)}.touch-pedals #touchBrake.pressed{background:#e24a3e;transform:scale(.96)}
.touch-ui #pause{padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left))}
.touch-ui .pause-card{width:min(860px,100%);max-height:100%;padding:18px 22px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.touch-ui .pause-card h2{font-size:23px;margin:6px 0}.touch-ui .difficulty-control{margin:10px 0;padding:10px}.touch-ui .track-options{gap:8px}.touch-ui .track-choice canvas{height:70px}.touch-ui .track-choice strong{font-size:13px}.touch-ui .track-choice>span,.touch-ui .track-choice p{font-size:10px}
@media(max-height:350px){#steeringStick{width:110px;height:110px}#steeringKnob{left:29px;top:29px}.touch-pedals #touchGas{height:90px}.touch-ui #ready{top:30%}.touch-ui .brand small{display:none}}

.touch-ui #loading{z-index:6}
/* Keep resume and restart visible on a landscape phone without scrolling. */
@media(max-height:600px){
 .touch-ui .pause-card{padding:12px 18px}
 .touch-ui .pause-card>small,.touch-ui #pauseText,.touch-ui .difficulty-control>p,.touch-ui .track-choice p{display:none}
 .touch-ui .pause-card h2{font-size:20px;margin:0 0 6px}
 .touch-ui .difficulty-control{margin:6px 0;padding:7px 10px}
 .touch-ui .difficulty-heading{font-size:13px}
 .touch-ui .difficulty-heading input{font-size:16px;padding:3px}
 .touch-ui #difficulty{margin:7px 0 5px}
 .touch-ui .difficulty-scale{font-size:10px}
 .touch-ui .track-choice canvas{height:44px}
 .touch-ui .pause-card .track-choice{padding:7px}
 .touch-ui .pause-card .track-choice.selected{padding:6px}
 .touch-ui .track-choice strong{font-size:12px}
 .touch-ui .track-choice>span{margin-top:3px}
 .touch-ui .pause-card .track-note{font-size:10px;margin:6px 0}
 .touch-ui #soundButton,.touch-ui #resume,.touch-ui #restart{width:32%;margin:4px 0 0;padding:10px 6px;font-size:12px;min-height:38px}
}

/* Avoid double-tap zoom on menus; keep vertical menu scrolling available. */
.touch-ui #pause,.touch-ui #menuButton{touch-action:pan-y}
.touch-ui #difficultyNumber{font-size:16px}


/* Apply directly to labels too: WebKit can otherwise select button text on hold. */
.touch-ui #touchControls,.touch-ui #touchControls *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.touch-ui #touchControls button span{pointer-events:none}

#healthPanel{position:absolute;right:max(20px,env(safe-area-inset-right));top:16px;width:150px;padding:10px 12px;background:#142431cf;border:1px solid #ffffff45;border-radius:10px}
.health-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:11px;letter-spacing:2px}.health-heading strong{font-size:18px;letter-spacing:0;font-variant-numeric:tabular-nums}
#healthMeter{height:7px;background:#ffffff25;border-radius:5px;overflow:hidden}#healthBar{height:100%;width:100%;background:#62e0a5;transition:width .2s,background .2s}
#healthPanel.damaged #healthBar{background:#ffbf59}#healthPanel.critical #healthBar{background:#ff5959}#healthPanel.critical strong{color:#ff8c8c}
#resume[hidden]{display:none!important}

#cityMap{position:absolute;right:max(20px,env(safe-area-inset-right));top:128px;width:110px;padding:5px;background:#112b35b8;border:1px solid #ffffff35;border-radius:8px;text-align:center}#cityMap canvas{display:block;width:100%;height:auto}#cityMap span{font-size:7px;letter-spacing:1.3px;color:#c9e3df}@media(max-height:450px){#cityMap{width:82px;top:128px}}

.chase-timer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;padding-top:8px;border-top:1px solid #ffffff25}.chase-timer>span{font-size:8px;letter-spacing:1px;color:#c4d2d8}.chase-timer strong{font-size:21px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#fff}.chase-timer small{font-size:11px;font-weight:400;color:#c4d2d8}

/* Allow the iOS keyboard, selection and paste in connection fields. */
.touch-ui .online-card input{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;touch-action:manipulation}

@media(max-height:350px){#cityMap{width:60px}#cityMap span{display:none}}
