/* Retro Poster (paper, outlines, stacked titles) + Comic Pop (halftone, bubbles).
   Light only by design. */

@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-wght.woff2") format("woff2-variations"),
       url("assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Lalezar";
  src: url("assets/fonts/lalezar/lalezar-arabic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: "Lalezar";
  src: url("assets/fonts/lalezar/lalezar-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF;
}

:root {
  --bg: #f8ebd7;
  --surface: #fff9ef;
  --surface-2: #f2cf94;
  --ink: #1b1a17;
  --ink-soft: #5e554a;
  --line: #1b1a17;
  --line-soft: rgba(27, 26, 23, .16);
  --accent: #cc3366;
  --accent-ink: #ffffff;
  --gold: #ffc93c;
  --pink: #ff9cc8;
  --pink-dot: #ff73b1;
  --teal: #13998f;
  --brown: #6b4a2b;
  --ok: #13805f;
  --bad: #d1344b;
  --kourosh: #2f6bd8;
  --iman: #13998f;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --display: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --halftone: radial-gradient(circle, rgba(27, 26, 23, .12) 1px, transparent 1.4px) 0 0 / 7px 7px;
  --comic: radial-gradient(circle, var(--pink-dot) 32%, transparent 34%) 0 0 / 11px 11px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

/* pops, shakes and confetti must never open a sideways scroll on phones */
html, body { overflow-x: clip; }

body {
  background:
    radial-gradient(circle, #cc3366 1.3px, transparent 1.7px) 0 0 / 46px 52px,
    radial-gradient(circle, #13998f 1.3px, transparent 1.7px) 17px 23px / 58px 44px,
    radial-gradient(circle, #ffc93c 1.5px, transparent 1.9px) 31px 9px / 40px 61px,
    var(--bg);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.demo-banner {
  background: var(--ink);
  color: var(--gold);
  text-align: center;
  font-size: 13px;
  padding: 6px 16px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2.5px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 21px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  white-space: nowrap;
  text-shadow: 1.5px 1.5px 0 var(--gold);
}
.brand-text small { color: var(--ink-soft); font-size: 12px; }

.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 3px;
  border-radius: 999px;
}

.tabs a {
  position: relative;
  z-index: 1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.tabs a.active { color: var(--ink); }

.tab-ink, .seg-ink {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 0;
  background: var(--gold);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  transition: transform .32s var(--ease-out), width .32s var(--ease-out);
}

/* ---------- layout ---------- */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 16px 80px;
  outline: none;
}

main.wide { max-width: 1080px; }

.card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.stack > * + * { margin-top: 16px; }

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin: 0;
}

h1, h2, h3 { line-height: 1.4; margin: 0; font-family: var(--display); font-weight: 400; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 20px; }

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  vertical-align: middle;
}

.chip.open { background: #c9f0dd; }
.chip.closed { background: var(--gold); }
.chip.resolved { background: #cfdcff; }

/* ---------- episode hero ---------- */

.hero {
  position: relative;
  background: var(--halftone), var(--surface-2);
  color: var(--ink);
}

/* comic speech bubble */
.hero .eyebrow {
  display: inline-block;
  position: relative;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.hero .eyebrow::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 16px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.hero h1 {
  margin-top: 4px;
  font-size: 32px;
  text-shadow: 1.5px 1.5px 0 var(--gold), 3px 3px 0 var(--accent);
}

.hero .chip { background: var(--surface); }
.hero .chip.open { background: #c9f0dd; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.countdown {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.countdown div {
  min-width: 66px;
  text-align: center;
  background: var(--ink);
  color: var(--gold);
  border-radius: 10px;
  padding: 4px 8px 6px;
}

.countdown b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.3; }
.countdown span { font-size: 11px; color: #f8ebd7; }

/* ---------- nickname ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }

input[type="text"], select {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
}

.avatar-row { display: flex; flex-wrap: wrap; gap: 8px; }

.avatar-btn {
  width: 46px;
  height: 46px;
  font-size: 22px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #fff;
}

.avatar-btn[aria-pressed="true"] {
  background: var(--gold);
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 8px 18px 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
  .opt:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-sm); }
  .template-row button:hover { background: var(--gold); border-style: solid; }
  .brand:hover .brand-mark { animation: wiggle .5s var(--ease-out); }
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn.dark { background: var(--gold); color: var(--ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }

.privacy-note {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  background: #c9f0dd;
  border: 2px dashed var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}

/* ---------- question cards ---------- */

.q-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.q-num {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--surface-2);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0 8px;
}

.options { display: grid; gap: 10px; }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: right;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #fff;
  overflow: hidden;
  min-height: 56px;
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}

.opt:not(:disabled):active { transform: translate(2px, 2px) scale(.985); box-shadow: none; }
.opt:disabled { cursor: default; }

/* halftone result bar: comic dots over a light wash of the option color */
.opt .fill {
  position: absolute;
  inset: 0 0 0 auto;
  width: 0;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--c, var(--accent)) 70%, transparent) 30%, transparent 34%) 0 0 / 7px 7px,
    color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
  border-left: 2px solid color-mix(in srgb, var(--c, var(--accent)) 60%, transparent);
  transition: width .75s var(--ease-out);
}

.opt > *:not(.fill) { position: relative; }

.opt .label { flex: 1; font-weight: 800; font-size: 17px; }
.opt .pct { font-family: var(--display); font-size: 21px; min-width: 3.2ch; text-align: left; opacity: 0; }
.revealed .opt .pct { opacity: 1; }

.opt.mine {
  background: #fffbe8;
  box-shadow: var(--shadow-sm);
  transform: translate(-1px, -1px);
}

.opt.mine .label::after { content: " ✔"; color: var(--ok); }
.opt.correct { border-color: var(--ok); box-shadow: 3px 3px 0 var(--ok); }
.opt.wrong-mine { border-color: var(--bad); box-shadow: 3px 3px 0 var(--bad); }

.badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c, var(--surface-2));
  border: 2px solid var(--ink);
  color: #fff;
  font-family: var(--display);
  font-size: 18px;
  padding-bottom: 2px;
}

