/* Goalix appearance: existing dark palette is the default. */
:root {
  color-scheme: dark;
  --primary: var(--primary-neon);
  --theme-ink: var(--text-main);
  --theme-muted: var(--text-muted);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg-base: #f3f5fa;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #e9edf5;
  --bg-glass: rgba(255, 255, 255, .97);
  --border-glass: #d6dce7;
  --border-glass-hover: #9b85e8;
  --primary-neon: #6540ce;
  --primary-neon-glow: rgba(101, 64, 206, .14);
  --text-main: #182238;
  --text-muted: #56617a;
  --state-success: #147640;
  --state-warning: #925400;
  --state-danger: #ba2544;
  --state-disabled: #626e82;
  --accent-gold: #925400;
  --ink-main: #182238;
  --ink-muted: #56617a;
  --ink-subtle: #626e82;
  --ink-accent: #6540ce;
  --ink-gold: #925400;
  --ink-green: #147640;
  --ink-red: #ba2544;
  --surface-soft: #edf0f7;
  --surface-raised: #ffffff;
  --surface-hover: #e6eaf4;
  --surface-overlay-rgb: 24, 34, 56;
  --theme-border: #d6dce7;
  --bs-body-bg: var(--bg-base);
  --bs-body-color: var(--text-main);
  --bs-body-color-rgb: 24, 34, 56;
  --bs-emphasis-color-rgb: 24, 34, 56;
  --bs-secondary-color: var(--text-muted);
  --bs-primary-rgb: 101, 64, 206;
  --bs-success-rgb: 20, 118, 64;
  --bs-warning-rgb: 146, 84, 0;
  --bs-danger-rgb: 186, 37, 68;
  --bs-info-rgb: 10, 108, 131;
  --bs-light-rgb: 24, 34, 56;
}
.theme-switcher { flex: 0 0 auto; }
.theme-icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.1rem;
}
.theme-toggle:hover { background: var(--bg-surface-elevated); }
.theme-toggle:focus-visible, .theme-option:focus-within { outline: 2px solid var(--primary-neon); outline-offset: 3px; }
.theme-menu {
  min-width: 190px;
  padding: 8px;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .16);
}
.theme-menu-title { margin: 6px 10px 8px; color: var(--text-muted); font-size: .75rem; font-weight: 700; }
.theme-option { position: relative; display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 10px; border-radius: 10px; cursor: pointer; }
.theme-option:hover { background: var(--bg-surface-elevated); }
.theme-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-option-check { margin-left: auto; opacity: 0; }
.theme-option:has(input:checked) { color: var(--primary-neon); background: var(--primary-neon-glow); }
.theme-option input:checked ~ .theme-option-check { opacity: 1; }
@media (max-width: 991.98px) {
  .theme-switcher { margin-right: 8px; }
  .theme-toggle { width: 42px; height: 42px; }
}

