/* ==========================================================================
   Tokens: every color is defined once here, with a matching dark-mode set.
   Chart series colors are a colorblind-validated categorical palette.
   ========================================================================== */

:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --surface-3: #e7e6e1;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6e69;
  --tick: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.18);
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-ink: #1c5cab;
  --accent-wash: rgba(42, 120, 214, 0.1);
  --on-accent: #ffffff;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-wash: rgba(12, 163, 12, 0.1);
  --bad: #d03b3b;
  --bad-ink: #b3261e;
  --bad-wash: rgba(208, 59, 59, 0.09);
  --warn-ink: #8a5a00;
  --warn-wash: rgba(250, 178, 25, 0.16);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 8px 28px rgba(11, 11, 11, 0.06);
  --shadow-lift: 0 2px 4px rgba(11, 11, 11, 0.06), 0 16px 40px rgba(11, 11, 11, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242422;
    --surface-3: #2e2e2b;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #a3a29b;
    --tick: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-ink: #86b6ef;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --on-accent: #ffffff;
    --good: #0ca30c;
    --good-ink: #3dc43d;
    --good-wash: rgba(12, 163, 12, 0.16);
    --bad: #d03b3b;
    --bad-ink: #f07b7b;
    --bad-wash: rgba(208, 59, 59, 0.16);
    --warn-ink: #fab219;
    --warn-wash: rgba(250, 178, 25, 0.12);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242422;
  --surface-3: #2e2e2b;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #a3a29b;
  --tick: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-ink: #86b6ef;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --good-ink: #3dc43d;
  --good-wash: rgba(12, 163, 12, 0.16);
  --bad-ink: #f07b7b;
  --bad-wash: rgba(208, 59, 59, 0.16);
  --warn-ink: #fab219;
  --warn-wash: rgba(250, 178, 25, 0.12);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: 12px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font: 600 0.85em/1.5 var(--font);
  text-align: center;
}

/* ==========================================================================
   Layout: header, tabs, footer
   ========================================================================== */

.site-header, .tabs-row, main, .site-footer, .offline-banner {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 16px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-mark rect { fill: var(--accent); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-tagline { color: var(--ink-2); font-size: 0.875rem; }

.lang-picker { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 0.875rem; }

select, input[type="text"] {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
select { padding-right: 8px; cursor: pointer; }
select:disabled { opacity: 0.6; cursor: default; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.tab {
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.offline-banner {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-wash);
  color: var(--warn-ink);
  font-weight: 600;
}

main { padding: 20px 0 48px; }

.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--ink-2);
  font-size: 0.875rem;
  display: grid;
  gap: 6px;
}

/* ==========================================================================
   Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms, border-color 120ms, transform 120ms;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-lg { min-height: 48px; padding: 10px 24px; font-size: 1.0625rem; }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 0.875rem; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 20px;
}
.field { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { padding: 0; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.filters-actions { display: flex; gap: 8px; margin-left: auto; }
.month-picker { display: flex; gap: 6px; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.segmented input:checked + span { background: var(--accent-wash); color: var(--accent-ink); }
.segmented input:hover:not(:checked) + span { background: var(--surface-2); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented input:disabled + span { opacity: 0.55; }

.toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ==========================================================================
   Shared states: loading, error, empty
   ========================================================================== */

.stage { transition: opacity 150ms; }
.stage.is-refreshing { opacity: 0.55; pointer-events: none; }

.state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.state-title { font-size: 1.25rem; }
.state-text { max-width: 52ch; color: var(--ink-2); }
.state--error .state-icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bad-wash);
  color: var(--bad-ink);
  font-weight: 800;
  font-size: 1.25rem;
}
.state .btn { margin-top: 6px; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inline-message { margin: -8px 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); }
.inline-message--warn { background: var(--warn-wash); color: var(--ink); }
.inline-message--error { background: var(--bad-wash); color: var(--ink); }

