/* =============================================
   Quiniela Mundialista - Estilos Principales
   FIFA World Cup 2026
   ============================================= */

:root {
  --bg-primary:    #04091A;
  --bg-secondary:  #081428;
  --bg-card:       #0C1D38;
  --bg-card-hover: #102244;
  --gold:          #F4A429;
  --gold-dark:     #C4841E;
  --green:         #00C49A;
  --green-dark:    #009977;
  --red:           #CC0033;
  --blue:          #005BAA;
  --blue-light:    #0080D6;
  --text-primary:  #F0F5FF;
  --text-muted:    #7898C0;
  --border:        rgba(0, 91, 170, 0.3);
  --border-gold:   rgba(244, 164, 41, 0.25);
  --shadow:        0 4px 24px rgba(0,0,0,0.55);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(4, 9, 26, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 91, 170, 0.4);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 64px;
}

/* Fila de tabs mobile: oculta en escritorio */
.navbar-tabs-mobile {
  display: none;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  text-decoration: none;
  opacity: 0.85;
}
.navbar-brand span {
  color: inherit;
  -webkit-text-fill-color: inherit;
}

.brand-logo {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(204,0,51,0.4));
}

.navbar-brand .ball { font-size: 1.5rem; }

.nav-menu {
  display: flex;
  flex-direction: row;
  gap: 0.25rem;
  list-style: none;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--gold);
  background: rgba(244, 164, 41, 0.12);
}

.btn-config {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-config:hover {
  border-color: var(--blue-light);
  color: var(--blue-light);
  background: rgba(0, 128, 214, 0.1);
}

/* ===================== HERO ===================== */
.hero {
  position: relative;
  padding: 3rem 1.5rem 3rem;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(180deg, #020810 0%, #05101E 50%, #060D1C 100%);
}

/* Aurora capa 1 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 90% 60% at 15% 45%, rgba(0,91,170,0.32) 0%, transparent 60%),
    radial-gradient(ellipse 75% 55% at 82% 35%, rgba(70,0,180,0.22) 0%, transparent 58%),
    radial-gradient(ellipse 60% 45% at 50% 0%,  rgba(0,196,154,0.14) 0%, transparent 52%),
    radial-gradient(ellipse 55% 40% at 68% 80%, rgba(0,60,200,0.16) 0%, transparent 50%);
  animation: heroAurora1 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

/* Aurora capa 2 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 65% 50% at 78% 65%, rgba(40,0,140,0.2) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 22% 72%, rgba(0,120,220,0.16) 0%, transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 90%, rgba(0,91,170,0.1) 0%, transparent 45%);
  animation: heroAurora2 16s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}

@keyframes heroAurora1 {
  0%   { opacity: 0.7;  transform: scale(1)    translate(0,   0);    }
  50%  { opacity: 1;    transform: scale(1.05) translate(-1.5%, 1%); }
  100% { opacity: 0.85; transform: scale(1.08) translate(1.5%, -2%); }
}

@keyframes heroAurora2 {
  0%   { opacity: 0.6;  transform: scale(1)    translate(0,    0);   }
  50%  { opacity: 0.9;  transform: scale(1.04) translate(2%,  -1%); }
  100% { opacity: 0.75; transform: scale(1.07) translate(-2%,  2%); }
}

.hero-wc-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  pointer-events: none;
  animation: wcLogoFloat 6s ease-in-out infinite;
}

/* Anillo giratorio exterior */
.hero-wc-logo::before {
  content: '';
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: rgba(244,164,41,0.45);
  border-right-color: rgba(0,91,170,0.3);
  animation: wcRingSpin 8s linear infinite;
  pointer-events: none;
}

/* Segundo anillo más lento, dirección opuesta */
.hero-wc-logo::after {
  content: '';
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-bottom-color: rgba(204,0,51,0.35);
  border-left-color: rgba(0,196,154,0.25);
  animation: wcRingSpin 12s linear infinite reverse;
  pointer-events: none;
}

@keyframes wcLogoFloat {
  0%, 100% { transform: translate(-50%, -50%); }
  50%       { transform: translate(-50%, calc(-50% - 14px)); }
}

@keyframes wcRingSpin {
  to { transform: rotate(360deg); }
}

.hero-wc-logo img {
  height: 340px;
  width: auto;
  display: block;
  opacity: 0.40;
  position: relative;
  z-index: 1;
  animation: wcLogoGlow 3s ease-in-out infinite alternate;
}

@keyframes wcLogoGlow {
  0%   { filter: drop-shadow(0 0 20px rgba(204,0,51,0.5)) drop-shadow(0 0 40px rgba(0,91,170,0.4)); }
  50%  { filter: drop-shadow(0 0 30px rgba(244,164,41,0.65)) drop-shadow(0 0 60px rgba(0,91,170,0.5)); }
  100% { filter: drop-shadow(0 0 50px rgba(204,0,51,0.9)) drop-shadow(0 0 90px rgba(0,91,170,0.75)) drop-shadow(0 0 110px rgba(244,164,41,0.5)); }
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border: 1px solid rgba(0, 91, 170, 0.4);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--gold) 0%, #fff 40%, var(--blue-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.hero-quiniela-name {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(244,164,41,0.12);
  border: 1px solid rgba(244,164,41,0.35);
  border-radius: 100px;
  padding: 0.25rem 1.1rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

/* ---- Countdown ---- */
.countdown-wrap {
  display: inline-flex;
  gap: 1.2rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
}

.countdown-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.2rem;
}

.countdown-sep {
  align-self: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--border);
  margin-top: -0.4rem;
}

