/* ============================================================
   iPad layout — 7 Nov 2026
   Applies only on tablet-sized screens (744px wide and up, 600px tall and up);
   the iPhone layout is untouched.
   - The cake stays in a centre column; the two side "wings" are kept empty
     and reserved for future graphics (.stage-wing, see index.html).
   - Everything in the round is bigger and louder: larger text and buttons,
     a stronger glow on the active team, a pulsing spotlight behind the cake.
   ============================================================ */

.stage-wing { display: none; }

@media (min-width: 744px) and (min-height: 600px) {

  /* ---------- the centre column (the whole round is drawn in --u units of it) ---------- */
  body.round-ui {
    /* portrait: about two thirds of the width; landscape: limited by the height */
    --fw: min(58vw, calc(100dvh * 0.5628));
    --wing: calc((100vw - var(--fw)) / 2);
  }
  @media (orientation: landscape) {
    body.round-ui { --fw: min(44vw, calc(100dvh * 0.5628)); }
  }

  /* ---------- side wings: empty, reserved for future graphics ---------- */
  body.round-ui .stage-wing {
    display: block; position: fixed; z-index: 0; pointer-events: none;
    top: calc(var(--st) + 3vh); bottom: calc(var(--sb) + 3vh);
    width: calc(var(--wing) - 3vw);
  }
  body.round-ui .stage-wing.wing-right { right: 1.5vw; }
  body.round-ui .stage-wing.wing-left { left: 1.5vw; }
  /* a soft glow so the empty wings feel like part of the stage, not dead space */
  body.round-ui .stage-wing::before {
    content: ""; position: absolute; inset: 18% 8% 22%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 205, 110, .45), rgba(255, 205, 110, 0));
    animation: wing-breathe 5.5s ease-in-out infinite;
  }
  body.round-ui .stage-wing.wing-left::before { animation-delay: -2.7s; }
  @keyframes wing-breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }

  /* ---------- spotlight behind the cake ---------- */
  body.round-ui #theater-stage::before {
    content: ""; display: block !important; position: absolute; z-index: -1; pointer-events: none;
    left: 50%; top: 46%; width: 125%; aspect-ratio: 1; transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 226, 150, .75), rgba(255, 205, 110, .28) 55%, rgba(255, 205, 110, 0));
    animation: stage-pulse 3.4s ease-in-out infinite;
  }
  @keyframes stage-pulse { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.97); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } }
  body.round-ui .round-cake { filter: drop-shadow(0 calc(2 * var(--u)) calc(5 * var(--u)) rgba(120, 70, 10, .35)); }
  body.round-ui .level-candle { filter: drop-shadow(0 0 calc(3.5 * var(--u)) rgba(255, 190, 80, .8)); }

  /* ---------- team bar: wider than the column, bigger type ---------- */
  body.round-ui .game-scoreboard {
    left: calc(var(--x0) - 6 * var(--u)); width: calc(112 * var(--u));
    height: calc(17 * var(--u));
  }
  body.round-ui .game-scoreboard .game-team-name,
  body.round-ui .game-scoreboard .game-score:not(.second) .game-team-name,
  body.round-ui .game-scoreboard .game-score.second .game-team-name { font-size: calc(5 * var(--u)); }
  body.round-ui .game-scoreboard .game-team-score b,
  body.round-ui .game-scoreboard .score-of { font-size: calc(6.2 * var(--u)); }
  body.round-ui .game-scoreboard .game-score.active .game-team-name,
  body.round-ui .game-scoreboard .game-score.active .game-team-score {
    text-shadow: 0 0 calc(2.4 * var(--u)) rgba(255, 180, 40, 1);
  }

  /* ---------- text inside the cake ---------- */
  body.round-ui .sentence { font-size: calc(6.2 * var(--u)); line-height: 1.45; font-weight: 800; }
  body.round-ui .formula-tag { font-size: calc(2.6 * var(--u)); margin-bottom: calc(1.2 * var(--u)); }
  body.round-ui .question-number { font-size: calc(3.4 * var(--u)); }
  body.round-ui .question-box { font-size: calc(6.6 * var(--u)); }
  body.round-ui .voice-instruction { font-size: calc(5 * var(--u)); }
  body.round-ui .host-answer-label { font-size: calc(3.9 * var(--u)); }
  body.round-ui .host-answer strong { font-size: calc(7 * var(--u)); }
  body.round-ui .choices { gap: calc(2.2 * var(--u)); }
  body.round-ui .choices .choice {
    font-size: calc(5 * var(--u)); padding: calc(2.4 * var(--u)) calc(3.6 * var(--u));
    border-width: calc(0.6 * var(--u));
  }

  /* ---------- buttons ---------- */
  body.round-ui .round-controls > .primary,
  body.round-ui .host-verdict > button {
    font-size: calc(7.2 * var(--u));
    box-shadow: inset 0 calc(0.6 * var(--u)) 0 #fff, inset 0 calc(-0.8 * var(--u)) calc(1.5 * var(--u)) rgba(190, 140, 60, .35),
      0 0 calc(3.2 * var(--u)) rgba(255, 190, 60, .7), 0 calc(1 * var(--u)) calc(2.4 * var(--u)) rgba(110, 70, 20, .3);
  }
  body.round-ui .paper-stage-action { left: calc(var(--x0) + 1 * var(--u)); width: calc(98 * var(--u)); height: calc(17 * var(--u)); }
  body.round-ui .round-pause { width: calc(16 * var(--u)); height: calc(16 * var(--u)); }

  /* ---------- the other screens (home, team names, topic map…): scaled up as a whole ---------- */
  body:not(.round-ui) { --z: 1.3; }
  body:not(.round-ui) > header,
  body:not(.round-ui) > main,
  body:not(.round-ui) > footer { zoom: var(--z); }
  /* the home screen fills the visible height; divide by the zoom so it still fits */
  body:not(.round-ui) .home-screen {
    height: calc((100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) / var(--z) - 96px);
  }
  dialog#rules { zoom: 1.25; }
  @media (orientation: landscape) {
    body:not(.round-ui) { --z: 1.12; }
    dialog#rules { zoom: 1.1; }
  }

  /* ---------- louder: slow golden rays turning behind the cake ---------- */
  body.round-ui #theater-stage > .round-cake { z-index: 0; }
  body.round-ui .stage-rays {
    display: block; position: fixed; z-index: 0; pointer-events: none;
    left: 50vw; top: 46dvh; width: max(150vw, 150dvh); aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, .30) 0deg 6deg, rgba(255, 214, 120, 0) 6deg 18deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 18%, rgba(0,0,0,.55) 45%, transparent 75%);
    mask-image: radial-gradient(closest-side, #000 18%, rgba(0,0,0,.55) 45%, transparent 75%);
    animation: rays-turn 60s linear infinite;
  }
  @keyframes rays-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
}
.stage-rays { display: none; }

/* very large iPads (12.9"/13") get a little more */
@media (min-width: 1000px) and (min-height: 1300px) {
  body:not(.round-ui) { --z: 1.4; }
}
@media (min-width: 744px) and (min-height: 600px) and (prefers-reduced-motion: reduce) {
  body.round-ui .stage-wing::before, body.round-ui #theater-stage::before, body.round-ui .stage-rays { animation: none; }
}
