
/* ─── DESIGN SYSTEM ─────────────────────────────────────────── */
:root {
  --pitch:        #0a1a0f;
  --pitch-mid:    #0f2318;
  --pitch-light:  #163320;
  --line:         #1e4a2a;
  --line-bright:  #2a6438;
  --turf:         #1a3d24;
  --accent:       #00e676;
  --accent-dim:   #00c853;
  --accent-glow:  rgba(0,230,118,0.15);
  --accent-pulse: rgba(0,230,118,0.08);
  --white:        #f0f7f2;
  --white-dim:    #8aad96;
  --red:          #ff3d57;
  --gold:         #ffd740;
  --text:         #c8e6c9;
  --text-dim:     #557a5e;

  --radius:       4px;
  --radius-lg:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.6);
  --shadow-green: 0 0 20px rgba(0,230,118,0.2);
  --transition:   0.18s cubic-bezier(0.4,0,0.2,1);

  --font-head:    'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--pitch);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle pitch-line texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.012) 60px,
      rgba(255,255,255,0.012) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.008) 60px,
      rgba(255,255,255,0.008) 61px
    );
  pointer-events: none;
  z-index: 0;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--pitch); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }

/* ─── HEADER ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,26,15,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-green);
  animation: pulse-logo 3s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-logo {
  0%, 100% { box-shadow: 0 0 10px rgba(0,230,118,0.3); }
  50% { box-shadow: 0 0 24px rgba(0,230,118,0.6); }
}

.logo-text {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--white);
  text-transform: uppercase;
}

.logo-text span { color: var(--accent); }

.header-tag {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: var(--radius);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.btn-admin {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-admin:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-pulse);
}

/* ─── HERO STRIP ─────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--pitch-mid) 0%, transparent 100%);
}

.hero-eyebrow {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: var(--white);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
}

.hero-sub {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--white-dim);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* ─── STATS BAR ─────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--line);
}

/* ─── MAIN LAYOUT ────────────────────────────────────────────── */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 64px - 180px);
}

/* ─── SIDEBAR / FILTERS ──────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--pitch-mid);
  padding: 1.5rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-section h3 {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* Search */
.search-wrap {
  position: relative;
}

.search-wrap input {
  width: 100%;
  background: var(--pitch-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px 10px 36px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--white);
  outline: none;
  transition: border-color var(--transition);
}

.search-wrap input::placeholder { color: var(--text-dim); }

.search-wrap input:focus {
  border-color: var(--accent);
  background: var(--turf);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

/* Filter chips */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  font-size: 0.875rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
}

.filter-chip:hover {
  background: var(--pitch-light);
  border-color: var(--line);
}

.filter-chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip .chip-count {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--pitch);
  padding: 1px 7px;
  border-radius: 99px;
}

.filter-chip.active .chip-count {
  background: var(--accent);
  color: var(--pitch);
}

/* Reset button */
.btn-reset {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-reset:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ─── MAIN CONTENT ────────────────────────────────────────────── */
.main-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ─── PLAYER AREA ─────────────────────────────────────────────── */
.player-area {
  background: var(--pitch-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: none;
}

.player-area.visible { display: block; }

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--pitch-light);
  gap: 1rem;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.player-votes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-channel-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 3px;
  background: var(--pitch);
}

.player-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  text-transform: uppercase;
}

.player-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.btn-close-player {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-close-player:hover { color: var(--red); border-color: var(--red); }

.player-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.player-viewport video,
.player-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  font-family: var(--font-head);
}

.player-placeholder .icon { font-size: 3rem; opacity: 0.4; }
.player-placeholder p { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ─── STREAM GRID TOOLBAR ──────────────────────────────────────── */
.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-count {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.results-count span { color: var(--accent); }

.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.active-filter-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 99px;
}

.active-filter-tag button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
}

/* ─── STREAM GRID ─────────────────────────────────────────────── */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ─── STREAM CARD ─────────────────────────────────────────────── */
.stream-card {
  background: var(--pitch-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  animation: card-in 0.3s ease both;
  position: relative;
  display: flex;
  flex-direction: column;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stream-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), var(--shadow-green);
}

.stream-card.playing {
  border-color: var(--accent);
  box-shadow: var(--shadow-green);
}

.stream-card.playing::before {
  content: 'NOW PLAYING';
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--pitch);
  background: var(--accent);
  padding: 3px 7px;
  border-radius: 3px;
  z-index: 2;
}

.card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;  /* clips logo, play button, health badge within thumb */
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;  /* top corners match card */
  background: var(--pitch-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-thumb-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--pitch-light), var(--turf));
}

/* Pitch lines decoration in card */
.card-thumb-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0,230,118,0.07) 0%, transparent 70%);
}

.card-logo {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.card-logo-placeholder {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  opacity: 0.4;
}

.card-play-btn {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  background: rgba(0,0,0,0.5);
}

.card-play-btn .play-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pitch);
  font-size: 1.1rem;
  box-shadow: 0 0 24px rgba(0,230,118,0.5);
  transition: transform var(--transition);
}

.stream-card:hover .card-play-btn { opacity: 1; }
.stream-card:hover .play-icon { transform: scale(1.1); }

.card-body {
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;  /* grow to fill card height */
}

.card-league {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 4px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--white-dim);
  line-height: 1.4;
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
}

.tag-default {
  background: var(--pitch-light);
  color: var(--text-dim);
  border: 1px solid var(--line);
}

.tag-hd { background: rgba(0,230,118,0.1); color: var(--accent); border: 1px solid rgba(0,230,118,0.3); }
.tag-live { background: rgba(255,61,87,0.1); color: var(--red); border: 1px solid rgba(255,61,87,0.3); }

.card-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.card-offline {
  position: absolute;
  inset: 0;
  background: rgba(10,26,15,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  z-index: 3;
}

/* ─── EMPTY STATE ──────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }

.empty-state h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white-dim);
  margin-bottom: 0.5rem;
}

.empty-state p { font-size: 0.875rem; }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: var(--pitch-mid);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-logo {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--white-dim);
  text-transform: uppercase;
}

.footer-logo span { color: var(--accent); }

.footer-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  max-width: 500px;
  text-align: center;
  line-height: 1.5;
}

.footer-version {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ─── TOAST NOTIFICATIONS ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  background: var(--pitch-mid);
  color: var(--white);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease;
  max-width: 280px;
}

.toast.error { border-left-color: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── ADMIN MODAL OVERLAY ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--pitch-mid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.modal h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.modal h2 span { color: var(--accent); }

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: var(--pitch-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--white);
  outline: none;
  transition: border-color var(--transition);
}

.form-group input:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-primary {
  flex: 1;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: var(--pitch);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover { background: var(--accent-dim); }

.btn-secondary {
  padding: 11px 18px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover { color: var(--red); border-color: var(--red); }

/* ─── ADMIN PANEL ─────────────────────────────────────────────── */
.admin-panel {
  display: none;
  padding: 1.5rem;
  background: var(--pitch-mid);
  border-bottom: 1px solid var(--line);
}

.admin-panel.open { display: block; }

.admin-panel h2 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1rem;
}

