/* assets/css/home.css */

/* =========================================
   1. FONTS & GLOBALS
   ========================================= */
@font-face {
    font-family: 'DrukWide';
    src: url('../../doc/DrukWideBold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'HelveticaBold';
    src: url('../../doc/HelveticaBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}


body {
    font-family: 'HelveticaBold', Arial, sans-serif !important;
    font-weight: bold !important;
    color: white;
    margin: 0;
    padding: 0;
    
    /* Togliamo l'immagine da qui per evitare lo stretch su iOS */
    background: transparent !important; 
    
    position: relative;
    min-height: 100vh;
    z-index: 0;
}

body::before {
    content: "";
    position: fixed; /* Ancorato alla finestra del browser */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Immagine di Sfondo */
    background-image: url('../../imm/sfondouml25.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    
    /* Manda lo sfondo dietro al contenuto */
    z-index: -1; 
    
    /* Ottimizzazione per evitare scatti su mobile */
    transform: translateZ(0);
    will-change: transform;
}

/* --- FIX FOOTER STICKY --- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}




.home-container, 
main.home-container {
    flex: 1;
    width: 100%; /* O la larghezza che preferisci */
    display: flex;
    flex-direction: column;
}

footer {
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* =========================================
   2. LARGHEZZA PAGINA (Più spazio)
   ========================================= */
.home-container, 
main.container {
    /* Aumentiamo la larghezza massima per riempire meglio gli schermi moderni */
    max-width: 1600px !important; 
    width: 95% !important;
    margin: 0 auto;
    padding: 20px 0;
}

/* Assicuriamo che la sidebar e il contenuto principale si adattino */
.content-container {
    display: flex;
    gap: 30px; /* Spazio tra sidebar e contenuto */
    justify-content: space-between;
    align-items: flex-start;
}

/* Colonna Principale (Highlights, Partite, ecc) */
.main-content {
    flex: 1; /* Prende tutto lo spazio disponibile */
    min-width: 0; /* Evita problemi di overflow */
}

/* Colonna Laterale (Classifiche, Storia) */
.sidebar {
    width: 350px; /* Larghezza fissa o percentuale */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Responsive per tablet/mobile */
@media (max-width: 1024px) {
    .content-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        order: 2; /* Su mobile va sotto */
    }
}/* assets/css/home.css */

body {
    font-family: "ParagrafoFont", Arial, sans-serif;
    padding-bottom: 30px;
    color: var(--testo-bianco);
    
    /* --- GESTIONE SFONDO FISSO --- */
    background-image: url('../../imm/sfondouml25.jpg') !important;
    background-size: cover !important;       /* Adatta l'immagine per coprire tutto */
    background-position: center center !important; /* Centra l'immagine */
    background-attachment: fixed !important; /* FONDAMENTALE: Blocca lo sfondo */
    background-repeat: no-repeat !important; /* Evita che l'immagine si ripeta a mosaico */
    
    text-align: center !important;
    text-transform: uppercase !important;
}
/* :root (da style.css - assicurati che siano in main.css) */
:root {
    --primary-color: #ff19ff;
    --secondary-color: #5e11f7;
    --text-color: #ffffff;
    --card-bg-color: rgba(0, 0, 0, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.home-container {
    width: 90%;
    max-width: 1400px;
    margin: 20px auto;
}

/* --- Sezione "Oggi in Campo" --- */
.oggi-in-campo-container {
    background-color: var(--card-bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}
.oggi-in-campo-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
}
.oggi-in-campo-matches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.oggi-in-campo-matches .partita-box {
    min-width: 280px;
    max-width: 400px;
    width: 100%;
    flex-grow: 1;
    box-shadow: none;
    border: 1px solid var(--border-color);
 
}
@media (max-width: 600px) {
    .oggi-in-campo-matches {
        flex-direction: column;
        align-items: center;
    }
}


/* --- Slider Ultime Partite (VERSIONE CORRETTA) --- */
.partite-banner-container {
    background-color: var(--card-bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    position: relative;
}

.partite-banner-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.partite-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 15px;
    scrollbar-width: none;
}

.partite-slider::-webkit-scrollbar {
    display: none;
}

/* FIX LARGHEZZA: usa !important per forzare la dimensione */
.partita-box {
    flex: 0 0 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    scroll-snap-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    max-height: 250px;
}

.partita-box:hover {
    transform: translateY(-5px);
}

/* FIX LINK BLU: rimuovi colore e sottolineatura */
.partita-box a,
.partita-box a:visited,
.partita-box a:hover,
.partita-box a:active {
    color: inherit !important;
    text-decoration: none !important;
}

.no-link-decoration {
    color: inherit !important;
    text-decoration: none !important;
}

.partita-header {
    width: 100%;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.partita-fase {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.partita-ora {
    font-size: 0.95em;
    color: var(--text-color);
    font-weight: bold;
    margin: 0;
}

.partita-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    width: 100%;
    padding: 10px 0;
}

.team-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.partita-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-size: 0.85em;
    display: block;
    width: 100%;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2em;
    min-height: 2.4em;
    max-height: 2.4em;
}

.team-short {
    display: none;
}

.partita-score {
    font-size: 1.6em;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.partita-footer {
    width: 100%;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.partita-data {
    font-size: 0.8em;
    color: #ccc;
    margin: 0;
}

@media (max-width: 768px) {
    .partita-box {
        flex: 0 0 240px !important;
        min-width: 240px !important;
        max-width: 240px !important;
        min-height: 230px;
        max-height: 230px;
    }
    
    .team-name {
        display: none;
    }
    
    .team-short {
        display: block;
        font-size: 0.9em;
        font-weight: bold;
    }
    
    .partita-logo {
        width: 40px;
        height: 40px;
    }
}


.slider-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}
.slider-control {
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
}
.no-data {
    color: #ccc;
    font-style: italic;
    padding: 20px;
}
@media (max-width: 768px) {
    .partita-box {
        flex: 0 0 220px;
    }
    .team-name {
        display: none; /* Nascondiamo il nome lungo */
        height: auto; /* Resettiamo l'altezza fissa */
    }
    .team-short {
        display: block; /* Mostriamo la sigla */
        font-size: 0.9em;
    }
    .slider-controls {
        display: none; /* Nascosto su mobile, si usa lo swipe */
    }
}

/* --- Banner Sponsor --- */
.sponsor-banner {
    background-color: transparent;
    margin: 20px 0;
    padding: 20px 0;
    overflow: hidden;
    position: relative;
}
.sponsor-scroll {
    display: flex;
    animation: scroll 35s linear infinite;
    width: calc(200% + 60px); /* 2x il numero di sponsor + gap */
}
.sponsor-item {
    flex: 0 0 auto;
    margin: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    width: 180px;
    background-color: #fff;
    border: 2px solid #ff19ff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.sponsor-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.sponsor-banner:hover .sponsor-scroll {
    animation-play-state: paused;
}
@media (max-width: 768px) {
    .sponsor-item {
        height: 70px;
        width: 140px;
        margin: 0 20px;
        padding: 8px;
    }
    .sponsor-banner { padding: 15px 0; }
}

/* --- Contenuto Principale (Sidebar + Storia) --- */
.content-container {
    display: flex;
    gap: 20px;
}
.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 300px;
}
.main-content {
    flex: 2.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
@media (max-width: 900px) {
    .content-container {
        flex-direction: column;
    }
    .sidebar {
        min-width: 100%;
        flex-direction: row;
        justify-content: space-around;
    }
    .box-classifica {
        flex: 1;
    }
}
@media (max-width: 600px) {
    .sidebar {
        flex-direction: column;
    }
}/* --- LAYOUT & COLONNE (Modifica questa parte esistente) --- */
.content-container {
    display: flex;
    gap: 30px; /* Più spazio tra sidebar e contenuto */
    align-items: flex-start;
}

/* Allarghiamo la sidebar per dare più respiro alle classifiche */
.sidebar {
    flex: 1.2; /* Aumentato da 1 a 1.2 (più largo) */
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 340px; /* Larghezza minima garantita su desktop */
}

.main-content {
    flex: 2; /* Ridotto proporzionalmente */
    display: flex;
    flex-direction: column;
    gap: 30px;
}


/* --- BOX CLASSIFICHE (Design Aggiornato e Corretto) --- */

/* 1. IL CONTENITORE: Nero semitrasparente */
.box-classifica {
    background: rgba(0, 0, 0, 0.6) !important; /* Sfondo scuro semitrasparente */
    border-radius: 12px;
    padding: 25px; /* Padding interno */
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.box-classifica h2 {
    color: var(--primary-color, #ff19ff);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-transform: uppercase;
}

.classifica-content {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spazio tra le righe */
}

/* 2. LA RIGA (LINK): Reset totale colori e sottolineature */
a.classifica-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05); /* Grigio molto scuro */
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;

    /* BLOCCO IMPORTANTE: RIMUOVE LO STILE DA LINK */
    text-decoration: none !important;
    color: #ffffff !important; 
    outline: none;
}

/* Gestione stati link (visited, active, hover) per evitare il blu */
a.classifica-item:visited,
a.classifica-item:active,
a.classifica-item:focus {
    text-decoration: none !important;
    color: #ffffff !important;
}

/* Animazione entrata */
a.classifica-item {
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Ritardi animazione */
a.classifica-item:nth-child(1) { animation-delay: 0.1s; }
a.classifica-item:nth-child(2) { animation-delay: 0.2s; }
a.classifica-item:nth-child(3) { animation-delay: 0.3s; }
a.classifica-item:nth-child(4) { animation-delay: 0.4s; }
a.classifica-item:nth-child(5) { animation-delay: 0.5s; }

/* Effetto Hover sulla riga */
a.classifica-item:hover {
    background: rgba(255, 255, 255, 0.15); /* Leggermente più chiaro */
    transform: translateX(5px); /* Spostamento a destra */
    border-color: var(--primary-color, #ff19ff); /* Bordo colorato */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none !important; /* Sicurezza extra */
    color: #ffffff !important;
}

/* Posizione (1, 2, 3...) */
.position {
    font-weight: 700;
    color: #aaa; 
    width: 20px;
    font-size: 0.9em;
    text-align: center;
}

/* --- FOTO & LOGHI --- */
.giocatore-foto-container {
    position: relative;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.giocatore-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}

.team-logo-overlay {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: #222; 
    border-radius: 50%;
    padding: 2px;
    border: 1px solid #555;
    z-index: 2;
}

/* --- TESTI INTERNI --- */
.giocatore-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; 
}

.giocatore-nome {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff !important; /* Forza il bianco */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
}

.giocatore-team {
    font-size: 0.75rem;
    color: #cccccc !important; /* Grigio chiaro */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-decoration: none !important;
}

/* --- STAT VALUE (Voto o Gol) --- */
.stat-value {
    font-family: 'DrukWide', 'Arial Black', sans-serif;
    font-size: 1.1rem;
    color: #ffffff;
    text-align: right;
    min-width: 40px;
}

/* --- STILE SPECIALE PER IL PRIMO IN CLASSIFICA (Rank 1) --- */
a.classifica-item.rank-1 {
    background: linear-gradient(90deg, rgba(255, 25, 255, 0.15), transparent);
    padding: 15px 12px;
    border: 1px solid rgba(255, 25, 255, 0.4);
    margin-bottom: 5px;
}

a.classifica-item.rank-1 .position {
    color: var(--primary-color, #ff19ff);
    font-size: 1.2em;
}

a.classifica-item.rank-1 .giocatore-foto {
    border: 2px solid var(--primary-color, #ff19ff);
    box-shadow: 0 0 8px rgba(255, 25, 255, 0.5);
}

a.classifica-item.rank-1 .stat-value {
    color: var(--primary-color, #ff19ff);
    font-size: 1.3rem;
}

/* --- PULSANTE "VISUALIZZA TUTTI" --- */
.view-more {
    display: block;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--primary-color, #ff19ff) !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 0.85em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.view-more:hover {
    background: var(--primary-color, #ff19ff);
    color: #fff !important;
    border-color: var(--primary-color, #ff19ff);
}

/* --- ANIMAZIONI --- */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .content-container {
        flex-direction: column; 
    }
    .sidebar {
        width: 100%;
        order: 2; 
    }
    .box-classifica {
        margin-bottom: 20px;
    }
}



/* --- Box Storia & Countdown (Main Content) --- */
.fantasy-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--box-shadow);
}
.fantasy-banner h2 {
    color: var(--text-color);
    font-size: 2em;
    margin: 0;
}
#countdown {
    color: white;
    font-size: 240%;
}

.storia-uml-box {
    flex: 1;
    min-height: 250px;
}
.storia-link {
    display: block;
    height: 100%;
}
.storia-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}
.storia-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.storia-uml-box:hover .storia-img {
    transform: scale(1.05);
}
.storia-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 40px 20px 20px;
    text-align: center;
    /* Stili per hover gestiti inline */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}
.storia-uml-box:hover .storia-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.storia-text {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-color);
}
@media (max-width: 768px) {
    .storia-overlay {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        padding: 20px 15px 15px;
    }
    .storia-text {
        font-size: 1.2em;
    }
}



/* --- NUOVI COMPONENTI MAIN CONTENT --- */
/* --- FIX DIMENSIONI & LAYOUT (Incolla in home.css) --- */

/* 1. GENERALI PER IL MAIN CONTENT */
.main-content {
    /* Assicura che nulla esca dalla colonna */
    width: 100%;
    overflow: hidden; 
}
.main-content img {
    /* Regola d'oro: le immagini non devono mai superare il genitore */
    max-width: 100%;
    height: auto;
}

/* 2. PODIO (CLASSIFICA FINALE) */
.podium-box {
    display: flex;
    align-items: flex-end; /* Allinea i piedi dei giocatori */
    justify-content: center;
    gap: 15px;
    padding: 30px 10px 10px 10px;
    height: 100px; /* Altezza fissa per evitare salti */
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    text-align: center;
    position: relative;
}

/* Dimensioni Loghi Fisse */
.podium-logo {
    object-fit: contain;
    margin-bottom: 1px;
}

/* Dimensioni specifiche per grado */
.rank-1 .podium-logo { width: 90px; height: 90px; } /* 1° Grande */
.rank-2 .podium-logo { width: 70px; height: 70px; } /* 2° Medio */
.rank-3 .podium-logo { width: 60px; height: 60px; } /* 3° Piccolo */

/* Ordine visivo: 2 - 1 - 3 */
.podium-item.rank-1 { order: 2; padding-bottom: 20px; } /* Il 1° sta più in alto visivamente */
.podium-item.rank-2 { order: 1; padding-bottom: 15px; } /* Il 1° sta più in alto visivamente */
.podium-item.rank-3 { order: 3; padding-bottom: 10px; } /* Il 1° sta più in alto visivamente */

.podium-rank {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    position: absolute;
    bottom: 25px; /* Sovrapposto al logo/testo */
    right: 50%;
    transform: translateX(50%); /* Centrato */
    border: 2px solid white;
    z-index: -10;
}



/* --- 2. TEAM OF THE WEEK (Link Cliccabili) --- */
.totw-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

/* Modifica: ora targettiamo 'a.totw-card' */
a.totw-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 5px;
    min-width: 0;
    transition: transform 0.2s, background 0.2s;
    
    /* RESET LINK STYLES */
    text-decoration: none !important; /* Via la sottolineatura */
    color: white !important; /* Forza il testo bianco */
    cursor: pointer;
}

a.totw-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    border-color: #ff19ff;
    /* Opzionale: ombra colorata al passaggio */
    box-shadow: 0 5px 15px rgba(255, 25, 255, 0.2);
}

.totw-role {
    font-size: 0.75em;
    background: #ff19ff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.totw-img {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.3);
    margin-bottom: 8px;
}

.totw-name {
    font-size: 0.85em;
    font-weight: bold;
    color: white; /* Ridondante col reset sopra, ma male non fa */
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .totw-img { width: 45px; height: 45px; border-radius: 10px; }
    .totw-role { font-size: 0.6em; padding: 2px 5px; }
    .totw-name { font-size: 0.7em; }
}






/* 4. VIDEO (YouTube Embed) */
.video-box {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio precisi */
    background: black;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.video-box iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 5. NEWS GRID (Immagini contenute) */
.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50% - 50% */
    gap: 15px;
}

.news-card {
    background: rgba(0,0,0,0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.news-img-container {
    width: 100%;
    height: 140px; /* Altezza fissa immagine */
    overflow: hidden;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Riempie il box senza deformare */
    transition: transform 0.5s;
}

.news-card:hover .news-img { transform: scale(1.1); }

.news-content { padding: 12px; }
.news-title { font-size: 0.9em; line-height: 1.3; color: white; font-weight: bold; }
.news-date { font-size: 0.7em; color: var(--primary-color); margin-bottom: 5px; }

/* 6. STORIA BANNER (Fisso) */
.history-banner-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 400px; /* Altezza fissa banner */
    border: 1px solid var(--primary-color);
}

.history-bg {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Taglia l'eccedenza */
    filter: brightness(0.4);
}

.history-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* RESPONSIVE PER MOBILE */
@media (max-width: 600px) {
    .totw-img { width: 40px; height: 40px; } /* Più piccoli su mobile */
    .totw-vote { font-size: 0.8em; }
    .news-grid { grid-template-columns: 1fr; } /* News una sotto l'altra */
}


/* =========================================
   FIX MOBILE & RESPONSIVE (Aggiungere in fondo a home.css)
   ========================================= */

@media (max-width: 900px) {
    
    /* 1. SIDEBAR: SPOSTIAMOLA IN ALTO E RIDUCIAMO LE DIMENSIONI */
    .content-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        /* Era order: 2, lo mettiamo a 0 per farlo tornare sopra (visto che nell'HTML è prima del main) */
        order: 0 !important; 
        margin-bottom: 20px;
        gap: 15px; /* Meno spazio tra i due box */
    }

    /* Riduciamo l'altezza delle righe nelle classifiche */
    .classifica-item {
        padding: 8px 10px; /* Molto meno padding */
        gap: 10px;
    }

    .giocatore-foto-container {
        width: 38px; /* Foto più piccole */
        height: 38px;
    }
    
    .giocatore-nome { font-size: 0.9rem; }
    .giocatore-team { font-size: 0.65rem; }
    .stat-value { font-size: 1rem; }
    
    /* Titoli più piccoli */
    .box-classifica h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    .box-classifica { padding: 15px; } /* Meno padding del contenitore */
}

@media (max-width: 768px) {

    /* 2. BOX ULTIME PARTITE (SLIDER) COMPATTO */
    .partite-banner-container {
        padding: 15px 0; /* Toglie padding laterale per sfruttare lo schermo */
    }

    .partita-box {
        /* Riduciamo drasticamente le dimensioni */
        flex: 0 0 220px !important; 
        min-width: 220px !important;
        max-width: 220px !important;
        min-height: auto !important; /* Toglie altezza fissa */
        padding: 12px 5px !important;
    }

    .partita-header { margin-bottom: 5px; }
    .partita-fase { font-size: 0.7em; }
    .partita-ora { font-size: 0.8em; }
    
    .partita-logo {
        width: 35px; /* Logo più piccolo */
        height: 35px;
    }
    
    .partita-score {
        font-size: 1.2em; /* Risultato più piccolo */
        min-width: 40px;
    }

    /* Nascondi nomi lunghi, mostra solo sigle (che devi assicurarti di avere nell'HTML con classe .team-short) */
    .team-name { display: none; } 
    .team-short { display: block; font-size: 0.9em; font-weight: bold; }
    
    
    /* 3. PODIO (Classifica Finale) SISTEMATO */
    .podium-box {
        height: auto; /* Altezza automatica */
        padding: 20px 0 0 0;
        align-items: flex-end; /* Allinea in basso */
        gap: 5px; /* Meno spazio tra i podi */
    }

    /* Riduciamo le dimensioni dei loghi sul podio */
    .rank-1 .podium-logo { width: 70px; height: 70px; }
    .rank-2 .podium-logo { width: 55px; height: 55px; }
    .rank-3 .podium-logo { width: 45px; height: 45px; }
    
    .podium-rank {
        width: 20px; height: 20px; font-size: 0.7em;
        bottom: 20px; /* Aggiustamento posizione pallino numero */
    }
    .rank-1 .podium-rank { bottom: 35px; }
    .rank-2 .podium-rank { bottom: 35px; }
    .podium-team-name {
        font-size: 0.65em; /* Testo molto più piccolo */
        line-height: 1.1;
    }
    
    /* 4. TEAM OF THE WEEK MOBILE */
    .totw-container { gap: 5px; }
    .totw-card { padding: 8px 2px; }
    .totw-img { width: 45px; height: 45px; border-radius: 10px; }
    .totw-role { font-size: 0.55em; padding: 2px 4px; margin-bottom: 5px; }
    .totw-name { font-size: 0.65em; }
    
    /* Titoli generali */
    h2 { font-size: 1.3em !important; }
}

/* --- OTTIMIZZAZIONE SLIDER MOBILE (Data in linea) --- */

/* 1. Default (Desktop): Nascondi la data accanto all'ora */
.mobile-date {
    display: none;
}

/* 2. Mobile: Logica inversa */
@media (max-width: 768px) {
    
    /* Mostra la data accanto all'ora */
    .mobile-date {
        display: inline;
        font-weight: normal;
        opacity: 0.8;
        font-size: 0.9em;
    }

    /* Nascondi il vecchio footer (che conteneva la data) */
    .partita-footer {
        display: none !important;
    }

    /* Riduci l'altezza del box partita recuperando spazio */
    .partita-box {
        padding: 10px 5px !important; /* Meno padding verticale */
        min-height: auto !important; /* Altezza automatica */
        height: auto !important;
        gap: 5px; /* Meno spazio tra gli elementi interni */
    }

    /* Riduci spazi header */
    .partita-header {
        margin-bottom: 5px;
    }
    
    /* Riduci spazi tra loghi e nomi */
    .partita-teams {
        padding: 5px 0;
        margin: 0;
    }
}

/* ============================================================
   MOBILE SLIM FIT (Ottimizzazione Spazi Stretti)
   Da incollare alla fine di home.css
   ============================================================ */

@media (max-width: 768px) {
    
    /* 1. CONTENITORE PRINCIPALE: Più largo */
    .home-container {
        width: 96% !important; /* Allarga la pagina al 96% dello schermo */
        margin-top: 10px !important;
        margin-bottom: 10px !important;
    }

    /* 2. BOX CONTENITORI (Slider, Oggi, Classifiche): Meno imbottitura */
    .partite-banner-container,
    .oggi-in-campo-container,
    .box-classifica,
    .totw-box,
    .standings-box,
    .fantasy-section {
        padding: 12px 10px !important; /* Ridotto da 20/25px a 10px */
        margin-bottom: 15px !important; /* Ridotto spazio tra i box verticali */
        border-radius: 8px !important; /* Raggio più stretto per salvare spazio */
    }

    /* 3. LAYOUT COLONNE (Sidebar vs Main) */
    .content-container {
        gap: 15px !important; /* Ridotto lo stacco tra le sezioni principali */
    }

    .sidebar {
        gap: 15px !important; /* Ridotto spazio tra i box della sidebar */
        margin-bottom: 0 !important;
    }
    
    .main-content {
        gap: 15px !important;
    }

    /* 4. TITOLI H2: Più vicini al contenuto */
    .box-classifica h2, 
    .partite-banner-container h2, 
    .oggi-in-campo-container h2 {
        margin-bottom: 10px !important; /* Era 20px */
        font-size: 1.2em !important; /* Leggermente più piccoli */
        margin-top: 0 !important;
    }

    /* 5. LISTE CLASSIFICHE (Righe Giocatori) */
    .classifica-content {
        gap: 6px !important; /* Meno spazio tra le righe dei giocatori */
    }

    a.classifica-item {
        padding: 8px !important; /* Box giocatore più sottile */
        min-height: auto !important;
    }
    
    /* Riduzione icone e testi nelle liste */
    .giocatore-foto-container { width: 35px; height: 35px; }
    .giocatore-nome { font-size: 0.85rem; }
    .giocatore-team { font-size: 0.6rem; margin-top: 0; }
    .stat-value { font-size: 0.9rem; }

    /* 6. SLIDER PARTITE: Massima larghezza */
    .partite-slider {
        gap: 10px !important; /* Box partite più vicini tra loro */
    }
    
    /* 7. TEAM OF THE WEEK (TOTW) */
    .totw-container {
        margin-top: 5px !important;
        gap: 4px !important;
    }
    .totw-card {
        padding: 6px 2px !important;
    }
    .totw-role { 
        margin-bottom: 4px !important; 
        padding: 2px 4px !important;
        font-size: 0.55em !important;
    }
    .totw-img {
        margin-bottom: 4px !important;
    }

    /* 8. SPONSOR */
    .sponsor-banner {
        margin: 10px 0 !important;
        padding: 10px 0 !important;
    }
    .sponsor-item {
        margin: 0 10px !important;
        height: 50px !important; /* Sponsor più piccoli */
        width: 100px !important;
    }
}

/* =========================================
   AGGIORNAMENTI DESIGN HOME (PODIO & STORIA)
   ========================================= */

/* --- 1. NUOVO PODIO (Numeri DrukWide, Niente Medaglie) --- */

.podium-rank {
    /* Rimuoviamo lo stile a "pallino" */
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    
    /* Stile Testo DRUKWIDE */
    font-family: 'DrukWide', sans-serif !important;
    font-weight: bold;
    font-style: italic; /* Opzionale per dinamicità */
    
    /* Posizionamento */
    position: absolute;
    bottom: 20px !important; /* Spinge un po' giù sotto il logo */
    right: 50%;
    transform: translateX(50%);
    z-index: 20;
}

/* Colori specifici per posizione */
.rank-1 .podium-rank { 
    font-size: 2rem !important; 
    color: var(--primary-color, #ff19ff); /* Rosa Neon */
    bottom: -10px !important;
}
.rank-2 .podium-rank { 
    font-size: 1.5rem !important; 
    color: #ffffff; /* Argento */
    bottom: -10px !important;
}
.rank-3 .podium-rank { 
    font-size: 1.5rem !important; 
    color: #ffffff; /* Bronzo */
    bottom: -10px !important;
}

/* --- 2. BOX STORIA (Foto Pulita + Animazione + Hover) --- */

.history-banner-link {
    position: relative;
    overflow: hidden;
    display: block;
    height: 400px; /* Altezza fissa */
    border-radius: 12px;
    border: 1px solid var(--primary-color);
}

/* FOTO: Chiara, senza filtri scuri, con animazione lenta */
.history-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1) !important; /* Nessun filtro scuro di default */
    
    /* Animazione "Respiro" molto lenta */
    animation: slowZoom 15s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes slowZoom {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.15); }
}

/* CONTENUTO (Testo): Invisibile di default */
.history-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    
    /* Centramento */
    display: flex; flex-direction: column; 
    align-items: center; justify-content: center;
    
    /* OVERLAY NERO E OPACO SU HOVER */
    background: rgba(0, 0, 0, 0.7); /* Overlay scuro */
    opacity: 0; /* Invisibile */
    transition: opacity 0.3s ease-in-out;
}

/* TESTI */
.history-title {
    font-family: 'DrukWide', sans-serif;
    color: white;
    font-size: 1.4rem;
    margin-bottom: 5px;
}
.history-subtitle {
    font-family: 'HelveticaBold', sans-serif;
    color: var(--primary-color);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* EFFETTO HOVER: Mostra tutto */
.history-banner-link:hover .history-content {
    opacity: 1; /* Appare overlay e testo */
}

/* Ferma o rallenta l'animazione foto su hover (opzionale) */
.history-banner-link:hover .history-bg {
    animation-play-state: paused;
}


@media (max-width: 768px) {
    html {
        font-size: 85% !important; 
    }
    
    .history-banner-link {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 200px; /* Altezza fissa banner */
    border: 1px solid var(--primary-color);
}
}

/* ============================================================
   EFFETTO LINEA PERIMETRALE ANIMATA (Fix: 1px & Hover Storia)
   ============================================================ */

/* 1. Definizione delle Animazioni */
@keyframes borderRunHorizontal {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes borderRunVertical {
    0% { background-position: 0 200%; }
    100% { background-position: 0 -200%; }
}

@keyframes borderRunVerticalReverse {
    0% { background-position: 0 -200%; }
    100% { background-position: 0 200%; }
}

/* 2. Configurazione Base per i Box */
.partite-banner-container,
.box-classifica,
.fantasy-section,
.history-banner-link {
    position: relative !important;
    border: none !important;
    background-clip: padding-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1; 
}

/* 3. Pseudo-elemento (Il bordo animato) */
.partite-banner-container::before,
.box-classifica::before,
.fantasy-section::before,
.history-banner-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px; 
    
    /* MODIFICA RICHIESTA: Spessore 1px */
    padding: 1px !important; 
    
    box-sizing: border-box; 
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    pointer-events: none; /* Lascia passare il click */
    z-index: 5; /* Bordo sopra lo sfondo ma sotto il contenuto hover */
}

/* 4. FIX SPECIFICO PER STORIA (Hover e Click) */
/* Assicura che l'immagine stia sotto */
.history-bg {
    position: relative;
    z-index: 1;
}

/* Assicura che il testo/hover stia SOPRA tutto (bordo e immagine) */
.history-content {
    position: absolute;
    z-index: 10 !important; /* Più alto del bordo (che è 5) */
}

/* Assicura che gli altri contenuti stiano sopra il bordo */
.partite-banner-container > *,
.box-classifica > *,
.fantasy-section > * {
    position: relative;
    z-index: 6; /* Più alto del bordo */
}

/* 5. Applicazione Animazioni */

/* Banner Partite (Orizzontale) */
.partite-banner-container::before {
    background: linear-gradient(90deg, transparent 0%, transparent 40%, #ff19ff 50%, transparent 60%, transparent 100%);
    background-size: 200% 100%;
    animation: borderRunHorizontal 4s linear infinite;
}

/* Classifiche (Verticale) */
.box-classifica::before {
    background: linear-gradient(180deg, transparent 0%, transparent 40%, #ff19ff 50%, transparent 60%, transparent 100%);
    background-size: 100% 200%;
    animation: borderRunVertical 6s linear infinite;
}

/* Storia Banner (Verticale Lento) */
.history-banner-link::before {
    background: linear-gradient(180deg, transparent 0%, transparent 30%, #ff19ff 50%, transparent 70%, transparent 100%);
    background-size: 100% 200%;
    animation: borderRunVertical 8s ease-in-out infinite;
}

/* Fantasy Section (Inverso) */
.fantasy-section::before {
    background: linear-gradient(0deg, transparent 0%, transparent 40%, #ff19ff 50%, transparent 60%, transparent 100%);
    background-size: 100% 200%;
    animation: borderRunVerticalReverse 7s linear infinite;
}

/* Fix Safari */
@supports not (mask-composite: exclude) {
    .partite-banner-container::before,
    .box-classifica::before,
    .fantasy-section::before,
    .history-banner-link::before {
        -webkit-mask-composite: source-out;
        mask-composite: subtract;
    }
}