/* Bootstrap utilities and controls previously assumed a dark-only surface. */
html[data-theme="light"] .navbar-custom { background: rgba(255, 255, 255, .98) !important; }
html[data-theme="light"] .navbar-brand-custom { color: var(--primary-neon); }
html[data-theme="light"] .nav-link-custom.active { color: var(--primary-neon) !important; }
html[data-theme="light"] .navbar-toggler { color: var(--text-main); }
html[data-theme="light"] .navbar-toggler-icon { filter: invert(1); }
html[data-theme="light"] .text-white { color: var(--text-main) !important; }
html[data-theme="light"] .text-white-50 { color: var(--text-muted) !important; }
html[data-theme="light"] :is(.btn-primary, .btn-success, .btn-danger, .bg-primary, .bg-success, .bg-danger).text-white { color: #fff !important; }
html[data-theme="light"] :is(.bg-primary, .bg-success, .bg-danger):is(.text-dark, .text-light) { color: #fff !important; }
html[data-theme="light"] .bg-warning:not([class*="bg-opacity"]),
html[data-theme="light"] .text-bg-warning { color: #4a3008 !important; background-color: #f5bd51 !important; }
html[data-theme="light"] .bg-info:not([class*="bg-opacity"]),
html[data-theme="light"] .text-bg-info { color: #083c49 !important; background-color: #9ae1ed !important; }
html[data-theme="light"] .btn-outline-light { --bs-btn-color: var(--text-main); --bs-btn-border-color: var(--border-glass); --bs-btn-hover-bg: var(--bg-surface-elevated); --bs-btn-hover-color: var(--text-main); --bs-btn-active-color: var(--text-main); --bs-btn-active-bg: var(--bg-surface-elevated); }
html[data-theme="light"] .btn-close-white { filter: none; }
html[data-theme="light"] .bg-dark { background-color: var(--bg-surface) !important; }
html[data-theme="light"] .bg-black { background-color: var(--bg-surface-elevated) !important; }
html[data-theme="light"] .dropdown-menu-dark {
  --bs-dropdown-bg: var(--bg-surface);
  --bs-dropdown-color: var(--text-main);
  --bs-dropdown-link-color: var(--text-main);
  --bs-dropdown-link-hover-color: var(--text-main);
  --bs-dropdown-link-hover-bg: var(--bg-surface-elevated);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: var(--primary-neon);
  --bs-dropdown-divider-bg: var(--border-glass);
}
html[data-theme="light"] .table-dark { --bs-table-bg: var(--bg-surface); --bs-table-color: var(--text-main); --bs-table-border-color: var(--border-glass); --bs-table-striped-bg: var(--bg-base); --bs-table-striped-color: var(--text-main); --bs-table-hover-bg: var(--bg-surface-elevated); --bs-table-hover-color: var(--text-main); }
html[data-theme="light"] .table { --bs-table-color: var(--text-main); --bs-table-bg: transparent; --bs-table-hover-color: var(--text-main); --bs-table-hover-bg: var(--bg-surface-elevated); --bs-table-striped-color: var(--text-main); --bs-table-striped-bg: var(--bg-base); }
html[data-theme="light"] :is(.form-control, .form-select, .search-input-custom) { color: var(--text-main) !important; background-color: var(--bg-surface) !important; }
html[data-theme="light"] .form-control::placeholder { color: var(--text-muted) !important; opacity: 1; }
html[data-theme="light"] .form-select { --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23182238' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
html[data-theme="light"] .accordion-button::after { filter: none; }
html[data-theme="light"] .btn-outline-primary { color: var(--primary-neon); --bs-btn-color: var(--primary-neon); }
html[data-theme="light"] .btn-primary:hover { background-color: #5330b6 !important; border-color: #5330b6 !important; }
html[data-theme="light"] .btn-outline-primary.active,
html[data-theme="light"] .btn-outline-primary:active,
html[data-theme="light"] .btn-check:checked + .btn-outline-primary { color: #fff !important; }
html[data-theme="light"] .bg-dark .text-primary,
html[data-theme="light"] .bg-dark.text-primary { color: var(--primary-neon) !important; }
html[data-theme="light"] .alert-info { color: var(--primary-neon); }
html[data-theme="light"] .alert-warning { color: #795000; background-color: #fff4d8; }
html[data-theme="light"] .alert-danger { color: #a81e39; background-color: #fff0f3; }
html[data-theme="light"] .alert-success { color: #116438; background-color: #e7f5ed; }
html[data-theme="light"] .league-card:hover,
html[data-theme="light"] .card.team-card:hover { background: var(--bg-surface-elevated) !important; }
html[data-theme="light"] .league-filter-tab.active { color: #fff; background: var(--primary-neon); }
html[data-theme="light"] .league-picker-option.is-selected { color: #245909; background: #e8f3df; }
html[data-theme="light"] .skeleton-block { background-image: linear-gradient(90deg, #e1e5ee 20%, #f5f6fa 50%, #e1e5ee 80%); }
html[data-theme="light"] footer { background: var(--bg-surface) !important; }
html[data-theme="light"] .mobile-bottom-nav { background: var(--bg-surface) !important; box-shadow: 0 -4px 16px rgba(24, 34, 56, .1); }
html[data-theme="light"] .navbar-collapse.show,
html[data-theme="light"] .navbar-collapse.collapsing { background: var(--bg-surface) !important; }

/* The pitch and image silhouettes retain their intentional illustration colors. */
html[data-theme="light"] .lineup-pitch :is(.pitch-player, .pitch-player-marker, .pitch-player-name) { color: #fff; }
html[data-theme="light"] .lineup-team-name { color: var(--text-main); }
html[data-theme="light"] .game-career-link { color: var(--primary-neon) !important; }
html[data-theme="light"] .game-level-chip { color: var(--primary-neon); background: var(--primary-neon-glow); }
html[data-theme="light"] .game-difficulty-chip { background: var(--primary-neon); }
html[data-theme="light"] .lineup-view-switch button.is-active { color: var(--primary-neon); background: var(--primary-neon-glow); }
html[data-theme="light"] .league-logo-tile { filter: none; box-shadow: 0 2px 8px rgba(24, 34, 56, .12); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle, .theme-option { transition: none; }
}
