* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fondo negro y tipografía principal */
body {
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    background-color: #0a0a0a;
    /* Color de fondo para todas las páginas */
    color: #d0d0d0;
    /* Configuración para mantener el footer abajo */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    /* Esto hace que el contenido principal crezca para ocupar el espacio sobrante */
    display: flex;
    flex-direction: column;
}

/* Fondo específico para la página del torneo */
body.page-torneo {
    /* El fondo ahora es un video, se mantiene el color base por si el video no carga */
    background-color: #0a0a0a;
}

/* Video de fondo para el body */
.main-bg-video {
    position: fixed;
    /* Fija el video en la ventana */
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    /* Lo envía completamente al fondo */
    object-fit: cover;
    /* Asegura que cubra todo el espacio sin deformarse */
}

/* NAVBAR */
.navbar {
    width: 100%;
    background-color: #000000;
    background-color: rgba(0, 0, 0, 0.7);
    /* Fondo negro semi-transparente */
    backdrop-filter: blur(10px);
    /* Efecto de difuminado */
    -webkit-backdrop-filter: blur(10px);
    /* Soporte para Safari */
    color: #d0d0d0;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ffbf007c;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo span {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.logo img {
    height: 40px;
}

.nav-links a {
    color: #b0b0b0;
    text-decoration: none;
    margin-left: 20px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: "Oswald", sans-serif;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

/* ---------------------------------------------------------------------- */
/* ESTILOS DEL CARRUSEL PRINCIPAL (Hero Section) */
/* ---------------------------------------------------------------------- */

/* Contenedor principal del carrusel (Define el marco y la proporción 16:9) */
.hero {
    padding: 0;
    /* Se convierte en una tarjeta con márgenes */
    width: 100%;
    /* Ocupa todo el ancho */
    max-width: 100%;
    /* Sin límite de ancho */
    margin: 0;
    /* Sin márgenes */
    background-color: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    /* --- CAMBIOS CRÍTICOS PARA PROPORCIÓN 16:9 --- */
    position: relative;
    height: 0;
    padding-bottom: 44.25%;
    /* Relación de aspecto 16:9 (9/16 = 0.5625) */

    /* Aseguramos el recorte para los bordes redondeados */
    border-radius: 0;
    overflow: hidden;
}

/* Contenedor de las Diapositivas (Ocupa todo el espacio proporcional del padre) */
.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* No necesita border-radius ni overflow: hidden aquí */
}

/* Diapositiva Individual (Aplica la imagen de fondo) */
.carousel-slide {
    display: none;
    /* Controlado por JS */
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    /* --- CAMBIO CLAVE: Usamos 'cover' ya que la imagen es 16:9 y el contenedor también --- */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000000;
}

/* Video de fondo para el carrusel */
.hero-slide-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: 1;
    /* Se asegura que esté detrás del contenido de hero-content (que tiene z-index: 5) */
}

/* Contenido de texto dentro del carrusel */
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 81px;
    width: 100%;
    box-sizing: border-box;
    z-index: 5;
    /* Gradiente oscuro para mejorar la legibilidad sobre la imagen de fondo */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 70%);
}

.hero-content h1 {
    font-family: "Unbounded", sans-serif;
    font-size: 3.5rem;
    /* Ajustado para el carrusel */
    margin-bottom: 10px;
    position: relative;
    /* Sobrescribir el color del texto para que el contenido sea blanco y no transparente */
    color: #ffffff;
    -webkit-text-stroke: 1px #000000;
    /* Hacemos el título más grande */
}

.hero-content h1::before {
    /* Necesitas ajustar el before para que funcione bien con el gradiente de fondo */
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: #ffffff;
    -webkit-text-stroke: 0;
    text-shadow: none;
    z-index: 1;
}

/* Flechas de Navegación del Carrusel (SOLO DENTRO DE .hero) */
.hero .prev,
.hero .next {
    cursor: pointer;
    position: absolute;
    /* Aquí se aplica position: absolute, solo dentro de .hero */
    top: 50%;
    width: auto;
    padding: 15px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: all 0.3s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    /* Flechas circulares */
    z-index: 6;
    /* Asegura que estén sobre el contenido */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

/* Estos selectores quedaron sin la clase .hero antes, deben ir así */
.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.hero .prev:hover,
.hero .next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    /* Efecto de hover sutil */
    color: #ffbf00;
    /* Color de acento al pasar el ratón */
    box-shadow: 0 0 15px rgba(255, 191, 0, 0.5);
    /* Pequeño brillo neon */
}

/* Media Query para móvil */
@media (max-width: 768px) {
    .hero {
        width: 100%;
        /* Ocupa todo el ancho en móvil */
        padding-bottom: 56.25%;
        margin: 0;
        /* Sin márgenes en móvil */
        border-radius: 0;
        /* Sin bordes redondeados */
    }

    .hero-content {
        padding: 20px
    }

    .hero-content h1 {
        font-size: 16.99px;
        /* Tamaño reducido para el título */
    }

    .hero-content p {
        font-size: 10.99px;
        /* Tamaño reducido para el párrafo */
    }
    /* Estilos de las flechas del Hero, también específicas */
    .hero .prev,
    .hero .next {
        padding: 10px;
        font-size: 16px;
        width: 35px;
        height: 35px;
    }
}

/* SECCIÓN HERO (Fin de estilos del carrusel principal) */
/* ---------------------------------------------------------------------- */

/* SECCIÓN CANALES */
.canales-section {
    padding: 40px;
    background-color: #0a0a0a9d;
    border-top: 1px solid #ffbf007c;
}

.canales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #1a1a1a;
    color: #b0b0b0;
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #ffbf00;
    color: #fff;
}

.filter-btn.active {
    background-color: #ffbf00;
    color: #000;
    border-color: #ffbf00;
}

.canales-section h2 {
    font-family: "Russo One", sans-serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #d0d0d0;
}

.canales-subtitle {
    color: #808080;
    margin-bottom: 20px;
}

/* Carrusel horizontal */
.canales-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    justify-content: center;
}

.canales-carousel {
    display: flex;
    gap: 20px;
    overflow-x: hidden;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    width: 100%;
    /* overflow-x: auto; */
    max-width: calc(280px * 5 + 20px * 4);
    flex: 1;
}

.canales-carousel::-webkit-scrollbar {
    height: 8px;
}

.canales-carousel::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.canales-carousel::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 4px;
}

/* Botones de navegación del Carrusel de Canales (ESCRITORIO) */
.carousel-btn {
    /* Hereda el estilo del carrusel principal */
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: all 0.3s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
    /* Fondo oscuro semitransparente */
    border-radius: 50%;
    /* Circular */
    border: none;
    /* Quitamos el borde anterior */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    z-index: 5;
}

.carousel-btn:hover {
    /* Hereda el efecto de hover del carrusel principal */
    background-color: rgba(255, 255, 255, 0.2);
    /* Fondo sutil al hacer hover */
    color: #ffbf00;
    /* Color de acento al pasar el ratón */
    box-shadow: 0 0 15px rgba(255, 191, 0, 0.5);
    /* Pequeño brillo neon */
}