.badge.text { background: var(--surface-2); color: var(--ink); font-size: 18px; }

.q-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.points-earned { font-weight: 800; color: var(--ok); }
.points-missed { font-weight: 800; color: var(--bad); }

/* celebration panels use the comic page */
.done-card {
  text-align: center;
  background: var(--comic), var(--pink);
}

.done-card h2 {
  display: inline-block;
  background: var(--gold);
  border: 2.5px solid var(--ink);
  padding: 2px 14px 4px;
  transform: rotate(-1.5deg);
}

.done-card .muted { color: var(--ink); font-weight: 600; }

.done-card .big-emoji {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  font-size: 38px;
  background: #fff;
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 79% 32%, 100% 40%, 84% 55%, 96% 75%, 73% 76%, 68% 98%, 50% 84%, 32% 98%, 27% 76%, 4% 75%, 16% 55%, 0 40%, 21% 32%, 18% 10%, 39% 18%);
}

/* ---------- leaderboard ---------- */

.seg {
  position: relative;
  display: inline-flex;
  background: var(--surface);
  border: 2px solid var(--ink);
  padding: 3px;
  border-radius: 999px;
  gap: 4px;
}

.seg button {
  position: relative;
  z-index: 1;
  border: 1.5px solid transparent;
  background: transparent;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.seg button[aria-pressed="true"] { color: var(--ink); }

.podium-card { background: var(--comic), var(--pink); }

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 8px;
  text-align: center;
}

.podium .p {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px 12px 4px 4px;
  padding: 10px 6px;
}

.podium .p .av { font-size: 28px; line-height: 1.25; }
.podium .p { min-width: 0; }
.podium .p .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .p .pt { font-family: var(--display); font-size: 22px; }
.podium .p1 { padding-top: 26px; background: var(--gold); box-shadow: var(--shadow-sm); }
.podium .p2 { padding-top: 16px; }

.rows { list-style: none; margin: 0; padding: 0; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1.5px dashed var(--line-soft);
}

.row:last-child { border-bottom: none; }
.row .rk { width: 44px; font-family: var(--display); font-size: 18px; color: var(--ink-soft); }
.row .av { font-size: 20px; }
.row .nm { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.row .pt { font-family: var(--display); font-size: 20px; }

.row.me {
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding-inline: 10px;
  margin: 4px 0;
}

.row.me .rk { color: var(--ink); }

.gap-row { text-align: center; color: var(--ink-soft); padding: 2px; }

/* ---------- team panel ---------- */

.team-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .team-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
}

.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.35; }
.stat span { font-size: 13px; color: var(--ink-soft); }

.effort {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 2px dashed var(--ink);
  background: #c9f0dd;
  border-radius: 14px;
  padding: 12px 14px;
}

