/* Data Honey Live, styled from the Data Honey Proposal Design System.
   Ink on cream, honey as the accent. Honey yellow is a fill only, never text.
   Two faces: Poppins for titles, numbers and caps; Source Sans 3 for reading.
   Hairlines separate things, not shadows. */
:root {
  /* color */
  --honey-500: #ffde00;   /* brand yellow: fills, bars, tabs, highlights only */
  --honey-400: #ffc324;   /* gold: accent rules, header fills, the active step */
  --honey-100: #fff3c4;   /* honey tint: callouts, highlighted rows */
  --amber-500: #faa634;   /* big numerals and fills on dark */
  --amber-700: #9a5f12;   /* the only accent allowed as body-size text */
  --surface-0: #ffffff;   /* cards, table cells */
  --surface-100: #fffaf0; /* cream page ground */
  --surface-200: #f4ede0; /* sand: header bands, subtle fills */
  --ink: #1c1a14;         /* all running text and headings */
  --ink-muted: #5c5247;   /* captions, footers, secondary */
  --ink-inverse: #ffffff; /* text on ink or midnight */
  --midnight: #13263f;    /* dark panels, rendered as a gradient */
  --midnight-grad: linear-gradient(150deg, #1b3250, #0f2033);
  --line: #e6dcc8;        /* hairlines */
  --line-accent: #ffc324; /* the 3px gold rule */
  --signal-ok: #2f6b3a;   /* text and check marks only */
  --signal-warn: #8a3b12; /* text only */

  /* type */
  --font-display: "Poppins", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;

  /* spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;

  /* radius */
  --radius-sm: 4px; --radius-md: 8px; --radius-pill: 999px;

  /* the one shadow, for on-screen cards */
  --shadow-card: 0 1px 2px rgba(28, 26, 20, .08);
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface-100); color: var(--ink); font-family: var(--font-body);
  font-size: 15px; line-height: 24px; min-height: 100dvh; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 36px; line-height: 40px; font-weight: 700; }
h2 { font-size: 28px; line-height: 34px; font-weight: 700; }
h3 { font-size: 22px; line-height: 28px; font-weight: 600; }
p { margin: 0 0 var(--space-4); }
button { font: inherit; cursor: pointer; color: inherit; }
b, strong { font-weight: 700; }
a { color: var(--amber-700); }
.muted { color: var(--ink-muted); }
[hidden] { display: none !important; }

/* shared text styles */
.eyebrow, .tag {
  display: block; font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--amber-700); margin: 0 0 var(--space-1);
}
.rule { height: 3px; width: 64px; background: var(--line-accent); border-radius: var(--radius-pill); margin: var(--space-3) 0 var(--space-4); }
.caption { font-family: var(--font-body); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }

