/* ============================================
   BRACKET INTERACTIVO - ESTILO SIMPLE Y LIMPIO
   ============================================ */

/* Variables de colores para llaves */
:root {
  --llave-1-color: #007bff;
  --llave-2-color: #ff6b35;
  --winner-color: #ffd700;
  --winner-text: #1a1a1a;
}

/* ============================================
   FASES DEL BRACKET
   ============================================ */
.bracket-phase {
  display: inline-block;
  vertical-align: middle;
  margin: 10px;
  min-width: 180px;
  align-self: center;
  flex-shrink: 0; /* No reducir tamaño en responsive */
}

.phase-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #1a2332, #2c3e50);
  color: #ffd700;
  border-radius: 4px;
}

/* ============================================
   LLAVES (Contenedores de partidos)
   ============================================ */
.llave-container {
  padding: 8px;
  margin-bottom: 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.llave-1 {
  border-color: var(--llave-1-color);
  background: rgba(0, 123, 255, 0.05);
}

.llave-2 {
  border-color: var(--llave-2-color);
  background: rgba(255, 107, 53, 0.05);
}

.llave-title {
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 5px;
}

/* ============================================
   PARTIDOS (Match Pairs)
   ============================================ */
.match-pair {
  margin-bottom: 8px;
  padding: 5px;
  background: #f8f9fa;
  border-radius: 4px;
}

/* ============================================
   EQUIPOS (Team Boxes)
   ============================================ */
.team-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin: 2px 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 3px;
}

.llave-1 .team-box {
  border-left: 2px solid var(--llave-1-color);
}

.llave-2 .team-box {
  border-left: 2px solid var(--llave-2-color);
}

.team-name {
  font-size: 0.8rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Logo miniatura */
.team-logo-mini {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Logo del campeón (el doble de grande con efecto) */
.campeon-box {
  position: relative;
}

.campeon-box .team-logo-mini {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
  animation: championPulse 2s ease-in-out infinite;
}

/* Efecto de estrellitas alrededor del logo del campeón */
.campeon-box::before,
.campeon-box::after {
  content: "⭐";
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleFloat 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.campeon-box::before {
  top: -5px;
  left: -5px;
  animation-delay: 0s;
}

.campeon-box::after {
  bottom: -5px;
  right: -5px;
  animation-delay: 1.5s;
}

/* Agregar estrellitas adicionales con elementos adicionales en el HTML */
.campeon-sparkle {
  position: absolute;
  font-size: 1rem;
  animation: sparkleFloat 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.campeon-sparkle:nth-child(1) {
  top: 10%;
  right: 10%;
  animation-delay: 0.75s;
}

.campeon-sparkle:nth-child(2) {
  bottom: 10%;
  left: 10%;
  animation-delay: 2.25s;
}

@keyframes championPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1));
  }
}

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px) scale(1.2);
    opacity: 1;
  }
}

.team-score {
  font-size: 0.9rem;
  font-weight: 700;
  margin-left: 10px;
}

.vs-indicator {
  font-size: 0.65rem;
  text-align: center;
  color: #6c757d;
  padding: 2px 0;
}

/* ============================================
   GANADORES (Fondo dorado)
   ============================================ */
.team-box.winner {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: var(--winner-text);
  font-weight: 700;
  border-left-width: 2px;
  border-left-color: #d4af37;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2);
}

.team-box.winner .team-name {
  color: var(--winner-text);
  font-weight: 700;
}

.team-box.winner .team-score {
  color: #000;
  font-weight: 900;
}

/* ============================================
   SEMIFINALES CON INDICADOR DE LLAVE
   ============================================ */
.bracket-semifinal .match-pair[data-llave-origen="1"] {
  border-left: 2px solid var(--llave-1-color);
  background: rgba(0, 123, 255, 0.05);
}

.bracket-semifinal .match-pair[data-llave-origen="2"] {
  border-left: 2px solid var(--llave-2-color);
  background: rgba(255, 107, 53, 0.05);
}

/* ============================================
   CAMPEÓN
   ============================================ */
.bracket-campeon {
  text-align: center;
}

.campeon-container {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}

.campeon-box {
  font-size: 1.1rem;
  padding: 15px 25px;
  text-align: center;
  min-width: 150px;
  box-shadow: 0 2px 4px rgba(255, 215, 0, 0.2);
  border: 1px solid #ffd700;
}

/* Eliminada animación pulse - se ve como los demás */

/* ============================================
   RESPONSIVE
   ============================================ */
/* Desactivado para mantener el mismo tamaño en todos los dispositivos */
/* La sección tiene overflow-x: auto en estilos.css para scroll horizontal */