.effort .clock { font-size: 28px; }
.effort b { color: var(--ok); }

.tq {
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.tq + .tq { margin-top: 10px; }

.tq-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tq-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 999px;
  padding: 3px 12px 3px 6px;
  font-size: 14px;
  font-weight: 700;
}

.tq-opt .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--ink-soft)); border: 1.5px solid var(--ink); }
.tq-opt .n { color: var(--ink-soft); font-weight: 600; }

.tq-opt[aria-pressed="true"] {
  background: #c9f0dd;
  box-shadow: 2px 2px 0 var(--ink);
}

.tq-opt[aria-pressed="true"]::after { content: "✅"; }

.template-row { display: flex; flex-wrap: wrap; gap: 6px; }

.template-row button {
  border: 2px dashed var(--ink);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
}


.draft-list { list-style: none; padding: 0; margin: 0; }
.draft-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1.5px dashed var(--line-soft); }
.draft-list button { border: none; background: none; color: var(--bad); font-weight: 800; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.insight {
  border-inline-start: 4px solid var(--accent);
  padding: 4px 12px;
  margin: 0;
}

/* ---------- on-screen graphic: the comic page ---------- */

.screen-wrap { max-width: 1080px; }

.stage {
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  overflow: hidden;
  container-type: inline-size;
  background: radial-gradient(circle, var(--pink-dot) 32%, transparent 34%) 0 0 / 1.3cqw 1.3cqw, var(--pink);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4cqw 5cqw;
  gap: 2cqw;
}

.stage.chroma { background: #00b140; }

.stage .s-eyebrow {
  font-size: 2cqw;
  font-weight: 800;
  background: #fff;
  border: .3cqw solid var(--ink);
  border-radius: 2cqw;
  padding: .1cqw 1.6cqw .3cqw;
}

.stage .s-title {
  font-family: var(--display);
  font-size: 5cqw;
  line-height: 1.35;
  background: var(--gold);
  border: .4cqw solid var(--ink);
  box-shadow: .6cqw .6cqw 0 var(--ink);
  padding: .2cqw 2cqw .6cqw;
  transform: rotate(-1deg);
}

.stage .s-bars { flex: 1; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 2cqw; }

.s-bar {
  display: grid;
  grid-template-columns: 13cqw 1fr 9cqw;
  align-items: center;
  gap: 2cqw;
  font-family: var(--display);
  font-size: 3.4cqw;
}

.s-bar > span:first-child {
  background: #fff;
  border: .3cqw solid var(--ink);
  border-radius: 1cqw;
  text-align: center;
  padding-bottom: .3cqw;
}

.s-bar .track {
  height: 5.6cqw;
  border-radius: .8cqw;
  background: #fff;
  border: .35cqw solid var(--ink);
  overflow: hidden;
}

.s-bar .bar {
  height: 100%;
  width: 0;
  background:
    radial-gradient(circle, var(--c, var(--accent)) 40%, transparent 43%) 0 0 / 1cqw 1cqw,
    color-mix(in srgb, var(--c, var(--accent)) 45%, #fff);
  border-left: .35cqw solid var(--ink);
  transition: width 1.1s var(--ease-out);
}

.s-bar.win .track { box-shadow: 0 0 0 .5cqw var(--gold); }
.s-bar .pc { text-align: left; color: var(--ink); min-width: 3.2ch; }
.stage .s-foot { align-self: stretch; display: flex; justify-content: space-between; font-size: 1.8cqw; font-weight: 700; }
.stage.chroma .s-foot { color: #fff; }

.screen-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.screen-controls select { width: auto; flex: 1; min-width: 220px; }
.screen-controls .btn { font-size: 17px; padding: 6px 14px 8px; }

/* ---------- toast & modal ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--gold);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 8px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .28s var(--ease-pop);
  max-width: calc(100vw - 32px);
  text-align: center;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 26, 23, .55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

.modal[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px;
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
}

.modal-box img { width: 100%; border-radius: 10px; border: 2px solid var(--ink); display: block; }

/* ---------- intro film ---------- */

.banner-video {
  margin-inline-start: 8px;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  padding: 1px 10px 3px;
  cursor: pointer;
  white-space: nowrap;
}

.modal-box.video-box { width: min(880px, 100%); padding: 14px; }

.video-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.video-head h2 { font-size: 24px; }

.icon-close {
  flex: none;
  width: 38px;
  height: 38px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font: 800 16px/1 Vazirmatn, Tahoma, sans-serif;
  cursor: pointer;
}

.film {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: var(--pink);
}

.film video { width: 100%; height: 100%; display: block; object-fit: contain; }

.film-play {
  /* under the poster's title card, not on it */
  position: absolute;
  inset: auto 0 9%;
  margin: 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .14s var(--ease-out);
}

.film-play svg { width: 46%; height: 46%; }
.film-play:active { transform: scale(.94); }

.film-end {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  align-content: center;
  padding: 16px;
  background: rgba(248, 235, 215, .9);
  animation: fade-in .3s var(--ease-out);
}

.film-play[hidden], .film-end[hidden] { display: none; }

.video-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.video-foot small { color: var(--ink-soft); font-weight: 700; }
.video-foot .btn { font-size: 17px; padding: 4px 14px 6px; }

@media (max-width: 520px) {
  .modal-box.video-box { padding: 12px; }
  .video-head h2 { font-size: 19px; }
  .film-play { width: 50px; height: 50px; bottom: 5%; border-width: 2.5px; box-shadow: var(--shadow-sm); }
  .film-end .btn { font-size: 16px; padding: 4px 12px 6px; }
  .video-foot .btn { width: 100%; }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .brand-text strong { font-size: 19px; }
  .brand-mark { width: 36px; height: 36px; font-size: 19px; }
  .tabs a { padding: 3px 8px; font-size: 13px; }
  h1, .hero h1 { font-size: 26px; }
}



/* =====================================================================
   Motion. Chrome stays under 300ms; data reveals and celebrations can
   run longer because they are the moments people came for.
   ===================================================================== */

@keyframes enter-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.8) rotate(-18deg); } 70% { opacity: 1; transform: scale(.92) rotate(4deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes stamp-tilt { 0% { opacity: 0; transform: scale(1.6) rotate(-14deg); } 70% { opacity: 1; transform: scale(.95) rotate(1deg); } 100% { opacity: 1; transform: rotate(-1.5deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes tick { from { transform: translateY(-45%); opacity: 0; } }
@keyframes float-up { 0% { opacity: 0; transform: translateY(10px) scale(.9); } 60% { opacity: 1; transform: translateY(-4px) scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes celebrate-in { 0% { opacity: 0; transform: scale(.92) rotate(-1.5deg); } 70% { opacity: 1; transform: scale(1.02) rotate(.4deg); } 100% { transform: none; } }
@keyframes burst-in { 0% { transform: scale(.4) rotate(-90deg); opacity: 0; } 70% { transform: scale(1.1) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes rise { from { transform: translateY(70%); opacity: 0; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(19, 128, 95, .55); } 100% { box-shadow: 0 0 0 7px rgba(19, 128, 95, 0); } }
@keyframes glow-once { 0%, 100% { box-shadow: 0 0 0 0 rgba(204, 51, 102, 0); } 40% { box-shadow: 0 0 0 6px rgba(204, 51, 102, .35); } }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 .5cqw var(--gold); } 50% { box-shadow: 0 0 0 1.4cqw var(--gold); } }
@keyframes title-stamp { 0% { opacity: 0; transform: scale(1.25) rotate(-7deg); } 65% { opacity: 1; transform: scale(.97) rotate(.5deg); } 100% { opacity: 1; transform: rotate(-1deg); } }
@keyframes print { from { text-shadow: 0 0 0 var(--gold), 0 0 0 var(--accent); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
@keyframes play-pulse { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(255, 201, 60, .7); } 50% { box-shadow: var(--shadow), 0 0 0 14px rgba(255, 201, 60, 0); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } }

/* page arrival: blocks cascade in */
.enter { animation: enter-up .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
.hero.enter h1 { animation: print .6s var(--ease-out) .2s both; }

/* live status: the open chip breathes so the page reads as "happening now" */
.chip.open::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  animation: live 1.6s ease-out infinite;
}

/* countdown digits roll when they change */
.countdown b { overflow: hidden; }
.countdown b.tick { animation: tick .32s var(--ease-out); }

/* join */
.avatar-btn { transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out); }
.avatar-btn:active { transform: scale(.94); }
.avatar-btn[aria-pressed="true"] { animation: pop .3s var(--ease-pop); }
input.shake { animation: shake .4s var(--ease-out); border-color: var(--bad); }

/* picking an answer */
.just-picked .opt.mine .badge { animation: pop .34s var(--ease-pop); }
.just-picked .opt.mine .label::after { display: inline-block; animation: pop .34s var(--ease-pop) .05s both; }
.just-revealed .pct { animation: fade-in .3s var(--ease-out) .12s both; }
.just-revealed .q-foot { animation: fade-in .3s var(--ease-out) .2s both; }

/* finishing the set */
.done-card.celebrate { animation: celebrate-in .55s var(--ease-pop) both; }
.done-card.celebrate .big-emoji { animation: burst-in .6s var(--ease-pop) .15s both; }
.done-card.celebrate h2 { animation: stamp-tilt .5s var(--ease-out) .3s both; }

/* results, the first time a fan sees them: card by card */
.reveal > .card .opt .fill { transition-delay: calc(var(--i, 0) * 260ms + 150ms); }
.reveal .mark { display: inline-block; animation: stamp .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 260ms + 450ms); }
.reveal .opt.wrong-mine { animation: shake .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 260ms + 600ms); }
.reveal .points-earned, .reveal .points-missed { display: inline-block; animation: float-up .5s var(--ease-pop) both; animation-delay: calc(var(--i, 0) * 260ms + 650ms); }
.reveal > .done-card.celebrate { animation-delay: calc(var(--i, 0) * 260ms + 300ms); }
.reveal > .done-card.celebrate .big-emoji { animation-delay: calc(var(--i, 0) * 260ms + 450ms); }
.reveal > .done-card.celebrate h2 { animation-delay: calc(var(--i, 0) * 260ms + 600ms); }

/* leaderboard: podium rises 3rd, 2nd, then 1st; rows cascade */
.podium.rise .p { animation: rise .55s var(--ease-pop) both; }
.podium.rise .p3 { animation-delay: .05s; }
.podium.rise .p2 { animation-delay: .2s; }
.podium.rise .p1 { animation-delay: .4s; }
.podium.rise .p1 .av:first-child { animation: burst-in .5s var(--ease-pop) .8s both; }
.rows.cascade .row { animation: enter-up .35s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms + .3s); }
.rows.cascade .row.me { animation: enter-up .35s var(--ease-out) both, glow-once 1.2s ease .9s; }
.climb {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0 8px;
  animation: float-up .5s var(--ease-pop) .8s both;
}

/* team panel */
.tq-opt { transition: transform .14s var(--ease-out); }
.tq-opt:active { transform: scale(.95); }
.tq-opt.just-set { animation: pop .34s var(--ease-pop); }
.draft-list li.just-added { animation: slide-in .3s var(--ease-out); }
.btn.busy { cursor: progress; opacity: 1; }
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* video graphic: a sequence the editor can record */
.stage.intro .s-eyebrow { animation: pop .4s var(--ease-pop) .05s both; }
.stage.intro .s-title { animation: title-stamp .6s var(--ease-out) .15s both; }
.stage.intro .s-bar { animation: enter-up .4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 170ms + 300ms); }
.stage.intro .s-bar .bar { transition-delay: calc(var(--i, 0) * 170ms + 450ms); }
.stage.intro .s-foot { animation: fade-in .4s var(--ease-out) 1.2s both; }
.stage .s-bar.win .track { animation: ring 1s var(--ease-in-out) 2; }
.stage.intro .s-bar.win .track { animation-delay: 1.8s; }
.stage .mark { display: inline-block; animation: stamp .5s var(--ease-out) both; }
.stage.intro .mark { animation-delay: 1.7s; }

/* intro film */
.film-play:not([hidden]) { animation: pop .45s var(--ease-pop) .35s both, play-pulse 2.4s var(--ease-in-out) 1.2s infinite; }

/* modal */
.modal:not([hidden]) { animation: backdrop-in .2s var(--ease-out); }
.modal:not([hidden]) .modal-box { animation: modal-in .26s var(--ease-out); }
.modal.closing { animation: backdrop-out .16s ease forwards; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 14px; border: 1.5px solid #1b1a17; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  /* keep fades that help comprehension, drop movement */
  .enter, .rows.cascade .row, .podium.rise .p, .stage.intro .s-bar, .done-card.celebrate,
  .done-card.celebrate h2, .done-card.celebrate .big-emoji, .reveal .mark, .stage .mark,
  .reveal .points-earned, .reveal .points-missed, .climb, .stage.intro .s-title, .stage.intro .s-eyebrow,
  .modal:not([hidden]) .modal-box {
    animation: fade-in .25s ease both !important;
  }
  .reveal .opt.wrong-mine, .countdown b.tick, .avatar-btn[aria-pressed="true"], .just-picked .opt.mine .badge,
  .just-picked .opt.mine .label::after, .tq-opt.just-set, .stage .s-bar.win .track, .hero.enter h1,
  .chip.open::before, input.shake, .film-play:not([hidden]) {
    animation: none !important;
  }
  .opt .fill, .s-bar .bar, .tab-ink, .seg-ink { transition: none !important; }
}

/* =====================================================================
   Fan voice box and the AI brief
   ===================================================================== */

.voice {
  display: grid;
  gap: 8px;
  text-align: right;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
}

.voice label { font-weight: 800; font-size: 14px; }

.voice textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 64px;
}

.voice textarea.shake { animation: shake .4s var(--ease-out); border-color: var(--bad); }
.voice .btn { justify-self: start; font-size: 17px; padding: 4px 16px 6px; }
.voice.sent { text-align: center; font-weight: 800; background: #c9f0dd; }
.voice.just-sent { animation: pop .4s var(--ease-pop); }

.ai-card { border-width: 3px; }

.ai-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-head .btn { white-space: nowrap; }
.spinner.dark { border-color: rgba(27, 26, 23, .25); border-top-color: var(--ink); }
.ai-card .btn:not(.ghost) .spinner { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }

.ai-loading { margin-top: 16px; display: grid; gap: 12px; }
.ai-status { margin: 0; font-weight: 800; display: inline-block; }
.ai-status.tick { animation: fade-in .35s var(--ease-out); }

@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton {
  border: 2px dashed var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-2) 0%, #fff7e6 50%, var(--surface-2) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton.wide { height: 46px; }
.skeleton.tall { height: 150px; }

.ai-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 2px dashed var(--bad);
  border-radius: 12px;
  color: var(--bad);
  font-weight: 700;
}

.brief { display: grid; gap: 14px; margin-top: 14px; }
.brief-top { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.ai-live { background: #c9f0dd; }
.chip.ai-sample { background: var(--gold); }
.chip.mood { background: var(--pink); }

.brief-headline {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.45;
  text-shadow: 1.5px 1.5px 0 var(--gold);
}

.ai-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.theme {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.theme header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.theme h3 { font-size: 18px; }
.theme .count { font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--surface-2); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 8px; }
.theme p { margin: 6px 0 8px; font-size: 14px; }

/* quotes as comic speech bubbles */
.theme blockquote {
  position: relative;
  margin: 8px 0 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
}

.theme blockquote::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 14px;
  width: 9px;
  height: 9px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.brief-cols { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.brief-box {
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
}

.brief-box h3 { font-size: 18px; margin-bottom: 8px; }
.brief-box h3 + * { margin-top: 0; }
.brief-box ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }

.lines li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px dashed var(--ink);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 700;
}

.lines li span { flex: 1; }

.copy {
  border: 1.5px solid var(--ink);
  background: var(--gold);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  transition: transform .14s var(--ease-out);
}

.copy:active { transform: scale(.94); }
.copy.copied { animation: pop .3s var(--ease-pop); }

.stat-callout { background: var(--pink); border: 2px solid var(--ink); border-radius: 10px; padding: 8px 12px; }
.stat-callout p { margin: 2px 0 0; font-weight: 700; }

.ideas li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
}

.ideas li i {
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--w);
  background: radial-gradient(circle, rgba(19, 153, 143, .45) 30%, transparent 34%) 0 0 / 7px 7px, rgba(19, 153, 143, .12);
}

.ideas li span, .ideas li b { position: relative; }
.ideas li span { flex: 1; }
.ideas li b { font-family: var(--display); font-weight: 400; font-size: 18px; }

.actions-list li { padding-right: 26px; position: relative; font-size: 14px; }
.actions-list li::before { content: "☐"; position: absolute; right: 0; font-size: 16px; }

.story li { font-size: 14px; }
.story li b { display: block; }

.flagged { border-color: var(--bad); background: #fff1f3; }
.flagged li { font-size: 13px; }
.flagged em { display: block; color: var(--bad); font-style: normal; font-weight: 700; }

/* the brief builds up section by section when it arrives */
.ai-in { animation: enter-up .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  .ai-in, .voice.just-sent { animation: fade-in .25s ease both !important; }
  .skeleton { animation: none; }
}
