/* Andamento della partita punto per punto (Views/Calendario/Andamento.cshtml): casa in blu, ospite in oro,
   gli stessi colori del sito. */
.and-testata {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .25rem 1rem;
  padding: 1rem;
  border-radius: .5rem;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary) 40%, var(--brand-gold) 60%, var(--brand-gold) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.and-squadra {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
}

.and-squadra-casa { color: #fff; }

.and-squadra-ospite {
  color: var(--brand-primary);
  text-align: right;
}

.and-risultato {
  font-size: 2rem;
  font-weight: 800;
  background: #fff;
  color: var(--brand-primary);
  border-radius: .5rem;
  padding: .1rem .9rem;
  white-space: nowrap;
}

.and-trattino { margin: 0 .35rem; }

.and-info,
.and-parziali {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
  font-size: .875rem;
}

.and-info {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

.and-parziale {
  background: rgba(255, 255, 255, .9);
  color: var(--brand-primary);
  border-radius: 1rem;
  padding: 0 .6rem;
  font-weight: 600;
}

.and-legenda {
  display: inline-block;
  width: .9rem;
  height: .9rem;
  border-radius: .2rem;
  vertical-align: -.1rem;
}

.and-legenda-casa { background: var(--brand-primary); }
.and-legenda-ospite { background: var(--brand-gold); }
.and-testo-casa { color: var(--brand-primary); }
.and-testo-ospite { color: #b07a10; }

.and-set { border-color: #dee2e6; }

.and-set-testa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f2f8;
}

.and-set-punti { font-size: 1.1rem; }
.and-vince { font-weight: 800; }

.and-grafico {
  display: block;
  width: 100%;
  height: auto;
  background: #fafafa;
  border-radius: .35rem;
  margin-bottom: .25rem;
}

.and-area-casa { fill: var(--brand-primary); fill-opacity: .8; }
.and-area-ospite { fill: var(--brand-gold); fill-opacity: .9; }
.and-asse { stroke: #6c757d; stroke-width: .6; }
.and-linea { fill: none; stroke: #212529; stroke-width: 1; stroke-linejoin: round; }
.and-to-casa,
.and-to-ospite { stroke-width: 1; stroke-dasharray: 3 2; }
.and-to-casa { stroke: var(--brand-primary); }
.and-to-ospite { stroke: #b07a10; }
.and-to-testo { font-size: 9px; font-weight: 700; text-anchor: middle; fill: #dc3545; }
.and-scala { font-size: 7px; fill: #6c757d; }

.and-tabella {
  table-layout: fixed;
  text-align: center;
}

.and-tabella th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
}

.and-tabella .and-th-casa { background: var(--brand-primary); color: #fff; }
.and-tabella .and-th-ospite { background: var(--brand-gold); color: var(--brand-primary); }

.and-tabella td {
  padding: .1rem;
  border: 0;
}

.and-punto {
  display: inline-block;
  min-width: 2rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.35;
}

.and-punto-casa { background: var(--brand-primary); color: #fff; }
.and-punto-ospite { background: var(--brand-gold); color: var(--brand-primary); }

.and-riga-timeout td {
  font-size: .8rem;
  font-weight: 600;
  padding: .15rem .25rem;
}

.and-timeout-casa {
  background: rgba(42, 43, 103, .12);
  color: var(--brand-primary);
  text-align: left;
  border-left: 4px solid var(--brand-primary) !important;
}

.and-timeout-ospite {
  background: rgba(251, 182, 50, .2);
  color: #7a5408;
  text-align: right;
  border-right: 4px solid var(--brand-gold) !important;
}

@media (max-width: 575.98px) {
  .and-squadra { font-size: .95rem; }
  .and-risultato { font-size: 1.5rem; padding: .1rem .6rem; }
}

/* "Scarica PDF" (window.print): solo la partita, 3 set per riga, colori conservati, elenco punti compatto. */
@media print {
  @page { size: A4 portrait; margin: 10mm; }

  header,
  footer,
  #cookie-banner { display: none !important; }

  body { margin: 0 !important; }
  main { padding-bottom: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .and-testata { box-shadow: none; padding: .5rem; }
  .and-col {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }
  .and-set { break-inside: avoid; }
  .and-set .card-body { padding: .25rem !important; }
  .and-tabella th { font-size: .65rem; padding: .1rem; }
  .and-tabella td { padding: 0 0 1px; font-size: .6rem; line-height: 1; }
  .and-punto { font-size: .6rem; line-height: 1.1; min-width: 1.4rem; }
  .and-riga-timeout td { font-size: .6rem; padding: 0 .2rem 1px; }
}
