/* SAT Quest
   A game first: scoreboard numbers, two player colours (blue for you, pink for
   them), a green "go" colour for playing and for right answers, and chunky
   buttons that press down. Hand-drawn Open Peeps characters give it people.
   Surfaces are plain and flat; only things you can press have depth. */

:root {
  color-scheme: light;

  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --sunken: #e4e7ec;
  --ink: #10131a;
  --muted: #4d5666;
  --dim: #666f80;
  --line: #d9dde3;
  --line-strong: #b9bfc9;

  --go: #2e9e4f;
  --go-edge: #1f7a39;
  --go-soft: #e3f4e8;
  --you: #2d6be0;
  --you-soft: #e2ebfc;
  --them: #d63d6f;
  --them-soft: #fbe4ec;
  --bot: #7a8599;
  --bot-soft: #e8ebf0;
  --flame: #f06d0f;
  --gold: #e8a800;
  --bad: #d23a31;
  --bad-soft: #fbe6e4;
  --warn: #9a5c00;
  --warn-soft: #fdf1dc;
  --focus: #2d6be0;
  --on-color: #ffffff;

  --radius: 16px;
  --radius-sm: 12px;

  /* Old names still used by the dashboard, results and calculator views. */
  --text: var(--ink);
  --card: var(--surface);
  --card-2: var(--surface-2);
  --well: var(--surface-2);
  --hover: var(--surface-2);
  --canvas: var(--surface);
  --empty: var(--sunken);
  --accent: var(--you);
  --accent-2: var(--you);
  --good: var(--go);
  --ok: var(--warn);
  --low: var(--bad);
  --grid-line: #e8ebef;
  --grid-axis: #9aa2b0;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #0f1115;
  --surface: #181b21;
  --surface-2: #20242b;
  --sunken: #0b0d10;
  --ink: #eef1f5;
  --muted: #aab3c1;
  --dim: #8a94a4;
  --line: #2a2f37;
  --line-strong: #3d434e;

  --go: #3cbd62;
  --go-edge: #268a43;
  --go-soft: #173222;
  --you: #5c8ff2;
  --you-soft: #1a2640;
  --them: #ee6a96;
  --them-soft: #3a1b27;
  --bot: #8a95a8;
  --bot-soft: #252a33;
  --flame: #ff8a36;
  --gold: #f5bd2e;
  --bad: #f06a60;
  --bad-soft: #3a1b19;
  --warn: #f0b13c;
  --warn-soft: #33270f;
  --focus: #7fa8ff;
  --grid-line: #232830;
  --grid-axis: #4d5563;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.005em; }
h1 { font-size: 34px; }
h2 { font-size: 24px; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--you); }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--sunken); padding: 1px 5px; border-radius: 5px; }

i[class^='ph-'], i[class*=' ph-'] { line-height: 1; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 20px 24px 64px; }
.wrap-quiz, .wrap-results { max-width: 860px; }

/* ───────────────────────────── top bar ───────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 24px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  font: 900 30px/1 var(--font-display); letter-spacing: 0.01em;
}
.wordmark i { color: var(--gold); font-size: 30px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--go); color: #fff; font-size: 26px; }
.brand h1 { font-size: 28px; }
.brand p { color: var(--dim); font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.streak {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 12px; border-radius: 999px; background: var(--surface);
}
.streak strong { font: 800 20px/1 var(--font-display); }
.streak em { color: var(--muted); font-size: 13px; font-style: normal; }
.streak.is-live strong { color: var(--flame); }

/* ───────────────────────────── buttons ───────────────────────────── */
/* Chunky and pressable: a solid edge underneath that the button sinks into. */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-edge: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--btn-edge);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 700 16px/1 var(--font-body);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--btn-edge);
  transition: transform 0.05s, box-shadow 0.05s, filter 0.12s;
  text-decoration: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-edge); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 1.1em; }
.btn-go, .btn-primary { --btn-bg: var(--go); --btn-fg: var(--on-color); --btn-edge: var(--go-edge); }
.btn-plain, .btn-ghost { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-edge: var(--line-strong); }
.btn-quiet {
  background: transparent; color: var(--muted); border-color: transparent; box-shadow: none;
}
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--sunken); filter: none; }
.btn-quiet:active:not(:disabled) { transform: none; }
.btn-sm { padding: 9px 14px; font-size: 14.5px; box-shadow: 0 3px 0 var(--btn-edge); }
.btn-sm:active:not(:disabled) { transform: translateY(3px); }
.btn-xs { padding: 6px 10px; font-size: 13px; border-radius: 9px; box-shadow: 0 2px 0 var(--btn-edge); }
.btn-xs:active:not(:disabled) { transform: translateY(2px); }
.btn-block { display: flex; width: 100%; margin-top: 14px; }
.btn.is-on { --btn-bg: var(--you-soft); --btn-edge: var(--you); --btn-fg: var(--you); }
.kbd {
  display: inline-block; padding: 1px 6px; margin-left: 4px;
  border: 1px solid currentColor; border-radius: 4px; font: 600 12px var(--font-mono); opacity: 0.6;
}

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface);
  color: var(--muted); font: 700 14.5px/1 var(--font-body); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }

