:root {
  --bg: #140d33;
  --bg-2: #1f1550;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f6f3ff;
  --muted: #b9b0e0;
  --gold: #f7c948;
  --gold-deep: #e0a91b;
  --gold-ink: #2a1c00;
  --t0: #2ec4b6;
  --t1: #ff6b6b;
  --t2: #9b8cff;
  --t3: #ffa94d;
  --radius: 18px;
  --font: 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, #3a2490 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #0f4c5c 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.t0 { --team: var(--t0); }
.t1 { --team: var(--t1); }
.t2 { --team: var(--t2); }
.t3 { --team: var(--t3); }

.loading, .fatal { text-align: center; padding: 20vh 16px; color: var(--muted); }
.fatal h1 { color: var(--text); }
.muted { color: var(--muted); font-size: 0.85rem; }

.screen {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  animation: fade-in 0.35s ease;
}

/* ---------- Background pattern (board and question screens) ---------- */
.screen { position: relative; z-index: 1; }
.watermark {
  position: fixed; inset: -30%; z-index: 0;
  display: none; flex-direction: column; justify-content: center; gap: 64px;
  transform: rotate(-14deg);
  opacity: 0.06;
  pointer-events: none;
  overflow: hidden;
}
body.in-game .watermark { display: flex; }
.wm-row { display: flex; gap: 96px; flex: none; }
.wm-row:nth-child(even) { transform: translateX(-160px); }
.wm-item { display: inline-flex; align-items: center; gap: 14px; flex: none; color: #fff; font-size: 1.7rem; font-weight: 800; white-space: nowrap; }
.wm-item .logo { --s: 46px; margin: 0; box-shadow: none; }
.watermark .logo, .watermark .logo-check path { animation: none; }
.watermark .logo-check path { stroke-dashoffset: 0; }

/* ---------- Buttons ---------- */

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 22px;
  font-weight: 700;
  font-size: 1.05rem;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--gold-ink);
  box-shadow: 0 6px 0 #9c7206, 0 10px 24px rgba(247, 201, 72, 0.25);
}
.btn-gold:disabled { opacity: 0.35; box-shadow: none; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn-small { padding: 8px 14px; font-size: 0.9rem; border-radius: 10px; }
.btn-big { display: block; width: 100%; max-width: 420px; margin: 28px auto 0; padding: 18px; font-size: 1.35rem; }
.btn-team {
  background: var(--team);
  color: #10091f;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--team) 60%, black);
}
.link { background: none; border: 0; color: var(--muted); font-size: 0.85rem; margin-top: 18px; text-decoration: underline; text-underline-offset: 4px; }
.link:hover { color: var(--text); }
/* "Get the app" icons on the home page */
.app-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }
.app-links-title { width: 100%; text-align: center; color: var(--muted); font-size: 0.9rem; }
.app-link {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 700;
  transition: background 0.2s, transform 0.15s;
}
.app-link span { display: flex; flex-direction: column; line-height: 1.25; }
.app-link small { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
a.app-link:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.app-link.soon { opacity: 0.55; cursor: default; }
.app-help { width: 100%; text-align: center; color: var(--muted); font-size: 0.8rem; text-underline-offset: 4px; }
.version { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 22px 0 0; opacity: 0.7; }

/* ---------- Setup ---------- */

.setup { max-width: 860px; }
.brand { text-align: center; margin-bottom: 22px; }
.brand h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; margin: 10px 0 4px; letter-spacing: -0.5px; }
.brand p { color: var(--muted); margin: 0; font-size: 1.1rem; }
.logo {
  --s: 88px;
  height: var(--s);
  width: fit-content;
  margin: 0 auto;
  padding: 0 calc(var(--s) * 0.2);
  display: flex; align-items: center; gap: calc(var(--s) * 0.1);
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  border-radius: calc(var(--s) * 0.3);
  box-shadow: 0 12px 30px rgba(247, 201, 72, 0.35);
  animation: logo-bob 3s ease-in-out infinite;
}
.logo-q {
  font-size: calc(var(--s) * 0.62); font-weight: 800; line-height: 1;
  color: var(--gold-ink);
  transform: translateY(4%);
}
.logo-q:first-child { transform: translateY(4%) rotate(12deg); }
.logo-q:last-child { transform: translateY(4%) rotate(-12deg); }
.logo-check {
  width: calc(var(--s) * 0.62); height: calc(var(--s) * 0.62);
  display: grid; place-items: center;
  background: var(--t0);
  border-radius: 50%;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18), 0 0 0 calc(var(--s) * 0.04) rgba(42, 28, 0, 0.85);
}
.logo-check svg { width: 68%; height: 68%; }
.logo-check path {
  fill: none; stroke: #fff; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22;
  animation: draw-check 0.6s 0.3s ease-out forwards;
}

