* {
  margin: 0px;
  padding: 0px;
}

#titulo {
  text-align: center;
  color: #FF000F;
}

#intro {
  text-align: center;
  padding: 20px;
  font-size: 30px;
}

#p1 {
  text-align: center;
  color: black;
}

/* ?? CORRECCIÓN CLAVE 1: max-width en lugar de width fijo */
#contenedor {
  max-width: 1050px;
  width: 100%;
  margin: 0 auto;
}

a:hover {
  color: #FF0000; /* rojo */
}

a:visited {
  color: #00FF00; /* verde */
}

a:link {
  color: #FF0000;
}

body {
  background-color: #B8CCCC;
}

.navegacion {
  background: #FCFBFA;
  text-align: center;
}

.navegacion ul {
  list-style: none;
}

.menu > li {
  position: relative;
  display: inline-block;
}

.menu > li > a {
  display: block;
  padding: 15px 20px;
  color: #080807;
  font-family: sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  text-decoration: none;
}

.menu li a:hover {
  color: #D5DBDB;
  transition: all 0.3s;
}

/* Submenú */
.submenu {
  position: absolute;
  background: #D5DBDB;
  width: 100%; /* conserva el ancho del padre */
  display: none; /* oculto por defecto */
}

/* ?? CORRECCIÓN CLAVE 2: Más área táctil (padding) para el submenú */
.submenu li a {
  display: block;
  padding: 15px 10px;
  color: #5b5a3d;
  text-decoration: none;
  text-align: center;
  font-family: sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
}

.menu li:hover .submenu {
  display: block;
}

.menu li:hover {
  background: #FF000F;
}

.descripcion {
  text-align: center;
  padding: 50px;
  margin-left: 300px;
  color: white;
}

img,
video {
  display: block;
  margin: 0 auto;
}

.contenedor-graficas-horizontal {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 40px;
    width: 100%;
    margin: 40px auto;
}

.grafica-item {
    flex: 1;
    min-width: 400px;
    height: 550px;
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
}

@media (max-width: 1100px) {
    .contenedor-graficas-horizontal {
        flex-direction: column;
    }
}

/* --- Cajas de Monetización --- */
.caja-afiliado {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    margin: 25px 0;
    text-align: center;
    border-top: 4px solid #06367A;
}

.caja-afiliado h4 {
    margin-top: 0;
    color: #06367A;
    font-size: 18px;
    margin-bottom: 10px;
}

.caja-afiliado p {
    color: #555;
    font-size: 14px;
    margin-bottom: 15px;
}

.cuota-destacada {
    display: inline-block;
    background: #f4f7f6;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.btn-afiliado {
    display: inline-block;
    background: #28a745;
    color: #ffffff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.3s ease;
}

.btn-afiliado:hover {
    background: #218838;
}

.btn-sorare {
    background: #000000;
}

.btn-sorare:hover {
    background: #333333;
}

.texto-legal-afiliado {
    display: block;
    margin-top: 12px;
    font-size: 11px;
    color: #888;
}

/* ?? CORRECCIÓN CLAVE 3: Área táctil gigante para los enlaces del footer */
footer a {
    display: inline-block;
    padding: 12px;
}
/* --- Buscador Rápido Equipo/Jornada --- */
.buscador-inicio-contenedor {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 40px 0;
    padding: 0 15px;
    box-sizing: border-box;
}

.buscador-inicio-form {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #f4f7f6;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.buscador-inicio-form select,
.buscador-inicio-form input[type="submit"] {
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.buscador-inicio-form input[type="submit"] {
    background-color: #06367A;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
}

.buscador-inicio-form input[type="submit"]:hover {
    background-color: #042452;
}

/* Ajustes para móviles */
@media (max-width: 768px) {
    .buscador-inicio-form {
        flex-direction: column;
        width: 100%;
    }
    
    .buscador-inicio-form select,
    .buscador-inicio-form input[type="submit"] {
        width: 100%;
    }
}
/* --- MENÚ HAMBURGUESA (MÓVIL) --- */
@media (max-width: 900px) {
    /* Ocultamos el título centrado de PC y mostramos la barra móvil */
    .titulo-desktop { display: none !important; }
    .barra-movil { display: flex !important; }

    /* Convertimos el menú horizontal en un panel lateral */
    #nav-principal {
        position: fixed;
        top: 0;
        left: -320px; /* Escondido a la izquierda */
        width: 280px;
        height: 100vh;
        background-color: #FCFBFA;
        z-index: 999;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 15px rgba(0,0,0,0.5);
        overflow-y: auto;
        text-align: left;
        padding-top: 60px;
    }

    #nav-principal.activo {
        left: 0; /* Sale hacia la pantalla */
    }

    #menu-cerrar { display: block !important; }

    /* Apilamos los botones uno debajo de otro */
    .menu > li {
        display: block;
        border-bottom: 1px solid #e0e0e0;
    }

    .menu > li > a {
        padding: 18px 25px;
        font-size: 18px;
        color: #333;
    }

    /* Arreglamos el submenú de equipos */
    .submenu {
        position: relative; 
        width: 100%;
        box-shadow: none;
        background: #f4f7f6;
        display: none; /* Oculto por defecto */
    }

    .submenu li a {
        padding: 15px 20px 15px 45px;
        font-size: 16px;
        text-align: left;
        color: #555;
    }

    .has-submenu.abierto .submenu {
        display: block;
    }
}
/* ESTILOS PARA LA CUADRÍCULA DE TEMPORADAS EN EQUIPOS.HTML */
.grid-temporadas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}
.card-temporada {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-decoration: none;
    display: block;
}
.card-temporada:hover {
    transform: translateY(-5px);
    border-color: #06367A;
    box-shadow: 0 8px 15px rgba(6,54,122,0.15);
}
.card-temporada img {
    max-width: 100px;
    height: auto;
    margin-bottom: 15px;
}
.card-temporada span {
    display: block;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}
