/* CSS GRID 4 COLONNE */
.k2-main-grid-section {
    padding: 30px 20px;
    background: #141414;
}

.k2-container-grid-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    max-width: 1400px;
    /* Layout largo */
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .k2-container-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2x2 su tablet */
    }
}

@media (max-width: 768px) {
    .k2-container-grid-4 {
        grid-template-columns: 1fr !important;
        /* 1 col su mobile */
    }
}

/* BOX STILI GENERICI */
.k2-col-stats,
.k2-col-standings {
    background: transparent;
}

.col-header {
    text-align: center;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-transform: uppercase;
    border-bottom: 3px solid #333;
    padding-bottom: 10px;
}

.col-header.west {
    border-color: #e74c3c;
}

/* Rosso per West */
.col-header.east {
    border-color: #3498db;
}

/* Blu per East */

/* STATS BOX (Mini tabelle) */
.stats-box {
    background: #1e272e;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.stats-box-title {
    display: block;
    background: #333;
    color: #fff;
    padding: 10px 15px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    transition: background 0.3s;
}

.stats-box-title:hover {
    background: #444;
}

.stats-box-title.team-title {
    background: #2c3e50;
}

.view-all {
    font-size: 18px;
    line-height: 1;
}

.stats-list {
    padding: 0;
}

.stat-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 13px;
    color: #ccc;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row.is-first {
    background: #252525;
    font-weight: bold;
    color: #fff;
    padding: 12px;
}

.s-rank {
    width: 25px;
    text-align: center;
    color: #666;
    font-weight: bold;
}

.is-first .s-rank {
    color: #f1c40f;
    font-size: 16px;
}

.s-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.s-name {
    color: #ecf0f1;
}

.s-team {
    font-size: 10px;
    color: #7f8c8d;
    text-transform: uppercase;
}

.team-info-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.mini-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.s-val {
    font-weight: 700;
    color: #fff;
    width: 40px;
    text-align: right;
}

.is-first .s-val {
    color: #f1c40f;
    font-size: 16px;
}

/* FIX STANDINGS DISPLAY */
/* Adattiamo le classifiche per stare in colonne strette */
/* FIX STANDINGS DISPLAY */
/* Adattiamo le classifiche per stare in colonne strette */
.k2-standings-table {
    width: 100%;
    table-layout: fixed;
    /* Importante per colonne strette */
}

.k2-standings-table th,
.k2-standings-table td {
    padding: 8px 4px !important;
    font-size: 13px !important;
    vertical-align: middle !important;
    /* Forza allineamento centrale verticale */
}

.k2-standings-table img {
    max-width: 30px !important;
    max-height: 30px !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

.team-logo-small {
    width: 30px !important;
    height: 30px !important;
}

.team-name-full {
    display: none;
}

/* Nascondi nome completo se c'è */
.team-abbr {
    display: inline-block;
    font-weight: bold;
}

/* Mostra solo abbreviazione */

/* Fix layout verticale */
.k2-col-stats {
    width: 100%;
}

/* LARGHEZZE COLONNE CLASSIFICA */
/* 1. Rank (#) */
.k2-standings-table th:nth-child(1),
.k2-standings-table td:nth-child(1) {
    width: 35px;
    text-align: center;
}

/* 2. Team (Logo+Nome) - Più larga */
.k2-standings-table th:nth-child(2),
.k2-standings-table td:nth-child(2) {
    width: auto;
    /* Prende tutto lo spazio rimanente */
}

/* 3. V - P - % - ULT 10 - STRISCIA (Strette) */
.k2-standings-table th:nth-child(n+3),
.k2-standings-table td:nth-child(n+3) {
    width: 40px;
    text-align: center;
}

/* FIX ALLINEAMENTO SQUADRA STANDINGS */
td.team-col-content,
.k2-team-cell {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    justify-content: flex-start !important;
}

.k2-team-logo {
    margin: 0 !important;
    /* Rimuove i margini automatici che centravano il logo */
    flex-shrink: 0;
}

/* Assicuriamo che la sezione mercato sia visibile e ben spaziata */
.k2-market-section {

    clear: both;
    width: 100%;
    margin-top: 40px;
    display: block;
    overflow: visible;
}

/* MARKET GRID LAYOUT */
.k2-trades-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
}

.k2-trades-grid .k2-trade-block {
    flex: 1;
    min-width: 300px;
    /* Prevent too narrow on small screens */
    margin-bottom: 0;
    width: 100%;
}

@media (max-width: 768px) {
    .k2-trades-grid {
        flex-direction: column;
    }

    .k2-trades-grid .k2-trade-block {
        width: 100%;
    }
}

/* TRADE LAYOUT STYLES */
.k2-trade-block {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.trade-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.trade-badge {
    background: #e74c3c;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.trade-date {
    color: #888;
    font-size: 13px;
}

/* CONTAINER PRINCIPALE SQUADRE - Flexbox con wrap per 2 o 3 squadre */
.trade-split-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
}

