/* ============================================================
   PARTITE.CSS - Stili unificati per partite_excel e partite_incorso
   ============================================================ */

  
    /* =========================================================
       PAGINAZIONE - invariata
       ========================================================= */
    .mercato-page .menu-paginazione{
      background:#234567;
      border:none;
      border-radius:12px;
      padding:10px;
      box-shadow:0 8px 22px rgba(2,8,23,.10);
      display:flex;
      flex-direction:column;
      gap:8px;
    }
    .mercato-page .paginazione-riepilogo{
      display:flex;
      align-items:center;
      justify-content:center;
      gap:8px;
      background:#123456;
      border-radius:10px;
      padding:5px 8px;
    }
    .mercato-page .btn-navwk{
      background:#345678;
      border:1px solid #123456;
      border-radius:10px;
      width:36px;
      height:36px;
      display:flex;
      align-items:center;
      justify-content:center;
      box-shadow:0 4px 12px rgba(29,78,216,.15);
      transition: all .15s ease;
    }
    .mercato-page .btn-navwk:disabled{ opacity:.45; box-shadow:none; }
    .mercato-page .btn-navwk:hover:not(:disabled){ background:#456789; transform:translateY(-1px); }
    .mercato-page .btn-riepilogo{
      background:#345678;
      color:#fff;
      border:1px solid rgba(255,255,255,.25);
      border-radius:8px;
      padding:6px 12px;
      font-weight:600;
      font-size:0.9rem;
      text-decoration:none;
      display:inline-flex;
      align-items:center;
      gap:6px;
    }
    .mercato-page .paginazione-sessioni{
      display:flex;
      flex-wrap:wrap;
      gap:5px;
      justify-content:center;
    }
    .mercato-page .session-btn{
      display:inline-flex;
      justify-content:center;
      align-items:center;
      width:42px;
      height:42px;
      border-radius:12px;
      border:1px solid rgba(255,255,255,.35);
      background:#ffffff;
      font-weight:500;
      font-size:0.85rem;
      color:#0f172a;
      text-decoration:none;
      box-shadow:0 3px 8px rgba(2,8,23,.08);
      transition: all .1s ease;
    }
    .mercato-page .session-btn:hover{ transform:translateY(-1px); box-shadow:0 6px 14px rgba(2,8,23,.12); }
    .mercato-page .session-btn.active{ background:#345678; border-color:#123456; color:#fff; }

    .paginazione-link {
      display:block;
      padding:0.4rem 0.6rem;
      border-radius:6px;
      background:#345678;
      color:#fff !important;
      text-align:center;
      text-decoration:none;
      font-size:0.85rem;
      border:none;
      cursor:pointer;
      width:100%;
    }
    .paginazione-link:hover { background:#456789; }

    /* =========================================================
       LOGHI
       ========================================================= */
    .team-logo{ width:24px; height:24px; object-fit:contain; }
    .team-logo-sm{ width:16px; height:16px; object-fit:contain; vertical-align:middle; }
    .team-maglia{ width:44px; height:44px; object-fit:contain; }
    .team-panchina{ width:44px; height:44px; object-fit:contain; display:block; }

    /* =========================================================
       CARD PARTITA
       ========================================================= */
    .match-card{
      background:#fff;
      border-radius:6px;
      padding:0.9rem;
      margin-bottom:1rem;
      box-shadow:0 3px 10px rgba(2,8,23,.08);
      border:1px solid rgba(52,86,120,.12);
    }

    .match-teams{
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:0.5rem;
      margin-bottom:0.75rem;
    }

    .team-side{ flex:1; }
    .team-side.left{ text-align:right; }
    .team-side.right{ text-align:left; }

    .team-name{ font-weight:700; font-size:1rem; }

    .score-display{
      min-width:180px;
      padding:0 0.75rem;
      text-align:center;
    }
    .vs-logos{
      display:flex;
      align-items:center;
      justify-content:center;
      gap:10px;
    }
    .team-logo-vs{ width:48px; height:48px; object-fit:contain; }
    .vs-text{
      font-size:1.7rem;
      font-weight:900;
      color:#345678;
      line-height:1;
    }

   /* =========================================================
   META STADIO / SPETT / PUNTI (fix: niente tagli + badge “auto”)
   ========================================================= */
.match-meta{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:.5rem;
  padding:.35rem .25rem;
  margin:.2rem 0 .5rem 0;
  border-top:1px solid rgba(52,86,120,.10);
  font-size:.78rem;
  color:#334155;
}

.match-meta .meta-item{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.match-meta .meta-item.right{ text-align:right; }

.match-meta .meta-item.center{
  overflow:visible;     /* niente taglio */
  white-space:normal;
  justify-self:center;
  padding:0 .15rem;
}

/* 2×2: su desktop i badge prendono la loro larghezza (max-content) */
.match-meta .meta-grid{
  display:grid;
  grid-template-columns: repeat(2, max-content);
  gap:.3rem .45rem;
  justify-content:center;
  align-items:stretch;
}

/* Schermi medi: due colonne “normali” (riempiono) */
@media (max-width: 700px){
  .match-meta .meta-grid{
    grid-template-columns: repeat(2, minmax(0,1fr));
    width:100%;
  }
}

/* Mobile stretto: una colonna */
@media (max-width: 420px){
  .match-meta .meta-grid{ grid-template-columns: 1fr; }
}

/* Badge custom: più piccoli e puliti */
.match-meta .meta-badge{
  background:#f8fafc;
  border:1px solid rgba(52,86,120,.20);
  border-radius:8px;
  padding:.22rem .50rem;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.match-meta .meta-label{
  font-size:.58rem;
  font-weight:800;
  color:#475569;
  line-height:1.05;
}

.match-meta .meta-values{
  font-size:.72rem;
  font-weight:900;
  color:#0f172a;
  line-height:1.1;
  white-space:nowrap;
}

/* Se proprio non entra, su mobile può andare a capo (meglio che tagliare) */
@media (max-width: 420px){
  .match-meta .meta-values{ white-space:normal; }
}

    /* =========================================================
       FORMAZIONI - affiancate
       ========================================================= */
    .formations-container{
      display:grid;
      grid-template-columns:minmax(0,1fr) minmax(0,1fr);
      gap:0.6rem;
      margin-top:0.6rem;
      align-items:start;
    }

    .formation-side{
      background:#f8fafc;
      border-radius:6px;
      padding:0.65rem;
      min-width:0;
    }

    .formation-header{
      background:#345678;
      color:#fff;
      padding:0.35rem;
      border-radius:6px;
      text-align:center;
      font-weight:700;
      font-size:0.85rem;
      margin-bottom:0.45rem;
      display:flex;
      align-items:center;
      justify-content:center;
    }

    /* =========================================================
       RIGA GIOCATORE (7 colonne)
       ========================================================= */
    .player-row{
      display:grid;
      align-items:center;
      column-gap:4px;
      padding:0.2rem 0.3rem;
      margin-bottom:0.1rem;
      background:#fff;
      border-radius:3px;
      border:1px solid rgba(52,86,120,.10);
      font-size:0.82rem;
      line-height:1.2;
    }
    .player-row:hover{ background:#f3f6fb; }
    .formation-side.left .player-row.active{ border-left:3px solid #22c55e; border-right:none; }
    .formation-side.right .player-row.active{ border-right:3px solid #22c55e; border-left:none; }
    .player-row.inactive{ opacity:.65; }

    .role-badge{
      width:20px;
      height:20px;
      border-radius:10px;
      display:flex;
      align-items:center;
      justify-content:center;
      font-weight:800;
      font-size:0.7rem;
    }

    .player-name{
      min-width:0;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      font-weight:600;
      font-size:0.72rem;
    }
    .formation-side.left .player-name{ text-align:left; }
    .formation-side.right .player-name{ text-align:right; }

    .voto-badge{
      min-width:22px;
      height:18px;
      border-radius:3px;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      font-weight:700;
      font-size:0.6rem;
      padding:0 2px;
    }

    /* ========== VOTI LIVE STYLES ========== */
    .live-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
      color: white;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 0.65rem;
      font-weight: 700;
      text-transform: uppercase;
      animation: pulse-live 2s infinite;
    }
    .live-badge::before {
      content: '';
      width: 6px;
      height: 6px;
      background: white;
      border-radius: 50%;
      animation: blink 1s infinite;
    }
    @keyframes pulse-live {
      0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
      50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    }
    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }
    
    .voto-live {
      position: relative;
      transition: all 0.3s ease;
    }
    .voto-live.updating {
      animation: voto-update 0.5s ease;
    }
    @keyframes voto-update {
      0% { transform: scale(1); background-color: inherit; }
      50% { transform: scale(1.2); background-color: #fbbf24; }
      100% { transform: scale(1); background-color: inherit; }
    }
    
    .live-controls {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
      border-radius: 8px;
      margin-bottom: 10px;
    }
    .live-controls .live-status {
      display: flex;
      align-items: center;
      gap: 6px;
      color: white;
      font-size: 0.75rem;
    }
    .live-controls .live-fonte {
      color: #94a3b8;
      font-size: 0.65rem;
    }
    .live-controls .btn-refresh {
      margin-left: auto;
      background: #3b82f6;
      color: white;
      border: none;
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 0.7rem;
      cursor: pointer;
      transition: background 0.2s;
    }
    .live-controls .btn-refresh:hover {
      background: #2563eb;
    }
    .live-controls .btn-refresh:disabled {
      background: #64748b;
      cursor: not-allowed;
    }
    
    .fonte-badge {
      display: inline-flex;
      align-items: center;
      padding: 2px 6px;
      border-radius: 3px;
      font-size: 0.6rem;
      font-weight: 600;
    }
    .fonte-fantacalcio { background: #dbeafe; color: #1d4ed8; }
    .fonte-gazzetta { background: #fce7f3; color: #be185d; }
    .fonte-official { background: #dcfce7; color: #166534; }
    /* ========== END VOTI LIVE STYLES ========== */

	<%select case request.QueryString("fonte")
	Case 0
	colorifonte = "background:#f1f5f9; color:#1e293b;"

	Case 2
	colorifonte = "background:#cffafe; color:#0891b2;"
		Case 1
	colorifonte = "background:#fce7f3; color:#be185d;"
	Case else 
		colorifonte = "background:#f1f5f9; color:#1e293b;"
	end Select
	
	%>
    .voto-g{ min-width:20px; height:16px; font-size:0.58rem; background:#fce7f3; color:#be185d; }
    .voto-fg{ min-width:20px; height:16px; font-size:0.58rem; background:#cffafe; color:#0891b2; }

    .punti-pos{ background:#dcfce7; color:#166534; }
    .punti-neg{ background:#fee2e2; color:#991b1b; }
    .punti-zero{ background:#e2e8f0; color:#334155; } /* così non sembra “mancante” */

    .empty{ color:transparent; background:transparent !important; border:none !important; min-width:0 !important; }

    .formation-side.left  .player-row:not(.bench-separator){
      grid-template-columns:22px 14px 1fr 20px 20px 28px 44px;
    }
    .formation-side.right .player-row:not(.bench-separator){
      grid-template-columns:44px 28px 20px 20px 1fr 14px 22px;
    }

    .sa-logo{
      width:14px;
      height:14px;
      object-fit:contain;
    }

    .player-row.bench-separator{
      display:flex;
      justify-content:center;
      align-items:center;
      padding:5px 0;
      background:rgba(255,204,51,1);
      border:none;
      border-radius:6px;
      margin:0.45rem 0 0.35rem 0;
      opacity:1;
    }

    /* MOBILE: formazioni una sotto l'altra, ENTRAMBE con stesso ordine */
    @media (max-width: 768px){
      /* Formazioni una sotto l'altra */
      .formations-container{
        grid-template-columns:1fr !important;
        gap:0.8rem;
      }
      
      /* Entrambe le colonne allineate a sinistra */
      .formation-side.left .player-name,
      .formation-side.right .player-name{ 
        text-align:left !important; 
      }
      
      /* Bordo verde sempre a sinistra */
      .formation-side.left .player-row.active,
      .formation-side.right .player-row.active{ 
        border-left:3px solid #22c55e !important; 
        border-right:none !important; 
      }
      
      /* Stessa griglia per ENTRAMBE (7 colonne) */
      .formation-side.left .player-row:not(.bench-separator),
      .formation-side.right .player-row:not(.bench-separator){
        grid-template-columns:20px 14px 1fr 20px 20px 26px 36px !important;
      }
      
      /* RIORDINA gli elementi della colonna destra usando CSS order */
      .formation-side.right .player-row .o1 { order: 1 !important; }
      .formation-side.right .player-row .o2 { order: 2 !important; }
      .formation-side.right .player-row .o3 { order: 3 !important; }
      .formation-side.right .player-row .o4 { order: 4 !important; }
      .formation-side.right .player-row .o5 { order: 5 !important; }
      .formation-side.right .player-row .o6 { order: 6 !important; }
      .formation-side.right .player-row .o7 { order: 7 !important; }
      
      .match-card{ padding:0.5rem; }
      .formation-side{ padding:0.4rem; }
      .formation-header{ padding:0.25rem; font-size:0.8rem; }

      .player-row{
        padding:0.15rem 0.25rem;
        font-size:0.72rem;
        column-gap:3px;
      }

      .role-badge{ width:20px; height:20px; font-size:0.65rem; }
      .voto-badge{ min-width:18px; height:16px; font-size:0.54rem; }
      .voto-media{ min-width:24px; height:17px; font-size:0.58rem; }
      .voto-g, .voto-fg{ min-width:18px; height:15px; font-size:0.52rem; }
      .sa-logo{ width:12px; height:12px; }
      .player-name{ font-size:0.7rem; }
      
      .team-logo-vs{ width:36px; height:36px; }
      .vs-text{ font-size:1.3rem; }
      .team-name{ font-size:0.85rem; }
    }

    /* BADGE LEGA */
    .lega-badge{
      display:inline-block;
      padding:0.25rem 0.6rem;
      border-radius:6px;
      font-size:0.8rem;
      font-weight:700;
      margin-right:0.5rem;
    }
/* Badge lega dentro intestazione sidebar (mini) */
.lega-badge-mini{
  font-size:0.72rem;
  padding:0.10rem 0.45rem;
  border-radius: 5px;
  margin-left:0.45rem;
  margin-right:0;            /* override del tuo margin-right */
  vertical-align:middle;
  border:1px solid rgba(255,255,255,.25);
  box-shadow:none;
}

    .download-box{ background:#f8fafc; border:1px solid #e6ebf2; }

    /* SEZIONE CALCOLI DETTAGLIATI */
    .calcoli-container{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:0.5rem;
      margin-top:0.5rem;
    }
    /* ========== STILI BLU PER VOTI JSON ========== */
    .calcoli-box{
      background:linear-gradient(135deg, #e8f4fc 0%, #d1e8f8 100%);
      border:1px solid #5196db;
      border-radius:6px;
      padding:0.5rem 0.6rem;
      font-size:0.72rem;
    }
    .calcoli-box.right{
      background:linear-gradient(135deg, #f0f7fc 0%, #e0eef8 100%);
    }
    .calcoli-header{
      font-weight:700;
      color:#205b97;
      margin-bottom:0.3rem;
      font-size:0.75rem;
      border-bottom:1px solid #72aae1;
      padding-bottom:0.2rem;
    }
    .calcoli-row{
      display:flex;
      justify-content:space-between;
      padding:0.1rem 0;
      color:#2c5282;
    }
    .calcoli-row .label{ }
    .calcoli-row .value{ font-weight:600; }
    .calcoli-row.highlight{
      background:#b3d1ef;
      margin:0.2rem -0.3rem;
      padding:0.2rem 0.3rem;
      border-radius:3px;
    }
    .calcoli-row.total{
      font-weight:700;
      font-size:0.8rem;
      color:#1a365d;
      border-top:1px solid #72aae1;
      margin-top:0.3rem;
      padding-top:0.3rem;
    }
    
    /* RISULTATO GRANDE - BLU */
    .result-container{
      display:flex;
      justify-content:center;
      align-items:center;
      gap:1rem;
      background:linear-gradient(135deg, #3182d4 0%, #5196db 100%);
      border-radius:8px;
      padding:0.6rem 1rem;
      margin-top:0.5rem;
    }
    .result-score{
      font-size:2rem;
      font-weight:900;
      color:#ffffff;
      text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .result-totals{
      font-size:0.85rem;
      font-weight:600;
      color:#e8f4fc;
      text-align:center;
      background: rgba(255,255,255,0.2);
      padding: 4px 8px;
      border-radius: 4px;
    }
    
    /* BEST11 SQUADRE */
    .best11-container{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:0.5rem;
      margin-top:0.5rem;
    }
    .best11-box{
      background:linear-gradient(135deg, #ffffcc 0%, #ffffee 100%);
      border:1px solid #e6d600;
      border-radius:6px;
      padding:0.4rem 0.5rem;
      font-size:0.68rem;
      overflow:hidden;
    }
    .best11-header{
      font-weight:700;
      color:#665c00;
      margin-bottom:0.2rem;
      font-size:0.7rem;
    }
    .best11-form{
      font-size:0.55rem;
      color:#666;
      font-style:italic;
      word-wrap:break-word;
      overflow-wrap:break-word;
      line-height:1.3;
      margin-bottom:0.2rem;
      max-height:2.6em;
      overflow:hidden;
    }
    .best11-stats{
      display:flex;
      justify-content:space-between;
      font-size:0.62rem;
      color:#665c00;
      border-top:1px solid #e6d600;
      padding-top:0.2rem;
      margin-top:0.2rem;
    }
    
    /* SUPPLEMENTARI E RIGORI */
    .suppl-container{
      margin-top:0.5rem;
      border:2px solid #f59e0b;
      border-radius:8px;
      background:linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
      padding:0.5rem;
    }
    .suppl-header{
      text-align:center;
      font-weight:700;
      color:#92400e;
      font-size:0.75rem;
      margin-bottom:0.4rem;
      border-bottom:1px solid #fbbf24;
      padding-bottom:0.3rem;
    }
    .suppl-players{
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:0.4rem;
      margin-bottom:0.4rem;
    }
    .suppl-player{
      background:#fef08a;
      border:1px solid #fbbf24;
      border-radius:4px;
      padding:0.2rem 0.4rem;
      font-size:0.65rem;
      display:flex;
      justify-content:space-between;
      align-items:center;
    }
    .suppl-player.right{
      text-align:right;
      flex-direction:row-reverse;
    }
    .suppl-result{
      text-align:center;
      font-weight:700;
      background:#fbbf24;
      border-radius:4px;
      padding:0.3rem;
      font-size:0.8rem;
      color:#78350f;
    }
    .rigori-container{
      margin-top:0.3rem;
      border-top:1px dashed #fbbf24;
      padding-top:0.3rem;
    }
    .rigori-header{
      text-align:center;
      font-weight:700;
      color:#dc2626;
      font-size:0.7rem;
      margin-bottom:0.3rem;
    }
    .rigori-row{
      display:grid;
      grid-template-columns:1fr auto 1fr;
      gap:0.3rem;
      font-size:0.6rem;
      margin-bottom:0.15rem;
      align-items:center;
    }
    .rigori-row .left{ text-align:right; }
    .rigori-row .right{ text-align:left; }
    .rigori-row .center{ text-align:center; font-weight:700; }
    .rig-gol{ color:#16a34a; }
    .rig-sbagliato{ color:#dc2626; }
    .rig-sv{ color:#9ca3af; }
    
    @media (max-width: 768px){
      .calcoli-container{
        grid-template-columns:1fr;
      }
      .best11-container{
        grid-template-columns:1fr;
      }
      .suppl-players{
        grid-template-columns:1fr;
      }
    }


    .pos-badge{
      width:18px;
      height:18px;
      border-radius:50%;
      background:#345678;
      color:#fff;
      font-size:0.65rem;
      font-weight:700;
      display:flex;
      align-items:center;
      justify-content:center;
      flex-shrink:0;
    }
    .nome-gioc{
      flex:1;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      font-weight:600;
    }


.lega-badge-mini{
  vertical-align:middle;
  line-height:1;
  position:relative;
  top:-1px;   /* prova -1px, se esagerato torna a 0 o -0.5px */
}
    /* bottone aggiornamento */
.agg-dot{
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}
.agg-dot.ok{ background:#B4E197; }   /* verde */
.agg-dot.ko{ background:#FFCCCC; }   /* rosso */

.aggform-status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:.9rem;
  white-space:nowrap;
}
.calcoli-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.modulo-txt{
  font-weight:700;
}

/* status piccolo e allineato a destra */
.calcoli-header .aggform-status{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:.75rem;         /* molto più piccolo */
  line-height:1;
  white-space:nowrap;       /* resta sulla stessa linea */
  opacity:.95;
}

.calcoli-header .aggform-status .bi{
  font-size:.9rem;          /* icona leggermente più grande del testo */
  line-height:1;
}

.calcoli-header .aggform-date{
  font-weight:600;
}

/* pallino più piccolo, sempre inline */
.calcoli-header .aggform-status .agg-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  display:inline-block;
  vertical-align:middle;
}


  
 
  /* =========================================================
   PROGRAMMA PARTITE (quando la scadenza non è ancora scaduta)
   ========================================================= */
.programma-giornata-card{border:1px solid #e6ebf2;border-radius:14px;background:#f7fbff}
.programma-giornata-card .card-header{
  background:#234567;color:#fff;border-bottom:1px solid rgba(255,255,255,.15);
  border-radius:14px 14px 0 0
}
.programma-giornata{padding:10px}

.programma-giornata .match-item{
  border:1px solid #e6ebf2;
  border-radius:.8rem;
  background:#fff;
  padding:.6rem .7rem;
  margin-bottom:.55rem;
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:.6rem;
}
.programma-giornata .match-team{display:flex;align-items:center;gap:.5rem;min-width:0}
.programma-giornata .match-team.left{justify-content:flex-start}
.programma-giornata .match-team.right{justify-content:flex-end}
.programma-giornata .match-team .logo{height:26px;width:26px}
.programma-giornata .match-team span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}

.programma-giornata .match-score{
  font-weight:700;
  padding:.15rem .6rem;
  border-radius:.5rem;
  background:#f1f5fb;
  min-width:70px;
  text-align:center;
  justify-self:center;
}
.programma-giornata .match-vs{opacity:.7;font-weight:700}

/* =========================================================
   VOTI LIVE - Stati partita e bottoni +/- 0.25
   ========================================================= */
/* Badge stato partita */
.stato-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
}
.stato-pending { background: #f1f5f9; color: #64748b; }
.stato-live { 
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); 
  color: white;
  animation: pulse-live 2s infinite;
}
.stato-finished { background: #dcfce7; color: #166534; }

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* Voto pending (partita non iniziata) */
.voto-pending { opacity: 0.5; background: #e2e8f0 !important; color: #64748b !important; }

/* Voto live (partita in corso) */
.voto-live { 
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
  animation: pulse-voto 2s infinite;
}

/* Voto provvisorio (conclusa ma senza Gazzetta) */
.voto-provisional { background: #dbeafe !important; color: #1e40af !important; }

/* Voto ufficiale (Gazzetta) */
.voto-official { background: #dcfce7 !important; color: #166534 !important; }

@keyframes pulse-voto {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0); }
}

/* Bottoni +/- 0.25 */
.voto-adjust-btns {
  display: inline-flex;
  gap: 2px;
  margin-left: 3px;
  vertical-align: middle;
}
.btn-voto-minus, .btn-voto-plus {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 2px;
  font-size: 9px;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}
.btn-voto-minus { background: #fee2e2; color: #dc2626; }
.btn-voto-minus:hover { background: #fecaca; }
.btn-voto-plus { background: #dcfce7; color: #16a34a; }
.btn-voto-plus:hover { background: #bbf7d0; }

/* Indicatore fonte voto */
.fonte-indicator {
  font-size: 0.45rem;
  padding: 1px 2px;
  border-radius: 2px;
  margin-left: 1px;
  vertical-align: super;
}
.fonte-fc { background: #dbeafe; color: #1d4ed8; }
.fonte-gz { background: #fce7f3; color: #be185d; }
.fonte-live { background: #fef3c7; color: #d97706; }

/* Data partita nel box SerieA */
.match-datetime {
  font-size: 0.65rem;
  color: #64748b;
  text-align: center;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}
.match-datetime .match-date {
  font-weight: 500;
}
.match-datetime .match-time {
  font-weight: 600;
  color: #334155;
}
.match-datetime.live {
  color: #dc2626;
  font-weight: 600;
}
/* Risultato partita */
.match-risultato {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}
.match-risultato.live {
  color: #dc2626;
  animation: pulse-live 1.5s ease-in-out infinite;
}
.match-risultato.final {
  color: #166534;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 4px;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Riga giocatore con voto modificato */
.player-row.voto-adjusted .voto-badge {
  border: 2px solid #f59e0b !important;
}


.br-table { width:100%; border-collapse:collapse; font-size:0.6rem; }
.br-table th, .br-table td { padding:1px 2px; text-align:center; border:1px solid #e2e8f0; }
.br-table th { background:#f8fafc; color:#475569; font-size:0.55rem; font-weight:600; }
.br-table .br-logo { width:16px; height:16px; object-fit:contain; }
.br-table .br-logo-sm { width:12px; height:12px; object-fit:contain; }
.br-table .br-pts { font-weight:700; font-size:0.65rem; }
.br-table .br-vnp { min-width:18px; }
.br-table .br-badge { 
  display:inline-flex; align-items:center; justify-content:center;
  min-width:14px; height:14px; border-radius:3px; 
  font-weight:700; font-size:0.55rem; color:#fff;
}
.br-table .br-oggi {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:14px; height:14px; border-radius:3px; 
  font-weight:700; font-size:0.5rem; color:#fff;
  background:#345678;
}
.br-table .br-res { font-size:0.5rem; font-weight:600; }
.br-table .br-diag { color:#d1d5db; font-size:0.6rem; }
.br-table .br-row:hover { background:#f1f5f9; }
.br-icon-v { color:#22c55e; font-size:0.65rem; }
.br-icon-n { color:#9ca3af; font-size:0.65rem; }
.br-icon-p { color:#ef4444; font-size:0.65rem; }


/* Animazione aggiornamento voto */
@keyframes voto-update {
  0% { background-color: #fef3c7; transform: scale(1); }
  50% { background-color: #fde047; transform: scale(1.1); }
  100% { background-color: #fef3c7; transform: scale(1); }
}
.voto-badge.voto-adjusted {
  border: 2px solid #f59e0b !important;
}


/* ============================================================
   VARIANTE EXCEL (colori giallo/arancio)
   Usare classe .fonte-excel sul container principale
   ============================================================ */
.fonte-excel .calcoli-box{
  background:linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border:1px solid #f59e0b;
}
.fonte-excel .calcoli-box.right{
  background:linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}
.fonte-excel .calcoli-header{
  color:#92400e;
  border-bottom:1px solid #fbbf24;
}
.fonte-excel .calcoli-row{
  color:#78350f;
}
.fonte-excel .calcoli-row.highlight{
  background:#fef08a;
}
.fonte-excel .calcoli-row.total{
  color:#78350f;
  border-top:1px solid #fbbf24;
}
.fonte-excel .result-container{
  background:linear-gradient(135deg, #ff9900 0%, #ffcc00 100%);
}
.fonte-excel .best11-box{
  background:linear-gradient(135deg, #ffffcc 0%, #ffffee 100%);
  border:1px solid #e6d600;
}
.fonte-excel .best11-header{
  color:#665c00;
}
.fonte-excel .best11-stats{
  color:#665c00;
}

/* ============================================================
   VARIANTE JSON (colori blu/azzurro) - DEFAULT
   ============================================================ */
/* Già definiti sopra come default */


/* Classe esplicita fonte-json (identica ai default blu) */
.fonte-json .calcoli-box{
  background:linear-gradient(135deg, #e8f4fc 0%, #d1e8f8 100%);
  border:1px solid #5196db;
}
.fonte-json .calcoli-header{
  color:#205b97;
  border-bottom:1px solid #72aae1;
}
.fonte-json .calcoli-row{
  color:#2c5282;
}
.fonte-json .result-container{
  background:linear-gradient(135deg, #3182d4 0%, #5196db 100%);
}


/* ============================================================
   BATTLE ROYALE TABLE (partite_excel)
   ============================================================ */
.br-table { width:100%; border-collapse:collapse; font-size:0.6rem; }
.br-table th, .br-table td { padding:1px 2px; text-align:center; border:1px solid #e2e8f0; }
.br-table th { background:#f8fafc; color:#475569; font-size:0.55rem; font-weight:600; }
.br-table .br-logo { width:16px; height:16px; object-fit:contain; }
.br-table .br-logo-sm { width:12px; height:12px; object-fit:contain; }
.br-table .br-pts { font-weight:700; font-size:0.65rem; }
.br-table .br-vnp { min-width:18px; }
.br-table .br-badge { 
  display:inline-flex; align-items:center; justify-content:center;
  min-width:14px; height:14px; border-radius:3px; 
  font-weight:700; font-size:0.55rem; color:#fff;
}
.br-table .br-oggi {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:14px; height:14px; border-radius:3px; 
  font-weight:700; font-size:0.5rem; color:#fff;
  background:#345678;
}
.br-table .br-res { font-size:0.5rem; font-weight:600; }
.br-table .br-diag { color:#d1d5db; font-size:0.6rem; }
.br-table .br-row:hover { background:#f1f5f9; }
.br-icon-v { color:#22c55e; font-size:0.65rem; }
.br-icon-n { color:#9ca3af; font-size:0.65rem; }
.br-icon-p { color:#ef4444; font-size:0.65rem; }

/* ============================================================
   SIDEBAR (Best11, Classifiche, Marcatori)
   ============================================================ */
.sidebar-card{
  background:#fff;
  border-radius:8px;
  box-shadow:0 2px 8px rgba(2,8,23,.08);
  border:1px solid rgba(52,86,120,.12);
  overflow:hidden;
}
.sidebar-header{
  background:linear-gradient(135deg, #345678 0%, #456789 100%);
  color:#fff;
  padding:0.5rem 0.75rem;
  font-size:0.8rem;
  font-weight:700;
}
.sidebar-body{
  padding:0.4rem;
  max-height:300px;
  overflow-y:auto;
}
.classifica-row{
  display:flex;
  align-items:center;
  gap:5px;
  padding:0.25rem 0.3rem;
  border-bottom:1px solid #f0f4f8;
  font-size:0.75rem;
}
.classifica-row:last-child{ border-bottom:none; }
.classifica-row:hover{ background:#f8fafc; }

.pos-badge{
  width:18px;
  height:18px;
  border-radius:50%;
  background:#345678;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0.6rem;
  font-weight:700;
}

