/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE (Mantenemos tus fuentes y colores)
   ========================================================================== */
:root {
    /* Colores Corporativos */
    --primary-blue: #1e3a5f;
    --accent-gold: #ffd700;
    --white: #ffffff;
    --bg-light: #f4f4f4;


    background-image: url('images/FondoPrincipal.png');
    background-repeat: repeat;
    background-size: cover;

    --glow-hue: 222deg;
    --shadow-hue: 180deg;
    --spring-easing: linear(0, 0.002, 0.01 0.9%, 0.038 1.8%, 0.156, 0.312 5.8%, 0.789 11.1%, 1.015 14.2%,
            1.096, 1.157, 1.199, 1.224 20.3%, 1.231, 1.231, 1.226, 1.214 24.6%,
            1.176 26.9%, 1.057 32.6%, 1.007 35.5%, 0.984, 0.968, 0.956, 0.949 42%,
            0.946 44.1%, 0.95 46.5%, 0.998 57.2%, 1.007, 1.011 63.3%, 1.012 68.3%,
            0.998 84%, 1);
    --spring-duration: 1.33s;
}

html {
    height: 100%;  
}

body {
    
    font-family: 'Shadows Into Light', cursive; /*'alkatra', sans-serif;*/
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    opacity: 0.9;
    display: block;
    
    flex-direction: column;
    align-items: stretch;
}

header {
    width: 100%;
    height:fit-content;
    background-color: #333;
    color: #fff;
    padding: 1rem 0;
    text-align: center;
    position: relative;
    z-index: 50;
}

header h1 {

    margin: 1px;
}

nav {
    display: flex;
    flex-direction: row;
    /* align-items: start; */
    margin-top: 1px;
}

nav div {
    width: 60%;
    display: flex;
    
}

nav button {
    background: var(--bg-color,var(--primary-blue));
    color: var(--text-color, #fff);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}

nav button:hover {
    background: var(--bg-color, #2a4a7a);
}

.premium-btn {
    background-color: var(--accent-gold);
    color:var(--primary-blue);
    font-weight: bold;
    border: 2px solid var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: inherit;
}

.premium-btn:hover {
    background-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* Premium Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--accent-gold);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    font-family: inherit;
    box-sizing: border-box;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    font-family: inherit;
    z-index: 1;
}

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

.modal-content h2 {
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-family: inherit;
}

.premium-price {
    font-size: 2.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    margin: 20px 0;
}

.premium-price span {
    font-size: 1rem;
    color: #666;
}

.premium-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.premium-features li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.premium-features li::before {
    content: "✓";
    color: #28a745;
    margin-right: 10px;
}

#paypal-button-container {
    margin: 20px 0;
    min-height: 200px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#paypal-button-container iframe,
#paypal-button-container > div {
    min-width: 300px !important;
    width: 100% !important;
}

.payment-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
}

.payment-message.success {
    background: #d4edda;
    color: #155724;
}

.payment-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ARREGLO DE LOGO ESTRUCTURA UNICA PARA TODAS LAS PAGINAS */

/* #logoPrincipal {
    width: 150px;
    height: auto;
    position: absolute;
    top: 20px;
    left: 20px; 
    
    z-index: 10;
    max-width: 120px;
    transition: width 0.3s ease;
} */

/* Ajuste para móviles: el logo debe achicarse */
@media (max-width: 480px) {
    #logoPrincipal {
        width: 200px;
        top: -50px;
        left: 20px;
    }
}/* ARREGLO DE LOGO ESTRUCTURA UNICA PARA TODAS LAS PAGINAS */

@media (max-width: 480px) {
    .modal-content {
        margin: 2% auto;
        padding: 20px;
    }
    
    #paypal-button-container {
        min-height: 250px;
    }
}

nav button:hover {
    background-color: #0056b3;
}

 
#banner {
    position: relative;
    width: 100%;
    background-color: #000;    
    /* ¡IMPORTANTE!: Elimina o comenta el overflow: hidden. 
       Si lo dejas, cortará la parte del logo que sube al header. */
    overflow: visible !important;    
    /* Para que el banner y su logo estén por encima del flujo normal */
    z-index: 1050; 
}

