:root {
  --bg: #090910;
  --surface: #0f0f18;
  --surface-elevated: #131320;
  --card: #141420;
  --card-hi: #1a1a2a;
  --border: #24243a;
  --border-hi: #0ca7cf;
  --text: #f0f1f7;
  --text-lo: #9ca1b8;
  --text-dim: #5a6178;
  --teal: #00c2e8;
  --teal-mid: #0b88ad;
  --teal-dim: #041a22;
  --teal-glow: rgba(0, 194, 232, 0.12);
  --red: #ff2d52;
  --red-dim: #2a0d18;
  --red-glow: rgba(255, 45, 82, 0.18);
  --warn: #d9a22f;
  --warn-dim: #2a210b;
  --green: #35c26f;
  --green-dim: #0c2318;
  --blue: #3d8eff;
  --blue-dim: #0d1e3a;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --header-height: 76px;
  --nav-height: 76px;
  --club-bar-height: 26px;

  /* Semantic: text colour on teal/primary backgrounds */
  --teal-on: #00131a;

  /* Glass surfaces – overridden in light theme */
  --glass-card: rgba(15, 15, 24, 0.96);
  --glass-nav: rgba(15, 15, 24, 0.97);
  --glass-drawer: rgba(10, 10, 18, 0.98);
  --glass-panel: rgba(12, 12, 20, 0.98);

  /* Chart internals */
  --chart-grid-stroke: rgba(93, 102, 132, 0.45);
}

