#touch-controls{display:none}
#touch-controls[hidden]{display:none!important}
.phone #game{height:100dvh;touch-action:none}
.phone #menu{overflow-y:auto;overflow-x:hidden;padding:16px 16px 32px}
.phone .shade{position:fixed;background:#102735c9}
.phone .menu-content{margin:0;max-width:none;max-height:none;overflow:visible}
.phone h1{font-size:62px;letter-spacing:-4px;margin:22px 0}
.phone h1 br{display:none}.phone h1 em{margin-left:10px}.phone h1 span{font-size:26px}
.phone .menu-content>p{display:none}
.phone .level-picker{position:relative;inset:auto;width:auto;max-width:none;margin:24px 0 0;transform:none;padding:14px}
.phone #levels{display:grid;grid-template-columns:1fr;gap:8px}
.phone .badge{position:relative;inset:auto;margin-top:18px;font-size:9px}
.phone .race-options{max-width:none}.phone .choice{margin:14px 0}
.phone #cats,.phone #cats2{gap:5px;flex-wrap:wrap}
.phone #cats button,.phone #cats2 button{width:38px;height:40px;font-size:22px}
.phone #start{width:100%;min-width:0;min-height:48px}
.phone .graphics-choice{flex-wrap:wrap}.phone .volume-row input{min-width:40px;flex:1}
.phone #controller{font-size:11px}.phone .mode-choice{display:none}
.phone .modal{padding:15vh 16px 24px;overflow:auto}
.phone .modal h2{font-size:28px}.phone .modal button{display:block;width:100%;min-width:0;margin:14px 0}
.phone #fps-counter{top:max(6px,env(safe-area-inset-top));right:8px;font-size:10px;padding:5px}
.phone #sound-toggle{top:44px;right:8px;font-size:10px;padding:6px}
.phone .position{left:12px;top:22px}.phone .position b{font-size:50px}.phone .position span{font-size:20px}
.phone #standings{display:none}.phone .player-tag{left:12px;top:8px;font-size:10px}
.phone .top{top:9px;padding:5px;width:150px}.phone .top span{font-size:9px;letter-spacing:0}.phone .top strong{font-size:15px}
.phone .bottom{left:12px;bottom:192px;padding:6px 9px;gap:12px;font-size:17px}
.phone .speed{bottom:190px}.phone .speed b{font-size:29px}
.phone #map{width:100px;height:82px;right:8px;bottom:226px}
.phone #item{right:10px;bottom:116px;width:210px;min-height:66px;height:auto;padding:8px;border-radius:12px}
.phone .inventory-icon{font-size:28px}.phone .inventory-text strong{font-size:13px}.phone .inventory-text span{font-size:10px}.phone .inventory-text kbd{display:none}
.phone .pickup-toast{top:100px;width:75%;max-width:320px;padding:10px}
.phone .pickup-toast strong{font-size:16px}.phone .active-effect{bottom:270px;right:12px;font-size:11px}
.phone #message{font-size:52px;top:35%}
.phone #intro>span{font-size:10px;left:16px}.phone #skip-intro{right:12px;bottom:45px;font-size:12px}
.phone{--touch-steering-width:clamp(144px,20vw,184px);--touch-action-width:clamp(164px,22vw,192px)}
.phone #touch-controls{display:block;position:fixed;inset:0;pointer-events:none;z-index:80;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.phone #touch-controls button{pointer-events:auto;touch-action:none;box-sizing:border-box;background:rgb(16 39 53 / 12%);color:#fff;border:1.5px solid rgb(239 249 255 / 60%);border-radius:20px;min-width:0;padding:6px;font:800 12px Arial,sans-serif;text-shadow:0 1px 4px #081c2b;box-shadow:inset 0 0 18px #ffffff08}
.phone #touch-controls button.pressed{background:rgb(255 212 89 / 28%);border-color:#ffe7a1;color:#fff5d0}
.phone .touch-steering{position:absolute;left:max(12px,env(safe-area-inset-left));bottom:max(16px,calc(env(safe-area-inset-bottom) + 10px));width:var(--touch-steering-width);height:84px;display:grid;grid-template-columns:1fr 1fr;gap:8px;pointer-events:auto;touch-action:none}
.phone .touch-steering button{height:84px;font-size:25px!important;border-radius:30px!important}
.phone .touch-steering-center{position:absolute;left:50%;top:50%;transform:translate(calc(-50% + var(--steer,0)*12px),-50%);font-size:13px;color:#ffffff9c;pointer-events:none;text-shadow:0 1px 4px #081c2b}
.phone .touch-actions{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:max(16px,calc(env(safe-area-inset-bottom) + 10px));width:var(--touch-action-width);display:grid;grid-template-columns:1fr 1fr;grid-template-rows:44px 76px;gap:10px 8px;pointer-events:auto;touch-action:none}
.phone #touch-controls .touch-actions button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:100%;letter-spacing:.4px}
.phone .touch-actions [data-key=brake]{grid-area:1/1;border-radius:15px!important;font-size:10px!important}
.phone .touch-actions [data-key=item]{grid-area:1/2;flex-direction:row!important;border-radius:15px!important}
.phone .touch-actions [data-key=gas]{grid-area:2/1/3/3;border-color:#b5f5d6!important}
.phone .touch-actions strong{font:900 15px Arial,sans-serif}
.phone .touch-actions small{font:700 9px Arial,sans-serif;letter-spacing:.2px}
.phone .touch-actions [data-key=gas]>span{font-size:21px;line-height:1;transform:rotate(-90deg);color:#c8ffe5}
.phone #touch-controls .touch-pause{position:absolute;left:max(12px,env(safe-area-inset-left));top:70px;height:42px;width:42px;border-radius:14px}
@media(max-height:360px){.phone .touch-actions{grid-template-rows:44px 64px;gap:8px}.phone .touch-steering,.phone .touch-steering button{height:76px}}
@media (orientation:landscape){
.phone #menu{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.phone .level-picker{align-self:start;margin-top:15px}.phone .badge{grid-column:1/-1}
.phone #item{bottom:112px;right:10px;width:210px}.phone .bottom{bottom:12px;left:160px}
.phone .speed{bottom:12px}.phone #map{bottom:180px;width:85px;height:70px}
.phone .active-effect{bottom:190px}.phone .pickup-toast{top:80px;max-width:280px}
.phone .top{top:8px}
}

.phone #item{bottom:160px}.phone .speed,.phone .bottom{bottom:250px}.phone #map{bottom:270px}.phone .active-effect{bottom:238px}
@media(orientation:landscape){.phone #item{bottom:150px}.phone .speed,.phone .bottom{bottom:12px}.phone #map{bottom:224px}.phone .active-effect{bottom:228px;right:120px}}

#rotate-phone,#mobile-fullscreen,#fullscreen-help{display:none}
.phone #rotate-phone{display:grid;place-items:center;position:fixed;inset:0;z-index:300;background:#102735;color:#fff;text-align:center;padding:30px;touch-action:none}
.phone #rotate-phone h2{font-size:26px}.phone #rotate-phone p{font-size:15px;line-height:1.6}.phone .rotate-icon{font-size:70px;color:#ffd453}
.phone #mobile-fullscreen{display:block;position:fixed;right:max(10px,env(safe-area-inset-right));top:78px;z-index:120;background:#153747ed;color:#fff;padding:10px 14px;border:1px solid #cde4f488;border-radius:10px;font-size:12px;min-height:42px}
.phone #fullscreen-help{display:block;position:fixed;z-index:320;inset:10%;background:#153747;padding:20px;border:2px solid #ffd453;border-radius:18px;overflow:auto;box-shadow:0 0 0 100vmax #000a}
.phone #fullscreen-help p{font-size:14px}.phone #fullscreen-help button{padding:12px 20px;background:#ffd453;border-radius:9px}
@media(orientation:portrait){.phone #touch-controls{display:none!important}}
