/* ==========================================================================
   🎱 TORNEO SNOOKER BLACKPOOL MADRID - ESTILOS PREMIUM DARK V3
   Vallecas & Alcobendas | Nombres Grandes, Estados Visuales y Filtros Avanzados
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-dark: #0b0d13;
  --bg-primary: #121520;
  --bg-card: #181b2a;
  --bg-card-hover: #1f2337;
  --bg-surface: #1d2134;
  --bg-input: #10121c;
  
  --snooker-green: #0d6943;
  --snooker-green-light: #22c55e;
  --snooker-green-glow: rgba(34, 197, 94, 0.35);
  --snooker-green-card: rgba(13, 85, 52, 0.45);
  
  --gold: #f1b834;
  --gold-light: #ffd466;
  --gold-dark: #c48e14;
  --gold-glow: rgba(241, 184, 52, 0.35);
  --gold-card: rgba(241, 184, 52, 0.15);
  
  --ball-red: #ef4444;
  --text-main: #f0f3fa;
  --text-muted: #9ba4bc;
  --text-dim: #656e86;
  --text-gold: #f5c542;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(241, 184, 52, 0.4);
  --border-green: rgba(34, 197, 94, 0.45);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
  
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(13, 105, 67, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(241, 184, 52, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, rgba(18, 21, 32, 0.96) 0%, #0b0d13 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
}

/* ==========================================================================
   TOP SYSTEM & SYNC BAR
   ========================================================================== */

.top-system-bar {
  background: #07080d;
  border-bottom: 1px solid var(--border-color);
  padding: 0.45rem 1.25rem;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sync-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sync-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--snooker-green-light);
  box-shadow: 0 0 8px var(--snooker-green-light);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.admin-mode-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-admin-login-trigger {
  background: rgba(241, 184, 52, 0.18);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-admin-login-trigger:hover {
  background: var(--gold);
  color: #0b0d13;
  box-shadow: 0 0 12px var(--gold-glow);
}

.admin-badge-active {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid var(--border-green);
  color: #86efac;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Supabase Missing Table Banner Alert */
.supabase-alert-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2) 0%, rgba(241, 184, 52, 0.15) 100%);
  border-bottom: 2px solid var(--ball-red);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.supabase-alert-banner strong {
  color: #fca5a5;
}

/* ==========================================================================
   HEADER & HERO
   ========================================================================== */

.hero-header {
  position: relative;
  background: linear-gradient(180deg, rgba(22, 34, 58, 0.95) 0%, rgba(18, 21, 32, 0.98) 100%);
  border-bottom: 2px solid var(--border-gold);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1rem 1.25rem;
  overflow: hidden;
}

.hero-bg-texture {
  position: absolute;
  inset: 0;
  background-image: url('../IMG/Snooker1.jpg');
  background-size: cover;
  background-position: center 30%;
  opacity: 0.12;
  filter: blur(2px);
  pointer-events: none;
}

.header-container {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 2;
}

.brand-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.brand-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111 0%, #222 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 18px var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h1 {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.brand-text h1 span.gold-highlight {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(241, 184, 52, 0.45);
}

