/* Play mode (docs/done-specs/20261011-game-play-mode.md), with /js/play-mode.js: on a phone, either way up, a
   game card (.stage-card) opens fixed over the whole screen. Link it after the game's own stylesheet.
   Markup:
   - .play-start [data-play-open]: the Start overlay over the board (a <button> filling its positioned
     container, holding a .btn); the game shows and labels it.
   - .play-close [data-play-close]: the ✕ button in the game's bar.
   - [data-play-preview]: the board, a preview in the page (inert, set by play-mode.js; scrolls with
     the page here).
   - [data-play="page"]: page-level choices, hidden in play mode. [data-play="mode"]: play mode only.
   Each game sets its card's rows and its board's size under .is-play-mode.
   For design review: the Start overlay, the ✕ button, the card's square edges when it fills the screen. */

.play-start {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.play-start[hidden] { display: none; }
.play-start:focus-visible { outline: none; }
.play-start:focus-visible .btn { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 2px var(--wall); }

.stage-card:not(.is-play-mode) [data-play="mode"] { display: none; }
.play-close { margin-left: auto; }
html:has(.is-play-mode) { overflow: hidden; }

/* PAGE_QUERY in play-mode.js, inverted: below it the game plays in play mode */
@media (max-width: 719px), (max-height: 599px) {
  .stage-card:not(.is-play-mode) [data-play-preview] { pointer-events: none; touch-action: auto; }
  .is-play-mode [data-play="page"] { display: none; }

  .stage-card.is-play-mode {
    position: fixed; inset: 0; z-index: 40; width: auto; max-width: none; margin: 0; border-radius: 0;
    display: grid; align-content: stretch; gap: var(--s2);
    padding: max(var(--s2), env(safe-area-inset-top)) max(var(--s2), env(safe-area-inset-right))
      max(var(--s2), env(safe-area-inset-bottom)) max(var(--s2), env(safe-area-inset-left));
    overflow-y: auto; overscroll-behavior: none;
  }
}
