#mobileControls{position:fixed;inset:0;z-index:9;pointer-events:none;font:600 11px system-ui;color:#fff;user-select:none;-webkit-user-select:none}
#mobileControls[hidden]{display:none}
#settingsPanel #cameraSensitivity{width:100%;min-height:32px;margin:0}
#settingsPanel #cameraSensitivityHint{margin:0 0 14px;font-size:11px}
#mobileControls button,.touch-stick{pointer-events:auto;touch-action:none;-webkit-tap-highlight-color:transparent}
#mobileControls button{min-height:44px;border:1px solid #ffffff50;border-radius:14px;background:#13273fbb;color:#fff;font:inherit;box-shadow:0 3px 12px #0003}
#mobileControls button.pressed{background:#427680dd;border-color:#a7f8dc;transform:scale(.96)}
.touch-movement{position:absolute;left:max(18px,env(safe-area-inset-left));bottom:calc(22px + env(safe-area-inset-bottom));display:grid;justify-items:center;gap:12px}
.touch-sprint{width:96px}
#mobileControls .touch-sprint[aria-pressed="true"]{background:#aceb79;color:#163626;border:2px solid #e0ffc5;box-shadow:0 0 14px #98ed6655;font-weight:800}
#mobileControls [data-action="autoPickup"][aria-pressed="true"]{background:#aceb79;color:#163626;border:2px solid #e0ffc5;font-weight:800}
.touch-stick{width:120px;height:120px;display:grid;place-items:center;border:1px solid #ffffff50;border-radius:50%;background:radial-gradient(circle,#bfeaff12 35%,#13273f66 36%);box-shadow:inset 0 0 0 12px #ffffff08}
.touch-stick span{width:48px;height:48px;border-radius:50%;background:#d2efffa6;border:2px solid #ffffffa0;box-shadow:0 4px 18px #0005;pointer-events:none}
.touch-actions{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:calc(22px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,44px);gap:6px;align-items:center}
.touch-actions button{padding:4px;line-height:1.15}
#mobileControls [data-action="fire"],#mobileControls [data-action="MouseRight"]{grid-column:span 2;height:78px;font-size:15px;font-weight:800;border-width:2px;border-radius:24px}
#mobileControls [data-action="fire"]{background:#e7763be8;border-color:#ffca8b}
#mobileControls [data-action="MouseRight"]{background:#286fabe8;border-color:#91d8ff}
#mobileControls [data-action="Space"]{grid-column:span 2}
#mobileControls [data-action="KeyE"]{height:54px;border:0;border-radius:0;clip-path:polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%);background:linear-gradient(145deg,#d27bff,#762ce5);color:#fff4bf;filter:drop-shadow(0 0 6px #b04cff88);font-weight:800}
#mobileControls [data-action="KeyE"] span{display:block;font-size:22px;line-height:24px}
#mobileControls [data-action="KeyE"].pressed{background:#e4bcff;color:#4e148a}
.touch-pause{position:absolute;top:calc(12px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:44px;font-size:20px!important}
.touch-hint{position:absolute;top:calc(132px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:max-content;max-width:90%;text-align:center;font-size:10px;color:#deecf8;pointer-events:none;text-shadow:0 1px 5px #000}
body.mobile-mode #gameCanvas{touch-action:none}
body.mobile-mode .controls-panel{display:none!important}
body.touch-playing .settings-button,body.touch-playing .island-readout,body.touch-playing .brand,body.touch-playing .objective-panel{display:none}
body.touch-playing .hud-top{inset:calc(10px + env(safe-area-inset-top)) 68px auto 12px;pointer-events:none}
body.touch-playing .round-readout{position:static;transform:none;justify-items:start}
body.touch-playing .round-readout strong,body.touch-playing .kills-readout strong{font-size:16px}
body.touch-playing .player-panel{top:calc(50px + env(safe-area-inset-top));bottom:auto;left:max(12px,env(safe-area-inset-left));width:158px;padding:8px;transform:none;backdrop-filter:none;pointer-events:none}
body.touch-playing .ability-row,body.touch-playing #recoveryText{display:none}
body.touch-playing #gasStatus{position:fixed;top:calc(62px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:145px;font:600 9px/1.4 system-ui;text-align:right;text-shadow:0 1px 4px #000}
body.touch-playing #recoveryText{display:block;position:fixed;top:calc(94px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:145px;margin:0;font:600 9px/1.4 system-ui;text-align:right;text-shadow:0 1px 4px #000}
body.touch-playing .health-track{margin:5px 0 0}
body.touch-playing .panel-label,body.touch-playing .panel-label b{font-size:10px;letter-spacing:0}
body.touch-playing .power-panel{top:calc(94px + env(safe-area-inset-top));bottom:auto;left:max(12px,env(safe-area-inset-left));width:158px;padding:5px 8px;gap:2px;pointer-events:none}
body.touch-playing .power-panel>span,body.touch-playing .power-panel strong{font-size:10px}
body.touch-playing #racketChoices{bottom:calc(212px + env(safe-area-inset-bottom));gap:5px;pointer-events:auto;touch-action:none}
body.touch-playing .racket-slot{width:44px;height:48px;cursor:pointer}
body.touch-playing .racket-slot svg{width:22px;height:28px}
body.touch-playing .racket-slot kbd{display:none}
body.touch-playing .racket-slot span{font-size:8px}
body.touch-playing #specialSlot{width:66px;margin-left:0}
body.touch-playing #specialSlot b{font-size:19px;height:22px}
body.touch-playing #specialSlot small{font-size:7px}
body.touch-playing .event-feed{top:calc(156px + env(safe-area-inset-top));max-width:80%;pointer-events:none}
body.touch-playing .event{padding:4px 6px;font-size:10px}
body.mobile-mode #settingsPanel{top:12px;right:max(12px,env(safe-area-inset-right));max-height:calc(100dvh - 24px);overflow:auto;z-index:21}
body.mobile-mode .pause-hint{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}
body.touch-playing #tutorialPanel{top:calc(176px + env(safe-area-inset-top));right:12px;width:calc(100% - 24px);max-height:calc(100dvh - 470px);padding:10px;overflow:auto;pointer-events:auto;touch-action:pan-y}
body.touch-playing #tutorialPanel h2{font-size:16px;margin:4px 0}
body.touch-playing #tutorialPanel .tutorial-meter{margin:5px 0}
body.touch-playing #tutorialProgress,body.touch-playing #tutorialPanel footer{display:none}
body.touch-playing #tutorialCopy{font-size:11px;line-height:1.4;margin:4px 0}
body.touch-playing #tutorialPanel.tutorial-minimized{top:80px;right:calc(50% - 130px);width:260px;max-height:none;padding:6px 10px;overflow:visible}
@media (max-height:600px) and (orientation:landscape){
 body.touch-playing #racketChoices{bottom:calc(12px + env(safe-area-inset-bottom))}
 .touch-movement{bottom:calc(12px + env(safe-area-inset-bottom));gap:6px}
 .touch-stick{width:104px;height:104px}
 .touch-actions{bottom:calc(12px + env(safe-area-inset-bottom))}
 .touch-hint{top:calc(48px + env(safe-area-inset-top))}
 body.touch-playing .event-feed{top:calc(68px + env(safe-area-inset-top));max-width:38%}
 body.touch-playing #tutorialPanel{top:80px;right:calc(50% - 160px);width:320px;max-height:calc(100dvh - 200px)}
}
#mobileOrientation{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:28px;background:radial-gradient(ellipse at top,#145b89,#071624 75%);color:#effaff;text-align:center;font-family:system-ui}
#mobileOrientation[hidden]{display:none}
#mobileOrientation>div{max-width:340px}
#mobileOrientation .rotate-phone{display:block;font-size:58px;color:#7ce4ff}
#mobileOrientation h2{font-size:28px;margin:22px 0 12px}
#mobileOrientation p{line-height:1.6;color:#c5deed}
#mobileOrientation button{margin:12px 0 20px;padding:16px 24px;border:1px solid #ffcb80;border-radius:14px;background:#ef9343;color:#102333;font:800 15px system-ui;cursor:pointer}
#mobileOrientation small{display:block;font-size:12px;line-height:1.6;color:#a6c4d8}

/* Mobile hierarchy: quiet status strip, clear sightline, thumb actions. */
#mobileControls{font:600 10px/1.2 system-ui}
#mobileControls button{box-shadow:none;border-color:#e4f4ff35;background:#112536a8;border-radius:12px}
#mobileControls button:focus-visible{outline:2px solid #b3ecff;outline-offset:2px}
#mobileControls .touch-hint{display:none}
#mobileControls .touch-movement{left:max(12px,env(safe-area-inset-left));bottom:calc(12px + env(safe-area-inset-bottom));gap:8px}
#mobileControls .touch-stick{width:128px;height:128px;background:#122c3b38;border-color:#e2f4ff42;box-shadow:inset 0 0 0 10px #ffffff06}
#mobileControls .touch-stick span{width:50px;height:50px;background:#d6f3ff8c;border-width:1px;box-shadow:none}
#mobileControls .touch-sprint{width:88px;min-height:44px}
#mobileControls .touch-actions{right:max(12px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom));grid-template-columns:repeat(2,76px);gap:8px}
#mobileControls .touch-actions [data-action="Space"]{grid-column:1;grid-row:1;height:46px;font-size:10px}
#mobileControls .touch-actions [data-action="KeyE"]{grid-column:2;grid-row:1;justify-self:end;width:54px;height:50px;background:linear-gradient(145deg,#b779e8da,#6e40bddd);filter:none;color:#fff0c4}
#mobileControls [data-action="KeyE"] span{font-size:18px;line-height:20px}
#mobileControls .touch-actions [data-action="MouseRight"],#mobileControls .touch-actions [data-action="fire"]{grid-column:auto;grid-row:2;height:72px;border-width:1px;border-radius:23px;font-size:12px}
#mobileControls .touch-actions [data-action="MouseRight"]{background:#276e9dc7;border-color:#8ccbe9a0}
#mobileControls .touch-actions [data-action="fire"]{background:#d78044d9;border-color:#ffcc96a0}
#mobileControls .touch-pause,#mobileControls .touch-more{position:absolute;top:calc(10px + env(safe-area-inset-top));width:44px;height:44px;min-height:44px;font-size:18px!important;background:#102434a6}
#mobileControls .touch-pause{right:max(12px,env(safe-area-inset-right))}
#mobileControls .touch-more{right:calc(62px + env(safe-area-inset-right));pointer-events:auto}
#mobileControls .touch-more[aria-expanded="true"]{background:#3a667ecc;border-color:#b6e4f8}
#touchUtilities{position:absolute;top:calc(62px + env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));width:224px;max-height:calc(100dvh - 80px);overflow:auto;padding:10px;background:#0c2236f5;border:1px solid #99bdd746;border-radius:16px;box-shadow:0 12px 28px #0005;pointer-events:auto;touch-action:pan-y;z-index:2}
#touchUtilities[hidden]{display:none}
#touchUtilities header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-size:10px;letter-spacing:.08em;color:#a9c7d8}
#touchUtilities header button{width:44px;font-size:22px}
.touch-utility-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#touchUtilities p{margin:12px 2px 2px;color:#9cb7c8;font:11px/1.5 system-ui}
body.touch-playing .hud-top{inset:calc(12px + env(safe-area-inset-top)) 120px auto auto;display:flex;gap:12px;align-items:center}
body.touch-playing .round-readout,body.touch-playing .kills-readout{position:static;display:flex;align-items:center;gap:5px;padding:0;min-width:0;background:none;border:0;border-radius:0;box-shadow:none;transform:none;font:600 8px system-ui;letter-spacing:0;color:#d1e1eb}
body.touch-playing .round-readout strong,body.touch-playing .kills-readout strong{margin:0;font-size:13px;color:#fff}
body.touch-playing .player-panel{top:calc(12px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));width:144px;padding:7px 9px;border:1px solid #c0d9e32e;border-radius:10px;background:#112537b3;box-shadow:none}
body.touch-playing .panel-label,body.touch-playing .panel-label b{font-size:9px;font-weight:600}
body.touch-playing .health-track{height:4px;margin-top:4px;border:0;border-radius:4px}
body.touch-playing #healthBar{box-shadow:none}
body.touch-playing .power-panel{top:calc(54px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));width:144px;padding:0 2px;border:0;background:none;box-shadow:none;gap:2px;grid-template-columns:1fr auto}
body.touch-playing .power-panel>span,body.touch-playing .power-panel strong{font:600 8px system-ui;white-space:nowrap;color:#d9e4ed;text-shadow:0 1px 3px #000}
body.touch-playing .power-panel .power-track{grid-column:1/-1;height:2px;background:#ffffff24}
body.touch-playing #gasStatus{top:calc(34px + env(safe-area-inset-top));right:120px;width:174px;font:600 8px/1.3 system-ui;white-space:nowrap;color:#ddc2ff!important}
body.touch-playing #recoveryText{top:calc(49px + env(safe-area-inset-top));right:120px;width:174px;font:500 8px/1.3 system-ui;white-space:normal;color:#bdd8e5}
body.touch-playing #racketChoices{left:calc(50% - 16px);bottom:calc(10px + env(safe-area-inset-bottom));gap:4px;padding:5px;background:#1023307d;border:1px solid #d6eeff20;border-radius:14px}
body.touch-playing .racket-slot{width:44px;height:44px;min-width:44px;background:#142b3b8c;border:1px solid #dcefff22;border-bottom:2px solid var(--racket-color);border-radius:9px;box-shadow:none;gap:0}
body.touch-playing .racket-slot.selected{transform:translateY(-2px);background:#345b738a;border-color:var(--racket-color);box-shadow:none}
body.touch-playing .racket-slot svg{width:19px;height:25px}
body.touch-playing .racket-slot span{font-size:7px}
body.touch-playing #specialSlot{width:50px;min-width:50px;margin:0 0 0 2px}
body.touch-playing #specialSlot b{height:20px;font-size:19px}
body.touch-playing #specialSlot small{display:none}
body.touch-playing .event-feed{top:calc(80px + env(safe-area-inset-top));width:max-content;max-width:40%}
body.touch-playing .event{padding:5px 9px;border-radius:8px;font:600 10px/1.3 system-ui;letter-spacing:0;background:#122939b8;border:0;box-shadow:none}
body.touch-playing.tutorial-active .event-feed{top:calc(124px + env(safe-area-inset-top))}
body.touch-playing #connectionBadge{bottom:0;padding:0 6px;background:none;border:0;box-shadow:none;font-size:8px;opacity:.75;pointer-events:none}
body.touch-playing #tutorialPanel{top:calc(64px + env(safe-area-inset-top));right:calc(50% - 150px);width:300px;padding:8px 10px;max-height:calc(100dvh - 220px);background:#0e2739f2;border:1px solid #abcddd44;border-radius:12px;box-shadow:0 6px 18px #0003}
body.touch-playing #tutorialPanel .tutorial-heading{background:#0e2739fa}
body.touch-playing #tutorialPanel.tutorial-minimized{top:calc(64px + env(safe-area-inset-top));right:calc(50% - 122px);width:244px;display:grid;grid-template-columns:1fr 44px;align-items:center;gap:6px;padding:3px 6px 3px 10px;max-height:none;background:#102a3dc9;box-shadow:none}
body.touch-playing #tutorialPanel.tutorial-minimized .tutorial-heading{display:contents}
body.touch-playing #tutorialPanel.tutorial-minimized .tutorial-heading>span,body.touch-playing #tutorialPanel.tutorial-minimized #tutorialCount{display:none}
body.touch-playing #tutorialPanel.tutorial-minimized #tutorialToggle{grid-column:2;grid-row:1;background:none;border:0}
body.touch-playing #tutorialPanel.tutorial-minimized #tutorialTitle{grid-column:1;grid-row:1;margin:0;font:600 11px/1.3 system-ui;letter-spacing:0}
@media(max-width:640px){
 body.touch-playing .hud-top{gap:6px}
 body.touch-playing .round-readout,body.touch-playing .kills-readout{font-size:7px}
 body.touch-playing #racketChoices{gap:2px;padding:3px}
 body.touch-playing #specialSlot{width:44px;min-width:44px}
 body.touch-playing #tutorialPanel{right:calc(50% - 130px);width:260px}
 body.touch-playing #tutorialPanel.tutorial-minimized{right:calc(50% - 110px);width:220px}
}
body.mobile-mode:has(#pauseHint:not([hidden])) :is(.hud-top,.player-panel,.power-panel,.objective-panel,.island-readout,#tutorialPanel,#tutorialMarker,#eventFeed){visibility:hidden}
body.mobile-mode #pauseHint{width:min(300px,calc(100vw - 32px));padding:16px;gap:10px;border:1px solid #bed6e749;background:#0b2338f5;box-shadow:0 14px 50px #0005}
body.mobile-mode #pauseHint strong{font-size:18px;letter-spacing:.02em}
body.mobile-mode #pauseHint button{min-height:44px}
body.mobile-mode #pauseHint .quit-hint{font-size:10px}
body.mobile-mode:has(#settingsPanel:not([hidden])) #pauseHint{visibility:hidden}
body.mobile-mode #settingsPanel{background:#0b2338fa;border:1px solid #bed6e749;border-radius:16px;box-shadow:0 12px 36px #0005}

/* Direct thumb controls and context-only vertical flight controls. */
#mobileControls .touch-movement [data-action="autoPickup"]{width:88px;min-height:44px}
#mobileControls .touch-more{display:none}
#mobileControls .touch-actions{grid-template-columns:54px 76px 76px;grid-template-rows:44px 44px 44px 72px}
#mobileControls .touch-actions [data-action="KeyP"]{grid-column:3;grid-row:1;height:44px}
#mobileControls .touch-actions [data-action="KeyG"]{grid-column:3;grid-row:2;height:44px}
#mobileControls .touch-actions [data-action="Space"]{grid-column:3;grid-row:3;height:44px}
#mobileControls .touch-actions [data-action="KeyE"]{grid-column:1;grid-row:4}
#mobileControls .touch-actions [data-action="MouseRight"]{grid-column:2;grid-row:4}
#mobileControls .touch-actions [data-action="fire"]{grid-column:3;grid-row:4}
#mobileControls .touch-flight{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:calc(92px + env(safe-area-inset-bottom));display:grid;gap:8px;width:76px}
#mobileControls .touch-flight[hidden]{display:none}
#mobileControls .touch-flight button{width:76px;height:44px;display:grid;place-content:center;gap:2px;background:#224d6ed9;border-color:#99d9f899}
#mobileControls .touch-flight span{font:700 26px/26px system-ui}
#mobileControls .touch-flight small{font:600 9px/10px system-ui}
#mobileControls.touch-vertical .touch-actions [data-action="Space"],#mobileControls.touch-vertical .touch-actions [data-action="KeyG"]{visibility:hidden;pointer-events:none}
#mobileControls.touch-spectator .touch-actions,#mobileControls.touch-spectator .touch-sprint,#mobileControls.touch-spectator [data-action="autoPickup"]{display:none}
#mobileControls.touch-spectator .touch-flight{right:max(12px,env(safe-area-inset-right));bottom:calc(12px + env(safe-area-inset-bottom))}
body.touch-playing #specialSlot{cursor:pointer}
body.touch-playing #spectatorHint{top:72px;padding:6px 10px;font-size:10px;max-width:60vw}
@media(max-width:700px){
 body.touch-playing #racketChoices{left:50%;bottom:calc(100px + env(safe-area-inset-bottom))}
}
body.touch-playing #specialSlot{touch-action:none;user-select:none;-webkit-touch-callout:none;position:relative}
body.touch-playing #specialSlot.item-holding::after{content:"";position:absolute;bottom:0;left:0;height:4px;background:#ffe39a;animation:item-drop-hold .65s linear forwards;pointer-events:none}
@keyframes item-drop-hold{from{width:0}to{width:100%}}
