/* Trivia Dice mock tokens — external only (CSP-safe). Chrome 91 friendly. */
:root {
  --bg: #1a1430;
  --card: #2a2148;
  --card-2: #3a2f6e;
  --text: #f7f2ff;
  --muted: #c9b8ef;
  --primary: #6c5ce7;
  --primary-press: #5a4bd1;
  --hold: #ffb703;
  --ok: #2dd4a8;
  --bad: #ff6b81;
  --twist: #9be7ff;
  --die-face: #fff8e7;
  --die-ink: #2a2148;
  --promo: #ff8a3d;
  --radius: 16px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sm: 0.8125rem;
  --body: 1rem;
  --md: 1.25rem;
  --lg: 1.5625rem;
  --xl: 1.9375rem;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
@supports (height: 100dvh) {
  html, body { height: 100dvh; max-height: 100dvh; }
}
a { color: var(--twist); }

/* Trivia Dice — desktop one-page mock r1. External CSS only. Chrome 91-safe. */
:root {
  --lilac: #d4b8ff;
  --amazon-bg: #3a1f6e;
  --amazon-amber: #ffb703;
  --glow-a: #6c5ce744;
  --glow-b: #3b1f8a55;
  --lift: 0 10px 28px #00000055, 0 2px 0 #ffffff0a;
  --space: 8px;
}

html { height: 100%; }
body {
  height: 100vh;
  max-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -10%, var(--glow-a), transparent 60%),
    radial-gradient(700px 380px at 88% 110%, var(--glow-b), transparent 55%),
    var(--bg);
  overflow: hidden;
}
@supports (height: 100dvh) {
  body { height: 100dvh; max-height: 100dvh; }
}

/* ---------- Shared UI (phone + desktop) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--muted);
  border: 1px solid #ffffff18;
  white-space: nowrap;
}
.pill.twist {
  color: var(--twist);
  border-color: #9be7ff55;
  background: #3a2f6e;
}
.pill.pts {
  color: var(--hold);
  border-color: #ffb70355;
  background: #3a2f6e;
}

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.round-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.round-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff22;
  border: 1px solid #ffffff33;
}
.round-dots .dot.done { background: var(--ok); border-color: var(--ok); }
.round-dots .dot.current {
  background: var(--primary);
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px #6c5ce744;
}

.choice {
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid #ffffff22;
  background: var(--card-2);
  color: var(--text);
  font-size: var(--body);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  padding: 8px 12px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.choice:focus-visible { outline: 3px solid var(--hold); outline-offset: 2px; }
.choice.ok { background: var(--ok); color: #0b2e24; border-color: var(--ok); }
.choice.bad { background: var(--bad); color: #1a1430; border-color: var(--bad); }
.choice .letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1a1430;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff22;
}
.choice .choice-text { flex: 1; }

/* ---------- Phone / base (<1024) ---------- */
.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 12px 16px;
  max-width: 520px;
  margin: 0 auto;
}
@supports (height: 100dvh) {
  .shell { min-height: 100dvh; }
}

.header-desk { display: none; }
.phone-top { padding: 12px 0 8px; }
.phone-top h1 {
  margin: 0;
  font-size: var(--xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--sm);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  flex: 1;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  border: 1px solid #ffffff14;
  padding: 12px;
}

