/*!
 * PlayStation 5 Weekly Player Numbers
 * https://ps5-weekly-players.pages.dev
 * Copyright (c) 2026 andshrew
 * SPDX-License-Identifier: CC-BY-NC-SA-4.0
 * License: Creative Commons Attribution Non Commercial Share Alike 4.0 International
 * AI model contributors: Claude Sonnet 5.5
 * This website is not affiliated with PlayStation or Sony Interactive Entertainment Inc.
 */
/* ==================================================================
   ACCESSIBLE VARIANT - drop-in replacement for style.css.
   adjusted to WCAG 2.2 AA (most text AAA).

   What is different, and why
   - Text >= 7:1 (AAA) in both themes, secondary text >= 4.5:1 minimum.
   - Borders of interactive controls >= 3:1 (WCAG 1.4.11); decorative
     table/card borders stay subtle (--border) vs control borders (--border-strong).
   - Never colour alone (WCAG 1.4.1): links are underlined, selected chips
     show a tick, sorted columns show an arrow, chart series differ by
     dash pattern as well as colour.
   - Strong two-tone focus ring (WCAG 2.4.7 / 2.4.11) visible on any background.
   - Larger touch / click targets (WCAG 2.5.8), 16px+ text, 70ch line length.
   - Respects prefers-reduced-motion, prefers-contrast: more, and
     forced-colors (Windows High Contrast).
   Every colour pair is checked by contrast_check.py in this folder.
   ================================================================== */
:root {
  color-scheme: light dark;
  --bg: #f4f5f0;
  --surface: #e9ebe1;
  --text: #14181c;
  --muted: #474e55;
  --border: rgba(0, 0, 0, 0.16);        /* decorative dividers only */
  --border-strong: #66707a;             /* control outlines: >= 3:1 */
  --primary: #1d3c58;
  --primary-dark: #14293e;
  --on-primary: #ffffff;
  --focus: #0b5cad;
  --link-hover: #0b5cad;
  --stripe: rgba(29, 60, 88, 0.05);
  --hover: rgba(29, 60, 88, 0.11);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  /* chart colours for countries; total line uses --primary */
  --cat-1: #b43c06;
  --cat-2: #0a7a5c;
  --cat-3: #7a3fb2;
  --cat-4: #b3307f;
  --cat-5: #0a6aa8;
  --cat-6: #8a6100;
  --c-total: var(--primary);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1b1d;
    --surface: #26272a;
    --text: #ececec;
    --muted: #bcc0c7;
    --border: rgba(255, 255, 255, 0.16);
    --border-strong: #8d939c;
    --primary: #e4da9b;
    --primary-dark: #f0e8b8;
    --on-primary: #1b1b1d;
    --focus: #8cc8ff;
    --link-hover: #8cc8ff;
    --stripe: rgba(228, 218, 155, 0.05);
    --hover: rgba(228, 218, 155, 0.14);
    --shadow: none;
    --cat-1: #6cb4ff;
    --cat-2: #ff9c80;
    --cat-3: #7fd6a4;
    --cat-4: #d0a8ff;
    --cat-5: #ff8fc4;
    --cat-6: #4dd0dc;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1b1d;
  --surface: #26272a;
  --text: #ececec;
  --muted: #bcc0c7;
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: #8d939c;
  --primary: #e4da9b;
  --primary-dark: #f0e8b8;
  --on-primary: #1b1b1d;
  --focus: #8cc8ff;
  --link-hover: #8cc8ff;
  --stripe: rgba(228, 218, 155, 0.05);
  --hover: rgba(228, 218, 155, 0.14);
  --shadow: none;
  --cat-1: #6cb4ff;
  --cat-2: #ff9c80;
  --cat-3: #7fd6a4;
  --cat-4: #d0a8ff;
  --cat-5: #ff8fc4;
  --cat-6: #4dd0dc;
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

h1, h2 { line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }

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

.skip {
  position: absolute; left: -999px; top: 0; background: var(--primary);
  color: var(--on-primary); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }

/* ---------------------------------------------------------------- header */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--text); font-weight: 700; font-size: 1.1rem;
}
.brand:hover { text-decoration: none; }

.brand-mark { display: block; flex: none; height: 1.3rem; width: auto; color: var(--primary); }
.brand-logo { display: block; flex: none; width: auto; max-width: 14rem; }

.theme-toggle {
  font: inherit; font-size: 0.85rem; color: var(--text); cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.25rem 0.8rem; white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--primary); }