/* ESTILOS PARA LA CUADRÍCULA DE EQUIPOS EN LA TEMPORADA */
.grid-equipos {
    display: grid;
    /* Se adapta automáticamente: mínimo 140px por caja, máximo lo que sobre */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}
.card-equipo {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.card-equipo:hover {
    transform: translateY(-5px);
    border-color: #06367A;
    box-shadow: 0 8px 15px rgba(6,54,122,0.15);
}
.card-equipo img {
    max-width: 70px;
    height: auto;
    margin-bottom: 15px;
}
.card-equipo span {
    color: #333;
    font-weight: bold;
    font-size: 15px;
    line-height: 1.2;
}
/* ESTILOS PARA ASEGURAR GRÁFICOS RESPONSIVOS EN COMPARACIÓN JUGADORES */
    .contenedor-graficas-horizontal {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: 20px;
        width: 100%;
        margin: 40px auto;
        padding: 0 10px;
        box-sizing: border-box;
    }
    .grafica-item {
        flex: 1 1 400px;
        min-width: 280px; 
        max-width: 100%;
        height: 450px;
        background-color: rgba(0,0,0,0.2);
        padding: 15px;
        border-radius: 10px;
        box-sizing: border-box;
        position: relative; 
    }
/* ESTILOS PARA LA CUADRÍCULA DE BÚSQUEDAS EN JUGADORES.PHP */
.seccion-busqueda {
    max-width: 1050px; /* Igualamos al ancho máximo del contenedor general */
    width: 100%;
    margin: 0 auto 40px auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Fuerza 2 columnas exactamente iguales que ocupan todo el ancho */
    gap: 30px;
    padding: 0 15px;
    box-sizing: border-box;
}

/* En móviles, pasamos a 1 sola columna */
@media (max-width: 768px) {
    .seccion-busqueda {
        grid-template-columns: 1fr;
    }
}

.seccion-busqueda .buscador-inicio-contenedor {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.titulo-tarjeta {
    text-align: center;
    color: #06367A;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 20px;
}

.seccion-busqueda .buscador-inicio-form {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Hace que todas las cajas tengan la misma altura */
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

.seccion-busqueda .buscador-inicio-form select,
.seccion-busqueda .buscador-inicio-form input[type="text"] {
    width: 100%;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* El botón siempre pegado abajo */
.seccion-busqueda .buscador-inicio-form input[type="submit"] {
    width: 100%;
    margin-top: auto; 
    box-sizing: border-box;
}

/* Sub-grid para los 4 botones de los rankings */
.grid-botones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-grow: 1;
    width: 100%;
}

.grid-botones .buscador-inicio-form {
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.grid-botones input[type="submit"] {
    margin-bottom: 0;
    padding: 10px 5px;
    font-size: 14px;
    white-space: normal;
    height: 100%;
    margin-top: 0;
}
/* AJUSTE ESPECÍFICO PARA LA CUADRÍCULA DE 5 CAJAS EN JUGADORES */
.pagina-jugadores .seccion-busqueda {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 25px !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.pagina-jugadores .buscador-inicio-contenedor {
    flex: 1 1 320px !important;
    max-width: 380px !important;
    min-width: 300px !important;
}

/* Aseguramos que en móviles sigan ocupando el 100% */
@media (max-width: 768px) {
    .pagina-jugadores .buscador-inicio-contenedor {
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
}
/* FIJAR EL HEADER AL HACER SCROLL (STICKY MENU) */
header {
    position: sticky !important;
    top: 0 !important;
    z-index: 997 !important; /* Para que pase por encima del texto y las tablas */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important; /* Una sombrita elegante para separarlo del fondo */
}

/* PUENTE INVISIBLE PARA EL MENÚ DE IDIOMA */
.lang-dropdown::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -15px; /* Cubre el hueco de separación */
    height: 15px;
    background: transparent;
    z-index: 1;
}