/* Container foto giocatore con logo in filigrana */
.st-player-photo-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Foto del giocatore */
.st-player-photo {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}

/* Logo del team in filigrana (in alto a destra, dietro la foto) */
.st-team-logo-watermark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 80px;
    height: 80px;
    opacity: 0.3;
    z-index: 0;
    object-fit: contain;
    filter: brightness(1.5);
}

/* Badge posizione (in basso a destra) */
.st-position-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

/* Popup Giocatore */
.st-player-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.st-popup-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    color: #fff;
}

.st-close-popup {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.st-close-popup:hover,
.st-close-popup:focus {
    color: var(--primary-color);
}

/* Container principale Best Team */
.st-best-team-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Titolo del team */
.st-best-team-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Container dei record */
.st-best-records {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Singola riga giocatore */
.st-best-grid-row {
    display: grid;
    grid-template-columns: 60px 60px 1fr 80px;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    z-index: 1;
    pointer-events: auto; /* Forza la cattura degli eventi */
    cursor: pointer;      /* Fa capire all'utente che è cliccabile */
}

/* Evita che elementi interni blocchino l'hover della riga */
.st-best-grid-row > * {
    pointer-events: none; 
}

.st-best-grid-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary-color);
}

/* Colonna ruolo */
.st-best-col-role {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-color);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Colonna logo team */
.st-best-col-logo {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.st-best-col-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Colonna giocatore */
.st-best-col-player {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.st-best-link-player {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
    pointer-events: none;
}

.st-best-link-player:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Colonna punti */
.st-best-col-points {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: right;
    font-family: 'Montserrat Alternates', sans-serif;
}

/* Contenitore principale per la lista dei Team */
.st-best-teams-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Riga della griglia dei Team */
.st-best-teams-grid-row {
    display: grid;
    /* Struttura: Logo (60px), Nome Team (Espandibile), Conteggio (80px) */
    grid-template-columns: 60px 1fr 80px;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.st-best-teams-grid-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Colonna Logo */
.st-best-teams-col-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Colonna Nome Team */
.st-best-teams-col-team {
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Colonna Conteggio Giocatori (Punti/Count) */
.st-best-teams-col-points {
    font-size: 1.4rem;
    color: var(--primary-color);
    text-align: right;
    font-weight: 700;
}

/* Coach nella griglia best team */
.st-best-teams-coach {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* ============================================
   COACHES EFFICIENCY - Tabella efficienza coach
   ============================================ */

/* Container principale */
.st-coaches-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header della tabella */
.st-coaches-header {
    display: grid;
    grid-template-columns: 60px 1fr 60px 140px 80px 60px 140px 80px;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(var(--primary-color), 0.15), rgba(var(--primary-color), 0.05));
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    align-items: center;
}

/* Layout modificato quando hideWeekData = 1 (senza colonne week) */
.st-coaches-header.hide-week-columns {
    grid-template-columns: 60px 1fr 60px 140px 80px;
}

.st-coaches-grid-row.hide-week-columns {
    grid-template-columns: 60px 1fr 60px 140px 80px;
}

/* Celle header - Allineamento identico alle colonne dati */
.st-coaches-head-logo {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st-coaches-head-coachteam {
    text-align: left;
    display: flex;
    align-items: center;
    min-width: 150px;
    /* Larghezza minima per evitare compressione eccessiva */
}

.st-coaches-head-rank,
.st-coaches-head-prank {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
}

.st-coaches-head-rank::before,
.st-coaches-head-prank::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -12px;
    bottom: -12px;
    width: 2px;
    background: rgba(var(--primary-color), 0.4);
}

.st-coaches-head-rank::after,
.st-coaches-head-prank::after {
    content: '⇅';
    margin-left: 5px;
    opacity: 0.5;
    font-size: 0.9em;
}

.st-coaches-head-rank.sorted-asc::after,
.st-coaches-head-prank.sorted-asc::after {
    content: '▲';
    opacity: 1;
    color: #4ade80;
}

.st-coaches-head-rank.sorted-desc::after,
.st-coaches-head-prank.sorted-desc::after {
    content: '▼';
    opacity: 1;
    color: #4ade80;
}

.st-coaches-head-rank:hover,
.st-coaches-head-prank:hover {
    color: #fff;
    transform: scale(1.05);
}

.st-coaches-head-gr-points {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st-coaches-head-bof {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st-coaches-head-gr-ppoints {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st-coaches-head-pbof {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Righe della griglia */
.st-coaches-grid-row {
    display: grid;
    grid-template-columns: 60px 1fr 60px 140px 80px 60px 140px 80px;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
    transition: all 0.3s ease;
}

.st-coaches-grid-row:hover {
    background: rgba(var(--primary-color), 0.08);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.st-coaches-grid-row:last-child {
    border-radius: 0 0 8px 8px;
}

/* Colonna Logo */
.st-coaches-col-logo {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.st-coaches-col-logo img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid rgba(var(--primary-color), 0.3);
    padding: 3px;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.st-coaches-grid-row:hover .st-coaches-col-logo img {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Colonna Coach/Team */
.st-coaches-col-coachteam {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    min-width: 150px;
    /* Larghezza minima per evitare compressione eccessiva */
}

.st-coaches-col-coach {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 0.3px;
}

.st-coaches-col-team {
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* Colonna Rank */
.st-coaches-col-rank {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(var(--primary-color), 0.1);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.st-coaches-col-rank::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -14px;
    bottom: -14px;
    width: 2px;
    background: rgba(var(--primary-color), 0.4);
}

/* Colonne Punti (Week e Progressivi) */
.st-coaches-col-gr-points,
.st-coaches-col-gr-ppoints {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    justify-content: center;
    align-items: center;
}

.st-coaches-col-eff,
.st-coaches-col-peff {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.st-coaches-col-points,
.st-coaches-col-ppoints {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Colonne Best On Field */
.st-coaches-col-bof,
.st-coaches-col-pbof {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #fbbf24;
    /* Giallo/oro per best on field */
    background: rgba(251, 191, 36, 0.1);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Colonna Rank Progressivo */
.st-coaches-col-prank {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #60a5fa;
    /* Blu per progressivo */
    background: rgba(96, 165, 250, 0.1);
    padding: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.st-coaches-col-prank::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -14px;
    bottom: -14px;
    width: 2px;
    background: rgba(var(--primary-color), 0.4);
}

/* Cerchio non attivo */
.stat-nop-circle {
    background-color: #333;
    /* Colore scuro o un altro a scelta */
}

.stat-pl-circle {
    background-color: var(--primary-color);
    cursor: pointer;
}

.stat-pl-circle:hover {
    background-color: #fff;
    color: var(--primary-color);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
}

/* giocatori d'attacco */
.rc-circle {
    cursor: default;
    transform: translate(0px, 70px);
}

.rol1-circle {
    cursor: default;
    transform: translate(-50px, 70px);
}

.rol2-circle {
    cursor: default;
    transform: translate(50px, 70px);
}

.rol3-circle {
    cursor: default;
    transform: translate(100px, 70px);
}

.rqb-circle,
.rqb-circle:hover {
    transform: translate(0px, 110px);
}

.rrb-circle,
.rrb-circle:hover {
    transform: translate(0px, 180px);
}

.rrw-circle,
.rrw-circle:hover {
    transform: translate(-100px, 140px);
}

.rk-circle,
.rk-circle:hover {
    transform: translate(340px, 180px);
}

.rte-circle,
.rte-circle:hover {
    transform: translate(-100px, 70px);
}

.rwt-circle,
.rwt-circle:hover {
    transform: translate(150px, 70px);
}

.rwr1-circle,
.rwr1-circle:hover {
    transform: translate(-297px, 70px);
}

.rwr2-circle,
.rwr2-circle:hover {
    transform: translate(260px, 70px);
}

/* giocatori di difesa */

.rnt-circle {
    cursor: default;
    transform: translate(0px, 20px);
}

.rdl1-circle,
.rdl1-circle:hover {
    transform: translate(-60px, 20px);
}

.rdl2-circle,
.rdl2-circle:hover {
    transform: translate(60px, 20px);
}

.rlb1-circle,
.rlb1-circle:hover {
    transform: translate(-150px, -20px);
}

.rlb2-circle,
.rlb2-circle:hover {
    transform: translate(150px, -20px);
}

.rlb3-circle,
.rlb3-circle:hover {
    transform: translate(-80px, -60px);
}

.ridp-circle,
.ridp-circle:hover {
    transform: translate(80px, -60px);
}

.rcb1-circle {
    cursor: default;
    transform: translate(-250px, -80px);
}

.rcb2-circle {
    cursor: default;
    transform: translate(213px, -80px);
}

.rdb1-circle,
.rdb1-circle:hover {
    transform: translate(-10px, -180px);
}

.rdb2-circle,
.rdb2-circle:hover {
    transform: translate(40px, -130px);
}

/* Contenitore per allineare icone e testo */
.end-zone-content {
    color: rgba(36, 95, 40, 0.7);
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.1);
    letter-spacing: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    /* Spazio tra icone e testo */
    width: 100%;
    height: 100%;
    font-size: 2.2rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 15px;
}

/* Contenitore principale dei navigatori in stats.php */
.stats-nav {
    display: flex;
    /*justify-content: flex-start;*/
    /* Allineamento a sinistra per permettere lo scroll corretto */
    gap: 10px;
    padding: 10px 5px;
    margin-bottom: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;

    justify-content: safe center;
    align-content: center;
}

.stats-nav.stats-second-level {
    background: transparent;
    /* Rimosso lo sfondo chiaro */
    border-radius: 0;
    /* Rimosso l'arrotondamento */
    padding: 10px 5px;
    /* Allineato al padding del primo livello */
    margin-top: -10px;
    /* Opzionale: riduce lo spazio tra i due navigatori */
}

/* Stile specifico per i bottoni dei navigatori stats */
.stats-tab-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Montserrat Alternates', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.stats-tab-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.stats-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

/* Nasconde la scrollbar per un look più pulito */
.stats-nav::-webkit-scrollbar {
    height: 4px;
}

.stats-nav::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* DISEGNO DEL CAMPO PER STATISTICHE */

.field-top-down {
    width: 100%;
    max-width: 1024px;
    margin: 20px auto;
    background-color: rgba(36, 95, 40, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
}

/* End Zone in alto */
.end-zone.top {
    height: 100px;
    /*
    background: repeating-linear-gradient(
        45deg,
        #1a472a,
        #1a472a 10px,
        #245032 10px,
        #245032 20px
    );
    */
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid #fff;
    /* Linea di fondo campo */
    background-color: var(--primary-color);
    /* Colore primario del sito */
}

.end-zone.top span {
    color: rgba(255, 255, 255, 0.15);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 15px;
}

/* Goal Line */
.goal-line {
    height: 5px;
    background-color: #fff;
    width: 100%;
}

/* Sezioni delle Yard */
.field-section {
    height: 140px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    /* Linea delle yard */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 10px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Arial Black', sans-serif;
    position: relative;
}

.yard-num {
    position: absolute;
    right: 25px;
    /* Distanza dal bordo destro */
    top: 142px;

    color: rgba(255, 255, 255, 0.4);
    font-family: 'Stardos Stencil', cursive;
    font-size: 3rem;
    line-height: 1;

    /* 1. Ruota di 90 gradi 
       2. translateY(50%) sposta il numero verso il basso di metà della sua altezza
       portandolo esattamente a cavallo della linea
    */
    transform: rotate(90deg);
    transform-origin: center right;

    pointer-events: none;
    white-space: nowrap;
    filter: blur(0.4px) contrast(1.2);
}

/* Stile per la freccina direzionale piccola */
.direction-arrow {
    font-size: 1.2rem;
    /* Molto più piccola rispetto al numero */
    vertical-align: middle;
    /* La centra verticalmente rispetto al testo */
    display: inline-block;
    margin-right: 5px;
    /* Spazio tra freccia e numero */
    opacity: 0.8;
    /* Leggermente più sfumata */
    transform: rotate(-90deg);
}

/* Evidenziazione linea delle 20 yard */
/* Essendo orientato dall'alto, la linea delle 20 è il bordo INFERIORE del blocco yards-20 */
.field-section.yards-10.active-line {
    border-bottom: 4px solid rgba(212, 210, 51, 0.8);
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.field-section.yards-20 {
    border-bottom: 4px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.scrimmage-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    /* Spessore della linea */
    background-color: rgba(46, 94, 156, 0.8);
    /* Blu classico da grafica TV */
    /*box-shadow: 0 0 8px;*/
    z-index: 1;
    /* Sotto i cerchi dei giocatori (z-index 2), sopra l'erba */

    /* Dato che la sezione yards-20 finisce sulla linea delle 20:
       20yd - 2yd = 18yd. 
       Quindi 20px (2 yarde) dal fondo (bottom).
    */
    bottom: 24px;
    pointer-events: none;
}

/* Hash marks (trattini laterali) */
.field-section::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 25%;
    right: 25%;
    border-left: 2px dashed rgba(255, 255, 255, 0.2);
    border-right: 2px dashed rgba(255, 255, 255, 0.2);
}

/* Contenitore per i dati sopra ogni sezione del campo */
.best16-data-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;

    /* Stile del testo di default per i dati */
    color: #ffffff;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Stile base per i cerchi */
.player-circle {
    pointer-events: auto;
    /* ...ma riabilita i click sui cerchi stessi */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Montserrat Alternates', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    margin-bottom: 5px;
    /* Spazio tra i due cerchi */
    border: 2px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, scale 0.2s;  /* ← Aggiungi transizione per scale */
    position: absolute;
    left: 50%;
    z-index: 10;  /* ← Aggiungi z-index per assicurare che sia sopra */
}

.field-section,
.best16-data-overlay {
    pointer-events: none;
}

/* Stile per l'icona del pallone */
.fz-icon {
    width: 30px;
    /* Regola la grandezza in base ai tuoi gusti */
    height: auto;
    opacity: 0.8;
    /* Le rende leggermente meno "aggressive" rispetto al testo */
    filter: drop-shadow(0px 1px 1px rgba(255, 255, 255, 0.2));
}

/* Wrapper per le due tabelle Best16 - Affiancate su desktop */
.st-best-tables-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 30px auto;
}

.st-best-tables-wrapper .st-best-team-container {
    margin: 0;
    /* Rimuovo il margin auto quando è dentro il wrapper */
}

/* Stili per colonne ordinabili */
[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s ease;
}

[data-sort]:hover {
    color: #fff;
    background: rgba(207, 174, 112, 0.25);
    border-radius: 6px;
}

/* Indicatore di ordinamento */
[data-sort].sortable::after {
    content: '⇅';
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.9em;
}

[data-sort].sorted-asc::after {
    content: '▲';
    margin-left: 4px;
    color: var(--primary-color);
    opacity: 1;
}

[data-sort].sorted-desc::after {
    content: '▼';
    margin-left: 4px;
    color: var(--primary-color);
    opacity: 1;
}

#legendPopupTitle {
    color: var(--primary-color);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(207, 174, 112, 0.5);
    font-family: "Montserrat Alternates", sans-serif;
}

#popupPlayerName {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 24px;
    text-align: center;
}

#popupPlayerStats {
    font-size: 16px;
    line-height: 1.6;
}

#popupPlayerStats p {
    margin: 10px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

#popupPlayerStats strong {
    color: var(--primary-color);
}


/* ============================================
   STILI MOBILE PER TABELLE BEST16
   Da aggiungere al file style-stats-best16.css
   ============================================ */

/* Media query per smartphone (max-width: 768px) */
@media screen and (max-width: 768px) {
    
    /* Wrapper tabelle: da griglia a colonna verticale */
    .st-best-tables-wrapper {
        grid-template-columns: 1fr;
        /* Una sola colonna invece di 1fr 1fr */
        gap: 20px;
        /* Riduco leggermente il gap per ottimizzare lo spazio verticale */
    }
    
    /* Container delle tabelle: ottimizzazione mobile */
    .st-best-team-container {
        padding: 15px;
        /* Riduco il padding per guadagnare spazio */
        margin: 0;
        /* Rimuovo i margini laterali */
    }
    
    /* Titolo della tabella: dimensione ridotta per mobile */
    .st-best-team-title {
        font-size: 20px;
        /* Ridotto da 28px */
        margin-bottom: 15px;
        letter-spacing: 1px;
    }
    
    /* Griglia giocatori: layout ottimizzato per schermi stretti */
    .st-best-grid-row {
        grid-template-columns: 50px 50px 1fr 70px;
        /* Riduco le colonne fisse per guadagnare spazio */
        gap: 10px;
        /* Gap ridotto */
        padding: 10px;
    }
    
    /* Logo squadra ridotto */
    .st-best-col-logo img {
        width: 35px;
        height: 35px;
    }
    
    /* Ruolo con font più piccolo */
    .st-best-col-role {
        font-size: 12px;
    }
    
    /* Nome giocatore */
    .st-best-link-player {
        font-size: 14px;
    }
    
    /* Punti */
    .st-best-col-points {
        font-size: 16px;
    }
    
    /* Griglia squadre: layout ottimizzato */
    .st-best-teams-grid-row {
        grid-template-columns: 50px 1fr 70px;
        /* Riduco le colonne */
        padding: 10px;
    }
    
    /* Logo squadra nella tabella teams */
    .st-best-teams-col-logo img {
        width: 35px;
        height: 35px;
    }
    
    /* Nome team */
    .st-best-teams-col-team {
        font-size: 1rem;
    }
    
    /* Coach */
    .st-best-teams-coach {
        font-size: 0.8rem;
    }
    
    /* Conteggio giocatori */
    .st-best-teams-col-points {
        font-size: 1.2rem;
    }
}

/* Media query per smartphone molto piccoli (max-width: 480px) */
@media screen and (max-width: 480px) {
    
    /* Ulteriore riduzione per schermi molto piccoli */
    .st-best-team-container {
        padding: 12px;
    }
    
    .st-best-team-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* Griglia giocatori ancora più compatta */
    .st-best-grid-row {
        grid-template-columns: 45px 45px 1fr 65px;
        gap: 8px;
        padding: 8px;
    }
    
    .st-best-col-logo img {
        width: 32px;
        height: 32px;
    }
    
    .st-best-col-role {
        font-size: 11px;
    }
    
    .st-best-link-player {
        font-size: 13px;
    }
    
    .st-best-col-points {
        font-size: 15px;
    }
    
    /* Griglia squadre compatta */
    .st-best-teams-grid-row {
        grid-template-columns: 45px 1fr 65px;
        padding: 8px;
    }
    
    .st-best-teams-col-logo img {
        width: 32px;
        height: 32px;
    }
    
    .st-best-teams-col-team {
        font-size: 0.9rem;
    }
    
    .st-best-teams-coach {
        font-size: 0.75rem;
    }
    
    .st-best-teams-col-points {
        font-size: 1.1rem;
    }
}