/* Date subtitle below tournament title (segundo encabezado) */
.brand-date-subtitle {
  font-size: 1.05rem;
  font-weight: 800;
  color: #a5b4fc;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
  margin-bottom: 0.1rem;
  text-shadow: 0 0 12px rgba(165, 180, 252, 0.4);
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.venue-tag {
  background: rgba(13, 105, 67, 0.3);
  border: 1px solid var(--border-green);
  color: #7ef5bd;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   TOP BREAKS PANEL (Fase Final)
   ========================================================================== */

.top-breaks-panel {
  background: linear-gradient(135deg, rgba(241,184,52,0.12) 0%, rgba(22,27,48,0.95) 100%);
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
  box-shadow: 0 0 30px rgba(241,184,52,0.12);
}

/* Imagen de sede (Grupos) - banner ancho por Vallecas / Alcobendas */
.venue-banner-image {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  object-position: left center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Imagen junto al título de la Fase Final */
.toolbar-title-image {
  height: 34px;
  width: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}

.top-breaks-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(241,184,52,0.35);
}

.top-breaks-podium {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.break-rank-card {
  flex: 1;
  min-width: 170px;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  position: relative;
  border: 2px solid transparent;
  transition: var(--transition);
}

.break-rank-card.rank-1 {
  background: linear-gradient(145deg, rgba(241,184,52,0.28) 0%, rgba(25,30,50,0.9) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(241,184,52,0.3);
}
.break-rank-card.rank-2 {
  background: linear-gradient(145deg, rgba(192,192,192,0.2) 0%, rgba(22,27,48,0.9) 100%);
  border-color: rgba(192,192,192,0.5);
  box-shadow: 0 0 14px rgba(192,192,192,0.15);
}
.break-rank-card.rank-3 {
  background: linear-gradient(145deg, rgba(205,127,50,0.2) 0%, rgba(22,27,48,0.9) 100%);
  border-color: rgba(205,127,50,0.5);
  box-shadow: 0 0 14px rgba(205,127,50,0.15);
}
.break-rank-card.rank-empty {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.07);
  opacity: 0.55;
}

.break-rank-medal {
  font-size: 2rem;
  line-height: 1;
}

.break-rank-score {
  font-size: 2.5rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}
.rank-1 .break-rank-score { color: var(--gold); text-shadow: 0 0 16px rgba(241,184,52,0.6); }
.rank-2 .break-rank-score { color: #d0d0d0; }
.rank-3 .break-rank-score { color: #cd7f32; }
.rank-empty .break-rank-score { color: var(--text-dim); font-size: 1.5rem; }

.break-rank-player {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.break-rank-stage {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Playoff break input row */
.bracket-breaks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  background: rgba(241,184,52,0.07);
  border: 1px dashed rgba(241,184,52,0.3);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
}

.bracket-break-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold-light);
  font-weight: 800;
}

.bracket-break-input {
  width: 52px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--gold-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.88rem;
  text-align: center;
  padding: 0.2rem 0.25rem;
  outline: none;
}
.bracket-break-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}

.bracket-break-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.bracket-break-player-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}


.quick-stats-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.stat-pill .stat-label {
  color: var(--text-muted);
}

.stat-pill .stat-val {
  font-weight: 800;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */

.nav-tabs-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1rem 0;
}

.nav-tabs-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, var(--snooker-green) 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.nav-tab-btn.tab-admin.active {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: #0b0d13;
  box-shadow: 0 4px 16px rgba(241, 184, 52, 0.45);
}

.nav-tab-btn.tab-admin {
  flex-grow: 1;
  justify-content: center;
}

/* ==========================================================================
   MAIN CONTENT & ADVANCED FILTERS
   ========================================================================== */

.main-content {
  max-width: 1320px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.tab-pane.active {
  display: block;
}

#tab-admin.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 350px);
}

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

/* Filter Toolbar */
.section-toolbar-advanced {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.venue-segmented-control {
  display: flex;
  background: var(--bg-input);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 0.3rem;
}

.venue-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 1.2rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.venue-pill-btn:hover {
  color: #fff;
}

.venue-pill-btn.active {
  background: var(--snooker-green);
  color: #fff;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

/* Intuitive Filter Inputs Grid */
.filters-bar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  background: var(--bg-surface);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  align-items: center;
}

.filter-control-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-control-wrap label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--gold);
}

.btn-reset-filters {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  height: 38px;
  margin-top: auto;
}

.btn-reset-filters:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: var(--ball-red);
}

.match-count-badge {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--gold-light);
  background: rgba(241, 184, 52, 0.12);
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border-gold);
}

/* ==========================================================================
   PARTIDOS (MATCH CARDS) - DISEÑO MEJORADO & NOMBRES GRANDES
   ========================================================================== */

