:root {
  --bg-body: #0a1628;
  --bg-card: rgba(13,31,60,0.7);
  --bg-card-solid: #0d1f3c;
  --bg-elevated: rgba(13,31,60,0.6);
  --bg-select: rgba(13,31,60,0.8);
  --text-primary: #e0e8f5;
  --text-heading: #fff;
  --text-muted: rgba(138,180,248,0.3);
  --text-table: #d0d8e8;
  --text-hero-muted: rgba(255,255,255,0.4);
  --text-pendiente: #ffd54f;
  --border-color: rgba(42,90,158,0.15);
  --border-light: rgba(42,90,158,0.12);
  --accent-blue: #2a5a9e;
  --accent-glow: #4fc3f7;
  --accent-gold: #ffd54f;
  --btn-primary: #1a3a6b;
  --btn-primary-hover: #2a5a9e;
  --tabla-bg: rgba(13,31,60,0.5);
  --tabla-th-bg: rgba(26,58,107,0.6);
}

[data-tema="claro"] {
  --bg-body: #eef3fa;
  --bg-card: rgba(255,255,255,0.85);
  --bg-card-solid: #ffffff;
  --bg-elevated: rgba(255,255,255,0.8);
  --bg-select: #ffffff;
  --text-primary: #1a2a4a;
  --text-heading: #0a1628;
  --text-muted: rgba(26,58,107,0.4);
  --text-table: #1a2a4a;
  --text-hero-muted: rgba(26,58,107,0.3);
  --text-pendiente: #b8860b;
  --border-color: rgba(42,90,158,0.12);
  --border-light: rgba(42,90,158,0.08);
  --accent-blue: #1a5aae;
  --accent-glow: #1a73e8;
  --accent-gold: #e8a800;
  --btn-primary: #d4dce8;
  --btn-primary-hover: #b8c6d8;
  --tabla-bg: rgba(255,255,255,0.7);
  --tabla-th-bg: rgba(42,90,158,0.1);
}

[data-tema="uno-shot"] {
  --bg-body: #3A0D18;
  --bg-card: rgba(106,22,40,0.7);
  --bg-card-solid: #6A1628;
  --bg-elevated: rgba(106,22,40,0.6);
  --bg-select: #6A1628;
  --text-primary: #F1ECD4;
  --text-heading: #F1ECD4;
  --text-muted: rgba(168,170,165,0.5);
  --text-table: #D4B99A;
  --text-hero-muted: rgba(168,170,165,0.4);
  --text-pendiente: #D4B99A;
  --border-color: rgba(17,21,19,0.25);
  --border-light: rgba(17,21,19,0.15);
  --accent-blue: #176B4B;
  --accent-glow: #58C98D;
  --accent-gold: #D4B99A;
  --btn-primary: #176B4B;
  --btn-primary-hover: #58C98D;
  --tabla-bg: rgba(106,22,40,0.5);
  --tabla-th-bg: rgba(58,13,24,0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
}

/* ---------- PARTICULAS ---------- */
.particulas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particula {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-glow);
  border-radius: 50%;
  opacity: 0;
  animation: particulaFlotar 8s ease-in-out infinite;
}
.particula:nth-child(1) { left: 10%; top: 20%; width: 4px; height: 4px; animation-delay: 0s; }
.particula:nth-child(2) { left: 25%; top: 60%; animation-delay: 1.2s; }
.particula:nth-child(3) { left: 40%; top: 10%; width: 5px; height: 5px; animation-delay: 2.5s; }
.particula:nth-child(4) { left: 55%; top: 70%; animation-delay: 0.8s; }
.particula:nth-child(5) { left: 70%; top: 30%; width: 4px; height: 4px; animation-delay: 3.2s; }
.particula:nth-child(6) { left: 85%; top: 50%; animation-delay: 1.8s; }
.particula:nth-child(7) { left: 15%; top: 80%; animation-delay: 2s; }
.particula:nth-child(8) { left: 50%; top: 40%; width: 2px; height: 2px; animation-delay: 0.5s; }
.particula:nth-child(9) { left: 90%; top: 15%; animation-delay: 3.5s; }
.particula:nth-child(10) { left: 35%; top: 90%; width: 4px; height: 4px; animation-delay: 1s; }
.particula:nth-child(11) { left: 65%; top: 5%; animation-delay: 2.8s; }
.particula:nth-child(12) { left: 5%; top: 45%; width: 2px; height: 2px; animation-delay: 0.3s; }
.particula:nth-child(13) { left: 75%; top: 75%; animation-delay: 1.5s; }
.particula:nth-child(14) { left: 45%; top: 55%; width: 5px; height: 5px; animation-delay: 2.2s; }
.particula:nth-child(15) { left: 95%; top: 85%; animation-delay: 3s; }
@keyframes particulaFlotar {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { opacity: 0.6; }
  50% { transform: translateY(-30px) scale(1); opacity: 0.8; }
  80% { opacity: 0.3; }
  100% { transform: translateY(-60px) scale(0); opacity: 0; }
}