/* ───────────────────────────── form bits ───────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--muted); font-size: 14px; font-weight: 600; }

input[type='text'], select, .name-field, .code-field {
  width: 100%; min-width: 0;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; font: 400 16px/1.2 var(--font-body);
}
input[type='text']::placeholder { color: var(--dim); }
input[type='text']:focus, select:focus { border-color: var(--you); outline: none; }
.code-field {
  width: 118px; flex: none; text-align: center; text-transform: uppercase;
  font: 800 22px/1 var(--font-display); letter-spacing: 0.2em;
}

.fine-print { color: var(--muted); font-size: 14px; line-height: 1.55; }
.notice { color: var(--you); font-size: 15px; font-weight: 600; margin-top: 12px; }
.notice.is-bad { color: var(--bad); }
.callout {
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
  background: var(--warn-soft); color: var(--ink);
}
.callout strong { display: block; margin-bottom: 4px; }
.callout p { color: var(--muted); font-size: 14.5px; }
.callout.is-bad { background: var(--bad-soft); }

/* ───────────────────────────── animated emoji ───────────────────────────── */
/* Starts as the plain emoji character; motion.js swaps in Google's animation. */
.emoji {
  display: inline-grid; place-items: center; flex: none; vertical-align: middle;
  width: var(--emoji-size); height: var(--emoji-size);
  line-height: 1;
}
.emoji > * { grid-area: 1 / 1; }
.emoji-char { font-size: calc(var(--emoji-size) * 0.82); }
.streak-block:not(.is-lit) .streak-count .emoji { filter: grayscale(1); opacity: 0.45; }
.streak-block.is-at-risk .streak-count .emoji { filter: grayscale(0.6); opacity: 0.75; }
.quick-copy strong .emoji { margin-right: 4px; vertical-align: -4px; }
.vs-banner .emoji { margin: -4px 0; }
.vs-over > .emoji { margin: 0 auto 4px; display: grid; }
.levelup .emoji { flex: none; }
.emoji[data-ready='yes'] .emoji-char { display: none; }
.emoji svg { width: 100% !important; height: 100% !important; }

/* ───────────────────────────── avatars ───────────────────────────── */
.avatar {
  --tone: var(--bot-soft);
  --ring: var(--bot);
  flex: none; position: relative;
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--tone);
  box-shadow: inset 0 0 0 3px var(--ring);
}
.avatar img { width: 100%; height: 100%; display: block; transform: translateY(6%) scale(1.02); }
.avatar-you { --tone: var(--you-soft); --ring: var(--you); }
.avatar-them { --tone: var(--them-soft); --ring: var(--them); }
.avatar-bot { --tone: var(--bot-soft); --ring: var(--bot); }
.avatar-plain { --tone: var(--surface-2); --ring: var(--line); }
.avatar-initials, .avatar-mystery {
  font: 900 calc(var(--avatar-size) * 0.38) / 1 var(--font-display); color: var(--ring);
}

