﻿:root {
  --bg: radial-gradient(circle at 20% 20%, #081828 0%, #050c15 40%, #03060c 75%);
  --accent: #26f1c6;
  --accent-2: #f2b035;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #e8edf7;
  --muted: #9aacbf;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --card-bg: rgba(6, 10, 18, 0.7);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  --card-glow-start: rgba(44, 96, 184, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", "Manrope", system-ui, -apple-system, sans-serif;
  position: relative;
}

body.theme-light {
  --bg: radial-gradient(circle at 20% 20%, #f5f7fb 0%, #e7eef9 35%, #d7e4f5 75%);
  --panel: rgba(255, 255, 255, 0.85);
  --stroke: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #475467;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(15, 23, 42, 0.08);
  --card-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
  --card-glow-start: rgba(111, 143, 255, 0.25);
}

.bg-shapes {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(38, 241, 198, 0.12), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(242, 176, 53, 0.14), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.08), transparent 32%);
  filter: blur(0px);
  pointer-events: none;
  z-index: 0;
}

body.theme-light .bg-shapes {
  background: radial-gradient(circle at 20% 30%, rgba(15, 118, 255, 0.12), transparent 35%),
    radial-gradient(circle at 80% 15%, rgba(236, 72, 153, 0.12), transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.5), transparent 32%);
}