[data-tema="claro"] .particula {
  opacity: 0;
  animation: none;
}
[data-tema="uno-shot"] .particula {
  opacity: 0;
  animation: none;
}

/* ---------- GRID BACKGROUND ---------- */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42,90,158,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,90,158,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
[data-tema="claro"] .grid-bg {
  background-image:
    linear-gradient(rgba(42,90,158,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42,90,158,0.04) 1px, transparent 1px);
}
[data-tema="uno-shot"] .grid-bg {
  background-image:
    linear-gradient(#111513 1px, transparent 1px),
    linear-gradient(90deg, #111513 1px, transparent 1px);
}

/* ---------- FONDO ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(26,58,107,0.15), transparent 60%),
    radial-gradient(ellipse 500px 500px at 90% 80%, rgba(42,90,158,0.08), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

/* ---------- HEADER ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(42,90,158,0.15);
}
.header-left { flex: 1; }
.header-right { flex-shrink: 0; margin-left: 24px; }

.logo-fni {
  width: 72px;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}
.logo-fni:hover { transform: scale(1.05); }

.titulo {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text-heading) 30%, #8ab4f8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitulo {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.7;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.header-fecha {
  font-size: 12px;
  color: var(--text-muted);
}
.header-sep { color: rgba(42,90,158,0.3); font-size: 10px; }
.header-downtime {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid rgba(42,90,158,0.08);
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- LIVE BADGE ---------- */
.live-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 14px;
  background: rgba(79,195,247,0.04);
  border: 1px solid rgba(79,195,247,0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-glow);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s;
}
.live-header-badge.visible { opacity: 1; }
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4fc3f7;
  animation: livePulso 1.2s ease-in-out infinite;
}
@keyframes livePulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* ---------- FILTROS ---------- */
.filtros {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.filtros select { flex: 1; min-width: 160px; }
.filtros .btn-equipos-modal { flex-shrink: 0; }
.btn-tema {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--accent-gold);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s, background 0.25s;
  flex-shrink: 0;
  padding: 0;
}
.btn-tema:hover { border-color: rgba(42,90,158,0.3); }

/* ---------- ¿UN SHOT? ---------- */
.btn-uno-shot {
  padding: 14px 20px;
  background: var(--btn-primary);
  border: none;
  border-radius: 12px;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-uno-shot:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
[data-tema="uno-shot"] .btn-uno-shot {
  background: #6A1628;
  color: #58C98D;
  border: 2px solid #111513;
  outline: 2px solid #176B4B;
  outline-offset: -4px;
  font-family: 'Arial Black', 'Impact', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}
[data-tema="uno-shot"] .btn-uno-shot:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(88,201,141,0.3);
}

