/* Embedded presentation only. The game keeps its normal page shell, even
 * during loading, camera travel or a GPU failure. No fullscreen body mode. */
/* One content edge for navigation and gameplay. Padding inside main would
 * otherwise indent the stadium and answers a second time. */
body.stadium-inline:has(.public-header) :is(.page-return,.solo-page,.site-footer) {
  width:calc(100% - 2 * var(--page-gutter)); max-width:var(--public-content-width);
  margin-inline:auto; padding-inline:0;
}
body.stadium-inline:has(.shootout-active) { overflow:hidden; }
body.stadium-inline .page-return { margin-top:8px; }
body.stadium-inline .page-return button { min-height:36px; padding:6px 14px; }
body.stadium-inline .solo-page { --game-space:12px; padding:var(--game-space) 0; }
body.stadium-inline .solo-heading { gap:12px; flex-wrap:nowrap; align-items:center; margin:0; padding:12px 0; }
/* Equal breathing room above and below the mode selector. */
body.stadium-inline:has(.public-header) .game-mode-tabs { margin-block:16px; }
body.stadium-inline .solo-heading h1 { font-size:26px; line-height:1.1; margin:0; }
body.stadium-inline .solo-heading .game-rules-link { min-height:36px; padding:6px 12px; font-size:12px; white-space:nowrap; }
body.stadium-inline .solo-heading .game-back { display:inline-flex; flex-direction:row; align-items:center; justify-content:center; gap:8px; min-height:36px; padding:6px 14px; font-size:12px; line-height:1.2; white-space:nowrap; }
body.stadium-inline .solo-heading .back-arrow { transform:rotate(180deg); width:18px; height:18px; }
body.stadium-inline .shootout-team :is(span,strong) { font-family:inherit; font-weight:700; }
body.stadium-inline .shootout-team > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.stadium-inline #notice:empty { display:none; }

/* These tracks are independent of question length and answer state. */
body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) {
  height:calc(100svh - var(--public-header-height)); max-height:900px; min-height:0;
  display:grid; grid-template-rows:minmax(154px,.90fr) minmax(282px,1fr); gap:var(--game-space);
}
/* Also hide navigation during the final kick, before results replace play. */
body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) > .solo-heading { display:none; }
body.stadium-inline #stadium-stage { min-width:0; min-height:0; height:min(320px,36svh); display:grid; grid-template-rows:auto minmax(0,1fr); }
body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) #stadium-stage { height:100%; }
body.stadium-inline #shootout-hud { position:static; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0; opacity:1; padding:0 0 8px; }
body.stadium-inline #shootout-hud:has(#shootout-board[hidden]):has(#leave[hidden]) { display:none; }
body.stadium-inline #shootout-board { border:0; background:transparent; padding:0; }
body.stadium-inline .shootout-team { min-height:24px; }
body.stadium-inline #shootout-round { margin-top:2px; }
body.stadium-inline .stadium-viewport { grid-row:2; position:relative; min-height:0; isolation:isolate; overflow:hidden; background:transparent; }
body.stadium-inline #stadium-layer { position:absolute; inset:0; width:100%; height:100%; }
body.stadium-inline #stadium-framing { position:absolute; inset:12px 20px; }
body.stadium-inline #stadium-controls { position:absolute; inset:auto 8px 8px auto; min-height:0; padding:0; border:0; background:none; }
body.stadium-inline #stadium-skip { min-height:36px; padding:6px 12px; font-size:12px; }
body.stadium-inline #stadium-outcome { position:absolute; top:8px; left:12px; padding:4px 10px; margin:0; font-size:16px; background:var(--bg); border-radius:4px; }
body.stadium-inline #stadium-unavailable { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:12px; margin:0; padding:12px; border:0; text-align:center; font-size:13px; }
body.stadium-inline #stadium-retry { min-height:44px; }
body.stadium-inline #stadium-error-detail { flex-basis:100%; font-size:11px; overflow-wrap:anywhere; }
body.stadium-inline #stadium-loading { position:absolute; inset:0; display:grid; place-items:center; margin:0; font-size:13px; color:var(--muted); pointer-events:none; }
body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) :is(.solo-penalty-layout,.solo-questions,#quiz-run) { min-height:0; height:100%; }
body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) .solo-penalty-layout { display:block; }
body.stadium-inline #question-panel { height:100%; min-height:0; display:grid; grid-template-rows:12px minmax(64px,1fr) 116px 44px; gap:10px; }
body.stadium-inline #question-panel > * { min-width:0; min-height:0; }
body.stadium-inline #question-panel .clock { margin:0; gap:8px; font-size:11px; }
body.stadium-inline #question-panel .clock[hidden] { display:flex!important; visibility:hidden; }
body.stadium-inline #question-title { margin:0; font-size:23px; line-height:1.3; align-self:stretch; display:flex; align-items:center; overflow-wrap:anywhere; }
body.stadium-inline #question-title:focus { outline:none; }
/* Answers and Continue share one fixed-size target. Keep the answer grid's
 * geometry while hidden, so neither the question nor the pointer target moves. */
