#pilot-touch,.phone-input-help{display:none}
body.touch-device{overscroll-behavior:none;-webkit-user-select:none;user-select:none}
.touch-device input,.touch-device select{font-size:16px}
.touch-device #game-canvas{touch-action:none}
.touch-device .desktop-input-help{display:none}
.touch-device .phone-input-help{display:block}
.touch-device.tw-playing #pilot-touch{position:fixed;inset:0;display:block;z-index:8;pointer-events:none;touch-action:manipulation}
.touch-device [data-pilot-move]{position:absolute;left:0;bottom:0;width:46%;height:65%;pointer-events:auto;touch-action:none}
.touch-device [data-pilot-look]{position:absolute;left:46%;right:0;top:0;bottom:0;pointer-events:auto;touch-action:none}
.pilot-stick{position:absolute;left:var(--origin-x,82px);top:var(--origin-y,calc(100% - 180px - env(safe-area-inset-bottom)));width:108px;height:108px;transform:translate(-50%,-50%);border:2px solid #c1e4d77a;border-radius:50%;background:#10293266;pointer-events:none}
.pilot-stick i{position:absolute;left:50%;top:50%;width:44px;height:44px;transform:translate(calc(-50% + var(--stick-x,0px)),calc(-50% + var(--stick-y,0px)));border-radius:50%;background:#bfe5d5a3;border:2px solid #e0f6e2a6}
.pilot-stick span{position:absolute;top:100%;left:-10px;right:-10px;text-align:center;font-size:8px;letter-spacing:.6px;margin-top:10px;color:#e1f5e0;text-shadow:0 1px 3px #07171c}
[data-pilot-move].held .pilot-stick{border-color:#7adbc6;background:#2c8a7944}
.touch-device #pilot-touch button{pointer-events:auto;touch-action:none;-webkit-touch-callout:none;transition:none}
.touch-device #pilot-touch button:is(.held,.selected){background:#35766d;box-shadow:inset 0 0 0 2px #b6e2ca80;transform:none}
.touch-device .pilot-actions{position:absolute;right:max(16px,env(safe-area-inset-right));bottom:calc(22px + env(safe-area-inset-bottom));width:184px;height:238px;pointer-events:none}
.touch-device .pilot-actions button{position:absolute;width:52px;height:52px;border-radius:50%;padding:0;background:#122e3de0;color:#e0f4e9;border:1px solid #c1e6d380;font-size:10px;font-weight:800;letter-spacing:0;line-height:1.3}
.pilot-actions [data-pilot-code="KeyQ"]{top:0;left:0}.pilot-actions [data-pilot-hold="special"]{top:0;left:66px}.pilot-actions [data-pilot-code="KeyE"]{top:0;right:0}
.pilot-actions [data-pilot-code="KeyL"]{top:64px;left:0}.pilot-actions [data-pilot-code="KeyR"]{top:64px;left:66px}.pilot-actions .pilot-weapon{top:64px;right:0}
.pilot-actions [data-pilot-more]{bottom:0;left:0}
.pilot-actions [data-pilot-code="KeyT"]{top:128px;left:0}
.touch-device .pilot-actions [data-pilot-hold="fire"]{bottom:0;right:0;width:88px;height:88px;background:#b7d8c8de;color:#112d34;border:2px solid #e9f7de99;font-size:17px}
.pilot-actions [data-pilot-hold="fire"] small{display:block;font-size:8px;margin-top:6px;letter-spacing:0}
.touch-device #pilot-touch .pilot-map{position:absolute;top:calc(12px + env(safe-area-inset-top));right:calc(70px + env(safe-area-inset-right));width:48px;height:48px;border-radius:10px;background:#122d3ce0;border:1px solid #c1e6d380;color:#e0f4e9;font-size:9px;padding:0}
.pilot-tools{position:absolute;z-index:4;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:calc(100dvh - 90px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:auto;padding:14px;border:1px solid #a9d8c783;border-radius:16px;background:#102534f5;pointer-events:auto;overscroll-behavior:contain}
.pilot-tools-head{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;font-size:10px;letter-spacing:.7px;position:sticky;top:0;z-index:1;background:#102534}
.pilot-tools-head button{width:44px;height:44px;padding:0;font-size:24px;background:none;color:#edf6e2}
.pilot-tools>button{min-height:48px;font-size:11px;padding:10px 5px;background:#264555;color:#e0f4e9;border:1px solid #b2d8c655;border-radius:9px}
.touch-device #pilot-touch .pilot-tools,.touch-device #pilot-touch .pilot-tools button{touch-action:pan-y}
#pilot-touch[data-mode="ground"] .pilot-flight,#pilot-touch:not([data-mode="ground"]) .pilot-ground,#pilot-touch:not([data-mode="skiff"]) .pilot-skiff{display:none}
.touch-device.tw-playing #header{display:none}
.touch-device.tw-playing :is(.abilities,#radar,#flight-readout,#tips,#trackpad-status,#field-status,#field-deck,#mission-brief,#cooperation-hint,#pursuit-readout,#boss-progress,#hq-radio){display:none!important}
.touch-device.tw-playing #hud{pointer-events:none}
.touch-device.tw-playing #pause-open{top:calc(12px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));bottom:auto;width:48px;height:48px;z-index:10;pointer-events:auto;border-radius:10px}
.touch-device.tw-playing .objective{top:calc(12px + env(safe-area-inset-top))!important;left:max(12px,env(safe-area-inset-left))!important;width:calc(100vw - 152px);max-width:240px!important;padding:0!important}
.touch-device.tw-playing .objective .eyebrow{font-size:7px}
.touch-device.tw-playing .objective h2{font-size:15px;margin:5px 0;line-height:1.2}
.touch-device.tw-playing .objective p{display:none}
.touch-device.tw-playing #objective-distance{font-size:9px}
.touch-device.tw-playing .top-readout{display:none}
.touch-device.tw-playing .vitals{left:max(16px,env(safe-area-inset-left));bottom:calc(14px + env(safe-area-inset-bottom));width:142px;padding:0}
.touch-device.tw-playing .vitals .vital-label{font-size:8px}
.touch-device.tw-playing .vitals .vehicle-state{font-size:7px}
.touch-device.tw-playing #interaction{top:calc(94px + env(safe-area-inset-top));bottom:auto;left:50%;max-width:75vw;font-size:10px}
.touch-device.tw-playing #interaction kbd{display:none}
.touch-device.tw-playing #target-ui{right:max(16px,env(safe-area-inset-right))!important;bottom:calc(270px + env(safe-area-inset-bottom));width:145px;max-width:44vw;font-size:9px;padding:7px}
.touch-device.tw-playing #boss-hud{top:calc(136px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:180px}
.touch-device.tw-playing #toast{top:calc(116px + env(safe-area-inset-top));bottom:auto;max-width:78vw;font-size:10px;padding:10px;pointer-events:none}
.touch-device.tw-playing #party-hud{top:calc(155px + env(safe-area-inset-top));left:12px;font-size:9px;max-width:36vw}
.touch-device.tw-playing .player-chat.pc-compact{top:calc(75px + env(safe-area-inset-top))!important;bottom:auto!important;left:max(12px,env(safe-area-inset-left))!important;right:auto!important}
@media(orientation:landscape) and (max-height:600px){
 .pilot-stick{left:var(--origin-x,calc(82px + env(safe-area-inset-left)));top:var(--origin-y,calc(100% - 90px - env(safe-area-inset-bottom)));width:96px;height:96px}
 .touch-device .pilot-actions{width:250px;height:182px;bottom:calc(12px + env(safe-area-inset-bottom))}
 .pilot-actions [data-pilot-code="KeyQ"]{left:0;top:0}.pilot-actions [data-pilot-code="KeyE"]{left:66px;top:0;right:auto}
 .pilot-actions [data-pilot-hold="special"]{left:0;top:64px}.pilot-actions [data-pilot-code="KeyR"]{left:66px;top:64px}
 .pilot-actions [data-pilot-code="KeyL"]{left:132px;top:0}.pilot-actions .pilot-weapon{left:198px;top:0;right:auto}
 .pilot-actions [data-pilot-more]{left:0;bottom:0}
 .pilot-actions [data-pilot-code="KeyT"]{left:66px;top:auto;bottom:0}
 .touch-device .pilot-actions [data-pilot-hold="fire"]{width:80px;height:80px;right:4px}
 .touch-device.tw-playing .vitals{left:calc(146px + env(safe-area-inset-left));width:120px;bottom:calc(12px + env(safe-area-inset-bottom))}
 .touch-device.tw-playing .objective{max-width:260px!important}
 .touch-device.tw-playing #target-ui{bottom:calc(12px + env(safe-area-inset-bottom));right:calc(288px + env(safe-area-inset-right))!important;width:145px}
 .pilot-tools{grid-template-columns:repeat(5,minmax(0,1fr))}
 .touch-device.tw-playing #interaction{top:calc(76px + env(safe-area-inset-top))}
 .touch-device.tw-playing #toast{top:calc(78px + env(safe-area-inset-top));max-width:40vw;font-size:9px}
 .touch-device.tw-playing #party-hud{display:none}
}

.touch-device.tw-playing .vitals .vital-label{font-size:8px;letter-spacing:0;margin-bottom:5px}
.touch-device.tw-playing .vital-label b{font-size:10px;white-space:nowrap}
.touch-device.tw-playing .vitals .bar{height:4px;margin:0 0 8px}
.touch-device.tw-playing .vehicle-state{padding-top:6px;letter-spacing:0;font-size:7px}
.touch-device #header{height:76px;padding:12px max(20px,env(safe-area-inset-right)) 12px max(20px,env(safe-area-inset-left))}
.touch-device .header-meta :is(#backend,#save-status,.stats-link){display:none}
.touch-device .nav-screen{inset:76px 0 0;padding:24px max(24px,env(safe-area-inset-right)) 72px max(24px,env(safe-area-inset-left));display:block;overflow:auto;min-height:0;overscroll-behavior:contain}
.touch-device .nav-screen .mission-card{width:min(470px,100%);max-width:none;min-height:0;max-height:none;margin:0;padding:0;overflow:visible}
.touch-device .mission-card h1{font-size:44px;line-height:1.05;margin:18px 0}
.touch-device .mission-card #route-description{font-size:13px;line-height:1.6;max-width:420px}
.touch-device .nav-screen .hangar-caption{display:none}
.touch-device .nav-screen .nav-footer{position:static;margin:24px 0 0;padding:0}
.touch-device .launch-stack .large{min-height:52px;font-size:13px}
.touch-device .mission-card .text-button{min-height:44px}
@media(orientation:landscape) and (max-height:600px){
 .touch-device .nav-screen{padding-top:16px}
 .touch-device .nav-screen .mission-card{width:min(540px,80%)}
 .touch-device .mission-card h1{font-size:36px;margin:12px 0}
 .touch-device .mission-card #route-description{margin-bottom:18px}
 .touch-device .pilot-stick span{font-size:7px}
}
/* Clear the desktop narrow-window margin before fitting the phone navigation. */
.touch-device .nav-screen{position:fixed;margin:0;pointer-events:auto}
.touch-device .nav-screen .mission-card{justify-self:start;align-self:start;border:0;background:none}