/* ---------- SELECT ---------- */
select {
  padding: 14px 48px 14px 18px;
  background: var(--bg-select);
  color: var(--text-primary);
  border: 1px solid rgba(42,90,158,0.2);
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238ab4f8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
select:hover { border-color: rgba(42,90,158,0.4); }
select:focus { border-color: #2a5a9e; box-shadow: 0 0 0 2px rgba(42,90,158,0.15); }

/* ---------- BOTON EQUIPOS MODAL ---------- */
.btn-equipos-modal {
  padding: 14px 20px;
  background: var(--btn-primary);
  border: none;
  border-radius: 12px;
  color: var(--text-heading);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-equipos-modal:hover {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ---------- HERO / PRESENTACIÓN ---------- */
.hero {
  margin-bottom: 28px;
  padding: 20px 0;
  text-align: center;
  animation: heroEntrar 0.8s ease backwards;
}
@keyframes heroEntrar {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
.hero-title {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-heading);
  margin: 0 0 4px;
}
.hero-highlight { color: var(--accent-glow); }
.hero-motto {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-hero-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- STATS DASHBOARD ---------- */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
  animation: statsEntrar 0.6s ease backwards;
}
@keyframes statsEntrar {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.12);
  border-radius: 14px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, rgba(42,90,158,0.3), transparent);
}
.stat-card:hover {
  border-color: rgba(42,90,158,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.stat-card.live { border-color: rgba(79,195,247,0.12); }
.stat-card.live::before {
  background: linear-gradient(180deg, rgba(79,195,247,0.4), transparent);
}
.stat-card.live:hover { border-color: rgba(79,195,247,0.25); }
.stat-icon { font-size: 22px; line-height: 1; opacity: 0.7; }
.stat-card div { display: flex; flex-direction: column; gap: 1px; }
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-heading);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-card.live .stat-val { color: #4fc3f7; }
.stat-card.live .stat-icon { animation: livePulso 1.5s ease-in-out infinite; }

/* ---------- SECTION ---------- */
section { margin-bottom: 48px; }
.seccion-titulo {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 3px solid #2a5a9e;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-mini-tabla {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.25s, color 0.25s;
  line-height: 1;
  margin-left: auto;
}
.btn-mini-tabla:hover { border-color: rgba(42,90,158,0.3); color: var(--accent-glow); }
.seccion-titulo::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(42,90,158,0.2), transparent);
}

/* ---------- SUBTITULO GRUPO ---------- */
.subtitulo-grupo {
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 12px;
  padding-left: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subtitulo-grupo::after { content: ''; flex: 1; height: 1px; }
.subtitulo-grupo.estado-en_vivo { color: #4fc3f7; border-left: 3px solid #4fc3f7; }
.subtitulo-grupo.estado-en_vivo::after { background: linear-gradient(90deg, rgba(79,195,247,0.2), transparent); }
.subtitulo-grupo.estado-pendiente { color: var(--text-pendiente); border-left: 3px solid var(--text-pendiente); }
.subtitulo-grupo.estado-pendiente::after { background: linear-gradient(90deg, rgba(255,213,79,0.15), transparent); }
.subtitulo-grupo.estado-finalizado { color: #8ab4f8; border-left: 3px solid #8ab4f8; }
.subtitulo-grupo.estado-finalizado::after { background: linear-gradient(90deg, rgba(138,180,248,0.15), transparent); }

/* ---------- MATCHES GRID ---------- */
.matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.matches.animar > .match-card {
  animation: matchEntrada 0.4s ease backwards;
}
@keyframes matchEntrada {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------- SKELETON ---------- */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.08);
  border-radius: 16px;
  padding: 20px;
  overflow: hidden;
}
.skeleton-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(42,90,158,0.04), transparent);
  background-size: 400px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-card { position: relative; }
.skeleton-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.skeleton-badge { width: 60px; height: 20px; border-radius: 999px; background: rgba(42,90,158,0.1); }
.skeleton-time { width: 40px; height: 20px; border-radius: 6px; background: rgba(42,90,158,0.08); }
.skeleton-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skeleton-team { width: 30%; display: flex; align-items: center; gap: 8px; }
.skeleton-logo { width: 36px; height: 36px; border-radius: 50%; background: rgba(42,90,158,0.1); flex-shrink: 0; }
.skeleton-name { flex: 1; height: 12px; border-radius: 3px; background: rgba(42,90,158,0.08); }
.skeleton-score { width: 70px; height: 38px; border-radius: 12px; background: rgba(42,90,158,0.06); }

/* ---------- MATCH CARD ---------- */
.match-card {
  background: var(--bg-card);
  border: 1px solid rgba(42,90,158,0.15);
  border-radius: 16px;
  padding: 20px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
}
.match-card:hover {
  border-color: rgba(42,90,158,0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 20px rgba(42,90,158,0.05);
}
.match-card.en_vivo {
  border-color: rgba(79,195,247,0.2);
}
.match-card.en_vivo:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 30px rgba(79,195,247,0.08);
}
.match-card.en_vivo::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2a5a9e, #4fc3f7, #2a5a9e);
  background-size: 200% 100%;
  animation: barrido 3s ease-in-out infinite;
  border-radius: 16px 16px 0 0;
}
.match-card { position: relative; overflow: hidden; }

@keyframes barrido {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- MATCH HEADER ---------- */
.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.match-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-seguir {
  background: none;
  border: 1px solid rgba(42,90,158,0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.25s, border-color 0.25s, transform 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.btn-seguir:hover {
  color: #ffd54f;
  border-color: rgba(255,213,79,0.3);
  transform: scale(1.1);
}
.btn-seguir.siguiendo {
  color: #ffd54f;
  border-color: rgba(255,213,79,0.3);
  background: rgba(255,213,79,0.06);
}
.btn-seguir.siguiendo svg {
  fill: #ffd54f;
}
.estado-badge {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.estado-badge.en_vivo { background: rgba(79,195,247,0.08); color: var(--accent-glow); border: 1px solid rgba(79,195,247,0.15); }
.estado-badge.finalizado { background: rgba(138,180,248,0.06); color: #8ab4f8; border: 1px solid rgba(138,180,248,0.12); }
.estado-badge.pendiente { background: rgba(255,213,79,0.06); color: var(--text-pendiente); border: 1px solid rgba(255,213,79,0.12); }

.tiempo {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-glow);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.tiempo-pendiente { color: var(--text-pendiente); font-size: 14px; font-weight: 600; }
.tiempo-ago {
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: 6px;
}

/* ---------- MATCH BODY ---------- */
.match-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.team-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 35%;
}
.team-info.right { justify-content: flex-end; }
.team-nombre { font-size: 14px; font-weight: 700; color: var(--text-heading); line-height: 1.3; }
.team-logo {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(42,90,158,0.2);
  background: var(--bg-body);
  flex-shrink: 0;
}

.marcador {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.15);
  border-radius: 14px;
  padding: 10px 20px;
  min-width: 90px;
  justify-content: center;
}
.match-card.en_vivo .marcador { border-color: rgba(79,195,247,0.12); }

.puntaje {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-heading);
  min-width: 26px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s;
  display: inline-block;
}
.puntaje.bounce { animation: scoreBounce 0.4s ease; }
@keyframes scoreBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); color: #4fc3f7; }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.separador {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ---------- CONFETI ---------- */
@keyframes confetiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(80px) rotate(720deg); opacity: 0; }
}
.confeti-piece {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 5;
}
.match-card.finalizado .confeti-piece {
  animation: confetiFall 1s ease-out forwards;
}

/* ---------- TABLA MINI ---------- */
.tabla-wrapper.tabla-mini { max-width: 400px; }
.tabla-mini-tbl th,
.tabla-mini-tbl td { padding: 10px 8px !important; font-size: 12px !important; }
.tabla-mini-tbl .td-equipo { min-width: 120px !important; }
.tabla-mini-tbl .td-pts { font-size: 15px !important; }
.tabla-mini-tbl .td-dg { font-size: 12px !important; }

/* ---------- TABLA POSICIONES ---------- */
.tabla-serie-titulo {
  color: #8ab4f8;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 18px 2px;
  margin: 0;
}
.tabla-wrapper {
  border-radius: 16px;
  border: 1px solid rgba(42,90,158,0.15);
  background: var(--tabla-bg);
  overflow: hidden;
}
.tabla-scroll { overflow-x: auto; }
.tabla-posiciones {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.tabla-posiciones thead { position: sticky; top: 0; z-index: 2; }
.tabla-posiciones th {
  background: var(--tabla-th-bg);
  color: var(--text-heading);
  padding: 14px 12px;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  border-bottom: 1px solid rgba(42,90,158,0.15);
  white-space: nowrap;
}
.tabla-posiciones th:first-child { text-align: center; width: 40px; }
.tabla-posiciones th:nth-child(2) { text-align: left; }
.tabla-posiciones td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid rgba(42,90,158,0.06);
  color: var(--text-table);
  font-size: 13px;
}
.tabla-posiciones tbody tr { transition: background 0.2s; }
.tabla-posiciones tbody tr:hover { background: rgba(42,90,158,0.06); }
.tabla-posiciones tr:last-child td { border-bottom: none; }
.tabla-posiciones .td-pos {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  width: 40px;
}
.tabla-posiciones .td-equipo {
  text-align: left;
  font-weight: 600;
  min-width: 160px;
  padding-left: 12px;
}
.tabla-posiciones .td-equipo .eq-wrap { display: flex; align-items: center; gap: 6px; }
.tabla-posiciones .eq-nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla-posiciones .eq-crown { font-size: 14px; flex-shrink: 0; }
.tabla-posiciones .td-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.tabla-posiciones .td-pts {
  font-weight: 800;
  color: var(--text-heading);
  font-size: 18px;
}
.tabla-posiciones .td-dg { font-weight: 600; font-size: 14px; }
.tabla-posiciones tr.lider { background: rgba(42,90,158,0.06); }
.tabla-posiciones tr.lider .td-pos { color: #4fc3f7; font-size: 16px; }
.tabla-posiciones tr.lider .td-pts { color: #4fc3f7; }
.tabla-posiciones tr.sin-jugar { opacity: 0.5; }
.tabla-posiciones tr.sin-jugar .td-pts { color: var(--text-muted); font-size: 14px; }
.tabla-posiciones .dg-pos { color: #4caf50; font-weight: 700; }
.tabla-posiciones .dg-neg { color: #f44336; font-weight: 700; }

/* ---------- BRACKET ---------- */
.card {
  background: var(--tabla-bg);
  border: 1px solid rgba(42,90,158,0.12);
  border-radius: 16px;
  padding: 24px;
}
.card select { width: 100%; margin-bottom: 20px; }

.bracket { width: 100%; overflow-x: auto; }
.bracket-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}
.round { display: flex; flex-direction: column; gap: 10px; }
.round > h3 {
  text-align: center;
  color: #8ab4f8;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(42,90,158,0.1);
}
.bracket-match {
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.12);
  border-radius: 14px;
  padding: 12px;
  transition: border-color 0.25s;
}
.bracket-match:hover { border-color: rgba(42,90,158,0.25); }
.bracket-match.empty { border: 1px dashed rgba(42,90,158,0.1); opacity: 0.4; }
.match-title {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.match-state {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bracket-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.08);
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 12px;
}
.bracket-team.winner { border-color: rgba(42,90,158,0.25); background: var(--bg-elevated); }
.team-data { display: flex; align-items: center; gap: 6px; }
.team-data .logo { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(42,90,158,0.15); }
.bracket-team strong { color: var(--text-heading); font-size: 14px; }
.bracket-connector { position: absolute; pointer-events: none; opacity: 0.08; }

/* ---------- MODAL EQUIPOS ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  width: 100%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid rgba(42,90,158,0.15);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-header h2 { font-size: 16px; font-weight: 800; color: var(--text-heading); letter-spacing: 1px; margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(42,90,158,0.15);
  color: var(--text-heading);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(42,90,158,0.3); }
.modal-content .exp-grid { margin-bottom: 0; }

/* ---------- EXPLORAR EQUIPOS ---------- */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.exp-equipo {
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.1);
  border-radius: 14px;
  padding: 16px 18px;
  transition: border-color 0.25s;
}
.exp-equipo:hover { border-color: rgba(42,90,158,0.25); }
.exp-equipo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(42,90,158,0.06);
}
.exp-equipo-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(42,90,158,0.2);
  background: var(--bg-body);
  flex-shrink: 0;
}
.exp-equipo-nombre { font-size: 14px; font-weight: 700; color: var(--text-heading); flex: 1; }
.exp-jug-count {
  font-size: 10px;
  font-weight: 700;
  color: #8ab4f8;
  background: rgba(42,90,158,0.1);
  border-radius: 999px;
  padding: 2px 8px;
}
.exp-jugadores { display: flex; flex-direction: column; gap: 4px; }
.exp-jugador {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.05);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-table);
  transition: background 0.2s, padding 0.2s;
}
.exp-jugador:hover { background: var(--bg-elevated); padding-left: 14px; }
.exp-jugador::before { content: '👤'; font-size: 10px; opacity: 0.4; }
.exp-jugadores .vacio { font-size: 11px; color: var(--text-muted); padding: 6px 0; text-align: center; border: none; }
.exp-vacio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px;
  color: var(--text-muted);
  border: 1px dashed rgba(42,90,158,0.08);
  border-radius: 14px;
  font-size: 13px;
}