.groups-matches-grid {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.group-match-card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.group-header-banner {
  background: linear-gradient(90deg, rgba(13, 105, 67, 0.85) 0%, rgba(26, 32, 53, 0.95) 100%);
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.group-badge-num {
  background: var(--gold);
  color: #0b0d13;
  font-weight: 900;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 0 12px var(--gold-glow);
}

.group-header-banner h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.matches-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 1.35rem;
  padding: 1.35rem;
}

/* Match Card Container */
.match-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Match States */
.match-card.is-pending {
  background: #171a2a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 4px solid var(--text-dim);
}

.match-card.is-pending:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.match-card.in-progress {
  background: linear-gradient(145deg, rgba(241, 184, 52, 0.15) 0%, rgba(21, 26, 44, 0.97) 65%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 30px rgba(241, 184, 52, 0.30), inset 0 0 60px rgba(241, 184, 52, 0.04);
  border-top: 5px solid var(--gold);
  animation: pulseBorderGold 3s ease-in-out infinite alternate;
}

@keyframes pulseBorderGold {
  from { box-shadow: 0 0 18px rgba(241,184,52,0.25), inset 0 0 40px rgba(241,184,52,0.04); }
  to   { box-shadow: 0 0 40px rgba(241,184,52,0.40), inset 0 0 80px rgba(241,184,52,0.08); }
}

.match-card.is-completed {
  background: linear-gradient(145deg, rgba(13, 105, 52, 0.55) 0%, rgba(15, 22, 38, 0.98) 60%);
  border: 2px solid var(--snooker-green-light);
  box-shadow: 0 6px 30px rgba(34, 197, 94, 0.30), inset 0 0 60px rgba(34, 197, 94, 0.05);
  border-top: 5px solid var(--snooker-green-light);
  opacity: 0.92;
}

/* Stripe indicator for completed matches */
.match-card.is-completed::before {
  content: '✅ FINALIZADO';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--snooker-green-light);
  color: #0a1a10;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.18rem 0.65rem;
  letter-spacing: 0.08em;
  border-bottom-left-radius: 8px;
  z-index: 2;
}


/* Schedule Header */
.match-card-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.schedule-badge-highlight {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.table-badge-highlight {
  font-size: 0.85rem;
  font-weight: 800;
  color: #7ef5bd;
  background: rgba(13, 105, 67, 0.4);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--border-green);
}

/* Match Status Badges */
.match-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 800;
}

.badge-completed {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.5);
}

.badge-progress {
  background: rgba(241, 184, 52, 0.25);
  color: var(--gold-light);
  border: 1px solid rgba(241, 184, 52, 0.5);
}

.badge-pending {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Finished Match Highlight Banner */
.match-finished-banner {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.3) 0%, rgba(13, 105, 67, 0.2) 100%);
  border: 1px solid var(--snooker-green-light);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 900;
  color: #a7f3d0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
  letter-spacing: 0.01em;
}


/* Faceoff with Large Player Names & Big Scores */
.match-players-faceoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.player-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.player-side.player-right {
  text-align: center;
  align-items: center;
}

/* HUGE Player Names */
.player-name-display {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  line-height: 1.15;
}

.player-name-display.is-winner {
  color: var(--gold-light);
  text-shadow: 0 0 14px rgba(241, 184, 52, 0.65);
}

.player-frames-count {
  font-size: 2.15rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 12px var(--gold-glow);
}

.match-vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.match-vs-divider span {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.6);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
}

/* Highest Break Row */
.match-highest-breaks-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(241, 184, 52, 0.07);
  border: 1px dashed rgba(241, 184, 52, 0.3);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.break-item-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.break-label {
  color: var(--gold-light);
  font-weight: 800;
}

.break-input {
  width: 56px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--gold-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  padding: 0.25rem 0.35rem;
  outline: none;
}

.break-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Edición de día y hora del partido (solo Admin) */
.schedule-edit-day,
.schedule-edit-time {
  background: var(--bg-input);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
  outline: none;
  cursor: pointer;
}

.schedule-edit-day:focus,
.schedule-edit-time:focus {
  border-color: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}

/* Frame Inputs */
.match-frames-inputs-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg-input);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.frame-input-row {
  display: grid;
  grid-template-columns: 70px 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
}

.frame-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}

.frame-pts-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  width: 100%;
  outline: none;
  transition: var(--transition);
}

.frame-pts-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-glow);
  background: #1a1e33;
}

.frame-pts-input.winner-pts {
  border-color: var(--snooker-green-light);
  color: #86efac;
  font-weight: 900;
  background: rgba(34, 197, 94, 0.2);
}

.frame-pts-input:disabled {
  opacity: 0.88;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.06);
}

.match-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.btn-quick-save {
  background: linear-gradient(135deg, var(--snooker-green) 0%, #15803d 100%);
  border: 1px solid var(--border-green);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-quick-save:hover {
  background: var(--snooker-green-light);
  box-shadow: 0 2px 14px rgba(34, 197, 94, 0.45);
}

.btn-clear-match {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: var(--transition);
  font-weight: 700;
}

.btn-clear-match:hover {
  color: var(--ball-red);
}

/* ==========================================================================
   GRUPOS (STANDINGS VIEW)
   ========================================================================== */

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(580px, 1fr));
  gap: 1.75rem;
}

