#mobileControls{display:none}body.playing #game{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}body.playing{overscroll-behavior:none}#overlay{touch-action:pan-y;overscroll-behavior:contain}
body.touch-game.playing #mobileControls{display:block;position:fixed;inset:0;pointer-events:none;z-index:10}
#touchStick{position:absolute;left:max(18px,env(safe-area-inset-left));bottom:max(22px,env(safe-area-inset-bottom));width:118px;height:118px;border:2px solid #c8f58b65;border-radius:50%;background:#14251c75;pointer-events:auto;touch-action:none;display:grid;place-items:center}
#touchStick i{display:block;width:49px;height:49px;border-radius:50%;background:#c8f58b9c;border:1px solid #e7ffbfaa;box-shadow:0 0 20px #b2f38c25;pointer-events:none}
.touch-actions{position:absolute;right:max(18px,env(safe-area-inset-right));bottom:max(25px,env(safe-area-inset-bottom));display:flex;gap:14px;align-items:flex-end}
.touch-actions button{width:58px;height:58px;border-radius:50%;border:1px solid #c8f58b88;background:#1a3025c9;color:#dcffbd;font-size:28px;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none;padding:0}
.touch-actions #touchPower{width:68px;height:68px;margin-bottom:36px;background:#35472bd9}.touch-actions .pressed{background:#648c3e}
body.touch-game.playing #hud{left:max(9px,env(safe-area-inset-left));top:max(8px,env(safe-area-inset-top));width:174px;padding:8px 10px;font-size:10px;line-height:1.35;max-height:135px;pointer-events:none}
body.touch-game.playing .hud-main strong{font-size:22px}body.touch-game.playing #hud .character-title{margin-top:3px}body.touch-game.playing #currentDescription{display:none}
body.touch-game.playing #leaderboard{top:max(8px,env(safe-area-inset-top));right:max(9px,env(safe-area-inset-right));width:94px;padding:10px;max-height:45dvh;overflow:auto;pointer-events:auto}
body.touch-game.playing #leaderboard h3{margin:0;cursor:pointer;min-height:20px;font-size:11px}body.touch-game.playing #leaderboard h3:after{content:' ▾'}body.touch-game.playing #leaderboard ol,body.touch-game.playing #leaderboard button{display:none!important}
body.touch-game.playing.show-ranking #leaderboard{width:180px}body.touch-game.playing.show-ranking #leaderboard ol,body.touch-game.playing.show-ranking #leaderboard button{display:block!important}body.touch-game.playing.show-ranking #leaderboard ol{margin-top:6px;font-size:10px}
body.touch-game.playing #minimapWrap{width:94px;height:94px;right:max(9px,env(safe-area-inset-right));bottom:calc(max(25px,env(safe-area-inset-bottom)) + 125px);pointer-events:auto;padding:4px;cursor:pointer}body.touch-game.playing #minimap{width:84px;height:84px}
body.touch-game.playing.show-map #minimapWrap{width:170px;height:170px}body.touch-game.playing.show-map #minimap{width:160px;height:160px}
body.touch-game.playing #diagnosticsPanel{left:9px!important;bottom:calc(max(22px,env(safe-area-inset-bottom)) + 132px)!important;padding:6px!important;font-size:9px!important;max-width:180px!important}body.touch-game.playing #diagnosticsPanel:not([open]){opacity:.65}
@media(max-height:480px){#touchStick{width:100px;height:100px}.touch-actions #touchPower{margin-bottom:20px}body.touch-game.playing #minimapWrap{bottom:105px;width:78px;height:78px}body.touch-game.playing #minimap{width:68px;height:68px}body.touch-game.playing.show-map #minimapWrap{width:150px;height:150px}body.touch-game.playing.show-map #minimap{width:140px;height:140px}}

/* v68: pin the game and HUD to Safari's visible area, not the obscured layout viewport. */
body.touch-game.playing #game{position:fixed;left:var(--game-left,0px);top:var(--game-top,0px);width:var(--game-width,100vw);height:var(--game-height,100dvh)}
body.touch-game.playing #mobileControls{inset:auto;left:var(--game-left,0px);top:var(--game-top,0px);width:var(--game-width,100vw);height:var(--game-height,100dvh)}
body.touch-game.playing #hud{left:calc(var(--game-left,0px) + max(9px,env(safe-area-inset-left)));top:calc(var(--game-top,0px) + max(8px,env(safe-area-inset-top)));width:min(174px,calc(var(--game-width,100vw) * .56))}
body.touch-game.playing #leaderboard{right:calc(var(--game-right,0px) + max(9px,env(safe-area-inset-right)));top:calc(var(--game-top,0px) + max(8px,env(safe-area-inset-top)));max-height:calc(var(--game-height,100dvh) * .45)}
body.touch-game.playing #minimapWrap{right:calc(var(--game-right,0px) + max(9px,env(safe-area-inset-right)));bottom:calc(var(--game-bottom,0px) + max(25px,env(safe-area-inset-bottom)) + min(125px,calc(var(--game-height,100dvh) * .25)))}
body.touch-game.playing #diagnosticsPanel{left:calc(var(--game-left,0px) + max(9px,env(safe-area-inset-left)))!important;bottom:calc(var(--game-bottom,0px) + max(22px,env(safe-area-inset-bottom)) + 132px)!important}

.touch-actions #touchPower.active-power{background:#648c3e;box-shadow:0 0 14px #c8f58b88}
/* Keep the menu inside the visible area after Safari zoom, panning and rotation. */
body.touch-game #overlay.home-compact #card,body.touch-game #overlay.home-compact .lobby-content{min-width:0;max-width:100%}
body.touch-game #overlay.home-compact .entry-column{min-width:0;overflow-wrap:anywhere}
body.touch-game #overlay.home-compact input,body.touch-game #overlay.home-compact select{min-width:0;max-width:100%;font-size:16px}
body.touch-game #overlay.home-compact button{touch-action:manipulation}
#hudToggle{display:none}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.touch-game.playing #hud{width:min(144px,calc(var(--game-width,100vw) * .52));max-height:135px;pointer-events:auto}
body.touch-game.playing #hud .hud-main>b{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.touch-game.playing #hudToggle{display:inline-grid;place-items:center;flex:0 0 32px;width:32px;height:32px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--mint);font-size:18px;touch-action:manipulation}
body.touch-game.playing #hud .hud-main{gap:6px}
body.touch-game.playing #hud .hud-main strong{font-size:20px;line-height:1.1;min-width:0;white-space:nowrap}
body.touch-game.playing #hud #currentCharacter,body.touch-game.playing #hud #abilityVal{display:none}
body.touch-game.playing.show-hud #hud #currentCharacter,body.touch-game.playing.show-hud #hud #abilityVal{display:block}