/* Tarjetas de canal */
.canal-card {
    width: 280px;
    /* background-color: #1a1a1a; */
    border-radius: 16px;
    border: 1px solid #333333;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    scroll-snap-align: start;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    /* Añadido para el posicionamiento del vídeo de fondo */
    position: relative;
    overflow: hidden;
    /* Asegura que el vídeo se recorte a los bordes redondeados */
}

.canal-card:hover {
    border-color: #9c9343;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

/* El vídeo que se mostrará cuando un canal esté en directo */
.live-background-image {
    opacity: 0;
    /* Lo hacemos invisible por defecto */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Ocupa toda la tarjeta */
    object-fit: cover;
    z-index: 0;
    /* Lo ponemos detrás del contenido */
    transition: opacity 0.5s ease;
}

/* Estilos para el indicador "En Vivo" */
.live-indicator {
    /* Reset de estilos anteriores y nuevo diseño */
    width: auto;
    height: auto;
    padding: 3px 7px;
    /* Padding para crear el rectángulo */
    background-color: #cc0000;
    /* Un rojo un poco más oscuro para mejor contraste */
    border-radius: 4px;
    /* Bordes redondeados para el rectángulo */
    display: none;
    /* Oculto por defecto */
    /* Estilos de texto */
    color: #ffffff;
    font-family: "Oswald", sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}

.canal-card.live .live-indicator {
    display: inline-block;
    /* Se muestra cuando la tarjeta tiene la clase .live */
}

/* Estilo opcional para destacar toda la tarjeta cuando está en vivo */
.canal-card.live {
    border-color: #ffbf00;
    /* Borde violeta de Twitch */
    box-shadow: 0 4px 20px rgba(255, 191, 0, 0.5);
}

/* Cuando el canal está en vivo, hacemos visible el vídeo de fondo */
.canal-card.live .live-background-image {
    opacity: 0.4;
    /* Opacidad reducida para que no sea tan brillante */
}

.canal-card.live:hover {
    border-color: #ffbf0080;
}

/* Imagen del jugador */
.jugador-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    display: block;
    transition: opacity 0.5s ease;
    /* Añadimos una transición suave */
}

/* Aseguramos que todo el contenido de la tarjeta esté por encima del vídeo */
.canal-card>*:not(.live-background-image) {
    position: relative;
    z-index: 1;
}

.card-role {
    align-self: flex-start;
    background-color: #444;
    border-radius: 5px;
    color: #e0e0e0;
    display: inline-block;
    font-family: "Oswald", sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 3px 8px;
    text-transform: uppercase;
}

.canal-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Oswald", sans-serif;
    margin-bottom: 8px;
    margin-top: 0;
    color: #d0d0d0;
}

.canal-card p {
    font-size: 0.7rem;
    color: #909090;
    margin-bottom: 16px;
}

.btn-canal {
    display: inline-block;
    padding: 8px 16px;
    background-color: #303030;
    color: #ffffff;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: "Oswald", sans-serif;
    transition: all 0.3s ease;
    border: 1px solid #404040;
    margin-top: 0;
    /* Lo movemos al footer */
    flex-grow: 1;
    /* Ocupa el espacio disponible */
    /* margin-right ya no es necesario, usamos gap en el padre (.card-footer) */
}

.btn-canal:hover {
    background-color: #ffbf00;
    border-color: #606060;
}

/* --- NUEVOS ESTILOS PARA LIKES --- */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Empuja todo el bloque hacia abajo */
    padding-top: 10px;
    /* Espacio por si el texto de arriba es largo */
    gap: 15px;
    /* Espacio entre el botón y la sección de likes */
}

.like-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    /* Evita que se encoja */
}

.like-btn {
    color: #b0b0b0;
    cursor: pointer;
    font-size: 1.3rem;
    /* Un poco más grande para que sea fácil de clickear */
    transition: all 0.2s ease-in-out;
}

.like-btn:hover {
    transform: scale(1.15);
}

.like-btn.liked {
    color: #e53e3e;
    /* Rojo para el like */
}

.like-count {
    font-size: 0.9rem;
    color: #d0d0d0;
    font-weight: 500;
    min-width: 12px;
    /* Para que no salte el layout cuando pasa de 0 a 1 */
    text-align: left;
}

/* SECCIÓN COLLAGE */
.collage-section {
    padding: 60px 40px;
    margin-top: 0px;
    margin-left: 0px;
    margin-right: 0px;

    border-top: 1px solid #ffbf007c;
    background-color: #0a0a0a9d;
}

.collage-section h2 {
    font-family: "Russo One", sans-serif;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
    color: #d0d0d0;
    padding-top: 10px;
}

.collage-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.collage-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #333333;
}

.collage-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
    border-color: #505050;
}

.collage-item img,
.collage-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.collage-item:hover img,
.collage-item:hover video {
    transform: scale(1.1);
}

.collage-item-large {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 300px;
}

.collage-item-wide {
    grid-column: span 2;
    min-height: 200px;
}

.collage-item:not(.collage-item-large):not(.collage-item-wide) {
    min-height: 200px;
}

/* Responsive para collage */
@media (max-width: 768px) {
    .collage-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .collage-item-large {
        grid-column: span 1;
        grid-row: span 1;
    }

    .collage-item-wide {
        grid-column: span 1;
    }

    .collage-section {
        padding: 40px 20px;
    }

    /* Clase para ocultar elementos en móvil */
    .hide-on-mobile {
        display: none;
    }

    /* Hacer que la imagen MM4 ocupe todo el ancho en móvil */
    .collage-item-mm4 {
        grid-column: 1 / -1;
        /* Hace que el item ocupe todo el ancho de la grilla */
        height: 260px;
        /* Ajusta esta altura: más alto = menos zoom, más bajo = más rectangular. */
    }

    .collage-item-mm4 img {
        /* Con object-position puedes mover la imagen. 'center' la centra, 'top' la sube, 'bottom' la baja. */
        object-position: center center;
        object-fit: cover;
    }
}

/* SECCIÓN TORNEO */
.torneo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.torneo-logo {
    width: 120px;
    height: auto;
}

.torneo-video {
    width: 770px;
    height: 200px;
    object-fit: cover;
    object-position: center;
}

/* Quitamos el margen inferior del h2 cuando está dentro del header del torneo */
.torneo-header h2 {
    margin-bottom: 0;
}

.torneo-subtitle {
    color: #a0a0a0;
    max-width: 600px;
    margin: 0 auto 30px auto;
    text-align: center;
}

/* ESTADO GLOBAL DEL TORNEO */
#tournament-status-container {
    margin-top: 15px;
    margin-bottom: -10px;
    /* Reduce el espacio extra debajo */
    text-align: center;
}

