/* ===================== GENERAL ===================== */
.bracket-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin: 20px 0;
}

#categoria {
  color: #000;
}

table {
  margin-bottom: 0;
}

.match {
  border: 1px solid #ccc;
  padding: 10px;
  margin: 5px;
  border-radius: 5px;
  min-width: 200px;
}

.match span {
  display: block;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  color: white;
}

/* ===================== TABLAS ===================== */
.tabla-wrapper {
  border-radius: 12px;
  background-color: #1B2787;
  border: 1px solid #ffffff50;
  margin-bottom: 2rem;
  box-shadow:
    0 0 6px rgba(0, 92, 255, 0.3),
    0 4px 10px rgba(2, 3, 70, 0.4);
  overflow-x: auto; /* Para scroll horizontal */
  -webkit-overflow-scrolling: touch;
}

.tabla-fixture,
.tabla-grupo {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background-color: #020346;
  color: #fff;
}

.tabla-fixture th,
.tabla-fixture td,
.tabla-grupo th,
.tabla-grupo td {
  padding: 8px 12px;
  white-space: nowrap;
  text-align: center;
  border: 1px solid #ffffff30;
}

.tabla-fixture th,
.tabla-grupo th {
  background-color: #1B2787 !important;
  font-weight: bold;
}

.titulo-grupo {
  text-align: center;
  font-size: 1.6rem;
  color: #fff;
  background-color: #1B2787;
  padding: 10px;
  font-weight: bold;
  text-transform: uppercase !important;
  border-bottom: 1px solid #fff;
  margin: 0;
  word-break: break-word;
}

/* ===================== FINALES Y SEMIS ===================== */
.llave-wrapper {
  background: #0D0E3E;
  border-radius: 10px;
  margin: 30px auto;
  padding: 20px;
  max-width: 900px;
}

.titulo-llave {
  text-align: center;
  font-weight: bold;
  font-size: 24px;
  color: white;
  margin-bottom: 10px;
}

.tabla-finales {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}

.tabla-finales thead tr {
  background-color: #2F2FAA;
  color: white;
  text-align: center;
}

.tabla-finales tbody tr {
  background-color: #050529;
  color: white;
  text-align: center;
}

.tabla-finales th,
.tabla-finales td {
  padding: 10px;
  border: 1px solid #1a1a4c;
}

.franja-inferior {
  margin-top: 10px;
  padding: 10px;
  background: linear-gradient(to right, #50b96a, #3c99f0);
  color: white;
  text-align: center;
  font-weight: bold;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.ganador-final {
  background-color: #005CFF;
  color: white;
}

/* ===================== INDICADOR SCROLL ===================== */
.scroll-hint {
/*  color: #ccc;*/
  color: #9AF54F;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: right;
  padding: 5px 10px;
  font-style: italic;
  display: none;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .scroll-hint {
    display: block;
  }

  .tabla-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabla-fixture,
  .tabla-grupo {
    min-width: 600px;
  }
}

/* ===================== SPINNER ===================== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===================== EFECTO DE ACTUALIZACIÓN ===================== */
.tabla-wrapper.actualizada,
.llave-wrapper.actualizada {
  animation: parpadeo-actualizacion 1.5s ease-in-out;
}

@keyframes parpadeo-actualizacion {
  0% {
    box-shadow: 0 0 10px 2px rgba(0, 255, 128, 0.6);
    background-color: #213a80;
  }
  50% {
    box-shadow: 0 0 16px 4px rgba(0, 255, 128, 0.8);
    background-color: #1B2787;
  }
  100% {
    box-shadow: 0 0 6px rgba(0, 92, 255, 0.3), 0 4px 10px rgba(2, 3, 70, 0.4);
    background-color: #1B2787;
  }
}

/* ================= SCROLL FUNCIONAL CORRECTO ================= */

.tabla-wrapper {
  position: relative;
  margin-bottom: 2rem;
  background-color: #1B2787;
  border: 1px solid #ffffff50;
  border-radius: 12px;
  box-shadow:
    0 0 6px rgba(0, 92, 255, 0.3),
    0 4px 10px rgba(2, 3, 70, 0.4);
}

/* Nuevo contenedor para que el scroll funcione bien */
.tabla-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Importante: la tabla tiene un ancho mínimo para forzar el scroll */
.tabla-fixture,
.tabla-grupo {
  min-width: 600px;
  width: 100%;
  border-collapse: collapse;
  background-color: #020346;
  color: #fff;
}