/* ─── LIGHT THEME ─────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-elevated: #f8f8fc;
  --card: #ffffff;
  --card-hi: #f4f4f9;
  --border: #dcdce8;
  --border-hi: #0079a0;
  --text: #08080f;
  --text-lo: #52527a;
  --text-dim: #7070a0;
  --teal: #0080a8;
  --teal-mid: #006888;
  --teal-dim: #e0f5fb;
  --teal-glow: rgba(0, 128, 168, 0.12);
  --teal-on: #ffffff;
  --red: #c8163a;
  --red-dim: #fce8ec;
  --red-glow: rgba(200, 22, 58, 0.1);
  --warn: #966000;
  --warn-dim: #fef3e0;
  --green: #187840;
  --green-dim: #e8f7ee;
  --blue: #1460c8;
  --blue-dim: #e8f0fc;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.09);

  --glass-card: rgba(255, 255, 255, 0.97);
  --glass-nav: rgba(255, 255, 255, 0.97);
  --glass-drawer: rgba(250, 250, 255, 0.99);
  --glass-panel: rgba(250, 250, 255, 0.99);
  --chart-grid-stroke: rgba(100, 100, 150, 0.28);
}

[data-theme="light"] body {
  background: var(--bg);
}

[data-theme="light"] .topbar {
  background: linear-gradient(180deg, rgba(242, 242, 247, 0.97), rgba(242, 242, 247, 0.88));
  border-bottom-color: rgba(200, 200, 220, 0.7);
}

[data-theme="light"] .list-button,
[data-theme="light"] .primary-button {
  color: var(--teal-on);
}

[data-theme="light"] .mode-switch-button.active-fill {
  color: var(--teal-on);
}

/* ─────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(0, 194, 232, 0.07), transparent 20%), var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  height: 100%;
}

.app-shell {
  height: 100%;
  position: relative;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(9, 9, 16, 0.96), rgba(9, 9, 16, 0.82));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(36, 36, 58, 0.75);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.hamburger {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}

.hamburger-lines {
  width: 18px;
  display: grid;
  gap: 4px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-lockup.centered {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

.brand-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1.4px;
  color: var(--teal);
  line-height: 1;
}

.brand-title span {
  color: var(--text-lo);
  font-weight: 300;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.mode-chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--surface);
  color: var(--text-lo);
}

.mode-chip.team {
  border-color: var(--teal-mid);
  color: var(--teal);
  background: var(--teal-dim);
}

.hero-tile {
  width: 100%;
  text-align: left;
  color: inherit;
  border: 1px solid var(--border);
}

.hero-tile:disabled {
  cursor: default;
}

.tile-hint {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-lo);
}

.screen-stack {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--club-bar-height));
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: none;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 28px;
}

.stack-gap {
  display: grid;
  gap: 12px;
}

.section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--text-lo);
  margin: 20px 2px 8px;
}

.hero-card,
.card,
.panel,
.drawer,
.detail-panel,
.action-sheet {
  background: var(--glass-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero-card,
.card,
.panel {
  border-radius: var(--r-lg);
}

.hero-card {
  padding: 20px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.kpi-block {
  padding: 14px 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}

.kpi-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--teal);
}

.kpi-value.red {
  color: var(--red);
}

.kpi-value.blue {
  color: var(--blue);
}

.kpi-value.green {
  color: var(--green);
}

.kpi-value.warn {
  color: var(--warn);
}

.kpi-label {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}

.split-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.score-home,
.score-away {
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -2px;
}

.score-home {
  color: var(--teal);
  font-size: 52px;
  font-weight: 900;
}

.score-away {
  color: var(--red);
  font-size: 52px;
  font-weight: 900;
}

.score-separator {
  font-size: 30px;
  color: var(--text-dim);
  font-weight: 300;
}

.card {
  padding: 16px 18px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.muted {
  color: var(--text-lo);
}

.tiny {
  font-size: 11px;
}

.team-name {
  font-size: 16px;
  font-weight: 800;
}

.badge {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge.win {
  background: var(--green-dim);
  color: var(--green);
}

.badge.loss {
  background: var(--red-dim);
  color: var(--red);
}

.badge.draw {
  background: var(--warn-dim);
  color: var(--warn);
}

.badge.live {
  background: var(--teal-dim);
  color: var(--teal);
}

.badge.neutral {
  background: var(--card);
  color: var(--text-lo);
  border: 1px solid var(--border);
}

.form-strip {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.form-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 11px;
}

.form-dot.W {
  background: var(--green-dim);
  color: var(--green);
}

.form-dot.D {
  background: var(--warn-dim);
  color: var(--warn);
}

.form-dot.L {
  background: var(--red-dim);
  color: var(--red);
}

.segmented {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.segmented-fixed button {
  flex: 1;
}

.segmented button,
.filter-pill {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-lo);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
}

.segmented button.active,
.filter-pill.active {
  background: var(--teal-dim);
  color: var(--teal);
  border-color: var(--teal-mid);
}

.list-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.list-card-button {
  width: 100%;
  text-align: left;
  color: inherit;
}

.list-card.live {
  background: var(--teal-dim);
  border-color: var(--teal-mid);
}

.date-badge {
  min-width: 60px;
  text-align: center;
}

.date-day {
  font-size: 22px;
  font-weight: 900;
}

.date-rest {
  font-size: 10px;
  color: var(--text-lo);
}

.list-main {
  flex: 1;
}

.list-title {
  font-size: 15px;
  font-weight: 800;
}

.list-meta {
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 3px;
}

.list-button,
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: var(--r-md);
  font-weight: 800;
  border: none;
}

.list-button,
.primary-button {
  background: var(--teal);
  color: var(--teal-on);
}

.list-button {
  padding: 11px 16px;
  white-space: nowrap;
}

.secondary-button {
  background: var(--card);
  border: 1px solid var(--teal-mid);
  color: var(--teal);
  padding: 11px 16px;
}

.ghost-button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-lo);
  padding: 12px 16px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--nav-height);
  border-top: 1px solid var(--border);
  background: var(--glass-nav);
  display: flex;
  z-index: 60;
  backdrop-filter: blur(18px);
}

.nav-item,
.nav-live {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.nav-item.active {
  color: var(--teal-on);
}

.nav-live.active {
  color: var(--teal-on);
}

.nav-pill {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  border-radius: 14px;
  background: var(--teal);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}

.nav-icon {
  font-size: 19px;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.nav-live-circle {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  display: block;
  position: static;
  box-shadow: none;
}

.nav-live-circle span {
  font-size: 19px;
  position: static;
}

.nav-live-label {
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.nav-live.active .nav-live-label {
  color: var(--teal-on);
}

.overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 80;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(84vw, 360px);
  z-index: 81;
  padding: 22px 18px 24px;
  border-right: 1px solid var(--border);
  background: var(--glass-drawer);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-switch-button {
  min-height: 52px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.mode-switch-button.active-fill {
  background: var(--teal);
  color: var(--teal-on);
  border: 1px solid var(--teal);
}

.mode-switch-button.active-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--teal);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.6px;
}

.drawer-close {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-lo);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-row,
.team-row,
.player-check,
.game-check {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.drawer-row {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  color: var(--text);
}

.drawer-row.secondary {
  color: var(--text-lo);
}

.team-row {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.team-row.active {
  border-color: var(--teal-mid);
  background: var(--teal-dim);
}

.drawer-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-lo);
}

.drawer-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
}

.settings-link {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-lo);
  font-size: 18px;
}

.detail-panel,
.action-sheet {
  position: fixed;
  inset: calc(var(--header-height) + 8px) 10px calc(var(--nav-height) + 10px);
  z-index: 70;
  border-radius: 28px;
  background: var(--glass-panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.detail-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.back-link {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  flex: 0 0 auto;
  font-size: 17px;
}

.detail-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -1px;
}

.detail-sub {
  font-size: 12px;
  color: var(--text-lo);
  margin-top: 6px;
}

.detail-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-lo);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 28px;
}

.tabs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tabs-row button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-lo);
  padding: 9px 16px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.tabs-row button.active {
  border-color: var(--teal-mid);
  color: var(--teal);
  background: var(--teal-dim);
}

.feed-list {
  display: grid;
  gap: 8px;
}

.feed-item {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: start;
}

.feed-item.goal {
  border-left: 3px solid var(--teal);
}

.feed-item.defense {
  border-left: 3px solid var(--blue);
}

.feed-item.negative {
  border-left: 3px solid var(--red);
}

.feed-minute {
  color: var(--teal);
  font-weight: 800;
  font-size: 11px;
}

.feed-title {
  font-size: 13px;
  font-weight: 700;
}

.feed-detail {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-lo);
}

.feed-score {
  font-size: 12px;
  color: var(--text-lo);
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 10px;
  text-align: center;
}

.metric-value {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.metric-group-title {
  margin: 14px 2px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-lo);
}

.chart-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
}

.chart-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-lo);
  margin-bottom: 10px;
}

.chart-wrap {
  display: grid;
  gap: 6px;
}

.chart-axis-label {
  font-size: 10px;
  color: var(--text-dim);
}

.chart-axis-label.axis-y {
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.chart-axis-label.axis-x {
  text-align: right;
}

.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-lo);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.home,
.legend-dot.single {
  background: var(--teal);
}

.legend-dot.away {
  background: var(--red);
}

.chart-svg {
  width: 100%;
  height: auto;
}

.chart-axis,
.chart-grid {
  stroke: var(--chart-grid-stroke);
  stroke-width: 1;
}

.chart-grid {
  stroke-dasharray: 3 4;
}

.chart-axis-text {
  fill: var(--text-dim);
  font-size: 10px;
  font-family: "Inter", sans-serif;
}

.chart-line-home,
.chart-line-away {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-home {
  stroke: var(--teal);
}

.chart-line-away {
  stroke: var(--red);
}

.chart-empty,
.empty-state {
  color: var(--text-lo);
  font-size: 13px;
  line-height: 1.5;
}

.filters-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-lo);
}

.filter-field select,
.filter-field input {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 12px 14px;
}

.checkbox-list {
  display: grid;
  gap: 8px;
}

.game-check,
.player-check {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-main {
  flex: 1;
}

.check-main strong {
  display: block;
  font-size: 13px;
}

.check-main span {
  display: block;
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 2px;
}

.search-bar {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 14px 16px;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.player-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 12px;
  text-align: center;
}

.player-card.gk {
  background: var(--blue-dim);
}

.player-card-number {
  font-size: 30px;
  font-weight: 900;
  color: var(--teal);
  line-height: 1;
}

.player-card.gk .player-card-number {
  color: var(--blue);
}

.player-card-name {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.player-card-sub {
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-lo);
}

.player-divider {
  margin: 8px 0 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-lo);
}

.roster-grid {
  display: grid;
  gap: 8px;
}

.roster-row {
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-row.inactive {
  opacity: 0.45;
}

.roster-row.gk {
  background: var(--blue-dim);
}

.roster-number {
  min-width: 36px;
  font-size: 20px;
  font-weight: 900;
  color: var(--teal);
}

.roster-number.gk {
  color: var(--blue);
}

.roster-meta {
  flex: 1;
}

.roster-meta strong {
  display: block;
}

.roster-meta span {
  display: block;
  margin-top: 2px;
  color: var(--text-lo);
  font-size: 11px;
}

.club-footer {
  margin-top: 6px;
  padding-bottom: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.4px;
}

.club-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--nav-height);
  height: var(--club-bar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--glass-nav);
  border-top: 1px solid rgba(36, 36, 58, 0.6);
  z-index: 59;
  backdrop-filter: blur(18px);
}

.upload-card {
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: var(--surface);
  padding: 14px;
}

.upload-card input {
  width: 100%;
}

.mini-button {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 12px;
}

.mini-button.remove {
  color: var(--red);
  font-size: 18px;
  line-height: 1;
}

.ticker-layout {
  display: grid;
  gap: 14px;
}

.scoreboard-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 18px;
  color: var(--text);
}

.scoreboard-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scoreboard-label {
  font-size: 11px;
  color: var(--text-lo);
}

.scoreboard-names {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.scoreboard-names strong {
  font-size: 13px;
}

.ticker-actions {
  display: grid;
  gap: 18px;
}

.tree-entry {
  width: 100%;
  text-align: left;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 18px;
  display: grid;
  gap: 4px;
  color: var(--text);
}

.tree-entry.attack {
  border-color: rgba(0, 194, 232, 0.22);
}

.tree-entry.defense {
  border-color: rgba(79, 136, 242, 0.22);
}

.tree-entry-label {
  font-size: 18px;
  font-weight: 900;
}

.tree-entry-sub {
  font-size: 12px;
  color: var(--text-lo);
  line-height: 1.5;
}

.ticker-section {
  display: grid;
  gap: 10px;
}

.ticker-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-lo);
}

.ticker-section.attack {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.action-button {
  min-height: 70px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 8px;
  font-weight: 700;
}

.action-button.attack {
  border-color: rgba(0, 194, 232, 0.16);
}

.action-button.defense {
  border-color: rgba(79, 136, 242, 0.18);
}

.action-sheet {
  padding: 18px;
  gap: 14px;
  color: var(--text);
}

.tree-options {
  display: grid;
  gap: 10px;
}

.tree-option {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 16px;
  color: var(--text);
}

.tree-option-title {
  font-size: 15px;
  font-weight: 800;
}

.sheet-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.8px;
}

.sheet-sub {
  font-size: 12px;
  color: var(--text-lo);
  line-height: 1.5;
}

.sheet-player-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sheet-player {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 8px;
  text-align: center;
}

.sheet-player-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--teal);
}

.sheet-player.gk .sheet-player-number {
  color: var(--blue);
}

.sheet-player-name {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text);
}

.sheet-player.optional-skip .sheet-player-number {
  color: var(--text-lo);
}

.sheet-notes {
  min-height: 88px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 12px 14px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.sheet-actions button {
  flex: 1;
  padding: 14px;
}

.games-panel {
  min-height: 420px;
  align-content: start;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.season-tile {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  text-align: left;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.season-tile.active {
  border-color: var(--teal-mid);
  background: linear-gradient(180deg, rgba(4, 26, 34, 0.95), rgba(15, 15, 24, 0.96));
}

.season-tile-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.season-tile-title {
  font-size: 14px;
  font-weight: 800;
}

.season-tile-sub {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-lo);
}

.team-management {
  display: grid;
  gap: 12px;
}

.team-management-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.note-card {
  border-radius: var(--r-lg);
  border: 1px dashed var(--border);
  padding: 14px;
  color: var(--text-lo);
  line-height: 1.5;
}

input[type="checkbox"] {
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
}

/* ─── STATS SUB-NAVIGATION ──────────────────────────────── */
.stats-subnav {
  display: flex;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
  background: var(--glass-card);
  flex-shrink: 0;
}