.standings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.standings-card-header {
  background: linear-gradient(90deg, #182a46 0%, #151722 100%);
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.96rem;
}

.standings-table th {
  background: var(--snooker-green-dark);
  color: #e2e8f0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.9rem 1rem;
  border-bottom: 2px solid var(--gold-dark);
}

.standings-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.standings-table tbody tr {
  transition: background 0.15s ease;
}

.standings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.standings-table tr.row-qualified {
  background: rgba(34, 197, 94, 0.09);
}

.pos-cell {
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  width: 54px;
  font-size: 1.1rem;
}

.pos-cell.pos-1 {
  color: var(--gold-light);
}

.pos-cell.pos-2 {
  color: #cbd5e1;
}

.player-cell {
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.qualify-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--snooker-green-light);
  box-shadow: 0 0 9px var(--snooker-green-light);
}

.num-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  text-align: center;
  font-size: 1.02rem;
}

.num-cell.points-cell {
  color: var(--gold-light);
  font-weight: 900;
  font-size: 1.1rem;
}

/* ==========================================================================
   FASE FINAL (OCTAVOS -> CUARTOS -> SEMIS -> FINAL)
   ========================================================================== */

.bracket-wrapper {
  overflow-x: auto;
  padding-bottom: 2rem;
}

.bracket-container {
  display: flex;
  gap: 2rem;
  min-width: 1050px;
  justify-content: space-between;
}

.bracket-round-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bracket-round-header {
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.bracket-matches-list {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-grow: 1;
  gap: 1.25rem;
}

.bracket-match-node {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bracket-match-node:hover {
  border-color: var(--gold);
}

.bracket-node-header {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  font-weight: 800;
}

.bracket-node-schedule {
  color: var(--gold-light);
  font-family: 'JetBrains Mono', monospace;
}

.bracket-schedule-edit {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bracket-schedule-day,
.bracket-schedule-time {
  background: var(--bg-input);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.2rem;
  outline: none;
  cursor: pointer;
}

.bracket-schedule-day:focus,
.bracket-schedule-time:focus {
  border-color: var(--gold);
  box-shadow: 0 0 5px var(--gold-glow);
}

.bracket-participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--bg-input);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.bracket-participant-row.is-winner {
  border-color: var(--snooker-green-light);
  background: rgba(34, 197, 94, 0.18);
}

.bracket-participant-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.bracket-score-input {
  width: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--gold);
  border-radius: 4px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 0.25rem;
}

/* ==========================================================================
   ADMIN & MODALES
   ========================================================================== */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.75rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.admin-card h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.is-open .modal-dialog {
  transform: scale(1);
}

.admin-password-input {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-gold);
  color: #fff;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
}

.admin-password-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--gold-glow);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: #fff;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.94rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==============================
   FOOTER — TORNEO SNOOKER
   ============================== */

.app-footer {
    position: relative;
    margin-top: 3rem;
    padding: 2rem 2rem 1rem;
    overflow: hidden;

    background: linear-gradient(
        135deg,
        rgba(12, 24, 20, 0.98),
        rgba(18, 20, 25, 0.98)
    );

    border: 1px solid rgba(212, 175, 55, 0.20);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
}

/* Línea dorada superior */
.app-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 2px;

    background: linear-gradient(
        90deg,
        transparent,
        var(--gold-light, #e5c76b),
        transparent
    );
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 1.8rem;
}

/* Marca del torneo */
.footer-brand {
    flex: 1.2;
}

.footer-brand h3 {
    margin: 0.4rem 0;
    color: #f5f0df;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.footer-brand h3 span {
    color: var(--gold-light, #e5c76b);
}

.footer-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    color: #fff;
    background: #d52b36;
    border-radius: 50%;
    box-shadow: inset -3px -3px 5px rgba(0, 0, 0, 0.25);
    font-size: 1.4rem;
    line-height: 1;
}

.footer-locations {
    margin: 0.6rem 0 0;
    color: #b7beb9;
    font-size: 0.88rem;
}

