:root {
  color-scheme: dark;
  --fondo: #0c0f15;
  --pannello: rgba(255, 255, 255, .055);
  --pannello-forte: rgba(255, 255, 255, .1);
  --linea: rgba(255, 255, 255, .1);
  --testo: #f3f5f8;
  --tenue: #a4adba;
  --scuro: #12151b;            /* testo sopra i riquadri colorati */
  --link: #9cc4ff;
  --giallo: #ffd95a;
  --arancio: #ff9a5c;
  --rosso: #ff8a73;
  --viola: #c5a8ff;
  --verde: #a9ef62;
  --azzurro: #8fd4ff;
  --raggio: 22px;
  --raggio-piccolo: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--testo);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background:
    radial-gradient(60rem 38rem at 0% -10%, rgba(40, 86, 180, .42), transparent 62%),
    radial-gradient(46rem 36rem at 105% 5%, rgba(128, 96, 210, .2), transparent 60%),
    radial-gradient(50rem 40rem at 60% 110%, rgba(30, 70, 150, .22), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
}
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 1.1rem; font-weight: 700; }
h2 { font-size: 1.1rem; letter-spacing: -0.01em; }
h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); margin: 1.4rem 0 .6rem; }
p { margin: 0 0 .75rem; }
.tenue { color: var(--tenue); }
h1 .tenue, h2 .tenue { font-weight: 400; }
.piccolo { font-size: .85rem; }
.cifre { font-variant-numeric: tabular-nums; white-space: nowrap; }
.destra { text-align: right; }
.rosso { color: var(--rosso); }
:focus-visible { outline: 3px solid var(--azzurro); outline-offset: 2px; }

