/* ═══════════════════════════════════════════════════════════════════
   CUPFUTSAL CASPE 2026 — ESTILOS PRINCIPALES
   Mobile-first · Dark theme · Acentos dorados
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────
   1. VARIABLES CSS
─────────────────────────────────────────────── */
:root {
  /* Colores */
  --bg:           #0a1628;
  --bg-deep:      #070f1d;
  --bg-card:      #0f1e35;
  --bg-card-alt:  #112244;
  --bg-card-hover:#132750;
  --gold:         #f5b942;
  --gold-dark:    #d4af37;
  --gold-dim:     rgba(245, 185, 66, 0.18);
  --gold-subtle:  rgba(245, 185, 66, 0.08);
  --white:        #ffffff;
  --text:         #dde6f5;
  --text-muted:   #6b82a0;
  --border:       rgba(245, 185, 66, 0.18);
  --border-faint: rgba(255, 255, 255, 0.06);
  --error:        #ff4b4b;
  --success:      #2ecc71;

  /* Tipografía */
  --font-display: 'Bebas Neue', 'Arial Black', sans-serif;
  --font-body:    'Poppins', 'Segoe UI', sans-serif;

  /* Espaciado */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl:3rem;

  /* Bordes */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Sombras */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 20px rgba(245,185,66,0.15);

  /* Transiciones */
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ───────────────────────────────────────────────
   2. RESET Y BASE
─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img.eq-logo {
  width: 28px;
  height: 28px;
  max-width: 28px;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
}

/* Accesibilidad: ocultar visualmente pero accesible para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ───────────────────────────────────────────────
   3. UTILIDADES
─────────────────────────────────────────────── */
.hidden { display: none !important; }

.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }

/* ───────────────────────────────────────────────
   4. BOTONES GLOBALES
─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  min-height: 44px; /* touch target mínimo */
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  user-select: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245,185,66,0.3);
}

.btn-gold:hover {
  box-shadow: 0 6px 25px rgba(245,185,66,0.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border-faint);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border);
}

.btn-outline-gold:hover {
  background: var(--gold-subtle);
}

.btn-danger {
  background: rgba(255,75,75,0.15);
  color: var(--error);
  border: 1px solid rgba(255,75,75,0.3);
}

/* ───────────────────────────────────────────────
   5. CABECERA (HEADER)
─────────────────────────────────────────────── */
.site-header {
  position: relative;
  background: linear-gradient(180deg, #07101f 0%, var(--bg) 100%);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Logo como marca de agua de fondo */
.header-logo-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  background: url('/assets/logo.png') center / contain no-repeat;
  opacity: 0.06;
  pointer-events: none;
}

/* Efecto de luces de estadio (gradiente radial dorado desde arriba) */
.header-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(245,185,66,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 100%, rgba(10,30,70,0.5) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 100%, rgba(10,30,70,0.5) 0%, transparent 60%);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
}

.header-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 4.5rem);
  color: var(--gold);
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow:
    0 0 40px rgba(245,185,66,0.35),
    0 2px 4px rgba(0,0,0,0.5);
}

.header-subtitle {
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 0.35rem;
  font-weight: 300;
}

/* ───────────────────────────────────────────────
   6. NAVEGACIÓN DE CATEGORÍAS
─────────────────────────────────────────────── */
.cat-nav {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.cat-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  padding: 0 0.25rem;
}

.cat-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.cat-tab {
  flex-shrink: 0;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 44px;
}

.cat-tab:hover:not(.active) {
  color: rgba(255,255,255,0.75);
}

.cat-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.cat-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

/* ───────────────────────────────────────────────
   7. MAIN — contenedor principal
─────────────────────────────────────────────── */
#main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

/* ───────────────────────────────────────────────
   8. ESTADOS: CARGA Y ERROR
─────────────────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-card);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
}

.error-state .error-icon { font-size: 2.5rem; }
.error-state h2 { color: var(--text); font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.05em; }

/* ───────────────────────────────────────────────
   9. SECCIONES DE CONTENIDO
─────────────────────────────────────────────── */
.content-section {
  margin-bottom: var(--space-2xl);
}

/* Título de sección con línea decorativa */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

.section-title-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(245,185,66,0.35), transparent);
  margin-left: 0.5rem;
}

/* ───────────────────────────────────────────────
   10. TARJETAS DE PARTIDOS (Resultados y Próximos)
─────────────────────────────────────────────── */
.partido-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