.tournament-status-indicator {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 37px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    font-family: "Oswald", sans-serif;
    letter-spacing: 1px;
    font-style: italic;
    /* Letras inclinadas */
    background-color: transparent;
    /* Sin fondo */
    border: 2px solid;
    /* Borde con grosor de 2px (el color se define abajo) */
}

.tournament-status-indicator.online {
    color: #4caf50;
    /* Color de letra y borde verde */
    box-shadow: 0 0 10px #4caf509a;
}

.tournament-status-indicator.offline {
    color: #f44336;
    /* Color de letra y borde rojo */
    box-shadow: 0 0 10px #f443369a;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.team-card {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    border-color: #a970ff;
}

.team-card h3 {
    font-family: "Russo One", sans-serif;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-card h3 i {
    color: #a970ff;
}

.team-card ul {
    list-style: none;
    padding: 0;
}

.team-card li {
    color: #b0b0b0;
    margin-bottom: 8px;
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-card li .player-role {
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    color: #d0d0d0;
    background-color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.loading-message,
.error-message {
    grid-column: 1 / -1;
    /* Ocupa todo el ancho de la grilla */
    text-align: center;
    font-size: 1.1rem;
    color: #808080;
    padding: 40px 0;
}

/* LEADERBOARD SECTION */
.leaderboard-container {
    display: block;
    /* Cambiado a block para que las tablas sean horizontales/alargadas */
    max-width: 1400px;
    max-width: 1600px;
    width: 95%;
    margin: 0 auto;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.btn-refresh {
    display: none;
    /* Oculto por defecto, se muestra con JS */
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid rgba(255, 191, 0, 0.4);
    color: #d0d0d0;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover:not(:disabled) {
    border-color: #ffbf00;
    color: #fff;
}

.btn-refresh:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.tab-btn {
    background-color: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 191, 0, 0.4);
    color: #d0d0d0;
    padding: 12px 20px;
    cursor: pointer;
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #ffbf00;
    color: #fff;
}

.tab-btn.active {
    background-color: #ffbf00;
    color: #0a0a0a;
    font-weight: bold;
}

.leaderboard {
    display: none;
    /* Ocultas por defecto para el sistema de pestañas */
    background-color: lab(2 -0.07 -0.92 / 0.5);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    padding: 40px;
    /* Más espacio interno para que se vea más grande */
    padding: 25px;
    width: 100%;
}

.leaderboard.active {
    display: block;
    /* Solo se muestra la tabla activa */
    animation: fadeIn 0.5s ease;
}

/* Dual Leaderboard Container for Team Classification */
.dual-leaderboard-container {
    display: flex !important;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    width: 100%;
}

.dual-leaderboard-container .table-wrapper {
    flex: 1;
    min-width: 0;
}

@media (max-width: 992px) {
    .dual-leaderboard-container {
        flex-direction: column;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard h3 {
    font-family: "Russo One", sans-serif;
    color: #ffffff;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard h3 i {
    color: #ffbf00;
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard th,
.leaderboard td {
    padding: 12px 15px;
    padding: 20px 25px;
    /* Celdas más altas y anchas */
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
}

.leaderboard th {
    font-family: "Oswald", sans-serif;
    color: #a0a0a0;
    font-size: 0.9rem;
    font-size: 1.1rem;
    /* Títulos más grandes */
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
}

.leaderboard td {
    font-family: "Roboto", sans-serif;
    color: #e0e0e0;
    font-size: 1rem;
    font-size: 1.2rem;
    /* Datos más legibles */
    font-size: 1.05rem;
    border: none;
}

.leaderboard tbody tr {
    background-color: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.leaderboard td:first-child {
    border-radius: 8px 0 0 8px;
    border-left: 4px solid transparent;
}

.leaderboard td:last-child {
    border-radius: 0 8px 8px 0;
}

.leaderboard tbody tr:hover {
    background-color: rgba(255, 191, 0, 0.1);
    transform: scale(1.01) translateX(5px);
}

/* Estilos para el Top 3 */
.leaderboard tbody tr.top-1 {
    border-left: 4px solid #FFD700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1),
            transparent);
}

.leaderboard tbody tr.top-2 {
    border-left: 4px solid #C0C0C0;
}

.leaderboard tbody tr.top-3 {
    border-left: 4px solid #CD7F32;
}

.leaderboard tbody tr.top-1 td:first-child {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.2rem;
}

.leaderboard tbody tr.top-2 td:first-child {
    color: #C0C0C0;
    font-weight: bold;
}

.leaderboard tbody tr.top-3 td:first-child {
    color: #CD7F32;
    font-weight: bold;
}

.leaderboard tbody tr.match-point {
    background: linear-gradient(90deg, rgba(255, 191, 0, 0.3), rgba(255, 0, 0, 0.1));
    border-left: 4px solid #ff4500;
    color: #ffffff;
    font-weight: bold;
    animation: pulse-match-point 2s infinite;
}

.leaderboard tbody tr.match-point:hover {
    background: linear-gradient(90deg, rgba(255, 191, 0, 0.5), rgba(255, 0, 0, 0.2));
}

@keyframes pulse-match-point {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 69, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 69, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 69, 0, 0);
    }
}

/* Estilo para el equipo Ganador (999 puntos) */
.leaderboard tbody tr.winner {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.4), rgba(0, 0, 0, 0.5));
    border-left: 6px solid #FFD700;
    color: #ffffff;
    font-weight: bold;
    animation: winner-glow 1.5s infinite alternate;
}

@keyframes winner-glow {
    from {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }

    to {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

/* ESTADO ONLINE/OFFLINE PARA TORNEO */
.online-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 10px;
    font-family: "Oswald", sans-serif;
    vertical-align: middle;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.online-status.online {
    background-color: #4caf50;
    /* Verde */
    color: white;
}

.online-status.offline {
    background-color: #f44336;
    /* Rojo */
    color: white;
}

/* SECCIONES INFO (redes y contacto) */
.info-section {
    padding: 40px;
    border-top: 1px solid #ffbf007c;
    background-color: #0a0a0a9d;
    flex: 1;
    /* Hace que la sección ocupe todo el alto disponible en main */
    display: flex;
    flex-direction: column;
}

.info-section h2 {
    font-family: "Russo One", sans-serif;
    font-size: 1.6rem;
    margin-bottom: 30px;
    color: #d0d0d0;
    text-align: center;
}

.info-section p {
    color: #a0a0a0;
    max-width: 600px;
}

.sponsors-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden;
    align-items: center !important;
}

.sponsors-section h2 {
    width: 100%;
    text-align: center;
}

.sponsors-carousel {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
}

.sponsors-track {
    display: flex;
    width: max-content;
    animation: scrollSponsors 20s linear infinite;
}

.sponsor-logo {
    padding: 0 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sponsor-logo img {
    height: 45px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.sponsor-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(2.50);
}

@keyframes scrollSponsors {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-33.3333%);
    }
}

/* FOOTER NEGRO */
.main-footer {
    background-color: #000000;
    /* Fondo negro principal para el footer */
    color: #808080;
    border-top: 1px solid #333333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    /* Espaciado generoso en escritorio */
    flex-wrap: wrap;
    /* Permite que los elementos se reorganicen en pantallas más pequeñas */
    gap: 20px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 40px;
    /* Espacio entre los enlaces de navegación y los iconos sociales */
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-social-icons {
    display: flex;
    gap: 20px;
    /* Espacio entre cada icono */
}

.footer-social-icons a {
    color: #b0b0b0;
    font-size: 1.4rem;
    /* Tamaño de los iconos */
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-social-icons a:hover {
    color: #ffffff;
    transform: scale(1.15);
    /* Efecto de zoom al pasar el ratón */
}

.footer-logo-img {
    height: 40px;
    /* Altura consistente con la barra de navegación */
    width: auto;
    display: block;
}

.footer-links {
    display: flex;
    gap: 25px;
    /* Espacio entre los enlaces */
}

.footer-links a {
    color: #b0b0b0;
    text-decoration: none;
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #ffffff;
    /* Resalta el enlace al pasar el ratón */
}

.footer-bottom {
    background-color: #0a0a0a;
    /* Un tono ligeramente más claro para diferenciar */
    padding: 15px 20px;
    font-size: 0.8rem;
    border-top: 1px solid #222;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

#visitor-counter-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #808080;
}

#visitor-counter-container i {
    color: #a0a0a0;
}

#live-visitor-count {
    font-weight: bold;
    color: #ffffff;
}

/* Responsive básico */
@media (max-width: 768px) {
    body {
        /* Empujamos el contenido hacia abajo para dejar espacio a la barra de navegación fija */
        padding-top: 0px;
    }

    body.page-torneo {
        padding-top: 75px;
    }

    .torneo-video {
        width: 95%;
        max-width: 450px;
        height: auto;
    }

    /* Reajuste para que en móvil no se vea gigante */
    .leaderboard {
        padding: 15px;
    }

    .leaderboard th,
    .leaderboard td {
        padding: 12px 10px;
    }

    .leaderboard th {
        font-size: 0.9rem;
    }

    .leaderboard td {
        font-size: 1rem;
    }

    .navbar {
        padding: 10px 20px;
        position: relative;
        /* Necesario para poder centrar el logo de forma absoluta */
        padding: 16px 20px;
        position: fixed;
        /* La barra se queda fija en la parte superior */
    }

    /* En móvil, el logo se centra y el menú hamburguesa pasa a la izquierda */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .nav-links a {
        margin-left: 12px;
        font-size: 0.85rem;
    }

    .canales-section,
    .info-section {
        padding: 30px 20px;
    }

    .filter-controls {
        display: none;
    }

    /* Ajuste para la página del torneo en móvil */
    .page-torneo .info-section {
        padding-top: 75px;
        /* Empuja el contenido hacia abajo para que no quede oculto por la navbar fija */
    }

    .canales-wrapper {
        gap: 8px;
        align-items: flex-start;
        /* Alineamos a arriba para evitar problemas con la tarjeta */
    }

    /* --- CAMBIO CRÍTICO: OCULTAMOS LAS FLECHAS DEL CARRUSEL DE CANALES EN MÓVIL --- */
    .carousel-btn {
        display: none;
    }

    .canales-carousel {
        max-width: 100%;
        scrollbar-width: none;
        overflow-x: auto;
        /* PERMITE EL SCROLL CON EL DEDO */
        -ms-overflow-style: none;
        padding-bottom: 6px;
        gap: 12px;
    }

    .canales-carousel::-webkit-scrollbar {
        display: none;
    }

    .canal-card {
        width: calc(50% - 8px);
        height: 363px;
        padding: 12px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden;
    }

    .jugador-img {
        width: 100%;
        height: 155px;
        /* Altura fija para que la imagen NO se estire */
        object-fit: cover;
        /* Mantiene la proporción de la imagen sin deformarla */
        border-radius: 10px;
        margin-bottom: 10px;
        flex-shrink: 0;
    }

    .canal-card h3 {
        margin: 6px 0;
        font-size: 1rem;
    }

    .canal-card p {
        font-size: 0.80rem;
        color: #909090;
        margin-bottom: 8px;
        /* overflow: hidden; */
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        /* Limita el texto a 3 líneas */
        line-clamp: 3;
        /* Compatibilidad con navegadores modernos */
        -webkit-box-orient: vertical;
    }

    .card-footer {
        gap: 10px;
    }

    .canal-card .btn-canal {
        display: block;
        /* width: 100%; se elimina para que el botón de like quepa al lado */
        flex-grow: 1;
        /* Hacemos que el botón ocupe el espacio sobrante */
        padding: 8px 10px;
        font-size: 0.8rem;
        text-align: center;
        border-radius: 10px;
        margin-top: 0;
        /* Movido a .card-footer */
        margin-right: 0;
        /* No hay espacio lateral en móvil */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .leaderboard-container {
        grid-template-columns: 1fr;
    }

    .leaderboard td:first-child {
        font-family: "Oswald", sans-serif;
        font-weight: 700;
        font-size: 1.1rem;
        width: 80px;
        text-align: center;
    }

    .leaderboard tbody tr.top-1 td:first-child {
        color: #FFD700;
    }

    /* Gold */
    .leaderboard tbody tr.top-2 td:first-child {
        color: #C0C0C0;
    }

    /* Silver */
    .leaderboard tbody tr.top-3 td:first-child {
        color: #CD7F32;
    }

    /* Bronze */

    .like-section {
        justify-content: center;
    }

    .collage-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .collage-section {
        padding: 40px 20px;
    }

    /* --- ESTILOS RESPONSIVE DEL FOOTER --- */
    .footer-content {
        flex-direction: column;
        /* Apila el logo y los enlaces verticalmente */
        padding: 25px 20px;
        gap: 25px;
    }

    .footer-right {
        flex-direction: column;
        /* Apila los enlaces y los iconos */
        gap: 25px;
        align-items: center;
    }

    .footer-bottom {
        font-size: 0.75rem;
    }
}

.icon-twitch {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
}

@media (max-width: 480px) {
    .icon-twitch {
        width: 16px;
        height: 16px;
    }

    .canal-card h3 {
        gap: 6px;
        font-size: 0.95rem;
    }
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    z-index: 11;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #d0d0d0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 47px;
        top: 51px;
        /* Ajustado a la nueva altura de la navbar */
        left: 0;
        right: 0;
        width: 70%;
        /* Ocupa el 70% del ancho de la pantalla */
        left: -70%;
        /* Empieza fuera de la pantalla a la izquierda, cubriendo su propio ancho */
        height: calc(100vh - 51px);
        /* Ocupa el resto de la altura de la ventana */
        background-color: rgba(26, 26, 26, 0.8);
        /* Fondo oscuro con transparencia */
        backdrop-filter: blur(10px);
        /* Efecto de difuminado */
        -webkit-backdrop-filter: blur(10px);
        /* Soporte para Safari */
        flex-direction: column;
        gap: 15px;
        overflow-y: auto;
        /* Permite scroll si el contenido es muy largo */
        z-index: 10;
        transition: left 0.4s ease-in-out;
        /* Transición para el deslizamiento */
    }

    .nav-links.active {
        left: 0;
        /* Desliza el menú a la vista */
        padding: 20px;
        /* Aplica el padding solo cuando el menú está activo */
        border-bottom: 1px solid #333333;
        /* Aplica el borde solo cuando el menú está activo */
    }

    .nav-links a {
        margin-left: 0;
        display: block;
        padding: 10px 0;
        color: #b0b0b0;
        text-decoration: none;
    }
}

/* --- ESTILOS PARA EL FONDO OSCURO DEL MENÚ MÓVIL --- */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Color oscuro semi-transparente */
    z-index: 9;
    /* Debe estar por debajo del menú (z-index: 10) pero por encima del contenido */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* --- ESTILOS PARA EL MODAL DE LOGIN/REGISTRO --- */
.nav-auth-btn {
    background-color: #ffbf00;
    color: #0a0a0a;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: "Oswald", sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 20px;
}

.nav-auth-btn:hover {
    background-color: #e6ac00;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1a1a1aa1;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #333;
    width: 90%;
    max-width: 450px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: #808080;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.tab-link {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: #808080;
    font-family: "Russo One", sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    color: #ffffff;
    border-bottom-color: #ffbf00;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: "Oswald", sans-serif;
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background-color: #0a0a0a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #d0d0d0;
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ffbf00;
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: #ffbf00;
    color: #0a0a0a;
    border: none;
    border-radius: 6px;
    font-family: "Russo One", sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #e6ac00;
}

/* --- BOTONES SOCIALES (TWITCH Y KICK) --- */
.btn-twitch {
    background-color: #9146FF;
    color: white;
    margin-top: 15px;
}

.btn-twitch:hover {
    background-color: #772ce8;
}

/* Botón de Kick con alineación para el logo */
.btn-kick {
    background-color: #53fc18;
    color: #000000;
    margin-top: 10px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Espacio entre el logo y el texto */
}

.btn-kick:hover {
    background-color: #45d612;
    color: #000000;
}

/* Tamaño del logo de Kick para que coincida con el de Twitch */
.icon-kick {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

#modal-message {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    min-height: 20px;
}

.success {
    color: #4CAF50;
}

.error {
    color: #F44336;
}

/* Responsive para el botón de auth en nav */
@media (max-width: 768px) {
    .nav-auth-btn {
        width: 100%;
        margin-left: 0;
        padding: 12px;
        text-align: center;
    }

    .nav-links.active .nav-auth-btn {
        display: block;
    }
}

/* --- ESTILOS PARA TABLAS COLAPSABLES (SOLO MÓVIL) --- */

/* En escritorio, el icono para colapsar está oculto */
.collapse-icon {
    display: none;
}

@media (max-width: 768px) {
    .leaderboard h3.collapsible-trigger {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .collapse-icon {
        display: inline-block;
        /* Se muestra en móvil */
        color: #ffbf00;
        transition: transform 0.3s ease-in-out;
    }

    .leaderboard h3.collapsible-trigger.active .collapse-icon {
        transform: rotate(180deg);
        /* Gira la flecha al expandir */
    }

    .leaderboard-content {
        max-height: 0;
        /* Por defecto, el contenido está colapsado */
        overflow: hidden;
        transition: max-height 0.4s ease-out;
        /* Animación suave */
    }
}

/* --- ESTILOS DEL DASHBOARD (MODAL) --- */
#dashboard-modal h2 {
    color: #d0d0d0;
    font-family: "Russo One", sans-serif;
    text-align: center;
    margin-bottom: 20px;
}

.dashboard-input {
    width: 100%;
    padding: 12px;
    background-color: #0a0a0a;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 6px;
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.dashboard-input:focus {
    outline: none;
    border-color: #ffbf00;
}

textarea.dashboard-input {
    resize: vertical;
    min-height: 100px;
}

/* Sección de Roles (Admin) */
#admin-role-section {
    border-top: 1px solid #333;
    margin-top: 25px;
    padding-top: 25px;
}

#admin-role-section h3 {
    color: #ffbf00;
    font-family: "Russo One", sans-serif;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Botón con borde (Outline) para diferenciar acciones secundarias */
.btn-outline {
    background-color: transparent;
    border: 2px solid #ffbf00;
    color: #ffbf00;
}

.btn-outline:hover {
    background-color: #ffbf00;
    color: #0a0a0a;
}

/* --- NOTIFICACIÓN DE DISCORD (ESTILO LEVE) --- */
.discord-notification {
    position: fixed;
    bottom: 25px;
    right: -400px;
    /* Oculto inicialmente */
    background: rgba(88, 101, 242, 0.85);
    /* Color Discord con transparencia */
    backdrop-filter: blur(8px);
    /* Efecto cristal */
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 191, 0, 0.2);
    /* Borde dorado sutil */
}

.discord-notification.active {
    right: 25px;
}

.discord-notification:hover {
    background-color: #5865F2;
    transform: translateY(-3px);
    color: white;
    border-color:
        #ffbf00;
}

.discord-notification i {
    font-size: 1.5rem;
}

.discord-notification span {
    font-family: "Oswald", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform:
        uppercase;
    letter-spacing: 1px;
}

.discord-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    margin-left: 5px;
    transition: opacity 0.2s;
}