/* ───────────────────────────── home ───────────────────────────── */
.home {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.profile {
  position: sticky; top: 16px;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border-radius: var(--radius);
  padding: 22px;
}
.me { display: flex; align-items: center; gap: 14px; }
.me .avatar { --avatar-size: 112px; }

.level-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.level-head strong { font: 800 22px/1.1 var(--font-display); }
.level-head span { color: var(--dim); font-size: 14px; white-space: nowrap; }
.level-meta { display: block; color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.xp-track { height: 14px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.xp-fill {
  height: 100%; border-radius: 999px; background: var(--gold);
  box-shadow: inset 0 -4px 0 rgb(0 0 0 / 0.12);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* the daily streak */
.streak-block { padding: 14px 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.streak-count { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.streak-count i { font-size: 30px; color: var(--line-strong); }
.streak-count strong { font: 900 40px/0.9 var(--font-display); }
.streak-count span { font-weight: 700; color: var(--muted); }
.streak-block.is-lit .streak-count i,
.streak-block.is-lit .streak-count strong { color: var(--flame); }
.streak-block.is-at-risk .streak-count i { color: var(--flame); opacity: 0.55; }
.streak-week { display: flex; justify-content: space-between; list-style: none; margin: 0; padding: 0; }
.streak-week li { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.day-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sunken); color: #fff; font-size: 15px;
}
.streak-week li.is-filled .day-dot { background: var(--flame); }
.streak-week li.is-today .day-dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--flame); }
.streak-day { color: var(--dim); font-size: 12.5px; font-weight: 600; }
.streak-week li.is-today .streak-day { color: var(--ink); }
.streak-note { color: var(--muted); font-size: 14px; margin-top: 10px; }
.streak-block.is-at-risk .streak-note { color: var(--warn); font-weight: 700; }

.record { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.record div { text-align: center; }
.record div + div { border-left: 2px solid var(--line); }
.record dt { color: var(--dim); font-size: 13px; font-weight: 600; }
.record dd { margin: 2px 0 0; font: 900 30px/1 var(--font-display); }

.rivals h2 { font-size: 22px; margin-bottom: 6px; }
.rival-list { list-style: none; margin: 0; padding: 0; }
.rival-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.rival-list li:last-child { border-bottom: 0; }
.rival-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rival-record { font: 900 22px/1 var(--font-display); white-space: nowrap; }
.rival-record.is-good { color: var(--go); }
.rival-record.is-bad { color: var(--bad); }

/* the play column */
.play { min-width: 0; }
.play-title {
  font: 900 clamp(38px, 5.2vw, 60px)/0.95 var(--font-display);
  letter-spacing: 0.005em;
  margin: 4px 0 22px;
  max-width: 14ch;
}
.play-title span { color: var(--go); }

.quick {
  display: flex; align-items: center; gap: 18px;
  width: 100%; padding: 20px 22px;
  border: 0; border-radius: var(--radius);
  background: var(--go); color: #fff;
  box-shadow: 0 6px 0 var(--go-edge);
  font: inherit; text-align: left; cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, filter 0.12s;
}
button.quick:hover:not(:disabled) { filter: brightness(1.05); }
button.quick:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 0 0 var(--go-edge); }
button.quick:disabled { opacity: 0.5; cursor: not-allowed; }
.quick-icon { font-size: 40px; color: #fff; display: grid; place-items: center; }
.quick-copy { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick-copy strong { font: 900 32px/1 var(--font-display); letter-spacing: 0.01em; }
.quick-copy span { font-size: 15.5px; opacity: 0.92; }
.quick-go { font-size: 28px; }
.quick.is-searching {
  cursor: default; flex-wrap: wrap;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 3px var(--go) inset;
}
.quick.is-searching .quick-copy strong { font-size: 26px; }
.quick.is-searching .quick-copy span { color: var(--muted); opacity: 1; }
.quick-faces { display: flex; align-items: center; gap: 8px; }
.quick-vs { font: 900 20px/1 var(--font-display); color: var(--dim); }
.quick.is-searching .avatar-mystery { animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.play-section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 15px; }

.bots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
  font: inherit; text-align: left; cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, border-color 0.12s;
}
.bot:hover:not(:disabled) { border-color: var(--line-strong); }
.bot:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.bot:disabled { opacity: 0.5; cursor: not-allowed; }
.bot strong { display: block; font: 800 20px/1.1 var(--font-display); }
.bot em { display: block; font-style: normal; color: var(--muted); font-size: 14px; }

.formats { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; min-inline-size: 0; }
.format {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 2px solid var(--surface);
  cursor: pointer; transition: border-color 0.12s;
}
.format:hover { border-color: var(--line-strong); }
.format input { position: absolute; opacity: 0; pointer-events: none; }
.format.is-on { border-color: var(--you); background: var(--you-soft); }
.format-icon {
  flex: none; width: 40px; text-align: center;
  font-size: 28px; color: var(--dim);
}
.format.is-on .format-icon { color: var(--you); }
.format-body strong { display: block; font: 800 21px/1.15 var(--font-display); }
.format-body span { color: var(--muted); font-size: 14.5px; }

.friend-row { display: flex; align-items: flex-end; gap: 12px; }
.friend-row .field { flex: 1; }
.join-row { display: flex; gap: 10px; margin-top: 12px; align-items: stretch; }
.join-row input { flex: 1; }
.join-row .code-field { flex: none; width: 118px; }
.join-row .btn { flex: none; }
.advanced { margin-top: 16px; }
.advanced summary { color: var(--muted); cursor: pointer; font-size: 14.5px; font-weight: 600; }
.advanced .fine-print { margin: 8px 0 0; }

.solo-row { display: flex; flex-wrap: wrap; gap: 10px; }
.solo-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
  font: 700 16px/1.2 var(--font-body); text-align: left; cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, border-color 0.12s;
}
.solo-btn:hover { border-color: var(--line-strong); }
.solo-btn:active { transform: translateY(4px); box-shadow: none; }
.solo-btn i { font-size: 24px; color: var(--you); }
.solo-btn em { display: block; color: var(--muted); font: 400 13.5px var(--font-body); font-style: normal; margin-top: 2px; }

.gen-row { display: flex; align-items: flex-end; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.gen-row .field { flex: 1 1 260px; }
.gen-status { color: var(--muted); font-size: 14.5px; margin-top: 10px; min-height: 1.5em; }

.foot { color: var(--dim); font-size: 13.5px; margin-top: 44px; line-height: 1.7; max-width: 70ch; }
.foot a { color: inherit; }

/* ───────────────────────────── generic cards (other screens) ───────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; }
.card-sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.card h2 .count { color: var(--dim); font-weight: 700; font-size: 16px; margin-left: 6px; }
.eyebrow { color: var(--dim); font-size: 14px; font-weight: 700; }
.empty { color: var(--dim); font-size: 15px; padding: 14px 0; }

.hero { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-body { flex: 1 1 260px; min-width: 240px; }
.hero-title { font: 900 32px/1.05 var(--font-display); display: block; margin-bottom: 12px; }
.hero-meta { color: var(--muted); font-size: 14.5px; display: block; margin-top: 8px; }
.hero-meta strong { color: var(--ink); }
.hero-cta { display: flex; flex-direction: column; gap: 12px; min-width: 200px; }

.ring { position: relative; width: var(--ring-size); height: var(--ring-size); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--sunken); stroke-width: 10; }
.ring-fill { fill: none; stroke: var(--gold); stroke-width: 10; transition: stroke-dasharray 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font: 900 34px/1 var(--font-display); }
.ring-label span { color: var(--dim); font-size: 13px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat-icon { display: none; }
.stat-value { font: 900 34px/1 var(--font-display); order: 2; }
.stat-label { color: var(--muted); font-size: 14px; font-weight: 700; order: 1; margin-bottom: 4px; }
.stat-sub { color: var(--dim); font-size: 13px; order: 3; margin-top: 2px; }
.stat-good .stat-value { color: var(--go); }
.stat-ok .stat-value { color: var(--warn); }
.stat-low .stat-value { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.panel-section { margin-top: 20px; }
.panel-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--line);
}
.panel-section-head h3 { font: 800 19px/1 var(--font-display); }
.score-feel { font: 900 22px/1 var(--font-display); }
.score-feel em { color: var(--dim); font: 400 13px var(--font-body); font-style: normal; margin-left: 4px; }

.bar-row { margin-bottom: 12px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.bar-label { font-size: 15px; }
.bar-value { font-weight: 700; font-size: 15px; }
.bar-value em { color: var(--dim); font-size: 13px; font-style: normal; font-weight: 400; margin-left: 6px; }
.bar-track { height: 10px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--you); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tone-good { background: var(--go); }
.tone-ok { background: var(--gold); }
.tone-low { background: var(--bad); }
.tone-accent { background: var(--you); }

.weak-list { list-style: none; margin: 12px 0; padding: 0; }
.weak-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weak-list li:last-child { border-bottom: 0; }
.weak-skill { display: block; font-size: 15px; font-weight: 700; }
.weak-domain { display: block; color: var(--dim); font-size: 13px; }
.weak-score { font: 900 22px/1 var(--font-display); text-align: right; white-space: nowrap; }
.weak-score em { display: block; color: var(--dim); font: 400 12.5px var(--font-body); font-style: normal; }
.weak-score.is-bad { color: var(--bad); }
.weak-score.is-mid { color: var(--warn); }
.weak-score.is-good { color: var(--go); }
.strong-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--go-soft); color: var(--ink); font-size: 14.5px; }

.activity-card { display: flex; flex-direction: column; }
.activity-card .spark { flex: 1; }
.spark { display: flex; align-items: flex-end; gap: 5px; min-height: 108px; margin-top: 16px; }
.spark-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.spark-bar { width: 100%; border-radius: 6px 6px 2px 2px; transition: height 0.4s; }
.spark-good { background: var(--go); }
.spark-ok { background: var(--gold); }
.spark-low { background: var(--bad); }
.spark-empty { background: var(--sunken); }
.spark-axis { display: flex; justify-content: space-between; color: var(--dim); font-size: 13px; margin-top: 7px; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-top: 14px; }
.badge { border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; background: var(--surface-2); }
.badge-icon { display: block; font-size: 26px; margin-bottom: 6px; }
.badge-name { font-size: 13px; color: var(--muted); line-height: 1.3; }
.badge.is-locked { opacity: 0.4; filter: grayscale(1); }
.badge.is-earned { background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--gold); }
.badge.is-earned .badge-name { color: var(--ink); font-weight: 700; }
.badge.is-new { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ───────────────────────────── questions (solo and match) ───────────────────────────── */
.quizbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.quizbar-mid { text-align: center; }
.quiz-mode { display: block; font: 800 22px/1.1 var(--font-display); }
.quiz-count { color: var(--dim); font-size: 14px; }
.quizbar-right { display: flex; align-items: center; gap: 10px; }
.combo { display: flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); }
.combo em { color: var(--muted); font-size: 13px; font-style: normal; }
.combo strong { font: 900 20px/1 var(--font-display); }
.combo-mult { color: var(--you); font-size: 13px; font-weight: 700; }
.combo.is-hot strong { color: var(--flame); }
.xp-chip { color: var(--muted); font-size: 14px; }
.xp-chip strong { color: var(--ink); font: 900 18px var(--font-display); }

.progress { height: 10px; border-radius: 999px; background: var(--sunken); overflow: hidden; margin-bottom: 12px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--go); transition: width 0.35s; }

.timer, .vs-clock {
  position: relative; height: 14px; border-radius: 999px;
  background: var(--sunken); overflow: hidden; margin: 4px 0 30px;
  overflow: visible;
}
.timer-fill, .vs-clock-fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: var(--go);
}
.vs-clock-fill { transition: width 0.1s linear; }
.timer span, .vs-clock span {
  position: absolute; right: 0; top: 18px;
  font: 800 15px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--muted);
}
.timer.is-urgent .timer-fill, .vs-clock.is-urgent .vs-clock-fill { background: var(--bad); }
.timer.is-urgent span, .vs-clock.is-urgent span { color: var(--bad); }