/* ---------- audience frame ---------- */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-3);
  padding: calc(var(--space-2) + env(safe-area-inset-top)) var(--space-4) var(--space-2);
  background: var(--surface-0); border-bottom: 1px solid var(--line);
}
.top .logo { height: 28px; width: auto; flex: none; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: var(--space-2); }
.live {
  font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1;
  color: var(--ink-inverse); background: var(--ink); padding: 5px 8px 4px; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 5px;
}
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--honey-500); animation: blink 1.4s infinite; }
.live.off { background: var(--surface-200); color: var(--ink-muted); }
.live.off::before { background: var(--ink-muted); animation: none; }
@keyframes blink { 50% { opacity: .25; } }
.spacer { flex: 1; }
.who {
  border: 0; background: none; padding: 0; font-family: var(--font-display); font-size: 13px; font-weight: 600;
  color: var(--ink); max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
.score {
  display: flex; flex-direction: column; align-items: flex-end; line-height: 1; padding: 6px 10px;
  border: 1px solid var(--line); border-top: 3px solid var(--line-accent); border-radius: var(--radius-md);
  background: var(--surface-0); min-width: 5.6rem;
}
.score .label { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.score .val { font-family: var(--font-display); font-size: 22px; line-height: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; transition: transform .2s, color .2s; }
.score.bump .val { transform: scale(1.2); color: var(--amber-700); }

.stage { flex: 1; padding: var(--space-6) var(--space-4) var(--space-6); overflow-x: hidden; }
/* Bottom bar is ONE row (arrows + reactions) plus the small reaction note, to keep the slide area tall. */
.bottom {
  position: sticky; bottom: 0; z-index: 20; background: var(--surface-0); border-top: 1px solid var(--line);
  padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--space-1);
}
.navrow { display: flex; align-items: center; gap: 6px; }
.navbtn {
  flex: none; border: 1px solid var(--line); background: var(--surface-0); color: var(--ink); border-radius: var(--radius-md);
  width: 40px; height: 40px; font-family: var(--font-display); font-size: 18px; font-weight: 700;
}
.navbtn:active { background: var(--honey-100); }
.navbtn[disabled] { color: var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.catchup {
  flex: 1; border: 0; background: var(--ink); color: var(--ink-inverse); border-radius: var(--radius-md); height: 40px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.reactions { flex: 1; display: flex; gap: 6px; min-width: 0; }
.reactions button {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-0); border-radius: var(--radius-md); height: 40px; font-size: 19px; padding: 0;
  transition: transform .08s;
}
.reactions button:active { transform: scale(1.25); background: var(--honey-100); }
.reactions button[disabled] { cursor: default; transform: none; }
.reactions.spent button { opacity: .35; filter: grayscale(1); }
.reactions.spent button:active { transform: none; background: var(--surface-0); }
.react-note { font-size: 11px; line-height: 14px; color: var(--ink-muted); text-align: center; min-height: 14px; font-variant-numeric: tabular-nums; }

/* ---------- slides ---------- */
/* flow-root keeps children's margins inside the slide, so its measured height is its real height (see Slides.fit). */
.slide { animation: slidein .35s ease-out both; max-width: 46rem; margin: 0 auto; display: flow-root; }
.slide > :last-child { margin-bottom: 0; }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.slide.back { animation-name: slideback; }
@keyframes slideback { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.slide h2 { font-size: 28px; line-height: 34px; }
.lede { font-size: 18px; line-height: 28px; color: var(--ink); margin-bottom: var(--space-6); }
.txt { font-size: 16px; line-height: 26px; }

/* Title slides are dark divider panels: midnight gradient, white comb, honey only as type. */
.l-title {
  background: var(--midnight); background-image: var(--midnight-grad); color: var(--ink-inverse);
  border-radius: var(--radius-md); padding: var(--space-12) var(--space-6) var(--space-8);
  min-height: 60vh; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
}
.l-title .comb {
  position: absolute; top: 0; right: 0; bottom: 0; width: 42%; height: 100%; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%); mask-image: linear-gradient(to right, transparent, #000 45%);
}
@media (max-width: 560px) { .l-title .comb { width: 48%; } }
.l-title > *:not(.comb) { position: relative; z-index: 1; max-width: 34rem; }
.l-title .mark { height: 40px; width: auto; margin-bottom: var(--space-8); align-self: flex-start; }
.l-title .tag { color: var(--honey-400); }
.l-title h1 { color: var(--ink-inverse); font-size: 40px; line-height: 44px; }
.l-title .rule { background: var(--honey-400); }
.l-title .sub { font-size: 18px; line-height: 28px; color: var(--ink-inverse); opacity: .9; margin: 0 0 var(--space-3); }
.l-title .txt { color: var(--ink-inverse); opacity: .8; margin: 0; }

/* Bullets: a list with hairlines, not a stack of boxes. */
.bul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.bul li {
  padding: var(--space-3) 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 24px;
  animation: pop .4s ease-out both; animation-delay: calc(var(--i) * 60ms);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Raw-data rows render as a real table: honey-400 header, hairlines between rows. */
.dtable { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; background: var(--surface-0); border-radius: var(--radius-sm); overflow: hidden; }
.dtable th {
  text-align: left; font-family: var(--font-display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  padding: var(--space-2) var(--space-3); background: var(--honey-400); color: var(--ink);
}
.dtable th.n, .dtable td.n { width: 3rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.dtable td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.dtable tr { animation: pop .4s ease-out both; animation-delay: calc(var(--i) * 60ms); }

/* Photos: a real picture, framed by a hairline, never stretched. */
.photo { margin: 0 auto var(--space-6); width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.photo img { display: block; max-width: 100%; width: auto; height: auto; max-height: 46vh; }
.scr .photo img { max-height: 40vh; }

/* Callouts: honey-100 tint, radius-md. Quote variant in Poppins. */
.callout { background: var(--honey-100); border-radius: var(--radius-md); padding: var(--space-6); margin: 0 0 var(--space-6); }
blockquote.callout { font-family: var(--font-display); font-size: 22px; line-height: 30px; font-weight: 600; color: var(--ink); }
.lesson { margin-top: var(--space-6); }
.lesson .eyebrow { margin-bottom: var(--space-2); }
.lesson div { font-size: 16px; line-height: 24px; font-weight: 600; }

/* Cards: the capability-grid style, a gold rule on top instead of a box. */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--space-6) var(--space-6); }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } .cards.n3 { grid-template-columns: repeat(3, 1fr); } }
.card { border-top: 3px solid var(--line-accent); padding-top: var(--space-3); animation: pop .4s ease-out both; animation-delay: calc(var(--i) * 60ms); }
.card-head { font-family: var(--font-display); font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--space-1); }
.card-text { font-size: 15px; line-height: 22px; color: var(--ink-muted); }

/* Compare: two panels with a header band, like a phase card. */
.compare { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 560px) { .compare { grid-template-columns: 1fr 1fr; } }
.col { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; animation: pop .4s ease-out both; animation-delay: calc(var(--i) * 120ms); }
.col-head { font-family: var(--font-display); font-size: 13px; line-height: 20px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: var(--space-3) var(--space-4); background: var(--surface-200); }
.col:nth-child(2) .col-head { background: var(--honey-400); }
.col ul { margin: 0; padding: var(--space-3) var(--space-4) var(--space-4) calc(var(--space-4) + 18px); }
.col li { padding: 3px 0; font-size: 15px; line-height: 22px; }

/* Steps: phase-card numbers, honey-500 circles with ink numerals. */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.steps li {
  display: flex; gap: var(--space-4); align-items: flex-start; background: var(--surface-0); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: var(--space-4); animation: pop .4s ease-out both; animation-delay: calc(var(--i) * 80ms);
}
.step-n {
  flex: none; width: 32px; height: 32px; border-radius: var(--radius-pill); background: var(--honey-500); color: var(--ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.step-head { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 22px; }
.step-text { font-size: 15px; line-height: 22px; color: var(--ink-muted); }

/* Game placeholder and podium */
.gamepad, .podium {
  margin-top: var(--space-4); background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-6); min-height: 7rem; display: flex; flex-direction: column; justify-content: center; gap: var(--space-2);
}
.gamepad-wait { color: var(--ink-muted); display: inline-flex; gap: var(--space-2); align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--honey-400); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .4; } }
.double {
  align-self: center; background: var(--honey-500); color: var(--ink); font-family: var(--font-display); font-weight: 700;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-pill);
}