.discord-close:hover {
    opacity: 1;
}

/* --- LOADER PARA CARDS (Evita parpadeo de datos) --- */
.card-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    /* Mismo color de fondo de la card */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    /* Por encima del contenido */
    border-radius: 16px;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #ffbf00;
    /* Color dorado */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* --- MENÚ DESPLEGABLE DE USUARIO --- */
.auth-dropdown-container {
    position: relative;
    display: inline-block;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #1a1a1a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border: 1px solid #333;
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.user-dropdown a {
    color: #d0d0d0;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-family: "Oswald", sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.user-dropdown a:hover {
    background-color: #333;
    color: #ffbf00;
}

/* --- ESTILOS RESPONSIVE PARA EL MENÚ DESPLEGABLE --- */
@media (max-width: 768px) {
    .auth-dropdown-container {
        width: 100%;
    }

    .user-dropdown {
        position: static;
        /* Se integra en el flujo en lugar de flotar */
        width: 100%;
        box-shadow: none;
        margin-top: 10px;
        background-color: #0f0f0f;
        /* Fondo oscuro para diferenciar */
        border: 1px solid #333;
    }

    .user-dropdown a {
        text-align: center;
        padding: 15px;
        /* Área táctil más grande */
        border-bottom: 1px solid #222;
        font-size: 1rem;
    }

    .user-dropdown a:last-child {
        border-bottom: none;
    }
}

/* Overrides for Tournament Page (Yellow Theme) */
.page-torneo .navbar {
    border-bottom-color: #ffbf007c;
}

.page-torneo .tab-btn {
    border-color: rgba(255, 191, 0, 0.4);
}

.page-torneo .tab-btn:hover {
    border-color: #ffbf00;
    color: #fff;
}

.page-torneo .tab-btn.active {
    background-color: #ffbf00;
    color: #0a0a0a;
}

.page-torneo .leaderboard h3 i {
    color: #ffbf00;
}

.page-torneo .leaderboard tbody tr:hover {
    background-color: rgba(255, 191, 0, 0.1);
}

.page-torneo .leaderboard tbody tr.match-point {
    background: linear-gradient(90deg, rgba(255, 191, 0, 0.3), rgba(255, 0, 0, 0.1));
}

.page-torneo .info-section {
    border-top: none;
}

.page-torneo .nav-auth-btn {
    background-color: #ffbf00;
}

.page-torneo .nav-auth-btn:hover {
    background-color: #e6ac00;
}

.page-torneo .tab-link.active {
    border-bottom-color: #ffbf00;
}

.page-torneo .form-group input:focus {
    border-color: #ffbf00;
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.2);
}