/* ----------------------------------------------------------------- intro */
.intro { margin-bottom: 1.25rem; }
.intro > :first-child { margin-top: 0; }
.intro > :last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- controls */
.controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem;
  margin: 0 0 0.75rem;
}

.search input {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.8rem; min-width: min(22rem, 100%);
}
.search input:focus { border-color: var(--primary); }

.chips {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin: 0; padding: 0; border: 0; min-width: 0;
}
.chips legend {
  float: left; padding: 0; margin-right: 0.4rem; font-size: 0.9rem; color: var(--muted);
}

.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 0.2rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); font-size: 0.85rem; font-weight: 600;
  background: var(--bg); user-select: none;
}
.chip:hover span { border-color: var(--primary); }
.chip input:checked + span {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
}
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; cursor: pointer; }
.toggle input { accent-color: var(--primary); }

.status { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.6rem; }

/* ----------------------------------------------------------------- table */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); box-shadow: var(--shadow);
}

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

table.data th, table.data td {
  padding: 0.45rem 0.85rem; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) { background: var(--stripe); }
table.data tbody tr:hover { background: var(--hover); }
table.data tr[hidden] { display: none; }

table.data th {
  background: var(--surface); font-size: 0.85rem; font-weight: 600;
  border-bottom: 2px solid var(--border);
}
table.data th button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0;
  cursor: pointer; font-weight: 600;
}
table.data th button:hover { color: var(--primary); }

table.data th[aria-sort="ascending"] button::after { content: " ▲"; font-size: 0.7em; color: var(--primary); }
table.data th[aria-sort="descending"] button::after { content: " ▼"; font-size: 0.7em; color: var(--primary); }

table.data .num { text-align: right; }
table.data .rank { text-align: right; color: var(--muted); width: 1%; }
table.data td.name { white-space: normal; min-width: 14rem; font-weight: 500; }
table.data td.date { color: var(--muted); }
table.data tr.stale td.date,
table.data tr.stale td.name,
table.data tr.stale td.name a,
table.data tr.stale td.num:not([class*="col-"]) { font-style: italic; }
table.data td.na { color: var(--muted); }
table.data .empty-row td { text-align: center; color: var(--muted); padding: 1.5rem; }

/* percentage of total, shown only when the toggle is on */
.pct { display: none; margin-left: 0.5rem; color: var(--muted); font-size: 0.85em; }
html.show-pct .pct { display: inline-block; min-width: 3.4em; }

/* ------------------------------------------------------------- game page */
.crumb { margin: 0 0 0.75rem; font-size: 0.9rem; }

.game-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 1.5rem; margin-bottom: 1.25rem;
}
.game-head h1 { margin: 0; }

.btn {
  display: inline-block; padding: 0.45rem 0.95rem; border-radius: 8px;
  background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 0.9rem;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
:root[data-theme="dark"] .btn:hover { color: var(--on-primary); }

.stats {
  display: grid; gap: 0.75rem; margin-bottom: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.75rem 1rem;
}
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat-sub { font-size: 0.85rem; color: var(--muted); }

.notes {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: 10px;
  padding: 0.25rem 1rem 0.75rem; margin-bottom: 1.25rem;
}
.notes h2 { margin-top: 0.75rem; font-size: 1.05rem; }
.notes > :last-child { margin-bottom: 0; }
.notes.empty { border-style: dashed; background: transparent; }
.notes .placeholder { color: var(--muted); margin: 0; }

.chart-section h2 { margin-top: 1.25rem; }
.chart { position: relative; width: 100%; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }

.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s-total { stroke: var(--c-total); }
.chart .dot.s-total { fill: var(--c-total); }
.chart .dot { stroke: var(--bg); stroke-width: 1.5; }
.chart .guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }

.tip {
  position: absolute; top: 6px; z-index: 2; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  padding: 0.4rem 0.65rem; font-size: 0.85rem; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tip strong { display: block; margin-bottom: 0.15rem; }
.tip .row { display: flex; align-items: center; gap: 0.4rem; }
.tip .row .val { margin-left: auto; padding-left: 1rem; font-weight: 600; }
.tip .row .tp { color: var(--muted); font-size: 0.9em; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.sw { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; }
.sw.s-total { background: var(--c-total); }

/* ---------------------------------------------------------------- footer */
.site-footer {
  max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 2rem;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem;
}
.site-footer a { color: inherit; text-decoration: underline; }
.site-footer a:hover { color: var(--link-hover); }
.site-footer > :first-child { margin-top: 0; }
.site-footer > :last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .brand-text { font-size: 1rem; }
  table.data th, table.data td { padding: 0.4rem 0.6rem; }
}

/* ------------------------------------------------- nav, FAQ, day selector */
[hidden] { display: none !important; }

.site-nav { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: var(--text); font-weight: 600; font-size: 0.95rem; }
.nav-link:hover { color: var(--primary); text-decoration: none; }
.nav-link[aria-current="page"] { color: var(--primary); }

.select { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.select select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.6rem;
}
.select select:focus { border-color: var(--primary); }

.faq { max-width: 52rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 1rem; margin: 0 0 0.6rem;
}
.faq summary { cursor: pointer; font-weight: 600; padding: 0.75rem 0; }
.faq summary:hover { color: var(--primary); }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 0.6rem; }
.faq details > :last-child { margin-bottom: 0.9rem; }