/* ---------- EN VIVO GLOBAL ---------- */
.envivo-section { margin-bottom: 24px; }
.envivo-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: thin;
}
.envivo-card {
  flex-shrink: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid rgba(79,195,247,0.2);
  border-radius: 16px;
  padding: 14px 18px;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  position: relative;
  overflow: hidden;
}
.envivo-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2a5a9e, #4fc3f7, #2a5a9e);
  background-size: 200% 100%;
  animation: barrido 3s ease-in-out infinite;
}
.envivo-torneo {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-align: center;
}
.envivo-equipos { text-align: center; }
.envivo-equipo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.envivo-logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(79,195,247,0.2);
  flex-shrink: 0;
}
.envivo-marcador {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.envivo-puntaje {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-heading);
  min-width: 20px;
  text-align: center;
}
.envivo-sep { color: var(--text-muted); font-size: 14px; }
.envivo-tiempo {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-glow);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* ---------- VACIO ---------- */
.vacio {
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(42,90,158,0.08);
  border-radius: 14px;
  grid-column: 1 / -1;
  background: var(--bg-elevated);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(42,90,158,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(42,90,158,0.35); }

/* ---------- FOOTER ---------- */
.admin-cta {
  text-align: center;
  padding: 32px 24px;
  margin-bottom: 24px;
  background: var(--bg-elevated);
  border: 1px solid rgba(42,90,158,0.15);
  border-radius: 16px;
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  position: relative;
  overflow: hidden;
}
.admin-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0.3;
}
.admin-cta p {
  color: #8ab4f8;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: 0.3px;
}
.admin-wa {
  display: inline-block;
  color: #25d366;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 24px;
  border: 1.5px solid rgba(37,211,102,0.2);
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  letter-spacing: 0.3px;
}
.admin-wa:hover {
  background: rgba(37,211,102,0.08);
  border-color: rgba(37,211,102,0.35);
  transform: translateY(-1px);
}