.admin-panel h2 span { color: var(--accent); }

.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1rem;
}

.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.stream-table-wrap {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stream-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.stream-table th {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--pitch-light);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.stream-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.stream-table tr:last-child td { border-bottom: none; }
.stream-table tr:hover td { background: var(--pitch-light); }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.on { background: var(--accent); }
.status-dot.off { background: var(--red); }

.btn-sm {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: transparent;
}

.btn-sm-danger { color: var(--red); border-color: var(--red); }
.btn-sm-danger:hover { background: rgba(255,61,87,0.1); }
.btn-sm-toggle { color: var(--text-dim); border-color: var(--line); }
.btn-sm-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 600px) {
  .site-header { padding: 0 1rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .main-content { padding: 1rem; }
  .sidebar { padding: 1rem; }
  .header-tag { display: none; }
  .stats-bar { gap: 1.5rem; }
}

/* ─── HEALTH BADGES (added by health.js) ────────────────────── */
.health-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-head);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px 2px 5px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
}

.health-badge.health-ok   { background: rgba(0,230,118,0.2); color: var(--accent); border: 1px solid rgba(0,230,118,0.4); }
.health-badge.health-dead { background: rgba(255,61,87,0.2);  color: var(--red);    border: 1px solid rgba(255,61,87,0.4); }
.health-badge.health-geo  { background: rgba(255,215,64,0.2); color: var(--gold);   border: 1px solid rgba(255,215,64,0.4); }

.health-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot-ok   { background: var(--accent); animation: blink 2s ease-in-out infinite; }
.health-dot-dead { background: var(--red); }
.health-dot-geo  { background: var(--gold); }

/* Last-checked time in card footer */
.health-time {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  cursor: help;
}

/* Health summary in header */
.health-summary {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: help;
}

.health-summary-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.health-summary-dot.ok   { background: var(--accent); }
.health-summary-dot.warn { background: var(--gold); }

/* ═══════════════════════════════════════════════════════════════
   THEMES
   Applied via data-theme attribute on <html> element.
   Each theme overrides :root CSS variables + body font imports.
   Default (Pitch) theme is :root above — no data-theme needed.
   ═══════════════════════════════════════════════════════════════ */

/* ── THEME: ULTRAS ────────────────────────────────────────────
   Brutalist black & red. Raw fanzine energy. Zero compromise.
   Font: Bebas Neue (display) + Source Serif 4 (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="ultras"] {
  --pitch:        #0a0a0a;
  --pitch-mid:    #111111;
  --pitch-light:  #1a1a1a;
  --line:         #2a2a2a;
  --line-bright:  #3d0000;
  --turf:         #1f0000;
  --accent:       #e50000;
  --accent-dim:   #b50000;
  --accent-glow:  rgba(229,0,0,0.15);
  --accent-pulse: rgba(229,0,0,0.08);
  --white:        #f5f0f0;
  --white-dim:    #9a8585;
  --red:          #ff6b6b;
  --gold:         #ff9500;
  --text:         #d4c4c4;
  --text-dim:     #5a4545;
  --shadow-green: 0 0 20px rgba(229,0,0,0.25);
  --font-head:    'Bebas Neue', 'Barlow Condensed', sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
}

/* Ultras: replace pitch grid with diagonal hatch */
[data-theme="ultras"] body::before {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 18px,
      rgba(229,0,0,0.04) 18px,
      rgba(229,0,0,0.04) 19px
    );
}

[data-theme="ultras"] .logo-icon {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(229,0,0,0.5);
  border-radius: 2px; /* square badge, not circle */
}

[data-theme="ultras"] .live-dot { background: var(--accent); }

[data-theme="ultras"] .stream-card:hover,
[data-theme="ultras"] .stream-card.playing {
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 20px rgba(229,0,0,0.3);
}

[data-theme="ultras"] .card-play-btn .play-icon {
  background: var(--accent);
  box-shadow: 0 0 24px rgba(229,0,0,0.6);
  border-radius: 2px;
}

/* ── THEME: RETRO ─────────────────────────────────────────────
   1980s Teletext / Ceefax. Chunky pixels. BBC2 Grandstand vibes.
   Font: VT323 (display) + IBM Plex Mono (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="retro"] {
  --pitch:        #000000;
  --pitch-mid:    #000080;  /* classic Teletext navy */
  --pitch-light:  #0000aa;
  --line:         #0000cc;
  --line-bright:  #4444ff;
  --turf:         #000066;
  --accent:       #00ff00;  /* Teletext green */
  --accent-dim:   #00cc00;
  --accent-glow:  rgba(0,255,0,0.15);
  --accent-pulse: rgba(0,255,0,0.08);
  --white:        #ffffff;
  --white-dim:    #aaaaaa;
  --red:          #ff0000;
  --gold:         #ffff00;
  --text:         #ffffff;
  --text-dim:     #8888cc;
  --shadow-green: 0 0 12px rgba(0,255,0,0.4);
  --radius:       0px;      /* No border radius — pixel-perfect */
  --radius-lg:    0px;
  --font-head:    'VT323', 'Courier New', monospace;
  --font-body:    'IBM Plex Mono', 'Courier New', monospace;
}

/* Retro: scanline effect */
[data-theme="retro"] body::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.15) 2px,
      rgba(0,0,0,0.15) 4px
    );
  pointer-events: none;
  z-index: 10;
}

[data-theme="retro"] .site-header {
  background: #000080;
  border-bottom: 3px solid var(--accent);
  image-rendering: pixelated;
}

[data-theme="retro"] .logo-icon {
  background: var(--accent);
  color: #000;
  border-radius: 0;
  font-size: 0.9rem;
  box-shadow: none;
  animation: none;
  border: 2px solid #fff;
}

[data-theme="retro"] .logo-text {
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 var(--accent);
}

[data-theme="retro"] .stream-card {
  border: 2px solid var(--line-bright);
  border-radius: 0;
}

[data-theme="retro"] .stream-card:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: 4px 4px 0 var(--accent);
}

[data-theme="retro"] .card-thumb-bg {
  background: #000080;
}

[data-theme="retro"] .card-play-btn .play-icon {
  border-radius: 0;
  background: var(--accent);
  color: #000;
  box-shadow: none;
  font-size: 1.2rem;
}

[data-theme="retro"] .filter-chip {
  border-radius: 0;
  border: 1px solid var(--line-bright);
}

