/*
 * EVI Cup dark theme
 *
 * The theme bootstrap in base.html resolves light/dark/system before the first
 * stylesheet is parsed. Keeping all overrides behind data-theme makes the
 * existing light design the unchanged default and gives every public page the
 * same dark surfaces, contrast and interaction states.
 */

html[data-theme="dark"] {
  color-scheme: dark;

  --evi-page: #101010;
  --evi-surface: #181818;
  --evi-surface-raised: #202020;
  --evi-surface-soft: #282828;
  --evi-surface-hover: #303030;
  --evi-text: #f5f5f5;
  --evi-text-muted: #b5b5b5;
  --evi-text-subtle: #8f8f8f;
  --evi-border: rgba(255, 255, 255, .11);
  --evi-border-strong: rgba(255, 255, 255, .2);
  --evi-brand: #5597ff;
  --evi-brand-rgb: 85, 151, 255;
  --evi-brand-strong: #1769dc;
  --evi-brand-strong-rgb: 23, 105, 220;
  --evi-blue: var(--evi-brand);
  --evi-blue-rgb: var(--evi-brand-rgb);
  --evi-success: #4ade80;
  --evi-warning: #fbbf24;
  --evi-danger: #fb7185;
  --evi-focus: rgba(96, 165, 250, .42);
  --evi-skeleton-a: #242424;
  --evi-skeleton-b: #343434;

  --bs-body-color: var(--evi-text);
  --bs-body-color-rgb: 245, 245, 245;
  --bs-body-bg: var(--evi-page);
  --bs-body-bg-rgb: 16, 16, 16;
  --bs-emphasis-color: #fff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-secondary-color: var(--evi-text-muted);
  --bs-secondary-color-rgb: 181, 181, 181;
  --bs-secondary-bg: var(--evi-surface-raised);
  --bs-secondary-bg-rgb: 32, 32, 32;
  --bs-tertiary-color: var(--evi-text-subtle);
  --bs-tertiary-bg: var(--evi-surface-soft);
  --bs-tertiary-bg-rgb: 40, 40, 40;
  --bs-border-color: var(--evi-border);
  --bs-border-color-translucent: var(--evi-border);
  --bs-primary: var(--evi-brand-strong);
  --bs-primary-rgb: var(--evi-brand-strong-rgb);
  --bs-link-color: var(--evi-brand);
  --bs-link-color-rgb: var(--evi-brand-rgb);
  --bs-link-hover-color: var(--evi-brand);
  --bs-link-hover-color-rgb: var(--evi-brand-rgb);
  --bs-heading-color: var(--evi-text);
  --bs-code-color: #f0a8d0;
  --bs-focus-ring-color: var(--evi-focus);
  --bs-form-valid-color: #6ee7a0;
  --bs-form-invalid-color: #fda4af;
}

