/* The game scene keeps the original 800x600 geometry on every screen. */
.mobile-player-hud,.mobile-controls{display:none!important}
.mobile-layout-switch[hidden]{display:none!important}
body.mobile-game{--native-safe-top:env(safe-area-inset-top,0px);--native-safe-right:env(safe-area-inset-right,0px);--native-safe-bottom:env(safe-area-inset-bottom,0px);--native-safe-left:env(safe-area-inset-left,0px);height:100dvh;min-height:0;overflow:hidden;justify-content:flex-start;padding:0;gap:0;overscroll-behavior:none}
.mobile-game #gameFit{flex:none;max-width:none;outline:0}
.mobile-game #play.classic-game{position:absolute;width:800px;height:600px;transform-origin:0 0}
.mobile-game .web-status,.mobile-game .touch-tools,.mobile-game .mobile-player-hud{display:none!important}
body.mobile-game .web-strip{width:100%;height:calc(44px + var(--native-safe-top))!important;min-height:calc(44px + var(--native-safe-top))!important;padding:var(--native-safe-top) max(10px,var(--native-safe-right)) 0 max(10px,var(--native-safe-left));gap:6px}
.mobile-game .web-strip>span{display:none}
.mobile-game .web-strip a,.mobile-game .web-strip button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;font-size:13px;white-space:nowrap}
/* Only the web settings dialog is adapted; original game/auth/facility windows
   keep their native assets and positions. */
.mobile-game #settingsDialog{max-height:calc(100dvh - 24px);font:14px/1.4 sans-serif;padding:16px}
.mobile-game #settingsDialog button{min-height:44px;font-size:14px}
.mobile-game #settingsDialog input:not([type=checkbox]),.mobile-game #settingsDialog select{min-height:44px;font-size:16px}
/* Supplementary controls are explicit opt-in and remain outside the scene. */
.mobile-game.mobile-assist .mobile-controls:not([hidden]){display:block!important;width:100%;max-width:100%;order:2;flex:none;background:#151b1c;border-top:1px solid #655539;padding:0 max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));font:14px sans-serif}
.mobile-controls button{min-width:44px;min-height:44px;font:600 14px sans-serif;color:#e7ddc5;background:#253032;border:1px solid #687273;border-radius:6px;touch-action:none;user-select:none;-webkit-user-select:none}
.mobile-controls button:active,.mobile-controls button.is-held{background:#806238;border-color:#e2bb74}
.mobile-shortcuts{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:7px 0}
.mobile-shortcuts button{min-width:44px;background:#182020;border-color:#454b44}
.mobile-thumbs{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:2px 2px 0}
.mobile-direction-pad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:4px}
.mobile-direction-pad .direction-up{grid-column:2;grid-row:1}.mobile-direction-pad .direction-left{grid-column:1;grid-row:2}.mobile-direction-pad .direction-down{grid-column:2;grid-row:2}.mobile-direction-pad .direction-right{grid-column:3;grid-row:2}
.mobile-combat-actions{display:grid;grid-template-columns:repeat(2,minmax(56px,1fr));gap:6px;max-width:170px;flex:1}
.mobile-combat-actions .primary-attack{background:#7b3025;border-color:#cb8060}
@media(orientation:landscape) and (max-height:500px){
  .mobile-game.mobile-assist .mobile-controls{height:calc(104px + max(8px,env(safe-area-inset-bottom)));position:relative}
  .mobile-game.mobile-assist .mobile-shortcuts{position:absolute;left:calc(max(10px,env(safe-area-inset-left)) + 152px);right:calc(max(10px,env(safe-area-inset-right)) + 172px);top:34px;padding:0;gap:4px}
  .mobile-game.mobile-assist .mobile-thumbs{height:100%;padding-top:4px}
  .mobile-game.mobile-assist .mobile-combat-actions{margin-left:auto;max-width:160px}
  .mobile-game.mobile-assist .mobile-shortcuts button{font-size:12px;padding:3px}
}
@media(orientation:landscape) and (max-height:500px) and (max-width:700px){
  .mobile-game.mobile-assist .mobile-shortcuts{grid-template-columns:repeat(3,minmax(44px,1fr));top:8px}
}