.page-torneo .btn-submit:not(.btn-twitch):not(.btn-kick) {
    background-color: #ffbf00;
}

.page-torneo .btn-submit:not(.btn-twitch):not(.btn-kick):hover {
    background-color: #e6ac00;
}

.page-torneo .collapse-icon {
    color: #ffbf00;
}

.page-torneo .user-dropdown a:hover {
    color: #ffbf00;
}

.page-torneo .btn-outline {
    border-color: #ffbf00;
    color: #ffbf00;
}

.page-torneo .btn-outline:hover {
    background-color: #ffbf00;
    color: #0a0a0a;
}

.page-torneo .leaderboard tbody tr:nth-child(1) {
    border-left-color: #FFD700;
    background: linear-gradient(90deg,
            rgba(255, 215, 0, 0.1), transparent);
}

.page-torneo .leaderboard tbody tr:nth-child(1) td:first-child {
    color: #FFD700;
}

.page-torneo .spinner {
    border-top-color: #ffbf00;
}

.page-torneo .dashboard-input:focus {
    border-color: #ffbf00;
}

/* ==========================================================================
   ESTILOS MULTISTREAM - #ON? FAMILY (Premium Dark Theme - Integrado)
   ========================================================================== */

body.page-multistream {
    background-color: #0f0f11; 
    overflow: hidden; /* Congela la pantalla para evitar scroll vertical en PC */
    height: 100vh;
}