/* COLONNA SQUADRA - Si adatta automaticamente */
.trade-team-col {
    flex: 1;
    min-width: 200px;
    /* Evita compressione eccessiva */
    background: #252525;
    border-radius: 6px;
    padding: 12px;
    box-sizing: border-box;
}

/* Header con logo squadra */
.tt-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333;
}

.tt-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.tt-label {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

/* Lista assets */
.tt-assets-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Singolo asset (giocatore o pick) */
.asset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1e1e1e;
    padding: 8px;
    border-radius: 4px;
}

.asset-visual {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.asset-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.asset-ovr {
    position: absolute;
    bottom: -4px;
    right: -4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    border: 2px solid #1e1e1e;
}

.asset-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.asset-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.asset-type {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
}

/* Pick visual */
.pick-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 4px;
}

.pick-visual span {
    font-size: 24px;
}

/* Responsive: su mobile metti le squadre in colonna */
@media (max-width: 768px) {
    .trade-split-container {
        flex-direction: column;
    }

    .trade-team-col {
        min-width: 100%;
    }
}

/* ===================================
   ULTIMA PARTITA BOX
   =================================== */

.k2-last-game-section {
    padding: 30px 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.k2-last-game-container {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lg-title {
    text-align: center;
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Header con loghi e risultato */
.lg-header {
    display: none;
    /* Hidden, using new compact layout */
}

/* === ULTIMA PARTITA BOX === */
.last-game-box {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.last-game-box h2 {
    color: #ffd700;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    letter-spacing: 1.5px;
    text-align: center;
}

.lg-match-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
    text-align: center;
}

.lg-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.lg-team {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.lg-team-logo {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: contain;
}

.lg-team-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.lg-score {
    font-size: 20px;
    font-weight: 900;
    color: #ffd700;
    min-width: 35px;
    text-align: center;
}

.lg-score-sep {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

.lg-vs {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
}

.lg-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lg-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.lg-team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.lg-team-logo:hover {
    transform: scale(1.1);
}

.lg-team-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lg-score {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

.lg-score-num {
    font-size: 52px;
    font-weight: 900;
    color: #888;
    transition: all 0.3s ease;
}

.lg-score-num.winner {
    color: #f1c40f;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
}

.lg-score-sep {
    font-size: 32px;
    color: #555;
    font-weight: 300;
}

.lg-score {
    font-size: 20px;
    font-weight: 900;
    color: #ffd700;
    min-width: 35px;
    text-align: center;
}

.lg-vs {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
}

.lg-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lg-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.lg-stat-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lg-stat-label {
    color: #ffd700;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.lg-player-photo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin: 0 auto 4px;
    display: block;
    border: 1.5px solid #ffd700;
}

.lg-player-name-link {
    text-decoration: none;
    transition: all 0.2s;
}

.lg-player-name-link:hover .lg-player-name {
    color: #5dade2;
}

.lg-player-name {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.lg-stat-value {
    font-size: 13px;
    font-weight: 900;
    color: #ffd700;
}

.lg-mvp-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.lg-mvp-badge {
    color: #ffd700;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-align: center;
}

.lg-mvp-photo {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin: 0 auto 6px;
    display: block;
    border: 2px solid #ffd700;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
}

.lg-mvp-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
}

.lg-mvp-stats {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 6px;
}

.lg-mvp-stat {
    text-align: center;
}

.lg-mvp-stat-label {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.lg-mvp-stat-value {
    font-size: 12px;
    font-weight: 900;
    color: #fff;
}

.lg-mvp-score {
    text-align: center;
    padding: 5px;
    background: #ffd700;
    border-radius: 12px;
    color: #2c3e50;
}

.lg-mvp-score-label {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 1px;
}

.lg-mvp-score-value {
    font-size: 14px;
    font-weight: 900;
}

/* Media queries for Last Game box */
@media (max-width: 768px) {
    .lg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lg-team {
        font-size: 11px;
    }

    .lg-team-logo {
        width: 24px;
        height: 24px;
    }

    .lg-score {
        font-size: 18px;
    }
}

/* Link alla partita */
.lg-view-full {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #3498db;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.lg-view-full:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #5dade2;
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 1024px) {
    .lg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lg-mvp-card {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .k2-last-game-container {
        padding: 20px;
    }

    .lg-title {
        font-size: 22px;
    }

    .lg-header {
        flex-direction: column;
        gap: 20px;
    }

    .lg-team {
        width: 100%;
    }

    .lg-team-logo {
        width: 60px;
        height: 60px;
    }

    .lg-score-num {
        font-size: 36px;
    }

    .lg-stats-grid {
        grid-template-columns: 1fr;
    }

    .lg-mvp-card {
        grid-column: span 1;
    }
}

/* Nascondi "Ultimo aggiornamento" dalle classifiche homepage */
.k2-last-upd {
    display: none !important;
}