/* assets/css/storicopartite.css - TEMA 2026 (Vinaccia & Nuovo Sfondo) */

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

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

:root {
    --rosa-neon: #ff19ff;
    --viola: #790cfd; /* AGGIORNATO */
    --bianco: #ffffff;
    /* Opacità convertita in Vinaccia */
    --nero-transp: rgba(18, 0, 40, 0.7); 
    --verde: #00ff66;
    --rosso: #ff3333;
    /* Sfondo popup convertito in Vinaccia */
    --sfondo-box: rgba(18, 0, 40, 0.95);
}

body {
    color: var(--bianco);
    font-family: 'HelveticaBold', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #120028; /* AGGIORNATO IN 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;
    background-size: cover;
    z-index: -1; 
    transform: translateZ(0); 
    will-change: transform;
}

/* Utility Fonts */
.druk-font { font-family: 'DrukWide', sans-serif; letter-spacing: 0; }
.helvetica-font { font-family: 'HelveticaBold', sans-serif; }
.no-link-decoration { text-decoration: none; color: inherit; transition: opacity 0.2s; }
.no-link-decoration:hover { opacity: 0.8; }

main {
    max-width: 804px;
    width: 95%;
    margin: 27px auto;
    animation: fadeIn 0.8s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   2. HEADER PARTITA (Match Grid)
   ========================================= */
.match-header-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 13px;
    background: var(--nero-transp);
    padding: 20px;
    border-radius: 13px;
    box-shadow: none; 
    margin-bottom: 27px;
    align-items: center;
    border: 1px solid rgba(255, 25, 255, 0.15);
    backdrop-filter: blur(5px);
}

/* Squadre Laterali */
.team-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.team-logo-wrapper img {
    width: 121px;
    height: 121px;
    object-fit: contain;
    filter: drop-shadow(0 0 7px rgba(255,255,255,0.1));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.team-logo-wrapper img:hover { transform: scale(1.05); }

.team-name {
    font-family: 'HelveticaBold', sans-serif; /* Modificato in HelveticaBold */
    font-size: 0.74rem; /* Leggermente ridotto */
    color: var(--bianco);
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0;
}

/* Centro (Punteggio) */
.match-center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.match-score {
    font-family: 'DrukWide', sans-serif;
    font-size: 3rem;
    color: var(--rosa-neon);
    text-shadow: 0 0 10px rgba(255, 25, 255, 0.3);
    line-height: 1;
    margin-bottom: 10px;
}

.match-meta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.meta-item {
    font-size: 0.6rem;
    color: var(--bianco);
    text-transform: uppercase;
    opacity: 0.9;
}
.phase-label { color: var(--rosa-neon); font-weight: bold; letter-spacing: 0; }
.meta-extra { font-size: 0.54rem; color: var(--bianco); margin-top: 3px; font-style: italic; opacity: 0.8; }

/* Bottone Info */
.info-btn {
    background: transparent;
    border: 1px solid var(--rosa-neon);
    color: var(--rosa-neon);
    padding: 4px 9px;
    border-radius: 13px;
    font-family: 'HelveticaBold', sans-serif;
    font-size: 0.5rem;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.info-btn:hover { background: var(--rosa-neon); color: #fff; box-shadow: 0 0 7px var(--rosa-neon); }

/* =========================================
   3. LISTE SQUADRE (Columns)
   ========================================= */
.teams-columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--nero-transp);
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 25, 255, 0.15);
    backdrop-filter: blur(5px);
    box-shadow: none;
}

.team-column { padding: 0; }

.border-left-desktop {
    border-left: 1px solid rgba(255,255,255,0.1);
}

.team-col-header {
    text-align: center;
    font-family: 'DrukWide', sans-serif;
    font-size: 0.67rem;
    color: var(--rosa-neon);
    padding: 13px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255, 25, 255, 0.2);
    letter-spacing: 0;
}

.players-list {
    padding: 7px 13px 20px 13px;
}

/* Player Row (Card) */
.player-row {
    padding: 10px 7px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s ease, background 0.3s;
}
.player-row:hover {
    background: rgba(255, 25, 255, 0.08);
    transform: translateX(3px);
}

.player-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

