/* word-scramble fullscreen (html.pip-immersive only). The play column (HUD, status, #ws-game, how-to) is
   scaled with CSS zoom by the fit code in hd.js: --fs-zoom, --fs-base. Leaving fullscreen clears both. */
html.pip-immersive .game-wrap.pip-stage > .hud,
html.pip-immersive .game-wrap.pip-stage > #status,
html.pip-immersive .game-wrap.pip-stage > #ws-game,
html.pip-immersive .game-wrap.pip-stage > .ws-howto {
  zoom: var(--fs-zoom, 1); width: 100%; max-width: var(--fs-base, 460px); margin-left: auto; margin-right: auto; box-sizing: border-box;
}
html.pip-immersive .game-wrap.pip-stage > .hud { padding-block: .1rem; }
html.pip-immersive .game-wrap.pip-stage > #status { min-height: 1.3em; margin: .15rem auto; }
html.pip-immersive .game-wrap.pip-stage > .ws-howto,
html.pip-immersive .game-wrap.pip-stage > .ws-about,
html.pip-immersive .game-wrap.pip-stage > #ws-rehearsal { display: none; }

/* native Fullscreen API (Android Chrome): same fit as immersive, stage is the fullscreen element */
html.pip-native .game-wrap.pip-stage { background: #f8fafc; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: max(.5rem, env(safe-area-inset-top)) max(.5rem, env(safe-area-inset-right)) max(.5rem, env(safe-area-inset-bottom)) max(.5rem, env(safe-area-inset-left)); max-width: none; margin: 0; width: 100%; height: 100%; }
html.pip-native .game-wrap.pip-stage > .game-title,
html.pip-native .game-wrap.pip-stage > .facts,
html.pip-native .game-wrap.pip-stage > .btn-row { display: none; }
html.pip-native .game-wrap.pip-stage > .hud,
html.pip-native .game-wrap.pip-stage > #status,
html.pip-native .game-wrap.pip-stage > #ws-game,
html.pip-native .game-wrap.pip-stage > .ws-howto {
  zoom: var(--fs-zoom, 1); width: 100%; max-width: var(--fs-base, 460px); margin-left: auto; margin-right: auto; box-sizing: border-box;
}
html.pip-native .game-wrap.pip-stage > .ws-howto,
html.pip-native .game-wrap.pip-stage > .ws-about,
html.pip-native .game-wrap.pip-stage > #ws-rehearsal { display: none; }

/* fill the free height: hd.js sets --fs-gh (px, in zoomed units). Play area is a flex column, spread out. */
html.pip-immersive .game-wrap.pip-stage > #ws-game,
html.pip-native .game-wrap.pip-stage > #ws-game { min-height: var(--fs-gh, 340px); display: flex; flex-direction: column; justify-content: space-evenly; box-sizing: border-box; }
html.pip-immersive .game-wrap.pip-stage > #ws-game > .ws-tools,
html.pip-native .game-wrap.pip-stage > #ws-game > .ws-tools { margin-top: 0; }
html.pip-immersive .game-wrap.pip-stage > #ws-game > .ws-tools .ws-tool,
html.pip-native .game-wrap.pip-stage > #ws-game > .ws-tools .ws-tool { min-height: 48px; }
html.pip-immersive .ws-panel[hidden], html.pip-native .ws-panel[hidden] { display: none; }

/* landscape: letters left, tool buttons in a column on the right */
@media (orientation: landscape) {
  html.pip-immersive .game-wrap.pip-stage > #ws-game,
  html.pip-native .game-wrap.pip-stage > #ws-game { display: grid; grid-template-columns: minmax(0, 1fr) 140px; grid-template-rows: auto auto 1fr 1fr; column-gap: 14px; align-items: center; justify-content: stretch; }
  html.pip-immersive #ws-game > .ws-bar, html.pip-native #ws-game > .ws-bar { grid-column: 1; grid-row: 1; }
  html.pip-immersive #ws-game > .ws-time, html.pip-native #ws-game > .ws-time { grid-column: 1; grid-row: 2; margin-bottom: 4px; }
  html.pip-immersive #ws-game > .ws-slots, html.pip-native #ws-game > .ws-slots { grid-column: 1; grid-row: 3; margin: 0; }
  html.pip-immersive #ws-game > .ws-tray, html.pip-native #ws-game > .ws-tray { grid-column: 1; grid-row: 4; }
  html.pip-immersive #ws-game > .ws-tools, html.pip-native #ws-game > .ws-tools { grid-column: 2; grid-row: 1 / span 4; grid-template-columns: 1fr; align-content: center; gap: 10px; }
  html.pip-immersive #ws-game > .ws-tools .ws-tool, html.pip-native #ws-game > .ws-tools .ws-tool { min-height: 56px; }
}
