/* 202ch navy surfaces. Every content colour below is screen + manual dark only. */
@media screen {
  html[data-theme="dark"] body.site-theme {
    color-scheme: dark;
    --site-canvas: #0a1727;
    --site-surface: #14283d;
    --site-raised: #1b334c;
    --site-soft: #1b3347;
    --site-selected: #234766;
    --site-ink: #e7f0fb;
    --site-muted: #b0c4db;
    --site-line: #355576;
    --site-accent: #86ccff;
    --site-on-accent: #0b2440;
    --site-link: #98d3ff;
    --site-focus: #f6cf86;
    --site-danger: #ffbdcb;
    --site-danger-soft: #4b2d40;
    --site-warning: #f0d392;
    --site-warning-soft: #463a24;
    --site-success: #a0dcc0;
    --site-success-soft: #233f3c;
    --site-blue: #b0dfff;
    --site-blue-soft: #213e59;
    --site-purple: #d1c0fb;
    --site-purple-soft: #36334f;
    --site-shadow: 0 12px 32px #030b1738;
    --darts-article-background: #14283d;
    --darts-article-foreground: #e7f0fb;
    --darts-article-muted: #b0c4db;
    --darts-article-border: #355576;
    --darts-article-inset: #1b334c;
    --darts-link: #98d3ff;
    --darts-link-hover: #c3e6ff;
    background: var(--site-canvas);
    color: var(--site-ink);
  }

  html[data-theme="dark"] body a { color: var(--site-link, #98d3ff); }
  html[data-theme="dark"] body :is(button, input, select, textarea) {
    color-scheme: dark;
    accent-color: var(--site-accent);
  }
  html[data-theme="dark"] :where(body button:not(.site-theme-toggle)) {
    background-color: var(--site-raised);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: 3px;
  }
  html[data-theme="dark"] body :is(.choice-buttons, .settings-content, .settings-panel) button[aria-pressed="true"],
  html[data-theme="dark"] body :is(.primary, #vs-confirm, .settings-actions button:first-child) {
    background: var(--site-accent);
    border-color: var(--site-accent);
    color: var(--site-on-accent);
  }
  html[data-theme="dark"] body :is(.settings-content, .player-setting, .setting-group, .vs-guide, .solo-settings-body) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.settings-content .player-setting-one, .player-one) {
    --player: #a4d8ff;
    --tint: #213e59;
    border-color: #649bc7;
  }
  html[data-theme="dark"] body :is(.settings-content .player-setting-two, .player-two) {
    --player: #d1c0fb;
    --tint: #36334f;
    border-color: #9780c7;
  }
  html[data-theme="dark"] body .choice-buttons button[data-value="0"][aria-pressed="true"],
  html[data-theme="dark"] body .choice-buttons button[data-value="fixed-0"][aria-pressed="true"] {
    background: #213e59;
    color: #b0dfff;
    border-color: #649bc7;
  }
  html[data-theme="dark"] body .choice-buttons button[data-value="1"][aria-pressed="true"],
  html[data-theme="dark"] body .choice-buttons button[data-value="fixed-1"][aria-pressed="true"] {
    background: #36334f;
    color: #d1c0fb;
    border-color: #9780c7;
  }
  html[data-theme="dark"] body :is(.setting-group legend, .player-setting label, .pending-label, .win-count, .mode-tag) {
    color: var(--site-link);
  }
  html[data-theme="dark"] body :is(.history-scroll, .history-scroll th, .history-scroll td) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body .history-scroll thead th { background: var(--site-soft); }
  html[data-theme="dark"] body :is(.storage-message, .route-note, .settings-content p, .match-footer p) { color: var(--site-muted); }

  /* Homepage and explanatory pages had independent light-only stylesheets. */
  html[data-theme="dark"] body :is(.system-header, .guide-header, .policy-header, .policy-header-inner, .header) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.system-brand, .guide-brand, .policy-brand, .brand, .header-nav a) { color: var(--site-ink); }
  html[data-theme="dark"] body :is(.tool-hero, .guide-hero) {
    background: linear-gradient(115deg, #0c2038, #123d5e);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.tool-entry, .system-link-card, .guide-card, .news-window, .reason, .tip, .panel, .card, .guide-step, .guide-box, .policy-nav, .policy-section, .guide-toc) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.home-guide, .system-links-section, .news-section, .about-section, .guide-related, .how-to, .help) {
    background: var(--site-canvas);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.home-guide-copy p, .system-links-head p, .system-link-card small, .guide-lead, .guide-note, .guide-card p, .policy-date, .tool-summary, .news-window time) { color: var(--site-muted); }
  html[data-theme="dark"] body :is(.section-kicker, .guide-kicker, .tool-label, .system-link-card .sys-label, .system-link-card .sys-arrow, .tool-arrow) { color: var(--site-link); }
  html[data-theme="dark"] body :is(.system-page, .guide-page) :is(th, td) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.system-page, .guide-page) :is(thead th, tbody th) { background: var(--site-soft); }
  html[data-theme="dark"] body :is(.notice, .policy-notice, .guide-notice, .guide-example, .guide-callout, .callout, .guide-faq details) {
    background: var(--site-soft);
    border-color: var(--site-line);
    color: var(--site-ink);
  }
  html[data-theme="dark"] body :is(.system-footer, .policy-footer, .guide-footer) {
    background: var(--site-surface);
    border-color: var(--site-line);
    color: var(--site-muted);
  }
  html[data-theme="dark"] body main[data-policy-terms] { background: var(--site-surface); border-color: var(--site-line); }
  html[data-theme="dark"] body main[data-policy-terms] .lead { background: var(--site-soft); border-color: var(--site-accent); }
  html[data-theme="dark"] body :is(.about, .about-copy, .news-intro, .home-guide-copy) { color: var(--site-ink); }
  html[data-theme="dark"] body :is(.home-guide-copy p:not(.section-kicker), .system-links-head p, .system-link-card small) { color: var(--site-muted); }
  html[data-theme="dark"] body .play-card {
    background: linear-gradient(145deg, #14283d, #193b51);
    border-color: var(--site-line);
    border-top-color: #79bff0;
  }
  html[data-theme="dark"] body .play-card-cricket {
    background: linear-gradient(145deg, #14283d, #193c3c);
    border-top-color: #89cfb9;
  }
  html[data-theme="dark"] body :is(.play-card h3, .play-card h3 a) { color: var(--site-ink); }
  html[data-theme="dark"] body :is(.play-card > p, .play-card > small, .home-play-note) { color: var(--site-muted); }
  html[data-theme="dark"] body .play-card-label { color: var(--site-link); }
  html[data-theme="dark"] body .play-card-tag { background: var(--site-soft); color: var(--site-muted); }
  html[data-theme="dark"] body .play-card-actions a { background: var(--site-raised); border-color: var(--site-line); color: var(--site-link); }
  html[data-theme="dark"] body .play-card-actions a.play-start { background: var(--site-accent); border-color: var(--site-accent); color: var(--site-on-accent); }
  html[data-theme="dark"] body .guide-shot { background: var(--site-surface); border-color: var(--site-line); }
  html[data-theme="dark"] body .shell :is(.tool-link, .btn:not(.primary)) { background: var(--site-raised); border-color: var(--site-line); color: var(--site-link); }
  html[data-theme="dark"] body .shell .btn.primary { background: var(--site-accent); color: var(--site-on-accent); }
  html[data-theme="dark"] body .shell :is(.note, .lead) { color: var(--site-muted); }
  html[data-theme="dark"] body .shell h1 { color: var(--site-ink); }
  html[data-theme="dark"] body :is(.system-skip-link, .skip-link):focus { background: var(--site-raised); color: var(--site-ink); }

  /* Preserve primary/selected navigation, including the two-player header. */
  html[data-theme="dark"] body .site-tool-nav > a[aria-current],
  html[data-theme="dark"] body .site-language-menu > :is([aria-current], [aria-pressed="true"]) {
    background: var(--site-accent);
    border-color: var(--site-accent);
    color: var(--site-on-accent);
  }
  html[data-theme="dark"] body .site-global-brand .site-brand-accent { color: #86b8ff; }
}
