/* ============================================================
   Calendario Calcio — design system

   Stessa famiglia del Gestionale Commerciale: impianto Apple (SF,
   gerarchia di grigi, materiali traslucidi) su fondo azzurrino, raggi
   ampi e tipografia a tracking stretto. I token qui sotto sono gli
   stessi, così le due app si somigliano davvero invece di assomigliarsi
   a occhio; cambiano solo i componenti propri del calcio.

   Misure pensate per iPhone 16 Pro (393 pt di larghezza, isola
   dinamica in alto, barra di sistema in basso): tutto il layout vive
   dentro le safe area e nessun comando finisce sotto il pollice.
   ============================================================ */

/* ---------- token ---------- */

:root {
  --bg: #DFF2FD;
  --bg-elev: rgba(255, 255, 255, .60);
  --bg-sunken: #D0E9F8;
  --glass: saturate(170%) blur(20px);

  --text: #17405F;
  --text-2: rgba(24, 64, 95, .66);
  --text-3: rgba(24, 64, 95, .40);

  --fill1: rgba(47, 168, 238, .26);
  --fill2: rgba(47, 168, 238, .18);
  --fill3: rgba(47, 168, 238, .12);
  --sep: rgba(18, 57, 94, .13);

  --accent: #2FA8EE;
  --accent-2: #54BCF5;
  --accent-soft: rgba(47, 168, 238, .14);
  --ink: #12395E;
  --green: #1FA35C;
  --red: #E74C3C;
  --orange: #F9B234;

  --accent-fill: color-mix(in srgb, var(--accent) 50%, #072A45);
  --tile-surface: #F2FAFE;

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --shadow-1: 0 1px 2px rgba(18, 57, 94, .05), 0 6px 20px rgba(18, 57, 94, .07);
  --shadow-2: 0 2px 6px rgba(18, 57, 94, .08), 0 16px 40px rgba(18, 57, 94, .13);
  --shadow-pop: 0 -2px 10px rgba(18, 57, 94, .07), 0 -20px 60px rgba(18, 57, 94, .2);

  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: 16px;
  --maxw: 560px;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);

  color-scheme: light dark;
}

/* Scuro: stessa famiglia, virata sul navy profondo invece che sul nero. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071726;
    --bg-elev: rgba(23, 64, 95, .46);
    --bg-sunken: #04101B;
    --text: #EAF6FE;
    --text-2: rgba(217, 238, 252, .64);
    --text-3: rgba(217, 238, 252, .36);
    --fill1: rgba(84, 188, 245, .30);
    --fill2: rgba(84, 188, 245, .20);
    --fill3: rgba(84, 188, 245, .14);
    --sep: rgba(147, 199, 232, .20);
    --accent: #54BCF5;
    --accent-2: #3FB1F0;
    --accent-soft: rgba(84, 188, 245, .20);
    --ink: #EAF6FE;
    --green: #2ECC71;
    --red: #FF6B5E;
    --tile-surface: #0F2941;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
    --shadow-pop: 0 -20px 60px rgba(0, 0, 0, .65);
  }
}

/* preferenza esplicita dell'utente: vince sul sistema */
:root[data-theme="dark"] {
  --bg: #071726;
  --bg-elev: rgba(23, 64, 95, .46);
  --bg-sunken: #04101B;
  --text: #EAF6FE;
  --text-2: rgba(217, 238, 252, .64);
  --text-3: rgba(217, 238, 252, .36);
  --fill1: rgba(84, 188, 245, .30);
  --fill2: rgba(84, 188, 245, .20);
  --fill3: rgba(84, 188, 245, .14);
  --sep: rgba(147, 199, 232, .20);
  --accent: #54BCF5;
  --accent-2: #3FB1F0;
  --accent-soft: rgba(84, 188, 245, .20);
  --ink: #EAF6FE;
  --green: #2ECC71;
  --red: #FF6B5E;
  --tile-surface: #0F2941;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 12px 40px rgba(0, 0, 0, .55);
  --shadow-pop: 0 -20px 60px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

/* ---------- base ---------- */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  /* Due aloni fissi, azzurro e ambra: danno la profondità che rende
     percepibile la trasparenza delle superfici sopra. */
  background: var(--bg);
  background-image:
    radial-gradient(115% 75% at -5% -5%, rgba(84, 188, 245, .38), transparent 60%),
    radial-gradient(95% 65% at 105% 8%, rgba(249, 178, 52, .16), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.01em;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: none; cursor: pointer; }
input { background: none; border: none; outline: none; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }

.num, .m-when b, .g, .d-score { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-soft); }

/* ---------- impianto ---------- */

#app {
  max-width: var(--maxw);
  margin-inline: auto;
  min-height: 100dvh;
  position: relative;
}

