/* tower-of-hanoi · fullscreen. Paired with fullscreen-fit.js (sets --fs-side on <html>, toggles .fs-wide on
   the stage). Only inside the game-shell Full screen (html:is(.pip-immersive,.pip-native)). The pegs grow with the board. */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage #card-grid { width: var(--fs-side, min(92vw, 56vh)); margin: 6px auto; --toh-peg-h: max(150px, calc(var(--fs-side, 340px) * .62)); }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-peg { height: var(--toh-peg-h); }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-peg::before { height: calc(var(--toh-peg-h) - 40px); }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-disc { height: max(18px, calc(var(--toh-peg-h) * .078)) !important; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-howto { font-size: .76rem; margin: 2px 0; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-chips { margin: 2px 0; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .btn-row { margin: 4px 0; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage.fs-wide {
  display: grid;
  grid-template-columns: var(--fs-side) minmax(0, 260px);
  grid-template-rows: repeat(12, auto) 1fr;
  column-gap: 20px;
  justify-content: center;
  align-content: center;
}
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage.fs-wide > * { grid-column: 2; min-width: 0; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage.fs-wide > #card-grid { grid-column: 1; grid-row: 1 / -1; align-self: center; margin: 0; }
@media (max-height: 460px) {
  html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-howto, html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .facts { display: none; }
}
/* the shell hides .btn-row in fullscreen; Undo and Hint are real controls here, so keep them */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > .btn-row { display: flex; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-howto { display: none; }
/* short landscape: drop the secondary rows (chips, rehearsal panel) so the play column fits */
@media (max-height: 460px) {
  html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-chips, html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .toh-rehearsal { display: none; }
}
/* full screen: keep controls clear of the notch and home bar, and nothing scrolls */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); padding-bottom: max(8px, env(safe-area-inset-bottom)); overflow: hidden; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .btn { min-height: 44px; }
html:is(.pip-immersive,.pip-native) .hub-bar, html:is(.pip-immersive,.pip-native) .playyard-ad, html:is(.pip-immersive,.pip-native) .below-content { display: none; }