/* Brillo sutil al hover */
.partido-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,185,66,0.04) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}

.partido-card:hover::before { opacity: 1; }
.partido-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245,185,66,0.3);
  box-shadow: var(--shadow-card);
}

.partido-equipo {
  font-weight: 600;
  font-size: clamp(0.78rem, 2.5vw, 0.9rem);
  color: var(--text);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.partido-equipo.local    { justify-content: flex-end; }
.partido-equipo.visitante { justify-content: flex-start; }

.eq-logo-nombre {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.eq-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-faint);
  flex-shrink: 0;
  display: block;
}

.eq-logo-inicial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-dim);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Botón subir logo en el panel admin */
.btn-logo-upload {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-logo-upload:hover {
  border-color: var(--gold);
  background: rgba(245,185,66,0.28);
  transform: scale(1.08);
}

.btn-logo-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-logo-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 75, 75, 0.4);
  background: rgba(255, 75, 75, 0.12);
  color: #ff6b6b;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.btn-logo-delete:hover {
  border-color: #ff4b4b;
  background: rgba(255, 75, 75, 0.28);
  transform: scale(1.1);
}

.logo-preview-admin {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.partido-marcador {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--gold);
  text-align: center;
  white-space: nowrap;
  min-width: 70px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(245,185,66,0.3);
}

.partido-marcador.pendiente {
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Mensaje vacío cuando no hay datos */
.empty-msg {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* ───────────────────────────────────────────────
   11. TARJETAS DE PRÓXIMOS PARTIDOS (con hora)
─────────────────────────────────────────────── */
.proximo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: 0.5rem;
  transition: transform var(--transition), border-color var(--transition);
  position: relative;
}

/* Cabecera de día dentro del calendario de horarios */
.horario-dia-titulo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  margin: var(--space-lg) 0 0.6rem;
}

.horario-dia-titulo:first-child {
  margin-top: 0;
}

.proximo-card:hover {
  transform: translateY(-1px);
  border-color: rgba(245,185,66,0.3);
}

.proximo-hora-bloque {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 66px;
  max-width: 92px;
  text-align: center;
  flex-shrink: 0;
  border-right: 1px solid var(--border-faint);
  padding-right: var(--space-sm);
}

.proximo-hora {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  line-height: 1;
  letter-spacing: 0.04em;
}

.proximo-dia {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.proximo-enfrentamiento {
  flex: 1;
  font-size: clamp(0.78rem, 2.5vw, 0.88rem);
  font-weight: 500;
}

.proximo-local    { text-align: right; }
.proximo-vs       { color: var(--text-muted); font-size: 0.7rem; text-align: center; }
.proximo-visitante { text-align: left; }

.proximo-partido-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}

/* ───────────────────────────────────────────────
   12. TABLAS DE CLASIFICACIÓN
─────────────────────────────────────────────── */
.clasificacion-grupo {
  margin-bottom: var(--space-xl);
}

.grupo-titulo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

/* Listado de equipos del grupo (logo + nombre), antes de la tabla de stats */
.grupo-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.roster-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.tabla-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tabla-clasificacion {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  min-width: 360px; /* evita compresión excesiva en móvil */
}

.tabla-clasificacion thead tr {
  border-bottom: 1px solid var(--border);
}

.tabla-clasificacion th {
  padding: 0.6rem 0.4rem;
  text-align: center;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
  background: rgba(245,185,66,0.04);
}

.tabla-clasificacion th:first-child,
.tabla-clasificacion td:first-child {
  text-align: left;
  padding-left: 0.75rem;
  min-width: 120px;
}

.tabla-clasificacion td {
  padding: 0.65rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--border-faint);
  white-space: nowrap;
}

/* Los 2 primeros de cada grupo (clasificados) — fondo ligeramente diferente */
.tabla-clasificacion tbody tr:nth-child(1) td,
.tabla-clasificacion tbody tr:nth-child(2) td {
  background: rgba(245,185,66,0.04);
}