.view {
  padding: 12px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 40px);
}
.view.anima { animation: viewIn .34s var(--ease) both; }
.view > *:first-child { margin-top: 0; }

@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- barra superiore ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(var(--safe-t) + 8px) var(--gutter) 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--safe-t) + 50px);
  border-bottom: .5px solid var(--sep);
}

.topbar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .sub {
  font-size: 12.5px; font-weight: 500; color: var(--text-2); letter-spacing: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .title-wrap { flex: 1; min-width: 0; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--fill3);
  flex: none;
  transition: transform .15s var(--spring), background .15s;
}
.icon-btn:active { transform: scale(.9); background: var(--fill1); }
.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn.plain { background: none; }

/* mentre si scarica, l'icona dell'aggiornamento gira */
body.carico [data-aggiorna] svg { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- titoli di sezione ---------- */

.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-2);
  margin: 20px 4px 8px;
  display: flex; align-items: center; gap: 6px;
}
.section-title .n { color: var(--text-3); font-weight: 600; }

/* ---------- schede e liste ---------- */

.card, .list, .sq-head, .field-group {
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: .5px solid rgba(255, 255, 255, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .list,
  :root:not([data-theme="light"]) .sq-head, :root:not([data-theme="light"]) .field-group {
    border-color: rgba(147, 199, 232, .14);
  }
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .list,
:root[data-theme="dark"] .sq-head, :root[data-theme="dark"] .field-group {
  border-color: rgba(147, 199, 232, .14);
}

.card {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 16px;
  margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }
.card.flush { padding: 0; overflow: hidden; }

.list {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
}
.list.flush { padding: 0; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  position: relative;
  width: 100%;
  text-align: left;
  transition: background .12s;
}
.row + .row::before {
  content: ''; position: absolute; left: 56px; right: 0; top: 0;
  height: .5px; background: var(--sep);
}
.row:active { background: var(--fill3); }
.row.tap { cursor: pointer; }

.row .ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px; flex: none;
}
.row .body { flex: 1; min-width: 0; }
.row .t { display: block; font-size: 16px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .spunta { color: var(--accent); font-weight: 700; }

.muted { color: var(--text-2); }

/* intestazione di giornata, appiccicata in alto mentre si scorre */
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  margin-top: 14px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  font-weight: 700; font-size: 13px;
  letter-spacing: .3px;
  color: var(--text-2);
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  position: sticky; top: calc(var(--safe-t) + 50px); z-index: 5;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.group-head .total { margin-left: auto; font-weight: 650; color: var(--text-3); }
.group-head + .list { margin-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- riga partita ---------- */

/* Tre colonne: quando, chi, come sta andando. L'occhio scorre la
   colonna di mezzo e trova gli orari sempre allo stesso posto. */
.match {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  position: relative;
  text-align: left;
  transition: background .12s;
}
.match + .match::before {
  content: ''; position: absolute; left: 64px; right: 0; top: 0;
  height: .5px; background: var(--sep);
}
.match:active { background: var(--fill3); }

.m-when { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.m-when b { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.m-when small { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-3); text-align: center; line-height: 1.1; }

.m-teams { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-team .n {
  font-size: 15.5px; font-weight: 550; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-team .g { font-size: 16px; font-weight: 750; letter-spacing: -.3px; flex: none; min-width: 14px; text-align: right; }
.m-team .g.velato { color: var(--text-3); font-weight: 600; }
/* chi ha perso sbiadisce: il colpo d'occhio dice il risultato senza leggere */
.m-team.persa .n, .m-team.persa .g { color: var(--text-2); font-weight: 500; }
.m-team.vinta .n { font-weight: 700; }
.m-team.focus .n { color: var(--accent); }

.crest {
  width: 22px; height: 22px; flex: none;
  object-fit: contain;
  border-radius: 4px;
}
.crest.testo {
  display: grid; place-items: center;
  font-size: 8.5px; font-weight: 800; letter-spacing: -.2px;
  border-radius: 6px;
}
.crest.sm { width: 18px; height: 18px; }
.crest.sm.testo { font-size: 7px; }
.crest.lg { width: 46px; height: 46px; }
.crest.lg.testo { font-size: 15px; border-radius: 14px; }
.crest.xl { width: 62px; height: 62px; }
.crest.xl.testo { font-size: 20px; border-radius: 20px; }

.m-state { flex: none; display: flex; align-items: center; justify-content: flex-end; }

/* ---------- pillole di stato ---------- */

.pill {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 750; letter-spacing: .1px;
  white-space: nowrap;
}
.pill.live {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--red);
  animation: battito 2s ease-in-out infinite;
}
@keyframes battito { 50% { opacity: .55; } }
.pill.fine { background: var(--fill3); color: var(--text-3); }
.pill.rinv { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  background: var(--fill3); color: var(--text-2);
  font-size: 11.5px; font-weight: 650;
}

/* ---------- segmenti e pastiglie di filtro ---------- */

.segmented {
  display: flex; background: var(--fill3); border-radius: 11px; padding: 2px; gap: 2px;
  margin-bottom: 12px;
}
.segmented button {
  flex: 1; padding: 8px 4px; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  transition: background .18s var(--ease), transform .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.segmented button[aria-selected="true"] { background: var(--bg-elev); box-shadow: var(--shadow-1); font-weight: 650; }
.segmented button:active { transform: scale(.97); }

/* Scorrono in orizzontale oltre il bordo dello schermo: su un telefono
   sei bandiere non stanno in riga, e tagliarle a metà invita a scorrere. */
.chips {
  display: flex; gap: 7px; overflow-x: auto;
  padding: 2px var(--gutter) 10px;
  margin: 0 calc(var(--gutter) * -1);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 13px; border-radius: 999px; background: var(--fill3);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; flex: none;
  transition: transform .15s var(--spring), background .18s, color .18s;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px;
}
.chip[aria-pressed="true"] { background: var(--accent-fill); color: #fff; }
.chip:active { transform: scale(.94); }
.chip .fl { font-size: 15px; line-height: 1; }

/* ---------- avvisi ---------- */

.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 550; line-height: 1.35;
  margin-bottom: 12px;
  width: 100%; text-align: left;
}
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.filtro { color: var(--text); background: var(--fill3); }
.notice .x { margin-left: auto; opacity: .6; flex: none; padding: 4px; color: inherit; display: grid; place-items: center; }
.notice .x svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- ricerca ---------- */

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--fill3); border-radius: 11px; padding: 9px 12px;
  margin-bottom: 12px;
}
.search-bar input { flex: 1; font-size: 16px; min-width: 0; }
.search-bar input::placeholder { color: var(--text-3); }
.search-bar .i { color: var(--text-3); display: grid; place-items: center; }
.search-bar .i svg { width: 15px; height: 15px; fill: currentColor; }
.search-bar .x { color: var(--text-3); font-size: 15px; padding: 0 2px; }

/* ---------- elenco squadre ---------- */

.row.squadra { padding: 0; gap: 0; }
.row.squadra .apri {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px 11px 14px;
  text-align: left;
}
.row.squadra .cuore {
  flex: none; width: 48px; align-self: stretch;
  display: grid; place-items: center;
  color: var(--text-3);
  transition: transform .18s var(--spring), color .2s;
}
.row.squadra .cuore svg { width: 19px; height: 19px; fill: currentColor; }
.row.squadra .cuore.on { color: var(--red); }
.row.squadra .cuore:active { transform: scale(.85); }

/* ---------- scheda squadra ---------- */

.sq-head {
  background: var(--bg-elev);
  border-radius: var(--r-xl);
  padding: 18px;
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
  display: flex; gap: 14px; align-items: center;
  position: relative; overflow: hidden;
}
/* velo del colore sociale: identifica la squadra senza urlare */
.sq-head::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tinta) 18%, transparent), transparent 62%);
  pointer-events: none;
}
.sq-head .info { flex: 1; min-width: 0; position: relative; }
.sq-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.7px; line-height: 1.2; }
.sq-head .ref { font-size: 14px; color: var(--text-2); font-weight: 550; margin-top: 2px; }
.sq-head .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- foglio: dettaglio partita ---------- */

