/* Phone layouts keep the game and its primary action close at hand. */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
  body { overscroll-behavior: none; }
  button, select, input { touch-action: manipulation; }
  canvas { touch-action: none; }
  dialog { max-height: calc(100dvh - 24px); overflow: auto; }
  body[data-game="patchwork-parade"] .shell,
  body[data-game="puddle-engineers"] .shell,
  body[data-game="picnic-pairs"] .shell,
  body[data-game="mosaic-courtyard"] .shell,
  body[data-game="pantry-shuffle"] .shell { width: 100%; padding: 0 max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  body[data-game] .shell > header { min-height: 52px; }
  body[data-game] .shell > .footnote, body[data-game] .shell > footer { display: none; }
  body[data-game]:not([data-game="lantern-links"]) .game-menu { min-height: 0; gap: 12px; padding: 12px 0; }
  body[data-game]:not([data-game="lantern-links"]) .menu-art { display: none; }
  body[data-game]:not([data-game="lantern-links"]) .menu-copy { padding: 12px; }
  body[data-game]:not([data-game="lantern-links"]) .menu-copy h1 { font-size: clamp(28px, 8vw, 40px); }
  body[data-game]:not([data-game="lantern-links"]) .play-top { padding: 6px 0; gap: 8px; }
  body[data-game]:not([data-game="lantern-links"]) .scene-caption { min-height: 0; padding: 8px; }
  body[data-game]:not([data-game="lantern-links"]) .sidebar { position: static; padding: 6px; }
  body[data-game="lantern-links"] .shell { width: 100%; padding-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right)); }
  body[data-game="lantern-links"] #menuArt { display: none; }
  body[data-game="lantern-links"] .menu { min-height: 0; padding-block: 12px; }
  body[data-ug-game="find-the-animal"] .hero-art,
  body[data-ug-game="photon"] .orbit-art { display: none; }
  body[data-ug-game="find-the-animal"] .hero-card,
  body[data-ug-game="photon"] .home-layout { min-height: 0; }
  body[data-ug-game="swipe"] #gameCanvas,
  body[data-ug-game="pearls"] #game { touch-action: none; user-select: none; }
}

@media (max-width: 700px) {
  .app-shell { padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .app-header { height: 52px; }
  .hero-copy { padding: 18px; }
  .scene-footer > span:last-child { display: none; }
  .play-stats .icon-button.small { width: 44px; height: 44px; }
}

/* Edge-to-edge game presentation, on phones and larger screens. */

body[data-ug-game] .app-shell { width:100%; max-width:none; padding:0; }
body[data-ug-game] .app-header { padding:4px max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left)); }
body[data-ug-game] .hero-card, body[data-ug-game] .scene-frame, body[data-ug-game] .target-panel { border:0; border-radius:0; box-shadow:none; }
body[data-ug-game] .hero-card { min-height:calc(100dvh - 64px); display:flex; justify-content:center; }
body[data-ug-game] .hero-art { display:none; }
body[data-ug-game]:has(#playScreen.active) .app-header { display:none; }
body[data-ug-game] .play-screen { padding:max(4px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left)); }
body[data-ug-game] .play-layout { height:calc(100dvh - 66px); min-height:0; gap:0; }
body[data-ug-game] .scene-frame { flex:1; min-height:0; }