/* Icono de clasificado antes del nombre del equipo */
.tabla-clasificacion tbody tr:nth-child(1) td.celda-equipo::before {
  content: '●';
  color: var(--gold);
  font-size: 0.55rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tabla-clasificacion tbody tr:nth-child(2) td.celda-equipo::before {
  content: '●';
  color: rgba(245,185,66,0.5);
  font-size: 0.55rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.tabla-clasificacion .celda-equipo {
  font-weight: 600;
  color: var(--text);
}

.celda-equipo-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tabla-clasificacion .celda-pts {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  font-weight: 700;
}

.tabla-clasificacion tbody tr:last-child td {
  border-bottom: none;
}

.tabla-clasificacion tbody tr:hover td {
  background: var(--bg-card-hover);
}

/* ───────────────────────────────────────────────
   13. ELIMINATORIA / BRACKET
─────────────────────────────────────────────── */
.eliminatoria-grid {
  display: grid;
  gap: var(--space-md);
}

/* Tarjeta de enfrentamiento en la eliminatoria */
.bracket-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.bracket-match-card.final-card {
  border-color: rgba(245,185,66,0.4);
  box-shadow: 0 0 25px rgba(245,185,66,0.1);
}

.bracket-match-card:hover {
  border-color: rgba(245,185,66,0.35);
}

/* Etiqueta de ronda (SEMIFINAL 1, FINAL...) */
.bracket-ronda-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(245,185,66,0.65);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bracket-ronda-label.final-label {
  color: var(--gold);
  font-size: 0.75rem;
}

/* Hora y día del partido en la eliminatoria */
.bracket-horario {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

.bracket-equipos {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
}

.bracket-equipo {
  font-weight: 600;
  font-size: clamp(0.82rem, 2.8vw, 0.95rem);
  line-height: 1.3;
  color: var(--text);
}

.bracket-equipo.local      { text-align: right; }
.bracket-equipo.por-definir { color: var(--text-muted); font-style: italic; font-weight: 400; }
.bracket-equipo.ganador    { color: var(--gold); }

.bracket-score {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 1.8rem);
  color: var(--gold);
  text-align: center;
  min-width: 64px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(245,185,66,0.25);
}

.bracket-score.pendiente {
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* ──── Campeón destacado ──── */
.campeon-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: 0 0 40px rgba(245,185,66,0.18), var(--shadow-card);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-md);
}

.campeon-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245,185,66,0.07) 0%, transparent 70%);
}

.campeon-trofeo {
  font-size: 3.5rem;
  position: relative;
  animation: trofeo-pulse 2.5s ease-in-out infinite;
  display: block;
  margin-bottom: var(--space-sm);
}

@keyframes trofeo-pulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%       { transform: scale(1.08) rotate(3deg); }
}

.campeon-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  font-weight: 600;
  position: relative;
}

.campeon-nombre {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.5rem);
  color: var(--gold);
  letter-spacing: 0.07em;
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(245,185,66,0.4);
  position: relative;
}

.pendiente-grupos-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* ───────────────────────────────────────────────
   14. FOOTER
─────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  position: relative;
  margin-top: var(--space-2xl);
}

.footer-text {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Botón admin — discreto, esquina inferior derecha */
.admin-trigger-btn {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: rgba(255,255,255,0.12);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  transition: color var(--transition);
  border-radius: var(--radius-sm);
}

.admin-trigger-btn:hover { color: rgba(255,255,255,0.4); }

/* ───────────────────────────────────────────────
   15. MODAL / OVERLAY DE ADMIN
─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 8, 18, 0.98);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── LOGIN SCREEN ── */
.admin-login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-md);
}

.admin-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-card);
}

.admin-login-logo {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.admin-login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.admin-login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.admin-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.admin-password-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.75rem var(--space-md);
  font-size: 0.95rem;
  text-align: center;
  letter-spacing: 0.1em;
  transition: border-color var(--transition);
  min-height: 44px;
}

.admin-password-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(245,185,66,0.15);
}

.admin-error {
  color: var(--error);
  font-size: 0.82rem;
  margin-bottom: var(--space-sm);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

.admin-close-btn { margin-top: var(--space-sm); }

/* ── PANEL ADMIN ── */
.admin-panel {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.admin-header {
  background: var(--bg-deep);
  padding: 0.75rem var(--space-md);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-header-title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  white-space: nowrap;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-header-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  min-height: 38px;
  white-space: nowrap;
}

.admin-cat-selector {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-faint);
  padding: 0.6rem var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.admin-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-select {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 36px;
}

.admin-select:focus {
  outline: none;
  border-color: var(--gold);
}

.admin-tabs-nav {
  background: var(--bg-deep);
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs-nav::-webkit-scrollbar { display: none; }

.admin-tab {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.admin-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.admin-tab:hover:not(.active) {
  color: var(--text);
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  -webkit-overflow-scrolling: touch;
}

.admin-tab-content { display: block; }
.admin-tab-content.hidden { display: none; }

.admin-save-bar {
  background: rgba(245,185,66,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.admin-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

/* ── Formulario de equipos ── */
.admin-groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 640px) {
  .admin-groups-grid { grid-template-columns: 1fr 1fr; }
}

.admin-group-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.admin-group-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: var(--space-md);
}

.admin-equipo-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 0.5rem;
}

.admin-equipo-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 20px;
  font-weight: 600;
}

.btn-equipo-remove {
  background: none;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-equipo-remove:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  color: #dc2626;
}

.btn-equipo-add {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px dashed var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.45rem 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
  transition: border-color var(--transition), color var(--transition);
}
.btn-equipo-add:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.admin-text-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
  min-height: 38px;
}

.admin-text-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.09);
}