.footer-locations i {
    margin-right: 5px;
    color: var(--gold-light, #e5c76b);
}

/* Separador */
.footer-divider {
    width: 1px;
    align-self: stretch;
    min-height: 75px;
    background: rgba(255, 255, 255, 0.12);
}

/* Estado del sistema */
.footer-info {
    flex: 1;
    color: #aeb7b2;
    font-size: 0.82rem;
    line-height: 1.7;
}

.footer-info p {
    margin: 0.25rem 0;
}

.footer-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 0.3rem;
    color: #e4e9e5;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #35d07f;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(53, 208, 127, 0.55);
}

/* Enlaces */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 155px;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.85rem;

    color: #e8ece9;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;

    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.footer-link > i:first-child,
.footer-brand-icon {
    width: 19px;
    height: 19px;
    font-size: 1.2rem;
    object-fit: contain;
}

.footer-link .external-icon {
    width: auto;
    height: auto;
    margin-left: auto;
    color: #858e88;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.footer-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(229, 199, 107, 0.45);
}

.footer-link:hover .external-icon {
    opacity: 1;
}

.github-link:hover {
    color: #fff;
}

.supabase-link:hover {
    border-color: rgba(62, 207, 142, 0.5);
}

.netlify-link:hover {
    border-color: rgba(50, 195, 231, 0.5);
}

/* Franja inferior */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 1rem;

    color: #858e88;
    font-size: 0.76rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.footer-heart {
    color: #e45b64;
}

/* Adaptación a móviles */
@media (max-width: 768px) {
    .app-footer {
        padding: 1.5rem 1rem 1rem;
        margin-top: 2rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .footer-divider {
        width: 100%;
        min-height: 1px;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .footer-link {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        padding: 0.7rem 0.25rem;
        font-size: 0.78rem;
    }

    .footer-link .external-icon {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-link,
    .footer-link .external-icon {
        transition: none;
    }
}


/* ==========================================================================
   ADMIN: MESA, JUGADORES DEL CUADRO Y ENLACE DE YOUTUBE
   ========================================================================== */

.table-edit-select,
.bracket-table-select {
  background: var(--bg-input);
  border: 1px solid var(--border-green);
  color: #7ef5bd;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.1rem 0.3rem;
  outline: none;
  cursor: pointer;
}

.table-edit-select:focus,
.bracket-table-select:focus {
  border-color: var(--snooker-green-light);
  box-shadow: 0 0 6px var(--snooker-green-glow);
}

.bracket-node-table {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #7ef5bd;
}

.bracket-table-select {
  font-size: 0.74rem;
}

.bracket-player-select {
  flex: 1;
  min-width: 0;
  max-width: 170px;
  margin-right: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  color: #fff;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.3rem;
  outline: none;
  cursor: pointer;
}

.bracket-player-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}

/* Enlace de YouTube (partidos de grupos y eliminatorias) */
.match-video-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.youtube-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}

.youtube-link-btn:hover {
  background: rgba(239, 68, 68, 0.28);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.youtube-link-btn.is-empty {
  opacity: 0.45;
  pointer-events: none;
}

.youtube-logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
}

.youtube-url-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  outline: none;
}

.youtube-url-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.bracket-match-node .match-video-row {
  margin-top: 0.15rem;
}

.bracket-match-node .youtube-url-input {
  font-size: 0.72rem;
  padding: 0.3rem 0.45rem;
}

.bracket-match-node .youtube-link-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

.bracket-match-node .youtube-logo {
  height: 18px;
}

/* ==========================================================================
   RESPONSIVE (MÓVIL)
   ========================================================================== */