html[data-theme="dark"] ::selection {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.bg-light,
html[data-theme="dark"] main {
  color: var(--evi-text);
  background-color: var(--evi-page) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light {
  background-color: var(--evi-surface) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .link-dark,
html[data-theme="dark"] .text-body,
html[data-theme="dark"] .text-body-emphasis,
html[data-theme="dark"] .text-black {
  color: var(--evi-text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .text-black-50 {
  color: var(--evi-text-muted) !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-neutral {
  border-color: var(--evi-border) !important;
}

html[data-theme="dark"] hr {
  color: var(--evi-border-strong);
  border-color: var(--evi-border-strong);
  opacity: 1;
}

html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.list-group-item) {
  --bs-link-color-rgb: 85, 151, 255;
  --bs-link-hover-color-rgb: 134, 182, 255;
}

/* Bootstrap and shared primitives */
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .accordion-item,
html[data-theme="dark"] .toast {
  color: var(--evi-text);
  background-color: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .offcanvas-header {
  color: var(--evi-text);
  background-color: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .dropdown-divider {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .list-group-item-action {
  color: var(--evi-text);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .dropdown-item.active,
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .list-group-item-action:focus {
  color: #fff;
  background-color: var(--evi-surface-hover);
}

html[data-theme="dark"] #site-header .dropdown-item.text-danger,
html[data-theme="dark"] #site-header .dropdown-item.text-danger:hover,
html[data-theme="dark"] #site-header .dropdown-item.text-danger:focus {
  color: #ff8f9f !important;
}

html[data-theme="dark"] #site-header .dropdown-item.text-danger:hover,
html[data-theme="dark"] #site-header .dropdown-item.text-danger:focus {
  background: rgba(251, 113, 133, .12);
}

html[data-theme="dark"] .table {
  --bs-table-color: var(--evi-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--evi-border);
  --bs-table-striped-color: var(--evi-text);
  --bs-table-striped-bg: rgba(255, 255, 255, .025);
  --bs-table-hover-color: var(--evi-text);
  --bs-table-hover-bg: rgba(var(--evi-brand-rgb), .08);
  color: var(--evi-text);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .table-light {
  --bs-table-color: var(--evi-text);
  --bs-table-bg: var(--evi-surface-soft);
  --bs-table-border-color: var(--evi-border);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]) {
  color: var(--evi-text);
  background-color: var(--evi-surface-raised);
  border-color: var(--evi-border-strong);
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] input::placeholder {
  color: var(--evi-text-subtle);
  opacity: 1;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input:focus {
  color: var(--evi-text);
  background-color: var(--evi-surface-raised);
  border-color: var(--evi-brand);
  box-shadow: 0 0 0 .25rem var(--evi-focus);
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled,
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] textarea:disabled {
  color: var(--evi-text-subtle);
  background-color: #141414;
  opacity: .8;
}

html[data-theme="dark"] .form-check-input {
  background-color: var(--evi-surface-raised);
  border-color: var(--evi-border-strong);
}

html[data-theme="dark"] .form-check-input:checked {
  background-color: var(--evi-brand-strong);
  border-color: var(--evi-brand-strong);
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-outline-dark {
  --bs-btn-color: var(--evi-text);
  --bs-btn-bg: var(--evi-surface-raised);
  --bs-btn-border-color: var(--evi-border-strong);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--evi-surface-hover);
  --bs-btn-hover-border-color: var(--evi-border-strong);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--evi-surface-hover);
  --bs-btn-active-border-color: var(--evi-border-strong);
}

html[data-theme="dark"] .btn-dark {
  --bs-btn-color: #fff;
  --bs-btn-bg: #343434;
  --bs-btn-border-color: #505050;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #414141;
  --bs-btn-hover-border-color: #616161;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #4a4a4a;
  --bs-btn-active-border-color: #6a6a6a;
}

html[data-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #c5cfdd;
  --bs-btn-border-color: #66758a;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #333;
  --bs-btn-hover-border-color: #718096;
}

html[data-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .badge.text-bg-light,
html[data-theme="dark"] .badge.bg-light {
  color: var(--evi-text) !important;
  background-color: var(--evi-surface-soft) !important;
}

html[data-theme="dark"] .badge.bg-dark,
html[data-theme="dark"] .badge.text-bg-dark {
  color: #fff !important;
  background: #3a3a3a !important;
}

html[data-theme="dark"] .bg-warning.text-dark,
html[data-theme="dark"] .text-bg-warning,
html[data-theme="dark"] .badge.bg-warning {
  color: #171717 !important;
}

html[data-theme="dark"] .alert-light,
html[data-theme="dark"] .alert-secondary {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .nav-tabs .nav-link {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-pills .nav-link.active {
  color: #fff;
  background: var(--evi-brand-strong);
  border-color: var(--evi-brand-strong);
}

html[data-theme="dark"] .progress {
  background-color: var(--evi-surface-soft);
}

html[data-theme="dark"] .shadow,
html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-lg {
  --bs-box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .28);
  --bs-box-shadow-sm: 0 .125rem .35rem rgba(0, 0, 0, .24);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .4);
}

/* Header, menus, search and footer */
html[data-theme="dark"] .nav-minimal,
html[data-theme="dark"] #site-header .team-bar-wrapper,
html[data-theme="dark"] #site-header .navbar,
html[data-theme="dark"] #site-header.compact .navbar {
  color: var(--evi-text);
  background: rgba(24, 24, 24, .94) !important;
  border-color: var(--evi-border);
}

@supports (backdrop-filter: blur(16px)) {
  html[data-theme="dark"] #site-header .team-bar-wrapper,
  html[data-theme="dark"] #site-header .navbar,
  html[data-theme="dark"] #site-header.compact .navbar {
    background: rgba(24, 24, 24, .86) !important;
  }
}

html[data-theme="dark"] #site-header .navbar-nav .nav-link,
html[data-theme="dark"] #site-header .navbar-nav .nav-link:visited,
html[data-theme="dark"] #site-header .icon-btn,
html[data-theme="dark"] .mobile-appbar-title,
html[data-theme="dark"] .mobile-nav-btn,
html[data-theme="dark"] .nav-link-row,
html[data-theme="dark"] #mobileNav .list-group-item > button.list-group-item {
  color: var(--evi-text);
}

html[data-theme="dark"] #site-header .icon-btn:hover,
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="dark"] #mobileNav .list-group-item > button.list-group-item:hover,
html[data-theme="dark"] .list-group-nested .list-group-item:hover {
  color: #fff;
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] #site-header .burger-btn .burger-line,
html[data-theme="dark"] .burger-btn .burger-line {
  background: var(--evi-text);
}

html[data-theme="dark"] #site-header .logo-item:hover {
  background: rgba(var(--evi-brand-rgb), .12);
}

html[data-theme="dark"] #site-header .dropdown-menu {
  color: var(--evi-text);
  background: rgba(32, 32, 32, .98);
  border-color: var(--evi-border);
}

html[data-theme="dark"] #site-header .dropdown-item {
  color: var(--evi-text);
}

html[data-theme="dark"] #site-header .dropdown-item:hover,
html[data-theme="dark"] #site-header .dropdown-item:focus {
  color: #fff;
  background: rgba(var(--evi-brand-rgb), .14);
}

