/* assets/css/home.css - TEMA 2026 */

/* =========================================
   1. FONTS & GLOBALS
   ========================================= */
@font-face {
    font-family: 'DrukWide';
    src: url('/assets/doc/DrukTextWide-MediumItalic-Trial.otf') format('opentype');
    font-weight: bold;
    font-display: swap; /* Aggiunto */
    font-style: italic;
}

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

:root {
    --primary-color: #ff19ff;
    --secondary-color: #790cfd;
    --text-color: #ffffff;
    --testo-bianco: #ffffff;
    --card-bg-color: rgba(18, 0, 40, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --box-shadow: 0 3px 7px rgba(18, 0, 40, 0.3);
}

/* --- FORZATURA GLOBALE H2 --- */
h2 {
    font-family: 'DrukWide', sans-serif !important;
    font-style: italic !important;
    letter-spacing: 0 !important;
}

/* --- FIX FOOTER STICKY E SFONDO BASE --- */
html, body {
    height: 100%;
    margin: 0;
    background-color: #120028 !important;
}

body {
    font-family: 'HelveticaBold', Arial, sans-serif !important;
    font-weight: bold !important;
    color: var(--text-color);
    padding: 0;
    padding-bottom: 20px;
    background-color: #120028 !important;
    
    position: relative;
    min-height: 100vh;
    z-index: 0;
    
    display: flex;
    flex-direction: column;
    
    text-align: center !important;
    text-transform: uppercase !important;
}

/* NUOVO SFONDO CON OVERLAY GRADIENTE VINACCIA */
body::before {
    content: "";
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    background: linear-gradient(rgba(18, 0, 40, 0.5), rgba(18, 0, 40, 0.5)), url('/assets/imm/gradiente26.jpg') center/cover no-repeat;
    
    z-index: -1; 
    transform: translateZ(0);
    will-change: transform;
}

.home-container, 
main.home-container {
    flex: 1;
    width: 100%; 
    display: flex;
    flex-direction: column;
}

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

/* =========================================
   2. LARGHEZZA PAGINA E LAYOUT
   ========================================= */
.home-container, 
main.container {
    max-width: 1072px !important; 
    width: 95% !important;
    margin: 0 auto;
    padding: 13px 0;
}

.content-container {
    display: flex;
    gap: 20px; 
    justify-content: space-between;
    align-items: flex-start;
}

.main-content {
    flex: 2; 
    min-width: 0; 
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden; 
}
.main-content img {
    max-width: 100%;
    height: auto;
}

.sidebar {
    flex: 1.2; 
    width: 235px; 
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 228px; 
}

@media (max-width: 686px) {
    .content-container { flex-direction: column; }
    .sidebar { width: 100%; order: 2; }
}

/* =========================================
   3. BOX E SEZIONI PRINCIPALI
   ========================================= */
.oggi-in-campo-container {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    padding: 13px;
    margin-bottom: 13px;
    box-shadow: var(--box-shadow);
}
.oggi-in-campo-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 13px;
    font-size: 1.2em;
}
.oggi-in-campo-matches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 13px;
}
.oggi-in-campo-matches .partita-box {
    min-width: 188px;
    max-width: 268px;
    width: 100%;
    flex-grow: 1;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.partite-banner-container {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    padding: 13px;
    margin-bottom: 13px;
    box-shadow: var(--box-shadow);
    position: relative;
}
.partite-banner-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 13px;
    font-size: 1.2em;
}

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

.partita-box {
    flex: 0 0 201px !important;
    min-width: 201px !important;
    max-width: 201px !important;
    background-color: rgba(18, 0, 40, 0.7);
    border-radius: 7px;
    padding: 12px;
    text-align: center;
    scroll-snap-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(18, 0, 40, 0.5);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 168px;
    max-height: 168px;
}
.partita-box:hover { transform: translateY(-3px); }

