/* tower-stack - fullscreen: paired with js/fullscreen-fit.js (sets --fs-w).
   Only applies while the game-shell Full screen is on (html.pip-immersive). */
html.pip-immersive .game-viewport {
  box-sizing: border-box;
  height: var(--pip-vvh, 100dvh) !important;
  max-width: none !important;
  background: radial-gradient(120% 90% at 50% 0%, #1b1f4a 0%, #0b1022 70%);
}
html.pip-immersive .arena-wrap {
  flex: 0 0 auto;
  width: var(--fs-w, 100%);
  max-width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08), 0 20px 60px rgb(0 0 0 / .5);
}
html.pip-immersive .hub-bar,
html.pip-immersive .playyard-ad { display: none; }

/* pass 3: landscape and short stages. The base arena has min-height 480px, which
   clipped the canvas when the stage is only ~340px tall (phone on its side). */
html.pip-immersive .arena-wrap { min-height: 0; }
html.pip-immersive .below-content,
html.pip-immersive .bottom-ad-section,
html.pip-immersive .similar-games { display: none; }
html.pip-immersive .game-hud {
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
}
@media (orientation: landscape) and (max-height: 500px) {
  html.pip-immersive .hud-score-box,
  html.pip-immersive .hud-best-box { transform: scale(.85); transform-origin: top center; }
}

/* landscape: the arena takes the whole stage (fit script sets --fs-w to the viewport width),
   and the results sheet becomes a compact card so both buttons stay on screen. */
@media (orientation: landscape) and (max-height: 500px) {
  html.pip-immersive .game-overlay { padding: 8px; }
  html.pip-immersive .overlay-card { max-width: 520px; padding: 10px 16px; border-radius: 16px; }
  html.pip-immersive .overlay-kicker,
  html.pip-immersive .overlay-note,
  html.pip-immersive .overlay-ad,
  html.pip-immersive .stat-box .stat-label { display: none; }
  html.pip-immersive .overlay-title { font-size: 1.3rem; margin: 0 0 6px; }
  html.pip-immersive .overlay-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
  html.pip-immersive .stat-box.stat-primary { grid-column: auto; }
  html.pip-immersive .overlay-actions { flex-direction: row; gap: 8px; margin-top: 0; }
  html.pip-immersive .overlay-actions > * { flex: 1; min-height: 44px; }
  html.pip-immersive .game-overlay[hidden] { display: none; }
}
