/* Gameplay only, on touch-primary phones. Desktop and every menu retain their layout. */
@media (pointer:coarse) and (max-width:760px), (pointer:coarse) and (max-height:600px) and (orientation:landscape) {
  .game-viewport:has(.game-screen) .game-utilities {
    height:calc(48px + env(safe-area-inset-top));padding:0;background:none;
  }
  .game-viewport:has(.game-screen) .game-utilities .player-chip,
  .game-viewport:has(.game-screen) .game-utilities button:not(#fullscreenButton) {display:none}
  .game-viewport:has(.game-screen) .utility-right {
    position:absolute;right:max(10px,env(safe-area-inset-right));top:calc(2px + env(safe-area-inset-top));
  }
  .game-viewport:has(.game-screen) #fullscreenButton {width:44px;height:44px;min-width:44px}
  .game-viewport .game-screen,
  .game-viewport .game-screen.online-game {margin-top:0;height:100dvh;overflow:hidden}
  .game-viewport .game-screen.online-game {height:calc(100dvh - 24px)}
  .game-screen .game-top {
    flex:0 0 calc(48px + env(safe-area-inset-top));
    padding:env(safe-area-inset-top) calc(64px + env(safe-area-inset-right)) 0 max(10px,env(safe-area-inset-left));gap:8px;
  }
  .game-screen .run-title {min-width:0;font-size:12px}
  .game-screen .run-title small {font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .game-screen .run-stats {gap:8px;flex-shrink:0}
  .game-screen .pause-button {width:44px;height:44px;min-width:44px}
  .game-screen .canvas-container {margin-left:env(safe-area-inset-left);margin-right:env(safe-area-inset-right)}
  .game-screen>.game-controls {
    padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right));
    padding-bottom:calc(8px + env(safe-area-inset-bottom));flex-basis:calc(88px + env(safe-area-inset-bottom));
  }
  .game-screen .key-hints {display:none}
  .game-screen .touch-button {min-width:44px}
  .game-screen.online-game+.online-hud {height:24px;min-height:24px;padding:5px 12px;font-size:8px}
  .game-screen.online-game+.online-hud span:last-child {display:none}
}
@media (pointer:coarse) and (max-width:760px) and (orientation:portrait) {
  /* Keep the HUD on the picture and the thumb controls next to it, not across a blank letterbox. */
  .game-screen .canvas-container {
    flex:0 1 auto;height:calc((100vw - env(safe-area-inset-left) - env(safe-area-inset-right)) * .75);
    max-height:calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin-top:auto;
  }
  .game-screen>.game-controls {margin-bottom:auto}
}
@media (pointer:coarse) and (max-height:600px) and (orientation:landscape) {
  .game-screen>.game-controls {flex-basis:calc(64px + env(safe-area-inset-bottom));padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom))}
}