.eyebrow { color: var(--accent-ink); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ==========================================================================
   Play
   ========================================================================== */

.intro {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.intro-title { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
.intro-text { max-width: 62ch; color: var(--ink-2); font-size: 1.0625rem; }
.intro-facts { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--ink-2); }
.intro .btn-lg { margin-top: 8px; }
.intro-best { color: var(--muted); font-size: 0.875rem; }

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  margin-bottom: 14px;
}
.hud-stat { display: flex; align-items: baseline; gap: 8px; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.hud-stat strong { color: var(--ink); font-size: 1.5rem; }
.hud-context { margin-left: auto; color: var(--ink-2); font-size: 0.875rem; }

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

.versus {
  align-self: center;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-weight: 800;
  font-size: 0.875rem;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow 200ms, border-color 200ms;
}
.card--enter { animation: card-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
.card--correct { border-color: var(--good); box-shadow: 0 0 0 2px var(--good), var(--shadow-lift); }
.card--wrong { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad), var(--shadow-lift); }

.card-media {
  position: relative;
  display: grid;
  place-items: center;
  height: 240px;
  width: 100%;
  overflow: hidden;
  background: var(--surface-2);
}
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-media-fill { object-fit: cover; filter: blur(24px) saturate(1.1); transform: scale(1.25); opacity: 0.55; }
.card-media-main { object-fit: contain; }
.card-initial { color: var(--muted); font-size: 4rem; font-weight: 800; }

.card-body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 18px 20px 20px; text-align: center; }
.card-title { font-size: 1.3rem; line-height: 1.25; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-desc {
  display: -webkit-box;
  min-height: 3em;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.9375rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-had { margin-top: 8px; color: var(--ink-2); font-size: 0.9375rem; }
.card-views { font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.card-unit { color: var(--ink-2); font-size: 0.9375rem; }

/* Buttons and the revealed number share one grid cell so nothing jumps. */
.card-answer { display: grid; align-items: center; min-height: 3.1rem; }
.card-answer > * { grid-area: 1 / 1; }
.card-actions { display: flex; justify-content: center; gap: 10px; }
.card-answer .card-views { visibility: hidden; }
.card--revealed .card-actions { visibility: hidden; }
.card--revealed .card-answer .card-views { visibility: visible; }
.btn-guess { min-width: 124px; min-height: 50px; font-size: 1.0625rem; }

.card-trend { margin-top: auto; padding-top: 12px; min-height: 36px; }
.trend-chart { margin: 0 -4px; }
.trend-note { color: var(--ink-2); font-size: 0.8125rem; }

.round-result {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 132px;
  padding: 20px 16px 0;
  text-align: center;
}
.round-result:empty { padding: 0; }
.verdict { display: inline-flex; align-items: center; gap: 8px; font-size: 1.375rem; font-weight: 800; }
.verdict-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 1rem; }
.verdict--good { color: var(--good-ink); }
.verdict--good .verdict-icon { background: var(--good); }
.verdict--bad { color: var(--bad-ink); }
.verdict--bad .verdict-icon { background: var(--bad); }
.result-text { max-width: 60ch; color: var(--ink-2); }
.result-text strong { color: var(--ink); }
.round-result .btn { margin-top: 6px; }

.gameover {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.hero-number { font-size: clamp(4rem, 12vw, 6rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.gameover-label { color: var(--ink-2); font-size: 1.125rem; }
.gameover-best { margin-top: 4px; font-weight: 600; }
.gameover-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }

.recap { width: min(640px, 100%); margin-top: 28px; text-align: left; }
.recap-title { margin-bottom: 8px; font-size: 1rem; }
.recap-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.recap-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9375rem;
}
.recap-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 0.75rem; font-weight: 800; }
.recap-item--good .recap-icon { background: var(--good); }
.recap-item--bad .recap-icon { background: var(--bad); }
.recap-item--bad { background: var(--bad-wash); }
.recap-vs { color: var(--muted); font-weight: 700; }
.recap-choice { color: var(--ink-2); font-size: 0.8125rem; white-space: nowrap; }

/* ==========================================================================
   Compare
   ========================================================================== */

.search { display: flex; gap: 8px; margin-bottom: 16px; }
.combo { position: relative; flex: 1; max-width: 520px; }
.combo input { width: 100%; min-height: 44px; }

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.suggestion { display: grid; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.suggestion:hover, .suggestion[aria-selected="true"] { background: var(--accent-wash); }
.suggestion-title { font-weight: 600; }
.suggestion-desc { color: var(--ink-2); font-size: 0.8125rem; }

.panel {
  margin-bottom: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel-head { margin-bottom: 12px; }
.panel-title { font-size: 1.125rem; }
.panel-sub { color: var(--ink-2); font-size: 0.875rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.chip a { color: var(--ink); text-decoration: none; }
.chip a:hover { text-decoration: underline; }
.chip-remove {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 1.125rem;
  cursor: pointer;
}
.chip-remove:hover { background: var(--surface-2); color: var(--ink); }

.line-key { display: inline-block; flex: none; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; }

.insights { display: grid; gap: 4px; margin: -4px 0 16px; padding: 0 4px; }
.insight { color: var(--ink-2); }

.example-list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.example-label { color: var(--ink-2); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: middle; }
.data-table thead th { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.data-table tbody th { font-weight: 600; }
.row-label { display: inline-flex; align-items: center; gap: 8px; }
.data-table tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-note { margin-top: 10px; color: var(--ink-2); font-size: 0.875rem; }

/* ==========================================================================
   Charts
   ========================================================================== */

.chart { position: relative; outline-offset: 4px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 0.1; stroke: none; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .overlay { fill: transparent; cursor: crosshair; touch-action: pan-y; }

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  font-size: 0.8125rem;
  pointer-events: none;
  white-space: nowrap;
}
.chart-tooltip-date { margin-bottom: 4px; color: var(--ink-2); }
.chart-tooltip-row { display: flex; align-items: center; gap: 8px; }
.chart-tooltip-row strong { font-variant-numeric: tabular-nums; }
.chart-tooltip-row span:last-child { color: var(--ink-2); }
.chart--compact .chart-tooltip { min-width: 0; }

.floating-tooltip {
  position: absolute;
  z-index: 20;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  font-size: 0.8125rem;
  pointer-events: none;
}
.muted { color: var(--ink-2); }

/* ==========================================================================
   Top charts
   ========================================================================== */

.top-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.top-row {
  display: grid;
  grid-template-columns: 2.25rem 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--grid);
}
.top-row:last-child { border-bottom: 0; }
.top-rank { color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.top-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.top-thumb--empty { display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.top-main { display: grid; gap: 2px; min-width: 0; }
.top-title { overflow: hidden; color: var(--ink); font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.top-title:hover { text-decoration: underline; }
.top-desc { overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }

.bar-track { display: flex; align-items: center; gap: 8px; height: 22px; margin-top: 4px; border-radius: 4px; }
.bar {
  /* The value label sits at the tip, so the longest bar leaves room for it. */
  flex: 0 0 calc((100% - 64px) * var(--fraction));
  height: 16px;
  border-radius: 0 4px 4px 0;
  background: var(--series-1);
  transition: filter 120ms;
}
.bar-track:hover .bar, .bar-track:focus-visible .bar { filter: brightness(1.12); }
.bar-value { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.show-more { display: flex; margin: 16px auto 0; }

.reason { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.reason--bot { background: var(--warn-wash); color: var(--ink); }

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 760px) {
  .site-header { padding-top: 16px; }
  .brand-tagline, .lang-picker > span { display: none; }
  .brand-name { font-size: 1.125rem; line-height: 1.25; }
  .filters-actions { margin-left: 0; width: 100%; }
  .filters-actions .btn { flex: 1; }

  .arena { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .versus { justify-self: center; margin: -14px 0; position: relative; z-index: 2; width: 44px; height: 44px; }
  .card-media { height: 160px; }
  .card-body { padding: 14px 16px 16px; }
  .card-desc { min-height: 0; }
  .hud-context { margin-left: 0; width: 100%; }

  .search .btn { padding-inline: 20px; }
  .panel { padding: 16px 12px; }
  .top-row { grid-template-columns: 1.75rem 40px minmax(0, 1fr); }
  .top-thumb { width: 40px; height: 40px; }
  .top-compare { grid-column: 3; justify-self: start; }
  .recap-item { grid-template-columns: auto 1fr; }
  .recap-choice { grid-column: 2; }
}

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