/* One shared game, with a thumb-sized control surface on phones and tablets. */
html,body{width:100%;height:100%;overscroll-behavior:none}
button{touch-action:manipulation}
#game{touch-action:none}
#touchControls{position:fixed;inset:0;z-index:6;pointer-events:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.touchSteering{position:absolute;left:max(14px,env(safe-area-inset-left));bottom:max(14px,env(safe-area-inset-bottom));width:140px;text-align:center}
#touchSteerHint{display:block;font-size:9px;line-height:1.5;color:#fff9df;text-shadow:1px 1px #263c48;margin:0 -10px 7px;white-space:nowrap}
#touchMode{pointer-events:auto;min-height:36px;width:100%;font-size:10px;color:#fff4cf;background:#34445beb;border:1px solid #f6eac3;margin-bottom:7px}
#touchArrows{display:grid;grid-template-columns:repeat(3,44px);gap:3px;pointer-events:auto}
#touchArrows[hidden],#touchFollowHint[hidden]{display:none}
#touchArrows button{height:46px;font-size:24px;touch-action:none;color:#fff4cf;background:#34445beb;border:2px solid #f6eac3;padding:0}
#touchArrows button:first-child{grid-column:2}#touchArrows button:nth-child(2){grid-column:1}
#touchArrows button.pressed{background:#f7d34f;color:#253a42}
#touchFollowHint{color:#fff4cf;font-size:11px;line-height:1.6;text-shadow:1px 1px #263c48;min-height:94px;margin:0;padding:18px 8px;background:#273d5066}
#touchModeSettings{display:none}.touch-layout #touchModeSettings{display:block;margin:12px 0}#touchModeSettings>div{display:flex;gap:5px;margin-top:8px}#touchModeSettings button{font-size:10px;min-height:42px;flex:1}#touchModeSettings [aria-pressed=true]{background:#f7d34f;color:#283845}
.touchActions{position:absolute;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(2,64px);gap:7px;pointer-events:auto}
.touchActions button{height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:3px;border:2px solid #f6eac3;background:#34445beb;color:#fff4cf;box-shadow:2px 3px #22334366;font-size:10px;touch-action:none}
.touchActions button>b{font-size:16px;line-height:17px}.touchActions button>small{font-size:8px;line-height:9px;color:#d7e7bc}.touchActions button>small:empty{display:none}
.touchActions button.pressed{background:#f7d34f;color:#263746;transform:translateY(2px);box-shadow:none}.touchActions button:disabled{opacity:.45}.touchActions button:disabled>small{color:inherit}
.touch-layout #menu.lobbyMenu{inset:0;max-height:none}
.touch-layout.arcade>header{top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));display:flex;gap:7px;flex-wrap:nowrap}
.touch-layout.arcade>header .logo{display:none}.touch-layout.arcade>header .qualityControl{margin:0;min-width:100px;width:100px;padding:5px 7px;flex-shrink:0}.touch-layout #qualityToggle{font-size:9px!important}
.touch-layout .languageSwitch{margin-left:auto}.touch-layout .languageSwitch button{min-height:34px;padding:6px;font-size:10px}.touch-layout #sound{min-height:44px;padding:6px 8px;font-size:10px}.touch-layout #fullscreen{min-height:44px;font-size:10px;padding:6px 8px}
.touch-layout.playing>header{display:none}
.touch-layout .arcadeStats{top:78px;right:max(12px,env(safe-area-inset-right))}.touch-layout .arcadeStats>span{min-width:118px;padding:5px 8px;gap:20px}.touch-layout .arcadeStats strong{font-size:17px}
.touch-layout.arcade .lobbySide{top:auto;bottom:96px;max-height:calc(100dvh - 174px);width:290px;padding:16px;z-index:3}
.touch-layout .arcadeDock{bottom:max(24px,env(safe-area-inset-bottom));gap:7px}.touch-layout .arcadeDock button{min-width:48px;min-height:58px}.touch-layout .arcadeDockLeft{left:max(12px,env(safe-area-inset-left))}.touch-layout .arcadeDockRight{right:max(12px,env(safe-area-inset-right))}
.touch-layout.arcade .lobbyStart{bottom:115px;width:calc(100% - 28px);white-space:normal}.touch-layout .lobbyStart p{font-size:10px;line-height:1.6;margin-top:10px}.touch-layout .lobbyStart #start{margin-top:8px;width:220px;min-height:50px}
.touch-layout.arcade #footer{display:none}
.touch-layout.arcade .score{top:max(14px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left))}.touch-layout .score>small{font-size:9px;letter-spacing:1px}.touch-layout .score strong{font-size:29px;margin-top:3px}.touch-layout .score p{font-size:10px;margin:6px 0}.touch-layout .score b{margin-left:10px}
.touch-layout.arcade .wanted{top:max(12px,env(safe-area-inset-top));right:70px;padding:7px 9px;max-width:180px}.touch-layout .wanted>small:first-child,.touch-layout #heatLabel,.touch-layout #difficultyName,.touch-layout #bugSignal{display:none!important}.touch-layout .wanted div{font-size:15px;letter-spacing:2px;margin:0;line-height:1.3}.touch-layout #terrainName{max-width:145px;font-size:8px;margin:4px 0 0;letter-spacing:0}
.touch-layout.arcade #pause{position:fixed;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));min-width:44px;min-height:44px;padding:8px;z-index:7}
.touch-layout .bottom{position:static;display:block}.touch-layout.arcade .health{position:fixed;left:max(14px,env(safe-area-inset-left));bottom:calc(187px + env(safe-area-inset-bottom));width:140px;padding:8px 10px}.touch-layout .health small{font-size:9px;margin-bottom:4px}.touch-layout .health>div{margin-bottom:6px;height:4px}.touch-layout .health .personLife{height:auto;margin-bottom:5px;background:none}.touch-layout .personLife span{font-size:19px}.touch-layout #driverState{display:none}.touch-layout #smokeWarning{font-size:9px;line-height:1.4;margin:0 0 4px}.touch-layout .speed{position:fixed;right:max(14px,env(safe-area-inset-right));bottom:calc(187px + env(safe-area-inset-bottom))}.touch-layout .speed strong{font-size:35px}.touch-layout .speed span{font-size:8px}
.touch-layout #skillButton,.touch-layout #palmButton,.touch-layout #challengeAction,.touch-layout .keyhelp,.touch-layout #lootLauncher{display:none!important}
.touch-layout.arcade #routeHud{top:132px;max-height:calc(100dvh - 320px);width:min(280px,calc(100vw - 52px));padding:12px;font-size:11px;pointer-events:auto}.touch-layout #routeHud>:not(#taskToggle){max-width:100%}.touch-layout #routeHud #taskToggle{width:36px;height:48px;right:-36px}.touch-layout #routeChoices{gap:5px;margin-top:6px}.touch-layout #routeChoices button{min-height:40px;padding:7px;font-size:10px}.touch-layout #navigator{font-size:12px}.touch-layout #routeHud #interact{font-size:10px}.touch-layout #routeHud:not(.collapsed){overflow-y:auto;overflow-x:visible}.touch-layout #routeHud:not(.collapsed) #taskToggle{position:sticky;float:right;top:0;right:0;border:0}
.touch-layout #navigationPill{top:97px;left:50%;max-width:calc(100% - 40px);width:max-content;font-size:9px;padding:8px 10px;min-height:34px;white-space:normal}.touch-layout #storyChoiceLauncher{top:140px;right:12px;min-height:44px;max-width:145px}
.touch-layout #toast{top:29%;font-size:12px;padding:0 32px;line-height:1.5}.touch-layout #boardingHint{bottom:calc(295px + env(safe-area-inset-bottom));max-width:90vw;font-size:10px;padding:7px 10px}.touch-layout.arcade #worldEventPrompt{bottom:calc(300px + env(safe-area-inset-bottom));max-width:85vw;padding:7px 12px;font-size:10px}
.touch-layout.arcade #challengeHud{top:80px;right:12px;max-width:min(270px,calc(100vw - 54px));width:230px;padding:10px;max-height:calc(100dvh - 265px);overflow:visible}.touch-layout #challengeHud.collapsed{transform:translateX(calc(100% + 12px))}.touch-layout #challengeToggle{left:-36px;width:36px;height:44px}.touch-layout #challengeControl{display:none}.touch-layout #challengeHud h2{font-size:15px;margin:4px 0}.touch-layout #challengeHud p{font-size:10px;line-height:1.5;margin:5px 0}.touch-layout .challengeNumbers{font-size:10px}
.touch-layout #collection{padding:20px 14px}.touch-layout #collectionGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.touch-layout .vehicleCard{padding:10px}.touch-layout .vehicleCard button{min-height:44px;width:100%}.touch-layout #closeCollection,.touch-layout .drawerClose{min-width:44px;min-height:44px}
.touch-layout #lotteryScreen{overscroll-behavior:contain}.touch-layout.arcade .lotteryShell{padding:18px 14px 30px}.touch-layout .lotteryHeader{position:relative;flex-wrap:wrap;gap:8px;top:auto;left:auto;right:auto}.touch-layout .lotteryHeader h2{font-size:22px}.touch-layout .lotteryHeader>div:first-child{flex:1}.touch-layout .lootFunds{margin:0;padding:8px;font-size:10px}.touch-layout .lootFunds strong{font-size:16px;margin-left:5px}.touch-layout #closeLottery{width:100%;text-align:right;min-height:44px;padding:8px}.touch-layout #closeLottery kbd{display:none}.touch-layout .lotteryTabs{gap:16px;margin:10px 0 18px}.touch-layout .lotteryTabs button{font-size:14px;min-height:44px;padding:10px 0}.touch-layout .lotteryTabs span{margin-left:4px}.touch-layout .lotteryLayout{grid-template-columns:minmax(0,1fr);gap:20px}.touch-layout #lotteryCategories{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0}.touch-layout .categoryPick{padding:10px 6px;font-size:10px;min-height:48px}.touch-layout.arcade #poolRoster{max-height:220px;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:10px;touch-action:pan-y}.touch-layout #machineDraw{min-width:0;width:100%;max-width:310px}.touch-layout .poolItem{touch-action:pan-y}.touch-layout .machineArea{padding-bottom:env(safe-area-inset-bottom)}
.touch-layout #challengeMenu,.touch-layout #storyChoiceModal{padding:12px}.touch-layout .challengeShell{max-height:calc(100dvh - 24px);width:100%;padding:16px!important}.touch-layout .challengeHeading h2{font-size:21px}.touch-layout .challengeHeading>button{min-width:44px;min-height:44px}.touch-layout .storyChoicePanel{padding:22px 18px}.touch-layout #storyChoiceClose{min-width:44px;min-height:44px;top:5px;right:5px}.touch-layout .storyChoicePanel h2{font-size:22px}.touch-layout .storyChoiceOptions kbd,.touch-layout .storyChoiceHint{display:none}.touch-layout #overlay{padding:12px}.touch-layout .panel{max-height:calc(100dvh - 24px)}
@media(max-width:370px){.touch-layout #fullscreen{display:none}.touchActions{right:10px;grid-template-columns:repeat(2,61px);gap:6px}.touchSteering{left:10px;width:132px}.touch-layout .wanted{right:63px;max-width:148px}.touch-layout #terrainName{font-size:7px}}
@media(orientation:landscape) and (max-height:550px){
 .touch-layout.arcade>header{top:7px}.touch-layout .arcadeStats{top:70px}.touch-layout.arcade .lobbyStart{bottom:26px;width:260px}.touch-layout .lobbyStart p{font-size:9px}.touch-layout.arcade .lobbySide{bottom:91px;max-height:calc(100dvh - 155px)}
 .touch-layout .score strong{font-size:24px}.touch-layout .score p{margin-top:3px}.touch-layout .wanted{right:70px}.touch-layout.arcade .health{bottom:calc(169px + env(safe-area-inset-bottom));padding:6px 8px;width:133px}.touch-layout .personLife span{font-size:15px}.touch-layout .health small{font-size:8px}.touch-layout .health>div{margin-bottom:4px}.touch-layout .speed{bottom:calc(172px + env(safe-area-inset-bottom))}.touch-layout .speed strong{font-size:25px}
 .touchSteering{width:126px;bottom:max(10px,env(safe-area-inset-bottom))}.touchActions{bottom:max(10px,env(safe-area-inset-bottom));gap:5px}.touchActions button{height:44px}.touch-layout #navigationPill{top:12px;max-width:37%;min-height:32px}.touch-layout.arcade #routeHud{top:76px;max-height:calc(100dvh - 160px)}.touch-layout #storyChoiceLauncher{top:80px}.touch-layout #boardingHint,.touch-layout.arcade #worldEventPrompt{bottom:24px;max-width:calc(100vw - 350px);font-size:10px}.touch-layout.arcade #challengeHud{top:77px;max-height:calc(100dvh - 165px);width:225px;right:12px}.touch-layout #challengeHud:not(.collapsed){background:#34445bf5}.touch-layout #challengeHud:not(.collapsed) #challengeObjective{max-height:60px;overflow:auto}.touch-layout #toast{top:34%;padding:0 175px}.touch-layout .storyChoiceOptions{grid-template-columns:1fr 1fr}.touch-layout .lotteryLayout{grid-template-columns:minmax(200px,.9fr) minmax(240px,1fr);gap:22px}.touch-layout #challengeList{grid-template-columns:repeat(2,minmax(0,1fr))}
}