.d-head {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: start; gap: 8px;
  padding: 6px 0 20px;
}
.d-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.d-team .n { font-size: 15px; font-weight: 700; text-align: center; letter-spacing: -.3px; line-height: 1.25; }
.d-team .mini { font-size: 11.5px; font-weight: 650; color: var(--accent); }
.d-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; }
.d-score { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; display: flex; align-items: center; gap: 6px; }
.d-score span { color: var(--text-3); font-weight: 500; }
.d-time { font-size: 30px; font-weight: 800; letter-spacing: -1.2px; }
.d-when { font-size: 12px; font-weight: 650; color: var(--text-2); text-align: center; }

/* ---------- moduli ---------- */

.field-group {
  background: var(--bg-elev);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
}
.field {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  position: relative;
  min-height: 50px;
  width: 100%;
}
.field + .field::before {
  content: ''; position: absolute; left: 14px; right: 0; top: 0; height: .5px; background: var(--sep);
}
.field .k { font-size: 16px; font-weight: 500; flex: 1; color: var(--text); }

.field-note { font-size: 12.5px; color: var(--text-2); padding: 0 6px 14px; line-height: 1.45; }

.switch { width: 51px; height: 31px; border-radius: 999px; background: var(--fill1); position: relative; flex: none; transition: background .25s var(--ease); }
.switch[aria-checked="true"] { background: var(--green); }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
  transition: transform .25s var(--spring);
}
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- pulsanti ---------- */

