/* ==========================================================================
   CONFIGURACIÓN GENERAL
   ========================================================================== */
@font-face {
  font-family: "ChellaType";
  src: url("fonts/ChellaType-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

:root {
  --cafe: #2c2a29;
  --rosa: #e088bf;
  --blanco: #ffffff;
  --gris-oscuro: #1a1a1a;
  --gris-borde: #4d4d4d;
}

body {
  background-color: var(--cafe);
  color: var(--blanco);
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: hidden; /* Evita scroll horizontal global */
}

.app-container {
  width: 100%;
  max-width: 450px;
  /* Ancho máximo para simular móvil */
  background-color: var(--cafe);
  min-height: 100vh;
}

/* ==========================================================================
   HEADER Y PORTADA
   ========================================================================== */
.portada-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* Formato 1:1 solicitado */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  /* El clip-path crea una "ventana" para el contenido fixed de adentro */
  clip-path: inset(0);
  overflow: hidden; /* Corta cualquier imagen que crezca por animación */
}

.portada-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 450px;
  /* Mismo que el contenedor para asegurar 1:1 */
  aspect-ratio: 1 / 1;
  background: linear-gradient(to bottom, #b784e9, #ffa9cd, #fdd46e);
  z-index: -1;
}

/* La imagen fixed ahora funciona en móviles mediante el truco de clip-path + fixed */

.img-portada {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-superpuesta {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.img-titulo-animada {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  /* Por encima de la imagen superpuesta */
  transition: transform 0.1s ease-out;
  pointer-events: none;
  will-change: transform;
}

.titulo-dia-container {
  text-align: center;
  padding: 30px 0;
  position: relative;
  z-index: 3;
  /* Asegurar que el texto esté por encima de todo */
}

.dia-titulo {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}

.fecha-subtitulo {
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: 1px;
}

.faltan-texto {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cafe);
  margin-bottom: 5px;
}

.contador-detalles {
  font-size: 0.8rem;
  font-weight: 300;
  color: #ddd;
  margin-top: 5px;
}

/* ==========================================================================
   NAVEGACIÓN (TABS)
   ========================================================================== */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--blanco);
  font-size: 1.1rem;
  font-weight: 700;
  padding-bottom: 5px;
  cursor: pointer;
  opacity: 0.6;
  border-bottom: 3px solid var(--cafe);
}

.tab-btn.active {
  opacity: 1;
  border-bottom: 3px solid var(--rosa);
}

/* ==========================================================================
   PANTALLA 1: RANKING
   ========================================================================== */
