/* =============================================
   ASD Colombaro U14
   Impostazione grafica in linea con Apple:
   molta aria, angoli morbidi, separatori al posto dei bordi,
   grigi freddi, nessun maiuscoletto spaziato.
   ============================================= */

@import url('fonts.css');

:root {
  /* Su Mac e iPhone questo stack usa il carattere di sistema (SF Pro).
     Altrove ripiega su Inter, che e' il piu' vicino. */
  --ff: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
        "Helvetica Neue", "Inter", "Segoe UI", Roboto, sans-serif;

  /* Fondi */
  --sfondo:      #F5F5F7;
  --scheda:      #FFFFFF;
  --velo-grigio: rgba(118,118,128,.12);

  /* Testo */
  --testo:       #1D1D1F;
  --testo-2:     #6E6E73;
  --testo-3:     #8E8E93;

  /* Separatori */
  --sep:         rgba(60,60,67,.14);
  --sep-forte:   rgba(60,60,67,.24);

  /* Societa' */
  --arancio:     #F0922B;
  --arancio-cupo:#D97D14;

  /* Ruoli */
  --por:         #C8890B;
  --dif:         #0A72E8;
  --cen:         #1D9A54;
  --att:         #E0453C;

  --rosso:       #D70015;
  --ambra:       #B25000;
  --infortunio:  #7B5BD6;

  /* Le righe della griglia del tabellone: devono vedersi, ma restare
     dietro ai dati. Piu' chiare dei separatori normali. */
  --reticolo:    rgba(60,60,67,.14);

  --r-scheda:    18px;
  --r-campo:     12px;

  --ombra:       0 1px 3px rgba(0,0,0,.04), 0 6px 22px rgba(0,0,0,.05);
  --ombra-alta:  0 12px 48px rgba(0,0,0,.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--ff);
  background: var(--sfondo);
  color: var(--testo);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
  font-family: inherit; font-size: inherit; color: inherit; letter-spacing: inherit;
}

[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }


/* =============================================
   ACCESSO
   ============================================= */

.accesso {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background: var(--sfondo);
}

.accesso__scheda {
  width: 100%;
  max-width: 380px;
  background: var(--scheda);
  border-radius: 22px;
  box-shadow: var(--ombra);
  padding: 40px 34px 34px;
  text-align: center;
}

.accesso__stemma { width: 68px; height: auto; margin-bottom: 20px; }

.accesso__nome {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.15;
}

.accesso__squadra {
  font-size: 14px;
  color: var(--testo-2);
  margin: 2px 0 30px;
}

.accesso__form { display: grid; gap: 12px; text-align: left; }


/* =============================================
   CAMPI
   ============================================= */

.campo { display: grid; gap: 6px; }

.campo__nome {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--testo-2);
  padding-left: 2px;
}

input[type="text"], input[type="password"], input[type="date"],
input[type="time"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  /* Stessa altezza per tutti: data e ora hanno un'impaginazione
     propria del browser e senza questo restano più basse. */
  min-height: 40px;
  padding: 9px 12px;
  background: var(--scheda);
  border: 1px solid var(--sep-forte);
  border-radius: var(--r-campo);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--arancio);
  box-shadow: 0 0 0 3.5px rgba(240,146,43,.22);
}

input::placeholder, textarea::placeholder { color: var(--testo-3); }

textarea { resize: vertical; min-height: 68px; line-height: 1.45; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236E6E73' d='M1 2 6 7l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 11px;
  padding-right: 34px;
}


/* =============================================
   PULSANTI
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s, color .18s, opacity .18s;
}

.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn--pieno { background: var(--arancio); color: #fff; }
.btn--pieno:hover:not(:disabled) { background: var(--arancio-cupo); }

.btn--vuoto { background: var(--velo-grigio); color: var(--testo); }
.btn--vuoto:hover:not(:disabled) { background: rgba(118,118,128,.20); }

.btn--nudo { background: transparent; color: var(--arancio-cupo); padding: 8px 10px; }
.btn--nudo:hover:not(:disabled) { opacity: .65; }

.btn--rosso { background: transparent; color: var(--rosso); }
.btn--rosso:hover:not(:disabled) { background: rgba(215,0,21,.08); }

.btn--largo { width: 100%; padding: 10px 18px; }
.btn--mini  { padding: 7px 15px; font-size: 14px; }


/* =============================================
   MESSAGGI
   ============================================= */

.msg { padding: 11px 14px; border-radius: var(--r-campo); font-size: 14px; }
.msg--rosso { background: rgba(215,0,21,.08); color: var(--rosso); }


/* =============================================
   TESTATA
   ============================================= */

.testata {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep);
}

.testata__riga {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.testata__stemma { width: 32px; height: auto; flex-shrink: 0; }
.testata__nomi { flex: 1; min-width: 0; }

.testata__societa {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.2;
}

.testata__squadra { font-size: 12px; color: var(--testo-2); line-height: 1.2; }
.testata__utente { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.testata__chi { font-size: 13px; color: var(--testo-2); }

.menu { border-top: 1px solid var(--sep); }
.menu__riga { max-width: 1100px; margin: 0 auto; padding: 0 22px; display: flex; gap: 22px; }

.menu__voce {
  padding: 11px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--testo-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}

.menu__voce:hover { color: var(--testo); }
.menu__voce[aria-current="page"] { color: var(--testo); border-bottom-color: var(--arancio); }


/* =============================================
   IMPIANTO
   ============================================= */

.contenuto { max-width: 1100px; margin: 0 auto; padding: 26px 22px 60px; }

.titolo-pagina {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 3px;
}

.sottotitolo-pagina { font-size: 14px; color: var(--testo-2); }

.pagina__testa {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.scheda {
  background: var(--scheda);
  border-radius: var(--r-scheda);
  box-shadow: var(--ombra);
  overflow: hidden;
  margin-bottom: 18px;
}

/* Intestazione di una scheda: titolo a sinistra, azioni a destra.
   Senza queste regole il testo finisce a filo dell'angolo arrotondato. */
.scheda__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--sep);
}

.scheda__titolo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.scheda__titolo span {
  font-weight: 400;
  color: var(--testo-3);
  font-variant-numeric: tabular-nums;
}

.scheda__corpo { padding: 16px 18px; }


/* =============================================
   RIQUADRI DATI
   ============================================= */

.dati {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dato {
  background: var(--scheda);
  border-radius: var(--r-scheda);
  box-shadow: var(--ombra);
  padding: 14px 16px;
}

.dato__valore {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.dato__valore--allerta { color: var(--ambra); }
.dato__nome { font-size: 13px; font-weight: 500; margin-top: 4px; }
.dato__extra { font-size: 12px; color: var(--testo-2); margin-top: 1px; }

.dato__punto {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}
.dato__punto--por { background: var(--por); }
.dato__punto--dif { background: var(--dif); }
.dato__punto--cen { background: var(--cen); }
.dato__punto--att { background: var(--att); }


/* =============================================
   BARRA DEGLI STRUMENTI
   ============================================= */

.strumenti {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Controllo segmentato, come quello di iOS */
.segmenti {
  display: inline-flex;
  background: var(--velo-grigio);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}

.segmenti button {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--testo);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .18s, box-shadow .18s;
}

.segmenti button[aria-pressed="true"] {
  background: var(--scheda);
  box-shadow: 0 3px 8px rgba(0,0,0,.10), 0 1px 1px rgba(0,0,0,.04);
}

.cerca { position: relative; flex: 1; min-width: 190px; max-width: 300px; }

.cerca input {
  padding: 7px 13px 7px 32px;
  background: var(--velo-grigio);
  border: none;
  border-radius: 10px;
  font-size: 14px;
}

.cerca input:focus { box-shadow: 0 0 0 3.5px rgba(240,146,43,.22); }

.cerca__lente {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--testo-3); pointer-events: none; display: flex;
}


/* =============================================
   ELENCO GIOCATORI
   Righe con separatore rientrato, come le liste iOS.
   ============================================= */

.elenco { display: flex; flex-direction: column; }

/* Quando la lista è divisa per reparti, il contenitore esterno sparisce:
   ogni reparto porta la propria scheda. */
.scheda--trasparente { background: none; box-shadow: none; border-radius: 0; overflow: visible; }

/* Un reparto = un titolo fuori + una scheda con dentro le righe.
   È l'impostazione "inset grouped" di iOS: si arrotonda il contenitore,
   mai le fasce interne. */

.reparto { margin-bottom: 16px; }
.reparto:last-child { margin-bottom: 0; }

.reparto__titolo {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--tinta, var(--testo-2));
}

.reparto__punto {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--tinta, var(--testo-3));
  flex-shrink: 0;
}

