/* v0.21.7: iPhone Safari/PWA landscape - visible controls and bounded panels.
   Touch devices only: desktop layouts and game simulation are unchanged. */
@media (orientation:landscape) and (pointer:coarse) and (max-width:1280px){
 html,body{overflow:hidden!important;-webkit-text-size-adjust:100%!important}
 body>.app-shell{box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  height:var(--mobile-browser-h,100dvh)!important;min-height:0!important;max-height:var(--mobile-browser-h,100dvh)!important;
  padding:max(2px,env(safe-area-inset-top)) max(3px,env(safe-area-inset-right)) max(2px,env(safe-area-inset-bottom)) max(3px,env(safe-area-inset-left))!important;
  display:flex!important;flex-direction:column!important;overflow:hidden!important;gap:3px!important}
 body>.app-shell>.main-layout{flex:1 1 auto!important;height:0!important;min-height:0!important;width:100%!important;overflow:hidden!important;
  display:grid!important;grid-template-columns:minmax(0,1fr) clamp(178px,25vw,236px)!important;grid-template-rows:minmax(0,1fr)!important;gap:3px!important}
 body>.app-shell .battlefield-card,body>.app-shell .side-panel{min-width:0!important;min-height:0!important;height:100%!important;max-height:100%!important;box-sizing:border-box!important}
 body>.app-shell .battlefield-card>.battle-play-row{grid-template-columns:clamp(75px,11vw,115px) minmax(0,1fr)!important;min-height:0!important;gap:3px!important;overflow:hidden!important}
 body>.app-shell .battle-utility-panel{min-height:0!important;min-width:0!important;box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
  justify-content:flex-start!important;align-items:stretch!important;gap:4px!important;padding:4px 3px!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important}
 body>.app-shell .battle-utility-panel>.utility-group-heading{flex:0 0 auto!important;padding:2px 0 4px!important}
 body>.app-shell .battle-utility-panel>.utility-group-heading small{font-size:8px!important}
 body>.app-shell .battle-utility-panel>.button{box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 auto!important;width:100%!important;min-width:0!important;min-height:32px!important;height:auto!important;
  padding:5px 3px!important;margin:0!important;border-radius:7px!important;overflow:visible!important;white-space:normal!important;text-align:center!important}
 body>.app-shell .battle-utility-panel>.button>.utility-button-label,
 body>.app-shell .battle-utility-panel>.button>.utility-button-label span{display:block!important;min-width:0!important;max-width:100%!important;width:100%!important;
  font-size:clamp(9px,1vw,11px)!important;line-height:1.22!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:keep-all!important;text-align:center!important}
 body>.app-shell .battle-utility-panel>.button>.utility-hotkey{display:none!important}
 body>.app-shell .battle-utility-panel>.auto-wave-count{flex:0 0 auto!important;display:flex!important;align-items:center!important;justify-content:center!important;
  flex-wrap:wrap!important;width:100%!important;height:auto!important;min-height:34px!important;max-height:none!important;padding:3px 1px!important;gap:3px!important;line-height:1.15!important;font-size:9px!important;white-space:normal!important}
 body>.app-shell .battle-utility-panel>.auto-wave-count input{flex:0 0 30px!important;width:30px!important;min-width:26px!important;max-width:36px!important;
  height:24px!important;min-height:24px!important;font-size:14px!important;text-align:center!important}
 body>.app-shell .battle-utility-panel>.auto-wave-count .auto-count-hotkey{display:none!important}
 /* Persistent actions: always available on every tab, with no overlap with scrolling tab content. */
 body>.app-shell .side-panel{position:relative!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;
  padding:3px 3px 71px!important;gap:2px!important}
 body>.app-shell .side-panel>.sidebar-nav{flex:0 0 29px!important;height:29px!important;min-height:29px!important;max-height:29px!important;gap:2px!important;margin:0!important;padding:1px!important}
 body>.app-shell .side-panel>.sidebar-nav .panel-tab{min-width:0!important;padding:1px!important;gap:2px!important;font-size:clamp(9px,1.3vw,11px)!important;white-space:nowrap!important}
 body>.app-shell .side-panel>.sidebar-nav .tab-keys{width:13px!important;height:15px!important;font-size:8px!important}
 body>.app-shell .side-panel>.panel{flex:1 1 0!important;max-height:none!important;height:auto!important;min-height:0!important;
  overflow-y:auto!important;overflow-x:hidden!important;padding:4px!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:thin!important}
 body>.app-shell .side-panel>.header-actions{position:absolute!important;z-index:12!important;top:auto!important;left:3px!important;right:3px!important;bottom:3px!important;
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;
  width:auto!important;height:64px!important;min-height:64px!important;max-height:64px!important;
  gap:3px!important;margin:0!important;padding:3px!important;align-content:stretch!important;justify-items:stretch!important;
  overflow:visible!important;border:1px solid #365e65!important;border-radius:8px!important;
  background:#102d38f5!important;box-shadow:none!important;box-sizing:border-box!important}
 body>.app-shell .side-panel>.header-actions>button,
 body>.app-shell .side-panel>.header-actions #fullscreenGameBtn,
 body>.app-shell .side-panel>.header-actions #menuBtn,
 body>.app-shell .side-panel>.header-actions #fieldInfoBtn,
 body>.app-shell .side-panel>.header-actions #quickRecipeBtn,
 body>.app-shell .side-panel>.header-actions #soundBtn,
 body>.app-shell .side-panel>.header-actions #helpBtn{
  box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;
  flex:initial!important;width:100%!important;max-width:100%!important;min-width:0!important;
  height:26px!important;min-height:26px!important;max-height:26px!important;
  gap:2px!important;padding:1px!important;margin:0!important;overflow:hidden!important;
  font-size:clamp(8px,.95vw,10px)!important;line-height:1.1!important;letter-spacing:-.04em!important;white-space:nowrap!important;text-align:center!important}
 body>.app-shell .side-panel>.header-actions>button kbd{display:none!important}
 body>.app-shell .side-panel>.header-actions .fullscreen-game-icon{display:none!important}
 body>.app-shell .side-panel>.header-actions .fullscreen-game-label{display:inline!important;font-size:inherit!important}
 body>.app-shell .side-panel>.header-actions #fieldInfoBtn::before,
 body>.app-shell .side-panel>.header-actions #soundBtn::before{content:none!important}
 body>.app-shell .side-panel>.header-actions #helpBtn{font-size:15px!important}
 /* The sprite is geometrically centered, independent of unit name/title height. */
 body>.app-shell .side-panel .unit-top{display:flex!important;justify-content:center!important;align-items:center!important;gap:7px!important;min-height:51px!important}
 body>.app-shell .side-panel .unit-iconbox{display:flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 50px!important;width:50px!important;height:50px!important;margin:0!important;padding:0!important}
 body>.app-shell .side-panel .unit-iconbox img{display:block!important;position:static!important;margin:auto!important;
  max-width:90%!important;max-height:90%!important;width:auto!important;height:auto!important;object-fit:contain!important;object-position:center center!important}
 body>.app-shell .side-panel .unit-identity{flex:1 1 auto!important;min-width:0!important}
 body>.app-shell .side-panel .unit-content{min-height:0!important;height:auto!important;max-height:none!important;overflow-y:auto!important;padding-right:2px!important}
 body>.app-shell .side-panel .unit-stats>div{min-width:0!important}
 body>.app-shell .side-panel .unit-buttons{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important}
 body>.app-shell .side-panel .unit-buttons .mini{box-sizing:border-box!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
 /* Catalog header stays usable, back and close are not covered by scroll content. */
 #recipeModal .recipe-modal{min-height:0!important;overflow:hidden!important;padding-bottom:max(5px,env(safe-area-inset-bottom))!important}
 #recipeModal .recipe-grid{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
 #recipeModal .recipe-modal-bottom{justify-content:flex-end!important;gap:5px!important;min-height:28px!important;flex:0 0 28px!important}
 #recipeModal .recipe-modal-bottom #recipeExitBtn{display:inline-flex!important;align-items:center!important;justify-content:center!important;
  width:auto!important;max-width:100%!important;white-space:nowrap!important;min-height:25px!important}
 #recipeModal .recipe-modal-bottom #recipeExitBtn kbd{display:none!important}
 #recipeModal .recipe-back-button{flex:0 0 auto!important;max-width:70px!important;white-space:nowrap!important}
 #recipeModal .recipe-top>div{min-width:0!important;flex:1 1 auto!important}
 #recipeModal .recipe-top h2{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 #recipeModal .recipe-filter{white-space:nowrap!important}
 #recipeModal .recipe-search input{min-width:0!important;max-width:100%!important}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:350px){
 body>.app-shell .battle-utility-panel{gap:2px!important;padding:2px!important}
 body>.app-shell .battle-utility-panel>.button{min-height:27px!important;padding:3px 2px!important}
 body>.app-shell .battle-utility-panel>.button>.utility-button-label,
 body>.app-shell .battle-utility-panel>.button>.utility-button-label span{font-size:9px!important}
 body>.app-shell .side-panel{padding-bottom:65px!important}
 body>.app-shell .side-panel>.header-actions{height:59px!important;min-height:59px!important;max-height:59px!important}
 body>.app-shell .side-panel>.header-actions>button{height:23px!important;min-height:23px!important;max-height:23px!important}
}