.status-bar {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-vivo {
  background-color: var(--blanco);
  color: #000;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

@keyframes parpadeo {
  0% { opacity: 1; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.punto-rojo {
  width: 6px;
  height: 6px;
  background-color: red;
  border-radius: 50%;
  animation: parpadeo 1.5s infinite;
}

.status-texto {
  font-size: 0.6rem;
  color: #999;
}

.ranking-lista {
  padding: 10px 20px;
}

.ranking-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--blanco);
  margin-bottom: 25px;
  height: auto;
  position: relative;
  overflow: visible;
}

.ranking-item-main {
  display: flex;
  align-items: center;
  width: 100%;
  height: 80px;
}

.posicion-num {
  font-size: 70px;
  font-weight: 1000;
  width: 60px;
  text-align: center;
  color: rgb(72, 72, 72);
  letter-spacing: -8px;
}

.ranking-item:nth-child(1) .posicion-num {
  color: #4b4823
}

.ranking-item:nth-child(3) .posicion-num {
  color: #ff914d24;
}

.artista-info {
  flex-grow: 1;
  position: relative;
  z-index: 6; /* Mayor que el z-index 5 de la imagen */
  min-width: 0;
}

.artista-nombre {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.puntos-container {
  display: flex;
  flex-direction: column;
}

.puntos-texto {
  font-size: 0.75rem;
  color: #ccc;
}

.ver-detalles {
  font-size: 0.6rem;
  color: var(--blanco);
  text-decoration: none;
}

.artista-img-container {
  width: 100px;
  aspect-ratio: 1 / 1;
  align-self: flex-end;
  margin-top: -20px; /* Altura 100px - Contenedor 80px = 20px de sobreposición */
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}

.equipo-info {
  flex: 1;
  position: relative;
  z-index: 10;
  margin-right: -40px;
}

.artista-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-bottom: none;
}

/* Container for expanding the item to show details */
.ranking-item.expanded {
  padding-bottom: 10px;
}

.detalles-container {
  width: 100%;
  display: none;
  padding: 0px 10px;
  font-size: 9px;
}

.ranking-item.expanded .detalles-container {
  display: block;
}

.detalle-fila {
  display: grid;
  grid-template-columns: 1.5fr 1.8fr 2.2fr 0.8fr;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detalle-header {
  font-weight: 700;
  color: var(--rosa);
  margin-bottom: 5px;
}

.detalle-puntos {
  text-align: right;
  font-weight: 700;
}

.linea-clasificacion {
  text-align: center;
  position: relative;
  margin: 25px 0;
}

.linea-clasificacion::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--gris-borde);
}

.linea-clasificacion span {
  background-color: var(--cafe);
  position: relative;
  padding: 0 10px;
  font-size: 0.6rem;
  color: #888;
}

/* ==========================================================================
   PANTALLA 2: ENCUENTROS
   ========================================================================== */
.sticky-header-encuentros {
  position: sticky;
  top: 0;
  background-color: var(--cafe);
  z-index: 10;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.titulo-cartelera {
  text-align: center;
  font-size: 3rem;
  /* Aumentado ligeramente para lucir la fuente */
  font-weight: normal;
  font-family: "ChellaType", sans-serif;
  color: var(--rosa);
  letter-spacing: 2px;
  margin-top: 10px;
}

.selector-dias {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 0;
}

.dia {
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 2px;
}

.dia.active {
  color: var(--rosa);
  border-bottom: 2px solid var(--rosa);
}

.fecha-activa {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.controles-filtros {
  display: flex;
  padding: 0 20px;
  gap: 10px;
  margin: 0;
  width: 100%;
}

.input-busqueda {
  flex: 1 1 auto;
  min-width: 0;
  background-color: transparent;
  border: 1px solid var(--blanco);
  padding: 8px;
  color: var(--blanco);
  font-size: 16px;
  border-radius: 0;
  -webkit-appearance: none;
}

.btn-ordenar {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 40%;
  background-color: var(--blanco);
  color: #000;
  border: none;
  border-radius: 0;
  padding: 8px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.encuentros-lista {
  padding: 12px 20px 0 20px;
}

.encuentros-lista.hide-finalizados .match-finalizado {
  display: none !important;
}

.tarjeta-encuentro {
  border: 1px solid var(--blanco);
  margin-bottom: 15px;
  padding: 10px;
  contain: content;
  height: 170px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tarjeta-encuentro.tarjeta-podium-finalizado {
  height: auto !important;
  min-height: 170px;
}

/* Removido para que los equipos sigan centrados */

.tarjeta-encuentro .equipos-nombres {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.encuentro-cabecera {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1px;
}

.deporte-nombre {
  font-size: 1rem;
  font-weight: 700;
}

.deporte-fase {
  display: block;
  font-size: 0.65rem;
  font-weight: 300;
}

.tiempo-zona-info {
  text-align: right;
}

.horario {
    display: block;
    background-color: var(--rosa); /* Default pink */
    color: var(--cafe); /* Text is now brown/black according to request */
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 2px;
}

.zona {
  display: block;
  font-size: 0.65rem;
  margin-top: 4px;
}

.equipos-nombres {
  text-align: center;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.vs-text {
  font-weight: 800;
  color: var(--rosa);
  font-size: 0.75rem;
  margin: 4px 0;
  text-align: center;
  text-transform: uppercase;
}

.equipo-bando {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
    FOOTER
   ========================================================================== */
.footer-principal {
  border-top: 1px solid var(--gris-borde);
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.logo-footer {
  width: 120px;
}

/* Estilos de visibilidad */
.hidden {
  display: none !important;
}

/* Switch estilo iOS */
.contenedor-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 16px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 1px;
  top: 1px;
  background-color: var(--blanco);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--rosa);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.switch-label {
  font-size: 11px;
  color: var(--gris-texto);
  font-family: var(--font-main);
}

/* Estilos para enfrentamientos 1vs1 con imágenes */

.enfrentamiento-1vs1 {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: calc(100% + 20px);
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: -10px;
  padding: 0;
}

/* Estilos para enfrentamientos de varios equipos (Bandos) */
.enfrentamiento-bandos {
  display: flex;
  align-items: center; /* Alineación vertical al centro */
  justify-content: space-around;
  width: 100%;
  padding: 10px 0;
}

.enfrentamiento-bandos .equipo-bando {
  width: 40%;
  justify-content: center;
}

/* Estilos para Tipo 3 (Podium/Certamen) */

.enfrentamiento-tipo3 {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 120px;
}

.enfrentamiento-tipo3 .artista-img-container {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.enfrentamiento-tipo3 .artista-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
}

.artista-nombre-container {
  flex: 1;
  padding-left: 20px;
}

.artista-nombre {
  display: block;
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--blanco);
  text-align: left;
}

.separador-punto {
  opacity: 0.5;
}

.ganador-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--rosa);
  text-align: center;
  margin-top: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.ganador-footer {
  font-size: 12px;
  font-weight: 700;
  color: var(--rosa);
  margin-top: 10px;
  text-align: left;
  padding-left: 25px;
  width: 100%;
}

.podium-resultados {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 10px;
  justify-content: flex-start;
  justify-items: start; /* Asegura que cada celda alinee a la izquierda */
  margin-top: 15px;
  font-size: 12px;
  padding-left: 25px;
  width: 100%;
  padding-bottom: 10px
}

.podium-resultados span {
  color: var(--rosa);
  font-weight: 700;
  text-align: left; /* Rompe la herencia de centrado */
}

.podium-resultados span:first-child {
  text-align: left;
}

.rival-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  height: 120px;
  justify-content: flex-end;
}

.rival-img-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.rival-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
}

.rival-info-container {
  position: absolute;
  bottom: 10px;
  left: 5px;
  right: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.rival-nombre {
  font-size: 14px;
  font-weight: 700;
  color: var(--blanco);
  text-align: center;
  z-index: 2;
}

.rival-col::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, var(--cafe) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.vs-centro {
  font-size: 24px;
  font-weight: 800;
  color: var(--rosa);
  font-style: italic;
}

.enfrentamiento-nombres {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  width: 100%;
}

/* Homologar tamaño de nombres de equipos/artistas en todos los layouts */
.rival-nombre,
.enfrentamiento-nombres p,
.equipo-bando p,
.equipos-nombres,
.equipos-nombres p {
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* Estilos para el footer */
.footer-principal {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 10px;
}

.desarrollado-por {
  font-size: 12px;
  color: var(--gris-texto, #aaa);
  font-family: var(--font-main, sans-serif);
}

.desarrollado-por a {
  color: var(--rosa, #ff007f);
  text-decoration: none;
  font-weight: 700;
}

.desarrollado-por a:hover {
  text-decoration: underline;
}