@media (max-width: 768px) {
  .matches-list-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.85rem;
  }
  .standings-grid {
    grid-template-columns: 1fr;
  }
  .brand-section {
    flex-direction: column;
    align-items: center;
  }

  .brand-title-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 0.75rem;
  }

  .brand-text {
    width: 100%;
    text-align: center;
  }

  .brand-badge {
    width: 52px;
    height: 52px;
  }

  .brand-text h1 {
    font-size: 1.5rem;
  }

  /* Fase Final: en móvil, el texto arriba y la imagen de los clubes debajo, a ancho completo */
  .toolbar-title-playoffs {
    flex-wrap: wrap;
  }

  .toolbar-title-playoffs .toolbar-title-image {
    flex: 1 0 100%;
    order: 3;
    width: 100%;
    height: auto;
    max-height: 90px;
    margin-top: 0.5rem;
    object-fit: contain;
  }

  .match-card {
    padding: 1rem;
    min-width: 0;
  }

  .match-card-schedule-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .group-players-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
  }

  /* Enfrentamiento: 3 columnas (jugador · VS · jugador) que nunca se salen del bloque.
     Los nombres se parten en varias líneas y el marcador queda alineado abajo. */
  .match-players-faceoff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.65rem 0.6rem;
  }

  .player-side {
    min-width: 0;
    justify-content: space-between;
    gap: 0.3rem;
  }

  .player-name-display {
    font-size: 1.05rem;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.18;
  }

  .player-frames-count {
    font-size: 1.85rem;
  }

  .match-vs-divider {
    padding: 0;
    align-self: center;
  }

  .match-vs-divider span {
    font-size: 0.72rem;
    padding: 0.2rem 0.4rem;
  }
}

@media (max-width: 400px) {
  .match-card {
    padding: 0.85rem;
  }
  .player-name-display {
    font-size: 0.95rem;
  }
  .player-frames-count {
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   FASE FINAL: GANADOR / PERDEDOR EN CADA FILA DEL BRACKET
   ========================================================================== */

/* El estado .is-loser pone al perdedor con opacidad baja para destacar al ganador */
.bracket-participant-row.is-loser {
  opacity: 0.42;
  filter: grayscale(0.55);
}

/* ==========================================================================
   SECCIÓN DE PREMIOS Y PODIO (arriba del cuadro final)
   ========================================================================== */

.tournament-prizes-section {
  background: linear-gradient(135deg, rgba(241,184,52,0.12) 0%, rgba(22,28,55,0.97) 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 40px rgba(241,184,52,0.18), 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.prizes-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 18px rgba(241,184,52,0.55);
}

.prizes-header-icon {
  font-size: 1.4rem;
}

/* Podio de 3 columnas (3º - 1º - 2º) */
.prizes-podium {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 140px;
  transition: transform 0.3s ease;
}

.podium-slot:hover {
  transform: translateY(-4px);
}

/* Campeón (1er puesto) — más alto y llamativo */
.podium-champion {
  background: linear-gradient(160deg, rgba(241,184,52,0.28) 0%, rgba(15,20,40,0.95) 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 30px rgba(241,184,52,0.35), 0 8px 24px rgba(0,0,0,0.5);
  order: 2;
  padding: 1.75rem 2rem;
  min-height: 220px;
}

/* Subcampeón (2º puesto) */
.podium-second {
  background: rgba(192,192,192,0.1);
  border: 1.5px solid rgba(192,192,192,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  order: 1;
  min-height: 180px;
}

/* Tercero (3er puesto — son 2) */
.podium-third {
  background: rgba(180,120,50,0.1);
  border: 1.5px solid rgba(205,127,50,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  order: 3;
  min-height: 130px;
}

.podium-trophy-emoji {
  font-size: 3.5rem;
  animation: bounce 2s infinite ease-in-out;
  line-height: 1;
}

.podium-medal {
  font-size: 2rem;
  line-height: 1;
}

.podium-champion-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

.podium-champion-name {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(241,184,52,0.7);
  margin-top: 0.2rem;
  line-height: 1.1;
}

.podium-country {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.podium-rank-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

.podium-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-top: 0.1rem;
}

/* Break máximo del torneo */
.prizes-break-award {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(241,184,52,0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.25rem;
  font-size: 0.92rem;
}

.prizes-break-icon {
  font-size: 1.2rem;
}

.prizes-break-label {
  color: var(--text-muted);
  font-weight: 700;
}

.prizes-break-value {
  color: var(--gold-light);
  font-weight: 900;
  font-size: 1.05rem;
  font-family: 'JetBrains Mono', monospace;
}

.prizes-break-player {
  color: var(--text-main);
  font-weight: 800;
}

.prizes-break-stage {
  color: var(--text-dim);
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .prizes-podium {
    flex-direction: column;
    align-items: center;
  }

  .podium-champion {
    order: 1;
  }
  .podium-second {
    order: 2;
  }
  .podium-third {
    order: 3;
  }

  .podium-champion-name {
    font-size: 1.4rem;
  }
}