@font-face {
  font-family: "BGMS Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f2f7f7;
  --surface: #ffffff;
  --surface-2: #f7fbfb;
  --surface-3: #edf6f6;
  --text: #10242c;
  --muted: #64767d;
  --line: #d8e5e7;
  --line-strong: #b9cdd1;
  --primary: #009b8e;
  --primary-2: #00b9a8;
  --primary-soft: #dff9f5;
  --primary-contrast: #ffffff;
  --success: #12805c;
  --success-soft: #e5f8ef;
  --warning: #c67a11;
  --warning-soft: #fff4df;
  --danger: #c83d4d;
  --danger-soft: #fff0f2;
  --info: #256d95;
  --info-soft: #eaf5fb;
  --accent: #f2b948;
  --nav: #07191f;
  --nav-2: #0b252d;
  --nav-text: #e7f5f4;
  --nav-muted: #8fb0b5;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 5px 16px rgba(7, 25, 31, .07);
  --shadow: 0 14px 40px rgba(7, 25, 31, .10);
  --shadow-lg: 0 24px 70px rgba(2, 16, 21, .18);
  --focus-ring: 0 0 0 4px rgba(0, 155, 142, .18);
  --sidebar-width: 292px;
  --sidebar-collapsed-width: 86px;
  --topbar-height: 72px;
  --transition-fast: 150ms ease;
  --transition: 220ms ease;
  --font-fa: "BGMS Vazirmatn", Vazirmatn, Tahoma, Arial, sans-serif;
  --font-latin: Poppins, Inter, Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071218;
  --surface: #0c2027;
  --surface-2: #102a32;
  --surface-3: #15353e;
  --text: #e8f4f3;
  --muted: #99b0b4;
  --line: #24434b;
  --line-strong: #315761;
  --primary: #00c8b6;
  --primary-2: #00e0ca;
  --primary-soft: #0c3837;
  --primary-contrast: #041514;
  --success: #4cd2a0;
  --success-soft: #11382d;
  --warning: #f2b948;
  --warning-soft: #3c3017;
  --danger: #ff7c89;
  --danger-soft: #402129;
  --info: #79c6ef;
  --info-soft: #173445;
  --accent: #f2b948;
  --nav: #030d12;
  --nav-2: #0a2027;
  --nav-text: #ecfbf9;
  --nav-muted: #8aabb0;
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .22);
  --shadow: 0 16px 44px rgba(0, 0, 0, .28);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, .42);
  --focus-ring: 0 0 0 4px rgba(0, 214, 194, .22);
}

html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font-family: var(--font-latin); }
html[dir="rtl"] body { font-family: var(--font-fa); }
:where(button, input, select, textarea) { font-family: inherit; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; box-shadow: var(--focus-ring); }
::selection { background: var(--primary); color: var(--primary-contrast); }

.bgms-first-error-control {
  scroll-margin-block: calc(var(--topbar-height) + 1.5rem);
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger), transparent 82%) !important;
}
.bgms-first-error-group { scroll-margin-block: calc(var(--topbar-height) + 1.5rem); }

.card, .stat-card, .match-card, input, select, textarea, .live-search-select__results, .player-search-results, .player-search-item { background: var(--surface); color: var(--text); border-color: var(--line); }
.card, .stat-card, .match-card { box-shadow: var(--shadow-sm); }
.card__header, .data-table th, .match-card__head, .result-form, .participant, .finance-summary-grid > div, .signup-candidate-card { background: var(--surface-2); border-color: var(--line); }
.data-table td, .data-table th, .player-row, .auth-card__footer, .signup-review-facts div { border-color: var(--line); }
.page-subtitle, .stat-card__label, .meta-list, .data-table th, .round-title, .signup-field-help { color: var(--muted); }
input, select, textarea { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary-2); }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-light:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); }
.badge { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.message { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success), transparent 65%); }
.message.error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger), transparent 65%); }
.money-positive, .is-positive { color: var(--success) !important; }
.money-negative, .is-negative { color: var(--danger) !important; }
.money-neutral, .is-neutral { color: var(--muted) !important; }

html[data-theme="dark"] .player-row.is-winner { background: var(--success-soft); color: var(--success); }
html[data-theme="dark"] .empty-state { background: var(--surface-2); border-color: var(--line-strong); }
html[data-theme="dark"] .player-search-item:hover,
html[data-theme="dark"] .player-search-item.is-active { background: var(--primary-soft); color: var(--primary); }
html[data-theme="dark"] .jackpot-final-actions,
html[data-theme="dark"] .jackpot-finalists { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning), transparent 55%); }

.bgms-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.brand__signature, .bgms-admin-brand__sjm { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