.reparto__conta {
  margin-left: auto;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--testo-3);
}

.reparto--por { --tinta: var(--por); }
.reparto--dif { --tinta: var(--dif); }
.reparto--cen { --tinta: var(--cen); }
.reparto--att { --tinta: var(--att); }

/* La scheda del reparto: qui sì gli angoli morbidi */
.reparto__scheda {
  background: var(--scheda);
  border-radius: var(--r-scheda);
  box-shadow: var(--ombra);
  overflow: hidden;
}

.riga {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background-color .12s;
}

/* Il separatore parte dopo il numero di maglia, non da bordo a bordo */
.riga::after {
  content: '';
  position: absolute;
  left: 64px; right: 0; bottom: 0;
  height: 1px;
  background: var(--sep);
}

.riga:last-child::after { display: none; }

.riga:hover { background: rgba(0,0,0,.022); }
.riga--spenta { opacity: .45; }

.maglia {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--testo);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.maglia--vuota { background: var(--velo-grigio); color: var(--testo-3); font-weight: 400; }

.riga__dati { flex: 1; min-width: 0; }

.riga__nome {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.015em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.riga__sotto { font-size: 13px; color: var(--testo-2); margin-top: 1px; }
.riga__coda { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.freccia { color: var(--testo-3); display: flex; flex-shrink: 0; }


/* =============================================
   VISTA TABELLA
   Stessa impostazione della lista, ma a colonne.
   ============================================= */

.tabella-scorre { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }

th, td { padding: 9px 14px; text-align: left; white-space: nowrap; }

th {
  font-size: 12px;
  font-weight: 500;
  color: var(--testo-2);
  border-bottom: 1px solid var(--sep);
  position: sticky;
  top: 0;
  background: var(--scheda);
  z-index: 1;
}

td { font-size: 13.5px; border-bottom: 1px solid var(--sep); }

tbody tr { cursor: pointer; transition: background-color .12s; }
tbody tr:hover { background: rgba(0,0,0,.022); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.riga--spenta { opacity: .45; }

th.stretta, td.stretta { width: 1%; }
td.destra, th.destra { text-align: right; }

.td-nome { font-weight: 500; font-size: 14px; letter-spacing: -.012em; }

/* Numero di maglia in tabella: piu' piccolo che nella lista */
.maglia--tab { width: 26px; height: 26px; font-size: 12px; }

/* La colonna del nome resta ferma mentre si scorre in orizzontale */
@media (max-width: 760px) {
  th, td { padding: 8px 10px; }
  .tabella-fissa td:first-child,
  .tabella-fissa th:first-child {
    position: sticky; left: 0; z-index: 2; background: var(--scheda);
  }
  .tabella-fissa tr:hover td:first-child { background: #FAFAFA; }
}

/* Selettore lista/tabella */
.vista { display: inline-flex; gap: 2px; background: var(--velo-grigio); border-radius: 10px; padding: 2px; }

.vista button {
  display: grid;
  place-items: center;
  width: 32px; height: 27px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--testo-2);
  cursor: pointer;
  transition: background-color .18s, box-shadow .18s, color .18s;
}

.vista button[aria-pressed="true"] {
  background: var(--scheda);
  color: var(--testo);
  box-shadow: 0 3px 8px rgba(0,0,0,.10), 0 1px 1px rgba(0,0,0,.04);
}


/* =============================================
   ETICHETTE
   ============================================= */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--testo-2);
}

.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.tag--por { color: var(--por); }
.tag--dif { color: var(--dif); }
.tag--cen { color: var(--cen); }
.tag--att { color: var(--att); }

.pillola {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 500;
}

.pillola--prova  { background: rgba(10,114,232,.10); color: var(--dif); }
.pillola--fermo  { background: rgba(178,80,0,.10);   color: var(--ambra); }
.pillola--uscito { background: var(--velo-grigio);   color: var(--testo-2); }


/* =============================================
   STATI DI PASSAGGIO
   ============================================= */

.vuoto { padding: 60px 24px; text-align: center; }
.vuoto__titolo { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.vuoto__testo { font-size: 14px; color: var(--testo-2); margin: 4px 0 22px; }

.attesa { padding: 56px; text-align: center; color: var(--testo-2); font-size: 14px; }

.rotella {
  width: 22px; height: 22px; margin: 0 auto 12px;
  border: 2px solid var(--sep-forte);
  border-top-color: var(--arancio);
  border-radius: 50%;
  animation: gira .7s linear infinite;
}

@keyframes gira { to { transform: rotate(360deg); } }


/* =============================================
   PANNELLO LATERALE (drawer)
   Entra da destra sul computer, dal basso sul telefono.
   ============================================= */

.velo {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  animation: sfuma .2s ease-out;
}

@keyframes sfuma { from { opacity: 0 } to { opacity: 1 } }

.pannello {
  width: 100%;
  max-width: 460px;
  height: 100%;
  max-height: 100%;
  background: var(--sfondo);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 48px rgba(0,0,0,.18);
  animation: entra-da-destra .32s cubic-bezier(.32,.72,0,1);
}

@keyframes entra-da-destra {
  from { transform: translateX(100%) }
  to   { transform: translateX(0) }
}

.pannello__testa {
  flex-shrink: 0;
  padding: 16px 20px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.pannello__titolo { font-size: 17px; font-weight: 600; letter-spacing: -.022em; }

/* Il form sta fra la testa e il piede: deve essere anche lui una
   colonna flessibile, altrimenti cresce con il contenuto e spinge
   il piede fuori dallo schermo. */
.pannello__form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* min-height:0 è indispensabile: senza, un contenitore flex non si
   restringe sotto la propria altezza naturale e il piede finisce
   fuori dallo schermo. */
.pannello__corpo {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}

.pannello__piede {
  flex-shrink: 0;
  padding: 14px 20px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--sep);
  display: flex; gap: 10px; align-items: center;
}

.pannello__piede .spazio { flex: 1; }

.chiudi {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--velo-grigio);
  color: var(--testo-2);
  cursor: pointer; font-size: 17px; line-height: 1;
  flex-shrink: 0;
}
.chiudi:hover { background: rgba(118,118,128,.20); }

/* Blocchi di campi: schede bianche, come le sezioni di Impostazioni */
.blocco {
  background: var(--scheda);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.blocco__titolo {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--testo-2);
  margin: 0 0 12px 2px;
}

.coppia { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }

/* Spazio fra un campo e il successivo, ma NON fra i due campi
   affiancati dentro una coppia: quelli devono restare allineati. */
.blocco > .campo + .campo,
.blocco > .coppia + .campo,
.blocco > .campo + .coppia,
.blocco > .coppia + .coppia { margin-top: 12px; }

/* Campo con unita' di misura appesa (cm, kg) */
.con-unita { position: relative; }
.con-unita input { padding-right: 40px; }
.con-unita__um {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--testo-3); pointer-events: none;
}