[data-theme="retro"] .filter-chip.active {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

[data-theme="retro"] .btn-primary {
  border-radius: 0;
  letter-spacing: 0.12em;
  background: var(--accent);
  color: #000;
}

[data-theme="retro"] .hero {
  background: linear-gradient(180deg, #000080 0%, #000000 100%);
}

[data-theme="retro"] .hero h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  text-shadow: 3px 3px 0 var(--accent);
  letter-spacing: 0.06em;
}

[data-theme="retro"] .stat-num {
  text-shadow: 2px 2px 0 var(--accent);
}

/* ── THEME: CLASICO ───────────────────────────────────────────
   Luxury editorial. Cream, gold, and near-black.
   Match programme meets high-fashion magazine.
   Font: Playfair Display (display) + Lato (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="clasico"] {
  --pitch:        #0e0c09;
  --pitch-mid:    #141209;
  --pitch-light:  #1c1810;
  --line:         #2a2418;
  --line-bright:  #3d3420;
  --turf:         #181408;
  --accent:       #c9a84c;  /* burnished gold */
  --accent-dim:   #a88a3a;
  --accent-glow:  rgba(201,168,76,0.12);
  --accent-pulse: rgba(201,168,76,0.06);
  --white:        #f5f0e8;  /* warm cream */
  --white-dim:    #8a7d65;
  --red:          #c0392b;
  --gold:         #c9a84c;
  --text:         #d4c8b0;
  --text-dim:     #4a3f2a;
  --shadow-green: 0 0 24px rgba(201,168,76,0.15);
  --font-head:    'Playfair Display', Georgia, serif;
  --font-body:    'Lato', 'Barlow', sans-serif;
}

/* Clasico: subtle damask-like diamond pattern */
[data-theme="clasico"] body::before {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 24px,
      rgba(201,168,76,0.03) 24px,
      rgba(201,168,76,0.03) 25px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 24px,
      rgba(201,168,76,0.03) 24px,
      rgba(201,168,76,0.03) 25px
    );
}

[data-theme="clasico"] .logo-icon {
  background: transparent;
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px rgba(201,168,76,0.3);
  animation: pulse-gold 4s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.2); }
  50%       { box-shadow: 0 0 24px rgba(201,168,76,0.5); }
}

[data-theme="clasico"] .logo-text { letter-spacing: 0.08em; }

[data-theme="clasico"] .hero h1 {
  font-style: italic;
  letter-spacing: 0.01em;
  font-weight: 700;
}

[data-theme="clasico"] .hero h1 em {
  font-style: normal;
  color: var(--accent);
  font-weight: 900;
}

[data-theme="clasico"] .card-title {
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

[data-theme="clasico"] .card-league {
  letter-spacing: 0.2em;
  font-size: 0.65rem;
}

[data-theme="clasico"] .stream-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 24px rgba(201,168,76,0.15);
}

[data-theme="clasico"] .card-play-btn .play-icon {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px rgba(201,168,76,0.4);
}

[data-theme="clasico"] .filter-chip.active {
  background: rgba(201,168,76,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="clasico"] .live-dot { background: var(--accent); }

[data-theme="clasico"] .site-header {
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

[data-theme="clasico"] .hero-eyebrow {
  letter-spacing: 0.3em;
  font-size: 0.65rem;
}

/* ── THEME SWITCHER DROPDOWN ──────────────────────────────── */
.theme-switcher {
  position: relative;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition);
  white-space: nowrap;
}

.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-pulse);
}

.theme-btn .theme-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: background var(--transition);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--pitch-mid);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
  display: none;
  animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.theme-dropdown.open { display: block; }

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.theme-option:hover { background: var(--pitch-light); }
.theme-option.active { background: var(--accent-glow); }

.theme-option-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

.theme-option-info { flex: 1; }

.theme-option-name {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
}

.theme-option-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 1px;
  font-family: var(--font-body);
}

.theme-option.active .theme-option-name { color: var(--accent); }
.theme-option.active::after {
  content: '✓';
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

/* ─── LOADING SPINNER ────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── SORT DROPDOWN ──────────────────────────────────────────── */
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-wrap label {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

#sortSelect {
  background: var(--pitch-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

#sortSelect:focus,
#sortSelect:hover { border-color: var(--accent); }

/* ─── VOTES ──────────────────────────────────────────────────── */
.card-votes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;  /* pushes votes to bottom of card */
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.2;
}

.vote-btn:hover { border-color: var(--accent); color: var(--accent); }

.vote-up.voted  { background: rgba(0,230,118,0.15); border-color: var(--accent); color: var(--accent); }
.vote-down.voted { background: rgba(255,61,87,0.15); border-color: var(--red); color: var(--red); }

.vote-score {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  min-width: 24px;
  text-align: center;
  letter-spacing: 0.04em;
}

.vote-score.pos { color: var(--accent); }
.vote-score.neg { color: var(--red); }

/* ─── STREAM TEST BUTTON ─────────────────────────────────────── */
.card-test-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--white-dim);
  font-size: 0.7rem;
  padding: 3px 7px;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  backdrop-filter: blur(4px);
}

.stream-card:hover .card-test-btn { opacity: 1; }

.card-test-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--pitch);
  border-color: var(--accent);
}

.card-test-btn:disabled {
  opacity: 0.5 !important;
  cursor: wait;
}

/* Test result badge */
.card-test-result {
  position: absolute;
  top: 32px;
  right: 6px;
  z-index: 4;
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  animation: toast-in 0.2s ease;
}

