/* Local design experiment. Loaded after the recovered production stylesheet. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --field-green: #9c9c9c;
  --field-green-light: #bebebe;
  --field-green-dark: #7b7b7b;
  --chalk-white: #131313;
  --goal-net: #1d1d1d;
  --grass-stripe: #606060;
  --touchline: #505050;
  --crowd-900: #f2f2f2;
  --crowd-700: #d1d1d1;
  --crowd-500: #a6a6a6;
  --crowd-300: #2e2e2e;
  --crowd-100: #272727;
  --whistle-yellow: #9c9c9c;
  --whistle-yellow-dim: #9c9c9c;
  --referee-red: #fb8189;
  --referee-red-dim: #fb8189;
  --shadow-pitch: 0 4px 14px #0003;
  --shadow-pitch-lg: 0 16px 40px #0005;
  --shadow-goal: 0 4px 14px #0003;
  --shadow-card: 0 4px 16px #0002;
  --shadow-card-hover: 0 8px 24px #0004;
}

html[data-theme="dark"] { background: #0a0a0a; }
html[data-theme="dark"] body {
  background: #0a0a0a;
  color: var(--crowd-900);
}

/* Flat surfaces replace the blue wash and glass panels. */
[data-theme="dark"] :is(.header, .header-mobile-nav) {
  background: #101010;
  border-color: var(--crowd-300);
  box-shadow: none;
  backdrop-filter: none;
}
[data-theme="dark"] .header-nav { background: #191919; border-color: #2e2e2e; }
[data-theme="dark"] :is(.nav-link.active, .nav-link:hover, .nav-item.active, .nav-item:hover) {
  color: var(--field-green);
  background: #2d2d2d;
  box-shadow: none;
}
[data-theme="dark"] :is(.card, .card-pitch, .match-card, .page-header, .modal) {
  background: #131313;
  background-image: none;
  border-color: var(--crowd-300);
}
[data-theme="dark"] :is(.card, .match-card):hover { border-color: #505050; }
[data-theme="dark"] :is(.card-header, .card-footer, .match-header, .modal-header, .modal-footer) {
  background: #191919;
  border-color: var(--crowd-300);
}
[data-theme="dark"] .hero-section {
  background: #121212;
  border-bottom: 1px solid var(--crowd-300);
}
[data-theme="dark"] .hero-section .display-1 { color: #f2f2f2; }
[data-theme="dark"] .hero-subtitle { color: #b7b7b7; }
[data-theme="dark"] :is(.pitch-bg::before, .center-line) { background: none; }
[data-theme="dark"] :is(.card-pitch::before, .match-card::before) {
  background: var(--field-green);
}
[data-theme="dark"] :is(.stat-icon, .action-icon) {
  background: #2d2d2d;
  color: var(--field-green);
}

/* Keep button text distinct from the surface token used by the old CSS. */
[data-theme="dark"] :is(.btn-primary, .header-admin-btn, .header-logo) {
  background: #606060;
  color: #ffffff;
  box-shadow: none;
}
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #4e4e4e; box-shadow: none; }
[data-theme="dark"] .btn-secondary {
  background: #2f2f2f;
  color: #f2f2f2;
  border: 1px solid #494949;
  box-shadow: none;
}
[data-theme="dark"] .btn-secondary:hover:not(:disabled) { background: #3c3c3c; box-shadow: none; }
[data-theme="dark"] .btn::before { background: none; }
[data-theme="dark"] :is(.filter-btn.active, .tab-btn.active, .tab-btn:hover,
  .score-stepper .score-stepper-btn.is-add, .score-stepper-btn:hover:not(:disabled), .table .stat-cell.points) {
  color: #ffffff;
  background: #606060;
  box-shadow: none;
}
[data-theme="dark"] .filter-btn.active .filter-count { background: #ffffff26; color: #ffffff; }
[data-theme="dark"] :is(.btn-danger:hover:not(:disabled), .badge-live) { color: #211115; }

[data-theme="dark"] .table thead { background: #222222; color: #e9e9e9; }
[data-theme="dark"] .table tbody tr:nth-child(2n) { background: #171717; }
[data-theme="dark"] .table tbody tr:hover { background: #2d2d2d; }
[data-theme="dark"] .table tbody td.stat-cell.points::before { color: #ffffff; }
[data-theme="dark"] :is(input, select, textarea, .form-input, .form-select, .form-textarea,
  .select-trigger, .select-menu) {
  color: #f2f2f2;
  background: #171717;
  border-color: #494949;
}
[data-theme="dark"] :is(input, select, textarea):focus,
[data-theme="dark"] :is(.select-trigger:focus-visible, .select-trigger.is-open) {
  border-color: #9c9c9c;
  box-shadow: 0 0 0 3px #9c9c9c26;
}
[data-theme="dark"] :is(.select-option:hover, .select-option:focus-visible,
  .select-option.is-selected, .filter-btn:hover) { background: #2d2d2d; }
[data-theme="dark"] .modal-backdrop { background: #000a; }

[data-theme="dark"] :is(.badge-success, .badge-info, .badge-group-b, .badge-group-c) {
  color: #9c9c9c;
  background: #9c9c9c1a;
  border-color: #9c9c9c40;
}
[data-theme="dark"] :is(.match-status.played, .streak-win, .form-win, .admins-feedback.is-ok) {
  background: #9c9c9c1a;
  border-color: #9c9c9c40;
}
[data-theme="dark"] :is(.btn-ghost:hover:not(:disabled), .player-picker-option:hover,
  .player-picker-option:focus-visible, .player-picker-option.is-selected) { background: #2d2d2d; }
[data-theme="dark"] :is(.form-input:focus, .form-select:focus, .form-textarea:focus,
  .player-picker:focus-visible, .player-picker[aria-expanded="true"]) {
  border-color: #9c9c9c;
  box-shadow: 0 0 0 3px #9c9c9c26;
}
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] { background: #1d1d1d !important; }
[data-theme="dark"] :is(.badge-goal, .admin-badge, .header-admin-btn.is-active, .pos-1, .pos-3) {
  background: #606060;
  color: #ffffff;
}
[data-theme="dark"] .pos-2 { background: #c1c1c1; color: #171717; }
[data-theme="dark"] :is(.logo-dropzone, .logo-dropzone:hover, .logo-preview-card, .score-card) {
  background: #1d1d1d;
}
[data-theme="dark"] .logo-dropzone-active { background: #2d2d2d !important; }
[data-theme="dark"] .logo-dropzone::before { background: none; }
[data-theme="dark"] .competition-chip.is-live { color: #7fdfae; }

/* The recovered bundle also sets some tournament backgrounds inline. */
[data-theme="dark"] [style*="gradient"] { background-image: none !important; }
[data-theme="dark"] .tournament-card-header { background: #222222 !important; }
[data-theme="dark"] .tournament-card-header :is(h2, h3, h4) { color: #f2f2f2; }
[data-theme="dark"] .champion-badge { background: #606060 !important; color: #ffffff; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background-color: #595959; box-shadow: none; }
[data-theme="dark"] ::selection { background: #9c9c9c59; color: #fff; }

@media print {
  :root[data-theme="dark"] {
    color-scheme: light;
    --chalk-white: #fff;
    --goal-net: #f5f5f5;
    --crowd-900: #171717;
    --crowd-700: #333;
    --crowd-500: #555;
    --crowd-300: #ccc;
    --crowd-100: #eee;
    --field-green: #4e4e4e;
  }
  html[data-theme="dark"], html[data-theme="dark"] body,
  [data-theme="dark"] :is(.card, .match-card, .page-header, .table tbody tr:nth-child(2n)) {
    color: #171717;
    background: #fff;
    box-shadow: none;
  }
}

/* Suppress the browser's blue touch overlay and accidental selection on controls. */
:where(a, button, select, summary, [role="button"], [role="tab"], [role="radio"]) {
  -webkit-tap-highlight-color: transparent;
}
:where(button, [role="button"], [role="tab"], [role="radio"], .btn) {
  -webkit-user-select: none;
  user-select: none;
}
:where(button, a, summary, [role="button"], [role="tab"]):focus:not(:focus-visible) { outline: none; }