/* ---- Pot ---- */
.pot-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(145deg, rgba(20,35,65,0.95) 0%, rgba(10,22,45,0.98) 100%);
  border: 1px solid rgba(244,164,41,0.55);
  border-radius: var(--radius);
  padding: 1.4rem 3rem;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(244,164,41,0.1),
    0 8px 40px rgba(0,0,0,0.5),
    0 0 50px rgba(244,164,41,0.12);
  animation: potPulse 4s ease-in-out infinite alternate;
}

.pot-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(244,164,41,0.8) 30%, rgba(0,196,154,0.6) 70%, transparent 100%);
  animation: potBeam 3s linear infinite;
  background-size: 200% 100%;
}

.pot-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(244,164,41,0.07) 0%, transparent 70%);
  pointer-events: none;
}

@keyframes potPulse {
  0%   { box-shadow: 0 0 0 1px rgba(244,164,41,0.1), 0 8px 40px rgba(0,0,0,0.5), 0 0 30px rgba(244,164,41,0.08); }
  100% { box-shadow: 0 0 0 1px rgba(244,164,41,0.2), 0 8px 40px rgba(0,0,0,0.5), 0 0 60px rgba(244,164,41,0.2), 0 0 100px rgba(244,164,41,0.07); }
}

@keyframes potBeam {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pot-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(244,164,41,0.75);
  margin-bottom: 0.4rem;
}

.pot-amount {
  font-size: 3rem;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(244,164,41,0.45), 0 2px 4px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.pot-calc-row {
  font-size: 0.8rem;
  color: rgba(0,196,154,0.85);
  font-weight: 600;
  margin-top: 0.3rem;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

.pot-subtitle {
  font-size: 0.75rem;
  color: rgba(120,152,192,0.75);
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

/* ===================== MAIN TABS ===================== */
.main-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 1rem 1.5rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  overflow-x: auto;
  scrollbar-width: none;
}

.main-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ===================== CONTENT ===================== */
.tab-content {
  display: none;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tab-content.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.section-title span {
  color: var(--gold);
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold);
  color: #0d1b2a;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(244,164,41,0.06); }

.btn-green {
  background: var(--green);
  color: #0d1b2a;
}
.btn-green:hover { background: var(--green-dark); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(231,76,60,0.4);
}
.btn-danger:hover { background: rgba(231,76,60,0.12); }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 1rem; }

/* ===================== MODE SELECTOR ===================== */
.mode-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.mode-card {
  flex: 1;
  max-width: 220px;
  padding: 1.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--bg-card);
}

.mode-card:hover { border-color: var(--gold); background: var(--bg-card-hover); }
.mode-card.selected { border-color: var(--gold); background: rgba(244,164,41,0.1); }

.mode-card .mode-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--gold);
}