.card-test-result.test-ok   { background: var(--accent); color: var(--pitch); }
.card-test-result.test-fail { background: var(--red); color: #fff; }

/* ─── CONFIRM MODAL ──────────────────────────────────────────── */
#confirmModal .modal { max-width: 360px; }

#confirmMessage {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ─── RETRO THEME VOTE / TEST OVERRIDES ──────────────────────── */
[data-theme="retro"] .vote-btn        { border-radius: 0; }
[data-theme="retro"] .card-test-btn   { border-radius: 0; }
[data-theme="retro"] .card-test-result { border-radius: 0; }

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEMES
   All three share a light-mode base approach: dark text on light
   backgrounds. Scrollbar, body texture, and component overrides
   each get specific treatment per theme.
   ═══════════════════════════════════════════════════════════════ */

/* ── THEME: MATCHDAY ──────────────────────────────────────────
   Matchday programme. Royal blue, crisp white, clean sans-serif.
   Feels like a Premier League away end on a bright Saturday.
   Font: Bebas Neue (display) + Nunito (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="matchday"] {
  --pitch:        #f0f4ff;
  --pitch-mid:    #ffffff;
  --pitch-light:  #e8eeff;
  --line:         #c5d0f0;
  --line-bright:  #93a8e0;
  --turf:         #dce4f8;
  --accent:       #1565c0;
  --accent-dim:   #0d47a1;
  --accent-glow:  rgba(21,101,192,0.12);
  --accent-pulse: rgba(21,101,192,0.06);
  --white:        #0d1b3e;
  --white-dim:    #3a4f7a;
  --red:          #c62828;
  --gold:         #f57f17;
  --text:         #1a2a4a;
  --text-dim:     #6b80b0;
  --shadow-green: 0 0 20px rgba(21,101,192,0.15);
  --font-head:    'Bebas Neue', 'Barlow Condensed', sans-serif;
  --font-body:    'Nunito', 'Barlow', sans-serif;
}

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

[data-theme="matchday"] body::before {
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 40px,
      rgba(21,101,192,0.04) 40px, rgba(21,101,192,0.04) 41px
    ),
    repeating-linear-gradient(
      90deg, transparent, transparent 40px,
      rgba(21,101,192,0.04) 40px, rgba(21,101,192,0.04) 41px
    );
}

[data-theme="matchday"] ::-webkit-scrollbar-track { background: var(--pitch); }
[data-theme="matchday"] ::-webkit-scrollbar-thumb { background: var(--line-bright); }

[data-theme="matchday"] .site-header {
  background: rgba(21,101,192,0.96);
  border-bottom: 2px solid #0d47a1;
}

[data-theme="matchday"] .logo-text,
[data-theme="matchday"] .logo-text span,
[data-theme="matchday"] .header-tag,
[data-theme="matchday"] .live-badge { color: #fff; }

[data-theme="matchday"] .logo-icon {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 0 16px rgba(255,255,255,0.3);
  animation: none;
}

[data-theme="matchday"] .btn-admin {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
[data-theme="matchday"] .btn-admin:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

[data-theme="matchday"] .hero {
  background: linear-gradient(180deg, #e8eeff 0%, transparent 100%);
}

[data-theme="matchday"] .hero h1 { color: var(--white); }
[data-theme="matchday"] .hero h1 em { color: var(--accent); }
[data-theme="matchday"] .hero-eyebrow { color: var(--accent); }
[data-theme="matchday"] .hero-sub { color: var(--white-dim); }
[data-theme="matchday"] .stat-num { color: var(--accent); }
[data-theme="matchday"] .stat-label { color: var(--text-dim); }
[data-theme="matchday"] .stat-divider { background: var(--line); }

[data-theme="matchday"] .sidebar {
  background: #fff;
  border-right-color: var(--line);
}

[data-theme="matchday"] .search-wrap input {
  background: var(--pitch-light);
  color: var(--text);
  border-color: var(--line);
}
[data-theme="matchday"] .search-wrap input:focus { border-color: var(--accent); }

[data-theme="matchday"] .filter-chip { color: var(--text); }
[data-theme="matchday"] .filter-chip:hover { background: var(--pitch-light); border-color: var(--line); }
[data-theme="matchday"] .filter-chip.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
[data-theme="matchday"] .chip-count { background: var(--pitch-light); color: var(--text-dim); }

[data-theme="matchday"] .stream-card { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .stream-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(21,101,192,0.12); }
[data-theme="matchday"] .card-thumb-bg { background: linear-gradient(135deg, #e8eeff, #c5d0f0); }
[data-theme="matchday"] .card-league { color: var(--accent); }
[data-theme="matchday"] .card-title { color: var(--white); }
[data-theme="matchday"] .card-desc { color: var(--white-dim); }
[data-theme="matchday"] .card-votes { border-top-color: var(--line); }
[data-theme="matchday"] .vote-btn { color: var(--text-dim); border-color: var(--line); }

[data-theme="matchday"] .player-area { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .player-header { background: var(--accent); }
[data-theme="matchday"] .player-title { color: #fff; }
[data-theme="matchday"] .player-meta { color: rgba(255,255,255,0.75); }
[data-theme="matchday"] .btn-close-player { color: #fff; border-color: rgba(255,255,255,0.4); }

[data-theme="matchday"] .site-footer { background: #fff; border-top-color: var(--line); }
[data-theme="matchday"] .footer-logo { color: var(--text); }
[data-theme="matchday"] .footer-logo span { color: var(--accent); }
[data-theme="matchday"] .footer-note { color: var(--text-dim); }
[data-theme="matchday"] .footer-version { color: var(--text-dim); }

[data-theme="matchday"] .live-dot { background: #ff5252; }
[data-theme="matchday"] .toast { background: #fff; border-left-color: var(--accent); color: var(--text); }

[data-theme="matchday"] .admin-panel { background: #fff; border-bottom-color: var(--line); }
[data-theme="matchday"] .stream-table th { background: var(--pitch-light); color: var(--text-dim); }
[data-theme="matchday"] .stream-table td { color: var(--text); border-bottom-color: var(--line); }
[data-theme="matchday"] .modal { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .form-group input { background: var(--pitch-light); color: var(--text); border-color: var(--line); }

[data-theme="matchday"] .theme-dropdown { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .theme-option:hover { background: var(--pitch-light); }
[data-theme="matchday"] .theme-option-name { color: var(--white); }
[data-theme="matchday"] #sortSelect { background: var(--pitch-light); color: var(--text); border-color: var(--line); }

/* ── THEME: CLASICO ───────────────────────────────────────────
   Luxury editorial. Cream, gold, and near-black.
   Match programme meets high-fashion magazine.
   Font: Playfair Display (display) + Lato (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="clasico"] {
  --pitch:        #0e0c09;
  --pitch-mid:    #141209;
  --pitch-light:  #1c1810;
  --line:         #2a2418;
  --line-bright:  #3d3420;
  --turf:         #181408;
  --accent:       #c9a84c;  /* burnished gold */
  --accent-dim:   #a88a3a;
  --accent-glow:  rgba(201,168,76,0.12);
  --accent-pulse: rgba(201,168,76,0.06);
  --white:        #f5f0e8;  /* warm cream */
  --white-dim:    #8a7d65;
  --red:          #c0392b;
  --gold:         #c9a84c;
  --text:         #d4c8b0;
  --text-dim:     #4a3f2a;
  --shadow-green: 0 0 24px rgba(201,168,76,0.15);
  --font-head:    'Playfair Display', Georgia, serif;
  --font-body:    'Lato', 'Barlow', sans-serif;
}

/* Clasico: subtle damask-like diamond pattern */
[data-theme="clasico"] body::before {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 24px,
      rgba(201,168,76,0.03) 24px,
      rgba(201,168,76,0.03) 25px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 24px,
      rgba(201,168,76,0.03) 24px,
      rgba(201,168,76,0.03) 25px
    );
}

[data-theme="clasico"] .logo-icon {
  background: transparent;
  border: 2px solid var(--accent);
  box-shadow: 0 0 16px rgba(201,168,76,0.3);
  animation: pulse-gold 4s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.2); }
  50%       { box-shadow: 0 0 24px rgba(201,168,76,0.5); }
}

[data-theme="clasico"] .logo-text { letter-spacing: 0.08em; }

[data-theme="clasico"] .hero h1 {
  font-style: italic;
  letter-spacing: 0.01em;
  font-weight: 700;
}

[data-theme="clasico"] .hero h1 em {
  font-style: normal;
  color: var(--accent);
  font-weight: 900;
}