#banner-image {
    width: 100%;
    height: auto;
    display: block;
    /* Usa 16 / 9 si tus imágenes son 1365x768 */
    /* O usa 3168 / 1344 si ese es el tamaño real del diseño */
    aspect-ratio: 16 / 9; 
    object-fit: cover; /* Esto evita que la imagen se estire feo */
}
/* 3. Estilo Consolidado del Logo (Efecto 50% fuera) */
* --- BLOQUE ÚNICO PARA EL LOGO --- */
#logoPrincipal {
    width: 300px; /* Tamaño sugerido, ajústalo a tu gusto */
    height: auto;
    position: absolute;
    
    /* POSICIONAMIENTO */
    top: 0; 
    left: 150px; /* Desplazamiento a la izquierda que pediste */
    
    /* EL TRUCO DEL 50%: 
       -50% en Y lo sube para invadir el Header.
       -50% en X para que el 'left' sea exacto al centro del logo. */
    transform: translate(-50%, -40%); 
    
    /* CAPAS: Debe ser mayor al z-index del header (1000) */
    z-index: 1100; 
    
    /* Mejoras visuales */
    filter: drop-shadow(0px 5px 15px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
    cursor: pointer;
}


.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 30px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 10;
}

.banner-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.banner-arrow-left {
    left: 10px;
}

.banner-arrow-right {
    right: 10px;
}

/* === JACKPOT / POZO ACUMULADO === */
.jackpot-banner {
    position: relative;
    width: 100%;
    background: rgba(30, 58, 95, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #ffd700;
    padding: 8px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.jackpot-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-family: 'Bebas Neue', sans-serif;
}

.live-indicator {
    color: #ff4d4d;
    font-weight: bold;
    font-size: 0.8rem;
    animation: blink 1.5s infinite;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.65rem;
    color: #ccc;
    letter-spacing: 1px;
    font-family: 'Shadows Into Light', cursive;
}

.value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.2);
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}






main {


    padding: 2px;
    max-width: 100%;
    margin: 0 0;
   
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    
    background-position: center center;
    
    background-size: cover;
   


}

section {
    
    border-top: 1px;
    margin-bottom: 3px;
    padding-bottom: 0px;
    border-bottom: 1px solid #eee;
    opacity: 1;
}

section:last-child {

    border-bottom: none;
}


h3 {
    color: #2e6bab;
    text-align: center;
    font-size: 2.2rem;
    margin: 1px;
    /* margin-bottom: 1px;  */
}

h2,h1 {
    color: #2e6bab;
    text-align: center;
    font-size: 2.6rem;
     margin:1px; 
    


}

#auth-section {

    margin-top: 1px;

}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: calc(100% - 22px);
    padding: 10px;
    /* margin-bottom: 10px; */
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    /* Incluye padding y borde en el width */
    /* Ancho completo menos padding y borde */
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
}

button:hover {
    background-color: #0056b3;
}

#submitLogin, #submitRegister {
    background-color: #007bff;
    color: white;
}

.premium-btn {
    background-color: var(--accent-gold);
    color:var(--primary-blue);
    font-weight: bold;
    border: 2px solid var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.premium-btn:hover {
    background-color: #ffed4a;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

button:hover {
    background-color: #0056b3;
}

#auth-section{
   display : flex;
   flex-direction: column;
}
#login-form,
#register-form {
   
    display : flex;
   flex-direction: column;
    
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}
#loginUsername,
#loginPassword{
    display: flex;    
    /* margin-bottom: 20px; */
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
}

/* aqui voy a  cambiar tamaño de teams-list */
.teams-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

ul {
    list-style: none;
    padding: 0;
    
}

ul li {
    background-color: #e9e9e9;
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    
}


img{    
    width: 15%;
       
}

ul li img {
    margin-left: 10px;
    border: 3px solid #ccc;
}


.teams-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 2%;
    justify-content: center;
    max-width: auto;
    margin: 0 auto;

}



/* NOMBRE DE LA SECCION : PROXIMOS PARTIDOS Y SUS PREDICCIONES
ID SECCION GENERAL == matches-section
ID DEL DIV (SE PONEN LOS PARTIDOS) == matches-container */
/*

/*ajustes para tarjeta de partidos*/
.panel {
    margin: 0 auto;
    /* AJUSTA ESTA ALTURA SEGÚN EL CONTENIDO REAL DE TU TARJETA */
    height: 320px;
    /* Incrementado para dar más espacio. Puedes ajustar más. */
    position: relative;
    -webkit-perspective: 600px;
    -moz-perspective: 600px;
    perspective: 600px;
}

