/* ==========================================================================
   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;
}

.artista-nombre {
  font-size: 16px;
  font-weight: 700;
}

.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: underline;
}

.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;
}

.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: 2fr 2fr 1fr;
  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: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.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: 15px 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-bottom: 20px;
  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;
}

.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: 0 20px;
}

.tarjeta-encuentro {
  border: 1px solid var(--blanco);
  margin-bottom: 15px;
  padding: 10px;
  contain: content;
}

.encuentro-cabecera {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.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;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.equipos-nombres.multiline {
  font-size: 1.4rem;
}

.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;
}