/* ── Formulario de partidos ── */
.admin-grupo-header {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: var(--space-lg) 0 var(--space-sm);
  text-transform: uppercase;
}

.admin-partido-card {
  background: var(--bg-card);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}

.admin-partido-card:hover {
  border-color: var(--border);
}

.admin-partido-equipos {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.admin-partido-sep {
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 0.35rem;
}

.admin-partido-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-score-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-score-input {
  width: 52px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-align: center;
  padding: 0.3rem;
  min-height: 36px;
}

.admin-score-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.1);
}

.admin-score-sep {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-muted);
}

.admin-dia-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-body);
  min-height: 36px;
}

.admin-hora-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  width: 80px;
  min-height: 36px;
}

.admin-hora-input:focus,
.admin-dia-select:focus {
  outline: none;
  border-color: var(--gold);
}

.admin-jugado-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  min-height: 36px;
}

.admin-jugado-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.admin-save-partido-btn {
  margin-left: auto;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  min-height: 36px;
}

/* ── Formulario eliminatoria (admin) ── */
.admin-elim-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.admin-elim-label {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.admin-elim-equipos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: 0.65rem;
}

.admin-elim-equipo-block label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.admin-loading-msg {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: var(--space-md);
  font-style: italic;
}

/* ── Toast de notificación ── */
.toast {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  z-index: 99999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--error);   color: var(--error); }

/* ───────────────────────────────────────────────
   15b. LEYENDA DE TABLA
─────────────────────────────────────────────── */
.tabla-leyenda {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tabla-leyenda::before {
  content: "●";
  color: var(--gold);
  font-size: 0.6rem;
}

/* ───────────────────────────────────────────────
   16. ANIMACIONES DE SCROLL REVEAL
─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger para elementos en lista */
.reveal-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.15s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.20s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.25s; }
.reveal-stagger > *:nth-child(n+6) { transition-delay: 0.28s; }

/* Transición de categoría (fade) */
.cat-fade-out {
  animation: catFadeOut 0.15s ease forwards;
}

.cat-fade-in {
  animation: catFadeIn 0.25s ease forwards;
}

@keyframes catFadeOut {
  to { opacity: 0; transform: translateY(6px); }
}

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

/* ───────────────────────────────────────────────
   17. RESPONSIVE — Tablet (768px+)
─────────────────────────────────────────────── */
@media (min-width: 768px) {
  .site-header {
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
  }

  #main-content {
    padding: var(--space-xl);
  }

  .eliminatoria-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* La Final ocupa el ancho completo en desktop */
  .eliminatoria-grid .final-card {
    grid-column: 1 / -1;
  }

  .campeon-card {
    max-width: 500px;
    margin: var(--space-md) auto 0;
  }
}

/* ───────────────────────────────────────────────
   18. RESPONSIVE — Desktop (1024px+)
─────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .site-header {
    padding: var(--space-2xl) var(--space-2xl) var(--space-xl);
  }

  .header-logo-bg {
    width: 250px;
    height: 250px;
  }

  .cat-tab {
    font-size: 0.82rem;
    padding: 0.9rem 1.4rem;
  }

  .admin-panel {
    max-width: 860px;
    margin: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    height: calc(100vh - 2rem);
    margin-top: 1rem;
    overflow: hidden;
  }
}

/* ───────────────────────────────────────────────
   19. REDUCED MOTION — respetar preferencias del sistema
─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .campeon-trofeo {
    animation: none;
  }

  .spinner {
    animation: none;
    border-top-color: var(--gold);
    opacity: 0.6;
  }
}