.panel .front,
.panel .back {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
    transition: all .4s ease-in-out;
    /* Añade box-sizing aquí para consistencia si pones padding directamente */
    box-sizing: border-box;
    padding: 15px;
    /* Aplica un padding general a las caras */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.panel .front {
    /* La cara frontal comienza sin rotación y está adelante */
    z-index: 2;
    /* Z-index más alto para que esté por encima de .back inicialmente */
    -webkit-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    transform: rotateY(0deg);
    /* Inicio: mirando hacia adelante */

    /* Color de fondo para la cara FRONTAL */
    background-color: #ffffff;
    /* Un color sólido y claro para la cara frontal */
    color: #333;
    /* Color de texto para la cara frontal */
}

.panel .back {
    /* La cara trasera comienza rotada 180 grados y está detrás */
    z-index: 1;
    /* Z-index más bajo que .front */
    -webkit-transform: rotateY(-180deg);
    /* Inicio: volteada hacia atrás */
    -moz-transform: rotateY(-180deg);
    transform: rotateY(-180deg);

    /* Color de fondo para la cara TRASERA */
    background-color: #e8e8e8;
    /* Un color sólido para la cara trasera */
    color: #333;
    /* Color de texto para la cara trasera */
}

/* Estado 'flip' (cuando el mouse está sobre el panel) */
.panel.flip .front {
    z-index: 1;
    /* Al voltearse, la frontal pasa "detrás" */
    -webkit-transform: rotateY(180deg);
    /* Voltea 180 grados para ocultarse */
    -moz-transform: rotateY(180deg);
    transform: rotateY(180deg);
}


.panel.flip .front {
    z-index: 1;
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.panel.flip .back {
    z-index: 2;
    -webkit-transform: rotateX(0deg) rotateY(0deg);
    -moz-transform: rotateX(0deg) rotateY(0deg);
    transform: rotateX(0deg) rotateY(0deg);
}

#matches-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    
    gap: 1px;
    /* Espacio alrededor de la sección de partidos */
}

/* Ajustes para la tarjeta de partidos */
.match-card.panel {
    height: 320px;
    width: 320px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: rgb(247, 246, 246);
    /* Color de fondo general para la tarjeta */
    float: left;
    margin-right: 2%;
    margin-bottom: 10px;
    /* Espacio entre tarjetas */
}

/* Clases internas para los "cuadros" del flip (box1, box2) */
/* Ahora, estas no deben tener dimensiones fijas que choquen con el panel */
.match-card .front .box1,
.match-card .back .box2 {
    width: 100%;
    /* Ocupa todo el ancho del padding del panel */
    
    /* Si ya se aplica a .panel .front/.back, quita de aquí */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /*se define el ubicacion dentro */
    align-items: center;
}
   

/* Sobrescribe los estilos de 'p' si es necesario dentro de los boxes */
.match-card p {
    color: #333;
    /* Sobrescribe p { color: #ffffff; } si es necesario */
    margin-bottom: 5px;
    /* Espacio entre párrafos */
}

/* Estilos para el título del partido (h3) */
.match-card h3 {
    /* font-size: 1.3em; */
    /* Tamaño de fuente para el título del partido */
    margin-bottom: 1px;
    margin-top: 1px;
    
    /* Centra solo el título si es necesario */
    width: 90%;
    /* Asegura que ocupe el ancho completo para centrado */
}

/* Estilos para la sección de información de los equipos */
.match-card .teams-info {
    display: flex;
    justify-content: center;
    /* Centrar los equipos y "vs" */
    align-items: center;
    gap: 10px;
    /* margin-bottom: 15px; */
    /* Espacio entre los elementos de los equipos */
    width: 100%;

}

.match-card .team {
    display: flex;
    flex-direction: column;
    /* Bandera arriba, nombre abajo */
    align-items: center;
    /* Centrar bandera y nombre */
    text-align: center;
}

.match-card .team img {
    width: 60px;
    /* Tamaño de las banderas */
    height: auto;
    margin-bottom: 5px;
    /* Espacio entre bandera y nombre */
}

.match-card .team span {
    font-size: 0.99em;
    font-weight: bold;
    
}

/* Estilos para el texto "vs" */
.match-card .teams-info span:not(.team span) {
    font-size: 1.9em;
    font-weight: bold;
    color: #555;
}

/* Estilos para la fecha del partido */
.match-card .match-date {
    font-size:1.8em;
    color: #000000;
    margin-top: 1px;
    /* Empuja la fecha hacia abajo si usas flex-start */
    margin-bottom: 1px;
    /* Espacio antes del formulario/estado */
}

/* Estilos para el formulario de predicción */
.match-card .prediction-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    /* Espacio entre inputs y botón */
    margin-top: 15px;
    width: 100%;
}