body.page-multistream .main-bg-video {
    opacity: 0.3; /* Oscurecido para que la interfaz destaque */
    filter: blur(8px); /* Desenfoque sutil para mayor formalidad */
    z-index: -2;
}

body.page-multistream main {
    padding: 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- BOTÓN TOGGLE SIDEBAR --- */
.sidebar-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    top: auto; 
    background: #ffbf00; /* Amarillo ON */
    color: #000; /* Letras negras para mejor contraste */
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(255, 191, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-toggle-btn:hover {
    transform: scale(1.08) translateY(-3px);
    background: #e6ac00; /* Amarillo oscuro al pasar el ratón */
    box-shadow: 0 12px 28px rgba(255, 191, 0, 0.6);
    border-color: transparent;
    color: #000;
}

/* --- MENÚ LATERAL (SIDEBAR) --- */
.right-sidebar {
    position: fixed;
    top: 0;
    right: -380px; 
    width: 360px;
    height: 100vh;
    background: rgba(24, 24, 27, 0.85); /* Fondo oscuro semitransparente */
    backdrop-filter: blur(16px); /* Efecto cristal */
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.right-sidebar.active {
    right: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: white; 
    font-family: 'Unbounded', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: #adadb8;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.sidebar-close-btn:hover {
    color: #ff4d4d;
}

.sidebar-content {
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px; 
}

.sidebar-section h4 {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.75rem;
    color: #adadb8;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.sidebar-input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.sidebar-input-group:focus-within {
    border-color: #ffbf00; /* Borde amarillo al hacer click */
}

.sidebar-input-group i {
    color: #adadb8;
    margin-right: 12px;
    font-size: 1.1rem;
}

.sidebar-input-group input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
}

.sidebar-input-group input::placeholder {
    color: #6a6a72;
}

.sidebar-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #2f2f35;
    color: white;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-btn:hover {
    background: #3f3f46;
    color: white;
}

.sidebar-btn.btn-danger {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.sidebar-btn.btn-danger:hover {
    background: #ff4d4d;
    color: white;
    border-color: #ff4d4d;
}

.sidebar-layout {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.layout-btn {
    flex: 1;
    min-width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #adadb8;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
}

.layout-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.08);
}

.layout-btn.active {
    background: #ffbf00; /* Amarillo ON */
    color: #000;
    border-color: #ffbf00;
}

.sidebar-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav-links a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    color: #adadb8;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    text-transform: none;
    transition: all 0.2s ease;
}

.sidebar-nav-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border: none;
    transform: translateX(6px); 
}

/* --- CONTENEDOR CENTRAL --- */
.multistream-header-bar {
    margin-bottom: 24px;
    display: flex;
    background: rgba(24, 24, 27, 0.6);
    padding: 8px;
    border-radius: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    scrollbar-width: none;
}
.multistream-header-bar::-webkit-scrollbar {
    display: none; 
}

.multistream-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chrome-tabs {
    display: flex;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0;
}

.chrome-tab {
    padding: 10px 20px;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Roboto', sans-serif;
    text-transform: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #adadb8;
    white-space: nowrap;
    border: 1px solid transparent;
    height: auto;
}

.chrome-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.chrome-tab.active {
    background: rgba(255, 191, 0, 0.15); /* Fondo amarillo tenue */
    color: #ffbf00; /* Texto amarillo */
    border: 1px solid rgba(255, 191, 0, 0.5); /* Borde amarillo */
    font-weight: 500;
}

.chrome-tab .close-tab {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    transition: all 0.2s;
    margin-left: 0;
}

.chrome-tab .close-tab:hover {
    opacity: 1;
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.15);
}

.stream-wrapper.hidden {
    display: none !important;
}

.streams-grid {
    display: grid;
    gap: 20px;
    flex: 1;
    width: 100%;
    padding: 0;
    align-content: center; 
}

.streams-grid.layout-1 { grid-template-columns: 1fr !important; }
.streams-grid.layout-2 { grid-template-columns: repeat(2, 1fr) !important; }
.streams-grid.layout-3 { grid-template-columns: repeat(3, 1fr) !important; }
.streams-grid.layout-4 { grid-template-columns: repeat(2, 1fr) !important; grid-template-rows: repeat(2, 1fr) !important; }
.streams-grid.layout-5 { grid-template-columns: repeat(4, 1fr) !important; }

/* Modo foco */
.streams-grid.focused-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stream-wrapper {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    aspect-ratio: 16 / 9; 
    width: 100%;
    height: auto; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInStream 0.4s ease forwards;
}