/* --- struttura: menu laterale + contenuto --- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.lato {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.5rem 1rem; background: rgba(8, 10, 15, .5); border-right: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.marchio { display: flex; align-items: center; gap: .7rem; color: var(--testo); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; padding: 0 .5rem; }
.marchio img { width: 60px; height: 60px; object-fit: contain; flex: none; }
.marchio small { display: block; font-weight: 400; color: var(--tenue); font-size: .8rem; letter-spacing: 0; }
.marchio-grande { font-size: 1.35rem; padding: 0; margin-bottom: 2rem; }
.marchio-grande img { width: 96px; height: 96px; }
.menu { display: grid; gap: .2rem; align-content: start; flex: 1; }
.menu-titolo { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); padding: 0 .75rem .4rem; }
.menu a { color: #d5dbe4; text-decoration: none; padding: .6rem .75rem; border-radius: var(--raggio-piccolo); font-weight: 500; font-size: .95rem; white-space: nowrap; }
.menu a:hover { background: var(--pannello); color: #fff; }
.menu a[aria-current] { background: var(--pannello-forte); color: #fff; box-shadow: inset 0 0 0 1px var(--linea); }
.chi { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem .5rem 0; border-top: 1px solid var(--linea); }
.chi-nome { color: var(--testo); text-decoration: none; font-size: .92rem; font-weight: 600; line-height: 1.25; min-width: 0; }
.chi-nome small { display: block; color: var(--tenue); font-weight: 400; }
.pagina { width: 100%; max-width: 1180px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.pagina-stretta { max-width: 430px; padding: 12vh 1rem 3rem; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .lato { position: sticky; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .7rem 1rem; border-right: 0; border-bottom: 1px solid var(--linea); background: rgba(8, 10, 15, .82); }
  .marchio { padding: 0; } .marchio img { width: 42px; height: 42px; } .marchio small { display: none; }
  .menu { order: 3; flex: 1 0 100%; display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding: 0 1rem; }
  .menu::-webkit-scrollbar { display: none; }
  .menu-titolo { display: none; }
  .menu a { padding: .45rem .8rem; border-radius: 999px; }
  .chi { border: 0; padding: 0; }
  .chi-nome { text-align: right; font-size: .85rem; }
  .pagina { padding: 1.25rem 1rem 4rem; }
  h1 { font-size: 1.6rem; }
}

/* --- pannelli --- */
.briciole { font-size: .9rem; margin-bottom: .35rem; color: var(--tenue); }
.testata { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.testata h1, .testata h2 { margin: 0; }
.testata p { margin: .2rem 0 0; }
.testata > a:not(.btn) { font-size: .9rem; }
.scheda {
  background: var(--pannello); border: 1px solid var(--linea); border-radius: var(--raggio); padding: 1.35rem;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.scheda > h2, .scheda > .testata { margin-bottom: .9rem; }
.pila { display: grid; gap: 1rem; align-content: start; }
.colonne { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; margin-bottom: 1rem; }
@media (min-width: 1100px) { .colonne-larga { grid-template-columns: 1.6fr 1fr; } }
.griglia { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.vuoto { text-align: center; padding: 3rem 1rem; }
.vuoto h1, .vuoto h2 { margin-bottom: .5rem; }
.vuoto .codice { font-size: 4rem; font-weight: 800; color: var(--pannello-forte); margin: 0; line-height: 1; }

/* --- riquadri colorati --- */
.numeri, .tessere { display: grid; gap: .8rem; margin-bottom: 1rem; }
.numeri { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tessere { grid-template-columns: repeat(2, 1fr); }
.numero, .tessera {
  border-radius: var(--raggio); padding: 1rem 1.1rem; color: var(--scuro); text-decoration: none;
  display: flex; flex-direction: column; gap: .35rem; min-height: 112px; background: var(--azzurro);
}
.numero span, .tessera span { order: -1; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.numero strong, .tessera strong { font-size: 2.4rem; line-height: 1; font-weight: 500; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: auto; }
.tessera strong { font-size: 1.7rem; }
.tessera small { font-size: .8rem; font-weight: 500; }
a.numero { transition: transform .15s; }
a.numero:hover { transform: translateY(-2px); }
.numero:nth-child(1) { background: var(--azzurro); }
.numero:nth-child(2) { background: var(--viola); }
.numero:nth-child(3) { background: var(--arancio); }
.numero:nth-child(4) { background: var(--giallo); }
.numero:nth-child(5) { background: var(--verde); }
.c-giallo { background: var(--giallo); } .c-arancio { background: var(--arancio); } .c-rosso { background: var(--rosso); }
.c-viola { background: var(--viola); } .c-verde { background: var(--verde); } .c-azzurro { background: var(--azzurro); }
.c-grigio { background: #d7dce4; }
@media (prefers-reduced-motion: reduce) { a.numero { transition: none; } }

/* --- bottoni --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .93rem; line-height: 1.2;
  padding: .6rem 1.05rem; min-height: 42px; border-radius: var(--raggio-piccolo); cursor: pointer; text-decoration: none;
  background: var(--pannello-forte); color: var(--testo); border: 1px solid var(--linea);
}
.btn:hover { background: rgba(255, 255, 255, .17); }
.btn-primario { background: #fff; border-color: #fff; color: var(--scuro); }
.btn-primario:hover { background: #dfe5ee; }
.btn-pericolo { background: transparent; border-color: var(--rosso); color: var(--rosso); }
.btn-pericolo:hover { background: rgba(255, 138, 115, .14); }
.btn-fantasma { border-color: transparent; background: transparent; color: var(--tenue); }
.btn-piccolo { padding: .35rem .75rem; min-height: 34px; font-size: .84rem; border-radius: 10px; }
.btn-largo { width: 100%; }
.azioni { display: flex; flex-wrap: wrap; gap: .5rem; }
.zona-pericolo { margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--linea); }

/* --- avvisi e stati --- */
.avviso, .errore { padding: .8rem 1.1rem; border-radius: 16px; margin-bottom: 1rem; }
.avviso { background: rgba(143, 212, 255, .16); border: 1px solid rgba(143, 212, 255, .35); }
.avviso-ambra { background: var(--giallo); color: var(--scuro); border: 0; }
.avviso-rosso, .errore { background: var(--rosso); color: var(--scuro); border: 0; }
.errore { font-weight: 600; }
.avviso-ambra a, .avviso-rosso a { color: var(--scuro); font-weight: 600; }
.stato {
  display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; color: var(--scuro);
  font-size: .8rem; font-weight: 700; padding: .22rem .65rem; border-radius: 999px;
}
.stato-valida, .stato-r-consegnata { background: var(--verde); }
.stato-in_scadenza, .stato-r-in_attesa { background: var(--giallo); }
.stato-scaduta, .stato-r-rifiutata { background: var(--rosso); }
.stato-mancante { background: var(--pannello-forte); color: var(--testo); box-shadow: inset 0 0 0 1px var(--linea); }
.stato-r-approvata { background: var(--azzurro); }
.ruolo { font-size: .8rem; font-weight: 700; padding: .22rem .65rem; border-radius: 8px; background: var(--pannello-forte); white-space: nowrap; }
.ruolo-admin { background: #fff; color: var(--scuro); }
.ruolo-allenatore { background: var(--viola); color: var(--scuro); }

/* --- tabelle --- */
.scorri { overflow-x: auto; margin: 0 -1.35rem; padding: 0 1.35rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tenue); font-weight: 600; padding: .5rem .9rem .6rem 0; border-bottom: 1px solid var(--linea); white-space: nowrap; }
td { padding: .7rem .9rem .7rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
th:last-child, td:last-child { padding-right: 0; }
th.destra { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 600; text-decoration: none; color: var(--testo); }
td a:hover { text-decoration: underline; }

/* --- elenchi --- */
.dati { margin: 0; display: grid; }
.dati > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.dati > div:last-child { border-bottom: 0; }
.dati dt { color: var(--tenue); font-size: .9rem; white-space: nowrap; }
.dati dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.dati-compatti > div { padding: .3rem 0; border: 0; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.lista li:last-child { border-bottom: 0; }
.lista li > * { display: grid; padding: .6rem 0; text-decoration: none; color: inherit; }
.lista span { color: var(--tenue); font-size: .88rem; }
.lista a:hover strong { text-decoration: underline; }
.note { background: rgba(255, 255, 255, .06); border-radius: var(--raggio-piccolo); padding: .65rem .9rem; white-space: pre-line; }

.eventi { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.evento { display: grid; grid-template-columns: minmax(7.5rem, auto) 1fr auto; gap: .75rem; align-items: center; padding: .7rem .9rem; border-radius: 16px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--azzurro); }
.evento-partita { border-left-color: var(--arancio); }
.evento-altro { border-left-color: var(--tenue); }
.evento > div { display: grid; min-width: 0; }
.evento span { color: var(--tenue); font-size: .88rem; overflow-wrap: anywhere; }
.evento-quando strong { font-size: .92rem; }
@media (max-width: 520px) { .evento { grid-template-columns: 1fr auto; row-gap: .15rem; } .evento .evento-quando { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: baseline; } }

/* --- schede squadra, giocatore, richiesta --- */
.squadra { text-decoration: none; color: inherit; display: grid; gap: .35rem; transition: background .15s; }
.squadra:hover { background: var(--pannello-forte); }
.squadra p { margin: 0; }
.figli { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.figlio-testa { display: flex; align-items: center; gap: .9rem; }
.figlio-testa h1, .figlio-testa h2 { margin: 0; }
.figlio-testa h2 { font-size: 1.3rem; }
.figlio-testa p { margin: .15rem 0 0; }
.figlio .figlio-testa { margin-bottom: 1rem; }
.figlio .azioni { margin-top: 1.25rem; }
.maglia {
  flex: none; width: 3.5rem; height: 3.5rem; display: grid; place-items: center;
  background: var(--viola); color: var(--scuro); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.03em;
  border-radius: 16px; font-variant-numeric: tabular-nums;
}
.richiesta-testa { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; }
.richiesta-testa p { margin: .25rem 0 0; }
.richiesta .modulo { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--linea); }
.linguette { display: inline-flex; max-width: 100%; gap: .2rem; overflow-x: auto; margin-bottom: 1rem; padding: .3rem; border-radius: 16px; background: var(--pannello); border: 1px solid var(--linea); }
.linguette a { padding: .4rem .9rem; border-radius: 11px; text-decoration: none; color: #d5dbe4; white-space: nowrap; font-size: .9rem; font-weight: 500; }
.linguette a[aria-current] { background: rgba(255, 255, 255, .2); color: #fff; }
.certificato { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .06); margin-bottom: 1rem; }
.certificato p { margin: 0; }

/* --- moduli --- */
.modulo { display: grid; gap: 1rem; }
.modulo-stretto { max-width: 480px; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .88rem; }
label small { font-weight: 400; color: var(--tenue); }
input, select, textarea {
  font: inherit; color: var(--testo); width: 100%; min-height: 44px; padding: .5rem .8rem;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--raggio-piccolo); background: rgba(0, 0, 0, .28);
}
input::placeholder { color: #7f8896; }
input[type=file] { padding: .45rem; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .85rem; margin-right: .75rem; padding: .35rem .8rem; border-radius: 9px; border: 0; background: #fff; color: var(--scuro); cursor: pointer; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; min-height: 0; padding: 0; accent-color: var(--azzurro); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); font-weight: 600; margin-bottom: .7rem; }
.campi { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.campi-due { grid-template-columns: 1fr 1fr; }
.scelte { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.scelte-lunghe { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); max-height: 320px; overflow-y: auto; }
.scelta { display: flex; align-items: center; gap: .55rem; font-weight: 500; padding: .55rem .85rem; border: 1px solid var(--linea); border-radius: var(--raggio-piccolo); cursor: pointer; background: rgba(255, 255, 255, .03); }
.scelta:has(:checked) { border-color: var(--azzurro); background: rgba(143, 212, 255, .16); }
.modulo-riga { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.modulo-riga label { flex: 1 1 130px; }
.modulo-riga .cresce { flex: 3 1 220px; }
.filtri { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.filtri label { flex: 1 1 160px; max-width: 260px; }
.accesso h1 { margin-bottom: .4rem; }
.accesso .scheda { margin: 1.4rem 0 1rem; }

/* --- campi: tabella unica dell'occupazione --- */
.orario { table-layout: fixed; min-width: 620px; }
.orario thead th { font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--testo); font-weight: 700; padding-bottom: .8rem; }
.orario th:first-child { width: 7.2rem; }
.orario tbody th[scope=row] { font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--testo); vertical-align: top; padding-top: 1.1rem; white-space: normal; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.orario tbody th small { display: block; font-weight: 400; color: var(--tenue); }
.orario tbody tr:last-child th[scope=row] { border-bottom: 0; }
.orario td { vertical-align: top; padding: .5rem .9rem .5rem 0; }
.orario-sezione th { padding: 1.3rem 0 .5rem; border-bottom: 1px solid var(--linea); }
.pallino { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .5rem; background: var(--azzurro); }
.fascia { display: grid; grid-template-columns: 6.4rem 1fr; gap: .5rem; align-items: baseline; padding: .5rem .7rem; margin: .3rem 0; border-radius: 12px; background: rgba(255, 255, 255, .06); border-left: 4px solid var(--azzurro); }
.campo-0 { --c: var(--azzurro); } .campo-1 { --c: var(--viola); } .campo-2 { --c: var(--verde); } .campo-3 { --c: var(--giallo); }
.fascia, .pallino { border-left-color: var(--c); }
.pallino { background: var(--c); }
.fascia-ora { font-variant-numeric: tabular-nums; color: var(--tenue); white-space: nowrap; font-size: .9rem; }
.fascia-chi { font-weight: 600; }
.fascia-chi small { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: 8px; background: var(--pannello-forte); color: var(--tenue); }
.libero { display: block; padding: .8rem 0; color: rgba(164, 173, 186, .55); font-size: .88rem; }
.gestione { margin-top: 1rem; }
.gestione summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.gestione summary small { font-weight: 400; margin-left: .4rem; }
.gestione[open] summary { margin-bottom: .4rem; }
@media (max-width: 700px) {
  .orario { min-width: 0; }
  .orario thead { display: none; }
  .orario, .orario tbody, .orario tr, .orario th, .orario td { display: block; width: auto; }
  .orario tbody th[scope=row] { border: 0; padding: 1rem 0 0; font-size: 1.05rem; }
  .orario tbody th small { display: inline; }
  .orario td { padding: .2rem 0; border: 0; }
  .orario td::before { content: attr(data-campo); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tenue); margin-top: .5rem; }
  .libero { padding: .2rem 0; }
}

/* --- contatti di emergenza --- */
.emergenza { margin-bottom: 1rem; border-color: rgba(255, 138, 115, .45); }
.emergenza-numeri { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.chiama { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; align-items: center; padding: .8rem 1rem; border-radius: 16px; background: var(--rosso); color: var(--scuro); text-decoration: none; }
.chiama span { font-size: .85rem; font-weight: 600; }
.chiama strong { grid-column: 1; font-size: 1.35rem; letter-spacing: -0.01em; }
.chiama em { grid-row: 1 / span 2; grid-column: 2; font-style: normal; font-weight: 700; padding: .5rem .9rem; border-radius: 12px; background: var(--scuro); color: #fff; }