.question { padding: 26px; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.pill-math { background: var(--you-soft); color: var(--you); }
.pill-rw { background: var(--them-soft); color: var(--them); }
.q-domain { color: var(--dim); font-size: 14px; flex: 1; }
.dots { color: var(--gold); font-size: 11px; letter-spacing: 2px; }

.q-passage {
  background: var(--surface-2); border-left: 4px solid var(--line-strong);
  border-radius: 6px; padding: 16px 18px; margin-bottom: 16px;
  font-size: 16px; line-height: 1.75;
}
.q-notes { margin: 0 0 16px; padding: 14px 16px 14px 34px; background: var(--surface-2); border-radius: 8px; font-size: 15.5px; line-height: 1.65; }
.q-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 15px; }
.q-table th, .q-table td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.q-table th { background: var(--surface-2); color: var(--muted); font-weight: 700; }
.q-prompt { font-size: 18.5px; line-height: 1.55; margin-bottom: 18px; font-weight: 600; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 13px 16px 13px 12px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  box-shadow: 0 3px 0 var(--line);
  font: 400 16.5px/1.45 var(--font-body);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, border-color 0.12s, background 0.12s;
}
.choice:not(:disabled):hover { border-color: var(--line-strong); box-shadow: 0 3px 0 var(--line-strong); }
.choice:not(:disabled):active { transform: translateY(3px); box-shadow: none; }
.choice-letter {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  border: 2px solid var(--line); color: var(--muted);
  font: 800 17px/1 var(--font-display);
}
.choice:disabled { cursor: default; }
.choice.is-picked { border-color: var(--you); background: var(--you-soft); box-shadow: 0 3px 0 var(--you); }
.choice.is-picked .choice-letter { background: var(--you); border-color: var(--you); color: #fff; }
.choice.is-correct { border-color: var(--go); background: var(--go-soft); box-shadow: 0 3px 0 var(--go-edge); }
.choice.is-correct .choice-letter { background: var(--go); border-color: var(--go); color: #fff; }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 3px 0 var(--bad); }
.choice.is-wrong .choice-letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.choice.is-dim { opacity: 0.5; }
/* Correct/incorrect must not rely on green vs red alone. */
.choice.is-correct::after, .choice.is-wrong::after {
  margin-left: auto; font: 900 20px/1 var(--font-display);
}
.choice.is-correct::after { content: '✓'; color: var(--go); }
.choice.is-wrong::after { content: '✗'; color: var(--bad); }

.hint { color: var(--dim); font-size: 14px; margin-top: 14px; text-align: center; }

.feedback { margin-top: 16px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface-2); animation: rise 0.25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.feedback-head strong { font: 900 24px/1 var(--font-display); }
.feedback.is-good { background: var(--go-soft); }
.feedback.is-good .feedback-head strong { color: var(--go); }
.feedback.is-bad { background: var(--bad-soft); }
.feedback.is-bad .feedback-head strong { color: var(--bad); }
.feedback p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.award { font: 900 20px var(--font-display); white-space: nowrap; color: var(--gold); }
.award em { color: var(--dim); font: 400 13px var(--font-body); font-style: normal; }
.award-zero { color: var(--dim); font-size: 14px; }

/* ───────────────────────────── results ───────────────────────────── */
.results-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; }
.results-hero h1 { font-size: 46px; margin: 4px 0 6px; }
.results-sub { color: var(--muted); font-size: 15.5px; }
.levelup {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  background: var(--gold); color: #231a00;
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.levelup strong { display: block; font: 900 28px/1 var(--font-display); }
.levelup span { font-size: 15px; }

.review { list-style: none; margin: 14px 0 0; padding: 0; }
.review li { padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--surface-2); border-left: 5px solid var(--line); }
.review li.is-correct { border-left-color: var(--go); }
.review li.is-wrong { border-left-color: var(--bad); }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.review-num { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--sunken); font: 800 14px var(--font-display); color: var(--muted); }
.review-skill { flex: 1; font-size: 14px; color: var(--muted); }
.review-mark { font-size: 14px; font-weight: 700; color: var(--go); white-space: nowrap; }
.review li.is-wrong .review-mark { color: var(--bad); }
.review-prompt { font-size: 15.5px; }
.review-explain { color: var(--muted); font-size: 14.5px; margin-top: 6px; line-height: 1.6; }
.results-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ═══════════════════════════ the match ═══════════════════════════ */
.vs-wrap { max-width: 940px; }
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 14px; }
.vs-card {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center;
  column-gap: 12px; row-gap: 2px;
  background: var(--surface); border-radius: var(--radius); padding: 12px 16px;
  border: 3px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}