.stats-tab {
  flex: 1;
  padding: 14px 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  letter-spacing: 0.3px;
}

.stats-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* ─── STATS PLAYER ROW ───────────────────────────────────── */
.stat-player-row {
  width: 100%;
  text-align: left;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.stat-player-row.gk {
  background: var(--blue-dim);
}

.stat-player-number {
  font-size: 20px;
  font-weight: 900;
  color: var(--teal);
  min-width: 32px;
  line-height: 1;
}

.stat-player-number.gk {
  color: var(--blue);
}

.stat-player-info {
  flex: 1;
  min-width: 0;
}

.stat-player-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-player-pos {
  font-size: 11px;
  color: var(--text-lo);
  margin-top: 2px;
}

.stat-player-vals {
  font-size: 12px;
  color: var(--text-lo);
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── ONBOARDING ─────────────────────────────────────────── */
.onboarding-shell {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.onboarding-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.onboarding-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.splash-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.splash-logo {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -2.5px;
  color: var(--teal);
  line-height: 1;
}

.splash-logo span {
  color: var(--text-lo);
  font-weight: 300;
}

.splash-sub {
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.onboarding-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 20px 16px;
  overflow-y: auto;
}

.onboarding-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}

.onboarding-sub {
  font-size: 14px;
  color: var(--text-lo);
  line-height: 1.6;
  margin-top: -8px;
}

.onboarding-footer {
  padding: 12px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.onboarding-cta {
  padding: 17px;
  border-radius: var(--r-lg);
  font-size: 16px;
  width: 100%;
  text-align: center;
}

.onboarding-option {
  width: 100%;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.onboarding-option.selected {
  border-color: var(--teal-mid);
  background: var(--teal-dim);
}

.onboarding-option-title {
  font-size: 16px;
  font-weight: 800;
}

.onboarding-option-sub {
  font-size: 12px;
  color: var(--text-lo);
  margin-top: 4px;
  line-height: 1.4;
}

/* ─── LIGHT THEME: season-tile override ────────────────── */
[data-theme="light"] .season-tile.active {
  background: linear-gradient(180deg, rgba(224, 245, 251, 0.95), rgba(255, 255, 255, 0.96));
}

/* ─── THEME TOGGLE SWITCH ───────────────────────────────── */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
  padding: 0;
  flex-shrink: 0;
  transition: background 0.22s, border-color 0.22s;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s;
}

.theme-toggle.light {
  background: var(--teal-dim);
  border-color: var(--teal-mid);
}

.theme-toggle.light::after {
  transform: translateX(22px);
  background: var(--teal);
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ─── FOCUS VISIBLE ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ─── REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ─── STAT ROW ───────────────────────────────────────────── */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row-label {
  font-size: 13px;
  color: var(--text-lo);
}

.stat-row-value {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ─── TICKER ACTION GRID ─────────────────────────────────── */
.ticker-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 200px;
}

.ticker-cat-btn {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  min-height: 88px;
  text-align: left;
}

.ticker-cat-btn.attack {
  border-color: rgba(0, 194, 232, 0.28);
  background: rgba(0, 194, 232, 0.06);
}

.ticker-cat-btn.defense {
  border-color: rgba(61, 142, 255, 0.28);
  background: rgba(61, 142, 255, 0.06);
}

.ticker-cat-btn.sanction {
  border-color: rgba(255, 45, 82, 0.28);
  background: rgba(255, 45, 82, 0.06);
}

.ticker-cat-btn.warn {
  border-color: rgba(217, 162, 47, 0.28);
  background: rgba(217, 162, 47, 0.06);
}

.ticker-cat-btn.fastbreak {
  border-color: rgba(53, 194, 111, 0.28);
  background: rgba(53, 194, 111, 0.06);
}

.ticker-cat-label {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.ticker-cat-sub {
  font-size: 10px;
  color: var(--text-lo);
  line-height: 1.3;
}

/* ─── SPLASH ANIMATION ───────────────────────────────────── */
@keyframes hv-fadein {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 380px) {
  .kpi-grid,
  .metrics-grid,
  .action-grid,
  .sheet-player-grid,
  .players-grid,
  .season-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