/* images in FAQ answers and game notes */
.faq figure, .notes figure { margin: 0.75rem 0 1rem; }
.faq img, .notes img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
}
.faq figcaption, .notes figcaption { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); }

/* ==================================================================
   ACCESSIBILITY LAYER (overrides / additions to the rules above)
   ================================================================== */

/* ---- readable text ---------------------------------------------- */
body { font-size: 1rem; line-height: 1.6; }
/*.intro > *, .notes > *, .faq details > *, .site-footer > * { max-width: 70ch; }*/
.faq details > *, .site-footer > * { max-width: 70ch; }
.stat-label { font-size: 0.85rem; }
.status { font-size: 0.9rem; }
.site-footer { font-size: 0.92rem; }
.chart .axis-label { font-size: 12px; }

/* ---- links are never identified by colour alone ----------------- */
a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.16em; }
.brand, .nav-link, .btn { text-decoration: none; }
.nav-link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 0.16em; text-underline-offset: 0.3em; }
.btn:hover { text-decoration: underline; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--link-hover); }

/* ---- focus: two-tone ring that works on any background ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
}
.skip:focus { outline-offset: -3px; }
.chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
}

/* ---- controls: 3:1 outlines, comfortable target size ------------ */
.search input, .select select, .chip span, .theme-toggle, .toggle input {
  border-color: var(--border-strong);
}
.search input, .select select { border-width: 2px; min-height: 2.5rem; }
.theme-toggle { border-width: 2px; min-height: 2.25rem; padding: 0.3rem 0.9rem; }
.chip span {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 2.25rem; padding: 0.25rem 0.85rem;
  border-width: 2px; font-size: 0.9rem;
}
.chip input:checked + span::before { content: "\2713"; font-weight: 700; }   /* tick: not colour alone */
.chip input:checked + span { border-color: var(--primary); }
.toggle { min-height: 2.25rem; font-size: 0.95rem; }
.toggle input { width: 1.2rem; height: 1.2rem; }
.btn { padding: 0.6rem 1.1rem; min-height: 2.5rem; font-size: 0.95rem; }
.nav-link { padding: 0.4rem 0.25rem; }
table.data th button { padding: 0.35rem 0.3rem; min-height: 1.75rem; }
table.data th { font-size: 0.9rem; }
.faq summary { padding: 0.85rem 0; min-height: 2.75rem; }
::placeholder { color: var(--muted); opacity: 1; }

/* ---- chart: series differ by line style as well as colour ------- */
.chart .line { stroke-width: 2.5px; }
.chart path.line:nth-of-type(1) { stroke-width: 3.5px; }                      /* total: solid, heavier */
.chart path.line:nth-of-type(2) { stroke-dasharray: 10 6; }
.chart path.line:nth-of-type(3) { stroke-dasharray: 2 6; }
.chart path.line:nth-of-type(4) { stroke-dasharray: 14 5 3 5; }
.chart path.line:nth-of-type(5) { stroke-dasharray: 5 4; }
.chart path.line:nth-of-type(6) { stroke-dasharray: 18 6; }