/* =============================================
   FOTO DEL GIOCATORE
   ============================================= */

.foto-blocco { display: flex; align-items: center; gap: 16px; }

.foto {
  width: 76px; height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--velo-grigio);
  display: grid; place-items: center;
  overflow: hidden;
  position: relative;
}

.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

.foto__vuota { color: var(--testo-3); font-size: 22px; font-weight: 500; }

.foto-azioni { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.foto-nota { font-size: 12.5px; color: var(--testo-3); }

/* Miniatura tonda nelle righe dell'elenco */
.riga__foto {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--velo-grigio);
}


/* =============================================
   AVVISO
   ============================================= */

.avviso {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 200;
  background: rgba(29,29,31,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  padding: 12px 22px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--ombra-alta);
  max-width: calc(100vw - 40px);
  animation: sali .26s cubic-bezier(.32,.72,0,1);
}

.avviso--rosso { background: rgba(215,0,21,.94); }

@keyframes sali {
  from { opacity: 0; transform: translate(-50%, 12px) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}


/* =============================================
   SCHERMI PICCOLI
   ============================================= */

@media (max-width: 620px) {
  .contenuto      { padding: 20px 16px 56px; }
  .testata__riga  { padding: 9px 16px; }
  .menu__riga     { padding: 0 16px; }
  .testata__chi   { display: none; }
  .titolo-pagina  { font-size: 21px; }
  .pagina__testa  { flex-direction: column; align-items: stretch; }
  .pagina__testa .btn { width: 100%; }
  .coppia         { grid-template-columns: 1fr; }
  .cerca          { max-width: none; }
  .segmenti       { width: 100%; }
  .segmenti button{ flex: 1; padding: 6px 8px; }
  .riga           { padding: 9px 16px; }
  .riga::after    { left: 60px; }
  .gruppo         { padding: 12px 16px 6px; }
  .velo           { align-items: stretch; }
  .pannello       { max-width: none; animation: entra-dal-basso .32s cubic-bezier(.32,.72,0,1); }
  .pannello__piede .btn { flex: 1; }
  .coppia         { grid-template-columns: 1fr 1fr; }
  .dato__valore   { font-size: 23px; }
}

@keyframes entra-dal-basso {
  from { transform: translateY(100%) }
  to   { transform: translateY(0) }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Nome con miniatura nella vista a tabella */
.cella-nome { display: inline-flex; align-items: center; gap: 9px; }

.cella-foto {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--velo-grigio);
}


/* =============================================
   REGISTRO PRESENZE
   ============================================= */

/* Colori dei quattro stati */
:root {
  --presente:     #1D9A54;
  --ritardo:      #C8890B;
  --giustificato: #0A72E8;
  --assente:      #E0453C;
}

/* Data a mo' di foglietto da calendario */
.calendario {
  width: 46px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.1;
}

.calendario__giorno {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--testo-3);
}

.calendario__numero {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.calendario__mese {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--testo-2);
}

/* Nell'elenco sedute il separatore parte dopo il calendario */
.elenco .riga:has(.calendario)::after { left: 82px; }

/* Barretta con la composizione della seduta */
.barra {
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--velo-grigio);
  margin-top: 7px;
  max-width: 260px;
}

.barra__pezzo--presente     { background: var(--presente); }
.barra__pezzo--ritardo      { background: var(--ritardo); }
.barra__pezzo--giustificato { background: var(--giustificato); }
.barra__pezzo--assente      { background: var(--assente); }

.conteggio { text-align: right; }

.conteggio__num {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.conteggio__num span { color: var(--testo-3); font-weight: 400; }

.conteggio__perc { font-size: 12.5px; color: var(--testo-2); font-variant-numeric: tabular-nums; }


/* Percentuale con barretta, nel riepilogo per giocatore */
.perc { display: inline-flex; align-items: center; gap: 9px; min-width: 108px; }

.perc__barra {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--velo-grigio);
  overflow: hidden;
  min-width: 54px;
}

.perc__barra > span { display: block; height: 100%; border-radius: 999px; }

.perc__num {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

.perc--buono .perc__barra > span { background: var(--presente); }
.perc--medio .perc__barra > span { background: var(--ritardo); }
.perc--basso .perc__barra > span { background: var(--assente); }
.perc--buono .perc__num { color: var(--presente); }
.perc--medio .perc__num { color: var(--ritardo); }
.perc--basso .perc__num { color: var(--assente); }


/* =============================================
   APPELLO
   ============================================= */

.pannello__sotto { font-size: 13px; color: var(--testo-2); margin-top: 1px; }

.scorciatoie { display: flex; gap: 8px; margin-bottom: 14px; }

.appello {
  background: var(--scheda);
  border-radius: 14px;
  overflow: hidden;
}

.appello__riga {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  position: relative;
}

.appello__riga::after {
  content: '';
  position: absolute;
  left: 58px; right: 0; bottom: 0;
  height: 1px;
  background: var(--sep);
}

.appello__riga:last-child::after { display: none; }

/* Chi è assente si spegne: si vede a colpo d'occhio chi manca */
.appello__riga[data-segnato="assente"] .appello__chi { opacity: .45; }
.appello__riga[data-segnato="giustificato"] .appello__chi { opacity: .65; }

.appello__chi { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }

.appello__nome {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appello__ruolo { font-size: 12.5px; color: var(--testo-2); }

/* I quattro pulsanti P R G A */
.scelte {
  display: inline-flex;
  gap: 2px;
  background: var(--velo-grigio);
  border-radius: 9px;
  padding: 2px;
  flex-shrink: 0;
}

.scelta {
  width: 30px;
  height: 27px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--testo-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}

.scelta:disabled { cursor: default; }

/* L'hover schiarisce SOLO i pulsanti non selezionati: su quello attivo
   coprirebbe di bianco il fondo colorato e la lettera sparirebbe. */
.scelta:not(:disabled):not([aria-pressed="true"]):hover {
  background: rgba(255,255,255,.7);
  color: var(--testo);
}

.scelta[aria-pressed="true"] {
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.14);
}

/* Sul selezionato l'hover scurisce appena, senza toccare il colore */
.scelta[aria-pressed="true"]:not(:disabled):hover { filter: brightness(.92); }

.scelta--presente[aria-pressed="true"]     { background: var(--presente); }
.scelta--ritardo[aria-pressed="true"]      { background: var(--ritardo); }
.scelta--giustificato[aria-pressed="true"] { background: var(--giustificato); }
.scelta--assente[aria-pressed="true"]      { background: var(--assente); }

.nota-blocco {
  font-size: 13px;
  color: var(--testo-2);
  line-height: 1.5;
  padding: 0 4px;
}


@media (max-width: 620px) {
  .calendario { width: 40px; }
  .calendario__numero { font-size: 19px; }
  .elenco .riga:has(.calendario)::after { left: 68px; }
  .appello__riga { padding: 9px 12px; gap: 9px; }
  .appello__riga::after { left: 52px; }
  .scelta { width: 34px; height: 30px; }
  .barra { max-width: none; }
}


/* =============================================
   CAMPI DATA E ORA
   Il browser ci mette dentro icone e spaziature sue,
   e restano diversi da tutti gli altri campi.
   Qui gli togliamo ogni ornamento: devono sembrare,
   e comportarsi, come un normale campo di testo.
   ============================================= */

input[type="date"],
input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.2;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

/* Via l'icona del calendario e dell'orologio: toccando il campo
   il selettore si apre lo stesso, su telefono con la ruota di sistema. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
  opacity: 0;
  width: 0;
  padding: 0;
  margin: 0;
}

/* Il browser aggiunge margini attorno alle cifre: li azzeriamo,
   altrimenti il testo non si allinea con quello degli altri campi. */
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit { padding: 0; }

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }

