/* bubble-wrap · fullscreen. Scoped to html.pip-immersive / html.pip-native; normal play is untouched.
   Portrait: controls on top, the sheet fills the rest. Landscape: controls in a left column, sheet on the right.
   index.html's layout()/fitGrid() pick columns and size the sheet to the board box. */
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage {
  display: flex; flex-direction: column; align-items: stretch; max-width: none; margin: 0; overflow: hidden;
  padding: 6px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > * { flex: none; min-width: 0; }
html:is(.pip-immersive,.pip-native) .game-title, html:is(.pip-immersive,.pip-native) .facts,
html:is(.pip-immersive,.pip-native) .bw-how, html:is(.pip-immersive,.pip-native) .bw-daily,
html:is(.pip-immersive,.pip-native) .bw-studio, html:is(.pip-immersive,.pip-native) .pip-actions { display: none; }
html:is(.pip-immersive,.pip-native) .bw-modes { margin: 0; justify-content: center; }
html:is(.pip-immersive,.pip-native) .hud { padding: 4px 0; }
html:is(.pip-immersive,.pip-native) .hud .btn { min-height: 44px; min-width: 44px; }
html:is(.pip-immersive,.pip-native) #bw-timer { margin: 2px 0; }
html:is(.pip-immersive,.pip-native) #status { margin: 2px 0; min-height: 1.3em; font-size: 1rem; }
html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > #board-wrap {
  flex: 1 1 0; min-height: 0; width: 100%; margin: 0; display: grid; place-items: center; overflow: hidden; box-sizing: border-box;
}
html:is(.pip-immersive,.pip-native) #card-grid { margin: 0 !important; max-width: 100%; max-height: 100%; box-sizing: border-box; }
html:is(.pip-immersive,.pip-native) #win-overlay { max-height: 100%; overflow: auto; }
html:is(.pip-immersive,.pip-native) #win-overlay[hidden] { display: none; }
@media (orientation: landscape) {
  html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage {
    display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); column-gap: 14px;
    grid-template-rows: repeat(4, min-content) minmax(0, 1fr); align-content: start;
  }
  html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > * { grid-column: 1; }
  html:is(.pip-immersive,.pip-native) .bw-modes { grid-row: 1; flex-direction: column; align-items: stretch; gap: 6px; }
  html:is(.pip-immersive,.pip-native) .hud { grid-row: 2; }
  html:is(.pip-immersive,.pip-native) #bw-timer { grid-row: 3; }
  html:is(.pip-immersive,.pip-native) #status { grid-row: 4; }
  html:is(.pip-immersive,.pip-native) .game-wrap.pip-stage > #board-wrap { grid-column: 2; grid-row: 1 / -1; height: 100%; }
}
