/* Light is available by explicit choice; theme-init defaults to dark. */
:root { color-scheme: light; }
.theme-toggle { border: 1px solid var(--line); flex-shrink: 0; }
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: block; }

/* Graphite surfaces, silver accents, and the original franchise colors. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf0f4;
  --muted: #a2abb7;
  --line: #30353d;
  --paper: #101216;
  --ice: #c7d1dc;
  --surface: #1a1d23;
  --surface-raised: #232830;
  --secondary: #b7c0cb;
}
[data-theme="dark"] ::selection { background: #bdcbd9; color: #101216; }
[data-theme="dark"] :focus-visible { outline-color: #b9d9f1; }
[data-theme="dark"] .header { background: #16181d; border-color: var(--line); }
[data-theme="dark"] .topline { background: #090b0e; color: #a8b1bd; }
[data-theme="dark"] .brand img { filter: drop-shadow(0 0 1px #c2cad5); }
[data-theme="dark"] .silver { color: #aebdcc; }
[data-theme="dark"] .desktop-nav a { color: #a4adba; }
[data-theme="dark"] .desktop-nav a.active { color: #f4f6f9; }
[data-theme="dark"] .desktop-nav a.active:after,
[data-theme="dark"] .tabs button.active:after { background: #cbd5df; }
[data-theme="dark"] .icon-button:hover { background: #2b3038; }
[data-theme="dark"] .theme-toggle { background: #242a32; color: #e0e8f0; border-color: #414b58; }
[data-theme="dark"] .header-divider { background: var(--line); }
[data-theme="dark"] .league-mark { border-color: #d1d9e2; }
[data-theme="dark"] .favorite-header b { background: #cbd5df; color: #17212c; }
[data-theme="dark"] .hero { border: 1px solid #34424f; box-shadow: 0 16px 45px #0002; }
[data-theme="dark"] .hero:after { background: radial-gradient(ellipse at 75% 30%,#52657744,transparent 55%),repeating-linear-gradient(135deg,transparent 0 62px,#9eb2c605 62px 63px),linear-gradient(115deg,#14191f,#202c37); }
[data-theme="dark"] .metrics,
[data-theme="dark"] .game-card,
[data-theme="dark"] .standings-panel,
[data-theme="dark"] .logo-tile,
[data-theme="dark"] .franchise-card { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .metric+.metric:before { background: var(--line); }
[data-theme="dark"] .metric:nth-child(3),
[data-theme="dark"] .metric:nth-child(4) { border-color: var(--line); }
[data-theme="dark"] .metric span b { color: #c2cbd5; }
[data-theme="dark"] .metric span,
[data-theme="dark"] .context-detail,
[data-theme="dark"] .source-note,
[data-theme="dark"] .section-heading p,
[data-theme="dark"] .date-controls .date-label,
[data-theme="dark"] .game-top,
[data-theme="dark"] .game-bottom,
[data-theme="dark"] .table-foot,
[data-theme="dark"] .data-caption,
[data-theme="dark"] .view-header p,
[data-theme="dark"] .result-label,
[data-theme="dark"] .standing-note,
[data-theme="dark"] .franchise-info p,
[data-theme="dark"] .franchise-info .card-meta,
[data-theme="dark"] .modal-eyebrow,
[data-theme="dark"] .modal-body p,
[data-theme="dark"] .event p,
[data-theme="dark"] .event-time,
[data-theme="dark"] .api-details,
[data-theme="dark"] .team-modal-stats span,
[data-theme="dark"] .team-game-row small,
[data-theme="dark"] .connection-status,
[data-theme="dark"] .load-controls span { color: var(--muted); }
[data-theme="dark"] .select-wrap,
[data-theme="dark"] .calendar-input,
[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select,
[data-theme="dark"] .connect-form input { background: var(--surface); border-color: #414954; color: #d5dce5; }
[data-theme="dark"] .select-wrap select { color: #e1e6ed; }
[data-theme="dark"] option { background: var(--surface); color: var(--ink); }
[data-theme="dark"] input::placeholder { color: #969fad; opacity: 1; }
[data-theme="dark"] .section-number { color: #a6b4c3; border-color: #404956; }
[data-theme="dark"] .date-controls { background: #1b1f26; border-color: var(--line); }
[data-theme="dark"] .date-pill,
[data-theme="dark"] .small-arrow { color: #a9b4c2; }
[data-theme="dark"] .date-pill strong { color: #bbc6d3; }
[data-theme="dark"] .date-pill.active { background: #cdd6e0; color: #435364; box-shadow: 0 2px 9px #0003; }
[data-theme="dark"] .date-pill.active strong { color: #111b26; }
[data-theme="dark"] .small-arrow:hover { background: #303741; }
[data-theme="dark"] .status-pill,
[data-theme="dark"] .event-label { background: #2a333e; color: #c2d0de; }
[data-theme="dark"] .status-live { background: #1b3b32; color: #9fddc3; }
[data-theme="dark"] .team-name { color: #bac4cf; }
[data-theme="dark"] .team-name.winner,
[data-theme="dark"] .score.winner { color: #f5f7fa; }
[data-theme="dark"] .score { color: #96a3b2; }
[data-theme="dark"] .team-logo { filter: drop-shadow(0 0 1px #e6efffb3); }
[data-theme="dark"] .logo-fallback { background: #303b48; color: #d2dee9; }
[data-theme="dark"] .game-bottom,
[data-theme="dark"] .tabs,
[data-theme="dark"] .table-foot,
[data-theme="dark"] .standings-table td,
[data-theme="dark"] .data-caption,
[data-theme="dark"] .view-header,
[data-theme="dark"] .franchise-info .card-meta,
[data-theme="dark"] .event,
[data-theme="dark"] .api-details { border-color: var(--line); }
[data-theme="dark"] .game-detail,
[data-theme="dark"] .data-caption button,
[data-theme="dark"] .franchise-info .card-meta button,
[data-theme="dark"] .logo-tile span:last-child { color: #b7c8d9; }
[data-theme="dark"] .tabs button { color: #a4aebc; }
[data-theme="dark"] .tabs button.active { color: #edf2f7; }
[data-theme="dark"] .standings-table th { background: #20242c; color: #a7b2c0; }
[data-theme="dark"] .standings-table td { color: #aeb9c6; }
[data-theme="dark"] .standings-table tr:hover td { background: #242a33; }
[data-theme="dark"] .table-team,
[data-theme="dark"] .standings-table .points,
[data-theme="dark"] .franchise-info h3,
[data-theme="dark"] .event strong,
[data-theme="dark"] .event-time b,
[data-theme="dark"] .connect-form label,
[data-theme="dark"] .team-modal-stats strong,
[data-theme="dark"] .team-game-row strong { color: #e1e8ef; }
[data-theme="dark"] .fan-card { background: linear-gradient(135deg,#2d3743,#1d252e); border-color: #414e5c; }
[data-theme="dark"] .fan-card:before { color: #b9cde710; }
[data-theme="dark"] .fan-card .eyebrow { color: #b3c5d6; }
[data-theme="dark"] .fan-card p { color: #b3c0ce; }
[data-theme="dark"] .fan-stars { color: #71899f; text-shadow: 3px 5px 0 #17222d; }
[data-theme="dark"] .btn { background: #d9e2eb; color: #17222d; }
[data-theme="dark"] .btn:hover { background: #f2f6fa; }
[data-theme="dark"] .btn-light { background: #eef3f7; }
[data-theme="dark"] .btn-line,
[data-theme="dark"] .btn-outline { background: transparent; color: #d4dfea; border: 1px solid #657484; }
[data-theme="dark"] .btn-line:hover,
[data-theme="dark"] .btn-outline:hover { background: #303d4b; }
[data-theme="dark"] .text-link:hover { color: #b9d9f1; }
[data-theme="dark"] .logo-tile:hover { background: #252c35; }
[data-theme="dark"] .view-header .watermark { color: #272f39; }
[data-theme="dark"] .filter-chip { background: #262e38; color: #b6c4d2; }
[data-theme="dark"] .filter-chip.active { background: #cbd6e2; color: #152332; }
[data-theme="dark"] .empty-state { background: #1b222a; border-color: #43515f; color: #a9b9c9; }
[data-theme="dark"] .empty-state h3,
[data-theme="dark"] .connect-banner strong { color: #dce6ef; }
[data-theme="dark"] .connect-banner { background: #202b36; border-color: #3b4a59; }
[data-theme="dark"] .connect-banner p { color: #acbdce; }
[data-theme="dark"] .franchise-visual { background: radial-gradient(ellipse at 50% 90%,color-mix(in srgb,var(--club-color,#b3c6d1) 26%,transparent),transparent 100%),#202731; }
[data-theme="dark"] .franchise-visual:after { color: #c8d8e913; }
[data-theme="dark"] .franchise-visual .team-logo { filter: drop-shadow(0 0 1px #e6efffcc) drop-shadow(0 7px 7px #0005); }
[data-theme="dark"] .favorite-button { background: #17212bd9; color: #b5c7d8; border: 1px solid #526374; }
[data-theme="dark"] .favorite-button.selected { background: #d4e0eb; color: #182b3c; }
[data-theme="dark"] .form-dot { background: #223c32; color: #a1d5b9; }
[data-theme="dark"] .form-dot.loss { background: #423036; color: #e0b3bd; }
[data-theme="dark"] dialog { background: #1b2027; border-color: #45505e; }
[data-theme="dark"] dialog::backdrop { background: #03070dc9; }
[data-theme="dark"] .modal-close { background: #2d3945e8; color: #e8f1fa; }
[data-theme="dark"] .modal-close:hover { background: #425468; }
[data-theme="dark"] .notice { background: #263340; color: #b8c8d8; }
[data-theme="dark"] .team-modal-stats>div { background: #252f3a; border-color: #3a4654; }
[data-theme="dark"] .team-game-row { background: #242c36; border-color: #3a4552; }
[data-theme="dark"] .search-result:hover { background: #2b3745; }
[data-theme="dark"] .warning-banner { background: #383329; border-color: #62563d; color: #d9c9a7; }
[data-theme="dark"] .toast { background: #dce6f0; color: #172736; box-shadow: 0 6px 30px #0005; }
[data-theme="dark"] .skip { background: #dce6f0; color: #172736; }
[data-theme="dark"] .footer { background: #090d12; border-top: 1px solid #29313b; }
[data-theme="dark"] .footer-brand small,
[data-theme="dark"] .footer>p,
[data-theme="dark"] .footer-bottom { color: #94a4b5; }
[data-theme="dark"] .mobile-nav { background: #161b23f2; border-color: #36414e; box-shadow: 0 -5px 30px #0003; }
[data-theme="dark"] .mobile-nav a { color: #99adbf; }
[data-theme="dark"] .mobile-nav a.active { color: #eef5fc; }

@media(max-width:900px) { .header .league-mark { display: none; } }
@media(max-width:600px) { .header-actions { gap: 8px; } }
@media(max-width:360px) { .header-actions { gap: 4px; } }