input[type="date"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-text { padding: 0 1px; color: var(--testo-3); }

input[type="date"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-inner-spin-button { display: none; -webkit-appearance: none; }

/* La parte selezionata in arancione societario, non nel blu di sistema */
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus,
input[type="time"]::-webkit-datetime-edit-ampm-field:focus {
  background: var(--arancio);
  color: #fff;
  border-radius: 3px;
  outline: none;
}

/* Campo vuoto: segnaposto nello stesso grigio degli altri */
input[type="date"]:not(:focus):invalid::-webkit-datetime-edit,
input[type="time"]:not(:focus):invalid::-webkit-datetime-edit { color: var(--testo-3); }

/* Su iOS un campo data o ora vuoto si accartoccia: gli teniamo l'altezza */
input[type="date"], input[type="time"] { min-width: 0; }


/* =============================================
   PULSANTI TONDI DELL'INTESTAZIONE
   ============================================= */

.testa-azioni { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.tondo {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--velo-grigio);
  color: var(--testo-2);
  cursor: pointer;
  transition: background-color .18s, color .18s;
}

.tondo:hover { background: rgba(118,118,128,.20); color: var(--testo); }

.tondo--attivo {
  background: var(--arancio);
  color: #fff;
}
.tondo--attivo:hover { background: var(--arancio-cupo); color: #fff; }

/* Il blocco che si apre con la matita */
.apribile { animation: scendi .22s cubic-bezier(.32,.72,0,1); }

@keyframes scendi {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pannello__sotto {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* =============================================
   INFORTUNIO E NOTE NEL REGISTRO
   ============================================= */


.scelta--infortunato[aria-pressed="true"] { background: var(--infortunio); }

.barra__pezzo--infortunato { background: var(--infortunio); }

/* Chi è infortunato non è "spento" come un assente: è fuori gioco,
   ma per un motivo che non dipende da lui. */
.appello__riga[data-segnato="infortunato"] .appello__chi { opacity: .7; }
.appello__riga[data-segnato="infortunato"] .appello__nome { color: var(--infortunio); }

.pillola--infortunio { background: rgba(123,91,214,.12); color: var(--infortunio); }
.pillola--sparito    { background: rgba(224,69,60,.12);  color: var(--assente); }

/* La riga d'appello ora ha due piani: nome e scelte sopra, nota sotto */
.appello__riga { flex-direction: column; align-items: stretch; gap: 0; }

.appello__testa {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.appello__nome {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Il fumetto accanto al nome */
.nota-tasto {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--testo-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color .15s, color .15s;
}

.nota-tasto:hover:not(:disabled) { background: var(--velo-grigio); color: var(--testo-2); }
.nota-tasto:disabled { opacity: .4; cursor: default; }

/* Pieno quando una nota c'è: si vede senza aprire nulla */
.nota-tasto--piena { color: var(--arancio-cupo); }
.nota-tasto--piena:hover:not(:disabled) { color: var(--arancio-cupo); }

.appello__nota { padding: 0 0 8px 47px; }

.nota-campo {
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
  background: var(--velo-grigio);
  border: none;
  border-radius: 8px;
}

.nota-campo:focus { box-shadow: 0 0 0 3px rgba(240,146,43,.22); }

@media (max-width: 620px) {
  .appello__nota { padding-left: 41px; }

  /* Cinque pulsanti su schermo stretto: restano in riga, stretti,
     e il nome si accorcia. Mandarli a capo raddoppierebbe l'altezza
     di ogni riga, e con venti ragazzi diventa tutto scorrimento. */
  .appello__testa { flex-wrap: nowrap; gap: 8px; }
  .appello__chi   { gap: 9px; }
  .appello__nome  { font-size: 14px; }
  .scelta         { width: 27px; height: 28px; font-size: 12.5px; }
  .scelte         { gap: 1px; padding: 2px; }
  .appello__riga  { padding: 8px 10px; }
  .riga__foto, .appello__chi .maglia { width: 28px; height: 28px; font-size: 12px; }
}

/* Schermi molto stretti: via il ruolo sotto il nome, serve lo spazio */
@media (max-width: 380px) {
  .appello__ruolo { display: none; }
  .scelta { width: 25px; }
}

/* Spiegazione sotto un gruppo di campi */
.nota-campo-testo {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--testo-2);
  margin-top: 10px;
  padding-left: 2px;
}


/* =============================================
   TABELLONE
   Stessa impaginazione della tabella "Per giocatore":
   stesse altezze, stessi caratteri, stessi separatori.
   In piu': nome fermo a sinistra, date che scorrono,
   percentuale ferma a destra.
   ============================================= */

.griglia-guscio {
  /* Solo orizzontale: la tabella non deve avere una barra di
     scorrimento propria, scorre la pagina come tutto il resto. */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  --ombra-sx: 0 0 0 rgba(0,0,0,0);
  --ombra-dx: 0 0 0 rgba(0,0,0,0);
}

.griglia {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}

.griglia th, .griglia td { border: none; }

/* Solo le celle dei giorni stanno senza padding: il contenuto è
   una casella centrata. Le colonne con del testo lo tengono. */
.griglia__mese, .griglia__giorno, .griglia__cella, .griglia__riempi { padding: 0; }


/* ---------- Intestazione ---------- */

.griglia thead th {
  background: var(--scheda);
  z-index: 3;
  font-size: 12px;
  font-weight: 500;
  color: var(--testo-2);
}

/* Le colonne ferme devono stare sopra a tutto il resto */
.griglia thead th.griglia__angolo,
.griglia thead th.griglia__coda { z-index: 6; }



.griglia__mese {
  height: 30px;
  text-align: left;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--reticolo);
}

.griglia__mese ~ .griglia__mese { box-shadow: inset 1px 0 0 var(--sep); }

/* L'etichetta accompagna il mese mentre scorre, e resta dentro il suo gruppo */
.griglia__mese span {
  position: sticky;
  left: 219px;
  display: inline-block;
  padding: 0 12px 0 10px;
  background: var(--scheda);
  text-transform: capitalize;
}

.griglia__giorno {
  width: 40px;
  min-width: 40px;
  height: 42px;
  padding: 8px 0;
  text-align: center;
  vertical-align: bottom;
  cursor: pointer;
  border-bottom: 1px solid var(--sep);
  border-right: 1px solid var(--reticolo);
  transition: background-color .12s;
}

.griglia__giorno:hover { background: rgba(0,0,0,.022); }

.griglia__gg {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--testo);
  letter-spacing: -.02em;
  line-height: 1.15;
}

.griglia__sett { display: block; font-size: 10.5px; color: var(--testo-3); line-height: 1.1; }

/* Fine settimana in arancione */
.griglia__giorno--festivo .griglia__gg   { color: var(--arancio-cupo); }
.griglia__giorno--festivo .griglia__sett { color: var(--arancio-cupo); opacity: .7; }


/* ---------- Colonna ferma a sinistra ---------- */

.griglia__angolo,
.griglia__nome {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--scheda);
  text-align: left;
  white-space: nowrap;
  width: 210px;
  min-width: 210px;
  padding: 10px 16px 10px 18px;
  border-right: 1px solid var(--sep);
  box-shadow: var(--ombra-sx);
}

.griglia__angolo { vertical-align: bottom; border-bottom: 1px solid var(--sep); }

.griglia__nome {
  z-index: 2;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.012em;
  cursor: pointer;
  border-bottom: 1px solid var(--sep);
}

.griglia__testo {
  display: inline-block;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.griglia__ruolo {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: middle;
  background: var(--testo-3);
}

.griglia__ruolo--por { background: var(--por); }
.griglia__ruolo--dif { background: var(--dif); }
.griglia__ruolo--cen { background: var(--cen); }
.griglia__ruolo--att { background: var(--att); }


/* ---------- Colonna ferma a destra ---------- */

.griglia__coda {
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--scheda);
  width: 94px;
  min-width: 94px;
  text-align: right;
  padding: 10px 18px 10px 14px;
  border-bottom: 1px solid var(--sep);
  border-left: 1px solid var(--sep);
  box-shadow: var(--ombra-dx);
}

.griglia__coda--testa { z-index: 5; vertical-align: bottom; }

tbody .griglia__coda { z-index: 2; font-size: 13.5px; }

.griglia__perc { font-weight: 600; letter-spacing: -.02em; }
.griglia__perc span { font-size: 11.5px; font-weight: 500; opacity: .55; margin-left: 1px; }

.griglia__perc--buono { color: var(--presente); }
.griglia__perc--medio { color: var(--ritardo); }
.griglia__perc--basso { color: var(--assente); }
.griglia__vuoto { color: var(--testo-3); }


/* ---------- Colonna elastica ---------- */

.griglia__riempi {
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--sep);
  border-left: 1px solid var(--reticolo);
}


/* ---------- Celle ---------- */

.griglia__cella {
  text-align: center;
  height: 40px;
  border-bottom: 1px solid var(--sep);
  border-right: 1px solid var(--reticolo);
}

.griglia__giorno--inizio-mese,
.griglia__cella--inizio-mese { box-shadow: inset 1px 0 0 var(--sep); }

.griglia tbody tr:last-child th,
.griglia tbody tr:last-child td { border-bottom: none; }

/* Stessa evidenziazione della tabella "Per giocatore" */
.griglia tbody tr:hover .griglia__cella,
.griglia tbody tr:hover .griglia__riempi,
.griglia tbody tr:hover .griglia__nome,
.griglia tbody tr:hover .griglia__coda { background: #FAFAFA; }

.casella {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  position: relative;
}

.casella--presente     { background: rgba(29,154,84,.13);  color: var(--presente); }
.casella--ritardo      { background: rgba(200,137,11,.15); color: var(--ritardo); }
.casella--giustificato { background: rgba(10,114,232,.12); color: var(--giustificato); }
.casella--assente      { background: rgba(224,69,60,.13);  color: var(--assente); }
.casella--infortunato  { background: rgba(123,91,214,.13); color: var(--infortunio); }
.casella--fuori        { background: transparent; color: #D0D0D5; font-weight: 400; }

.casella--nota::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--arancio-cupo);
}


/* ---------- Legenda ---------- */

.legenda {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 13px 16px;
  border-top: 1px solid var(--sep);
  font-size: 12.5px;
  color: var(--testo-2);
}

.legenda__voce { display: inline-flex; align-items: center; gap: 6px; }
.legenda .casella { width: 22px; height: 22px; font-size: 11px; border-radius: 6px; }


@media (max-width: 620px) {

  .griglia__angolo, .griglia__nome { width: 158px; min-width: 158px; padding: 10px 12px 10px 14px; }
  .griglia__testo { max-width: 112px; }
  .griglia__mese span { left: 167px; }
  .griglia__coda { width: 74px; min-width: 74px; padding: 10px 14px 10px 10px; }
  .griglia__giorno { width: 36px; min-width: 36px; }
  .legenda { gap: 7px 12px; font-size: 12px; }
}


/* Riga di spiegazione sotto un campo */
.campo__aiuto {
  font-size: 12px;
  line-height: 1.45;
  color: var(--testo-3);
  padding-left: 2px;
  margin-top: 2px;
}

/* Righe alternate del tabellone: con venti nomi uno sotto l'altro
   e tutte le caselle uguali, senza un appiglio l'occhio si perde. */
.griglia tbody tr:nth-child(even) > * { background: #FAFAFB; }

/* L'evidenziazione al passaggio deve vincere su quella alternata */
.griglia tbody tr:hover > * { background: var(--arancio-velo); }


/* =============================================
   USCITE CON UN'ALTRA SQUADRA
   ============================================= */

:root { --uscita: #0A72E8; }

.pagina__azioni { display: flex; gap: 10px; flex-wrap: wrap; }

/* La riga di un'uscita si distingue da quella di un allenamento */
.riga--uscita .calendario__numero { color: var(--uscita); }
.riga--uscita .calendario__giorno,
.riga--uscita .calendario__mese   { color: var(--uscita); opacity: .7; }

.pillola--uscita { background: rgba(10,114,232,.11); color: var(--uscita); }

/* I nomi di chi c'è andato: due righe al massimo, poi tronca */
.riga__sotto--nomi {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}


/* ---------- Scelta dei giocatori ---------- */

.scelta-rosa {
  background: var(--scheda);
  border-radius: 14px;
  overflow: hidden;
}

.scelta-riga {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  position: relative;
  cursor: pointer;
  transition: background-color .12s;
}

.scelta-riga::after {
  content: '';
  position: absolute;
  left: 58px; right: 0; bottom: 0;
  height: 1px;
  background: var(--sep);
}

.scelta-riga:last-child::after { display: none; }
.scelta-riga:hover { background: rgba(0,0,0,.022); }

/* Chi è stato scelto si accende */
.scelta-riga[data-scelto="true"] { background: rgba(10,114,232,.06); }
.scelta-riga[data-scelto="true"]:hover { background: rgba(10,114,232,.10); }

.spunta {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--sep-forte);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}

.spunta[aria-pressed="true"] {
  background: var(--uscita);
  border-color: var(--uscita);
  color: #fff;
}

.spunta:disabled { opacity: .4; cursor: default; }

/* Il numero nella colonna "Grandi" del riepilogo */
.conta-grandi {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 980px;
  background: rgba(10,114,232,.11);
  color: var(--uscita);
  font-size: 12px;
  font-weight: 600;
}

/* Colonna e casella delle uscite con un'altra squadra */
.griglia__giorno--uscita .griglia__gg   { color: var(--uscita); }
.griglia__giorno--uscita .griglia__sett { color: var(--uscita); opacity: .7; }

.casella--grandi { background: rgba(10,114,232,.13); color: var(--uscita); }

/* Chi non è mai salito resta in secondo piano */
.riga--mai .griglia__nome,
.riga--mai .griglia__testo { color: var(--testo-2); }

.legenda strong { font-weight: 600; color: var(--testo); }


/* =============================================
   PARTITE
   ============================================= */

.dato__su { font-size: 17px; font-weight: 500; color: var(--testo-3); letter-spacing: -.02em; }

.riga--partita .calendario__numero { color: var(--testo); }

.riga__nome strong { font-weight: 650; }

/* Il risultato in coda alla riga */
.risultato { text-align: right; min-width: 76px; }

.risultato__num {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.risultato__num span { color: var(--testo-3); font-weight: 400; margin: 0 2px; }

.risultato__gol {
  font-size: 12px;
  color: var(--testo-3);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.risultato--vittoria  .risultato__num { color: var(--presente); }
.risultato--sconfitta .risultato__num { color: var(--assente); }
.risultato--pareggio  .risultato__num { color: var(--testo-2); }

.risultato__da-giocare {
  font-size: 12.5px;
  color: var(--testo-3);
  white-space: nowrap;
}

/* Controllo segmentato a tutta larghezza */
.segmenti--largo { width: 100%; }
.segmenti--largo button { flex: 1; }

/* Titolare / panchina nella distinta */
.scelte--tp { flex-shrink: 0; margin-right: 4px; }

.scelta--titolare[aria-pressed="true"] { background: var(--presente); }
.scelta--panchina[aria-pressed="true"] { background: var(--testo-2); }

/* Chi non è convocato resta spento */
.scelta-riga--distinta { gap: 9px; padding: 9px 14px; }
.scelta-riga--distinta .riga__foto,
.scelta-riga--distinta .maglia { flex-shrink: 0; }

.scelta-riga--distinta[data-dentro="false"] .appello__nome,
.scelta-riga--distinta[data-dentro="false"] .appello__ruolo { opacity: .5; }
.scelta-riga--distinta[data-dentro="false"] .scelte--tp { opacity: .35; }

.scelta-riga--distinta[data-dentro="true"] { background: rgba(29,154,84,.06); }
.scelta-riga--distinta[data-dentro="true"]:hover { background: rgba(29,154,84,.10); }
.scelta-riga--distinta[data-dentro="true"] .spunta {
  background: var(--presente); border-color: var(--presente); color: #fff;
}

@media (max-width: 620px) {
  .risultato { min-width: 62px; }
  .risultato__num { font-size: 17px; }
  .scelte--tp .scelta { width: 26px; }
}


/* =============================================
   LA PARTITA — testata e campo
   ============================================= */

.partita-testa {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.indietro { gap: 5px; padding-left: 0; flex-shrink: 0; }

.partita-titolo { flex: 1; min-width: 0; text-align: center; }

.partita-squadre {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.028em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.partita-squadre span { color: var(--testo-3); font-weight: 400; margin: 0 4px; }
.partita-info { font-size: 13.5px; color: var(--testo-2); margin-top: 2px; }


/* ---------- Il campo ---------- */

.formazione { display: grid; gap: 18px; }

.scheda--terreno { padding: 16px; }

.terreno-testa {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.terreno-modulo { display: grid; gap: 5px; }
.terreno-modulo select { min-width: 110px; }

.terreno-conta { font-size: 13.5px; color: var(--testo-2); padding-bottom: 10px; }
.terreno-conta strong { color: var(--testo); font-weight: 600; }

.terreno {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 10 / 14;
  /* Il verde del manto, con le fasce del taglio dell'erba */
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,.045) 0 7.14%,
      transparent 7.14% 14.28%),
    linear-gradient(170deg, #2E9E5B, #1D7F45);
  border-radius: 12px;
  overflow: hidden;
  touch-action: manipulation;
}

.terreno-righe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(255,255,255,.42);
  stroke-width: .55;
}

.terreno-righe .pieno { fill: rgba(255,255,255,.42); }

/* Con un giocatore in mano le caselle libere si accendono */
.terreno--in-mano .casella-terreno--vuota {
  border-color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.22);
  animation: pulsa 1.4s ease-in-out infinite;
}

@keyframes pulsa {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.08); }
}


/* ---------- Le caselle ---------- */

.casella-terreno {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 52px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #fff;
}

.casella-terreno--vuota {
  width: 38px; height: 38px;
  border: 1.5px dashed rgba(255,255,255,.55);
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  transition: background-color .18s, border-color .18s, transform .18s;
}

.casella-terreno--vuota:hover {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.9);
}

.casella-terreno__piu { font-size: 19px; font-weight: 300; opacity: .8; line-height: 1; }

.casella-terreno__ruolo {
  position: absolute;
  bottom: -15px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: .75;
}

/* Il giocatore schierato: maglia e nome sotto */
.casella-terreno--piena { width: 56px; }

.casella-terreno__num,
.casella-terreno__foto {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--testo);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 2px 6px rgba(0,0,0,.28);
  object-fit: cover;
  transition: transform .18s, box-shadow .18s;
}

.casella-terreno--piena:hover .casella-terreno__num,
.casella-terreno--piena:hover .casella-terreno__foto { transform: scale(1.06); }

.casella-terreno__nome {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* Quello che ho in mano */
.casella-terreno--scelta .casella-terreno__num,
.casella-terreno--scelta .casella-terreno__foto {
  border-color: var(--arancio);
  box-shadow: 0 0 0 3px rgba(240,146,43,.55), 0 2px 8px rgba(0,0,0,.3);
  transform: scale(1.08);
}


/* ---------- La panchina ---------- */

.panchina {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px;
}

.panchina__vuota { font-size: 13.5px; color: var(--testo-3); padding: 4px 0; }

.gettone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--sep-forte);
  border-radius: 980px;
  background: var(--scheda);
  cursor: pointer;
  transition: border-color .18s, background-color .18s, transform .12s;
}