.vs-card .avatar { grid-row: 1 / 3; }
.vs-card.is-them { grid-template-columns: auto 1fr auto; direction: rtl; }
.vs-card.is-them > * { direction: ltr; }
.vs-card.is-turn.is-you { border-color: var(--you); }
.vs-card.is-turn.is-them { border-color: var(--them); }
.vs-card.is-away { opacity: 0.55; }
.vs-card.is-empty { grid-template-columns: auto 1fr; color: var(--dim); }
.vs-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.vs-card.is-them .vs-name { justify-content: flex-end; }
.vs-name em { color: var(--dim); font-style: normal; font-weight: 400; font-size: 13px; }
.vs-away { color: var(--warn); }
.vs-score { grid-row: 1 / 3; grid-column: 3; font: 900 52px/0.9 var(--font-display); font-variant-numeric: tabular-nums; }
.vs-card.is-you .vs-score { color: var(--you); }
.vs-card.is-them .vs-score { color: var(--them); }
.vs-meta { display: flex; gap: 6px; align-items: center; min-height: 20px; flex-wrap: wrap; }
.vs-card.is-them .vs-meta { justify-content: flex-end; }
.vs-streak { display: inline-flex; align-items: center; gap: 2px; color: var(--flame); font: 900 17px/1 var(--font-display); }
.vs-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.vs-tag.is-bad { background: var(--bad-soft); color: var(--bad); }
.vs-mid { text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; }
.vs-mode { font: 800 20px/1.1 var(--font-display); }
.vs-round { color: var(--muted); font-size: 13.5px; }
.vs-code { color: var(--dim); font: 800 14px var(--font-display); letter-spacing: 0.2em; }