.brand-small { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 18px; }
.brand-small .logo { --s: 52px; margin: 0; }
.brand-small h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; }

.stepper {
  list-style: none; padding: 0; margin: 0 0 18px;
  display: flex; align-items: center; justify-content: center;
}
.stepper li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; }
.stepper li + li::before {
  content: ''; width: clamp(24px, 8vw, 70px); height: 3px; border-radius: 2px;
  background: var(--line); margin-inline: 10px;
}
.stepper li.done + li::before, .stepper li.done + li.current::before { background: var(--gold); }
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line); background: rgba(0, 0, 0, 0.2);
  font-variant-numeric: tabular-nums;
}
.stepper li.current { color: var(--text); }
.stepper li.current .step-num { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 4px rgba(247, 201, 72, 0.18); }
.stepper li.done .step-num { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.step-link {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border: 0; border-radius: 999px;
  background: none; color: inherit; font-weight: inherit;
  transition: background 0.2s;
}
.step-link:not(:disabled):not([aria-current]):hover { background: var(--surface-2); }
.step-link:not(:disabled):not([aria-current]):hover .step-num { border-color: var(--gold); }
.step-link[aria-current] { cursor: default; }
.step-link:disabled { opacity: 0.45; }

.step-panel { animation: slide-in 0.3s ease; padding: 22px 22px 24px; }
.step-panel > h2 { font-size: 1.4rem; margin-bottom: 18px; }
.step-nav { display: flex; gap: 12px; margin-top: 18px; }
.step-nav .btn { padding: 16px 28px; font-size: 1.2rem; }
.step-nav #nextBtn { margin-inline-start: auto; min-width: 200px; }

.summary { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.summary-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.chip-team { background: color-mix(in srgb, var(--team) 22%, transparent); color: var(--team); border: 1px solid color-mix(in srgb, var(--team) 50%, transparent); }
.vs { color: var(--muted); font-size: 0.9rem; }

.resume {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: rgba(247, 201, 72, 0.12);
  border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 16px;
}
.panel h2 { font-size: 1.2rem; margin: 0 0 14px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head .btn { margin-inline-start: auto; }
.count { color: var(--muted); font-weight: 500; }
.count.done { color: var(--gold); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }

.team-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.team-field input {
  font: inherit; font-size: 1.2rem; font-weight: 700; color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid color-mix(in srgb, var(--team) 55%, transparent);
  border-inline-start-width: 8px;
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
.team-field input:focus { outline: none; border-color: var(--team); }
.team-field input::placeholder { color: var(--muted); opacity: 0.55; font-weight: 500; }

.cat-group + .cat-group { margin-top: 20px; }
.cat-group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
  font-size: 1.05rem; font-weight: 800; color: var(--gold);
}
.cat-group-head::after { content: ''; flex: 1; height: 1px; background: var(--line); order: 1; }
.group-count {
  order: 2;
  font-size: 0.8rem; font-weight: 700; color: var(--gold-ink);
  background: var(--gold); border-radius: 999px; padding: 1px 10px;
}
.group-count:empty { display: none; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-weight: 700;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.cat-tile:hover { transform: translateY(-2px); }
.cat-tile-wrap { position: relative; display: grid; }
.cat-tile-wrap:has(.cat-info:hover, .cat-info:focus-visible), .cat-tile-wrap.tip-open { z-index: 5; }

.cat-info {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  font-size: 0.85rem; font-weight: 800; line-height: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cat-info:hover, .cat-info:focus-visible, .tip-open .cat-info { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

.cat-tip {
  position: absolute; bottom: calc(100% + 10px); inset-inline: -10px;
  padding: 10px 12px;
  background: #fffdf5; color: #2a1c00;
  border-radius: 12px;
  font-size: 0.9rem; font-weight: 500; line-height: 1.6; text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  pointer-events: none;
}
.cat-tip::after {
  content: ''; position: absolute; top: 100%; inset-inline-end: 23px;
  border: 7px solid transparent; border-top-color: #fffdf5;
}
.cat-info:hover + .cat-tip, .cat-info:focus-visible + .cat-tip, .tip-open .cat-tip {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.cat-tile.on { border-color: var(--gold); background: rgba(247, 201, 72, 0.14); }
.cat-icon { font-size: 1.8rem; line-height: 1; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  flex: 1 1 100px;
  padding: 12px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.2); border: 2px solid var(--line); font-weight: 700;
}
.seg button.on { border-color: var(--gold); background: rgba(247, 201, 72, 0.14); }

/* ---------- Score bar ---------- */

.scorebar { display: flex; gap: 14px; justify-content: center; margin-bottom: 20px; }
.team-card {
  position: relative;
  flex: 1 1 0; max-width: 360px;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--team) 14%, transparent);
  border: 2px solid color-mix(in srgb, var(--team) 40%, transparent);
  border-radius: var(--radius);
  transition: box-shadow 0.3s, border-color 0.3s;
}
.team-card.turn { border-color: var(--team); box-shadow: 0 0 0 4px color-mix(in srgb, var(--team) 25%, transparent), 0 0 32px color-mix(in srgb, var(--team) 35%, transparent); }
.team-name { font-weight: 700; font-size: 1.1rem; color: var(--team); overflow-wrap: anywhere; text-align: center; }
.team-score { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.team-score.bump { color: var(--gold); }
.turn-tag {
  position: absolute; bottom: -12px;
  background: var(--team); color: #10091f;
  font-size: 0.8rem; font-weight: 800;
  padding: 2px 12px; border-radius: 999px;
  animation: pulse 1.6s ease-in-out infinite;
}
.float-points {
  position: absolute; top: 10px; inset-inline-end: 16px;
  font-weight: 800; font-size: 1.6rem; color: var(--gold);
  animation: float-up 1.2s ease-out forwards;
  pointer-events: none;
}

/* ---------- Board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}
.col { display: flex; flex-direction: column; gap: 8px; }
.col-head {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 92px; padding: 10px 6px;
  text-align: center; font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(180deg, #3b2a8c, #2a1d6a);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cell {
  height: clamp(54px, 9vh, 84px);
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: clamp(1.2rem, 2.4vw, 1.9rem); font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  background: linear-gradient(180deg, var(--cell-top, #2c2070), var(--cell-bottom, #221862));
  border: 1px solid rgba(247, 201, 72, 0.35);
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
/* Darker cell = harder question: 200 light, 400 middle, 600 dark. */
.cell.lvl-1 { --cell-top: #6550d6; --cell-bottom: #5241be; }
.cell.lvl-2 { --cell-top: #3a2b96; --cell-bottom: #2e2280; }
.cell.lvl-3 { --cell-top: #1c1352; --cell-bottom: #140d3e; }
button.cell:hover { transform: translateY(-2px); filter: brightness(1.18); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
button.cell.flip { animation: flip 0.42s ease-in forwards; }
.cell.done { color: rgba(255, 255, 255, 0.28); background: rgba(0, 0, 0, 0.18); border-color: transparent; font-size: 1rem; }
.cell.done span { text-decoration: line-through; }
.cell.won { background: color-mix(in srgb, var(--team) 22%, transparent); border: 1px solid color-mix(in srgb, var(--team) 50%, transparent); color: var(--team); }
.cell.won span { text-decoration: none; }
button.cell.done { cursor: pointer; }
button.cell.done:hover { transform: translateY(-2px); filter: brightness(1.25); }

/* Dialog for changing a played cell's result */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 6, 30, 0.72);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
.modal {
  width: min(520px, 100%);
  padding: 26px 22px 18px;
  text-align: center;
  background: linear-gradient(180deg, #3b2a8c, #24185f);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  animation: pop-in 0.25s cubic-bezier(.2, 1.3, .5, 1);
}
.modal h2 { margin: 0 0 10px; font-size: 1.3rem; line-height: 1.5; }
.modal-meta { margin: 0; color: var(--muted); }
.modal-current { margin: 6px 0 18px; }
.modal .q-actions { justify-content: center; }
.modal .btn:disabled { opacity: 0.4; cursor: default; }

.toolbar { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ---------- Question ---------- */

.q-screen .scorebar { margin-bottom: 26px; }
.q-card {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 26px clamp(16px, 4vw, 44px) 22px;
  background: linear-gradient(180deg, rgba(59, 42, 140, 0.75), rgba(31, 21, 80, 0.85));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.35s cubic-bezier(.2, 1.3, .5, 1);
}
/* Arriving from a board cell: flyIn() in ui.js animates it instead of the pop-in. */
.q-card.arriving { animation: none; will-change: transform; }
.screen.no-fade { animation: none; }
/* While a picked cell turns over, the rest of the board steps back. */
.board-screen.leaving .col-head,
.board-screen.leaving .cell:not(.flip),
.board-screen.leaving .toolbar { opacity: 0; transform: scale(0.94); transition: opacity 0.35s ease, transform 0.35s ease; }
.q-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--surface-2); font-weight: 700; }
.chip-gold { background: var(--gold); color: var(--gold-ink); }
.q-team { margin-top: 16px; font-size: 1.15rem; color: var(--muted); }
.q-team b { color: var(--team); font-size: 1.35rem; }
.q-text {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800; line-height: 1.5;
  margin: 18px 0 22px;
  overflow-wrap: anywhere;
}

.q-text-small { font-size: clamp(1.3rem, 3vw, 1.9rem); margin-bottom: 16px; }

.flag-frame {
  width: min(360px, 80vw);
  aspect-ratio: 4 / 3;
  margin-bottom: 22px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 14px 34px rgba(0, 0, 0, 0.45);
  animation: pop-in 0.4s cubic-bezier(.2, 1.3, .5, 1);
}
.flag-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.map-frame {
  width: min(340px, 75vw);
  aspect-ratio: 1;
  margin-bottom: 22px;
  padding: 6%;
  display: grid; place-items: center;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(46, 196, 182, 0.22), rgba(0, 0, 0, 0.25) 70%);
  border: 1px solid var(--line);
  animation: pop-in 0.4s cubic-bezier(.2, 1.3, .5, 1);
}
/* The outlines are black; invert them to a light silhouette on the dark card. */
.map-frame img { width: 100%; height: 100%; object-fit: contain; filter: invert(1) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5)); }

.emblem-frame {
  margin: 0 0 22px;
  width: min(300px, 72vw);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: pop-in 0.4s cubic-bezier(.2, 1.3, .5, 1);
}
.emblem-frame img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  padding: 7%; box-sizing: border-box;
  background: #fff; border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.emblem-frame figcaption a { color: var(--muted); font-size: 0.72rem; text-decoration: none; }
.emblem-frame figcaption a:hover { text-decoration: underline; }

.capital-name {
  margin: 4px 0 26px;
  padding: 14px 36px;
  font-size: clamp(2.2rem, 7vw, 3.8rem); font-weight: 800;
  color: var(--gold);
  border: 2px dashed rgba(247, 201, 72, 0.5);
  border-radius: 20px;
  background: rgba(247, 201, 72, 0.08);
  animation: pop-in 0.4s cubic-bezier(.2, 1.3, .5, 1);
  overflow-wrap: anywhere;
}

.logo-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 3vw, 28px);
  width: min(560px, 100%);
  margin-bottom: 22px;
}
.logo-opt {
  position: relative; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 1;
  padding: 18%;
  background: #fff;
  border: 4px solid transparent;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.4s cubic-bezier(.2, 1.3, .5, 1);
  transition: border-color 0.3s, opacity 0.3s, transform 0.3s;
}
.logo-opt img { width: 100%; height: 100%; object-fit: contain; }
.logo-opt img.mirror { transform: scaleX(-1); }
.opt-label {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg-2); color: var(--gold);
  font-weight: 800; font-size: 1.1rem;
}
.logo-opt figcaption { position: absolute; bottom: 10px; font-weight: 800; font-size: 0.95rem; }
.logo-opt.is-real { border-color: var(--t0); transform: scale(1.03); }
.logo-opt.is-real figcaption { color: #0e8f84; }
.logo-opt.is-fake { border-color: var(--t1); opacity: 0.75; }
.logo-opt.is-fake figcaption { color: #d43c3c; }
.answer-note { display: block; font-size: 1rem; font-weight: 500; margin-top: 4px; opacity: 0.8; }

.timer { position: relative; width: 120px; height: 120px; margin-bottom: 20px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 10; }
.timer .track { stroke: rgba(255, 255, 255, 0.12); }
.timer .progress { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke 0.3s; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.urgent .progress { stroke: var(--t1); }
.timer.urgent span { color: var(--t1); animation: pulse 1s ease-in-out infinite; }

.answer {
  width: 100%;
  margin-bottom: 22px;
  padding: 16px 20px;
  font-size: clamp(1.4rem, 3.5vw, 2.1rem); font-weight: 800;
  color: var(--gold-ink);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-radius: 18px;
  animation: pop-in 0.4s cubic-bezier(.2, 1.4, .5, 1);
  overflow-wrap: anywhere;
}
.answer-label { display: block; font-size: 0.9rem; font-weight: 700; opacity: 0.7; margin-bottom: 4px; }

.q-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.q-actions .btn { min-width: 170px; }

/* ---------- Winner ---------- */

.win-screen { min-height: 100vh; display: grid; place-items: center; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.win-card {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, rgba(59, 42, 140, 0.85), rgba(31, 21, 80, 0.92));
  border: 1px solid var(--line);
  border-radius: 28px;
  animation: pop-in 0.5s cubic-bezier(.2, 1.4, .5, 1);
}
.trophy { font-size: 5rem; animation: wobble 2.4s ease-in-out infinite; }
.win-sub { color: var(--muted); margin: 6px 0 0; font-size: 1.1rem; }
.win-card h1 { font-size: clamp(2rem, 7vw, 3.2rem); margin: 4px 0 18px; overflow-wrap: anywhere; }
.winner { color: var(--team); }
.final { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.final li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--team) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--team) 40%, transparent);
  font-weight: 700;
}
.final li b { font-size: 1.4rem; color: var(--team); }

/* ---------- Animations ---------- */

.shake { animation: shake 0.5s ease; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes logo-bob { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-4px); } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes flip {
  0% { transform: perspective(500px) rotateY(0); }
  100% { transform: perspective(500px) rotateY(90deg) scale(1.15); opacity: 0.4; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-12px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(4px); }
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } }
@keyframes float-up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-46px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo-check path { stroke-dashoffset: 0; }
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  .screen { padding-top: 16px; }
  .team-inputs { grid-template-columns: 1fr; }
  .panel-head { flex-wrap: wrap; }
  .panel-head h2 { flex-basis: 100%; }
  .stepper .step-label { display: none; }
  .stepper li.current .step-label { display: inline; }
  .step-nav #nextBtn { min-width: 0; flex: 1; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .board { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .col { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .col-head { grid-column: 1 / -1; min-height: 0; flex-direction: row; padding: 8px; font-size: 1rem; }
  .col-head .cat-icon { font-size: 1.3rem; }
  .cell { height: 48px; font-size: 1rem; border-radius: 10px; }
  .cell.done { font-size: 0.85rem; }
  .scorebar { gap: 8px; }
  .team-card { padding: 10px 8px; }
  .team-name { font-size: 0.95rem; }
  .q-actions .btn { min-width: 0; flex: 1 1 100%; }
  .timer { width: 96px; height: 96px; }
}