body.stadium-inline #answer-slot { position:relative; display:grid; min-width:0; min-height:0; }
body.stadium-inline #answer-slot.is-continuing #choices { visibility:hidden; pointer-events:none; }
body.stadium-inline #answer-slot #next { position:absolute; inset:0; width:100%; height:100%; min-height:0; margin:0; padding:12px; --control-radius:6px; font-size:20px; line-height:1.25; text-align:center; justify-content:center; }
body.stadium-inline #choices { margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:1fr; gap:8px; }
body.stadium-inline #choices button { min-height:0; height:100%; padding:10px 14px; font-size:15px; line-height:1.25; }
body.stadium-inline #question-panel > .actions { display:flex; align-items:stretch; justify-content:flex-start; flex-wrap:nowrap; gap:8px; margin:0; }
body.stadium-inline #question-panel > .actions button { height:44px; padding:8px 20px; font-size:14px; }
body.stadium-inline #question-panel > .feedback-slot { display:none; }
body.stadium-inline [data-mode="friend"] #question-panel { grid-template-rows:12px minmax(64px,1fr) 116px 68px; }
body.stadium-inline [data-mode="friend"] #question-panel > .feedback-slot { display:flex; align-items:center; min-height:0; }
body.stadium-inline [data-mode="friend"] #question-panel > .actions:not(:has(#retry:not([hidden]))) { display:none; }
body.stadium-inline [data-mode="friend"] #question-panel:has(#retry:not([hidden])) { grid-template-rows:12px minmax(44px,1fr) 100px 60px 44px; }
body.stadium-inline :is(.shootout-active,.shootout-finished) > :is(#notice,#error):not(:empty) { position:fixed; z-index:8; top:70px; left:50%; transform:translateX(-50%); width:min(680px,calc(100% - 24px)); margin:0; padding:8px 12px; background:var(--surface); }
body.stadium-inline:has(:is(.shootout-active,.shootout-finished)) .site-footer,
body.stadium-inline .shootout-active .ad-gameplay { display:none; }

/* Outro stays inside the same stage. Results crossfade in its place without
 * turning the site black or replacing the navigation. */
body.stadium-inline:has(.shootout-finished) > .public-header { display:flex; }
body.stadium-inline .shootout-finished { position:relative; }
body.stadium-inline:has(.shootout-finished #question-panel:not([hidden])) .page-return { display:flex; }
body.stadium-inline .shootout-finished:has(#question-panel[hidden]) > .solo-heading { display:none; }
body.stadium-inline .shootout-finished:has(#question-panel[hidden]) #stadium-stage:not([hidden]) { position:fixed; z-index:4; inset:var(--stadium-result-top) auto auto var(--stadium-result-left); width:var(--stadium-result-width); height:var(--stadium-result-height); opacity:calc(1 - var(--stadium-result,0)); pointer-events:none; }
body.stadium-inline #stadium-stage[data-ending] :is(#shootout-hud,#stadium-controls,#stadium-outcome) { display:none; }
body.stadium-inline #stadium-stage[data-ending] { grid-template-rows:minmax(0,1fr); }
body.stadium-inline #stadium-stage[data-ending] .stadium-viewport { grid-row:1; }
body.stadium-inline .shootout-finished .solo-questions { position:static; width:100%; height:auto; max-height:none; padding:0; border:0!important; background:transparent; transform:none; overflow:visible; }
body.stadium-inline .shootout-finished:has(#question-panel[hidden]):has(#stadium-stage:not([hidden])) .solo-questions { opacity:var(--stadium-result,0); }
body.stadium-inline .shootout-finished #summary { padding:12px 0; border:0; background:transparent; }

@media(max-width:800px) {
  body.stadium-inline .page-return { margin-block:6px 0; }
  body.stadium-inline .solo-page { --game-space:8px; }
  body.stadium-inline .solo-heading h1 { font-size:22px; }
  body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) { grid-template-rows:minmax(120px,.80fr) minmax(256px,1fr); }
  body.stadium-inline #shootout-hud { gap:8px; padding-bottom:6px; }
  body.stadium-inline #shootout-hud #leave { padding:8px 12px; }
  body.stadium-inline #stadium-framing { inset:6px 10px; }
  body.stadium-inline #question-panel { grid-template-rows:10px minmax(76px,1fr) 100px 44px; gap:6px; }
  body.stadium-inline #question-title { font-size:18px; line-height:1.25; }
  body.stadium-inline #choices { gap:6px; }
  body.stadium-inline #choices button { padding:8px; font-size:13px; }
  body.stadium-inline [data-mode="friend"] #question-panel { grid-template-rows:10px minmax(68px,1fr) 100px 60px; }
  body.stadium-inline .shootout-finished #summary { padding:4px 0; }
}
@media(max-width:360px) {
  body.stadium-inline .solo-heading h1 { font-size:18px; }
}
/* Short phones need an actual pitch window, not a cropped strip. Reclaim
 * vertical padding before shrinking the question's text or touch targets. */
@media(max-width:599px) and (max-height:650px) {
  body.stadium-inline .page-return { margin-top:4px; }
  body.stadium-inline .solo-page { --game-space:6px; }
  body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) { grid-template-rows:minmax(156px,.8fr) minmax(220px,1fr); }
  body.stadium-inline .shootout-team { min-height:20px; }
  body.stadium-inline #shootout-round { font-size:11px; line-height:12px; }
  body.stadium-inline #question-panel { grid-template-rows:8px minmax(44px,1fr) 88px 44px; }
  body.stadium-inline #question-title { font-size:16px; }
  body.stadium-inline #choices button { font-size:12px; padding:6px; }
  body.stadium-inline [data-mode="friend"] #question-panel { grid-template-rows:8px minmax(44px,1fr) 88px 60px; }
}
/* Landscape uses two stable columns rather than shrinking touch targets. */
@media(min-width:600px) and (max-height:600px) {
  body.stadium-inline .page-return { margin-top:4px; }
  body.stadium-inline :is(.shootout-active,.shootout-finished:has(#question-panel:not([hidden]))) { grid-template-columns:minmax(0,1fr) minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:8px 16px; }
  body.stadium-inline #question-panel { grid-template-rows:6px minmax(40px,1fr) 92px 44px; gap:4px; }
  body.stadium-inline #question-title { font-size:17px; }
  body.stadium-inline #choices button { font-size:12px; padding:6px; }
  body.stadium-inline [data-mode="friend"] #question-panel { grid-template-rows:6px minmax(40px,1fr) 92px 48px; }
  body.stadium-inline [data-mode="friend"] .friend-response-time { font-size:16px; }
}