.vs-stage { display: grid; grid-template-columns: 1fr; gap: 14px; }
.vs-stage.has-panel { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
.vs-main { min-width: 0; }
.vs-panel { background: var(--surface); border-radius: var(--radius); overflow: hidden; align-self: start; position: sticky; top: 14px; }
.vs-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.vs-panel-body { padding: 12px; }
.vs-tools { display: flex; gap: 8px; margin-bottom: 12px; }

.vs-banner {
  padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 12px;
  background: var(--surface); font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.vs-banner.is-good { background: var(--go-soft); color: var(--go); }
.vs-banner.is-bad { background: var(--bad-soft); color: var(--bad); }
.vs-banner.is-warn { background: var(--warn-soft); color: var(--warn); }
.vs-banner.is-steal { background: var(--gold); color: #231a00; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-2px); } }
.vs-banner em { color: inherit; opacity: 0.8; font-style: normal; font-weight: 400; font-size: 14px; }
.vs-delta { font: 900 22px/1 var(--font-display); }
.vs-delta.is-up { color: var(--go); }
.vs-delta.is-down { color: var(--bad); }

/* lobby */
.vs-lobby { text-align: center; padding: 28px 24px; }
.vs-lobby-title { font-size: 40px; margin-bottom: 18px; }
.vs-bigcode { display: flex; justify-content: center; gap: 10px; margin: 10px 0 8px; }
.vs-bigcode span {
  width: 66px; height: 80px; display: grid; place-items: center;
  border-radius: 14px; background: var(--surface-2);
  box-shadow: inset 0 -5px 0 var(--line);
  font: 900 52px/1 var(--font-display);
}
.vs-lobby-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 22px 0 16px; }
.vs-lobby-vs { font: 900 30px/1 var(--font-display); color: var(--dim); }
.vs-seat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 12px; border-radius: var(--radius); background: var(--surface-2);
}
.vs-seat strong { font: 800 22px/1.1 var(--font-display); }
.vs-seat span { color: var(--muted); font-size: 14px; }
.vs-seat.is-ready span { color: var(--go); font-weight: 700; }
.vs-seat.is-empty { color: var(--dim); }
.bot-picks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.vs-share { display: flex; gap: 8px; margin: 14px 0 0; }
.vs-share input { flex: 1; font-size: 14px; color: var(--muted); }
.vs-share-note { color: var(--dim); font-size: 13.5px; margin-top: 8px; }
.vs-howto, .vs-warn { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; }
.vs-howto strong, .vs-warn strong { display: block; margin-bottom: 6px; font-size: 15.5px; }
.vs-howto p, .vs-warn p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-bottom: 6px; }
.vs-howto ol { margin: 6px 0 0; padding-left: 22px; color: var(--muted); font-size: 14.5px; line-height: 1.9; }
.vs-howto ol strong { display: inline; color: var(--ink); font-size: inherit; }
.vs-howto-note { color: var(--dim) !important; font-size: 13px !important; }
.vs-howto-bad { color: var(--bad) !important; }
.vs-warn { background: var(--bad-soft); }
.vs-warn strong { color: var(--bad); }
.vs-warn pre { margin: 4px 0 0; padding: 9px 11px; border-radius: 8px; background: var(--surface); overflow-x: auto; }
.vs-warn pre code { background: none; padding: 0; }