[data-theme="clasico"] .card-title {
  font-style: italic;
  font-weight: 700;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

[data-theme="clasico"] .card-league {
  letter-spacing: 0.2em;
  font-size: 0.65rem;
}

[data-theme="clasico"] .stream-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 24px rgba(201,168,76,0.15);
}

[data-theme="clasico"] .card-play-btn .play-icon {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 24px rgba(201,168,76,0.4);
}

[data-theme="clasico"] .filter-chip.active {
  background: rgba(201,168,76,0.1);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="clasico"] .live-dot { background: var(--accent); }

[data-theme="clasico"] .site-header {
  border-bottom: 1px solid rgba(201,168,76,0.2);
}

[data-theme="clasico"] .hero-eyebrow {
  letter-spacing: 0.3em;
  font-size: 0.65rem;
}

/* ── THEME SWITCHER DROPDOWN ──────────────────────────────── */
.theme-switcher {
  position: relative;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all var(--transition);
  white-space: nowrap;
}

.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-pulse);
}

.theme-btn .theme-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: background var(--transition);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--pitch-mid);
  border: 1px solid var(--line-bright);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
  display: none;
  animation: dropdown-in 0.15s ease;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.theme-dropdown.open { display: block; }

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.theme-option:hover { background: var(--pitch-light); }
.theme-option.active { background: var(--accent-glow); }

.theme-option-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.15);
}

.theme-option-info { flex: 1; }

.theme-option-name {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.2;
}

.theme-option-desc {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 1px;
  font-family: var(--font-body);
}

.theme-option.active .theme-option-name { color: var(--accent); }
.theme-option.active::after {
  content: '✓';
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

/* ─── LOADING SPINNER ────────────────────────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── SORT DROPDOWN ──────────────────────────────────────────── */
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-wrap label {
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

#sortSelect {
  background: var(--pitch-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

#sortSelect:focus,
#sortSelect:hover { border-color: var(--accent); }

/* ─── VOTES ──────────────────────────────────────────────────── */
.card-votes {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;  /* pushes votes to bottom of card */
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.2;
}

.vote-btn:hover { border-color: var(--accent); color: var(--accent); }

.vote-up.voted  { background: rgba(0,230,118,0.15); border-color: var(--accent); color: var(--accent); }
.vote-down.voted { background: rgba(255,61,87,0.15); border-color: var(--red); color: var(--red); }

.vote-score {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  min-width: 24px;
  text-align: center;
  letter-spacing: 0.04em;
}

.vote-score.pos { color: var(--accent); }
.vote-score.neg { color: var(--red); }

/* ─── STREAM TEST BUTTON ─────────────────────────────────────── */
.card-test-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--white-dim);
  font-size: 0.7rem;
  padding: 3px 7px;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  backdrop-filter: blur(4px);
}

.stream-card:hover .card-test-btn { opacity: 1; }

.card-test-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--pitch);
  border-color: var(--accent);
}

.card-test-btn:disabled {
  opacity: 0.5 !important;
  cursor: wait;
}

/* Test result badge */
.card-test-result {
  position: absolute;
  top: 32px;
  right: 6px;
  z-index: 4;
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  animation: toast-in 0.2s ease;
}

.card-test-result.test-ok   { background: var(--accent); color: var(--pitch); }
.card-test-result.test-fail { background: var(--red); color: #fff; }

/* ─── CONFIRM MODAL ──────────────────────────────────────────── */
#confirmModal .modal { max-width: 360px; }

#confirmMessage {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ─── RETRO THEME VOTE / TEST OVERRIDES ──────────────────────── */
[data-theme="retro"] .vote-btn        { border-radius: 0; }
[data-theme="retro"] .card-test-btn   { border-radius: 0; }
[data-theme="retro"] .card-test-result { border-radius: 0; }

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEMES
   All three share a light-mode base approach: dark text on light
   backgrounds. Scrollbar, body texture, and component overrides
   each get specific treatment per theme.
   ═══════════════════════════════════════════════════════════════ */

/* ── THEME: MATCHDAY ──────────────────────────────────────────
   Matchday programme. Royal blue, crisp white, clean sans-serif.
   Feels like a Premier League away end on a bright Saturday.
   Font: Bebas Neue (display) + Nunito (body)
   ──────────────────────────────────────────────────────────── */
[data-theme="matchday"] {
  --pitch:        #f0f4ff;
  --pitch-mid:    #ffffff;
  --pitch-light:  #e8eeff;
  --line:         #c5d0f0;
  --line-bright:  #93a8e0;
  --turf:         #dce4f8;
  --accent:       #1565c0;
  --accent-dim:   #0d47a1;
  --accent-glow:  rgba(21,101,192,0.12);
  --accent-pulse: rgba(21,101,192,0.06);
  --white:        #0d1b3e;
  --white-dim:    #3a4f7a;
  --red:          #c62828;
  --gold:         #f57f17;
  --text:         #1a2a4a;
  --text-dim:     #6b80b0;
  --shadow-green: 0 0 20px rgba(21,101,192,0.15);
  --font-head:    'Bebas Neue', 'Barlow Condensed', sans-serif;
  --font-body:    'Nunito', 'Barlow', sans-serif;
}

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

[data-theme="matchday"] body::before {
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 40px,
      rgba(21,101,192,0.04) 40px, rgba(21,101,192,0.04) 41px
    ),
    repeating-linear-gradient(
      90deg, transparent, transparent 40px,
      rgba(21,101,192,0.04) 40px, rgba(21,101,192,0.04) 41px
    );
}

[data-theme="matchday"] ::-webkit-scrollbar-track { background: var(--pitch); }
[data-theme="matchday"] ::-webkit-scrollbar-thumb { background: var(--line-bright); }

[data-theme="matchday"] .site-header {
  background: rgba(21,101,192,0.96);
  border-bottom: 2px solid #0d47a1;
}