/* Lato Sinistro: Foto + Nomi */
.player-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-img-wrap {
    position: relative;
    width: 34px;
    height: 34px;
}
.player-pic {
    width: 100%; height: 100%;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, border-color 0.3s;
}
.player-row:hover .player-pic {
    transform: scale(1.05);
    border-color: var(--rosa-neon);
}

.player-flag {
    position: absolute;
    bottom: -1px; right: -3px;
    width: 12px; height: 12px;
    border-radius: 2.8px;
    border: 1px solid var(--sfondo-box);
    object-fit: cover;
}

/* TESTI NOME/COGNOME/RUOLO */
.player-texts {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}
.p-nome { 
    font-family: 'HelveticaBold', sans-serif;
    font-size: 0.5rem; 
    color: var(--bianco); 
    text-transform: uppercase; 
    margin-bottom: 1px; 
    opacity: 0.9; 
    letter-spacing: 0;
}
.p-cognome { 
    font-family: 'DrukWide', sans-serif;
    font-size: 0.67rem; 
    color: var(--bianco); 
    text-transform: uppercase; 
    opacity: 1; 
    letter-spacing: 0;
}
.p-ruolo { 
    font-family: 'HelveticaBold', sans-serif;
    font-size: 0.44rem; 
    color: var(--rosa-neon);
    margin-top: 1px; 
    letter-spacing: 0; 
    opacity: 0.9; 
}

/* Lato Destro: Icone + Voto */
.player-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icons-area {
    display: flex;
    justify-content: flex-end;
}
.gol-container-row {
    display: flex;
    gap: 1px;
    align-items: center;
    justify-content: flex-end; /* Allinea a destra */
}

/* Su desktop nascondiamo il break */
.break-mobile {
    display: none;
}

.icon-s {
    width: 13px; 
    height: 13px;
    filter: brightness(0) invert(1);
    transition: transform 0.2s;
}
.icon-s:hover { transform: scale(1.1); }
.icon-s.ag { filter: none; }

/* Wrapper Voto */
.vote-wrapper {
    position: relative;
    width: 30px; height: 30px;
    display: flex; justify-content: center; align-items: center;
}

.voto-num {
    display: inline-flex; justify-content: center; align-items: center;
    width: 24px; height: 24px;
    border-radius: 4px;
    font-family: 'HelveticaBold', sans-serif !important; 
    font-size: 0.67rem;
    color: #ffffff !important; 
    font-weight: bold;
    position: relative; z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.extra-icon-img { width: 24px; height: 24px; object-fit: contain; z-index: 10; }

.corner-icon {
    position: absolute;
    width: 13px; height: 13px;
    z-index: 20;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)) brightness(0) invert(1);
}
.mp { top: -3px; left: -3px; }
.motn { top: -3px; right: -3px; }

/* Separatore Extra */
.extra-separator {
    text-align: center;
    margin: 10px 0 7px 0;
    border-top: 1px dashed rgba(255,25,255,0.2);
    position: relative;
}
.extra-separator span {
    background: rgba(18, 0, 40, 0.9);
    padding: 0 7px;
    position: relative;
    top: -6px;
    font-size: 0.47rem;
    color: var(--rosa-neon);
    letter-spacing: 0;
    border-radius: 7px;
}