.gettone:hover { border-color: var(--arancio); }

.gettone--scelto {
  border-color: var(--arancio);
  background: var(--arancio-velo);
  transform: scale(1.03);
  box-shadow: 0 0 0 3px rgba(240,146,43,.2);
}

.gettone__num,
.gettone__foto {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--testo);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  object-fit: cover;
  flex-shrink: 0;
}

.gettone__nome { font-size: 13.5px; font-weight: 500; letter-spacing: -.012em; }


@media (min-width: 900px) {
  /* Su schermo largo campo e panchina stanno affiancati */
  .formazione { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .panchina { flex-direction: column; flex-wrap: nowrap; }
  .gettone { width: 100%; justify-content: flex-start; }
}

@media (max-width: 620px) {
  /* Su schermo stretto il titolo va su una riga sua: in fila con i
     pulsanti si schiacciava fino a sparire. */
  .partita-testa { gap: 10px; }
  /* flex-basis 100%: con flex-wrap il titolo si prende una riga sua.
     Con `width` non bastava, perché la regola base impone basis 0. */
  .partita-titolo { order: -1; flex: 1 0 100%; text-align: left; }
  .partita-squadre { font-size: 17px; white-space: normal; }
  .partita-info { font-size: 12.5px; }
  .indietro { padding-left: 0; }
  .partita-azioni { flex: 1; }
  .casella-terreno { width: 46px; }
  .casella-terreno--piena { width: 50px; }
  .casella-terreno__num, .casella-terreno__foto { width: 36px; height: 36px; font-size: 14px; }
  .casella-terreno--vuota { width: 34px; height: 34px; }
  .casella-terreno__nome { font-size: 10px; }
  .scheda--terreno { padding: 12px; }
}


/* =============================================
   LA DIRETTA
   ============================================= */

.diretta { display: grid; gap: 16px; }

/* ---------- Tabellone ---------- */

.tabellone-live { padding: 18px 20px 16px; }

.live-tempi {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.live-tempo {
  min-width: 52px;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--velo-grigio);
  text-align: center;
}

.live-tempo--ora {
  background: var(--arancio);
  color: #fff;
  box-shadow: 0 2px 8px rgba(240,146,43,.35);
}

/* Il tempo che non va a referto resta più smorto */
.live-tempo--fuori { opacity: .55; }

.live-tempo__n { font-size: 10.5px; font-weight: 600; opacity: .75; }

.live-tempo__ris {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.live-centro { text-align: center; }

.live-punteggio {
  font-size: 46px;
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-punteggio em { font-style: normal; color: var(--testo-3); margin: 0 8px; font-weight: 300; }

.live-referto { font-size: 13px; color: var(--testo-2); margin-top: 4px; }

.live-orologio { text-align: center; margin-top: 14px; }

.live-orologio__num {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Mentre gira il cronometro pulsa piano: si vede che è vivo */
.live-orologio--gira .live-orologio__num { color: var(--presente); animation: batte 2s ease-in-out infinite; }

@keyframes batte { 0%, 100% { opacity: 1 } 50% { opacity: .68 } }

.live-orologio__stato { font-size: 13px; color: var(--testo-2); margin-top: 3px; }

.live-comandi {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--sep);
}


/* ---------- Avvisi del regolamento ---------- */

.avvisi { display: grid; gap: 8px; }

.avviso-regola {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
}

.avviso-regola svg { flex-shrink: 0; margin-top: 1px; }

.avviso-regola--alta  { background: rgba(224,69,60,.10);  color: #A32A22; }
.avviso-regola--media { background: rgba(178,80,0,.10);   color: var(--ambra); }


.scheda__nota { font-size: 12.5px; color: var(--testo-3); }


/* ---------- Gol degli avversari ---------- */

.riga-avversari {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.riga-avversari__titolo { font-size: 14px; font-weight: 500; }
.riga-avversari__nota { font-size: 12.5px; color: var(--testo-3); margin-top: 2px; }


/* ---------- Cronaca ---------- */

.riga--evento {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  cursor: default;
}

.riga--evento::after { left: 18px; }

.evento-minuto {
  font-size: 12.5px;
  color: var(--testo-3);
  font-variant-numeric: tabular-nums;
  min-width: 62px;
  flex-shrink: 0;
}

.evento-tipo {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 980px;
  flex-shrink: 0;
}

.evento-tipo--gol    { background: rgba(29,154,84,.13);  color: var(--presente); }
.evento-tipo--assist { background: rgba(10,114,232,.11); color: var(--uscita); }
.evento-tipo--giallo { background: rgba(200,137,11,.16); color: var(--ritardo); }
.evento-tipo--rosso  { background: rgba(224,69,60,.13);  color: var(--assente); }
.evento-tipo--male   { background: rgba(224,69,60,.10);  color: var(--assente); }
.evento-tipo--subito { background: rgba(224,69,60,.10);  color: var(--assente); }
.evento-tipo--parata { background: rgba(123,91,214,.13); color: var(--infortunio); }
.evento-tipo--entra  { background: rgba(29,154,84,.11);  color: var(--presente); }
.evento-tipo--esce   { background: var(--velo-grigio);   color: var(--testo-2); }

.evento-chi { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; }
.evento-chi em { font-style: normal; color: var(--testo-2); font-weight: 400; }

.evento-togli {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--testo-3);
  cursor: pointer;
  flex-shrink: 0;
}
.evento-togli:hover { background: rgba(215,0,21,.10); color: var(--rosso); }


/* ---------- Foglio delle azioni ---------- */

.velo--basso { align-items: flex-end; justify-content: center; }

.foglio {
  width: 100%;
  max-width: 460px;
  background: var(--scheda);
  border-radius: 20px 20px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  animation: sali-foglio .28s cubic-bezier(.32,.72,0,1);
}

@keyframes sali-foglio { from { transform: translateY(100%) } to { transform: translateY(0) } }

.foglio__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sep);
}

.foglio__nome { font-size: 17px; font-weight: 600; letter-spacing: -.022em; }
.foglio__sotto { font-size: 13px; color: var(--testo-2); margin-top: 1px; }

.foglio__azioni {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 16px 20px;
}

.azione {
  padding: 13px 12px;
  border: none;
  border-radius: 12px;
  background: var(--velo-grigio);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s, transform .12s;
}

.azione:active { transform: scale(.97); }

.azione--gol    { background: rgba(29,154,84,.13);  color: var(--presente); font-weight: 600; }
.azione--assist { background: rgba(10,114,232,.11); color: var(--uscita); }
.azione--giallo { background: rgba(200,137,11,.16); color: var(--ritardo); }
.azione--rosso  { background: rgba(224,69,60,.13);  color: var(--assente); }
.azione--male   { background: rgba(224,69,60,.09);  color: var(--assente); }
.azione--subito { background: rgba(224,69,60,.09);  color: var(--assente); }
.azione--parata { background: rgba(123,91,214,.13); color: var(--infortunio); }
.azione--entra  { background: rgba(29,154,84,.13);  color: var(--presente); font-weight: 600; }
.azione--esce   { background: var(--velo-grigio);   color: var(--testo-2); }


@media (max-width: 620px) {
  .live-punteggio { font-size: 40px; }
  .live-orologio__num { font-size: 30px; }
  .foglio { max-width: none; }
  .live-comandi .btn { flex: 1; }
}

/* Intestazione della formazione: modulo, conteggio, copia */
.formazione-testa {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.formazione-conta { font-size: 13.5px; color: var(--testo-2); padding-bottom: 10px; flex: 1; }
.formazione-conta strong { color: var(--testo); font-weight: 600; }

/* ---------- Le icone degli eventi ---------- */

.icona {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  vertical-align: -2px;
}

.icona--tasto { width: 19px; height: 19px; vertical-align: -4px; }

/* ---------- Il campo dentro la diretta ---------- */

.terreno--diretta { margin: 0 auto; }

/* Le caselle vuote qui non si toccano: sono solo il disegno del modulo */
.casella-terreno--spenta {
  cursor: default;
  opacity: .45;
  border-style: dashed;
}

/* Chi e' uscito resta al suo posto ma spento */
.casella-terreno--uscito { opacity: .5; }

/* I bollini di cos'ha fatto, attaccati al suo cerchio */
/* In alto a destra c'e' gia' la fascia: i bollini stanno a sinistra */
.bolli {
  position: absolute;
  top: -5px;
  left: -7px;
  display: flex;
  flex-direction: row-reverse;
  gap: 1px;
}

.bollo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
  color: var(--testo-2);
}

/* Dentro il bollino il tratto va ingrossato, altrimenti a questa
   misura il disegno sparisce */
.bollo .icona { width: 14px; height: 14px; vertical-align: 0; stroke-width: 1.8; }

.bollo--gol    { background: var(--presente);     color: #fff; }
.bollo--assist { background: var(--giustificato); color: #fff; }
.bollo--giallo { background: var(--ritardo);      color: #fff; }
.bollo--rosso,
.bollo--subito,
.bollo--male   { background: var(--assente);      color: #fff; }
.bollo--parata { background: var(--infortunio);   color: #fff; }

/* La freccia di chi e' uscito, sul cerchio */
.casella-terreno--uscito .bollo--esce {
  position: absolute;
  bottom: -3px;
  left: -5px;
  width: 16px;
  height: 16px;
  background: var(--assente);
  color: #fff;
}

/* Chi e' entrato dopo: non ha un posto sul campo */
.entrati-dopo { margin-top: 16px; }
.entrati-dopo__chi { display: flex; flex-wrap: wrap; gap: 6px; }

.entrato {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 7px;
  border: none;
  border-radius: 980px;
  background: rgba(29,154,84,.10);
  color: var(--testo);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.entrato__num {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 7px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--testo-2);
  text-align: center;
}

/* ---------- La diretta: si parte dal ragazzo ---------- */

.gol-avversario { width: 100%; }

.riga--live {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.riga--live:active { background: rgba(0,0,0,.05); }

.live-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--testo-2);
  font-variant-numeric: tabular-nums;
}

.live-chi { min-width: 0; }
.live-nome { font-size: 15.5px; font-weight: 500; letter-spacing: -.015em; }

.live-segni { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

.live-min {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
}

/* I segni accanto al nome: cos'ha fatto e a che minuto */
.segno {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 980px;
  font-size: 11px;
  font-weight: 600;
  background: var(--velo-grigio);
  color: var(--testo-2);
  white-space: nowrap;
}

.segno--gol    { background: rgba(29,154,84,.14);  color: var(--presente); }
.segno--assist { background: rgba(10,114,232,.13); color: var(--giustificato); }
.segno--giallo { background: rgba(200,137,11,.18); color: var(--ritardo); }
.segno--rosso,
.segno--subito,
.segno--male   { background: rgba(224,69,60,.13);  color: var(--assente); }
.segno--entra  { background: rgba(29,154,84,.10);  color: var(--presente); }
.segno--esce   { background: rgba(224,69,60,.09);  color: var(--assente); }
.segno--parata { background: rgba(123,91,214,.13); color: var(--infortunio); }

/* Il ragazzo che hai toccato: i tasti di cos'e' successo */
.foglio__num {
  display: inline-block;
  min-width: 26px;
  margin-right: 8px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--velo-grigio);
  font-size: 13px;
  font-weight: 600;
  color: var(--testo-2);
  text-align: center;
  vertical-align: 2px;
}

.tasti-evento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.tasto-evento {
  padding: 16px 10px;
  border: none;
  border-radius: 14px;
  background: var(--velo-grigio);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--testo);
  cursor: pointer;
  transition: transform .12s, filter .15s;
}

.tasto-evento:active { transform: scale(.97); }
.tasto-evento:hover  { filter: brightness(.96); }

/* Il gol si prende tutta la riga: e' quello che cerchi di corsa */
.tasto-evento--gol {
  grid-column: 1 / -1;
  background: var(--presente);
  color: #fff;
  font-size: 17px;
}

.tasto-evento--assist           { background: rgba(10,114,232,.13); color: var(--giustificato); }
.tasto-evento--giallo           { background: rgba(200,137,11,.18); color: var(--ritardo); }
.tasto-evento--rosso            { background: rgba(224,69,60,.14);  color: var(--assente); }
.tasto-evento--cambio_in        { background: rgba(29,154,84,.12);  color: var(--presente); }
.tasto-evento--cambio_out       { background: rgba(224,69,60,.10);  color: var(--assente); }
.tasto-evento--gol_subito       { background: rgba(224,69,60,.09);  color: var(--assente); }
.tasto-evento--rigore_segnato   { background: rgba(29,154,84,.12);  color: var(--presente); }
.tasto-evento--rigore_parato    { background: rgba(123,91,214,.13); color: var(--infortunio); }
.tasto-evento--rigore_sbagliato,
.tasto-evento--autogol          { background: var(--velo-grigio);   color: var(--testo-2); }

.foglio__corpo--suoi { border-top: 1px solid var(--sep); }
.foglio__etichetta { font-size: 12.5px; color: var(--testo-2); margin-bottom: 8px; }

.suoi-eventi { display: flex; flex-wrap: wrap; gap: 6px; }

.segno--togli {
  border: none;
  font-family: inherit;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.segno__x { opacity: .55; font-weight: 400; }

/* Il tasto ha l'icona sopra e la parola sotto: si legge di corsa */
.tasto-evento {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.evento-tipo { display: inline-flex; align-items: center; gap: 5px; }
.tab-gruppo__nome { display: inline-flex; align-items: center; gap: 5px; }
.foglio__etichetta { display: flex; align-items: center; gap: 5px; }
.gol-avversario { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }

@media (max-width: 380px) {
  .tasti-evento { gap: 7px; }
  .tasto-evento { padding: 14px 8px; font-size: 14px; }
}

.formazione-azioni { display: flex; gap: 8px; flex-wrap: wrap; }
.formazione-azioni .btn--rosso { border: 1px solid #E7C6C3; }

/* ---------- Distinta: numero e fascia ---------- */

.distinta-dati { flex: 1; min-width: 0; }

/* La specificità deve battere `input[type="number"]`, altrimenti
   il campo si prende il 100% della riga e sfonda tutto. */
input[type="number"].numero-partita {
  width: 48px;
  flex: 0 0 48px;
  min-height: 34px;
  padding: 5px 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 9px;
  flex-shrink: 0;
}

input[type="number"].numero-partita:disabled { opacity: .3; }

.fasce { display: inline-flex; gap: 2px; background: var(--velo-grigio); border-radius: 9px; padding: 2px; flex-shrink: 0; }

.fascia {
  width: 27px; height: 27px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--testo-2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.fascia:disabled { opacity: .3; cursor: default; }
.fascia:not(:disabled):not([aria-pressed="true"]):hover { background: rgba(255,255,255,.7); }

.fascia[aria-pressed="true"] {
  background: var(--arancio);
  color: #fff;
  box-shadow: 0 2px 6px rgba(240,146,43,.35);
}

/* ---------- Convocazione ---------- */

.partita-azioni { display: flex; gap: 8px; flex-shrink: 0; }

.foglio__corpo { padding: 16px 20px 8px; }

.anteprima-convocazione {
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  min-height: 240px;
}

.foglio__piede {
  display: flex;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--sep);
}

.foglio__piede .btn { flex: 1; }

@media (max-width: 620px) {
  .partita-azioni { width: 100%; }
  .partita-azioni .btn { flex: 1; }
  .numero-partita { width: 42px; }
}

/* ---------- Fascia di capitano sul campo ---------- */

.casella-terreno__cerchio { position: relative; display: block; line-height: 0; }

.fascia-campo {
  position: absolute;
  top: -3px; right: -5px;
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.9);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}

.fascia-campo--C { background: var(--arancio); }
.fascia-campo--V { background: var(--testo-2); }

/* In panchina basta la lettera accanto al nome */
.fascia-gettone {
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--arancio);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}


/* =============================================
   IL TABELLINO
   ============================================= */

.tabellino { display: flex; flex-direction: column; gap: 16px; }

.tab-risultato { padding: 22px 20px 18px; text-align: center; }

.tab-punteggio {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.tab-squadra {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.tab-numeri {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.tab-numeri em { font-size: 24px; font-style: normal; color: var(--testo-3); }

.tab-sotto {
  font-size: 12.5px;
  color: var(--testo-2);
  margin-top: 8px;
}

.tab-referto {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sep);
}

.tab-referto__valore {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.tab-referto__nome { font-size: 12px; color: var(--testo-2); margin-top: 2px; }

.tab-esito--vittoria  { color: var(--presente); }
.tab-esito--pareggio  { color: var(--ambra); }
.tab-esito--sconfitta { color: var(--assente); }

/* ---------- Tempo per tempo ---------- */

.riga--tempo {
  display: grid;
  grid-template-columns: 34px 62px 1fr auto;
  align-items: center;
  gap: 10px;
}

.tempo-n   { font-size: 15px; font-weight: 600; }
.tempo-ris { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.tempo-esito {
  justify-self: start;
  display: inline-block;
  padding: 1px 8px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 500;
}

.tempo-esito--vinto { background: rgba(29,154,84,.10);  color: var(--presente); }
.tempo-esito--pari  { background: rgba(178,80,0,.10);   color: var(--ambra); }
.tempo-esito--perso { background: rgba(224,69,60,.10);  color: var(--assente); }
.tempo-esito--fuori { background: var(--velo-grigio);   color: var(--testo-2); }

.tempo-durata { font-size: 13px; color: var(--testo-2); font-variant-numeric: tabular-nums; }

/* ---------- Chi ha fatto cosa ---------- */

.tab-gruppi { display: flex; flex-direction: column; gap: 10px; }

.tab-gruppo { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: baseline; }
.tab-gruppo__nome { font-size: 12.5px; color: var(--testo-2); }
.tab-gruppo__chi  { font-size: 14px; font-weight: 500; line-height: 1.4; }

/* ---------- Quanto hanno giocato ---------- */

.riga--impiego {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.impiego-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--testo-2);
  font-variant-numeric: tabular-nums;
}

.impiego-nome { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }

.impiego-tempi { font-size: 12.5px; color: var(--testo-2); }
.impiego-tempi--poco { color: var(--ambra); font-weight: 500; }

.impiego-min {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}

@media (max-width: 420px) {
  .tab-numeri { font-size: 34px; }
  .tab-gruppo { grid-template-columns: 74px 1fr; }
}