.match-card .score1-input,
.match-card .score2-input {
    width: 50px;
    /* Ajusta el ancho de los inputs */
    text-align: center;
    font-size: 1.9em;
    padding: 8px 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.match-card .submit-prediction-btn {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s ease;
}

.match-card .submit-prediction-btn:hover {
    background-color: #0056b3;
}

.match-card .prediction-message,
.match-card .match-status-info {
    font-size: 0.8em;
    /* Reduce el tamaño de los mensajes de estado/predicción */
    margin-top: 5px;
    text-align: center;
    width: 100%;
}

/* Estilos para el resultado final en la parte trasera */
.match-card .match-score-back {
    font-size: 2em;
    /* Tamaño grande para el resultado */
    font-weight: bold;
    color: #28a745;
    /* Un color distintivo para el resultado */
    margin-top: 2px;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

.match-card .match-score-back span {
    font-size: 0.7em;
    /* Para los nombres cortos de los equipos junto al score */
    font-weight: normal;
    color: #f00808;
}

.match-card .match-score-back span:nth-child(2) {
    /* el " - " */
    font-size: 1.3em;
    color: #333;
    margin: 0 5px;
}

/* Clase para el mensaje de volteo en la parte trasera */
.match-card .back p {
    font-size: 1.2em;
    color: #000000;
    margin-top: 5px;
}

.current-prediction {
    margin-top: 2px;
    height: 30px;
    font-size: 30px;
}

/*fin de ajuste tarjeta de partidos */
footer {
    clear: both;
    /* Fuerza al footer a colocarse debajo de cualquier flotante */
    background-color: #333;
    color: white;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

span {
    margin: 1px;
    /* font-size: xx-large; */
}

/* --- ESTILOS PARA LA TABLA DE POSICIONES --- */

/* Contenedor de botones (Real vs Pronósticos) */
.standings-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.btn-mode {
    font-family: 'alkatra', sans-serif;
    padding: 10px 25px;
    border: 2px solid #007bff;
    background-color: white;
    color: #007bff;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.btn-mode.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* Contenedor por Grupo */
.team-group {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.group-title {
    font-family: 'Shadows Into Light', cursive; /* Usando tu fuente de marca */
    font-size: 2.2rem;
    color: #2e6bab;
    margin-bottom: 1px;
    text-align: left;
    border-bottom: 2px solid #f0f0f0;
}

/* Estilo de la Tabla */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'alkatra', sans-serif;
}

.standings-table th {
    text-align: center;
    padding: 12px;
    background-color: #f8f9fa;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid #eee;
}

.standings-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #f1f1f1;
    font-size: 1.1rem;
}

/* Alineación especial para la columna de equipo */
.team-cell {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.team-cell img {
    width: 40px; /* Tamaño optimizado para banderas */
    height: 25px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* Resaltado de clasificados (Primeros 2) */
.qualified {
    background-color: #f0fff4; /* Un verde muy sutil */
}

.qualified td:first-child {
    font-weight: bold;
    color: #28a745;
    border-left: 5px solid #28a745;
}

.pts-cell {
    font-weight: bold;
    color: #000;
}

/* Responsive */
@media (max-width: 600px) {
    .standings-table th:nth-child(3), 
    .standings-table td:nth-child(3) { display: none; } /* Ocultar PJ en móviles muy pequeños */
}


/* Fin de estilos tabla de posiciones */

 /* estilos para mostrar los grupos */
/* Contenedor de filtros de grupos */
 .group-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 2px;
    padding: 10px;
}

.btn-group-filter {
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    color: #555;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'alkatra', sans-serif;
    transition: all 0.2s ease;
}

.btn-group-filter:hover {
    border-color: #007bff;
    color: #007bff;
}

.btn-group-filter.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

.no-matches {
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px;
    color: #888;
    font-style: italic;
}


.finished-view {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
}

.final-score {
    font-size: 1.9rem;
    font-weight: 900;
    color: #2e6bab;
    margin: 0 5px;
    font-family: 'alkatra', sans-serif;
}

.status-badge {
    background-color: #28a745;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

.old-prediction {
    /* font-size: 2.5 em; */
    font-size: 30px;
    color: #666;
    border: 2px dashed #ccc;
    /* padding: 10px; */
    border-radius: 10px;
    margin: 1px 0;
}

.hint {
    font-size: 1em;
    color: #999;
    font-style: italic;
    margin-top: 1px;
}


/* VISTA  MODIFIACADA PARA MOVILES */


    @media (max-width: 767px) {
    .group-selector {
        display: flex !important;
        flex-wrap: nowrap !important; /* Evita que salten de línea */
        overflow-x: auto !important;  /* Activa el scroll horizontal */
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        gap: 10px;
        /* padding: 15px 10px; */
        justify-content: flex-start !important; /* Alinea al inicio para poder scrollear */
        scrollbar-width: none; /* Oculta scrollbar en Firefox */
    }

    .group-selector::-webkit-scrollbar {
        display: none; /* Oculta scrollbar en Chrome/Safari */
    }

    .btn-group-filter {
        flex: 0 0 auto; /* Importante: evita que los botones se encojan */
        padding: 8px 20px;
        font-size: 0.9rem;
    }
}
    /* FORZAR BOTONES DE GRUPO A LÍNEA ÚNICA CON SCROLL */
    .group-filters, #matches-section .filter-container {
        display: flex !important;
        flex-wrap: nowrap !important; /* No saltar de línea */
        overflow-x: auto !important;  /* Activar scroll lateral */
        gap: 10px;
        margin-bottom: 5px;
        padding: 10px 5px;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Evitar que estos botones específicos midan 100% */
    .btn-group-filter {
        width: auto !important; /* Cancela el 100% */
        flex: 0 0 auto !important; /* Evita que se encojan */
        white-space: nowrap !important; /* Texto en una sola línea */
        padding: 8px 20px !important;
    }

    /* Solo los botones de formularios deben ser 100% */
    #login-form button, #register-form button, #submitLogin, #submitRegister {
        width: 100%;
        margin-bottom: 10px;
    }

    input {
        width: 100%;
        margin-bottom: 10px;
    }
 /* ARREGLO PARA LA TABLA DE PUNTOS EN MÓVIL */ 
    
@media (max-width: 767px) {
    /* Forzamos a que la tabla no intente estirarse de más */
    .standings-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto; /* Permite que las columnas se ajusten al contenido */
    }

    .standings-table th, 
    .standings-table td {
        padding: 6px 2px; /* Reducimos el padding al mínimo lateral */
        font-size: 0.8rem;
        text-align: center;
        /* Quitamos anchos heredados que puedan estar estorbando */
        width: auto; 
    }

    /* Columna de Posición: muy estrecha */
    .pos-cell, .standings-table th:first-child {
        width: 30px;
    }

    /* COLUMNA CLAVE: El nombre del equipo */
    .team-cell {
        text-align: left !important;
        display: flex;
        align-items: center;
        gap: 5px;
        padding-left: 5px !important;
        /* Evita que el nombre se separe de los números */
        min-width: 120px; 
        max-width: 150px; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Si el nombre es muy largo, pone "..." */
    }

    /* TRUCO: Forzamos a las columnas numéricas a ser lo más pequeñas posible */
    .standings-table td:not(.team-cell):not(.pos-cell),
    .standings-table th:not(:nth-child(2)):not(:first-child) {
        width: 1%; /* El navegador las ajustará al contenido mínimo */
        white-space: nowrap;
        padding: 6px 8px; /* Espacio cómodo para tocar, pero sin huecos vacíos */
    }

    /* Resaltar la columna de puntos para que se diferencie */
    .pts-cell {
        font-weight: bold;
        background-color: rgba(255, 255, 255, 0.05);
        width: 35px !important;
    }
}
    

@media(max-width:767px){
    h2,h1{
        font-size: 1.5rem !important;
       margin-top: 1px !important;
        margin-bottom: 10px !important;
        text-align: center;
        letter-spacing: 0.5px;    
    }

}


@media (max-width: 767px) {
    #team-section, #matches-section {
        padding: 10px 5px !important; /* Reduce el espacio interno de las secciones */
    }
}


@media (max-width: 767px) {
    /* Centrar el contenedor de las tarjetas */
    #matches-container {
        display: flex; /* Cambiamos a flex para mejor control de centrado en una sola columna */
        flex-direction: column;
        align-items: center; /* Centra las tarjetas horizontalmente */
        gap: 20px;
        padding: 10px 0;
        width: 100%;
    }

    /* Ajuste de la tarjeta de partido */
    .match-card.panel {
        float: none !important;      /* Eliminamos el desplazamiento a la izquierda */
        margin: 0 auto 15px auto !important; /* Centrado horizontal automático */
        width: 90% !important;       /* Que ocupe casi todo el ancho disponible */
        max-width: 340px;            /* Pero que no se deforme en móviles grandes */
        height: auto;                /* Permitimos que crezca según el contenido */
        min-height: 320px;
    }

    /* Ajuste para las caras front/back para que ocupen el nuevo ancho */
    .panel .front, .panel .back {
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    #logoPrincipal {
        width: 1px; /* Más pequeño en móvil */
        left: 5%; /* Lo centramos para una mejor impresión visual */
        top: 0;
        transform: translate(5%, -50%);
    }
}
#total-puntos {
    font-size: 3.5rem;
    font-weight: bold;
    color: #2e6bab;
    /* margin-top: 20px; */
    text-align: center;
}