body.theme-light .topbar {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.theme-light .brand-icon {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
}

body.theme-light .brand-home-link {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .brand-mark {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

body.theme-light .status {
  color: #0f172a;
}

body.theme-light .tab-button {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(15, 23, 42, 0.1);
  color: #475467;
}

body.theme-light .tab-button.active {
  background: linear-gradient(135deg, #0f3760, #1f5f92);
  color: #f8fafc;
  border-color: transparent;
}

body.theme-light .league-toggle {
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
}

body.theme-light .league-option {
  color: #0f172a;
}

body.theme-light .league-option.active {
  background: linear-gradient(135deg, #f2b035, #ffd666);
  color: #101620;
}

body.theme-light .glass {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body.theme-light .match-card {
  color: #0f172a;
}

body.theme-light .match-card .match-score,
body.theme-light .match-card .match-date {
  color: #0f172a;
}

body.theme-light .match-card::before {
  opacity: 0.6;
}

body.theme-light .match-tag {
  background: #2563eb;
}

body.theme-light .table {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
}

body.theme-light .table th {
  color: #0f172a;
}

body.theme-light .table thead th {
  background: rgba(226, 232, 240, 0.85);
}

body.theme-light .table td {
  color: #1f2937;
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .pill {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #1f2937;
}

body.theme-light .modal-dialog {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

body.theme-light .modal-close {
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}

body.theme-light .player-match-card {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 36px);
  backdrop-filter: blur(12px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.35));
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 6px 8px 6px 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.brand-home-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  border-color: rgba(242, 176, 53, 0.35);
  background: rgba(255, 255, 255, 0.07);
}

.brand-mark {
  background: linear-gradient(135deg, #0d3b66, #1b4f72);
  color: #e8edf7;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 16px;
}

.brand-copy small {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
}

.brand-icon {
  background: linear-gradient(135deg, #0d3b66, #1b4f72);
  color: #e8edf7;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
  letter-spacing: -0.02em;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:active {
  transform: scale(0.96);
}

body.theme-light .theme-toggle {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.league-select {
  appearance: none;
  background: linear-gradient(135deg, #0f1f33, #0a1726);
  border: 1px solid rgba(38, 241, 198, 0.2);
  color: #f7fbff;
  padding: 10px 42px 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  min-width: 240px;
  box-shadow: 0 10px 30px rgba(13, 179, 255, 0.28);
  position: relative;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23f7fbff' d='M1.41 0L6 4.58 10.59 0 12 1.42 6 7.42 0 1.42z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.league-select option {
  color: #eaf3ff;
  font-weight: 700;
  background: #0d1a28;
  padding: 8px;
  border: none;
}

.league-select option:disabled {
  color: #6c7a92;
}

.league-select:focus {
  outline: 2px solid #26f1c6;
  outline-offset: 2px;
}

.league-picker {
  position: relative;
}

.league-toggle {
  background: linear-gradient(135deg, rgba(13, 25, 40, 0.96), rgba(7, 16, 27, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f7fbff;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 800;
  min-width: 240px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.league-toggle:focus {
  outline: 2px solid rgba(242, 176, 53, 0.85);
  outline-offset: 2px;
}

.league-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  background: #0d1a28;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
  width: 260px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  display: none;
}

.league-picker.open .league-menu {
  display: block;
}

.league-option {
  padding: 10px 12px;
  border-radius: 10px;
  color: #f0f6ff;
  font-weight: 700;
  cursor: pointer;
}

.league-option:hover {
  background: rgba(242, 176, 53, 0.1);
}

.league-option.active {
  background: linear-gradient(135deg, rgba(242, 176, 53, 0.95), rgba(255, 214, 102, 0.9));
  color: #101620;
}

.league-option.disabled {
  color: #6c7a92;
  cursor: not-allowed;
}

.chevron {
  font-size: 14px;
  opacity: 0.8;
}

nav {
  display: flex;
  gap: 10px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

nav a:hover {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.06);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  position: relative;
  z-index: 1;
  padding: clamp(16px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 12px;
}

.tab-button {
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.tab-button.active {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.06);
}

.glass {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 6px 0;
  font-size: clamp(26px, 4vw, 34px);
}

h2 {
  margin: 0;
  font-size: 22px;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.lede {
  margin: 6px 0 12px;
  color: var(--muted);
  max-width: 720px;
}

.status {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.control-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-card label {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input[type="number"],
input[type="search"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 15px;
}

button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #0b0e16;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 18px 40px rgba(38, 241, 198, 0.2);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(242, 176, 53, 0.25);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: none;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.pill.subtle {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px 16px;
}

.stat-label {
  color: var(--muted);
  font-weight: 700;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0;
}

.stat-desc {
  color: var(--muted);
  font-size: 13px;
}

.panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-head {
  margin-bottom: 12px;
}

.compact-head h2,
.schedule-toolbar h2 {
  letter-spacing: -0.02em;
}

.schedule-toolbar {
  align-items: center;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  width: 100%;
  margin-top: 6px;
  margin-bottom: 10px;
}

.round-filter {
  flex: 0 0 210px;
}

.view-toggle {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.view-btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.view-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.view-btn.active {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #05090f;
  border-color: transparent;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

body.theme-light .view-btn {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

body.theme-light .view-btn.active {
  color: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
}

.schedule-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 960px) {
  .schedule-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

@media (min-width: 1180px) {
  .schedule-block .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.match-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 14px;
  padding: 10px 12px 12px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
  cursor: pointer;
  overflow: hidden;
}
.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 25% -15%, var(--card-glow-start), transparent 55%),
    radial-gradient(circle at 80% 120%, rgba(255, 255, 255, 0.05), transparent 40%);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

.match-card > * {
  position: relative;
  z-index: 1;
}
.match-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.match-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.4fr) minmax(80px, 0.6fr) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.match-row.compact {
  padding: 8px 12px;
  gap: 8px;
}

.match-row:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.match-row-teams {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.match-row-team {
  color: var(--accent-2);
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  line-height: 1.2;
}

.match-row-vs {
  font-weight: 700;
  color: var(--muted);
}

.match-row-score {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
}

.match-row-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.match-row-meta .match-icons {
  display: inline-flex;
  gap: 4px;
}

.match-row-chip {
  display: flex;
  align-items: center;
}

body.theme-light .match-row {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15);
}

@media (max-width: 900px) {
  .match-row {
    grid-template-columns: 1fr;
  }
  .match-row-score,
  .match-row-meta {
    text-align: left;
  }
}
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}
.match-card.small {
  padding: 8px 10px;
  gap: 4px;
}
.match-top { display: flex; justify-content: flex-end; }
.match-tag {
  background: #1f8bff;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
}
.match-tag.tag-2m {
  background: linear-gradient(120deg, #f05a5a, #d63232);
}
.match-tag.tag-3m {
  background: linear-gradient(120deg, #2c3e8c, #1c2259);
}
.match-tag.tag-4w {
  background: linear-gradient(120deg, #108e7e, #0b5f57);
}
.match-tag.tag-4z {
  background: linear-gradient(120deg, #2f7bff, #1c4dcc);
}
.match-home,
.match-away {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-2);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  display: block;
  letter-spacing: 0.15px;
}

.match-home {
  text-align: left;
}

.match-away {
  text-align: right;
}

.match-vs { text-align: center; color: var(--muted); font-weight: 700; }
.match-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.match-score { font-weight: 800; color: var(--text); }
.match-status-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.14);
  color: #ffb4b4;
  border: 1px solid rgba(255, 107, 107, 0.24);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.match-icons { display: inline-flex; gap: 6px; font-size: 14px; }
.match-date { margin-left: auto; color: var(--muted); }
.card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.card a {
  color: var(--accent-2);
  text-decoration: none;
}

.card a:hover {
  text-decoration: underline;
}

.team-name.gold {
  color: var(--accent-2);
  font-weight: 700;
}

.match-vs {
  text-align: center;
  padding: 4px 0;
  color: #ffffff;
  font-weight: 700;
}

.match-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.league-tag {
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  color: #fff;
  display: inline-block;
}

.league-tag-red {
  background: linear-gradient(135deg, #ff5a5f, #d72638);
}

.league-tag-blue {
  background: linear-gradient(135deg, #0f2f55, #123c6d);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: var(--text);
}

.date-text {
  color: var(--muted);
  font-size: 13px;
}

.league-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12px;
  color: #0a0f15;
  background: rgba(255, 255, 255, 0.8);
}

.league-tag-red {
  background: linear-gradient(135deg, #ff5a5f, #d72638);
  color: #fff;
}

.league-tag-blue {
  background: linear-gradient(135deg, #0f2f55, #123c6d);
  color: #fff;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.table thead th {
  background: rgba(3, 8, 16, 0.72);
}

.table thead th:first-child {
  border-top-left-radius: 12px;
}

.table thead th:last-child {
  border-top-right-radius: 12px;
}

.table th,
.table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--stroke);
}

.table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.table-group-row td {
  background: rgba(242, 176, 53, 0.1) !important;
  color: var(--accent-2) !important;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
}

.table tbody tr:not([data-team-id]):hover td {
  background: rgba(255, 255, 255, 0.04);
}
.table tbody tr[data-team-id] {
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}

.table tbody tr[data-match-id] {
  cursor: pointer;
}

.table tbody tr[data-match-id]:hover td {
  background: rgba(242, 176, 53, 0.08);
}
.table tbody tr[data-team-id]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(38, 241, 198, 0.08), rgba(17, 94, 84, 0.2));
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 0;
}
.table tbody tr[data-team-id]:hover {
  transform: translateX(4px);
}
.table tbody tr[data-team-id]:hover::before {
  opacity: 1;
}
.table tbody tr[data-team-id] td {
  position: relative;
  z-index: 1;
  background: transparent !important;
}
.table tbody tr[data-team-id] td:nth-child(2) {
  position: relative;
}
.table tbody tr[data-team-id] td:nth-child(2)::after {
  content: "›";
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
  transition: opacity 0.15s ease, right 0.15s ease;
}
.table tbody tr[data-team-id]:hover td:nth-child(2)::after {
  opacity: 1;
  right: -10px;
  color: var(--accent);
}

.team-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.team-row:hover td {
  background: rgba(38, 241, 198, 0.06);
}

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(10, 14, 22, 0.7);
  color: var(--text);
  font-size: 14px;
  min-width: 200px;
  appearance: none;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex: 0 0 220px;
}

input[type="search"] {
  flex: 0 1 320px;
  min-width: 200px;
  margin-top: 0;
}

.meta {
  color: var(--muted);
  font-size: 14px;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.team-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  color: var(--muted);
}

.meta-block {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.meta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

.meta-value {
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}

.meta-wrap {
  white-space: normal;
  word-break: break-word;
}

.team-card {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  width: 100%;
}

.team-card-title {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 8px;
}

.team-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  line-height: 1.4;
}

.team-card-line {
  white-space: normal;
  word-break: break-word;
}

.team-link {
  color: var(--accent-2);
}

.team-link:hover {
  text-decoration: underline;
}

.match-vs-inline {
  color: #ffffff;
  font-weight: 700;
}

.panel-subhead h3 {
  color: var(--text);
}
#toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0c1118;
  color: var(--text);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: none;
  z-index: 20;
}

#toast.show {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  max-width: 920px;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px 24px 16px;
  box-shadow: 0 15px 60px rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.match-modal-score {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 12px;
}
.match-modal-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  margin-bottom: 10px;
}
.match-modal-meta .meta-item {
  font-size: 12px;
  color: var(--muted);
}
.match-modal-meta .meta-item strong {
  color: var(--text);
}

.match-modal-games table.compact th,
.match-modal-games table.compact td {
  padding: 6px 8px;
  font-size: 13px;
}

.match-modal-games h4 {
  margin: 8px 0;
}
.match-modal-games .is-double td {
  background: rgba(255, 255, 255, 0.03);
}
.match-modal-games table {
  width: 100%;
  table-layout: fixed;
}
.match-modal-games th:nth-child(1),
.match-modal-games td:nth-child(1) {
  width: 45px;
  text-align: center;
  white-space: nowrap;
}
.match-modal-games th:nth-child(2),
.match-modal-games td:nth-child(2) {
  width: 70px;
  text-align: center;
  white-space: nowrap;
}
.match-modal-games th:nth-child(3),
.match-modal-games td:nth-child(3),
.match-modal-games th:nth-child(4),
.match-modal-games td:nth-child(4) {
  width: 23%;
  white-space: normal;
  word-break: break-word;
}
.match-modal-games th:nth-child(5),
.match-modal-games td:nth-child(5) {
  width: 30%;
  white-space: normal;
  word-break: break-word;
}
.match-modal-games th:nth-child(6),
.match-modal-games td:nth-child(6) {
  width: 10%;
  white-space: nowrap;
  text-align: center;
}
.match-modal-games td.result-cell {
  white-space: nowrap;
  word-break: break-word;
  line-height: 1.4;
}
.match-modal-games td.player-cell {
  white-space: normal;
  word-break: break-word;
}
.match-modal-games .player-line,
.player-line {
  display: block;
}
#match-modal-source {
  display: inline-block;
  margin-top: 12px;
}

.player-link {
  background: none;
  border: none;
  color: var(--accent-2);
  font: inherit;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.player-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.player-dialog {
  max-width: 960px;
  width: calc(100vw - 32px);
  padding-top: 32px;
}

.player-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-right: 48px;
}

.player-modal-header h3 {
  margin: 0;
}

.player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.player-matches {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.player-match-card {
  background: rgba(8, 15, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.player-match-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.player-match-card h4 {
  margin: 0;
}

.player-match-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-weight: 600;
}

.player-match-score {
  font-size: 20px;
}

.player-games-table td,
.player-games-table th {
  font-size: 14px;
}

.player-games-table td.player-cell .player-line + .player-line {
  margin-top: 2px;
}

.player-games-table td.player-result {
  font-weight: 600;
}

.player-game-row.win .player-result {
  color: var(--accent);
}

.player-game-row.loss .player-result {
  color: var(--danger);
}

.player-result.result-win {
  color: var(--accent);
}

.player-result.result-loss {
  color: var(--danger);
}

.player-set-points {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.player-card-actions {
  margin-top: 12px;
}

.player-dialog .modal-close {
  top: 12px;
  right: 16px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .brand,
  .league-picker,
  .league-toggle {
    width: 100%;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    display: none;
  }

  .table {
    min-width: 360px;
  }
}
.card-badge {
  position: absolute;
  top: 26px;
  right: 12px;
}
.schedule-block {
  margin-bottom: 24px;
  padding: 18px 20px 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.schedule-block:last-child {
  margin-bottom: 0;
}
.schedule-block .panel-head {
  margin-bottom: 18px;
}