/* ---------- PREDICCIONES ---------- */
.btn-prediccion {
  margin-top: 12px;
  width: 100%;
  padding: 8px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.btn-prediccion:hover {
  border-color: rgba(42,90,158,0.3);
  color: var(--accent-glow);
  background: rgba(42,90,158,0.04);
}
.modal-pred { max-width: 420px; }
.pred-body { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }
.pred-partido { text-align: center; font-size: 18px; font-weight: 800; color: var(--text-heading); }
.pred-input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-select);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  text-align: center;
  transition: border-color 0.25s;
}
.pred-input:focus { border-color: var(--accent-glow); }
.pred-equipos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.pred-opcion {
  flex: 1;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
}
.pred-opcion:hover { border-color: rgba(42,90,158,0.3); transform: translateY(-2px); }
.pred-opcion.activo {
  border-color: var(--accent-glow);
  background: rgba(79,195,247,0.08);
  color: var(--accent-glow);
}
.pred-vs { font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.pred-feedback { text-align: center; min-height: 20px; }
.pred-error { color: #f44336; font-size: 13px; font-weight: 600; }
.pred-ok { color: #4caf50; font-size: 13px; font-weight: 600; }
/* ---------- RESULTADOS VOTACION ---------- */
.pred-votos {
  margin-top: 8px;
}
.pred-bar-row {
  display: flex;
  height: 6px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(42,90,158,0.06);
}
.pred-bar-fill {
  height: 100%;
  transition: width 0.5s ease;
}
.pred-bar-fill.team-a { background: #4fc3f7; box-shadow: 0 0 8px rgba(79,195,247,0.5); }
.pred-bar-fill.team-b { background: #ff6b9d; box-shadow: 0 0 8px rgba(255,107,157,0.5); margin-left: 2px; }
.pred-pcts {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}
.pred-pcts span:first-child { color: #4fc3f7; }
.pred-pcts span:last-child { color: #ff6b9d; }
.pred-pcts span:nth-child(2) { color: var(--text-muted); font-weight: 600; }

.pred-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s;
}
.pred-btn:hover { background: #1a5aae; transform: translateY(-1px); }

.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 40px 0 20px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-top: 1px solid rgba(42,90,158,0.06);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .matches { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .hero-title { font-size: 18px; }
  .stats-dashboard { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .container { padding: 20px 16px; }
  .header { flex-direction: column; text-align: center; gap: 16px; }
  .header-right { margin-left: 0; }
  .logo-fni { width: 60px; }
  .titulo { font-size: 48px; letter-spacing: 3px; }
  .subtitulo { font-size: 11px; letter-spacing: 2px; }
  .header-meta { justify-content: center; }
  .hero { padding: 16px 0; }
  .hero-title { font-size: 16px; letter-spacing: 1.5px; }
  .hero-motto { font-size: 12px; }
  .stats-dashboard { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .bracket-grid { max-width: 100%; }
  .card { padding: 20px; }
}

@media (max-width: 600px) {
  .container { padding: 14px 12px; }
  .header { margin-bottom: 24px; padding-bottom: 16px; gap: 12px; }
  .logo-fni { width: 48px; }
  .titulo { font-size: 36px; letter-spacing: 2px; }
  .subtitulo { font-size: 10px; margin-top: 4px; letter-spacing: 1px; }
  .hero-title { font-size: 15px; }
  .hero-motto { font-size: 11px; }
  .stats-dashboard { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-icon { font-size: 18px; }
  .stat-val { font-size: 20px; }
  .seccion-titulo { font-size: 15px; padding-left: 12px; }
  .subtitulo-grupo { font-size: 12px; margin: 12px 0 8px; }
  .matches { grid-template-columns: 1fr; gap: 10px; }
  .match-card { padding: 14px; border-radius: 14px; }
  .match-header { margin-bottom: 12px; }
  .estado-badge { font-size: 9px; padding: 3px 10px; }
  .tiempo { font-size: 16px; padding: 4px 12px; }
  .match-teams { gap: 6px; }
  .team-info { width: 28%; gap: 4px; }
  .team-nombre { font-size: 12px; }
  .team-logo { width: 28px; height: 28px; }
  .marcador { padding: 6px 12px; min-width: 64px; gap: 4px; border-radius: 10px; }
  .puntaje { font-size: 20px; min-width: 20px; }
  .separador { font-size: 12px; }
  .tabla-posiciones { font-size: 12px; min-width: 500px; }
  .tabla-posiciones th, .tabla-posiciones td { padding: 10px 6px; }
  .tabla-posiciones .td-equipo { min-width: 110px; font-size: 11px; }
  .tabla-posiciones .td-pos { font-size: 12px; }
  .tabla-posiciones .td-pts { font-size: 15px; }
  .filtros select { min-width: 100%; font-size: 13px; padding: 12px 40px 12px 14px; }
  .card { padding: 14px; border-radius: 14px; }
  .card select { font-size: 13px; }
  .admin-cta { padding: 24px 16px; }
  .admin-cta p { font-size: 14px; }
  .admin-wa { font-size: 14px; padding: 8px 18px; }
  .footer { font-size: 10px; padding: 28px 0 14px; }
}

@media (max-width: 380px) {
  .container { padding: 10px 8px; }
  .titulo { font-size: 28px; letter-spacing: 1px; }
  .logo-fni { width: 38px; }
  .match-card { padding: 10px; }
  .match-teams { flex-direction: column; gap: 8px; }
  .team-info, .team-info.right { width: 100%; justify-content: center; }
  .team-nombre { font-size: 11px; }
  .team-logo { width: 24px; height: 24px; }
  .marcador { padding: 4px 10px; }
  .puntaje { font-size: 18px; }
}
