.team-hero {
    width: 100%;
    border-radius: 14px;
    padding: 2.2vw 2.2vw;
    margin: 1.2vw 0 2vw;
    background: radial-gradient(1200px 600px at 20% 20%, rgba(0, 140, 255, 0.18), rgba(0, 0, 0, 0)) ,
                linear-gradient(120deg, rgba(20, 35, 78, 0.85), rgba(7, 10, 25, 0.70));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.team-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2.2vw;
}

.team-hero__left {
    display: flex;
    align-items: center;
    gap: 1.6vw;
    min-width: 0;
}

.team-hero__logoWrap {
    width: 8.5vw;
    min-width: 8.5vw;
    max-width: 120px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(255, 130, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6vw;
    box-sizing: border-box;
}

.team-hero__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-hero__meta {
    min-width: 0;
}

.team-hero__title {
    margin: 0;
    font-size: clamp(26px, 3vw, 50px);
    letter-spacing: 0.02em;
    color: #ff8a00;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.team-hero__subtitle {
    margin: 0.25vw 0 0;
    font-size: clamp(13px, 1.35vw, 18px);
    color: white;
    opacity: 0.86;
    font-weight: 500;
}

.team-hero__link {
    color: white;
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.team-hero__link:hover {
    color: #ff8a00;
}

.team-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 1.2vw;
    align-items: stretch;
    width: clamp(520px, 44vw, 720px);
    max-width: 720px;
}

.team-statCard {
    border-radius: 12px;
    background: rgba(8, 12, 25, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 1.2vw 1.1vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.35vw;
    backdrop-filter: blur(10px);
}

.team-statCard__value {
    font-size: clamp(28px, 3.1vw, 56px);
    color: white;
    font-weight: 800;
    line-height: 1;
}

.team-statCard__label {
    font-size: clamp(12px, 1.3vw, 18px);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.rank-badge {
    display: inline-block;
    margin-top: 0.4vw;
    padding: 0.25vw 0.65vw;
    border-radius: 8px;
    font-size: clamp(12px, 1.05vw, 16px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.30);
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;

}

.rank-badge--good {
    background: rgba(0, 168, 120, 0.70);
    border-color: rgba(0, 168, 120, 0.85);
}

.rank-badge--mid {
    background: rgba(255, 138, 0, 0.65);
    border-color: rgba(255, 138, 0, 0.82);
}

.container_jugadores {
    display: flex;
    gap: 2vw;
}

/* Información del equipo en la página de jugadores */
.team-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2vw;
    align-items: center;
    font-size: 1vw;
    margin: 0.5vw 0;
}

.team-info-columns {
    display: grid !important;
    grid-template-columns: 1fr 2.5fr 0.7fr !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 1vw;
}

.team-info-columns .team-info {
    min-width: 0;
    max-width: 100% !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    box-sizing: border-box;
    word-break: break-word;
    font-size: 1.5vw;
}

.team-info-columns .team-photo {
    min-width: 0;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    text-align: right !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.team-info-columns .team-photo img {
    width: 90%;
    height: auto;
    margin: 0 auto;
    display: block;
    margin-right: 0 !important;

}

.team-logo {
    width: 6vw;
    height: auto;
}

.team-info p {
    margin: 0;
}

h2 {
    font-size: 2vw;
}

.jugadores-list {
    margin-top: 20px;
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 0.3vh; /* Espacio vertical entre cada jugador */
    list-style-type: none;
    font-size: 1vw;
    color: var(--text-color);
}

.jugadores-list li {
    display: flex;
    justify-content: flex-start; /* Alinear el contenido al inicio */
    padding: 0.5vh 0.5vw; /* Espaciado interno en cada elemento */
    border-bottom: 1px solid #444; /* Línea de separación entre jugadores */
}

.jugadores-list li a {
    color: inherit;
    text-decoration: none;
}

.jugadores-list li a:hover {
    color: #ff6600;
}

.info-divs-container {
    width: 70%;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Cambia a cuatro columnas */
    gap: 1vw; /* Ajustar este valor si hay demasiado espacio */
}

.info-div {
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column; /* Asegúrate de que se apilen verticalmente */
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #333;
    border-radius: 10px;
}

.info-div h5 {
    margin: 0; /* Eliminar margen por defecto */
    padding: 10px; /* Eliminar padding por defecto, si existe */
    font-size: 1.5vw
}

.info-div p {
    margin: 0; /* Eliminar margen por defecto */
    padding: 10px; /* Eliminar padding por defecto, si existe */
    font-size: 3vw;
}

.estadisticas_acumuladas {
    font-size: 1vw; /* Ajustar tamaño de fuente */
    border-collapse: collapse;
    display: block; /* Convierte la tabla en un bloque para desplazamiento */
    border-radius: 10px;
}

.estadisticas_acumuladas{
     margin-right: 20px;
}

.estadisticas_acumuladas th{
    text-align: left;
    padding-left: 10px;
    width: 11.25%; 
}

.estadisticas_acumuladas td {
    text-align: left;
    padding-left: 10px;
}

.grafica-container{
    display: flex;
    justify-content: space-between;  /* Ajuste de espaciado */
}

.grafica{
    width: calc((100vw / 3) - 5vw); /* Ajuste basado en el tamaño de la pantalla */
    height: calc((100vw / 3) - 5vw); /* Mantén la proporción */
    margin-bottom: 3vw; /* Espacio debajo de cada gráfico */
}

.titulos_porcentajes{
    margin: 0; 
    text-align: center;
    font-size: 2vw;
}

.tablasTop {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2vw;
    margin-bottom: 0;
}

.tablasTopDos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0;
}

.tabla{
    width: 100%;
    border-radius: 10px;
    margin-bottom: 0;
}

.tabla th{
    font-size: 1vw;
}

.tabla td{
    font-size: 1vw;
}

.tabla h4 {
    padding-left: 2px;
    margin-top: 0;
    margin-bottom: 0; /* Elimina márgenes de los encabezados dentro de las tablas */
    font-size: 1.5vw;
    text-align: center;
}

.tablaDos{
    width: 44vw; /* Ancho de cada gráfico */
}

.tablaDos th{
    font-size: 1vw;
}

.tablaDos td{
    font-size: 1vw;
}

.tablaDos h4 {
    padding-left: 2px;
    margin-top: 0;
    margin-bottom: 0; /* Elimina márgenes de los encabezados dentro de las tablas */
    font-size: 1.5vw;
    text-align: center;
}

.tablacontenido{
    border-radius: 10px;
    margin-top: 10px;
    min-height: 300px;
}

.est_local_visitante{
    margin: 0 auto;
}

.titulos-tablas-top{
    margin-top: 30px !important;
}

/* Media Query para dispositivos móviles */
@media (max-width: 768px) {
        .tablasTop {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }

    .team-hero {
        padding: 8px 7px;
        margin: 10px 0 18px;
        border-radius: 12px;
    }

    .team-hero__inner {
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 8px;
    }

    .team-hero__logoWrap {
        width: 48px;
        min-width: 48px;
        padding: 5px;
    }

    .team-hero__title {
        font-size: 16px;
        line-height: 1.05;
    }

    .team-hero__subtitle {
        font-size: 9px;
        line-height: 1.2;
        margin-top: 2px;
    }

    .team-hero__stats {
        width: 100%;
        max-width: none;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
    }

    .team-statCard {
        padding: 6px 4px;
        border-radius: 10px;
        gap: 2px;
    }

    .team-statCard__value {
        font-size: 16px;
    }

    .team-statCard__label {
        font-size: 8px;
    }

    .rank-badge {
        font-size: 7px;
        padding: 2px 5px;
        margin-top: 3px;
    }

    .container_jugadores{
        margin-top: 5px;
    }
    
    .jugadores-list {
        gap: 0.2em; /* Espacio vertical entre cada jugador */
        list-style-type: none;
        gap: 0.3vh; /* Espacio vertical entre cada jugador */
        font-size: 1.5vw;
        margin-top: 5px;
    }

    .jugadores-list li {
        padding: 0.2vh 0.2vw; /* Espaciado interno en cada elemento */
    }

    .info-div {
        border-radius: 5px;
    }

    .info-div h5 {
        padding: 5px; /* Eliminar padding por defecto, si existe */
        font-size: 2.5vw;
        text-align: center;
    }

    .info-div p {
        margin: 0; /* Eliminar margen por defecto */
        padding: 10px; /* Eliminar padding por defecto, si existe */
        font-size: 3.5vw;
    }

    .tabla_datos{
        margin-top: -20px;
    }

    .tabla_datos table{
        margin-top: 30px;
    }

    .estadisticas_acumuladas{
        margin-right: 5px;
        margin-top: 5vw !important;
    }

    .estadisticas_acumuladas {
        font-size: 1vw; /* Ajustar tamaño de fuente */
        border-collapse: collapse;
        display: block; /* Convierte la tabla en un bloque para desplazamiento */
        border-radius: 5px;
    }

    .estadisticas_acumuladas th{
        padding-left: 5px;
        width: 11.5%;
        font-size: 1.5vw;
    }

    .estadisticas_acumuladas td {
        text-align: left;
        padding-left: 5px;
        font-size: 1.5vw;
    }

    .grafica {
        margin-left: -5%;
        width: 100%;
        width: calc((100vw / 3)); /* Ajuste basado en el tamaño de la pantalla */
        height: calc((100vw / 3)); /* Mantener proporción */
        margin-bottom: 3vw; /* Ajustar margen inferior */
    }

    .titulos-jugadores{
        font-size: 3vw !important;
        margin-bottom: 10px;
    }

    .titulos-tablas-top{
        font-size: 2vw !important;
        margin-bottom: -10px !important;
        margin-top: 0px !important;
    }

    .tabla th{
        font-size: 1.5vw;
    }

    .tabla td{
        font-size: 1.6vw;
    }

    .tablaDos th{
        font-size: 1.6vw;
    }

    .tablaDos td{
        font-size: 1.6vw;
    }

    .tablasTop {
        margin-top: 10px;
        margin-bottom: 0px;
    }

    .tabla{
        width: 100%;
        margin-bottom: 10px;
    }

    .tablacontenido{
        border-radius: 10px;
        margin-top: 5px;
        min-height: 130px;
    }

    .tablaDos h4 {
        padding-left: 1.5px;
    }
    
    .team-info-columns {
        grid-template-columns: 1fr 2fr 1fr !important;
        gap: 2vw;
    }

    .team-info-columns .team-info {
        font-size: 2vw;
        gap: 5px;
    }

    .team-info-columns .team-photo {
        width: 90%;
    }
}

/* Estilo específico para iPad y tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .jugadores-list {
        gap: 0.5em; /* Espacio vertical entre cada jugador */
        list-style-type: none;
    }

    .jugadores-list li {
        padding: 0.2vh 0.2vw; /* Espaciado interno en cada elemento */
    }

    .info-div {
        border-radius: 5px;
    }

    .info-div h5 {
        padding: 5px; /* Eliminar padding por defecto, si existe */
        font-size: 2vw;
        text-align: center;
    }

    .info-div p {
        padding: 5px; /* Eliminar padding por defecto, si existe */
        font-size: 3vw;
    }
}

/* Cuando no hay espacio (p.ej. nombre muy largo), baja las cards debajo */
@media (min-width: 769px) and (max-width: 1100px) {
    .team-hero__inner {
        grid-template-columns: 1fr;
    }

    .team-hero__stats {
        width: 100%;
        max-width: none;
        grid-template-columns: repeat(4, minmax(110px, 1fr));
    }
}