/* ambient-rain · fullscreen — paired with fullscreen-fit.js (--fs-hero-h / --fs-hero-w, html.fs-wide).
   Everything is scoped under html:is(.pip-immersive,.pip-native): normal play is untouched. */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage {
  display: flex; flex-direction: column; align-items: center;
  padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > * { width: min(100%, 560px); flex: none; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > :is(#ar-hero,#stage) {
  width: 100%; max-width: 760px; height: var(--fs-hero-h, 320px); margin: 0; container-type: size; box-sizing: border-box;
}
/* Landscape: hero on the left at full height, the rest in a right-hand column. */
html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage {
  display: grid; grid-template-columns: var(--fs-hero-w, 55%) minmax(0, 440px); column-gap: 16px;
  grid-auto-rows: min-content; align-content: start; justify-content: center; align-items: start; overflow-y: auto;
}
html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage > * { width: auto; grid-column: 2; min-width: 0; }
html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage > :is(#ar-hero,#stage) { grid-column: 1; grid-row: 1 / span 14; max-width: none; height: var(--fs-hero-h, 320px); position: sticky; top: 0; }
html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage > .pip-dock { grid-column: 1 / -1; }
html:is(.pip-immersive,.pip-native) .howto, html:is(.pip-immersive,.pip-native) .facts { display: none; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage #stage { max-width: none; margin: 0; }
html:is(.pip-immersive,.pip-native):not(.ar-hd) .game-wrap.pip-stage #game-canvas { height: 100% !important; width: 100% !important; }
html:is(.pip-immersive,.pip-native):not(.ar-hd) .game-wrap.pip-stage > #stage { height: var(--fs-hero-h, 320px); }
html:is(.pip-immersive,.pip-native).ar-hd #ar-hero { overflow: hidden; border-radius: 12px; }
html:is(.pip-immersive,.pip-native).ar-hd #ar-hero > #stage { width: var(--ar-w, 100%); transform-origin: 0 0; scale: var(--ar-k, 1); }
/* Full screen, phone fit: nothing but the rain window and the few controls the session needs. */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > :is(.game-title,.rain-grounding,.pip-actions,.ad-well,.article-section) { display: none; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .hud { min-height: 44px; margin: 0 0 4px; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage .hud .btn { min-width: 44px; min-height: 44px; }
/* The stage is drawn on a 500 unit tall design and scaled by --ar-k, so size touch targets in design units. */
html:is(.pip-immersive,.pip-native) #stage .seg button,
html:is(.pip-immersive,.pip-native) #stage #overlay .btn { min-height: max(44px, calc(44px / var(--ar-k, 1))); }
html:is(.pip-immersive,.pip-native) #stage #overlay .btn { min-width: max(44px, calc(44px / var(--ar-k, 1))); }
html:is(.pip-immersive,.pip-native) #stage #snd-btn { min-width: max(44px, calc(44px / var(--ar-k, 1))); min-height: max(44px, calc(44px / var(--ar-k, 1))); }
html:is(.pip-immersive,.pip-native) #stage #overlay { padding: .5rem; }
html:is(.pip-immersive,.pip-native) #stage #overlay .ov-card { max-width: 380px; }
html:is(.pip-immersive,.pip-native) #stage #overlay .seg-label { margin: .3rem 0 .2rem; }
html:is(.pip-immersive,.pip-native) #stage #overlay p { margin-bottom: .4rem; }
html:is(.pip-immersive,.pip-native) #stage #overlay [hidden] { display: none; }
@media (orientation: landscape) {
  html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage { grid-template-columns: minmax(0, 1fr) minmax(0, 190px); column-gap: 12px; overflow-y: hidden; }
  html:is(.pip-immersive,.pip-native).fs-wide .game-wrap.pip-stage > :is(#ar-hero,#stage) { width: 100%; }
  html:is(.pip-immersive,.pip-native).fs-wide #stage #setup-stats,
  html:is(.pip-immersive,.pip-native).fs-wide #stage #setup-rank { display: none; }
}