.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: 8px; flex-shrink: 0; }
.partita-fase { color: var(--primary-color); font-weight: bold; font-size: 0.57em; margin-bottom: 3px; }
.partita-ora { font-size: 0.64em; color: var(--text-color); font-weight: bold; margin: 0; }
.partita-teams { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-grow: 1; width: 100%; padding: 7px 0; }
.team-info { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.partita-logo { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.team-name { font-size: 0.57em; 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: 0.8em; min-height: 1.6em; max-height: 1.6em; }
.team-short { display: none; }

.partita-score { font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 1.07em; color: var(--primary-color); white-space: nowrap; flex-shrink: 0; min-width: 34px; display: flex; align-items: center; justify-content: center; }
.partita-footer { width: 100%; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.partita-data { font-size: 0.54em; color: #ccc; margin: 0; }

.slider-controls { display: flex; justify-content: center; gap: 7px; margin-top: 10px; }
.slider-control { background: var(--primary-color); color: var(--text-color); border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-weight: bold; }
.no-data { color: #ccc; font-style: italic; padding: 13px; }

/* =========================================
   4. CLASSIFICHE E SIDEBAR
   ========================================= */
.box-classifica {
    background: rgba(18, 0, 40, 0.6) !important;
    border-radius: 8px;
    padding: 17px; 
    margin-bottom: 13px;
    box-shadow: 0 3px 7px rgba(18, 0, 40, 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: 13px;
    font-size: 1em;
    text-transform: uppercase;
}

.classifica-content { display: flex; flex-direction: column; gap: 7px; }

a.classifica-item {
    display: flex; align-items: center; gap: 10px; padding: 8px;
    background: rgba(255, 255, 255, 0.05); border-radius: 5px; border: 1px solid transparent;
    cursor: pointer; transition: all 0.2s ease-in-out;
    text-decoration: none !important; color: #ffffff !important; outline: none;
    animation: slideIn 0.5s ease-out forwards; opacity: 0;
}
a.classifica-item:visited, a.classifica-item:active, a.classifica-item:focus { text-decoration: none !important; color: #ffffff !important; }
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:hover { background: rgba(255, 255, 255, 0.15); transform: translateX(3px); border-color: var(--primary-color, #ff19ff); box-shadow: 0 3px 5px rgba(18, 0, 40, 0.2); }

.position { font-weight: 700; color: #aaa; width: 13px; font-size: 0.6em; text-align: center; }
.giocatore-foto-container { position: relative; width: 30px; height: 30px; flex-shrink: 0; }
.giocatore-foto { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; border: 1px solid rgba(255,255,255,0.2); }
.team-logo-overlay { position: absolute; bottom: -3px; right: -3px; width: 13px; height: 13px; object-fit: contain; background: #120028; border-radius: 50%; padding: 1px; border: 1px solid #555; z-index: 2; }

.giocatore-info { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.giocatore-nome { font-size: 0.64rem; font-weight: 700; color: #ffffff !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.giocatore-team { font-size: 0.5rem; color: #cccccc !important; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }

.stat-value { font-family: 'DrukWide', sans-serif; font-style: italic; font-size: 0.74rem; color: #ffffff; text-align: right; min-width: 27px; }

a.classifica-item.rank-1 { background: linear-gradient(90deg, rgba(255, 25, 255, 0.15), transparent); padding: 10px 8px; border: 1px solid rgba(255, 25, 255, 0.4); margin-bottom: 3px; }
a.classifica-item.rank-1 .position { color: var(--primary-color, #ff19ff); font-size: 0.8em; }
a.classifica-item.rank-1 .giocatore-foto { border: 2px solid var(--primary-color, #ff19ff); box-shadow: 0 0 5px rgba(255, 25, 255, 0.5); }
a.classifica-item.rank-1 .stat-value { color: var(--primary-color, #ff19ff); font-size: 0.87rem; }

.view-more { display: block; text-align: center; margin-top: 10px; padding: 7px; background: rgba(255, 255, 255, 0.05); border-radius: 5px; color: var(--primary-color, #ff19ff) !important; font-weight: bold; font-size: 0.57em; 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); }

@keyframes slideIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   5. COMPONENTI MAIN CONTENT
   ========================================= */

/* Sezioni con titolo esterno: il div wrapper deve avere margin-top ridotto
   e gap verso il basso piccolo. Il gap del .main-content (20px) vale tra fratelli,
   quindi avvolgiamo titolo+box nello stesso div nel PHP. Dove non è possibile,
   usiamo questo pattern: il titolo standalone ha margin-bottom negativo. */
.section-title-label {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 1.2em;
    text-align: center;
}
.podium-box { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding: 20px 7px 7px 7px; height: 67px; }
.podium-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; text-align: center; position: relative; }
.podium-logo { object-fit: contain; margin-bottom: 1px; }
.rank-1 .podium-logo { width: 60px; height: 60px; } 
.rank-2 .podium-logo { width: 47px; height: 47px; } 
.rank-3 .podium-logo { width: 40px; height: 40px; } 
.podium-item.rank-1 { order: 2; padding-bottom: 13px; } 
.podium-item.rank-2 { order: 1; padding-bottom: 10px; } 
.podium-item.rank-3 { order: 3; padding-bottom: 7px; } 

.podium-rank {
    width: auto !important; height: auto !important; background: transparent !important; border: none !important; border-radius: 0 !important;
    font-family: 'DrukWide', sans-serif !important; font-weight: bold; font-style: italic !important;
    position: absolute; bottom: 13px !important; right: 50%; transform: translateX(50%); z-index: 20;
}
.rank-1 .podium-rank { font-size: 1.34rem !important; color: var(--primary-color, #ff19ff); bottom: -7px !important; }
.rank-2 .podium-rank { font-size: 1rem !important; color: #ffffff; bottom: -7px !important; }
.rank-3 .podium-rank { font-size: 1rem !important; color: #ffffff; bottom: -7px !important; }

/* STORIA & COUNTDOWN */
.fantasy-section { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); border-radius: 8px; padding: 20px; text-align: center; box-shadow: var(--box-shadow); }
.fantasy-banner h2 { color: var(--text-color); font-size: 1.34em; margin: 0; }
#countdown { color: white; font-size: 160%; }

.history-banner-link { position: relative; overflow: hidden; display: block; height: 268px; border-radius: 8px; border: 1px solid var(--primary-color); }
.history-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(1) !important; animation: slowZoom 15s ease-in-out infinite alternate; will-change: transform; position: relative; z-index: 1; }
@keyframes slowZoom { 0% { transform: scale(1.0); } 100% { transform: scale(1.15); } }
.history-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(18, 0, 40, 0.7); opacity: 0; transition: opacity 0.3s ease-in-out; z-index: 10 !important; }
.history-title { font-family: 'DrukWide', sans-serif; font-style: italic; color: white; font-size: 0.94rem; margin-bottom: 3px; }
.history-subtitle { font-family: 'HelveticaBold', sans-serif; color: var(--primary-color); font-size: 0.54rem; letter-spacing: 0.7px; }
.history-banner-link:hover .history-content { opacity: 1; }
.history-banner-link:hover .history-bg { animation-play-state: paused; }

/* Mobile: history overlay always visible (no hover on touch) */
@media (hover: none), (max-width: 515px) {
    .history-content { opacity: 1 !important; background: rgba(18, 0, 40, 0.55); }
    .history-bg { animation-play-state: running; }
}

.storia-uml-box { flex: 1; min-height: 168px; }
.storia-link { display: block; height: 100%; }
.storia-image-container { position: relative; width: 100%; height: 100%; border-radius: 8px; 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(18, 0, 40, 0.8), transparent); padding: 27px 13px 13px; text-align: center; opacity: 0; visibility: hidden; transform: translateY(13px); transition: all 0.3s ease; }
.storia-uml-box:hover .storia-overlay { opacity: 1; visibility: visible; transform: translateY(0); }
.storia-text { font-size: 1em; font-weight: bold; color: var(--text-color); }

/* TEAM OF THE WEEK */
.totw-container { display: flex; justify-content: space-between; gap: 7px; width: 100%; }
a.totw-card { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; display: flex; flex-direction: column; align-items: center; padding: 10px 3px; min-width: 0; transition: transform 0.2s, background 0.2s; text-decoration: none !important; color: white !important; cursor: pointer; }
a.totw-card:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-3px); border-color: #ff19ff; box-shadow: 0 3px 10px rgba(255, 25, 255, 0.2); }
.totw-role { font-size: 0.5em; background: #ff19ff; color: white; padding: 3px 5px; border-radius: 3px; text-transform: uppercase; margin-bottom: 7px; font-weight: bold; box-shadow: 0 1px 3px rgba(18, 0, 40, 0.3); }
.totw-img { width: 47px; height: 47px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(255,255,255,0.3); margin-bottom: 5px; }
.totw-name { font-size: 0.57em; font-weight: bold; color: white; text-align: center; line-height: 1.2; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* NEWS */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.news-card { background: rgba(18, 0, 40, 0.6); border-radius: 8px; 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: 94px; overflow: hidden; }
.news-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.news-card:hover .news-img { transform: scale(1.1); }
.news-content { padding: 8px; }
.news-title { font-size: 0.6em; line-height: 1.3; color: white; font-weight: bold; }
.news-date { font-size: 0.47em; color: var(--primary-color); margin-bottom: 3px; }

/* VIDEO */
.video-box { position: relative; width: 100%; height: 0; padding-bottom: 56.25%; background: #120028; border-radius: 8px; 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; }

/* SPONSOR */
.sponsor-banner { background-color: transparent; margin: 13px 0; padding: 13px 0; overflow: hidden; position: relative; }
.sponsor-scroll { display: flex; animation: scroll 35s linear infinite; width: calc(200% + 40px); }
.sponsor-item { flex: 0 0 auto; margin: 0 20px; display: flex; align-items: center; justify-content: center; height: 60px; width: 121px; background-color: #fff; border: 1px solid #ff19ff; border-radius: 8px; padding: 0px !important; box-shadow: 0 3px 5px rgba(18, 0, 40, 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; }

/* =========================================
   6. BORDI ANIMATI
   ========================================= */
@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%; } }

.partite-banner-container, .box-classifica, .fantasy-section, .history-banner-link {
    position: relative !important; border: none !important; background-clip: padding-box; box-shadow: 0 7px 20px rgba(18, 0, 40, 0.5); z-index: 1; 
}
.partite-banner-container::before, .box-classifica::before, .fantasy-section::before, .history-banner-link::before {
    content: ''; position: absolute; inset: 0; border-radius: 8px; 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; z-index: 5; 
}
.partite-banner-container > *, .box-classifica > *, .fantasy-section > * { position: relative; z-index: 6; }

.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; }
.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; }
.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::before { background: linear-gradient(0deg, transparent 0%, transparent 40%, #ff19ff 50%, transparent 60%, transparent 100%); background-size: 100% 200%; animation: borderRunVerticalReverse 7s linear infinite; }

@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;
    }
}

/* =========================================
   7. RESPONSIVE MOBILE
   ========================================= */
@media (max-width: 603px) {
    .content-container { flex-direction: column; }
    .sidebar { width: 100%; min-width: 100%; order: 0 !important; margin-bottom: 13px; gap: 10px; }
    .classifica-item { padding: 5px 7px; gap: 7px; }
    .giocatore-foto-container { width: 25px; height: 25px; }
    .giocatore-nome { font-size: 0.6rem; }
    .giocatore-team { font-size: 0.44rem; }
    .stat-value { font-size: 0.67rem; }
    .box-classifica { padding: 10px; } 
}

.mobile-date { display: none; }

@media (max-width: 515px) {
    .home-container {
        font-size: 57%;
    }
    .home-container { width: 96% !important; margin-top: 7px !important; margin-bottom: 7px !important; }
    .partite-banner-container, .oggi-in-campo-container, .box-classifica, .totw-box, .standings-box, .fantasy-section { padding: 8px 7px !important; margin-bottom: 10px !important; border-radius: 5px !important; }
    .content-container { gap: 10px !important; }
    .sidebar { gap: 10px !important; margin-bottom: 0 !important; }

    /* Gap ridotto nel main-content per sezioni compatte */
    .main-content { gap: 14px !important; }

    /* Titoli standalone (h2 diretto figlio di .main-content) devono
       stare vicini al loro box, NON al box precedente.
       Usiamo margin-bottom negativo per "assorbire" il gap. */
    .main-content > h2 {
        margin-bottom: -6px !important;
        margin-top: 4px !important;
        font-size: 1em !important;
    }

    /* Il div che wrappa video (h2 + video-box) non deve avere gap interno esagerato */
    .main-content > div > h2:first-child {
        margin-bottom: 8px !important;
        margin-top: 0 !important;
    }
    
    .partite-banner-container { padding: 10px 0 !important; }
    .partite-slider { gap: 7px !important; }
    .partita-box { flex: 0 0 147px !important; min-width: 147px !important; max-width: 147px !important; min-height: auto !important; height: auto !important; padding: 7px 3px !important; gap: 3px; }
    .partita-header { margin-bottom: 3px; }
    .partita-fase { font-size: 0.47em; }
    .partita-ora { font-size: 0.54em; }
    .partita-logo { width: 23px; height: 23px; }
    .partita-score { font-size: 0.8em; min-width: 27px; }
    .team-name { display: none; } 
    .team-short { display: block; font-size: 0.6em; font-weight: bold; }
    .partita-teams { padding: 3px 0; margin: 0; }
    .mobile-date { display: inline; font-weight: normal; opacity: 0.8; font-size: 0.6em; }
    .partita-footer { display: none !important; }
    .slider-controls { display: none; }
    
    .classifica-content { gap: 4px !important; }
    a.classifica-item { padding: 5px !important; min-height: auto !important; }
    .giocatore-foto-container { width: 23px; height: 23px; }
    .giocatore-nome { font-size: 0.57rem; }
    .giocatore-team { font-size: 0.4rem; margin-top: 0; }
    .stat-value { font-size: 0.6rem; }
    
    .podium-box { height: auto; padding: 13px 0 0 0; align-items: flex-end; gap: 3px; }
    .rank-1 .podium-logo { width: 47px; height: 47px; }
    .rank-2 .podium-logo { width: 37px; height: 37px; }
    .rank-3 .podium-logo { width: 30px; height: 30px; }
    .podium-rank { width: 13px; height: 13px; font-size: 0.47em; bottom: 13px; }
    .rank-1 .podium-rank, .rank-2 .podium-rank { bottom: 23px; }
    .podium-team-name { font-size: 0.44em; line-height: 1.1; }
    
    .totw-container { margin-top: 3px !important; gap: 3px !important; }
    .totw-card { padding: 4px 1px !important; }
    .totw-role { margin-bottom: 3px !important; padding: 1px 3px !important; font-size: 0.37em !important; }
    .totw-img { width: 30px; height: 30px; border-radius: 7px; margin-bottom: 3px !important; }
    .totw-name { font-size: 0.44em; }
    
    .news-grid { grid-template-columns: 1fr; }
    .history-banner-link { height: 134px; }
    .storia-overlay { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; padding: 13px 10px 10px; }
    .storia-text { font-size: 0.8em; }
    
    .sponsor-banner { padding: 7px 0 !important; margin: 7px 0 !important; }
    .sponsor-item { margin: 0 7px !important; height: 34px !important; width: 67px !important; }
}

@media (max-width: 402px) {
    .totw-img { width: 27px; height: 27px; } 
    .totw-vote { font-size: 0.54em; }
    .news-grid { grid-template-columns: 1fr; } 
}

/* =========================================
   8. MOBILE-SPECIFIC FIXES
   ========================================= */

/* Su touch device / mobile: i margin-bottom dei box si sommano al gap flex
   e creano spazi doppi. Li azzeriamo lasciando solo il gap a gestire la distanza. */
@media (max-width: 686px) {
    .box-classifica { margin-bottom: 0 !important; }
    .partite-banner-container { margin-bottom: 0 !important; }
    .oggi-in-campo-container { margin-bottom: 0 !important; }

    /* Titolo HIGHLIGHTS FINALE e ULTIME DAL CAMPO sono <h2> o <div> con h2
       direttamente nel flusso flex di .main-content. Li colleghiamo al box sotto. */
    .main-content > h2 {
        margin-bottom: -6px;
        margin-top: 4px;
    }

    /* Il wrapper del video (div con style margin-bottom:20px) va resettato */
    .main-content > div[style*="margin-bottom"] {
        margin-bottom: 0 !important;
    }

    /* news-grid su mobile: 1 colonna più leggibile */
    .news-grid {
        grid-template-columns: 1fr;
    }

    /* History banner altezza più generosa su mobile per leggere il testo */
    .history-banner-link { height: 160px; }
}