/* fullscreen - paired with fullscreen-fit.js. Applies only while the shell's Full screen is on
   (html.pip-immersive); normal play is untouched. Classes and variables come from the script.
   !important only where a game's own #id rule would otherwise win. */
html.pip-immersive .pip-stage.fs-on { display: flex; flex-direction: column; align-items: center; }
html.pip-immersive .pip-stage.fs-on > .fs-hide { display: none !important; }
html.pip-immersive .pip-stage.fs-on > .fs-side { width: min(100%, 520px); box-sizing: border-box; flex: none; }
html.pip-immersive .pip-stage.fs-on > .fs-board {
  flex: none;
  width: var(--fs-bw, max-content) !important;
  max-width: none !important;
  transform-origin: 0 0;
  transform: scale(var(--fs-s, 1));
  margin: 0 calc((var(--fs-s, 1) - 1) * var(--fs-nw, 0px)) calc((var(--fs-s, 1) - 1) * var(--fs-nh, 0px)) 0 !important;
}
html.pip-immersive .pip-stage.fs-on.fs-wide {
  display: grid;
  grid-template-columns: max-content minmax(0, var(--fs-sidew, 360px));
  grid-template-rows: repeat(var(--fs-n, 6), min-content) 1fr;
  column-gap: 24px;
  justify-content: center;
  align-content: start;
  align-items: start;
}
html.pip-immersive .pip-stage.fs-on.fs-wide > .fs-board { grid-column: 1; grid-row: 1 / -1; }
html.pip-immersive .pip-stage.fs-on.fs-wide > .fs-side { grid-column: 2; width: auto; }

/* HD overlay layers that are siblings of a canvas board scale with it */
html.pip-immersive .pip-stage.fs-on > .fs-follow { transform-origin: 0 0; transform: scale(var(--fs-s, 1)); margin: 0 !important; }

/* Spring Launch: full screen finish. Applies only inside html.pip-immersive (iPhone and Android). */
html.pip-immersive .pip-stage.fs-on { justify-content: center; background: linear-gradient(#0f172a, #0b1220); gap: 6px; }
html.pip-immersive .pip-stage.fs-on.fs-wide { align-content: center; }
html.pip-immersive .pip-stage.fs-on .hud { display: flex; align-items: center; justify-content: center; gap: 12px; }
html.pip-immersive .pip-stage.fs-on .hud .btn,
html.pip-immersive .pip-stage.fs-on .sl-over .btn { min-height: 44px; min-width: 44px; padding: 0 18px; }
html.pip-immersive .pip-stage.fs-on #status { color: #e2e8f0; min-height: 1.2em; text-align: center; }
html.pip-immersive .pip-stage.fs-on #game-canvas { box-shadow: 0 10px 30px rgba(0,0,0,.45); border-radius: 12px; }
@media (orientation: landscape) and (max-height: 520px) {
  html.pip-immersive .pip-stage.fs-on .hud { flex-direction: column; align-items: stretch; }
}
