/* element-quiz · fullscreen. Paired with fullscreen-fit.js (toggles .fs-wide on the stage when the screen is
   wide). Only inside the game-shell Full screen (html.pip-immersive). */
html.pip-immersive .game-wrap.pip-stage .hud { margin: 4px 0; }
html.pip-immersive .game-wrap.pip-stage #card-grid { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
html.pip-immersive .game-wrap.pip-stage .hud, html.pip-immersive .game-wrap.pip-stage #status { max-width: 640px; margin-left: auto; margin-right: auto; }
html.pip-immersive .game-wrap.pip-stage.fs-wide #card-grid, html.pip-immersive .game-wrap.pip-stage.fs-wide .hud, html.pip-immersive .game-wrap.pip-stage.fs-wide #status { max-width: 860px; }
html.pip-immersive .game-wrap.pip-stage.fs-wide .qcard {
  display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr); column-gap: 18px;
  grid-template-areas: "top top" "bar bar" "tile opts" "hint opts"; align-items: center;
}
html.pip-immersive .game-wrap.pip-stage.fs-wide .qtop { grid-area: top; }
html.pip-immersive .game-wrap.pip-stage.fs-wide .tbar { grid-area: bar; }
html.pip-immersive .game-wrap.pip-stage.fs-wide .tile { grid-area: tile; }
html.pip-immersive .game-wrap.pip-stage.fs-wide .qhint { grid-area: hint; }
html.pip-immersive .game-wrap.pip-stage.fs-wide .opts { grid-area: opts; }
@media (max-height: 740px) {
  html.pip-immersive .game-wrap.pip-stage .tile:not(.wide) { width: 92px; height: 92px; }
  html.pip-immersive .game-wrap.pip-stage .tile .big { font-size: 2.7rem; }
  html.pip-immersive .game-wrap.pip-stage .tile.wide { height: 76px; }
  html.pip-immersive .game-wrap.pip-stage .qcard { padding-top: .6rem; padding-bottom: .7rem; }
  html.pip-immersive .game-wrap.pip-stage .qhint { margin: .25rem 0 .3rem; }
  html.pip-immersive .game-wrap.pip-stage .opt { min-height: 44px; margin: .25rem 0; padding-top: .45rem; padding-bottom: .45rem; }
  html.pip-immersive .game-wrap.pip-stage .opts.grid .opt { min-height: 50px; }
}
@media (max-height: 460px) {
  html.pip-immersive .game-wrap.pip-stage .tile:not(.wide) { width: 76px; height: 76px; }
  html.pip-immersive .game-wrap.pip-stage .tile .big { font-size: 2.1rem; }
  html.pip-immersive .game-wrap.pip-stage .tile .cat, html.pip-immersive .game-wrap.pip-stage .tile .num { display: none; }
  html.pip-immersive .game-wrap.pip-stage .setup .how { display: none; }
}
/* pass 3: touch targets, setup fit, depth */
html.pip-immersive .game-wrap.pip-stage .btn, html.pip-immersive .game-wrap.pip-stage .seg button { min-height: 44px; }
html.pip-immersive .game-wrap.pip-stage { padding-bottom: max(.6rem, env(safe-area-inset-bottom, 0px)); }
html.pip-immersive .game-wrap.pip-stage {
  background-color: #ecfdf5;
  background-image: radial-gradient(circle at 18% 12%, rgb(5 150 105 / .16), transparent 46%), radial-gradient(circle at 88% 92%, rgb(14 116 144 / .14), transparent 50%),
    linear-gradient(rgb(15 23 42 / .035) 1px, transparent 1px), linear-gradient(90deg, rgb(15 23 42 / .035) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}
@media (max-height: 800px) { html.pip-immersive .game-wrap.pip-stage .setup .how { display: none; } html.pip-immersive .game-wrap.pip-stage .setup { padding: .7rem; } }
html.pip-immersive .game-wrap.pip-stage .tile:not(.wide)::before {
  content: ""; position: absolute; inset: 3px 3px 55% 3px; border-radius: 10px; pointer-events: none;
  background: linear-gradient(rgb(255 255 255 / .38), rgb(255 255 255 / 0));
}
/* pass 4: the stage never scrolls. Title, facts and the extra link row are hidden; the board scrolls on its own if a menu is taller. */
html.pip-immersive .game-wrap.pip-stage .game-title,
html.pip-immersive .game-wrap.pip-stage .facts,
html.pip-immersive .game-wrap.pip-stage .pip-actions { display: none; }
html.pip-immersive .game-wrap.pip-stage { display: flex; flex-direction: column; overflow: hidden; }
html.pip-immersive .game-wrap.pip-stage #card-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html.pip-immersive .game-wrap.pip-stage .hud, html.pip-immersive .game-wrap.pip-stage #status { flex: 0 0 auto; }
@media (orientation: landscape) and (max-height: 520px) {
  html.pip-immersive .game-wrap.pip-stage { padding-top: 4px; padding-bottom: max(4px, env(safe-area-inset-bottom, 0px)); }
  html.pip-immersive .game-wrap.pip-stage .hud { margin: 2px auto; }
  html.pip-immersive .game-wrap.pip-stage #status { min-height: 0; margin: 0 auto; }
  html.pip-immersive .game-wrap.pip-stage .qcard { padding-top: .35rem; padding-bottom: .4rem; }
  html.pip-immersive .game-wrap.pip-stage .qtop { margin-bottom: .25rem; }
  html.pip-immersive .game-wrap.pip-stage .tbar { margin-bottom: .35rem; }
  html.pip-immersive .game-wrap.pip-stage .opt { margin: .15rem 0; }
}