.stream-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.focused-mode .stream-wrapper {
    height: 80vh;
    width: auto;
    max-width: 100%;
}

.remove-stream-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; 
}

.stream-wrapper:hover .remove-stream-btn {
    opacity: 1;
}

.remove-stream-btn:hover {
    background: #ff4d4d;
    border-color: #ff4d4d;
    transform: scale(1.1);
}

@keyframes fadeInStream {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .streams-grid.layout-3, .streams-grid.layout-4, .streams-grid.layout-5 {
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 600px) {
    .page-multistream {
        height: auto;
        overflow: visible;
    }
    
    .page-multistream main {
        padding: 10px;
    }

    .right-sidebar {
        width: 100%;
        right: -100%;
    }

    .streams-grid {
        display: grid;
        grid-template-columns: 1fr !important; 
        gap: 15px;
    }

    .focused-mode .stream-wrapper {
        width: 100%;
        height: auto;
    }

    .remove-stream-btn {
        opacity: 1;
    }
}
/* --- FIN ESTILOS MULTISTREAM --- */

.generated-team-card {
    background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%);
    border: 1px solid #2a2a2a;
    border-top: 4px solid #ffbf00;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* Marca de agua estilo credencial */
.generated-team-card::after {
    content: '\f132';
    /* fa-shield-halved */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 7rem;
    color: rgba(255, 255, 255, 0.02);
    z-index: 0;
    transform: rotate(-15deg);
    pointer-events: none;
}

.generated-team-card:hover {
    transform: translateY(-8px);
    border-color: #ffbf00;
    box-shadow: 0 12px 30px rgba(255, 191, 0, 0.15);
}

.generated-team-card h3 {
    font-family: "Russo One", sans-serif;
    color: #ffbf00;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    text-align: center;
}

.generated-team-card h3,
.generated-team-card ul {
    position: relative;
    z-index: 1;
    /* Mantiene el texto por encima de la marca de agua */
}

.generated-team-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.generated-team-card li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.generated-team-card li:last-child {
    border-bottom: none;
}

.generated-team-card li i {
    color: #666;
    font-size: 0.8rem;
}

/* Placeholders de equipos vacíos (Rayitas) */
.team-placeholder {
    background-color: rgba(26, 26, 26, 0.3);
    border: 2px dashed #444;
    border-radius: 12px;
    width: 100%;
    max-width: 300px;
    min-height: 160px;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsivo para volver a colocarlo vertical en tablets/móviles */
@media (max-width: 992px) {
    .team-generator-layout {
        flex-direction: column;
    }
    .tg-left-panel {
        flex: none;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }

    .tg-image-panel {
        max-width: 100%;
        margin-bottom: 20px;
    }
}

/* --- TARJETA DE IMAGEN (IZQUIERDA) --- */
.tg-image-panel {
    flex: 1;
    max-width: 350px;
    /* Ancho máximo de la tarjeta de imagen */
    display: flex;
    flex-direction: column;
}

.tg-image-card {
    background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%);
    border: 1px solid #2a2a2a;
    border-top: 4px solid #ffbf00;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.tg-image-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

#results-area.teams-grid,
#placeholder-area.teams-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
}

.generated-team-card {
    background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%);
    border: 1px solid #2a2a2a;
    border-top: 4px solid #ffbf00;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* Marca de agua estilo credencial */
.generated-team-card::after {
    content: '\f132';
    /* fa-shield-halved */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: -10px;
    bottom: -20px;
    font-size: 7rem;
    color: rgba(255, 255, 255, 0.02);
    z-index: 0;
    transform: rotate(-15deg);
    pointer-events: none;
}

.generated-team-card:hover {
    transform: translateY(-8px);
    border-color: #ffbf00;
    box-shadow: 0 12px 30px rgba(255, 191, 0, 0.15);
}

.generated-team-card h3 {
    font-family: "Russo One", sans-serif;
    color: #ffbf00;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    text-align: center;
}

.generated-team-card h3,
.generated-team-card ul {
    position: relative;
    z-index: 1;
    /* Mantiene el texto por encima de la marca de agua */
}

.generated-team-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.generated-team-card li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.generated-team-card li:last-child {
    border-bottom: none;
}

.generated-team-card li i {
    color: #666;
    font-size: 0.8rem;
}

/* Placeholders de equipos vacíos (Rayitas) */
.team-placeholder {
    background-color: rgba(26, 26, 26, 0.3);
    border: 2px dashed #444;
    border-radius: 12px;
    width: 100%;
    max-width: 300px;
    min-height: 160px;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsivo para volver a colocarlo vertical en tablets/móviles */
@media (max-width: 992px) {
    .team-generator-layout {
        flex-direction: column;
    }
    .tg-left-panel {
        flex: none;
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
}

/* --- ODOMETRO LIVE TORNEO --- */
.live-odometer-container {
    display: none;
    /* Oculto por defecto */
    justify-content: flex-end;
    /* Alineado a la esquina derecha */
    width: 100%;
    margin-bottom: 10px;
    /* Separación sobre la tabla */
    z-index: 1;
    /* Ensure it's above the leaderboard content */
}

.live-odometer-container.active {
    display: flex;
}

.odometer-digits {
    /* This is the container for all digit wrappers and separators */
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    align-items: center;
    /* No need for id="odometer-time" here anymore */
}

/* New styles for rolling odometer effect */
.odometer-digit-wrapper {
    /* Inherits background, border, border-radius, box-shadow, color, font-family from previous .digit-box */
    background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
    border: 1px solid #555;
    border-radius: 6px;
    background: transparent;
    /* Fondo transparente */
    border: none;
    /* Sin borde */
    min-width: 26px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 2px 0 rgba(255, 255, 255, 0.1);
    color: #ffbf00;
    box-shadow: none;
    /* Sin sombra */
    color: #ffffff;
    /* Números blancos */
    font-family: "Courier New", Courier, monospace;

    /* Key properties for rolling effect */
    height: calc(1.5em + 4px);
    /* Height of one digit (1.5em) + top/bottom padding (2px each) */
    overflow: hidden;
    /* Hide digits outside the current view */
    position: relative;
    /* Establish positioning context for the strip */
    display: inline-flex;
    /* To make it behave like a block but align inline */
    justify-content: center;
    /* Center content horizontally */
    align-items: center;
    /* Center content vertically */
    padding: 0 6px;
    /* Only horizontal padding, vertical padding is handled by height */
}

.odometer-digit-strip {
    display: flex;
    flex-direction: column;
    /* Stack digits vertically */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Smooth ease-out transition */
    transform: translateY(0);
    /* Initial transform to show '0' at the top */
}

.odometer-digit-strip span {
    height: 1.5em;
    /* Each digit takes up the visual height of the wrapper's content area */
    line-height: 1.5em;
    /* Vertically center the digit text */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* Ensure span takes full width of its parent (strip) */
}

.odometer-separator {
    /* Removed margin-top: -3px; relying on parent's align-items: center */
    color: #888;
}

@media (max-width: 768px) {
    .odometer-digits {
        font-size: 1.2rem;
        /* Adjust font size for smaller screens */
    }
    .odometer-digit-wrapper {
        min-width: 20px;
        /* Adjust width for smaller screens */
        height: calc(1.2em + 4px);
        /* Adjust height based on new font size */
        padding: 0 4px;
        /* Adjust padding for smaller screens */
    }
    .odometer-digit-strip span {
        height: 1.2em;
        /* Adjust span height based on new font size */
        line-height: 1.2em;
    }
}

/* Event Cards Grid */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to {
        --angle: 360deg;
    }
}

.event-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.event-card {
    background: #111;
    /* Fallback for older browsers */
    border-radius: 16px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Evita que la imagen cuadrada sobresalga de las esquinas redondeadas */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Integra una capa negra transparente, el video webp y el borde animado todo en uno */
    background:
        linear-gradient(rgba(17, 17, 17, 0.85), rgba(17, 17, 17, 0.85)) padding-box,
        url('/vid/onfffgggg.webp') center/cover no-repeat padding-box,
        conic-gradient(from var(--angle), #333 0%, #333 70%, #ffbf00 100%) border-box;
    border: 2px solid transparent;
    animation: rotateBorder 4s linear infinite;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(255, 191, 0, 0.15);
    background:
        linear-gradient(rgba(17, 17, 17, 0.65), rgba(17, 17, 17, 0.65)) padding-box,
        url('/vid/onfffgggg.webp') center/cover no-repeat padding-box,
        conic-gradient(from var(--angle), #555 0%, #555 40%, #ffbf00 100%) border-box;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    gap: 15px;
}

.event-header h3 {
    font-family: "Unbounded", sans-serif;
    color: #ffffff;
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.3;
}

.event-status {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    font-family: "Oswald", sans-serif;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.event-status.status-pending {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.event-status.status-live {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.4);
    animation: pulseLive 2s infinite;
}

.event-status.status-finished {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.event-status.status-unknown {
    background-color: rgba(108, 117, 125, 0.15);
    color: #6c757d;
    border: 1px solid #6c757d;
}

@keyframes pulseLive {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.event-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
    flex-grow: 1;
}

.event-details p {
    background: #1a1a1a;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    font-size: 0.8rem;
    color: #a0a0a0;
    text-transform: uppercase;
    font-family: "Oswald", sans-serif;
    letter-spacing: 0.5px;
    transition: border-color 0.3s ease;
}

.event-card:hover .event-details p {
    border-color: #333;
}

.event-details p i {
    color: #ffbf00;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.event-details p span {
    font-family: "Roboto", sans-serif;
    font-weight: bold;
    color: #ffffff;
    font-size: 1rem;
    text-transform: none;
    letter-spacing: normal;
    word-break: break-word;
}

.btn-event-details {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px;
    background-color: transparent;
    border: 2px solid #ffbf00;
    color: #ffbf00;
    text-decoration: none;
    border-radius: 8px;
    font-family: "Russo One", sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.btn-event-details:hover {
    background-color: #e6ac00;
    color: #000000;
    box-shadow: 0 0 20px rgba(255, 191, 0, 0.4);
}

.btn-event-details i {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.btn-event-details:hover i {
    transform: translateX(5px);
}

.eventos-header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
    width: 100%;
}

/* Aumentamos la especificidad para sobrescribir .info-section h2 */
.info-section h2.eventos-title {
    text-align: left;
    font-family: "Oxanium", sans-serif;
    font-size: 60px;
    color: #ffffff;
    margin-bottom: 0px;
    font-weight: 700;
}

.info-section p.eventos-subtitle {
    text-align: left;
    margin-bottom: 10px;
    color: #a0a0a0;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .info-section h2.eventos-title {
        font-size: 42px;
        /* Reducimos el tamaño en celulares para que no se corte */
    }

    .event-cards-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin: 20px auto;
        padding: 0 15px;
    }

    .event-card {
        padding: 20px;
    }

    .event-header h3 {
        font-size: 1.2rem;
    }

    .event-status {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .event-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .event-details p {
        padding: 10px;
        font-size: 0.75rem;
    }

    .event-details p span {
        font-size: 0.9rem;
    }

    .btn-event-details {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* --- ODOMETRO LIVE TORNEO --- */
.live-odometer-container {
    display: none;
    /* Oculto por defecto */
}

/* =========================================
   CARRUSEL LIVE STREAM (DISEÑO ESCRITORIO)
   ========================================= */

#live-stream-slide {
    padding: 0;
    background: black;
    height: 100%; 
    min-height: 500px;
    overflow: hidden;
}

.stream-layout-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    height: 100%; 
    background: black;
    position: relative;
}

.stream-player-box {
    height: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    background: #000;
    z-index: 1;
}

#twitch-embed-carousel {
    width: 100%;
    height: 100%;
}

#twitch-embed-carousel iframe {
    width: 100% !important;
    height: 100% !important;
}

.stream-info-box {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.95) 25%, #000 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.stream-info-content {
    padding: 40px;
    padding-left: 15%;
    pointer-events: auto;
}

/* --- TIPOGRAFÍA --- */
.onfamily-label { color: #ffbf00; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-size: 1rem; letter-spacing: 2px; font-weight: 600; }
.stream-title-text { color: white; font-family: 'Oswald', sans-serif; font-size: 2.5rem; text-transform: uppercase; line-height: 1.1; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }
.stream-divider { width: 80px; height: 3px; background: #ffbf00; margin: 15px 0; }
.stream-category-text { color: #ffbf00; font-family: 'Oswald', sans-serif; font-size: 1.5rem; text-transform: uppercase; font-weight: 700; }

/* =========================================
   MODO MÓVIL (OCULTAR LIVE)
   ========================================= */
@media (max-width: 900px) {
    /* OCULTAMOS EL SLIDE COMPLETO DEL LIVE */
    #live-stream-slide {
        display: none !important; /* El !important asegura que JS no lo muestre a la fuerza */
    }

    /* Ajuste para que el carrusel normal no deje un hueco */
    .hero {
        padding-bottom: 56.25%; /* Mantiene proporción 16:9 para banners normales */
    }
}

@media (max-width: 768px) {
    /* 1. Ocultamos el slide del directo sí o sí */
    #live-stream-slide {
        display: none !important;
    }

    /* 2. Si el contenedor .hero está vacío o queremos que desaparezca el hueco: */
    .hero {
        /* Cambiamos el padding-bottom a 0 si no hay slides visibles */
        height: auto; 
        padding-bottom: 0; 
        min-height: 0;
    }

    /* 3. Solo le damos altura a los slides que SÍ queremos ver (los banners normales) */
    .carousel-slide:not(#live-stream-slide) {
        position: relative; /* Cambiamos de absolute a relative para que empuje el alto */
        padding-bottom: 56.25%; /* Esto crea el alto 16:9 solo para los banners de imagen */
        display: none; /* Se activará con el display: block del JS */
    }
}