[data-theme="matchday"] .logo-text,
[data-theme="matchday"] .logo-text span,
[data-theme="matchday"] .header-tag,
[data-theme="matchday"] .live-badge { color: #fff; }

[data-theme="matchday"] .logo-icon {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 0 16px rgba(255,255,255,0.3);
  animation: none;
}

[data-theme="matchday"] .btn-admin {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
[data-theme="matchday"] .btn-admin:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

[data-theme="matchday"] .hero {
  background: linear-gradient(180deg, #e8eeff 0%, transparent 100%);
}

[data-theme="matchday"] .hero h1 { color: var(--white); }
[data-theme="matchday"] .hero h1 em { color: var(--accent); }
[data-theme="matchday"] .hero-eyebrow { color: var(--accent); }
[data-theme="matchday"] .hero-sub { color: var(--white-dim); }
[data-theme="matchday"] .stat-num { color: var(--accent); }
[data-theme="matchday"] .stat-label { color: var(--text-dim); }
[data-theme="matchday"] .stat-divider { background: var(--line); }

[data-theme="matchday"] .sidebar {
  background: #fff;
  border-right-color: var(--line);
}

[data-theme="matchday"] .search-wrap input {
  background: var(--pitch-light);
  color: var(--text);
  border-color: var(--line);
}
[data-theme="matchday"] .search-wrap input:focus { border-color: var(--accent); }

[data-theme="matchday"] .filter-chip { color: var(--text); }
[data-theme="matchday"] .filter-chip:hover { background: var(--pitch-light); border-color: var(--line); }
[data-theme="matchday"] .filter-chip.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
[data-theme="matchday"] .chip-count { background: var(--pitch-light); color: var(--text-dim); }

[data-theme="matchday"] .stream-card { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .stream-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(21,101,192,0.12); }
[data-theme="matchday"] .card-thumb-bg { background: linear-gradient(135deg, #e8eeff, #c5d0f0); }
[data-theme="matchday"] .card-league { color: var(--accent); }
[data-theme="matchday"] .card-title { color: var(--white); }
[data-theme="matchday"] .card-desc { color: var(--white-dim); }
[data-theme="matchday"] .card-votes { border-top-color: var(--line); }
[data-theme="matchday"] .vote-btn { color: var(--text-dim); border-color: var(--line); }

[data-theme="matchday"] .player-area { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .player-header { background: var(--accent); }
[data-theme="matchday"] .player-title { color: #fff; }
[data-theme="matchday"] .player-meta { color: rgba(255,255,255,0.75); }
[data-theme="matchday"] .btn-close-player { color: #fff; border-color: rgba(255,255,255,0.4); }

[data-theme="matchday"] .site-footer { background: #fff; border-top-color: var(--line); }
[data-theme="matchday"] .footer-logo { color: var(--text); }
[data-theme="matchday"] .footer-logo span { color: var(--accent); }
[data-theme="matchday"] .footer-note { color: var(--text-dim); }
[data-theme="matchday"] .footer-version { color: var(--text-dim); }

[data-theme="matchday"] .live-dot { background: #ff5252; }
[data-theme="matchday"] .toast { background: #fff; border-left-color: var(--accent); color: var(--text); }

[data-theme="matchday"] .admin-panel { background: #fff; border-bottom-color: var(--line); }
[data-theme="matchday"] .stream-table th { background: var(--pitch-light); color: var(--text-dim); }
[data-theme="matchday"] .stream-table td { color: var(--text); border-bottom-color: var(--line); }
[data-theme="matchday"] .modal { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .form-group input { background: var(--pitch-light); color: var(--text); border-color: var(--line); }

[data-theme="matchday"] .theme-dropdown { background: #fff; border-color: var(--line); }
[data-theme="matchday"] .theme-option:hover { background: var(--pitch-light); }
[data-theme="matchday"] .theme-option-name { color: var(--white); }
[data-theme="matchday"] #sortSelect { background: var(--pitch-light); color: var(--text); border-color: var(--line); }

/* ── THEME: BROADSHEET ────────────────────────────────────────
   Sunday newspaper. Warm cream stock, dense black ink, serifs.
   Think The Times, but for football streaming.
   Font: Playfair Display (display) + Libre Baskerville (body)
   ──────────────────────────────────────────────────────────── */














/* ── THEME: CLASSIC ───────────────────────────────────────────
   Pure classic football green. White pitch, racing green accents.
   Like a freshly painted stadium on opening day.
   Font: Barlow Condensed + Barlow (same as Pitch but inverted)
   ──────────────────────────────────────────────────────────── */
[data-theme="classic"] {
  --pitch:        #f8fdf9;
  --pitch-mid:    #ffffff;
  --pitch-light:  #eef7f0;
  --line:         #c8e6c9;
  --line-bright:  #a5d6a7;
  --turf:         #e8f5e9;
  --accent:       #2e7d32;
  --accent-dim:   #1b5e20;
  --accent-glow:  rgba(46,125,50,0.1);
  --accent-pulse: rgba(46,125,50,0.05);
  --white:        #1b2e1c;
  --white-dim:    #4a6b4c;
  --red:          #c62828;
  --gold:         #f9a825;
  --text:         #1b2e1c;
  --text-dim:     #6a8f6c;
  --shadow-green: 0 0 20px rgba(46,125,50,0.15);
  --font-head:    'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
}

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

[data-theme="classic"] body::before {
  background-image:
    repeating-linear-gradient(
      0deg, transparent, transparent 50px,
      rgba(46,125,50,0.05) 50px, rgba(46,125,50,0.05) 51px
    ),
    repeating-linear-gradient(
      90deg, transparent, transparent 50px,
      rgba(46,125,50,0.05) 50px, rgba(46,125,50,0.05) 51px
    );
}

[data-theme="classic"] ::-webkit-scrollbar-track { background: var(--pitch); }
[data-theme="classic"] ::-webkit-scrollbar-thumb { background: var(--line-bright); }

[data-theme="classic"] .site-header {
  background: rgba(248,253,249,0.97);
  border-bottom: 2px solid var(--line);
}

[data-theme="classic"] .logo-icon {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(46,125,50,0.3);
}

[data-theme="classic"] .logo-text { color: var(--white); }
[data-theme="classic"] .logo-text span { color: var(--accent); }
[data-theme="classic"] .header-tag { color: var(--text-dim); border-color: var(--line); }
[data-theme="classic"] .btn-admin { color: var(--text-dim); border-color: var(--line); }
[data-theme="classic"] .btn-admin:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }

[data-theme="classic"] .hero { background: linear-gradient(180deg, var(--pitch-light) 0%, transparent 100%); }
[data-theme="classic"] .hero h1 { color: var(--white); }
[data-theme="classic"] .hero h1 em { color: var(--accent); }
[data-theme="classic"] .hero-eyebrow { color: var(--accent); }
[data-theme="classic"] .hero-sub { color: var(--white-dim); }
[data-theme="classic"] .stat-num { color: var(--accent); }
[data-theme="classic"] .stat-label { color: var(--text-dim); }

[data-theme="classic"] .sidebar { background: #fff; border-right-color: var(--line); }
[data-theme="classic"] .search-wrap input { background: var(--pitch-light); color: var(--text); border-color: var(--line); }
[data-theme="classic"] .search-wrap input:focus { border-color: var(--accent); }
[data-theme="classic"] .filter-chip { color: var(--text); }
[data-theme="classic"] .filter-chip:hover { background: var(--pitch-light); border-color: var(--line); }
[data-theme="classic"] .filter-chip.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
[data-theme="classic"] .chip-count { background: var(--pitch-light); color: var(--text-dim); }

[data-theme="classic"] .stream-card { background: #fff; border-color: var(--line); }
[data-theme="classic"] .stream-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(46,125,50,0.12); }
[data-theme="classic"] .card-thumb-bg { background: linear-gradient(135deg, var(--pitch-light), var(--turf)); }
[data-theme="classic"] .card-league { color: var(--accent-dim); }
[data-theme="classic"] .card-title { color: var(--white); }
[data-theme="classic"] .card-desc { color: var(--white-dim); }
[data-theme="classic"] .card-votes { border-top-color: var(--line); }
[data-theme="classic"] .vote-btn { color: var(--text-dim); border-color: var(--line); }
[data-theme="classic"] .vote-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="classic"] .card-play-btn .play-icon { background: var(--accent); color: #fff; box-shadow: 0 0 20px rgba(46,125,50,0.4); }

[data-theme="classic"] .player-area { background: #fff; border-color: var(--line); }
[data-theme="classic"] .player-header { background: var(--pitch-light); border-bottom-color: var(--line); }
[data-theme="classic"] .player-title { color: var(--white); }
[data-theme="classic"] .player-meta { color: var(--text-dim); }
[data-theme="classic"] .btn-close-player { color: var(--text-dim); border-color: var(--line); }

[data-theme="classic"] .site-footer { background: #fff; border-top-color: var(--line); }
[data-theme="classic"] .footer-logo { color: var(--white); }
[data-theme="classic"] .footer-logo span { color: var(--accent); }
[data-theme="classic"] .footer-note, [data-theme="classic"] .footer-version { color: var(--text-dim); }

[data-theme="classic"] .live-dot { background: var(--red); }
[data-theme="classic"] .live-badge { color: var(--red); }
[data-theme="classic"] .toast { background: #fff; border-left-color: var(--accent); color: var(--text); }
[data-theme="classic"] .toast.error { border-left-color: var(--red); }

[data-theme="classic"] .modal { background: #fff; border-color: var(--line); }
[data-theme="classic"] .form-group input { background: var(--pitch-light); color: var(--text); border-color: var(--line); }
[data-theme="classic"] .theme-dropdown { background: #fff; border-color: var(--line); }
[data-theme="classic"] .theme-option:hover { background: var(--pitch-light); }
[data-theme="classic"] .theme-option-name { color: var(--white); }
[data-theme="classic"] #sortSelect { background: var(--pitch-light); color: var(--text); border-color: var(--line); }
[data-theme="classic"] .admin-panel { background: #fff; border-bottom-color: var(--line); }
[data-theme="classic"] .stream-table th { background: var(--pitch-light); color: var(--text-dim); }
[data-theme="classic"] .stream-table td { color: var(--text); border-bottom-color: var(--line); }

/* ── LIGHT THEME: SHARED OVERRIDES ───────────────────────────
   Elements that need the same treatment across all 3 light themes
   ──────────────────────────────────────────────────────────── */
[data-theme="matchday"] .health-summary,

[data-theme="matchday"] .results-count,

[data-theme="matchday"] .sidebar-section h3,

[data-theme="matchday"] .btn-reset,

[data-theme="matchday"] .sort-wrap label,

[data-theme="matchday"] .active-filter-tag,

[data-theme="matchday"] .tag-default,

[data-theme="matchday"] .card-flag,

[data-theme="matchday"] .modal-overlay,

[data-theme="matchday"] .stream-card.playing::before,

/* ── THEME: SIGNAL ────────────────────────────────────────────
   Clean, minimal, modern. Off-white background, near-black text,
   sharp accent blue. Inspired by BBC Sport app / Sky Sports app.
   No texture, no noise — pure clarity.
   Font: Outfit (single family, all weights)
   ──────────────────────────────────────────────────────────── */
[data-theme="signal"] {
  --pitch:        #f7f7f7;
  --pitch-mid:    #ffffff;
  --pitch-light:  #efefef;
  --line:         #e0e0e0;
  --line-bright:  #bdbdbd;
  --turf:         #f0f0f0;
  --accent:       #1565c0;
  --accent-dim:   #0d47a1;
  --accent-glow:  rgba(21,101,192,0.08);
  --accent-pulse: rgba(21,101,192,0.04);
  --white:        #111111;
  --white-dim:    #555555;
  --red:          #d32f2f;
  --gold:         #f57c00;
  --text:         #222222;
  --text-dim:     #888888;
  --shadow-green: 0 0 20px rgba(21,101,192,0.12);
  --radius:       6px;
  --radius-lg:    10px;
  --font-head:    'Outfit', 'Barlow Condensed', sans-serif;
  --font-body:    'Outfit', 'Barlow', sans-serif;
}

[data-theme="signal"] body { background: var(--pitch); }
[data-theme="signal"] body::before { display: none; } /* No texture */

[data-theme="signal"] ::-webkit-scrollbar-track { background: var(--pitch); }
[data-theme="signal"] ::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 3px; }

[data-theme="signal"] .site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line);
}

[data-theme="signal"] .logo-icon {
  background: var(--accent);
  box-shadow: none;
  animation: none;
  border-radius: 8px;
}

[data-theme="signal"] .logo-text { color: var(--white); letter-spacing: 0.02em; font-weight: 800; }
[data-theme="signal"] .logo-text span { color: var(--accent); }
[data-theme="signal"] .header-tag { color: var(--text-dim); border-color: var(--line); }
[data-theme="signal"] .live-badge { color: var(--red); }
[data-theme="signal"] .live-dot { background: var(--red); }
[data-theme="signal"] .btn-admin { color: var(--text-dim); border-color: var(--line); }
[data-theme="signal"] .btn-admin:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
[data-theme="signal"] .health-summary { color: var(--text-dim); }
[data-theme="signal"] .theme-btn { color: var(--text-dim); border-color: var(--line); }
[data-theme="signal"] .theme-btn:hover { color: var(--accent); border-color: var(--accent); }

[data-theme="signal"] .hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--pitch) 100%);
  border-bottom-color: var(--line);
}
[data-theme="signal"] .hero h1 { color: var(--white); font-weight: 800; letter-spacing: -0.02em; }
[data-theme="signal"] .hero h1 em { color: var(--accent); }
[data-theme="signal"] .hero-eyebrow { color: var(--accent); font-weight: 600; }
[data-theme="signal"] .hero-sub { color: var(--white-dim); }
[data-theme="signal"] .stat-num { color: var(--accent); font-weight: 800; }
[data-theme="signal"] .stat-label { color: var(--text-dim); }
[data-theme="signal"] .stat-divider { background: var(--line); }

[data-theme="signal"] .app-layout { border-top: 1px solid var(--line); }
[data-theme="signal"] .sidebar { background: #ffffff; border-right-color: var(--line); }
[data-theme="signal"] .sidebar-section h3 { color: var(--text-dim); border-bottom-color: var(--line); }
[data-theme="signal"] .search-wrap input { background: var(--pitch-light); color: var(--text); border-color: var(--line); }
[data-theme="signal"] .search-wrap input:focus { border-color: var(--accent); background: #fff; }
[data-theme="signal"] .search-wrap input::placeholder { color: var(--text-dim); }

[data-theme="signal"] .filter-chip { color: var(--text); background: #fff; border-color: var(--line); }
[data-theme="signal"] .filter-chip:hover { background: var(--pitch-light); border-color: var(--line-bright); }
[data-theme="signal"] .filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="signal"] .filter-chip.active .chip-count { background: rgba(255,255,255,0.25); color: #fff; }
[data-theme="signal"] .chip-count { background: var(--pitch-light); color: var(--text-dim); }
[data-theme="signal"] .btn-reset { color: var(--text-dim); border-color: var(--line); }

[data-theme="signal"] .stream-card { background: #fff; border-color: var(--line); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="signal"] .stream-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(21,101,192,0.12); transform: translateY(-2px); }
[data-theme="signal"] .stream-card.playing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
[data-theme="signal"] .stream-card.playing::before { background: var(--accent); color: #fff; }

[data-theme="signal"] .card-thumb-bg { background: linear-gradient(135deg, #e8eeff, #d0daff); }
[data-theme="signal"] .card-league { color: var(--accent); font-weight: 700; }
[data-theme="signal"] .card-title { color: var(--white); font-weight: 700; text-transform: none; letter-spacing: -0.01em; }
[data-theme="signal"] .card-desc { color: var(--white-dim); }
[data-theme="signal"] .card-footer { border-top: 1px solid var(--pitch-light); padding-top: 6px; margin-top: 6px; }
[data-theme="signal"] .card-votes { border-top-color: var(--line); }
[data-theme="signal"] .vote-btn { color: var(--text-dim); border-color: var(--line); background: var(--pitch-light); }
[data-theme="signal"] .vote-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
[data-theme="signal"] .vote-up.voted  { background: rgba(21,101,192,0.1); border-color: var(--accent); color: var(--accent); }
[data-theme="signal"] .vote-down.voted { background: rgba(211,47,47,0.1); border-color: var(--red); color: var(--red); }

[data-theme="signal"] .card-play-btn .play-icon { background: var(--accent); color: #fff; box-shadow: 0 0 20px rgba(21,101,192,0.3); border-radius: 50%; }
[data-theme="signal"] .tag-default { background: var(--pitch-light); color: var(--text-dim); border-color: var(--line); }
[data-theme="signal"] .card-offline { background: rgba(255,255,255,0.9); color: var(--text-dim); }
[data-theme="signal"] .card-offline.geo { color: var(--accent); }

[data-theme="signal"] .player-area { background: #fff; border-color: var(--line); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
[data-theme="signal"] .player-header { background: var(--accent); border-bottom-color: transparent; }
[data-theme="signal"] .player-title { color: #fff; }
[data-theme="signal"] .player-meta { color: rgba(255,255,255,0.8); }
[data-theme="signal"] .btn-close-player { color: #fff; border-color: rgba(255,255,255,0.4); }
[data-theme="signal"] .btn-close-player:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,0.15); }
[data-theme="signal"] .vote-btn { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); color: #fff; }

[data-theme="signal"] .site-footer { background: #fff; border-top-color: var(--line); }
[data-theme="signal"] .footer-logo { color: var(--white); }
[data-theme="signal"] .footer-logo span { color: var(--accent); }
[data-theme="signal"] .footer-note { color: var(--text-dim); }
[data-theme="signal"] .footer-version { color: var(--text-dim); }

[data-theme="signal"] .modal { background: #fff; border-color: var(--line); }
[data-theme="signal"] .modal h2 { color: var(--white); }
[data-theme="signal"] .form-group input,
[data-theme="signal"] .form-group select { background: var(--pitch-light); color: var(--text); border-color: var(--line); }
[data-theme="signal"] .form-group label { color: var(--text-dim); }
[data-theme="signal"] .modal-overlay { background: rgba(0,0,0,0.3); }

[data-theme="signal"] .toast { background: #fff; border-left-color: var(--accent); color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
[data-theme="signal"] .toast.error { border-left-color: var(--red); }

[data-theme="signal"] .admin-panel { background: #fff; border-bottom-color: var(--line); }
[data-theme="signal"] .stream-table th { background: var(--pitch-light); color: var(--text-dim); border-bottom-color: var(--line); }
[data-theme="signal"] .stream-table td { color: var(--text); border-bottom-color: var(--line); }
[data-theme="signal"] .stream-table tr:hover td { background: var(--pitch-light); }

[data-theme="signal"] .theme-dropdown { background: #fff; border-color: var(--line); }
[data-theme="signal"] .theme-option:hover { background: var(--pitch-light); }
[data-theme="signal"] .theme-option-name { color: var(--white); }
[data-theme="signal"] .theme-option-desc { color: var(--text-dim); }
[data-theme="signal"] .active-filter-tag { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }
[data-theme="signal"] #sortSelect { background: #fff; color: var(--text); border-color: var(--line); }
[data-theme="signal"] .sort-wrap label { color: var(--text-dim); }
[data-theme="signal"] .results-count { color: var(--text-dim); }
[data-theme="signal"] .results-count span { color: var(--accent); }
[data-theme="signal"] .geo-hidden-note { color: var(--accent); font-size: 0.75em; }

/* ── NEW UI ELEMENTS (all themes) ────────────────────────────── */

/* Geo-blocked card */
.geo-blocked-card { opacity: 0.75; }
.geo-blocked-card .card-offline.geo {
  background: rgba(21,101,192,0.15);
  color: #1565c0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

/* Geo toggle */
.geo-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 4px;
}
.geo-toggle-wrap input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.geo-toggle-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Geo hidden note in results count */
.geo-hidden-note {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 4px;
}

/* Report button on card */
.card-report-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  color: var(--white-dim);
  font-size: 0.7rem;
  padding: 3px 7px;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0;
  backdrop-filter: blur(4px);
}
.stream-card:hover .card-report-btn { opacity: 1; }
.card-report-btn:hover { background: rgba(255,61,87,0.7); color: #fff; border-color: var(--red); }

/* Flagged badge */
.card-flagged {
  color: var(--red);
  font-size: 0.8rem;
  margin-left: 4px;
  vertical-align: middle;
}

/* Admin table failure count */
.fail-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(255,61,87,0.12);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
}

/* Report item in admin */
.report-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text);
  background: var(--pitch-light);
}

/* Signal theme: Outfit font needs weight mapping */
[data-theme="signal"] .card-title { font-weight: 700; font-size: 0.95rem; }
[data-theme="signal"] .hero h1 { font-size: clamp(2rem,4.5vw,3.5rem); }
[data-theme="signal"] .logo-text { font-size: 1.4rem; font-weight: 800; }

/* Signal theme: Outfit doesn't do all-caps as well — soften it */
[data-theme="signal"] .card-league { text-transform: uppercase; font-size: 0.65rem; font-weight: 600; }
[data-theme="signal"] .tag { font-weight: 600; }
