/* onescreen.css: the one-screen rules for games on an old kit (1, 2, 4), ported by tools/port_onescreen.mjs (P1FS05).
 * A full kit sync broke even-water, so old games get only this block: the kit-18 result sheet pinned inside the
 * screen with Next first, one row of controls, and the kit-20 touch rules. kit/onescreen.js sets data-pl-screen. */
/* Kit 18: one screen (P1FS01, Chen 2026-10-24). During play the page is never taller than the phone: the board takes
 * what is left after the rule, the message and ONE row of controls (the 20 px Accessible Play sizes are kept; the room
 * comes from layout, never from smaller text). The win / end card is a sheet pinned to the bottom of the screen with
 * the primary button (Next level / Play again) first, so it is visible without scrolling; Share and the rest follow
 * inside the sheet, which scrolls by itself when it is long. A game restyles the sheet through game.css. */
:root[data-pl-screen="play"] .app, :root[data-pl-screen="result"] .app { padding-bottom: 0; }
/* no accidental zoom or bounce while playing (double taps are moves in many games; P1TE07) */
html { touch-action: manipulation; overscroll-behavior: none; }
.controls { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
:root[data-pl-screen="result"] .result-card {
  position: fixed; z-index: 30; left: 50%; bottom: 0; width: min(100%, 430px); transform: translateX(-50%);
  display: flex; flex-direction: column; max-height: min(62dvh, calc(100dvh - 72px)); overflow-y: auto; overscroll-behavior: contain;
  margin: 0; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); background: var(--t-board);
  border: 2px solid var(--t-ink); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: 0 -8px 28px rgb(0 0 0 / .18);
}
:root[data-pl-screen="result"] .result-card[hidden] { display: none; }
:root[data-pl-screen="result"] .result-title { order: 0; }
:root[data-pl-screen="result"] .result-marks { order: 1; margin: 2px 0 10px; }
:root[data-pl-screen="result"] .result-actions { order: 2; }
:root[data-pl-screen="result"] .share-line { order: 3; margin: 10px 0 0; }
:root[data-pl-screen="result"] .result-card > :not(.result-title):not(.result-marks):not(.result-actions):not(.share-line) { order: 4; }
.result-actions #next-button:not([hidden]), .result-actions .primary:not([hidden]) { flex: 1 1 100%; order: -1; }
:root[data-pl-screen="result"] .controls { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  :root:not(.reduced-motion)[data-pl-screen="result"] .result-card { animation: pl-sheet-up .22s ease-out; }
}
@keyframes pl-sheet-up { from { transform: translate(-50%, 24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Kit 20 touch rules: the board wrapper pans; sheets scroll inside themselves. */
.board-shell, [data-pl="board"] { touch-action: pan-y; }
[data-pl="sheet"], [data-pl="textboard"], .pl-sheet { overscroll-behavior: contain; overflow-y: auto; }