.mode-card .mode-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===================== PARTICIPANT CARDS ===================== */
.participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.participant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.participant-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--green));
  opacity: 0;
  transition: opacity var(--transition);
}

.participant-card:hover { border-color: rgba(244,164,41,0.4); }
.participant-card:hover::before { opacity: 1; }

.participant-card.winner {
  border-color: var(--gold);
  background: rgba(244,164,41,0.08);
}

.participant-card.winner::before { opacity: 1; }

.participant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.participant-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: #0d1b2a;
  flex-shrink: 0;
}

.participant-info { flex: 1; margin-left: 0.75rem; }

.participant-name {
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.participant-name:hover { color: var(--gold); }

.participant-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge-paid {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-weight: 600;
}

.badge-paid.yes { background: rgba(0,196,154,0.18); color: var(--green); }
.badge-paid.no  { background: rgba(231,76,60,0.15); color: var(--red); }

.participant-teams {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.team-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.team-pill .team-flag { font-size: 1.2rem; }
.team-pill .team-name { font-weight: 500; }
.team-pill .team-conf { font-size: 0.7rem; color: var(--text-muted); margin-left: auto; }

.team-pill.eliminated {
  opacity: 0.4;
  text-decoration: line-through;
}

.no-teams {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.participant-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ---- Add Participant ---- */
.add-participant-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.input-group {
  display: flex;
  flex: 1;
  min-width: 200px;
}

.form-control {
  flex: 1;
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.form-control:focus { border-color: var(--gold); }
.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-secondary); }

/* ---- Sorteo Banner ---- */
.sorteo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(135deg, rgba(244,164,41,0.12), rgba(0,196,154,0.08));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.sorteo-banner p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 500px;
}

/* ===================== WIN PROBABILITY BAR ===================== */
.match-main-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.match-team-info {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.fifa-rank {
  font-size: .68rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .5px;
  opacity: .85;
}

.win-prob-bar {
  display: flex;
  height: 20px;
  border-radius: 100px;
  overflow: hidden;
  margin-top: .75rem;
  font-size: .65rem;
  font-weight: 800;
}

.win-prob-home,
.win-prob-draw,
.win-prob-away {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  overflow: hidden;
  transition: width .4s ease;
}

.win-prob-home { background: rgba(0,196,154,.75); color: #0d1b2a; }
.win-prob-draw { background: rgba(255,255,255,.18); color: var(--text-muted); }
.win-prob-away { background: rgba(244,164,41,.75);  color: #0d1b2a; }

.win-prob-labels {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .3rem;
  padding: 0 .1rem;
}

/* ===================== MATCHES ===================== */
.matches-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(244,164,41,0.08);
}

.match-day {
  margin-bottom: 2rem;
}

.match-day-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.match-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: all var(--transition);
}

.match-card:hover { border-color: rgba(244,164,41,0.3); background: var(--bg-card-hover); }

.match-card.live {
  border-color: var(--red);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--red); }
  50% { border-color: rgba(231,76,60,0.3); }
}