.dice-mid { display: flex; flex-direction: column; gap: 10px; }
.dice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.die {
  background: var(--die-face);
  color: var(--die-ink);
  border-radius: 16px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 3px solid transparent;
  box-shadow: 0 6px 0 #1a1430, 0 10px 18px #0006;
  font-weight: 700;
  position: relative;
  font-family: inherit;
  cursor: pointer;
}
.die.category {
  background: linear-gradient(160deg, #efe6ff 0%, #fff8e7 70%);
  border-color: #6c5ce7;
}
.die .icon { font-size: 1.75rem; line-height: 1; }
.die .pip { font-size: 2rem; line-height: 1; }
.die .label {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
}
.die .face-num {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--die-ink);
  opacity: 0.9;
}
.die.held { border-color: #b87a00; }
.die.held .badge {
  position: absolute;
  top: -8px;
  right: -6px;
  background: var(--hold);
  color: #1a1430;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
}

.readout-card {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--card-2);
  border-radius: 12px;
  border: 1px solid #ffffff18;
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-size: var(--body);
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  width: 100%;
  font-family: inherit;
}
.btn:focus-visible { outline: 3px solid var(--hold); outline-offset: 2px; }
.btn-roll {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-press) 100%); /* RC1: #fff >= 4.86:1 across the gradient */
  box-shadow: 0 6px 0 var(--primary-press), 0 10px 20px #6c5ce744;
  margin-top: 10px;
  font-size: var(--md);
  letter-spacing: 0.01em;
}
.btn-ask {
  background: linear-gradient(180deg, #7a6cf0 0%, var(--primary) 100%);
  box-shadow: 0 6px 0 var(--primary-press);
  margin-top: 10px;
}

.q-card h2 {
  margin: 0 0 10px;
  font-size: var(--md);
  font-weight: 600;
  max-width: 36ch;
  line-height: 1.3;
}
.choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.rail { display: none; }
.amazon-card { display: none; }
.howto-tip { display: none; }

.phone-footer {
  margin-top: 12px;
  padding: 10px 0 4px;
  font-size: var(--sm);
  color: var(--muted);
  border-top: 1px solid #ffffff14;
  text-align: center;
}
.phone-footer a {
  color: var(--twist);
  text-decoration: none;
  font-weight: 600;
}
.phone-footer a:hover { text-decoration: underline; }
.phone-footer .lock { opacity: 0.85; }

.coming-soon-blot { /* toggle-able */ }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Desktop ≥1024 ---------- */
@media (min-width: 1024px) {
  body {
    overflow: hidden;
    height: 100vh;
  }
  @supports (height: 100dvh) {
    body { height: 100dvh; }
  }

  .shell {
    max-width: none;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0 16px 12px;
    overflow: hidden;
  }
  @supports (height: 100dvh) {
    .shell { height: 100dvh; }
  }

  .phone-top { display: none; }
  .phone-footer { display: none; }

  .header-desk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    flex-shrink: 0;
    gap: 12px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
  }
  .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #fff8e7, #efe6ff);
    color: var(--die-ink);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 0 #1a1430, 0 6px 14px #0005;
    flex-shrink: 0;
  }
  .brand-text {
    min-width: 0;
    flex: 1 1 auto;
  }
  .brand-text h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .brand-text .tagline {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
  }

  .more-games {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .more-label {
    color: var(--muted);
    font-size: var(--sm);
    font-weight: 600;
  }
  .chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid #ffffff22;
    color: var(--text);
    text-decoration: none;
    line-height: 1.15;
    box-shadow: 0 4px 12px #0004;
    min-height: 40px;
    justify-content: center;
  }
  .chip:focus-visible { outline: 3px solid var(--hold); outline-offset: 2px; }
  .chip .chip-title {
    font-size: 0.8125rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .chip .chip-sub {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 500;
  }
  .chip .lock { font-size: 0.7rem; opacity: 0.9; }
  .chip-live:hover {
    border-color: var(--lilac);
    background: #32265a;
  }
  .chip-soon {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
    box-shadow: none;
  }

  .stage {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1.4fr 300px;
    gap: 12px;
    min-height: 0;
    height: calc(100% - 56px);
    align-items: stretch;
  }

  .col-dice,
  .col-play,
  .rail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  /* Left: dice ~128px, vertically centered block; readout under; Roll bottom */
  .dice-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    min-height: 0;
  }
  .dice-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    min-height: 0;
  }
  .dice-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
  }
  .die {
    width: 128px;
    height: 128px;
    min-height: 128px;
    flex: 0 0 128px;
    border-radius: 18px;
  }
  .die .icon { font-size: 2.25rem; }
  .die .pip { font-size: 2.6rem; }
  .die .label { font-size: 0.75rem; }
  .die .face-num { font-size: 0.9rem; }

  .readout-card {
    padding: 12px;
    gap: 8px;
    justify-content: center;
  }
  .readout-card .pill { font-size: 0.75rem; padding: 5px 12px; }

  .btn-roll {
    margin-top: 14px;
    min-height: 56px;
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  /* Center: fill height, tall answers, balanced */
  .q-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    min-height: 0;
  }
  .q-card h2 {
    font-size: 1.3rem;
    margin: 0 0 12px;
    flex-shrink: 0;
  }
  .choices {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1 1 auto;
    align-content: stretch;
    min-height: 0;
  }
  .choice {
    min-height: 72px;
    height: 100%;
    font-size: 1.05rem;
    padding: 12px 14px;
    border-radius: 14px;
  }
  .choice .letter {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  .btn-ask {
    margin-top: 12px;
    min-height: 52px;
    flex-shrink: 0;
  }

  /* Right rail */
  .rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    flex-shrink: 0;
  }
  .stat {
    background: var(--card);
    border-radius: 14px;
    padding: 10px 14px;
    border: 1px solid #ffffff14;
    box-shadow: var(--lift);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  .stat b {
    font-size: var(--lg);
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  .stat span {
    font-size: var(--sm);
    color: var(--muted);
    font-weight: 600;
  }
  .stat.streak b { color: var(--ok); }

  .howto-tip {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    background: var(--card);
    border: 1px solid #ffffff18;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--lift);
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
  }
  .howto-tip:focus-visible { outline: 3px solid var(--hold); outline-offset: 2px; }
  .howto-tip:hover { border-color: var(--lilac); }
  .howto-tip strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--twist);
  }
  .howto-tip ul {
    margin: 0;
    padding: 0 0 0 16px;
    font-size: var(--sm);
    color: var(--muted);
    line-height: 1.45;
  }
  .howto-tip li { margin-bottom: 4px; }

  .amazon-card {
    display: flex;
    flex-direction: column;
    width: 280px;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    background: var(--amazon-bg);
    border: 1px solid var(--lilac);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--lift), 0 0 0 1px #ffffff08;
    flex-shrink: 0;
  }
  .amazon-illus {
    width: 64px;
    height: 64px;
    margin: 0 auto 8px;
    display: block;
  }
  .amazon-eyebrow {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lilac);
    text-align: center;
  }
  .amazon-title {
    margin: 6px 0 12px;
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    color: var(--text);
  }
  .btn-amazon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    border-radius: 12px;
    background: var(--amazon-amber);
    color: #1a1430;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    border: 0;
    box-shadow: 0 4px 0 #c48a00;
  }
  .btn-amazon:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
  .btn-amazon:hover { filter: brightness(1.05); }
  .ftc {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
    text-align: center;
  }
}


/* ---- Live Trivia Dice bridges (stage-onepage-r1) ---- */
.wrap { display: contents; } /* shell owns layout */
#dice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#dice .die { min-height: 96px; }
#dice .die-face { font-size: 2rem; line-height: 1; }
#dice .die-name { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; opacity: 0.85; }
#dice .die-cat { background: linear-gradient(160deg, #efe6ff 0%, #fff8e7 70%); border-color: #6c5ce7; }
#dice .die.held { border-color: #b87a00; }
#dice .die .twist-tag { display: none; } /* mock uses higher-die pill in readout */
.rule-line, .mult-line, #narrator { font-size: 0.8125rem; margin: 6px 0 0; }
.dice-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dice-actions button { flex: 1 1 120px; min-height: 48px; }
#btn-roll { background: linear-gradient(180deg, #6c5ce7 0%, #5a4bd1 100%); /* RC1 AA: #fff on #6c5ce7 4.86:1, on #5a4bd1 6.25:1 (old lighter top stop was 4.01:1) */ color: #fff; border: 0; border-radius: 14px; font-weight: 700; }
/* §1 Ask me! — bright yellow so it stands out next to Roll (JustOut voice Nov 6 2026). #1a1430 on #FFE566/#FFCC00 ≥ 12:1. */
#btn-lock { background: linear-gradient(180deg, #FFE566 0%, #FFCC00 100%); color: #1a1430; border: 0; border-radius: 14px; font-weight: 800; box-shadow: 0 4px 0 #b38f00, 0 0 18px #ffcc0073; }
#btn-lock:hover { background: linear-gradient(180deg, #fff08f 0%, #ffd633 100%); }
#btn-lock:active { transform: translateY(2px); box-shadow: 0 2px 0 #b38f00, 0 0 12px #ffcc0073; }
#btn-lock:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
body.hc #btn-lock { background: #FFD400; color: #000; border: 2px solid #fff; box-shadow: none; }
button.secondary { background: #3a2f6e; color: #f7f2ff; border: 1px solid #ffffff22; border-radius: 12px; }
#q-card #prompt { margin: 0 0 10px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; max-width: 36ch; }
#q-card #choices { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
#q-card .choice { min-height: 52px; max-height: none; }
.hud-rail .stat b, .rail .stat b { font-variant-numeric: tabular-nums; }
.seed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; margin-top: 8px; }
.seed-row > #btn-daily,
.seed-row > #btn-share { width: 100%; min-height: 44px; margin: 0; white-space: normal; line-height: 1.2; text-align: center; box-sizing: border-box; }
.seed-row > #share-out { grid-column: 1 / -1; margin: 0; min-width: 0; }
.seed-row #share-out:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: 0.85rem; }
.howto summary { cursor: pointer; }
/* Compact chrome so 1280×800 fits one viewport */
@media (min-width: 1024px) {
  .lb-top { margin: 4px auto 0; max-width: 1100px; padding: 0 16px; }
  .lb-top-inner { padding: 4px 10px; font-size: 12px; }
  .season-strip { margin: 4px auto; max-width: 1100px; }
  .ss-rotor { height: 40px !important; }
  .lb-bottom { display: none; } /* winners still in top bar; save vertical space */
  footer.site-foot { display: none; }
  .howto:not(.play-howto) { max-height: 32vh; overflow: auto; }
  #q-card .choice {
    min-height: 56px;
    max-height: 120px;
  }
  #q-card #choices {
    align-content: center;
    flex: 1;
  }
  .col-play .q-card, .col-play #q-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    flex: 1;
  }
  /* Amazon: show on desktop */
  .rail { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .amazon-card { display: flex; flex-direction: column; gap: 8px; }
  .howto-tip { display: block; }
  body.onepage-desk { overflow: hidden; height: 100vh; }
}
@media (max-width: 1023.98px) {
  .header-desk { display: none !important; }
  .amazon-card, .rail .amazon-card { display: none !important; }
  .howto-tip.desk-only { display: none !important; }
  .phone-footer-more { display: block; }
}
/* R-NOMONEY: never style price/stars into amazon card */
.amazon-card .price, .amazon-card .stars { display: none !important; }