/* --- RANKING GURU SCORE: ESTILO UNIFICADO --- */
#ranking-section {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 15px !important;
    margin: 40px auto !important;
    padding: 25px !important;
    width: 95% !important;
    max-width: 1000px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Estilo de la tabla interna */
.table-ranking {
    width: 100% !important;
    border-collapse: collapse !important; /* Cambiado para que los bordes se vean uniformes */
    margin-top: 15px;
    color: rgb(0, 0, 0) !important;
}

/* Encabezados (Th) - Usando el estilo azul brillante de tus grupos */
.table-ranking th {
    background: rgba(0, 212, 255, 0.2) !important;
    color: #000000 !important;
    font-family: 'Bebas Neue', sans-serif !important;
    padding: 12px !important;
    text-transform: uppercase;
    border-bottom: 2px solid #000000 !important;
    text-align: center !important;
}

/* Celdas (Td) */
.table-ranking td {
    padding: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-family: 'Alkatra', cursive !important; /* Fuente que usas en el resto de la web */
    text-align: center;
}

/* Alineación específica para el nombre de usuario */
.table-ranking td:nth-child(2) {
    text-align: center;
    font-weight: bold;
    color: #040404;
}

/* Efecto Hover en las filas */
.table-ranking tbody tr:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transition: 0.3s;
}