.match-team {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.match-team.away { justify-content: flex-end; flex-direction: row; }

.match-team-flag { font-size: 1.5rem; line-height:1; }
.flag-img {
  width: 40px;
  height: 27px;
  object-fit: cover;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.flag-fallback { font-size: 1.4rem; }

/* LOCAL / VISITANTE label */
.team-role-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: .1rem .35rem;
  border-radius: 3px;
  margin-bottom: .15rem;
}
.team-role-badge.local    { background: rgba(0,91,170,.25); color: var(--blue-light); }
.team-role-badge.visitor  { background: rgba(204,0,51,.2);  color: #ff4466; }

/* TV broadcaster badges */
.match-tv {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  padding: .4rem .75rem .5rem;
  border-top: 1px solid var(--border);
}
.tv-badge {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .5px;
  padding: .1rem .4rem;
  text-transform: uppercase;
}
.match-venue {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem .45rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .68rem;
}
.match-venue i { font-size: .6rem; color: rgba(244,164,41,0.55); }
.tv-venue-inline {
  margin-left: auto;
  color: var(--text-muted);
  font-size: .6rem;
  display: flex;
  align-items: center;
  gap: .25rem;
  opacity: .75;
}
.tv-venue-inline i { font-size: .55rem; color: rgba(244,164,41,0.6); }
.match-team-name { font-weight: 600; font-size: 0.95rem; }

.match-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .65rem;
  font-weight: 700;
  color: var(--gold, #f4a429);
  background: rgba(244,164,41,.1);
  border: 1px solid rgba(244,164,41,.25);
  border-radius: 20px;
  padding: .08rem .45rem;
  margin-top: .1rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-center {
  text-align: center;
  min-width: 90px;
}

.match-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.match-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.match-group {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.1rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===================== TRANSMISIONES ===================== */
.streams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.stream-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand, var(--border-gold));
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.stream-card:hover {
  border-color: rgba(244,164,41,0.4);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stream-logo {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.stream-logo img {
  max-height: 60px;
  max-width: 140px;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 6px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.stream-logo-fallback {
  height: 60px;
  width: 120px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.stream-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.stream-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.stream-type {
  font-size: 0.72rem;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  font-weight: 600;
  display: inline-block;
}

.stream-type.gratis { background: rgba(0,196,154,0.18); color: var(--green); }
.stream-type.premium { background: rgba(244,164,41,0.18); color: var(--gold); }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Selector más específico [0,2,0] + !important para ganar a Bootstrap [0,1,0] */
.modal-overlay > .modal {
  display:   block    !important;
  position:  relative !important;
  top:       auto     !important;
  left:      auto     !important;
  height:    auto     !important;
  overflow:  visible  !important;
  z-index:   auto     !important;
  width:     100%;
  max-width: 520px;
  padding: 2rem;
  background: #2A4D8F;
  border: 1px solid rgba(100, 160, 255, 0.5);
  border-radius: var(--radius);
  transform: translateY(-14px);
  transition: transform 0.2s ease;
  box-shadow: 0 0 0 1px rgba(244,164,41,0.1), 0 28px 80px rgba(0,0,0,0.75);
}

.modal-overlay > .modal.modal-admin {
  background: #1F3D7A;
  border-color: rgba(244,164,41,0.4);
  max-width: 680px;
}

.modal-overlay.open > .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-title { font-size: 1.2rem; font-weight: 800; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.modal-close:hover { background: rgba(231,76,60,0.2); color: var(--red); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
}

/* ===================== STATS BAR ===================== */
.stats-bar {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  background: linear-gradient(145deg, rgba(12,29,56,0.9) 0%, rgba(6,15,32,0.95) 100%);
  border: 1px solid rgba(0,91,170,0.35);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  text-align: center;
  flex: 1;
  min-width: 110px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(244,164,41,0.7) 50%, transparent 100%);
  opacity: 0.5;
  transition: opacity var(--transition);
}

.stat-item:hover {
  border-color: rgba(244,164,41,0.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 35px rgba(0,0,0,0.4), 0 0 25px rgba(244,164,41,0.08), inset 0 1px 0 rgba(255,255,255,0.06);
}

.stat-item:hover::before { opacity: 1; }

.stat-value {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--gold);
  display: block;
  line-height: 1;
  text-shadow: 0 0 20px rgba(244,164,41,0.35);
}

.stat-label {
  font-size: 0.63rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.45rem;
  display: block;
}

/* ===================== ALERTS ===================== */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-info    { background: rgba(244,164,41,0.1); border-color: rgba(244,164,41,0.3); color: #f4d080; }
.alert-success { background: rgba(0,196,154,0.1);  border-color: rgba(0,196,154,0.3); color: var(--green); }
.alert-danger  { background: rgba(231,76,60,0.1);  border-color: rgba(231,76,60,0.3); color: #f09090; }

/* ===================== LOADING ===================== */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  color: var(--text-muted);
  flex-direction: column;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== EMPTY STATE ===================== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.empty-state p { font-size: 0.88rem; }

/* ===================== FOOTER ===================== */
.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
  /* Navbar ocupa todo el ancho */
  .navbar { width: 100%; box-sizing: border-box; }
  .navbar-top {
    width: 100%;
    padding: 0 .75rem;
    height: 52px;
    box-sizing: border-box;
  }
  .nav-menu { display: none; }
  .navbar-brand { font-size: .95rem; gap: .35rem; flex: 1; min-width: 0; }
  .navbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-logo { height: 26px; flex-shrink: 0; }
  .btn-config { font-size: .75rem; padding: .35rem .65rem; flex-shrink: 0; }

  /* Fila de botones dentro del navbar */
  .navbar-tabs-mobile {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .35rem;
    padding: .4rem .5rem;
    width: 100%;
    box-sizing: border-box;
    background: rgba(4,9,26,.6);
    border-top: 1px solid rgba(0,91,170,.25);
  }
  .navbar-tabs-mobile .tab-btn {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    padding: .45rem .1rem;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
    justify-content: center;
    color: var(--text-muted);
    transition: all .2s;
  }
  .navbar-tabs-mobile .tab-btn.active {
    background: rgba(244,164,41,.15);
    border-color: rgba(244,164,41,.5);
    color: var(--gold);
  }

  /* Ocultar el main-tabs externo en móvil */
  .main-tabs { display: none; }

  .hero { padding: 2.5rem 1rem 2rem; }
  .countdown-wrap { gap: 0.7rem; padding: 1rem; }
  .countdown-num { font-size: 1.6rem; }
  .match-main-row { gap: .5rem; }
  .match-team-name { font-size: 0.82rem; }
  .match-team-flag { font-size: 1.3rem; }
  .win-prob-labels { font-size: .6rem; }
  .mode-selector { flex-direction: column; align-items: center; }
  .participants-grid { grid-template-columns: 1fr; }
  .tab-content { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
  .match-main-row { grid-template-columns: 1fr auto 1fr; }
  .match-team.away { flex-direction: row; justify-content: flex-start; }
  .fifa-rank { display: none; }
}

/* ===================== WINNER BANNER ===================== */
.winner-banner {
  text-align: center;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(244,164,41,0.2), rgba(0,196,154,0.1));
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  animation: winner-glow 3s ease-in-out infinite;
}

@keyframes winner-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(244,164,41,0.3); }
  50% { box-shadow: 0 0 50px rgba(244,164,41,0.6); }
}

.winner-banner h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.winner-banner p {
  color: var(--text-muted);
}

/* ===================== TOOLTIP ===================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ===================== ADMIN PANEL ===================== */
.admin-session-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 196, 154, 0.08);
  border: 1px solid rgba(0, 196, 154, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.admin-section {
  padding: 1.2rem;
  background: rgba(12, 29, 56, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.admin-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===================== BRACKET / LLAVES ===================== */
.bk-round {
  margin-bottom: 2.5rem;
}

.bk-round-preview {
  opacity: 0.7;
  border-left: 3px solid rgba(244,164,41,0.2);
  padding-left: 1rem;
}
.bk-round-preview .bk-round-title { color: var(--text-muted); border-bottom-color: rgba(244,164,41,0.15); font-size: .95rem; }
.bk-match-preview { border-style: dashed; opacity: .85; }

.bk-round-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bk-round-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.bk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.bk-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.bk-match {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  transition: border-color var(--transition);
}

.bk-match:hover { border-color: rgba(244,164,41,0.4); }

.bk-match.tbd { opacity: 0.55; }

.bk-match-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  text-align: center;
  white-space: nowrap;
}

.bk-slot {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bk-slot.has-owner { background: rgba(244,164,41,0.06); border-radius: 4px; padding: 0.25rem 0.4rem; }

.bk-slot-icon { font-size: 0.9rem; line-height: 1; }

.bk-slot-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bk-owner-badge {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nombre del dueño (jugador de quiniela) prominente debajo del slot */
.bk-owner-inline {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: .2rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* Botón de edición para admin */
.bk-edit-btn {
  background: none;
  border: 1px solid rgba(244,164,41,0.25);
  border-radius: 6px;
  padding: 2px 5px;
  cursor: pointer;
  font-size: .75rem;
  opacity: 0;
  transition: opacity .15s, border-color .15s;
  flex-shrink: 0;
}
.bk-match:hover .bk-edit-btn { opacity: 1; }
.bk-edit-btn:hover { border-color: var(--gold); background: rgba(244,164,41,0.1); }

.bk-vs {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
}

.tbd-slot { opacity: 0.5; }

.bk-tbd {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 640px) {
  .bk-grid { grid-template-columns: 1fr; }
  .bk-grid-sm { grid-template-columns: 1fr; }
}

/* ===================== FOOTER ===================== */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.4) 100%);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-footer-logo img {
  height: 52px;
  width: auto;
  opacity: 0.6;
  filter: drop-shadow(0 0 8px rgba(244,164,41,0.3));
}

.site-footer-text { text-align: left; }

.site-footer-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 .15rem;
}

.site-footer-credit {
  font-size: .82rem;
  color: var(--gold);
  margin: 0 0 .1rem;
}

.site-footer-power {
  font-size: .72rem;
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 480px) {
  .site-footer-inner { flex-direction: column; gap: .8rem; }
  .site-footer-text  { text-align: center; }
}

/* ===================== SORTEO REVEAL ===================== */

.sr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  font-family: inherit;
}

.sr-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* Fondo */
.sr-bg {
  position: absolute;
  inset: 0;
  background: #01060f;
  z-index: 0;
}

.sr-stars {
  position: absolute;
  inset: 0;
  animation: srStarsTwinkle 6s ease-in-out infinite alternate;
}

@keyframes srStarsTwinkle {
  0%   { opacity: .7; }
  100% { opacity: 1; }
}

.sr-aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 25% 25%, rgba(0,91,170,.45) 0%, transparent 60%),
    radial-gradient(ellipse 65% 55% at 75% 70%, rgba(204,0,51,.35) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(40,0,160,.25) 0%, transparent 55%);
  animation: srAurora 9s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes srAurora {
  0%   { transform: scale(1) translate(0,0); opacity: .8; }
  50%  { transform: scale(1.06) translate(-2%,2%); opacity: 1; }
  100% { transform: scale(1.1) translate(2%,-1%); opacity: .85; }
}

/* Header */
.sr-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.4rem 1rem .4rem;
}

.sr-header-logo {
  font-size: 2.2rem;
  margin-bottom: .2rem;
  animation: srLogoPulse 1.6s ease-in-out infinite;
  display: inline-block;
}

@keyframes srLogoPulse {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50%       { transform: scale(1.18) rotate(5deg); }
}

.sr-header-title {
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 5px;
  background: linear-gradient(90deg, #f4a429 0%, #fff 45%, #3fa7f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  text-shadow: none;
}

.sr-header-sub {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
  margin-top: .25rem;
  letter-spacing: 1px;
}

/* Barra de progreso general */
.sr-progress-bar-wrap {
  position: relative;
  z-index: 1;
  width: min(560px, 88vw);
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  margin: .7rem auto .2rem;
  overflow: hidden;
}

.sr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f4a429, #3fa7f0);
  border-radius: 2px;
  transition: width .4s ease;
}

.sr-progress-text {
  position: relative;
  z-index: 1;
  font-size: .72rem;
  color: rgba(255,255,255,.45);
  text-align: center;
  margin-bottom: .4rem;
}

/* Stage */
.sr-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  min-height: 0;
}

/* Card wrap — maneja entry/exit */
.sr-card-wrap {
  position: relative;
}

.sr-card-wrap.sr-wrap-enter {
  animation: srWrapEnter .42s cubic-bezier(.3,1.5,.5,1) both;
}

.sr-card-wrap.sr-wrap-exit {
  animation: srWrapExit .35s ease-in both;
}

@keyframes srWrapEnter {
  0%   { transform: translateY(55px) scale(.82); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes srWrapExit {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-50px) scale(.75); opacity: 0; }
}

/* Card 3D flip */
.sr-card {
  width: min(340px, 82vw);
  height: 195px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.4,1.6,.5,.9);
}

.sr-card.sr-flipped {
  transform: rotateY(180deg);
}

.sr-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

/* Cara delantera — suspense */
.sr-card-front {
  background: linear-gradient(145deg, #0b2040 0%, #143060 50%, #0d2a52 100%);
  border: 2px solid rgba(0,91,170,.55);
  box-shadow:
    0 0 30px rgba(0,91,170,.3),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.sr-qmark {
  font-size: 4.5rem;
  font-weight: 900;
  color: rgba(255,255,255,.75);
  line-height: 1;
  animation: srQPulse 1.1s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(0,120,255,.6);
}

@keyframes srQPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 20px rgba(0,120,255,.5); }
  50%       { transform: scale(1.12); text-shadow: 0 0 45px rgba(0,180,255,.9); }
}

.sr-front-slot {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  margin-top: .55rem;
  text-align: center;
  letter-spacing: .3px;
}

/* Cara trasera — reveal */
.sr-card-back {
  background: linear-gradient(145deg, #6b2f00 0%, #a04800 45%, #c97000 100%);
  border: 2px solid rgba(244,164,41,.65);
  transform: rotateY(180deg);
  box-shadow:
    0 0 40px rgba(244,164,41,.35),
    inset 0 1px 0 rgba(255,255,255,.1);
}

.sr-back-initials {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: .5rem;
  opacity: 0;
  transform: scale(.5);
  transition: transform .35s cubic-bezier(.3,1.6,.5,.9), opacity .3s ease;
}

.sr-back-name {
  font-size: 1.7rem;
  font-weight: 900;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease .08s, transform .35s ease .08s;
}

.sr-back-slot {
  font-size: .85rem;
  color: rgba(255,255,255,.8);
  margin-top: .3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease .18s, transform .3s ease .18s;
}

/* Activar animaciones tras el flip */
.sr-back-shown .sr-back-initials {
  opacity: 1;
  transform: scale(1);
}

.sr-back-shown .sr-back-name {
  opacity: 1;
  transform: translateY(0);
}

.sr-back-shown .sr-back-slot {
  opacity: 1;
  transform: translateY(0);
}

/* Barra de suspense */
.sr-suspense-track {
  width: min(340px, 82vw);
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}

.sr-suspense-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(204,0,51,.9), rgba(244,164,41,1));
  border-radius: 3px;
  width: 0%;
}

/* Partículas */
.sr-particles-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  z-index: 10;
}