.podium-list { list-style: none; margin: 0; padding: 0; text-align: left; border-top: 1px solid var(--line); }
.podium-list li { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); animation: pop .5s ease-out both; }
.podium-list li.r1 { background: var(--honey-100); animation-delay: .6s; }
.podium-list li.r1 .pname, .podium-list li.r1 .pscore { font-size: 20px; }
.podium-list li.r2 { animation-delay: .4s; } .podium-list li.r3 { animation-delay: .2s; }
.medal { font-family: var(--font-display); font-weight: 700; color: var(--amber-700); width: 1.6rem; font-variant-numeric: tabular-nums; }
.pname { flex: 1; font-family: var(--font-display); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pscore { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- results ---------- */
.bars { display: flex; flex-direction: column; gap: var(--space-3); text-align: left; }
.bar-label { display: flex; justify-content: space-between; gap: var(--space-3); font-weight: 600; font-size: 15px; line-height: 20px; }
.bar-n { font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.bar-track { height: 10px; background: var(--surface-200); border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--space-1); display: flex; }
.bar-fill { height: 100%; background: var(--honey-400); border-radius: var(--radius-pill); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.bar.correct .bar-label span:first-child::before { content: "\2713  "; color: var(--signal-ok); font-weight: 700; }
.bar.correct .bar-fill { background: var(--honey-400); }
.bar.wrong .bar-fill { background: var(--line); }
.bar.wrong .bar-label { color: var(--ink-muted); font-weight: 400; }
.bar-track.split .bar-fill { border-radius: 0; }
.bar-fill.ok { background: var(--ink); } .bar-fill.no { background: var(--honey-400); }
.bar-sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: 2px; }
.verdict { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.verdict.ok { color: var(--signal-ok); } .verdict.no { color: var(--signal-warn); }
.est-result { text-align: center; }
.est-target { font-family: var(--font-display); font-size: 44px; line-height: 48px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); margin: var(--space-1) 0 var(--space-2); font-variant-numeric: tabular-nums; }
.est-target small { font-size: 15px; color: var(--ink-muted); font-weight: 600; letter-spacing: 0; }
.est-win { color: var(--signal-ok); font-weight: 700; }

/* ---------- sheets (modals) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(19, 38, 63, .55); padding: 0; animation: fade .2s both;
}
@media (min-width: 560px) { .modal { align-items: center; padding: var(--space-4); } }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 32rem; background: var(--surface-100); border-top: 3px solid var(--line-accent);
  border-radius: var(--radius-md) var(--radius-md) 0 0; padding: var(--space-6) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(19, 38, 63, .25); animation: up .3s cubic-bezier(.2, .8, .2, 1) both; max-height: 92dvh; overflow: auto;
}
@media (min-width: 560px) { .sheet { border-radius: var(--radius-md); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { font-size: 22px; line-height: 28px; margin-bottom: var(--space-1); }
.sheet .kicker { font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-700); margin-bottom: var(--space-2); display: flex; justify-content: space-between; align-items: center; }
.timer { height: 6px; background: var(--surface-200); border-radius: var(--radius-pill); overflow: hidden; margin: var(--space-3) 0 var(--space-4); }
.timer > div { height: 100%; background: var(--honey-400); width: 100%; transition: width .25s linear; }
.timer.hot > div { background: var(--amber-700); }
.secs { font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: .04em; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.choices.list { grid-template-columns: 1fr; }
.choice {
  border: 1px solid var(--line); background: var(--surface-0); color: var(--ink); border-radius: var(--radius-md); padding: var(--space-4) var(--space-3);
  font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 20px; text-align: center; min-height: 3.6rem;
  display: flex; align-items: center; justify-content: center; transition: transform .08s, background .15s; word-break: break-word;
}
.choices.list .choice { justify-content: flex-start; text-align: left; }
.choice:active { transform: scale(.98); }
.choice.sel { background: var(--ink); color: var(--ink-inverse); border-color: var(--ink); }
.choice.correct { background: var(--honey-400); color: var(--ink); border-color: var(--honey-400); }
.choice.wrong { background: var(--surface-200); color: var(--ink-muted); border-color: var(--surface-200); }
.choice[disabled] { cursor: default; }

.caprow { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3); margin-bottom: var(--space-2); }
.caprow p { font-weight: 600; margin-bottom: var(--space-2); line-height: 22px; }
.capbtns { display: flex; gap: var(--space-2); }
.capbtns .choice { flex: 1; min-height: 2.8rem; padding: var(--space-2); font-size: 14px; letter-spacing: .04em; }
.capbtns .choice.sel.cap { background: var(--honey-400); color: var(--ink); border-color: var(--honey-400); }
.capbtns .choice.sel.nocap { background: var(--ink); color: var(--ink-inverse); border-color: var(--ink); }

.est { text-align: center; }
.est output { display: block; font-family: var(--font-display); font-size: 44px; line-height: 48px; font-weight: 700; letter-spacing: -.02em; margin: var(--space-2) 0 0; font-variant-numeric: tabular-nums; }
.est .unit { color: var(--ink-muted); margin-bottom: var(--space-3); }
.est input[type=range] { width: 100%; accent-color: var(--ink); height: 2.4rem; }
.est .range-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.btn {
  width: 100%; border: 0; background: var(--honey-400); color: var(--ink); font-family: var(--font-display); font-weight: 700;
  font-size: 15px; letter-spacing: .02em; border-radius: var(--radius-md); padding: 14px var(--space-4); margin-top: var(--space-3);
}
.btn:active { background: var(--honey-500); }
.btn.ghost { background: var(--surface-0); color: var(--ink); border: 1px solid var(--line); }
.btn.dark { background: var(--ink); color: var(--ink-inverse); }
.btn[disabled] { opacity: .45; }

/* Result: one big word, set like a key figure with a honey rule beside it. */
.result { display: flex; gap: var(--space-4); align-items: stretch; justify-content: center; padding: var(--space-2) 0 var(--space-4); text-align: left; }
.result .mark { flex: none; width: 4px; border-radius: var(--radius-pill); background: var(--line-accent); }
.result .big { font-family: var(--font-display); font-size: 44px; line-height: 48px; font-weight: 700; letter-spacing: -.02em; }
.result .pts { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--signal-ok); animation: pop .4s .15s both; font-variant-numeric: tabular-nums; }
.result .pts.zero { color: var(--ink-muted); }
.result p { color: var(--ink-muted); margin: 2px 0 0; }
.locked { text-align: center; color: var(--ink-muted); font-family: var(--font-display); font-weight: 600; font-size: 14px; padding: var(--space-3) 0 0; }

.join .sheet { text-align: center; }
.join .logo-big { height: 48px; width: auto; margin: 0 auto var(--space-4); display: block; }
.nametag {
  margin: var(--space-4) 0 var(--space-2); padding: var(--space-4) var(--space-3); border-radius: var(--radius-md); background: var(--surface-0);
  border: 1px solid var(--line); border-top: 3px solid var(--line-accent);
  font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; min-height: 4.2rem;
  display: flex; align-items: center; justify-content: center; word-break: break-word;
}
.nametag.spin { animation: spin .35s ease-out; }
@keyframes spin { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- sad panda ---------- */
.panda .sheet { text-align: center; }
.panda-wrap { width: 170px; height: 170px; margin: 0 auto var(--space-2); animation: shake 1.1s ease-in-out infinite; }
@keyframes shake { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.tear { animation: tear 1.3s ease-in infinite; transform-origin: center; }
.tear.t2 { animation-delay: .5s; }
@keyframes tear { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(42px); opacity: 0; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(8.8rem + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); z-index: 60;
  background: var(--ink); color: var(--ink-inverse); padding: 10px var(--space-4); border-radius: var(--radius-md);
  font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 20px; opacity: 0; transition: .25s; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.gold { background: var(--honey-400); color: var(--ink); }

/* ---------- presenter ---------- */
.pres { display: grid; grid-template-columns: 1fr; min-height: 100dvh; }
@media (min-width: 980px) { .pres { grid-template-columns: 1fr 22rem; } .pres .side { border-left: 1px solid var(--line); max-height: 100dvh; overflow: auto; position: sticky; top: 0; } }
.pres .main { padding: var(--space-4) var(--space-6); max-width: 60rem; }
.pres .side { padding: var(--space-4); background: var(--surface-0); }
.ptop { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.ptop img { height: 24px; width: auto; }
.ptop .clock { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; }
.ptop .clock small { font-family: var(--font-body); font-weight: 400; color: var(--ink-muted); font-size: 13px; }
.ptop .clock.behind { color: var(--signal-warn); }
.chip { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 2px 10px; font-weight: 600; font-size: 13px; line-height: 22px; }
.chip.on { color: var(--signal-ok); }
.chip.off { color: var(--signal-warn); }
.cue-banner {
  display: flex; align-items: center; gap: var(--space-4); background: var(--midnight); background-image: var(--midnight-grad);
  color: var(--ink-inverse); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); margin-bottom: var(--space-4);
}
.cue-banner .cue-help { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--honey-400); }
.cue-banner .cue-word { font-family: var(--font-display); font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -.01em; color: var(--ink-inverse); }
.cue-banner .decoys { font-size: 14px; color: var(--ink-inverse); opacity: .75; }
.cue-banner.none { background: var(--surface-200); background-image: none; color: var(--ink-muted); }
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.controls .btn { margin: 0; padding: var(--space-3) var(--space-2); font-size: 14px; }
.controls .btn.nav { background: var(--ink); color: var(--ink-inverse); }
.controls .btn.game { background: var(--honey-400); color: var(--ink); }
.controls .btn.warn { background: var(--surface-0); color: var(--signal-warn); border: 1px solid var(--line); }
.notes, .livegame { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); }
.notes h4, .livegame h4, .side h4 { font-family: var(--font-display); margin: 0 0 var(--space-2); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--amber-700); }
.notes p { margin: 0; font-size: 17px; line-height: 26px; }
.livegame .count { font-family: var(--font-display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: var(--space-2); }
.preview { border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); background: var(--surface-100); }
.preview .slide { max-width: none; animation: none; }
.list { list-style: none; margin: 0 0 var(--space-6); padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; align-items: center; gap: var(--space-2); padding: 7px var(--space-2); border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.list li:hover { background: var(--surface-100); }
.list li.cur { background: var(--honey-100); box-shadow: inset 4px 0 0 var(--honey-500); }
.list .n { width: 1.6rem; color: var(--ink-muted); font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.list .ttl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list .mins { color: var(--ink-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.list .fill { flex: none; font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--signal-warn); border: 1px solid var(--signal-warn); border-radius: var(--radius-sm); padding: 0 4px; line-height: 16px; }
.list .ico { font-family: var(--font-display); font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--amber-700); }
.lb { list-style: none; margin: 0 0 var(--space-6); padding: 0; border-top: 1px solid var(--line); }
.lb li { display: flex; gap: var(--space-2); padding: 6px var(--space-1); font-size: 14px; border-bottom: 1px solid var(--line); }
.lb .rank { width: 1.4rem; color: var(--ink-muted); font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.lb .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .sc { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.lb li.offline .nm { color: var(--ink-muted); font-weight: 400; }
.pin .sheet { text-align: center; }
.pin input { width: 100%; font-family: var(--font-display); font-size: 28px; font-weight: 700; padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface-0); text-align: center; letter-spacing: .3em; color: var(--ink); }
.pin input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.err { color: var(--signal-warn); font-weight: 700; min-height: 1.3rem; margin: var(--space-2) 0 0; }

/* ---------- big screen ---------- */
body.screen { overflow: hidden; }
.scr { display: grid; grid-template-columns: 1fr 24rem; height: 100dvh; }
.scr .stage { padding: var(--space-8) var(--space-12); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.scr .slide { max-width: none; width: 100%; }
.scr .slide h2 { font-size: 36px; line-height: 42px; }
.scr .l-title { min-height: 72vh; padding: var(--space-16); }
.scr .l-title h1 { font-size: 56px; line-height: 60px; }
.scr .panel { background: var(--surface-0); border-left: 1px solid var(--line); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); overflow: hidden; }
.scr .brandrow img { height: 30px; width: auto; display: block; }
.scr .brandrow .t { font-size: 13px; color: var(--ink-muted); margin-top: var(--space-2); }
.qrbox { text-align: center; background: var(--surface-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.qrbox .qr { display: inline-block; background: var(--surface-0); padding: var(--space-2); border-radius: var(--radius-sm); }
.qrbox .qr img, .qrbox .qr canvas { display: block; }
.qrbox .url { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-top: var(--space-2); word-break: break-all; }
.qrbox .joined { color: var(--ink-muted); font-size: 14px; margin-top: 2px; }
.scr .lb { flex: 1; overflow: hidden; }
.scr .lb li { font-size: 16px; padding: var(--space-2) var(--space-1); }
.scr .lb li.r1 { background: var(--honey-100); }
.scr .lgame { background: var(--surface-100); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); }
.scr .lgame .count { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.scr .lgame .timer { margin: var(--space-2) 0 0; }
.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.floater { position: absolute; bottom: -60px; font-size: 2.6rem; animation: floatup 3.2s ease-out forwards; }
.floater small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--ink-muted); text-align: center; }
@keyframes floatup { to { transform: translateY(-110vh) rotate(var(--rot, 10deg)); opacity: 0; } }
.scr .result-panel { background: var(--surface-0); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4) var(--space-6); margin-top: var(--space-4); }
@media (max-width: 900px) { .scr { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .scr .panel { border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; } }

/* narrow phones: mark + LIVE + name + score only */
@media (max-width: 400px) {
  .brand .brand-text { display: none; }
  .who { max-width: 38vw; }
  .score { min-width: 5rem; }
}

/* ---------- phones: every slide must fit on one screen ----------
   Rule: no slide may scroll on a phone or be cut off on the projector.
   These sizes are the phone scale. If a slide still doesn't fit, Slides.fit() shrinks it a little
   (never below FIT_MIN) and the fit test (e2e/fit.py) fails, which means: trim the slide's words. */
@media (max-width: 560px) {
  .top { padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
  .top .logo { height: 24px; }
  .score { padding: 4px 8px; min-width: 4.6rem; }
  .score .val { font-size: 19px; line-height: 22px; }
  .stage { padding: var(--space-4) var(--space-4) var(--space-4); }

  .slide h2 { font-size: 23px; line-height: 28px; }
  .tag { font-size: 11px; line-height: 14px; }
  .rule { margin: var(--space-2) 0 var(--space-3); }
  .lede { font-size: 16px; line-height: 23px; margin-bottom: var(--space-3); }
  .txt { font-size: 15px; line-height: 22px; margin-bottom: var(--space-3); }

  .l-title { min-height: 0; padding: var(--space-8) var(--space-4) var(--space-6); }
  .l-title .mark { height: 32px; margin-bottom: var(--space-4); }
  .l-title h1 { font-size: 32px; line-height: 36px; }
  .l-title .sub { font-size: 16px; line-height: 23px; }
  .l-title .txt { font-size: 14px; line-height: 21px; }

  .callout { padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
  blockquote.callout { font-size: 17px; line-height: 24px; }
  .lesson { margin-top: var(--space-3); }
  .lesson .eyebrow { margin-bottom: 2px; }
  .lesson div { font-size: 14px; line-height: 20px; }
  .photo { margin-bottom: var(--space-3); }
  .photo img { max-height: 24vh; }

  .bul li { padding: 7px 0; font-size: 15px; line-height: 21px; }
  .cards { gap: var(--space-3); }
  .card { padding-top: var(--space-2); }
  .card-head { font-size: 12.5px; line-height: 17px; }
  .card-text { font-size: 14px; line-height: 19px; }
  .compare { gap: var(--space-2); }
  .col-head { padding: 6px var(--space-3); font-size: 12px; line-height: 17px; }
  .col ul { padding: 6px var(--space-3) 8px calc(var(--space-3) + 16px); }
  .col li { padding: 1px 0; font-size: 14px; line-height: 19px; }
  .steps { gap: var(--space-2); }
  .steps li { padding: 10px var(--space-3); gap: var(--space-3); }
  .step-n { width: 26px; height: 26px; font-size: 12px; }
  .step-head { font-size: 15px; line-height: 20px; }
  .step-text { font-size: 14px; line-height: 19px; }
  .dtable { font-size: 14px; line-height: 18px; }
  .dtable th, .dtable td { padding: 6px var(--space-2); }
  .gamepad, .podium { padding: var(--space-4); min-height: 5rem; margin-top: var(--space-2); }
  .podium-list li { padding: var(--space-2); }

  /* Game popups follow the same rule: no scrolling inside a popup either (e2e/fit_popups.py). */
  .sheet { padding: var(--space-4) var(--space-3) calc(var(--space-4) + env(safe-area-inset-bottom)); }
  .sheet h3 { font-size: 18px; line-height: 24px; }
  .timer { margin: var(--space-2) 0 var(--space-3); }
  .choice { min-height: 2.9rem; padding: 10px var(--space-3); font-size: 15px; }
  .choices { gap: 6px; }
  .caprow { padding: var(--space-2) var(--space-3); margin-bottom: 6px; }
  .caprow p { font-size: 14px; line-height: 19px; margin-bottom: 6px; }
  .capbtns .choice { min-height: 2.4rem; padding: 6px; }
  .btn { padding: 12px var(--space-4); margin-top: var(--space-2); }
}