html[data-theme="dark"] #mobileNav.offcanvas-nav,
html[data-theme="dark"] #mobileNav .offcanvas-header,
html[data-theme="dark"] #mobileNav .offcanvas-body {
  color: var(--evi-text);
  background: var(--evi-surface);
}

html[data-theme="dark"] .btn-accordion {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .mobile-nav-btn {
  color: var(--evi-text);
  background: rgba(32, 32, 32, .94);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .mobile-nav-btn:hover {
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .global-search-overlay {
  color: var(--evi-text);
  background: var(--evi-page);
}

html[data-theme="dark"] .global-search-input,
html[data-theme="dark"] .global-search-input:focus,
html[data-theme="dark"] .global-search-list {
  color: var(--evi-text);
  background: var(--evi-surface);
}

html[data-theme="dark"] .global-search-input-wrap i,
html[data-theme="dark"] .global-search-close,
html[data-theme="dark"] .global-search-theme,
html[data-theme="dark"] .global-search-tab.is-active,
html[data-theme="dark"] .global-search-section-title,
html[data-theme="dark"] .global-search-result,
html[data-theme="dark"] .global-search-label,
html[data-theme="dark"] .global-search-score,
html[data-theme="dark"] .global-search-media i {
  color: var(--evi-text);
}

html[data-theme="dark"] .global-search-theme {
  background: var(--evi-surface-raised);
}

html[data-theme="dark"] .global-search-theme:hover {
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .global-search-tab,
html[data-theme="dark"] .global-search-loading,
html[data-theme="dark"] .global-search-empty,
html[data-theme="dark"] .global-search-subtitle {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .global-search-result {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .global-search-result:hover,
html[data-theme="dark"] .global-search-result:focus-visible {
  color: #fff;
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .global-search-match-logos img {
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .page-share-action {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .page-share-action:hover,
html[data-theme="dark"] .page-share-action:focus-visible {
  color: #fff;
  background: var(--evi-surface-hover);
  border-color: var(--evi-brand);
}

html[data-theme="dark"] .site-footer,
html[data-theme="dark"] section.sponsor-section,
html[data-theme="dark"] .sponsor-section,
html[data-theme="dark"] .sponsor-track-wrap {
  color: var(--evi-text-muted) !important;
  background-color: var(--evi-surface) !important;
  border-color: var(--evi-border) !important;
}

html[data-theme="dark"] footer h6,
html[data-theme="dark"] footer .list-unstyled a {
  color: var(--evi-text) !important;
}

html[data-theme="dark"] footer p.small {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] footer .list-unstyled a:hover {
  color: var(--evi-brand) !important;
}

html[data-theme="dark"] :is(.navbar-brand, .mobile-appbar-brand, .footer-brand) img,
html[data-theme="dark"] #site-header .logo-item,
html[data-theme="dark"] .sponsor-item {
  background: rgba(255, 255, 255, .94);
  border-radius: 10px;
}

html[data-theme="dark"] :is(.navbar-brand, .mobile-appbar-brand, .footer-brand) img {
  padding: 3px;
}

html[data-theme="dark"] #site-header .logo-item,
html[data-theme="dark"] .sponsor-item {
  padding: 3px 6px;
}

/* PWA surfaces and full-page preferences */
html[data-theme="dark"] .pwa-bottom-nav {
  color: var(--evi-text-muted);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .pwa-bottom-nav a,
html[data-theme="dark"] .pwa-bottom-nav button {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .pwa-bottom-nav a:hover,
html[data-theme="dark"] .pwa-bottom-nav button:hover {
  color: var(--evi-text);
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .pwa-bottom-nav a.is-active {
  color: var(--evi-brand);
  background: transparent;
}

html[data-theme="dark"] .pwa-bottom-nav a.is-active i {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] .push-pref-modal,
html[data-theme="dark"] .push-pref-page-header,
html[data-theme="dark"] .push-pref-page-body {
  color: var(--evi-text);
  background: var(--evi-page);
}

html[data-theme="dark"] .push-pref-page-back,
html[data-theme="dark"] .push-pref-section-head h6,
html[data-theme="dark"] .push-team-option span:last-child,
html[data-theme="dark"] .push-pref-toggle strong {
  color: var(--evi-text);
}

html[data-theme="dark"] .push-pref-page-back:hover,
html[data-theme="dark"] .push-pref-page-back:focus-visible {
  color: var(--evi-brand);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .push-pref-label,
html[data-theme="dark"] .push-pref-kicker,
html[data-theme="dark"] .push-pref-hint,
html[data-theme="dark"] .push-pref-toggle small,
html[data-theme="dark"] .push-pref-section-head small {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .push-pref-status strong[data-tone="green"] {
  color: #6ee7a0;
}

html[data-theme="dark"] .push-pref-status strong[data-tone="yellow"] {
  color: #fcd34d;
}

html[data-theme="dark"] .push-pref-status strong[data-tone="red"] {
  color: #fda4af;
}

html[data-theme="dark"] .push-pref-toggle {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .push-pref-toggle:has(input:checked) {
  background: rgba(var(--evi-brand-rgb), .12);
  border-color: rgba(var(--evi-brand-rgb), .42);
}

html[data-theme="dark"] .push-team-star,
html[data-theme="dark"] .push-team-fallback {
  color: var(--evi-text-muted);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .push-team-option:hover {
  background: rgba(255, 255, 255, .025);
}

html[data-theme="dark"] .install-guide-modal,
html[data-theme="dark"] .install-guide-card,
html[data-theme="dark"] .install-guide-note,
html[data-theme="dark"] .pwa-banner {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .install-guide-note,
html[data-theme="dark"] .pwa-banner .pwa-icon {
  color: var(--evi-text-muted);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .install-step-number {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] .install-step small,
html[data-theme="dark"] .pwa-banner .pwa-sub {
  color: var(--evi-text-muted);
}

/* Shared filter bar */
html[data-theme="dark"] .evi-filter-bar {
  background: var(--evi-surface);
}

html[data-theme="dark"] .evi-filter-button {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .evi-filter-button:hover {
  color: var(--evi-text);
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .evi-filter-button.active,
html[data-theme="dark"] .evi-filter-button[aria-pressed="true"],
html[data-theme="dark"] .evi-filter-button[aria-selected="true"] {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] .evi-filter-button:focus-visible {
  outline-color: var(--evi-focus);
}

/* Reusable match card and schedule */
html[data-theme="dark"] .day-card,
html[data-theme="dark"] .home-match-feed-panel,
html[data-theme="dark"] .match-feed-panel {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .day-heading,
html[data-theme="dark"] .match-card-team-name,
html[data-theme="dark"] .match-card-score {
  color: var(--evi-text);
}

html[data-theme="dark"] .match-card-group,
html[data-theme="dark"] .match-card-meta {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .match-card-meta.is-live {
  color: var(--evi-success);
}

html[data-theme="dark"] .match-card-phase {
  color: var(--evi-text-subtle);
}

html[data-theme="dark"] .match-card-link:hover {
  background: rgba(255, 255, 255, .035);
}

html[data-theme="dark"] .match-card-link:focus-visible {
  outline-color: var(--evi-brand);
}

html[data-theme="dark"] .match-card-logo {
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
}

html[data-theme="dark"] .match-card-logo-fallback,
html[data-theme="dark"] .team-logo-fallback-sm,
html[data-theme="dark"] .team-table-fallback,
html[data-theme="dark"] .team-api-card .team-api-fallback,
html[data-theme="dark"] .fg-team-fallback,
html[data-theme="dark"] .mini-logo-fallback {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .match-card-favorite {
  color: var(--evi-brand);
}

html[data-theme="dark"] .match-feed-filter {
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .match-feed-filter button {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .match-feed-filter button:hover {
  color: var(--evi-text);
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .match-feed-filter button.active {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] .match-feed-message {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .match-feed-error {
  color: #fda4af;
}

html[data-theme="dark"] .team-logo,
html[data-theme="dark"] .group-impact-logo,
html[data-theme="dark"] .mini-logo {
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
}

html[data-theme="dark"] .standings-team-logo,
html[data-theme="dark"] .team-api-logo,
html[data-theme="dark"] .team-hero-logo,
html[data-theme="dark"] .team-other-logo,
html[data-theme="dark"] .fg-team img,
html[data-theme="dark"] .push-team-option img,
html[data-theme="dark"] .global-search-media:not(.is-photo) > img,
html[data-theme="dark"] .global-search-match-logos img,
html[data-theme="dark"] .player-hero img.rounded-circle {
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
}

html[data-theme="dark"] .player-hero img.rounded-circle {
  border-radius: 999px;
}

html[data-theme="dark"] .match-card-skeleton-group,
html[data-theme="dark"] .match-card-skeleton-logo,
html[data-theme="dark"] .match-card-skeleton-name,
html[data-theme="dark"] .match-card-skeleton-score,
html[data-theme="dark"] .match-card-skeleton-meta,
html[data-theme="dark"] .match-card-skeleton-phase,
html[data-theme="dark"] .schedule-skeleton-heading,
html[data-theme="dark"] .tippspiel-skeleton-badge,
html[data-theme="dark"] .tippspiel-skeleton-name,
html[data-theme="dark"] .tippspiel-skeleton-meta,
html[data-theme="dark"] .tippspiel-skeleton-copy {
  background: linear-gradient(90deg, var(--evi-skeleton-a) 0%, var(--evi-skeleton-b) 46%, var(--evi-skeleton-a) 100%);
  background-size: 220% 100%;
}

html[data-theme="dark"] .tippspiel-skeleton-card,
html[data-theme="dark"] .tippspiel-skeleton-leader,
html[data-theme="dark"] .tippspiel-skeleton-row {
  background: var(--evi-surface);
}

/* Reusable standings table */
html[data-theme="dark"] .standings-feed {
  --standings-bg: var(--evi-surface);
  --standings-text: var(--evi-text);
  --standings-muted: var(--evi-text-muted);
}

html[data-theme="dark"] .standings-section-title,
html[data-theme="dark"] .standings-table,
html[data-theme="dark"] .standings-rank,
html[data-theme="dark"] .standings-favorite,
html[data-theme="dark"] .standings-team-name {
  color: var(--evi-text);
}

html[data-theme="dark"] .standings-table thead th,
html[data-theme="dark"] .standings-message {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .standings-row.is-highlighted {
  background: rgba(var(--evi-brand-rgb), .1);
  box-shadow: inset 3px 0 0 var(--evi-brand);
}

html[data-theme="dark"] .standings-row.is-live {
  box-shadow: inset 3px 0 0 var(--evi-success);
}

html[data-theme="dark"] .standings-team-fallback,
html[data-theme="dark"] .standings-message {
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .standings-all-link {
  color: var(--evi-brand);
}

html[data-theme="dark"] .standings-error {
  color: #fda4af;
}

html[data-theme="dark"] .standings-skeleton-title,
html[data-theme="dark"] .standings-skeleton-head,
html[data-theme="dark"] .standings-skeleton-rank,
html[data-theme="dark"] .standings-skeleton-logo,
html[data-theme="dark"] .standings-skeleton-name,
html[data-theme="dark"] .standings-skeleton-stat {
  background: linear-gradient(90deg, var(--evi-skeleton-a) 0%, var(--evi-skeleton-b) 46%, var(--evi-skeleton-a) 100%);
  background-size: 220% 100%;
}

/* API-backed catalogs */
html[data-theme="dark"] .evi-catalog-status,
html[data-theme="dark"] .evi-skeleton-card,
html[data-theme="dark"] .evi-skeleton-row {
  color: var(--evi-text-muted);
  background: var(--evi-surface);
}

html[data-theme="dark"] .evi-skeleton-player,
html[data-theme="dark"] .evi-skeleton-line,
html[data-theme="dark"] .evi-skeleton-logo {
  background: var(--evi-skeleton-a);
}

html[data-theme="dark"] .evi-skeleton-card::after,
html[data-theme="dark"] .evi-skeleton-player::after,
html[data-theme="dark"] .evi-skeleton-row::after {
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .18), transparent);
}

html[data-theme="dark"] .group-api-count {
  color: var(--evi-text-muted);
}

/* Match detail, odds and ticker */
html[data-theme="dark"] .match-page .card,
html[data-theme="dark"] .match-detail-card,
html[data-theme="dark"] .match-sticky-card {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .match-sticky-card.is-stuck,
html[data-theme="dark"] .match-sticky-active {
  background: rgba(24, 24, 24, .9) !important;
  border-color: transparent !important;
}

html[data-theme="dark"] .match-hero-card {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .match-hero-card.is-stuck {
  background: rgba(24, 24, 24, .9) !important;
  border-color: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 12px 40px rgba(0, 0, 0, .48) !important;
}

html[data-theme="dark"] .match-hero-card.is-stuck::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .015));
  opacity: 1;
}

html[data-theme="light"] .match-hero-card.is-stuck {
  background: rgba(255, 255, 255, .68) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 32px rgba(31, 38, 135, .15) !important;
}

html[data-theme="light"] .match-hero-card.is-stuck::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .06));
  opacity: .7;
}

html[data-theme="dark"] .match-odds-team-name,
html[data-theme="dark"] .match-odds-percent,
html[data-theme="dark"] .impact-team-name,
html[data-theme="dark"] .timeline-title,
html[data-theme="dark"] .timeline-event-title {
  color: var(--evi-text);
}

html[data-theme="dark"] .match-odds-team-link:hover,
html[data-theme="dark"] .match-odds-team-link:focus-visible {
  color: var(--evi-brand);
}

html[data-theme="dark"] .match-odds-sample,
html[data-theme="dark"] .match-odds-error,
html[data-theme="dark"] .match-odds-empty,
html[data-theme="dark"] .impact-label,
html[data-theme="dark"] .timeline-time,
html[data-theme="dark"] .timeline-description,
html[data-theme="dark"] .event-meta {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .group-impact-summary,
html[data-theme="dark"] .group-impact-scenario-head,
html[data-theme="dark"] .group-impact-meta,
html[data-theme="dark"] .match-score-date,
html[data-theme="dark"] .match-score-group,
html[data-theme="dark"] .match-score-status,
html[data-theme="dark"] .timeline-system-line,
html[data-theme="dark"] .timeline-minute,
html[data-theme="dark"] .event-label,
html[data-theme="dark"] .match-events-error {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .group-impact-scenario-head strong,
html[data-theme="dark"] .group-impact-team,
html[data-theme="dark"] .group-impact-meta strong,
html[data-theme="dark"] .score-num,
html[data-theme="dark"] .score-sep,
html[data-theme="dark"] .timeline-player {
  color: var(--evi-text);
}

html[data-theme="dark"] .group-impact-scenario {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .group-impact-fallback,
html[data-theme="dark"] .team-logo-fallback {
  color: var(--evi-text);
  background: var(--evi-surface-soft) !important;
  border-color: var(--evi-border) !important;
}

html[data-theme="dark"] .match-quicknav a {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .match-quicknav a:hover {
  color: #fff;
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .timeline-system-line::before,
html[data-theme="dark"] .timeline-system-line::after {
  background: var(--evi-border);
}

html[data-theme="dark"] .prob-bar {
  background: var(--evi-surface-soft);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .prob-home { background: #1e4f8a; }
html[data-theme="dark"] .prob-draw { background: #555; }
html[data-theme="dark"] .prob-away { background: #873b49; }

html[data-theme="dark"] .impact-card,
html[data-theme="dark"] .impact-row,
html[data-theme="dark"] .match-meta-pill {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .timeline-minute {
  color: var(--evi-text-muted);
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .match-odds-row {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .match-odds-skeleton,
html[data-theme="dark"] .skeleton-line {
  background: linear-gradient(90deg, var(--evi-skeleton-a), var(--evi-skeleton-b), var(--evi-skeleton-a));
  background-size: 220% 100%;
}

/* Home */
html[data-theme="dark"] .hero-live-match,
html[data-theme="dark"] .hero-live-center,
html[data-theme="dark"] .hero-live-board,
html[data-theme="dark"] .hero-countdown {
  color: var(--evi-text);
  background: rgba(24, 24, 24, .94);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .hero-live-meta,
html[data-theme="dark"] .hero-live-time {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .live-score {
  color: var(--evi-text);
}

html[data-theme="dark"] .live-logo {
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
}

html[data-theme="dark"] .hero-count-number,
html[data-theme="dark"] .hero-count-label {
  color: var(--evi-text);
}

html[data-theme="dark"] .home-sections,
html[data-theme="dark"] .page-section {
  color: var(--evi-text);
}

html[data-theme="dark"] .leader-card,
html[data-theme="dark"] .home-sections .card {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

/* Teams, groups and players */
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .team-section-card,
html[data-theme="dark"] .team-hero-card,
html[data-theme="dark"] .group-card,
html[data-theme="dark"] .player-hero,
html[data-theme="dark"] .player-page .card {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .player-section-title,
html[data-theme="dark"] .group-title,
html[data-theme="dark"] .team-title,
html[data-theme="dark"] .player-title {
  color: var(--evi-text);
}

html[data-theme="dark"] .side-kicker,
html[data-theme="dark"] .team-subline {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .team-tag,
html[data-theme="dark"] .team-quicknav a,
html[data-theme="dark"] .tipps-soft-link,
html[data-theme="dark"] .tipps-count {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .team-quicknav a:hover,
html[data-theme="dark"] .tipps-soft-link:hover {
  color: #fff;
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .searchbar,
html[data-theme="dark"] .group-header {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .group-header {
  background: linear-gradient(135deg, #282828, #1e1e1e);
}

html[data-theme="dark"] .groups-page .list-group-item,
html[data-theme="dark"] .group-card .list-group-item {
  border-color: var(--evi-border);
}

html[data-theme="dark"] .team-logo-xs,
html[data-theme="dark"] .team-logo-sm,
html[data-theme="dark"] .groups-page .team-logo-sm {
  padding: 2px;
  background: rgba(255, 255, 255, .94);
  border-color: transparent;
}

html[data-theme="dark"] .team-api-card hr[style],
html[data-theme="dark"] #teamGrid hr[style] {
  background: var(--evi-border) !important;
}

html[data-theme="dark"] .player-card-rank,
html[data-theme="dark"] .player-card-stat {
  color: var(--evi-text);
  background: #252525;
}

html[data-theme="dark"] .player-card-shell {
  background: var(--evi-surface);
}

html[data-theme="dark"] .player-card-team-logo,
html[data-theme="dark"] .sponsor-page-logo {
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .94);
}

html[data-theme="dark"] .player-card-stat span {
  color: var(--evi-text-muted);
}

/* Tipps, leaderboards and highlighted rows */
html[data-theme="dark"] .tipps-app {
  --tipps-bg: var(--evi-page);
  --tipps-panel: var(--evi-surface);
  --tipps-panel-2: var(--evi-surface-soft);
  --tipps-line: var(--evi-border);
  --tipps-text: var(--evi-text);
  --tipps-muted: var(--evi-text-muted);
  --tipps-accent: var(--evi-brand);
  --tipps-success: var(--evi-success);
  --tipps-random-bg: var(--evi-brand-strong);
}

html[data-theme="dark"] .tipps-app .tipps-intro-card,
html[data-theme="dark"] .tipps-app .tipps-group-section,
html[data-theme="dark"] .tipps-app .fg-tip-list,
html[data-theme="dark"] .tipps-app .fg-empty {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .tipps-app .btn-outline-primary {
  color: var(--evi-brand) !important;
  background: transparent !important;
  border-color: rgba(var(--evi-brand-rgb), .55) !important;
}

html[data-theme="dark"] .tipps-app .btn-outline-primary:hover {
  color: #fff !important;
  background: var(--evi-brand-strong) !important;
}

html[data-theme="dark"] .tipps-app .form-control {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border-strong);
}

html[data-theme="dark"] .fg-team-fallback,
html[data-theme="dark"] .fg-score-box,
html[data-theme="dark"] .fg-score-input {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .points-chip.is-hit,
html[data-theme="dark"] .fg-breakdown .points-chip.is-hit {
  color: #86efac;
  background: rgba(34, 197, 94, .14);
}

html[data-theme="dark"] .points-chip.is-miss,
html[data-theme="dark"] .fg-breakdown .points-chip.is-miss {
  color: var(--evi-text-muted);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .podium-card,
html[data-theme="dark"] .tip-group-mini {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .avatar-sm,
html[data-theme="dark"] .avatar-lg,
html[data-theme="dark"] .avatar-xl {
  color: var(--evi-brand);
  background: #303030;
  border-color: var(--evi-border);
}

html[data-theme="dark"] .table-me {
  color: var(--evi-text);
  background: rgba(251, 191, 36, .11) !important;
}

/* Status, archive and information pages */
html[data-theme="dark"] .status-page {
  color: var(--evi-text);
}

html[data-theme="dark"] .status-summary,
html[data-theme="dark"] .status-service {
  color: var(--evi-text);
  background: var(--evi-surface);
}

html[data-theme="dark"] .status-time,
html[data-theme="dark"] .status-service-detail,
html[data-theme="dark"] .status-service-latency,
html[data-theme="dark"] .status-release {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .status-service-badge {
  color: var(--evi-text-muted);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .status-service[data-status="operational"] .status-service-badge {
  color: #86efac;
  background: rgba(34, 197, 94, .14);
}

html[data-theme="dark"] .status-service[data-status="degraded"] .status-service-badge {
  color: #fcd34d;
  background: rgba(245, 158, 11, .14);
}

html[data-theme="dark"] .status-service[data-status="down"] .status-service-badge {
  color: #fda4af;
  background: rgba(244, 63, 94, .14);
}

html[data-theme="dark"] .archive-card {
  color: var(--evi-text);
  background: rgba(32, 32, 32, .92);
  border-color: var(--evi-border) !important;
}

html[data-theme="dark"] .archive-title {
  color: var(--evi-text);
}

html[data-theme="dark"] .archive-badge {
  color: var(--evi-text-muted);
  background: var(--evi-surface-soft);
}

html[data-theme="dark"] .archive-badge.active {
  color: #86efac;
  background: rgba(34, 197, 94, .14);
}

html[data-theme="dark"] .archive-actions .btn,
html[data-theme="dark"] .archive-actions a {
  color: var(--evi-brand);
  background: var(--evi-surface);
  border-color: rgba(var(--evi-brand-rgb), .38);
}

html[data-theme="dark"] .pill-link,
html[data-theme="dark"] .badge-soft,
html[data-theme="dark"] .t-badge {
  color: var(--evi-text);
  background: var(--evi-surface-soft);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .rule-box,
html[data-theme="dark"] .t-item,
html[data-theme="dark"] .evi-acc .accordion-item,
html[data-theme="dark"] .evi-acc .accordion-button {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .rule-text,
html[data-theme="dark"] .evi-acc .accordion-body,
html[data-theme="dark"] .t-text {
  color: var(--evi-text-muted);
}

html[data-theme="dark"] .evi-acc .accordion-button:not(.collapsed) {
  color: #fff;
  background: var(--evi-brand-strong);
}

html[data-theme="dark"] .accordion-button::after {
  filter: invert(1) grayscale(100%) brightness(180%);
}

html[data-theme="dark"] .pdf-shell,
html[data-theme="dark"] .pdf-fallback {
  color: var(--evi-text);
  background: var(--evi-surface);
  border-color: var(--evi-border);
}

/* Moderator scoreboard inherits the public shell. */
html[data-theme="dark"] .scoreboard-page .player-card {
  color: var(--evi-text);
  background: var(--evi-surface-raised);
  border-color: var(--evi-border);
}

html[data-theme="dark"] .scoreboard-page .player-card:hover {
  background: var(--evi-surface-hover);
}

html[data-theme="dark"] .scoreboard-page .player-card-selected {
  background: rgba(var(--evi-brand-strong-rgb), .16);
  border-color: var(--evi-brand);
}

html[data-theme="dark"] .scoreboard-page .player-avatar {
  background: #303030;
}

html[data-theme="dark"] .scoreboard-page .player-avatar-initial,
html[data-theme="dark"] .scoreboard-page .player-meta .player-number {
  color: var(--evi-text-muted);
}

/* Focus visibility is intentionally global in dark mode. */
html[data-theme="dark"] :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--evi-brand);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="dark"] *,
  html[data-theme="dark"] *::before,
  html[data-theme="dark"] *::after {
    scroll-behavior: auto !important;
  }
}