.btn {
  display: block; width: 100%;
  padding: 14px; border-radius: var(--r-sm);
  font-size: 16.5px; font-weight: 650;
  background: var(--bg-elev); color: var(--accent);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border: .5px solid var(--sep);
  transition: transform .15s var(--spring), opacity .15s;
  text-align: center;
  box-shadow: var(--shadow-1);
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; box-shadow: none; }
.btn.primary { background: var(--accent-fill); color: #fff; border-color: transparent; }
.btn.secondary { background: var(--fill3); color: var(--accent); box-shadow: none; }
.btn.danger { background: var(--fill3); color: var(--red); box-shadow: none; }
.btn + .btn { margin-top: 10px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin: 0; }

/* ---------- stato vuoto ---------- */

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .e { font-size: 42px; margin-bottom: 12px; opacity: .9; }
.empty h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 5px; letter-spacing: -.3px; }
.empty p { font-size: 14.5px; line-height: 1.45; max-width: 320px; margin-inline: auto; }

/* ---------- barra a schede ---------- */

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex;
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(26px);
  -webkit-backdrop-filter: saturate(180%) blur(26px);
  border-top: .5px solid var(--sep);
  max-width: var(--maxw);
  margin-inline: auto;
}
.tabbar button {
  flex: 1; height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 10.5px; font-weight: 600;
  transition: color .18s;
  position: relative;
}
.tabbar button svg { width: 24px; height: 24px; fill: currentColor; transition: transform .22s var(--spring); }
.tabbar button[aria-current="page"] { color: var(--accent); }
.tabbar button[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
.tabbar button:active svg { transform: scale(.86); }
.tabbar .badge {
  position: absolute; top: 6px; left: 56%;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- tira per aggiornare ---------- */

.pull {
  position: fixed; top: calc(var(--safe-t) + 54px); left: 50%;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-elev); color: var(--text-3);
  box-shadow: var(--shadow-1);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  transform: translate(-50%, -60px);
  transition: color .2s, background .2s;
  z-index: 39; pointer-events: none;
}
.pull svg { width: 17px; height: 17px; fill: currentColor; }
.pull.pronto { color: var(--accent); background: var(--accent-soft); }
body.carico .pull { animation: gira 1s linear infinite; }

/* ---------- fogli modali ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .28s var(--ease) both;
  display: flex; align-items: flex-end; justify-content: center;
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  background: var(--bg);
  background-image:
    radial-gradient(120% 60% at 0% 0%, rgba(84, 188, 245, .30), transparent 62%),
    radial-gradient(100% 50% at 100% 4%, rgba(249, 178, 52, .14), transparent 58%);
  width: 100%; max-width: var(--maxw);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-pop);
  max-height: 92dvh;
  display: flex; flex-direction: column;
  animation: sheetUp .42s var(--ease) both;
  overflow: hidden;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet.closing { animation: sheetDown .28s var(--ease) both; }
@keyframes sheetDown { to { transform: translateY(100%); } }

.sheet-grab { padding: 8px 0 2px; display: grid; place-items: center; flex: none; }
.sheet-grab span { width: 36px; height: 5px; border-radius: 999px; background: var(--fill1); }

.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 14px 12px; flex: none; }
.sheet-head h2 { flex: 1; font-size: 17px; font-weight: 700; letter-spacing: -.4px; text-align: center; }
.sheet-head .act { font-size: 16px; font-weight: 600; color: var(--accent); padding: 4px; min-width: 62px; text-align: left; }
.sheet-head .act.right { text-align: right; font-weight: 650; }

.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 var(--gutter) calc(var(--safe-b) + 24px);
  flex: 1;
}

/* ---------- avvisi temporanei ---------- */

.toast-host {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px);
  z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 20px;
}
.toast {
  background: color-mix(in srgb, var(--text) 88%, transparent);
  color: var(--bg);
  padding: 11px 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: toastIn .34s var(--spring) both;
  max-width: 100%; text-align: center;
}
.toast.out { animation: toastOut .26s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* ---------- accessibilità e rifiniture ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Schermi stretti (iPhone mini, SE): i nomi lunghi hanno bisogno di più
   spazio, quindi la colonna dell'ora si restringe. */
@media (max-width: 375px) {
  .match { grid-template-columns: 48px 1fr auto; gap: 8px; }
  .m-team .n { font-size: 15px; }
  .chip { padding: 7px 11px; font-size: 13px; }
}
