/* Shared mobile runtime polish for ToollySoft browser games. */
html,body{min-height:100%;min-height:100dvh;overscroll-behavior:none;-webkit-text-size-adjust:100%}
canvas,img{-webkit-user-drag:none}
button,select{-webkit-tap-highlight-color:transparent}
body.game-breaker #gameArea,body.game-toolug #gameCanvas,body.game-toolion canvas{touch-action:none}
button:focus-visible,select:focus-visible{outline:2px solid #67dcff;outline-offset:2px}
.mobile-fullscreen{display:none}
@media(pointer:coarse){
  .mobile-fullscreen{display:block;position:fixed;z-index:2147483000;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));min-width:48px;min-height:44px;padding:8px 10px;border:1px solid #67dcff88;border-radius:8px;background:#03101de6;color:#dff8ff;font:800 10px/1 system-ui;letter-spacing:.06em;box-shadow:0 4px 18px #0009;backdrop-filter:blur(8px)}
  body.mobile-cinema{position:fixed;inset:0;width:100vw;height:var(--mobile-vh,100dvh);overflow:hidden;background:#000}
  body.mobile-cinema> :is(#wrap,#gameShell,#game-container,#app,.game-wrap){width:100vw!important;height:var(--mobile-vh,100dvh)!important;max-width:none!important;max-height:none!important;margin:0!important}
  body.game-backgrounded canvas{filter:brightness(.55)}
}
@media(pointer:coarse){
  button,select,[role=button]{min-height:44px;touch-action:manipulation}
  button{user-select:none;-webkit-user-select:none}
}
@media(max-width:720px){
  body.game-tooltris{height:100dvh;padding:max(3px,env(safe-area-inset-top)) max(3px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(3px,env(safe-area-inset-left))}
  body.game-tooltris .game-wrap{max-height:100dvh;overflow:hidden;border-radius:10px}
  body.game-tooltris .mobile-controls{padding-bottom:env(safe-area-inset-bottom)}
  body.game-toolman #gameShell{width:100vw;height:min(100dvh,75vw);max-height:none}
  body.game-toolman .touch{right:max(8px,env(safe-area-inset-right));bottom:max(42px,env(safe-area-inset-bottom));width:150px;height:108px}
  body.game-toolman .touch button{min-width:48px;min-height:48px}
  body.game-toolman .overlay{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
  body.game-toolug #game-container{height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
  body.game-toolug #startPanel,body.game-toolug #gameOverPanel{width:min(92vw,430px);max-height:88dvh;overflow:auto;padding:22px 18px}
  body.game-toolug #instructions{display:none}
  body.game-toolug #muteBtn,body.game-toolug #fullscreenBtn{top:max(8px,env(safe-area-inset-top))}
  body.game-smoke{display:grid;place-items:center;height:100dvh}
  body.game-smoke #wrap{width:100vw;height:auto;max-height:100dvh;margin:0}
  body.game-smoke .mobile-controls{inset:auto max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
  body.game-smoke .mobile-controls button{min-width:52px;min-height:52px}
  body.game-breaker #app{height:100dvh;padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
  body.game-breaker .top-actions button{min-width:48px;min-height:48px}
  body.game-toolion #wrap{height:100dvh}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:560px){
  body.game-smoke #wrap{width:min(100vw,calc(100dvh * 16 / 9));height:100dvh}
  body.game-smoke .top{padding:max(5px,env(safe-area-inset-top)) 8px}
  body.game-smoke .mobile-controls{bottom:max(6px,env(safe-area-inset-bottom))}
  body.game-toolman #gameShell{width:min(100vw,calc(100dvh * 4 / 3));height:100dvh}
  body.game-tooltris .game-header{display:none}
  body.game-tooltris .game-wrap{padding:4px;gap:4px}
  body.game-toolug #gameCanvas{height:100dvh;width:auto}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
