/* === ESTILOS BASE === */
body {
  margin: 0;
  padding: 0;
  font-family: 'Arial', sans-serif;
  text-align: center;
  background: linear-gradient(
    120deg,
    #1b7b80 0%,
    #cccccc 33%,
    #cccccc 66%,
    #033c4c 100%
  );
  background-attachment: fixed;
  background-size: cover;
  overflow-x: hidden;
}

.ligas-hub {
  padding: 30px 10px;
}

/* === TÍTULO PRINCIPAL === */
.sweet-title {
  order: 2;
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 10vw, 12rem); /* Escalable */
  line-height: 0.9em;
  text-align: center;
  text-shadow:
    3px 1px 1px #1b7b80, 2px 2px 1px #033c4c,
    4px 2px 1px #1b7b80, 3px 3px 1px #033c4c,
    5px 3px 1px #1b7b80, 4px 4px 1px #033c4c,
    6px 4px 1px #1b7b80, 5px 5px 1px #033c4c,
    7px 5px 1px #1b7b80, 6px 6px 1px #033c4c,
    8px 6px 1px #1b7b80, 7px 7px 1px #033c4c,
    9px 7px 1px #1b7b80;
}

/* Spans del título */
.sweet-title span {
  display: block;
  position: relative;
}

.sweet-title span::before {
  content: attr(data-text);
  position: absolute;
  text-shadow:
    2px 2px 1px #1b7b80,
    -1px -1px 1px #033c4c,
    -2px 2px 1px #1b7b80,
    1px -1px 1px #033c4c;
  z-index: 1;
}

.sweet-title span:nth-child(1) {
  padding-right: 2.25rem;
}

.sweet-title span:nth-child(2) {
  padding-left: 2.25rem;
}

/* === WRAPPERS DE TÍTULO Y LOGO === */
.title-logo-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.title-wrapper,
.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* === LOGO PRINCIPAL === */
.logo-img {
  width: clamp(180px, 30vw, 420px);
  height: auto;
  object-fit: contain;
  animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

/* === LISTA DE LIGAS === */
.logos-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 3rem;
}

/* Cada tarjeta de liga */
.logos-list__item {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 5 / 6;
  border-radius: 16px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease;
}

.logos-list__item:hover {
  transform: scale(1.03);
}

/* Fondos específicos de cada liga */
.logos-list__item.starcup {
  background-image: url("/static/CD/images/starcup_banner.jpg");
}

.logos-list__item.latam {
  background-image: url("/static/CD/images/copa_latam_banner.jpg");
}

.logos-list__item.sf {
  background-image: url("/static/CD/images/copa_sf_banner.jpg");
}

/* === OVERLAY DE LAS TARJETAS === */
.overlay {
  background-color: rgba(0, 0, 0, 0.45);
  color: white;
  height: 100%;
  width: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
  transition: background-color 0.3s ease;
}

.overlay:hover {
  background-color: rgba(0, 0, 0, 0.55);
}

.overlay img {
  width: clamp(140px, 30vw, 300px);
  margin: 0 auto 10px;
}

.overlay h2 {
  margin: 10px 0 5px;
}

.overlay p {
  font-size: 1.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .title-logo-wrapper {
    flex-direction: column;
    gap: 0.5rem;
  }

  .sweet-title {
    font-size: clamp(2rem, 8vw, 7rem);
  }

  .logos-list {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .logos-list__item {
    width: 90%;
    max-width: 380px;
  }

  .overlay p {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .sweet-title {
    font-size: clamp(1.8rem, 10vw, 5rem);
  }

  .logo-img {
    width: 180px;
  }

  .logos-list__item {
    max-width: 320px;
  }

  .overlay img {
    width: 180px;
  }

  .overlay p {
    font-size: 1rem;
  }
}

/* === PRELOADER === */
.preloader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #1a202c;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader-item {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Root visible al cargar */
#root {
  opacity: 1;
  transition: opacity 0.5s ease;
}