/* Responsive Banner */
@media (max-width: 768px) {
    header nav {
        /* flex-wrap: wrap; */
        height: auto;
        padding: 1px;
    }
    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 4px 1px;
    }
    
    
    
    .elimination-container {
        padding: 1px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    header nav {
        /* flex-direction: column; */
        align-items: center;
        height: auto;
       
    }
    
    header nav div {
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
    }
    
  
    
    header nav button {
        margin: 3px;
        font-size: 0.75rem;
        padding: 6px 10px;
        width: auto;
    }
}
    
    header nav div {
        width: auto;
        margin-bottom: 0;
    }
    
    
    
    header nav button {
        margin: 3px;
        font-size: 0.75rem;
        padding: 6px 10px;
        width: auto;
    }
    
    /* Container for buttons to align right */
    header nav {
        position: relative;
    }

    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    
    
    .elimination-container {
        padding: 10px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }


    
    header nav div {
        width: 100%;
        margin-bottom: -10px;
    }
    
   
    
    header nav button {
        margin: 3px 3px 3px 0;
        font-size: 0.75rem;
        padding: 6px 10px;
        width: auto;
    }

    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
  
    
    .elimination-container {
        padding: 10px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }

    
    /* #banner #logoPrincipal {
        width: 150px;
        top: -50px;
    } */
    
    .banner-arrow {
        font-size: 20px;
        padding: 8px 12px;
    }
    
    /* Header navigation */
    header nav {
        flex-wrap: wrap;
        height: auto;
        /* padding: 10px; */
        justify-content: center;
    }
    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
        width: auto;
    }
    
    /* Elimination page */
    header nav div img#logoPrincipal {
        /* width: 180px; */
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        display: block;
        margin: 0 auto 10px auto;
    }
    
    .elimination-container {
        padding: 10px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }
    
    .view-btn, .type-btn {
        width:100%;
        margin: 5px 0;
    }




