/* 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) {
  .home-layout { gap: 0; }
  .home-description { margin-bottom: 12px; }
  .home-copy h1 { font-size: clamp(38px, 10vw, 60px); }
}

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

body[data-ug-game] #play { width:100%; max-width:none; height:100dvh; min-height:0; padding:0; gap:0; grid-template-columns:1fr; display:flex; }
body[data-ug-game] .play-aside, body[data-ug-game] .right-aside { display:none; }
body[data-ug-game] .game-shell { width:100%; max-width:none; max-height:none; height:100%; border:0; border-radius:0; box-shadow:none; padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
body[data-ug-game] .home { min-height:100dvh; }
body[data-ug-game] .home-layout { display:flex; justify-content:center; }
body[data-ug-game] .orbit-art, body[data-ug-game] .home-footer { display:none; }