/* Palette Colori Voti */
.voto-5down  { background-color: #cc0000 !important; }
.voto-5to6   { background-color: #ff6600 !important; }
.voto-6to65  { background-color: #ffcc00 !important; }
.voto-65to7  { background-color: #99cc00 !important; }
.voto-7to75  { background-color: #00cc00 !important; }
.voto-75to85 { background-color: #00ccff !important; }
.voto-85to95 { background-color: #0066ff !important; }
.voto-95to10 { background-color: #ff19ff !important; }
.voto-neutro { background-color: #444 !important; }

/* =========================================
   4. POPUP & TAVOLINO (FIX LEGENDA)
   ========================================= */

/* TAVOLINO */
.tavolino-box {
    text-align: center; padding: 27px 13px;
    background: var(--nero-transp); border-radius: 13px;
    border: 1px solid var(--rosa-neon); margin-top: 13px;
}
.tavolino-title { font-size: 1.2rem; color: var(--rosa-neon); margin-bottom: 7px; letter-spacing: 0; }
.tavolino-text { font-size: 0.67rem; color: var(--bianco); }

/* LEGENDA POPUP (Modale) */
.legend-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(18, 0, 40, 0.85); /* Overlay Vinaccia */
    backdrop-filter: blur(4px);
    z-index: 9990;
    display: none; 
}

.legend-popup {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; max-width: 235px;
    background: var(--sfondo-box); /* Vinaccia pieno */
    border: 1px solid var(--rosa-neon);
    border-radius: 11px;
    z-index: 9999;
    display: none; 
    box-shadow: 0 7px 20px rgba(0,0,0,0.5);
}

.legend-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.legend-title { font-size: 0.6rem; color: var(--rosa-neon); margin: 0; letter-spacing: 0; font-family: 'DrukWide', sans-serif; }

.close-btn {
    background: none; border: none; color: var(--bianco);
    font-size: 1rem; cursor: pointer; padding: 0; line-height: 1;
}

.legend-items { 
    padding: 13px; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
}

.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.5rem; color: #ccc; }

.legend-icon { width: 16px; display: flex; justify-content: center; }
.leg-img { width: 13px; height: 13px; filter: brightness(0) invert(1); }
.leg-img.ag { filter: none; }
.penalty-icon-leg { width: 13px; height: 13px; object-fit: contain; }

.error-container {
    text-align: center; padding: 27px; background: var(--nero-transp);
    border-radius: 13px; color: var(--rosso); font-size: 0.8rem;
}

/* =========================================
   5. RESPONSIVE (MOBILE OTTIMIZZATO)
   ========================================= */
@media (max-width: 515px) {
    
    /* Header Compatto */
    .match-header-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 7px;
        padding: 14px 10px;
    }

    /* Loghi */
    .team-logo-wrapper img {
        width: 70px;
        height: 70px;
    }
    .team-display { gap: 7px; }

    /* Testo squadre */
    .team-name {
        font-size: 0.47rem;
        line-height: 1.2;
        word-break: break-word;
    }

    /* Punteggio */
    .match-score {
        font-size: 1.8rem;
        margin-bottom: 7px;
        text-shadow: 0 0 7px rgba(255, 25, 255, 0.3);
    }

    /* Meta info */
    .meta-item { font-size: 0.44rem; }
    .meta-extra { font-size: 0.4rem; }
    .info-btn { font-size: 0.4rem; padding: 3px 7px; margin-top: 5px; }

    /* Stack Colonne */
    .teams-columns-container { grid-template-columns: 1fr; }
    .border-left-desktop {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0;
    }
    .team-col-header { font-size: 0.6rem; padding: 7px; }
    
    /* Player Row Compact */
    .players-list { padding: 3px 5px 13px 5px; }
    .player-row { padding: 5px 1px; } 
    
    .player-left { gap: 7px; }
    
    .player-img-wrap { width: 23px; height: 23px; }
    .player-pic { border-radius: 5px; } 
    .player-flag { width: 9px; height: 9px; bottom: -1px; right: -3px; }
    
    .p-cognome { font-size: 0.54rem; }
    .p-nome { font-size: 0.4rem; }
    .p-ruolo { font-size: 0.34rem; margin-top: 1px; }
    
    .player-right { gap: 4px; }

    /* Gestione "Doppia Fila" Palloni su Mobile */
    .gol-container-row {
        flex-wrap: wrap; /* Permette l'a capo */
    }
    
    .break-mobile {
        display: block; /* Attiva il break per spingere giù i palloni extra */
        flex-basis: 100%;
        height: 0;
    }

    .icon-s { width: 9px; height: 9px; }
    
    .vote-wrapper { width: 20px; height: 20px; }
    .voto-num { width: 17px; height: 17px; font-size: 0.54rem; border-radius: 3px; }
    .extra-icon-img { width: 17px; height: 17px; }
    .corner-icon { width: 9px; height: 9px; top: -3px; right: -3px; }
    .mp { left: -3px; }
    
    .extra-separator { margin: 7px 0; }
    .extra-separator span { font-size: 0.4rem; top: -5px; padding: 0 5px; }
}