.sr-particle {
  position: absolute;
  transform: translate(-50%, -50%);
  animation: srBurst .85s ease-out forwards;
}

@keyframes srBurst {
  0%   { transform: translate(-50%,-50%) translate(0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) translate(var(--tx),var(--ty)) rotate(var(--rot)); opacity: 0; }
}

/* Controles */
.sr-controls {
  position: relative;
  z-index: 1;
  display: flex;
  gap: .75rem;
  padding: .8rem 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.sr-btn {
  min-width: 130px;
  font-size: .9rem;
}

/* Strip de resultados */
.sr-results-strip {
  position: relative;
  z-index: 1;
  display: flex;
  gap: .5rem;
  padding: .65rem 1rem;
  width: 100%;
  overflow-x: auto;
  min-height: 78px;
  align-items: center;
  background: rgba(0,0,0,.38);
  border-top: 1px solid rgba(255,255,255,.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(244,164,41,.3) transparent;
}

.sr-result-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .4rem .65rem;
  min-width: 92px;
  flex-shrink: 0;
  animation: srChipIn .4s cubic-bezier(.3,1.4,.5,.9) both;
}

@keyframes srChipIn {
  0%   { transform: scale(.6) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.sr-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(244,164,41,.25);
  border: 1px solid rgba(244,164,41,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 900;
  color: #f4a429;
}

.sr-chip-slot {
  font-size: .62rem;
  color: rgba(255,255,255,.55);
  text-align: center;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-chip-owner {
  font-size: .72rem;
  font-weight: 700;
  color: #f4a429;
  text-align: center;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Grupos en bracket ─────────────────────────────────── */
.bk-round-groups {
  padding-bottom: .75rem;
  border-bottom: 2px solid rgba(244,164,41,.15);
  margin-bottom: .75rem;
}
.bk-groups-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .82rem;
  padding: .5rem 0;
}
.bk-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .4rem;
  margin-top: .5rem;
}
.bk-group-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
}
.bk-group-header {
  background: rgba(244,164,41,.13);
  border-bottom: 1px solid rgba(244,164,41,.18);
  font-size: .65rem;
  font-weight: 800;
  color: var(--gold, #f4a429);
  padding: .18rem .45rem;
  text-align: center;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.bk-group-team {
  display: flex;
  align-items: center;
  gap: .28rem;
  padding: .14rem .38rem;
  font-size: .65rem;
  color: var(--text-primary, #e2e8f0);
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-width: 0;
}
.bk-group-team img {
  width: 20px;
  height: auto;
  flex-shrink: 0;
  border-radius: 2px;
  vertical-align: middle;
  display: inline-block;
}
.bk-group-team:last-child { border-bottom: none; }
.bk-group-team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.bk-group-pts {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--gold, #f4a429);
  font-weight: 700;
  font-size: .6rem;
}

/* ── Footer info bar ───────────────────────────────── */
.site-footer-info {
  text-align: center;
  padding: 1rem 1.5rem .75rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: .82rem;
  color: var(--text-muted, #94a3b8);
}
.site-footer-info strong { color: var(--text-primary, #e2e8f0); }

/* ── Grupos en sección Partidos ────────────────────── */
.pg-section {
  margin-bottom: 1.25rem;
}
.pg-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: .6rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}
.pg-subtitle {
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
}
.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .45rem;
}
.pg-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  overflow: hidden;
}
.pg-head {
  background: rgba(244,164,41,.13);
  border-bottom: 1px solid rgba(244,164,41,.2);
  font-size: .67rem;
  font-weight: 800;
  color: var(--gold, #f4a429);
  padding: .22rem .5rem;
  text-align: center;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.pg-team {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .45rem;
  font-size: .72rem;
  color: var(--text-primary, #e2e8f0);
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-width: 0;
}
.pg-team:last-child { border-bottom: none; }
.pg-team span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-pts {
  flex-shrink: 0;
  margin-left: auto;
  background: rgba(244,164,41,.18);
  color: var(--gold, #f4a429);
  font-weight: 700;
  font-size: .62rem;
  padding: .05rem .3rem;
  border-radius: 4px;
}
/* ── Botón flotante subir / bajar ──────────────────── */
#fab-scroll {
  position: fixed;
  bottom: 1.4rem;
  right: 1.1rem;
  z-index: 8000;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--gold, #f4a429);
  color: #0a1628;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transform: scale(.7);
  transition: opacity .25s, transform .25s;
}
#fab-scroll.fab-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
#fab-scroll:active { transform: scale(.92); }