/* Easy mode (prefs.kid): hide the Amazon card and its FTC disclosure (JS also sets hidden). */
body.kid .amazon-card,
body.kid .amazon-card .ftc,
body.kid .amazon-card .btn-amazon {
  display: none !important;
}

/* Fail-closed: desktop author display:flex must not unhide [hidden] if JS is off. */
.amazon-card[hidden],
.amazon-card .ftc[hidden],
.amazon-card .btn-amazon[hidden] {
  display: none !important;
}

@media (min-width: 1024px) {
  #dice { display: flex; justify-content: center; gap: 14px; }
  #dice .die {
    width: 128px; height: 128px; min-height: 128px; flex: 0 0 128px;
  }
  #dice .die-face { font-size: 2.4rem; }
  #q-card #choices {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex: 1 1 auto;
    align-content: center;
  }
  #q-card .choice {
    min-height: 72px;
    max-height: 120px;
  }
  .col-play .howto:not(.play-howto)[open] { max-height: 28vh; }
  /* When question showing, howto can collapse space */
  body.q-open .howto { display: none; }
}

/* Desktop viewport fit: chrome + shell share 100vh (r1 layout ship) */
@media (min-width: 1024px) {
  html, body.onepage-desk {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
  body.onepage-desk {
    display: flex;
    flex-direction: column;
  }
  body.onepage-desk .lb-top,
  body.onepage-desk .season-strip {
    flex: 0 0 auto;
  }
  body.onepage-desk .shell {
    flex: 1 1 auto;
    height: auto !important;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.onepage-desk .stage {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
  }
  body.onepage-desk .howto:not(.play-howto) {
    max-height: min(52vh, 420px);
    overflow: auto;
  }
  body.onepage-desk .phone-footer-more,
  body.onepage-desk .site-foot,
  body.onepage-desk .lb-bottom {
    display: none !important;
  }
  /* Keep Amazon FTC visible: shrink illus */
  body.onepage-desk .amazon-illus { width: 48px; height: 48px; }
  body.onepage-desk .amazon-card { padding: 10px; gap: 6px; }
  body.onepage-desk .btn-amazon { min-height: 40px; font-size: 0.9rem; }
}

/* Background music toggle (jo-music, TOGGLE-SPEC.md) — Nov 6 2026. Header right cluster (desk) / phone header. */
:root {
  --jo-music-accent: #ffb703;    /* --hold on #1a1430 ≈ 10.9:1 */
  --jo-music-muted: #c9b8ef;     /* --muted on #1a1430 ≈ 9.9:1 */
  --jo-music-header-bg: #1a1430; /* --bg */
  --jo-music-focus: #ffb703;
  --jo-music-size: 44px;
  --jo-music-gap: 8px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.td-music { display: flex; align-items: center; gap: var(--jo-music-gap); flex-shrink: 0; }
.td-music-credit { color: var(--jo-music-muted); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.btn-music-toggle {
  min-width: var(--jo-music-size); min-height: var(--jo-music-size);
  width: var(--jo-music-size); height: var(--jo-music-size);
  display: inline-grid; place-items: center; position: relative;
  padding: 0; margin: 0; background: transparent; border: 1px solid #ffffff22; border-radius: 12px;
  cursor: pointer; color: var(--jo-music-muted); box-shadow: none; font: inherit; line-height: 1;
}
.btn-music-toggle:hover { background: #ffffff10; }
.btn-music-toggle:focus-visible { outline: 3px solid var(--jo-music-focus); outline-offset: 2px; }
.btn-music-toggle[aria-pressed="true"], .btn-music-toggle.is-loading { color: var(--jo-music-accent); }
.jo-music-icon { display: block; width: 22px; height: 22px; position: relative; }
.jo-music-icon svg { width: 100%; height: 100%; display: block; }
.jo-slash { opacity: 0; }
.jo-slash-gap { stroke: var(--jo-music-header-bg); }
.btn-music-toggle[aria-pressed="false"] .jo-slash { opacity: 1; }
.jo-eq { position: absolute; right: -3px; bottom: 0; display: flex; align-items: flex-end; gap: 2px; height: 10px; width: 10px; opacity: 0; pointer-events: none; }
.btn-music-toggle[aria-pressed="true"] .jo-eq { opacity: 1; }
.jo-eq span { width: 2px; height: 40%; background: currentColor; border-radius: 1px; transform-origin: bottom; }
.jo-eq span:nth-child(2) { height: 70%; }
.jo-eq span:nth-child(3) { height: 55%; }
.btn-music-toggle.is-playing .jo-eq span:nth-child(1) { animation: jo-eq 480ms ease-in-out infinite; }
.btn-music-toggle.is-playing .jo-eq span:nth-child(2) { animation: jo-eq 480ms ease-in-out 160ms infinite; }
.btn-music-toggle.is-playing .jo-eq span:nth-child(3) { animation: jo-eq 480ms ease-in-out 320ms infinite; }
@keyframes jo-eq { 0%, 100% { transform: scaleY(0.45); } 50% { transform: scaleY(1); } }
.jo-spin { position: absolute; inset: 6px; border-radius: 50%; border: 2px solid transparent; border-top-color: currentColor; opacity: 0; pointer-events: none; }
.btn-music-toggle.is-loading .jo-spin { opacity: 1; animation: jo-spin 700ms linear infinite; }
.btn-music-toggle.is-loading .jo-music-icon { opacity: .35; }
.btn-music-toggle.is-loading .jo-slash { opacity: 0; }
.jo-slash-gap { stroke: var(--jo-music-header-bg); }
@keyframes jo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .jo-eq span, .btn-music-toggle.is-playing .jo-eq span { animation: none !important; transform: none !important; }
  .btn-music-toggle.is-loading .jo-spin { animation: none; opacity: .7; border-right-color: currentColor; }
}
/* Phone header: title left, music right (top of page — never the bottom 120px, never over Roll / how-to). */
@media (max-width: 1023.98px) {
  .phone-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
  .phone-top > h1, .phone-top > .tagline { grid-column: 1; }
  .phone-top > .td-music { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 380px) { .td-music-credit { font-size: 0.6875rem; } }

/* ===== §2+3 Pip — Next mascot; pull the curly question-mark tail (#btn-next) ===== */
.pip-mascot { display: flex; align-items: center; gap: 0; margin-top: 8px; }
.pip-mascot[hidden] { display: none; }
.pip-body { flex: 0 0 auto; width: 64px; height: 64px; transform-origin: 50% 100%; }
.pip-body .pip-eyes-ouch, .pip-body .pip-ouch-mouth { display: none; }
.pip-mascot.pulled .pip-body .pip-eyes-open, .pip-mascot.pulled .pip-body .pip-smile { display: none; }
.pip-mascot.pulled .pip-body .pip-eyes-ouch, .pip-mascot.pulled .pip-body .pip-ouch-mouth { display: inline; }
.thumb-lane .pip-tail#btn-next {
  width: auto; margin: 0 0 0 -6px; padding: 0; min-width: 72px; min-height: 64px;
  display: inline-grid; place-items: center start; background: transparent; border: 0; border-radius: 14px;
  color: inherit; cursor: grab; box-shadow: none; touch-action: manipulation;
}
.thumb-lane .pip-tail#btn-next[hidden] { display: none; }
.thumb-lane .pip-tail#btn-next:active { cursor: grabbing; }
.thumb-lane .pip-tail#btn-next:focus-visible { outline: 3px solid #ffd400; outline-offset: 2px; }
.pip-tail svg { width: 72px; height: 64px; display: block; transform-origin: 0 70%; overflow: visible; }
.pip-talk { min-width: 0; margin-left: 6px; }
.pip-cap { margin: 0; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.pip-cap::before { content: "Pull Pip’s tail → "; color: #ffd400; }
.pip-line { margin: 2px 0 0; font-size: 0.9rem; font-weight: 800; color: #ffd400; min-height: 1.2em; }
.pip-line:empty { min-height: 0; }
@keyframes pip-wiggle { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
@keyframes pip-stretch { 0% { transform: scaleX(1); } 45% { transform: scaleX(1.45) scaleY(0.85); } 100% { transform: scaleX(1); } }
@keyframes pip-ouch { 0% { transform: none; } 30% { transform: translateY(-6px) scale(1.06, 0.92) rotate(-6deg); } 60% { transform: translateY(0) scale(0.96, 1.05) rotate(4deg); } 100% { transform: none; } }
.pip-mascot:not(.pulled) .pip-tail svg { animation: pip-wiggle 1.6s ease-in-out infinite; }
.pip-mascot.pulled .pip-tail svg { animation: pip-stretch 420ms ease-out; }
.pip-mascot.pulled .pip-body { animation: pip-ouch 420ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .pip-mascot .pip-tail svg, .pip-mascot.pulled .pip-tail svg, .pip-mascot.pulled .pip-body { animation: none !important; }
}

/* ===== §6.3 Streak flame (presentation only) ===== */
.flame-meter { display: inline-flex; align-items: baseline; gap: 6px; align-self: center; margin-top: 8px; padding: 4px 12px; border-radius: 999px;
  background: #3a1f1a; border: 1px solid #ff8a3d66; color: #ffd8a8; font-weight: 800; }
.flame-meter[hidden] { display: none; }
.flame-ico { display: inline-block; line-height: 1; transform-origin: 50% 90%; font-size: 1.1rem; }
.flame-meter[data-level="2"] .flame-ico { font-size: 1.3rem; }
.flame-meter[data-level="3"] .flame-ico { font-size: 1.5rem; }
.flame-meter[data-level="4"] .flame-ico { font-size: 1.7rem; }
.flame-meter[data-level="5"] .flame-ico { font-size: 1.9rem; }
.flame-meter[data-level="6"] .flame-ico { font-size: 2.1rem; }
.flame-meter[data-level="7"] .flame-ico { font-size: 2.3rem; }
.flame-meter[data-level="8"] .flame-ico { font-size: 2.5rem; }
.flame-meter[data-level="5"], .flame-meter[data-level="6"], .flame-meter[data-level="7"], .flame-meter[data-level="8"] { background: #4a1f10; border-color: #ff8a3d; box-shadow: 0 0 16px #ff8a3d55; }
.flame-label { font-size: 0.75rem; font-weight: 600; color: #ffb37a; }
@keyframes flame-flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, 0.94) rotate(2deg); } }
@keyframes flame-grow { 0% { transform: scale(0.6); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.flame-meter:not([hidden]) .flame-ico { animation: flame-flicker 900ms ease-in-out infinite; }
.flame-meter.grew .flame-ico { animation: flame-grow 420ms ease-out; }
@media (prefers-reduced-motion: reduce) { .flame-meter .flame-ico, .flame-meter.grew .flame-ico { animation: none !important; } }

/* ===== §6.2 Live scoreboard overtake ===== */
@keyframes lb-overtake { 0% { transform: translateY(8px) scale(0.96); box-shadow: 0 0 0 0 #ffd40000; } 35% { transform: translateY(-3px) scale(1.08); box-shadow: 0 0 0 4px #ffd400aa; } 100% { transform: none; box-shadow: 0 0 0 0 #ffd40000; } }
.lb-overtake { animation: lb-overtake 1.6s ease-out; background: #ffd40033 !important; }
@media (prefers-reduced-motion: reduce) { .lb-overtake { animation: none; outline: 2px solid #ffd400; } }

/* ===== §4 Who's playing (bottom of the left column; in flow, never fixed over the game) ===== */
.who { padding: 10px 12px; margin-top: 8px; flex: 0 0 auto; font-size: 0.8125rem; }
.who-title { margin: 0 0 4px; font-size: 0.875rem; font-weight: 800; }
.who-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.who-list li { margin: 0; }
.who-name { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 10px; border-radius: 999px; background: #3a2f6e; color: var(--twist); text-decoration: none; font-weight: 700; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name:hover { text-decoration: underline; }
.who-empty, .who-note { margin: 2px 0 0; color: var(--muted); }
.who-note { font-size: 0.7rem; }
.who-me { margin: 4px 0 0; }
.who-me:empty { display: none; }
.who-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.who-form[hidden] { display: none; }
.who-label { font-weight: 700; }
.who-input { flex: 1 1 120px; min-width: 0; min-height: 36px; padding: 4px 10px; border-radius: 10px; border: 1px solid #ffffff33; background: #1a1430; color: var(--text); font: inherit; }
.who button.small { margin-left: 0; min-height: 36px; }
.who-hide { margin-top: 6px; }
.who-msg { margin: 4px 0 0; color: #ffd166; }
.who-msg:empty { display: none; }

/* ===== §6.4 Reaction bar (in flow under the question; never fixed) ===== */
.react { padding: 8px 10px; margin-top: 8px; flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.react-bar { display: flex; gap: 6px; }
.react-bar button { min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; border: 1px solid #ffffff22; background: #3a2f6e; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.react-bar button.sent { animation: react-sent 500ms ease-out; }
@keyframes react-sent { 40% { transform: scale(1.3) rotate(-8deg); } }
.react-feed { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1 1 140px; font-size: 0.8rem; color: var(--muted); }
.react-pop { display: inline-flex; gap: 4px; align-items: center; padding: 2px 8px; border-radius: 999px; background: #ffffff10; }
.react-who { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react-msg { margin: 0; width: 100%; font-size: 0.75rem; color: #ffd166; }
.react-msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .react-bar button.sent { animation: none; } }

/* ===== §6.5 Daily banner + badge ===== */
.daily-banner { margin: 0 0 6px; padding: 6px 10px; border-radius: 10px; background: #2d2560; color: #ffe08a; font-size: 0.8125rem; font-weight: 700; }
.daily-banner[hidden] { display: none; }
.daily-banner.badge-pop { background: #4a3a00; color: #fff3b0; box-shadow: 0 0 0 2px #ffd400; }
@media (min-width: 1024px) {
  /* keep the left column's Roll/options visible: who panel is compact and scrolls its own list */
  .who .who-list { max-height: 72px; overflow: auto; }
}

/* ===== Design fold (DesignerBot ASKME-PIP-WHO-DESIGN.md) ===== */
/* Auto-play wait: visible numeric countdown, no hidden button fill. */
/* #Home TechBot f11fa550-0296-4ba4-b2fa-1c1aa1761363 t752u */
#btn-lock { display: none !important; }
.auto-countdown { display: flex; align-items: center; gap: 12px; color: #1a1430; background: #FFE566; border-radius: 14px; padding: 8px 16px; }
.auto-countdown[hidden] { display: none; }
.countdown-number { display: inline-block; min-width: 1ch; font-size: 2.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown-number.is-ticking { animation: countdown-spin 420ms ease-out; }
.countdown-hint { max-width: 22ch; font-size: .85rem; font-weight: 700; }
@keyframes countdown-spin { from { transform: perspective(160px) rotateY(-180deg); opacity: .3; } to { transform: perspective(160px) rotateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .countdown-number.is-ticking { animation: none; }
}

/* Who's playing — desktop: unchanged panel (bottom of the left column, above Roll / how-to safe zone). Chip + close are phone-only. */
.who-chip, .who-close { display: none; }
/* Phone (< 1024px): no persistent panel. A one-line “N playing” chip; tapping it peeks a sheet that overlays (adds no page height)
   and closes on Roll / Ask me / Pip / Esc / outside tap, so a turn still fits one screen. */
@media (max-width: 1023.98px) {
  .who { padding: 0; margin-top: 6px; background: none; border: 0; box-shadow: none; }
  .who-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px; border-radius: 999px; border: 1px solid #ffffff22; background: #3a2f6e; color: var(--text); font: inherit; font-size: 0.8125rem; font-weight: 700; cursor: pointer; }
  .who-chip:focus-visible { outline: 3px solid var(--twist); outline-offset: 2px; }
  .who-dot { width: 8px; height: 8px; border-radius: 50%; background: #2dd4a8; }
  .who-chip.is-empty .who-dot { background: #c9b8ef80; }
  .who-body { display: none; }
  body.q-open .who { display: none; } /* question on screen: chip steps aside so Roll → question stays one screen; peek again between turns */
  .who.is-open .who-body { display: block; position: fixed; z-index: 60; left: 8px; right: 8px; top: max(8px, env(safe-area-inset-top)); max-height: 70vh; overflow: auto; padding: 12px 14px; border-radius: 16px; background: #2a2148; border: 1px solid #8e7fd6; box-shadow: 0 12px 32px #000000a0; }
  .who.is-open .who-close { display: inline-flex; float: right; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -6px -8px 0 0; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; }
}

/* ===== LEVELUP-20261106 (DesignerBot pass 2) · Location: #Home / Bot: BuilderBot / ID: b49f36b1-f6af-459d-9e81-f79eb2fdd652 ===== */
/* 1) One warm colour at a time: while Ask me yellow is the focal, hold drops to a 2px outline and the promo chip mutes. */
body.ask-live .die.held, body.ask-live #dice .die.held { border-color: transparent; outline: 2px solid var(--hold); outline-offset: 2px; box-shadow: none; }
body.ask-live .die.held .badge { background: #ffb703; color: #1a1430; box-shadow: none; border: 2px solid var(--hold); }
body.ask-live .season-strip { opacity: 0.45; filter: saturate(0.2); }
body.ask-live .flame-meter { background: #2a2148; border-color: #ffffff22; color: #c9b8ef; }

/* 2) Tiny die in the score chip: five pips light standard die faces for turns 1–5 (visual only). */
.turn-die-pill { display: inline-flex; align-items: center; padding: 4px 8px; }
.turn-die { position: relative; display: inline-block; width: 22px; height: 22px; border-radius: 5px; background: #fff8e7; border: 1.5px solid #2a2148; }
.turn-die .tp { position: absolute; width: 5px; height: 5px; border-radius: 50%; box-sizing: border-box; border: 1px solid #2a214880; background: transparent; }
.turn-die .tp1 { top: 3px; left: 3px; } .turn-die .tp2 { top: 3px; right: 3px; } .turn-die .tp3 { top: 7px; left: 7px; }
.turn-die .tp4 { bottom: 3px; left: 3px; } .turn-die .tp5 { bottom: 3px; right: 3px; }
.turn-die .tp.on { background: #2a2148; border-color: #2a2148; }

/* 3) Pip mood — reuses the motion table: correct = 180 ms mint wash on cheeks, wrong = 280 ms 3-step shake on the tail. */
.pip-mascot .pip-body circle[fill="#ff8a9b"] { transition: fill 180ms ease-out; }
.pip-mascot.mood-good .pip-body circle[fill="#ff8a9b"] { animation: pip-mint 180ms ease-out; }
.pip-mascot.mood-bad .pip-tail svg { animation: pip-shake 280ms steps(3, end); }
@keyframes pip-mint { 0% { fill: #ff8a9b; } 50% { fill: #7ef0c8; } 100% { fill: #ff8a9b; } }
@keyframes pip-shake { 0% { transform: translateX(0); } 33% { transform: translateX(-5px); } 66% { transform: translateX(5px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .pip-mascot.mood-good .pip-body circle, .pip-mascot.mood-bad .pip-tail svg { animation: none !important; } }

/* 4) Run-end card: onepage-r2 ?state=profile dark card, 1200×630 aspect, username only. */
.end-card-wrap { margin-top: 10px; }
.end-card-wrap[hidden] { display: none; }
.end-card { box-sizing: border-box; width: 100%; max-width: 600px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #2a2148; color: #fff8e7; border: 1px solid #8e7fd6; border-radius: 16px; aspect-ratio: 1200 / 630; }
.end-card .profile-back { align-self: flex-start; min-height: 44px; background: none; border: 0; color: #c9b8ef; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.end-initial { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #6c5ce7; color: #fff8e7; font-weight: 800; font-size: 1.6rem; }
.end-card h2 { margin: 0; font-size: 1.5rem; }
.end-card .profile-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.end-card .profile-stats div { background: #3a2f6e; border-radius: 12px; padding: 10px 14px; }
.end-card .profile-stats span { display: block; font-size: 0.8125rem; color: #c9b8ef; }
.end-card .profile-privacy { margin: 0; font-size: 0.8125rem; color: #c9b8ef; }

/* 5) Shared thumb lane; phone question 60/40 and end-card focus.
   Location: #Home / Bot: BuilderBot / ID: b49f36b1-f6af-459d-9e81-f79eb2fdd652 */
#q-card #prompt.q-small { font-size: 1rem; }
.thumb-lane { background: var(--card); border-radius: var(--radius); padding: 12px; }
.thumb-lane #btn-roll { width: 100%; min-height: 48px; }
@media (min-width: 1024px) {
  /* thumb-lane lives inside .play-well now (t482u); do not display:contents / stage-grid place it. */
  .thumb-lane:not(.play-controls) { display: contents; }
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); grid-template-rows: minmax(0, 1fr); }
  .stage > .col-dice { grid-column: 1; grid-row: 1; height: auto; }
  .stage > .col-play { grid-column: 2; grid-row: 1; height: auto; overflow: hidden; min-height: 0; }
  .stage > .rail { display: none; grid-column: 3; grid-row: 1; }
}
@media (min-width: 1440px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 300px; }
  .stage > .rail { display: flex; }
}
@media (max-width: 1023.98px) {
  #q-card #prompt { font-size: 1.25rem; line-height: 1.3; }
  #q-card #prompt.q-small { font-size: 1rem; }
  /* t482u pass-5: no sticky lane on phone — a sticky lane covers actionable well content (Wild picks) whenever the
     well is taller than the viewport. Controls stay in normal flow; layout keeps them on the first screen instead. */
  .thumb-lane.play-controls { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .thumb-lane .pip-mascot { margin-top: 8px; }
  body.q-open, body.end-open { height: 100vh; overflow: hidden; }
  body.q-open .shell, body.end-open .shell { height: 100vh; min-height: 0; padding: 0 12px; overflow: hidden; }
  body.q-open .phone-top, body.end-open .phone-top,
  body.q-open .col-dice, body.end-open .col-dice,
  body.q-open .lb-top, body.end-open .lb-top,
  body.q-open .season-strip, body.end-open .season-strip,
  body.q-open footer, body.end-open footer,
  body.q-open .lb-bottom, body.end-open .lb-bottom,
  body.q-open #react, body.end-open #react { display: none; }
  body.q-open .stage, body.end-open .stage { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; min-height: 0; gap: 0; }
  body.q-open .col-play, body.end-open .col-play {
    grid-row: 1; min-height: 0; overflow: hidden;
    display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px;
  }
  body.q-open #q-card { display: flex; flex-direction: column; grid-row: 1; min-height: 0; overflow: auto; margin: 0; height: auto; }
  body.q-open .play-well, body.end-open .play-well {
    display: flex; flex-direction: column; justify-content: flex-end; grid-row: 2;
    flex: 0 0 auto; min-height: 0; max-height: none; overflow: visible; margin: 0; padding: 8px 10px;
  }
  body.q-open .well-main,
  body.end-open .well-main { display: none !important; }
  /* Question: centre the HUD+prompt+choices block in the card (safe auto margins, no empty bottom). */
  body.q-open #q-card > :first-child { margin-top: auto; }
  body.q-open #q-card > :last-child { margin-bottom: auto; }
  body.q-open .thumb-lane.play-controls, body.end-open .thumb-lane.play-controls {
    position: static; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  }
  .thumb-lane > * { flex-shrink: 0; }
  body.q-open .thumb-lane .dice-actions { margin: 0; }
  body.end-open .col-play { grid-template-rows: minmax(0, 1fr) auto; }
  body.end-open #q-card { display: none; }
  body.end-open #end-card-wrap { margin: 0; grid-row: 1; min-height: 0; overflow: auto; padding: 8px 0; }
  @supports (height: 100dvh) {
    body.q-open, body.end-open, body.q-open .shell, body.end-open .shell { height: 100dvh; }
  }
}


/* ===== t482u layout pass-3 (HOLD fixes) · STAGE ONLY · BuilderBot =====
   pass-4 ROOT CAUSE (replaces pass-3 howto sizing): <details> lays out every non-<summary>
   child inside a UA-internal content box (::details-content / shadow slot), so .howto-body
   and .howto-cta were never flex items of <details>. "flex:1; min-height:0" on .howto-body
   did nothing; the body grew to full content height; <details max-height + overflow:hidden>
   then clipped body+CTA (Got it y1012/y1420). overflow:hidden is script-scrollable but not
   wheel/touch-scrollable, and the non-overflowing .howto-body chained the wheel to the page.
   Phone Roll: position:sticky inside .play-well overflow:hidden never sticks to the viewport
   (pass-5: sticky removed on phone altogether — it overlaid Wild picks).
   Desktop Wild: every well child was flex:0 0 auto inside overflow:hidden, so the well
   clipped the LAST children (Reroll) instead of giving way.
   Fix (pass-4; RC3 supersedes: body now natural flow, .well-main sole desktop scroller): .howto-body was bounded, the only rules
   scroller; <details> is plain block; CTA follows the body; .well-main holds narrator/dice/rules
   (desktop: flexible + overflow fallback), .play-controls sits outside it and never shrinks.
   Bound first-screen rules+CTA; collapse closed howto (no empty well);
   CTA not sticky-over-chips; phone q-open well = controls only; Wild picks >=44px.
   Archaeology: grid-template-columns: 1fr 1.4fr 300px
*/
.side-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-width: 0; }
.side-card .seed-row { margin-top: 0; }

.col-play {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.play-well {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #1a1430;
  border: 1px solid #ffffff18;
  border-radius: var(--radius);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--lift);
}
.play-well #narrator {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: #c9b8ef;
  flex: 0 0 auto;
}
.well-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
/* Safe vertical centering: flexible spacers absorb free space and shrink to 0 on overflow (nothing unreachable).
   pass-5: replaces child auto margins, which lost on specificity to `.play-well #narrator{margin:0}` and
   `.play-well .play-howto.howto{margin:0}` — that is why collapsed content sat at the top with ~200px below.
   Negative margins cancel the extra flex gap the spacers would add. */
.well-main::before,
.well-main::after { content: ''; flex: 1 1 0; min-height: 0; }
.well-main::before { margin-bottom: -10px; }
.well-main::after { margin-top: -10px; }
body:not(.td-run-live) .play-well .readout-card { display: none; } /* idle/first load: no empty result bar */
.play-well .readout-card .rule-line { margin-top: 0; }
.play-well .dice-mid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  min-height: 0;
}
.play-well #dice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  justify-items: center;
  align-items: center;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}
.play-well #dice .die,
#dice .die {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 128px;
  min-height: 0;
  height: auto;
  border-radius: 16px;
  box-sizing: border-box;
}
.play-well .readout-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
  text-align: center;
}
.play-well .flame-meter { align-self: center; flex: 0 0 auto; }

/* Wild category picks: robust 2-col grid, >=44px taps (phone + desktop). */
.play-well .wild-row,
.wild-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  justify-items: stretch;
}
.wild-row .wild-label {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffe08a;
  text-align: center;
}
.wild-row .wild-pick,
button.wild-pick {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  border-radius: 12px;
}
.wild-row[hidden] { display: none !important; }

/* How-to: plain block <details> (no max-height / overflow / flex on it — see pass-4 root cause).
   Closed = summary chip only. Open = summary + CTA + .howto-body in natural flow.
   RC3: .howto-body is no longer a scroller at any width (no nested scroll boundary, no wheel/key shim);
   desktop: .well-main is the single scroll owner; phone: the page. */
.play-well .play-howto.howto {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 1px solid #ffffff14;
  border-radius: 12px;
  box-shadow: none;
}
.play-well .play-howto > .howto-chip {
  display: block;
  list-style: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 20px;
  color: #fff8e7;
  min-height: 44px;
  padding: 12px;
  box-sizing: border-box;
}
.play-howto .howto-chip::-webkit-details-marker { display: none; }
.play-well .play-howto > .howto-chip::before { content: '▸'; color: #ffe08a; margin-right: 6px; }
.play-well .play-howto[open] > .howto-chip::before { content: '▾'; }
.play-howto .howto-body {
  max-height: none;
  overflow: visible;
  padding: 0 12px 4px;
}
.play-howto .howto-body:focus-visible { outline: 3px solid #ffd400; outline-offset: -3px; }
.play-howto:not([open]) .howto-body,
.play-howto:not([open]) .howto-cta { display: none !important; }
.play-howto .howto-one { margin: 0 0 8px; color: #c9b8ef; font-size: 0.8125rem; }
.play-howto .howto-steps { margin: 0; padding: 0; list-style: none; }
.play-howto .howto-steps > li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; margin: 0 0 8px; }
.play-howto .howto-steps h3 { margin: 0 0 2px; font-size: 0.875rem; color: #fff8e7; }
.play-howto .howto-steps p { margin: 0; font-size: 0.8125rem; color: #c9b8ef; }
.play-howto .howto-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: #3a2f6e; color: #fff8e7; font-weight: 800; font-size: 0.75rem;
}
.play-howto .howto-twist h3 { margin: 8px 0 6px; font-size: 0.875rem; }
.play-howto .twist-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.play-howto .twist-grid li {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px;
  border-radius: 10px; background: #2a2148; border: 1px solid #ffffff14; font-size: 0.75rem;
}
.play-howto .howto-note { margin: 8px 0; font-size: 0.75rem; color: #c9b8ef; }
/* CTA sits between summary and rules body in normal flow — NOT position:sticky (never covers chips). */
.play-howto .howto-cta,
.howto-cta {
  position: static !important;
  margin: 0 0 8px;
  padding: 0 12px 10px;
  background: transparent;
  border-top: 0;
  border-bottom: 1px solid #ffffff14;
  border-radius: 0;
}
#btn-howto-go {
  width: 100%; min-height: 48px; margin: 0; padding: 10px 14px;
  border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: 800;
  color: #1a1430;
  background: linear-gradient(180deg, #FFE566 0%, #FFCC00 100%);
  box-shadow: 0 4px 0 #b38f00;
}
#btn-howto-go:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#btn-howto-go:active { transform: translateY(2px); box-shadow: 0 2px 0 #b38f00; }

/* Controls strip inside the well. */
.play-well > .thumb-lane.play-controls {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "roll pip"
    "actions pip";
  gap: 8px 12px;
  align-items: end;
  margin: 0;
  padding: 10px 0 0;
  background: transparent;
  border-radius: 0;
  border-top: 1px solid #ffffff14;
}
.play-controls > #btn-roll { grid-area: roll; width: 100%; max-width: none; margin: 0; min-height: 48px; }
.play-controls > .dice-actions {
  grid-area: actions; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; width: 100%;
}
.play-controls > .dice-actions > * { flex: 1 1 140px; min-height: 44px; }
.play-controls > .pip-mascot {
  grid-area: pip; margin: 0; align-self: end; justify-self: end; max-width: 220px;
}
body.q-open .play-howto,
body.end-open .play-howto { display: none !important; }

#dice .die.rolling { animation: td-die-wobble 380ms ease-in-out; }
@keyframes td-die-wobble {
  0% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-10deg) translateY(-6px); }
  50% { transform: rotate(8deg) translateY(2px); }
  75% { transform: rotate(-6deg) translateY(-3px); }
  100% { transform: rotate(0) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #dice .die.rolling { animation: none !important; }
}

.tut-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: flex; justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.tut-sheet .tut-box {
  pointer-events: auto; max-width: 420px; width: 100%;
  padding: 14px 16px; margin-bottom: 88px;
  background: #2a2148; color: #fff8e7; border: 1px solid #8e7fd6; border-radius: 16px;
  box-shadow: 0 12px 32px #000000a0;
}
.tut-sheet .lb-btns { display: flex; gap: 8px; }
.tut-sheet .lb-btns button {
  flex: 1; min-height: 44px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer;
  background: #6c5ce7; color: #fff;
}
.tut-sheet .lb-btns button.secondary { background: #3a2f6e; color: #f7f2ff; border: 1px solid #ffffff22; }
/* t482u RC2: 'Start a new round?' actions — scoped 44px buttons (were unstyled UA buttons). #fff/#5a4bd1 6.25:1, #f7f2ff/#3a2f6e 10.5:1. */
.nr-modal .lb-btns button {
  flex: 1 1 140px; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; cursor: pointer; background: #5a4bd1; color: #fff;
}
.nr-modal .lb-btns button.secondary { background: #3a2f6e; color: #f7f2ff; border: 1px solid #ffffff22; }
.nr-modal .lb-btns button:focus-visible { outline: 3px solid #111; outline-offset: 2px; } /* white .lb-box: #111 ring 18.9:1 */

@media (min-width: 1024px) {
  .stage {
    grid-template-columns: minmax(180px, 0.7fr) minmax(0, 2.1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 12px;
    align-items: stretch;
  }
  .stage > .col-dice { grid-column: 1; grid-row: 1; height: auto; min-width: 0; gap: 12px; }
  .stage > .col-play { grid-column: 2; grid-row: 1; height: auto; overflow: hidden; min-width: 0; }
  .stage > .rail { display: none; grid-column: 3; grid-row: 1; min-width: 0; }
  /* pass-3 intended 112px dice but `.play-well #dice .die` (higher specificity) kept them at 128px. */
  .play-well #dice .die { max-width: 112px; }
  body.td-howto-open .play-well #dice .die { max-width: 96px; } /* rules-first screen: rules get the space */
  /* Desktop budget @1280x800: well ~547px = 30 pad/border + 10 gap + controls ~69 + main ~438.
     Main (rules open) = narrator 20 + 10 + dice 96 + 10 + summary/borders 46 + body + CTA 67.
     RC3: body is natural flow; .well-main is the ONE desktop scroll owner (wheel/keys/scrollbar native);
     controls (.play-controls) sit outside it and never clip. */
  .well-main { overflow-y: auto; overscroll-behavior: contain; }
  body.q-open .col-play {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
  }
  body.q-open #q-card { grid-row: 1; min-height: 0; overflow: auto; }
  body.q-open .play-well {
    grid-row: 2; flex: 0 0 auto; overflow: visible; padding: 10px 14px; max-height: none;
  }
  body.q-open .well-main { display: none !important; }
  body.end-open .col-play {
    display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px;
  }
  body.end-open #end-card-wrap { grid-row: 1; min-height: 0; overflow: auto; }
  /* t482u RC2: q-open stays on at run end, so #q-card also claimed grid-row 1 and auto-placement opened an implicit
     third column (end card squeezed to the right). The end card owns the central area, as on phone. */
  body.end-open #q-card { display: none; }
  body.end-open .play-well { grid-row: 2; flex: 0 0 auto; }
  body.end-open .well-main { display: none !important; }
}
@media (min-width: 1440px) {
  .stage { grid-template-columns: minmax(200px, 0.65fr) minmax(0, 2.2fr) minmax(160px, 200px) !important; }
  .stage > .rail { display: flex; }
  .rail .amazon-card { width: 100%; max-width: 180px; }
  .play-well #dice .die { max-width: 128px; }
  body.td-howto-open .play-well #dice .die { max-width: 104px; }
}

@media (max-width: 1023.98px) {
  .seed-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .shell { max-width: 520px; }
  body:not(.q-open):not(.end-open):not(.td-run-live) .lb-top { display: none; }
  body:not(.q-open):not(.end-open):not(.td-run-live) .season-strip { display: none; }
  body:not(.q-open):not(.end-open) #react { display: none; }
  body:not(.q-open):not(.end-open) .phone-footer-more,
  body:not(.q-open):not(.end-open) .site-foot,
  body:not(.q-open):not(.end-open) .lb-bottom { display: none; }
  .stage { gap: 8px; }
  .col-dice { order: 0; }
  .col-play { order: 1; flex: 1 1 auto; min-height: 0; }
  /* RC1: during a live run the options card (Daily/Dare/Kid/Contrast/How to play/who) is hidden on phone, as it
     already is while a question is open. Visual order = DOM/Tab order (pass-5 order:-1 removed) and no Daily/Dare
     strip can peek under the well. The card returns when the run ends. */
  body.td-run-live .col-dice { display: none; }
  .side-card { padding: 10px; }
  .who { margin-top: 4px; }
  /* First screen: dice + bounded rules body + CTA + Roll — no 868px rules dump. */
  .play-well {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }
  /* Phone page scrolls; the well must not become a clipping/scroll container (pass-3 overflow:hidden). */
  .play-well { overflow: visible; padding: 12px; }
  .well-main { overflow: visible; }
  /* RC1: phone rules use natural page flow — no nested scroller, so touch, wheel and keys all just scroll the page.
     First screen @390x844: dice, summary, Got it (~y525-590), start of the rules; Roll follows the rules,
     and Got it collapses them so Roll comes straight up. */
  body.td-howto-open .play-well #dice .die { max-width: 84px; }
  .play-well .play-howto > .howto-chip { font-size: 0.8125rem; padding: 12px 10px; }
  .play-howto .howto-body { padding: 0 10px 4px; }
  .play-howto .howto-steps p { font-size: 0.75rem; }
  .play-well #dice { max-width: 320px; gap: 8px; }
  .play-well #dice .die { max-width: 96px; }
  .play-well > .thumb-lane.play-controls {
    grid-template-columns: 1fr;
    grid-template-areas:
      "roll"
      "actions"
      "pip";
  }
  .play-controls > .pip-mascot { justify-self: start; max-width: none; }
  .wild-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wild-row .wild-pick { min-height: 44px; }
  /* t317u: 390px phone and iPad portrait — one viewport, no document scroll. */
  .phone-footer-more, .site-foot, .lb-bottom { display: none !important; }
  .play-well { overflow: hidden; min-height: 0; }
  .well-main { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  .col-play { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
}

.audience-note{margin:.4rem 0 0;font-size:.72rem;line-height:1.3;opacity:.75;font-weight:400}


/* ===== t317u: one viewport, no page scroll; top countdown overlay (390 phone + iPad + desktop) ===== */
html, body, body.onepage-desk {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}
@supports (height: 100dvh) {
  html, body, body.onepage-desk { height: 100dvh; max-height: 100dvh; }
}
body, body.onepage-desk {
  display: flex;
  flex-direction: column;
}
body .lb-top,
body .season-strip { flex: 0 0 auto; }
body .shell {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body .stage { flex: 1 1 auto; min-height: 0; }
body.td-run-live #btn-roll { display: none !important; }

/* Big countdown always visible at the TOP of the viewport (not in the bottom controls). */
.auto-countdown-overlay {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #1a1430;
  background: #FFE566;
  border-radius: 18px;
  padding: 12px 20px;
  box-shadow: 0 10px 32px #00000088;
  max-width: calc(100vw - 24px);
}
.auto-countdown-overlay[hidden] { display: none; }
.auto-countdown-overlay .countdown-number {
  font-size: 4.5rem;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}
.auto-countdown-overlay .countdown-hint {
  max-width: 18ch;
  font-size: 1rem;
  font-weight: 700;
}
.btn-stop {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: #1a1430;
  color: #fff8e7;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-stop:focus-visible { outline: 3px solid #1a1430; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .auto-countdown-overlay .countdown-number.is-ticking { animation: none; }
}

@media (min-width: 600px) and (max-width: 1023.98px) {
  /* iPad-sized widths in the phone breakpoint */
  .auto-countdown-overlay .countdown-number { font-size: 5rem; }
}