.vs-countdown { text-align: center; padding: 48px 20px; }
.vs-count { font: 900 150px/1 var(--font-display); margin: 8px 0; color: var(--go); }
.vs-countdown p { color: var(--muted); font-size: 16px; }

/* draft */
.vs-draft h2 { font-size: 34px; margin: 6px 0; }
.vs-domains { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 16px 0; }
.vs-domain {
  padding: 18px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
  font: 800 21px/1.15 var(--font-display); cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, border-color 0.12s;
}
.vs-domain:not(:disabled):hover { border-color: var(--you); box-shadow: 0 4px 0 var(--you); }
.vs-domain:not(:disabled):active { transform: translateY(4px); box-shadow: none; }
.vs-domain:disabled { opacity: 0.45; cursor: default; }
.vs-draft-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vs-team { border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.vs-team strong { display: block; font-size: 15px; margin-bottom: 6px; }
.vs-team span { display: inline-block; font-size: 13px; padding: 3px 9px; margin: 2px 3px 2px 0; border-radius: 999px; background: var(--you-soft); color: var(--you); font-weight: 700; }
.vs-team + .vs-team span { background: var(--them-soft); color: var(--them); }
.vs-team em { color: var(--dim); font-size: 14px; }

/* wager: poker chips */
.vs-wager { text-align: center; }
.vs-wager h2 { font-size: 36px; margin: 6px 0; }
.vs-chips { display: flex; gap: 14px; justify-content: center; margin: 22px 0 10px; }
.vs-chip {
  width: 76px; height: 76px; border-radius: 50%;
  border: 6px dashed rgb(255 255 255 / 0.55); background: var(--gold); color: #231a00;
  box-shadow: 0 5px 0 #b58300;
  font: 900 34px/1 var(--font-display); cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s;
}
.vs-chip:not(:disabled):active { transform: translateY(5px); box-shadow: none; }
.vs-chip.is-on { background: var(--go); color: #fff; box-shadow: 0 5px 0 var(--go-edge); }
.vs-chip:disabled:not(.is-on) { opacity: 0.4; cursor: default; }

.vs-question { padding: 24px; }
.vs-explain { margin-top: 12px; padding: 16px 18px; }
.vs-explain p { color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.reveal-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.report { color: var(--dim); }
.report-done { color: var(--muted); font-size: 14px; }

/* game over */
.vs-over { text-align: center; padding: 30px 22px; }
.vs-over h1 { font-size: 64px; margin: 6px 0 4px; }
.vs-over.is-win h1 { color: var(--go); }
.vs-final { display: flex; align-items: center; justify-content: center; gap: 26px; margin: 18px 0 14px; }
.vs-final > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-final > div.is-winner .avatar { box-shadow: inset 0 0 0 3px var(--ring), 0 0 0 5px var(--surface), 0 0 0 9px var(--gold); }
.vs-final strong { font: 900 64px/1 var(--font-display); }
.vs-final span { color: var(--muted); font-weight: 700; }
.vs-final em { color: var(--dim); font: 900 34px var(--font-display); font-style: normal; }
.vs-record { color: var(--ink); font-size: 15.5px; font-weight: 700; margin-top: 10px; }

.round-log { list-style: none; margin: 14px 0 0; padding: 0; }
.round-log li { display: grid; grid-template-columns: 30px 1fr 84px 84px; gap: 8px; align-items: center; padding: 9px 8px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.round-log li:last-child { border-bottom: 0; }
.rl-head { color: var(--dim); font-weight: 700; font-size: 13px; }
.rl-round { color: var(--dim); font: 800 16px var(--font-display); }
.rl-skill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-cell { text-align: center; font-variant-numeric: tabular-nums; }
.rl-ok { color: var(--go); font-weight: 700; }
.rl-no { color: var(--bad); font-weight: 700; }
.rl-none { color: var(--dim); }

.challenge-card { margin-bottom: 16px; text-align: center; }
.challenge-card h2 { font-size: 36px; margin: 6px 0 8px; }
.challenge-card.is-win h2 { color: var(--go); }
.challenge-card .vs-share input { font-family: var(--font-mono); font-size: 12px; }
.vs-notice { color: var(--you); font-size: 15px; margin-top: 12px; }
.vs-notice.is-bad { color: var(--bad); }
.vs-offline { background: var(--warn-soft); margin-bottom: 16px; }
.spaced { margin-top: 26px; }

/* ───────────────────────────── graphing calculator ───────────────────────────── */
.calc { display: flex; flex-direction: column; gap: 10px; }
.calc-graph { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.calc-canvas { display: block; width: 100%; height: 240px; cursor: crosshair; touch-action: none; }
.calc-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.calc-zoom button { width: 28px; height: 28px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 700 15px/1 var(--font-body); }
.calc-zoom button:hover { color: var(--ink); }
.calc-readout { position: absolute; bottom: 6px; left: 8px; display: flex; gap: 12px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface); padding: 3px 8px; border-radius: 6px; }
.calc-rows { display: flex; flex-direction: column; gap: 7px; }
.calc-row { display: flex; align-items: center; gap: 8px; }
.calc-row input { flex: 1; min-width: 0; padding: 8px 10px; font: 400 14px/1 var(--font-mono); border-radius: 8px; }
.calc-row.is-error input { border-color: var(--bad); }
.calc-swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.calc-value { min-width: 62px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-row.is-error .calc-value { color: var(--bad); }
.calc-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.calc-keys button { padding: 9px 2px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--font-body); box-shadow: 0 2px 0 var(--line); }
.calc-keys button:active { transform: translateY(2px); box-shadow: none; }
.calc-hint { color: var(--dim); font-size: 12.5px; line-height: 1.55; }

.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.ref-card { display: flex; align-items: center; gap: 9px; border-radius: 10px; padding: 9px; background: var(--surface-2); }
.ref-card.is-wide { grid-column: span 2; }
.ref-svg { width: 52px; height: 52px; flex: none; stroke: var(--you); fill: var(--you-soft); stroke-width: 1.4; }
.ref-svg text { fill: var(--muted); stroke: none; font-size: 9px; }
.ref-body strong { display: block; font-size: 13px; margin-bottom: 2px; }
.ref-body span { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ref-facts { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.ref-note { color: var(--dim); font-size: 12.5px; margin-top: 8px; }

/* ───────────────────────────── responsive ───────────────────────────── */
.streak-chip { display: none; align-items: center; gap: 2px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--surface); }
.streak-chip strong { font: 900 22px/1 var(--font-display); color: var(--dim); }
.streak-chip.is-lit strong { color: var(--flame); }
.streak-chip:not(.is-lit) .emoji { filter: grayscale(1); opacity: 0.5; }

@media (max-width: 940px) {
  .home { grid-template-columns: 1fr; }
  .play { order: -1; }
  .streak-chip { display: inline-flex; }
  .profile { position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .profile .me, .profile .field { grid-column: 1 / -1; }
  .profile .rivals { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .col-4, .col-5, .col-7, .col-8 { grid-column: span 12; }
  .hero-cta { flex-direction: row; width: 100%; }
  .hero-cta .btn { flex: 1; }
  .vs-stage.has-panel { grid-template-columns: 1fr; }
  .vs-panel { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 14px 16px 48px; }
  .topbar { margin-bottom: 16px; }
  .wordmark { font-size: 26px; white-space: nowrap; }
  .topbar-right { flex-wrap: nowrap; }
  .topbar-right .btn-label { display: none; }
  .topbar-right .btn { padding: 8px 10px; }
  .profile { grid-template-columns: 1fr; padding: 18px; }
  .me .avatar { --avatar-size: 88px; }
  .bots { grid-template-columns: 1fr; }
  .quick { padding: 16px; gap: 12px; }
  .quick-copy strong { font-size: 27px; }
  .quick-go { display: none; }
  .friend-row { flex-direction: column; align-items: stretch; }
  .join-row { flex-wrap: wrap; }
  .join-row input:not(.code-field) { flex-basis: 100%; }
  .card { padding: 18px; }
  .question, .vs-question { padding: 18px; }
  .vs-head { grid-template-columns: 1fr 1fr; }
  .vs-mid { grid-column: 1 / -1; order: -1; flex-direction: row; justify-content: center; gap: 10px; align-items: baseline; }
  .vs-card { padding: 10px 12px; column-gap: 8px; }
  .vs-card .avatar { --avatar-size: 38px !important; }
  .vs-score { font-size: 40px; }
  .vs-name { font-size: 14px; white-space: normal; line-height: 1.15; }
  .vs-name em { display: none; }
  .vs-bigcode span { width: 54px; height: 66px; font-size: 42px; }
  .vs-lobby-players { grid-template-columns: 1fr; }
  .vs-lobby-vs { display: none; }
  .vs-count { font-size: 110px; }
  .vs-over h1 { font-size: 48px; }
  .vs-final { gap: 14px; }
  .vs-final strong { font-size: 48px; }
  .vs-draft-teams { grid-template-columns: 1fr; }
  .round-log li { grid-template-columns: 24px 1fr 62px 62px; font-size: 13px; }
  .results-hero h1 { font-size: 34px; }
  .quizbar { justify-content: center; }
  .quizbar-mid { order: -1; width: 100%; }
}

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

/* ═══════════════════════ accessibility ═══════════════════════ */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
.choice:focus-visible, .format:focus-within, .vs-domain:focus-visible, .quick:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  padding: 10px 16px; border-radius: 10px;
  background: var(--go); color: #fff; font-weight: 700;
  transition: top 0.15s;
}
.skip-link:focus { top: 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;
}
@media (forced-colors: active) {
  .card, .choice, .vs-card, .format, .solo-btn, .bot, .quick { border: 1px solid CanvasText; }
  .xp-fill, .bar-fill, .vs-clock-fill { forced-color-adjust: none; background: Highlight; }
}