/* Responsive Elimination Page */
/* @media (max-width: 768px) {
    header nav {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }
    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    header nav div img#logoPrincipal {
        width: 110px;
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        display: block;
        margin: 0 auto 10px auto;
    }
    
    .elimination-container {
        padding: 10px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }
} */
    
    header nav button {
        margin: 5px;
        font-size: 0.8rem;
        padding: 8px 12px;
    }
   
    
    .elimination-container {
        padding: 10px;
    }
    
    .bracket-container {
        overflow-x: auto;
    }
    
    .view-selector, .type-selector {
        flex-direction: column;
    }


/* Clases para estilos que estaban inline - movidos de index.html y elimination.html */
.text-small-link {
    font-size: 0.9rem;
    color: #3498db;
}

.text-error {
    color: red;
}

.hidden {
    display: none;
}

.admin-matches-container {
    margin-top: 15px;
}

.bracket-pending {
    padding: 20px;
    text-align: center;
    color: #999;
}

.match-status {
    color: #aaa;
    font-size: 0.8rem;
}



/* estilos de elimination.html MIGRACION DESDE index.html */

 .elimination-container {
            padding: 20px;
            max-width: 1800px;
            margin: 0 auto;
            overflow-x: auto;
        }

        .elimination-header {
            text-align: center;
            margin-bottom: 20px;
        }

        .elimination-header h1 {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 2.5rem;
            color: var(--primary-blue);
            margin-bottom: 5px;
        }

        .view-selector {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 15px;
            flex-wrap: wrap;
        }

        .view-btn {
            padding: 10px 20px;
            background: var(--primary-blue);
            color: white;
            border: 2px solid rgba(255, 215, 0, 0.3);
            border-radius: 5px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.95rem;
            transition: all 0.3s;
        }

        .view-btn:hover {
            background: var(--primary-blue);
        }

        .view-btn.active {
            background: var(--accent-gold);
            color: var(--primary-blue);
            border-color: var(--accent-gold);
            font-weight: bold;
        }

        .type-selector {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
        }

        .type-btn {
            padding: 8px 16px;
            background: white;
            color: var(--primary-blue);
            border: 2px solid var(--primary-blue);
            border-radius: 5px;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

        .type-btn:hover {
            background: #f0f0f0;
        }

        .type-btn.active {
            background: var(--primary-blue);
            color: white;
        }

        /* BRACKET VISUALIZATION */
        .bracket-wrapper {
            display: flex;
            justify-content: flex-start; /* Permite scroll horizontal natural en móvil */
            padding: 20px;
            overflow-x: auto; /* Fundamental para que el usuario pueda ver todo el torneo */
        }

        .bracket-tree {
            display: flex;
            justify-content: center;
            align-items: stretch;
        }

        .round-column {
                display: flex;
                flex-direction: column;
                justify-content: space-around; /* Distribuye los partidos automáticamente */
                min-width: 200px;
                margin: 0 20px;
        }

        .round-title {
            text-align: center;
            font-family: 'Bebas Neue', sans-serif;
            font-size: 1.3rem;
            color: var(--primary-blue);
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 3px solid var(--accent-gold);
        }

        .match-pair {
            display: flex;
            flex-direction: column;
            justify-content: center;
            position: relative;
            flex: 1;
            margin: 8px 0;
        }

        /* Connector Lines */
        .match-pair::before {
            content: '';
            position: absolute;
            left: -15px;
            top: 50%;
            width: 15px;
            height: 2px;
            background: #ccc;
        }

        .match-pair::after {
            content: '';
            position: absolute;
            right: -15px;
            top: 50%;
            width: 15px;
            height: 2px;
            background: #ccc;
        }

        .round-column:first-child .match-pair::before {
            display: none;
        }

        .round-column:last-child .match-pair::after {
            display: none;
        }

        .bracket-match {
            background: white;
            border-radius: 8px;
            padding: 8px 12px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
            border: 1px solid #ddd;
            transition: all 0.3s;
        }

        .bracket-match:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
            transform: scale(1.02);
        }

        .team-row {
            display: flex;
            align-items: center;
            padding: 4px 8px;
            border-radius: 4px;
        }

        .team-row.winner {
            background: linear-gradient(90deg, rgba(40, 167, 69, 0.15), transparent);
        }

        .team-row.winner .team-name,
        .team-row.winner .team-score {
            color: #28a745;
            font-weight: bold;
        }

        .team-flag {
            width: 22px;
            height: 15px;
            margin-right: 8px;
            object-fit: cover;
            border-radius: 2px;
        }

        .team-name {
            font-size: 0.8rem;
            font-weight: 500;
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .team-score {
            font-weight: bold;
            min-width: 18px;
            text-align: right;
            font-size: 0.9rem;
        }

        .vs-divider {
            text-align: center;
            font-size: 0.7rem;
            color: #999;
            padding: 2px 0;
        }

        /* Spacing for proper alignment */
        .round-column[data-round="round32"] .match-pair { min-height: 90px; }
        .round-column[data-round="round16"] .match-pair { min-height: 180px; }
        .round-column[data-round="quarterfinals"] .match-pair { min-height: 360px; }
        .round-column[data-round="semifinals"] .match-pair { min-height: 720px; }
        .round-column[data-round="final"] .match-pair { min-height: 1440px; }

        /* Qualified Teams Grid */
        .qualified-container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .qualified-section {
            margin-bottom: 25px;
            padding: 20px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .qualified-section h3 {
            font-family: 'Bebas Neue', sans-serif;
            color: var(--primary-blue);
            border-bottom: 2px solid var(--accent-gold);
            padding-bottom: 10px;
            margin-bottom: 15px;
            font-size: 1.3rem;
        }

        .teams-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
        }

        .team-badge {
            display: flex;
            align-items: center;
            background: #f8f9fa;
            padding: 8px 12px;
            border-radius: 5px;
            border: 1px solid #ddd;
        }

        .team-badge img {
            width: 24px;
            height: 16px;
            margin-right: 8px;
            border-radius: 2px;
        }

        .team-badge span {
            font-size: 0.85rem;
        }

        .loading {
            text-align: center;
            padding: 60px;
            font-size: 1.3rem;
            color: #666;
        }

        .back-link {
            display: inline-block;
            margin-bottom: 20px;
            color: var(--primary-blue);
            text-decoration: none;
            font-weight: bold;
        }

        .admin-panel {
            background: var(--primary-blue);
            padding: 15px;
            margin-bottom: 20px;
            border-radius: 8px;
            display: none; /* Oculto por defecto */
        }

        .admin-panel.visible {
            display: block;
        }

        .admin-panel h3 {
            color: var(--accent-gold);
            margin: 0 0 10px 0;
            font-family: 'Bebas Neue', sans-serif;
        }

        .admin-buttons {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }

        .admin-btn {
            padding: 8px 16px;
            background: var(--accent-gold);
            color: var(--primary-blue);
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
            font-family: inherit;
            font-size: 0.9rem;
        }

        .admin-btn:hover {
            background: #e6c200;
        }

        .admin-btn.danger {
            background: #dc3545;
            color: white;
        }

        .admin-btn.danger:hover {
            background: #c82333;
        }

        .match-admin {
            margin-top: 10px;
            padding: 10px;
            background: rgba(255,255,255,0.1);
            border-radius: 5px;
        }

        .match-admin input {
            padding: 5px;
            margin: 0 5px;
            width: 40px;
            border: 1px solid #ddd;
            border-radius: 3px;
            text-align: center;
        }

        .match-admin button {
            padding: 5px 10px;
            background: #28a745;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
            font-size: 0.8rem;
        }

        /* Mobile */
        @media (max-width: 768px) {
            .bracket-wrapper {
                overflow-x: auto;
            }
            
            .bracket-tree {
                flex-direction: column;
                align-items: center;
            }
            
            
            
            .match-pair::before,
            .match-pair::after {
                display: none;
            }
        }