/* legend + tooltip swatches become short line samples with the same pattern */
.sw { width: 1.9rem; height: 0.3rem; border-radius: 2px; }
.legend .lg:nth-child(1) .sw, .tip .row:nth-of-type(1) .sw { height: 0.4rem; }
.legend .lg:nth-child(2) .sw, .tip .row:nth-of-type(2) .sw { -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 16px); mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 16px); }
.legend .lg:nth-child(3) .sw, .tip .row:nth-of-type(3) .sw { -webkit-mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 9px); mask: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 9px); }
.legend .lg:nth-child(4) .sw, .tip .row:nth-of-type(4) .sw { -webkit-mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 19px, #000 19px 22px, transparent 22px 27px); mask: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 19px, #000 19px 22px, transparent 22px 27px); }
.legend .lg:nth-child(5) .sw, .tip .row:nth-of-type(5) .sw { -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 9px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 9px); }
.legend .lg:nth-child(6) .sw, .tip .row:nth-of-type(6) .sw { -webkit-mask: repeating-linear-gradient(90deg, #000 0 18px, transparent 18px 24px); mask: repeating-linear-gradient(90deg, #000 0 18px, transparent 18px 24px); }
.legend { font-size: 0.9rem; color: var(--text); }
.tip { font-size: 0.9rem; border-width: 2px; border-color: var(--border-strong); }

/* ---- motion ------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---- user asked for more contrast -------------------------------- */
@media (prefers-contrast: more) {
  :root, :root[data-theme] {
    --border: var(--border-strong);
    --muted: var(--text);
    --stripe: transparent;
  }
  table.data tbody tr:nth-child(even) { background: transparent; }
  .chart .grid { stroke: var(--border-strong); }
}

/* ---- Windows High Contrast / forced colours ---------------------- */
@media (forced-colors: active) {
  .chip input:checked + span { background: Highlight; color: HighlightText; border-color: Highlight; forced-color-adjust: none; }
  .btn, .theme-toggle, .chip span, .search input, .select select { border: 2px solid ButtonText; }
  .chart .line, .chart .guide { stroke: CanvasText; }          /* dash patterns still tell series apart */
  .chart .grid { stroke: GrayText; }
  .chart .dot { fill: CanvasText; stroke: Canvas; }
  .sw { background: CanvasText; forced-color-adjust: none; }
  .notes { border-left-color: CanvasText; }
  table.data tbody tr:hover { outline: 2px solid Highlight; outline-offset: -2px; }
}

/* code blocks (FAQ, notes, intro): scroll sideways instead of running off the screen */
.faq pre, .notes pre, .intro pre {
  margin: 0.75rem 0 1rem; padding: 0.85rem 1rem;
  max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font: 0.875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre; tab-size: 2;
}
.faq pre code, .notes pre code, .intro pre code {
  background: none; border: 0; padding: 0; border-radius: 0; font: inherit; white-space: inherit; overflow-wrap: normal;
}
.faq :not(pre) > code, .notes :not(pre) > code { overflow-wrap: anywhere; }

/* touch: let the page scroll vertically over the chart, horizontal drags scrub the tooltip */
.chart-svg, #overlay { touch-action: pan-y; }

/* ==================================================================
   PHONES (max-width 640px). Everything here is inside the media query,
   so the desktop layout is unchanged.
   ================================================================== */
@media (max-width: 640px) {
  /* header: the title wraps inside its own space and the buttons never push the page wider */
  .site-header { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .brand { flex: 1 1 0; min-width: 0; gap: 0.5rem; min-height: 2.75rem; }
  .brand-mark { height: 1rem; }
  .brand-logo { max-width: 7rem; }
  .brand-text { font-size: 1rem; line-height: 1.2; min-width: 0; }
  .site-nav { flex: none; gap: 0.15rem; }
  .nav-link { padding: 0.7rem 0.55rem; }
  .theme-toggle { min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.6rem; }
  .theme-toggle { font-size: 0; }               /* hides the label text (still read by screen readers) */
  .theme-toggle::before { content: attr(data-icon); font-size: 1.1rem; line-height: 1; }

  /* easier tapping */
  .crumb a { display: inline-block; padding: 0.7rem 0; }
  .search input, .select select { min-height: 2.75rem; }
  .chip span { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 0.95rem; }
  .toggle { min-height: 2.5rem; }
  .toggle input { width: 1.25rem; height: 1.25rem; }
  .faq summary { padding: 0.9rem 0; }
  table.data th button { padding: 0.5rem 0.15rem; }

  /* tables: tighter cells, the game name wraps so Players stays on screen,
     and the first identifying column stays put while the rest scrolls sideways */
  table.data th, table.data td { padding: 0.45rem 0.5rem; }
  table.data td.name { min-width: 0; }
  #games td.name, #games th:nth-child(2), #history td:first-child, #history th:first-child {
    position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--border);
  }
  #games td.name, #history td:first-child { background: var(--bg); }
  #games tbody tr:nth-child(even) td.name, #history tbody tr:nth-child(even) td:first-child {
    background: color-mix(in srgb, var(--primary) 5%, var(--bg));
  }
  #games th:nth-child(2), #history th:first-child { z-index: 2; }
  .stat-value { font-size: 1.4rem; }
  .game-head .btn { align-self: flex-start; }
}
