/* ==========================================================================
   Torneo Bronze · sistema visivo
   Grigio e bianco, con un solo accento: un blu acceso, usato con il
   contagocce dove serve dare energia o segnalare uno stato (play-off,
   selezione, conferma). Nero/grigio scuro per le azioni forti.
   Niente badge, stelle o altra gamification: sofisticato, non un giochino.
   Raggi: superfici 20px, controlli 14px, tasselli numero 10px,
   pillola piena solo per segmented control e barra tab.

   Un solo font, Helvetica Neue, con tre soli pesi:
     --fw-light   300 · "Display": solo il titolo in testata. Grande e arioso.
     --fw-regular 400 · "Body": paragrafi, descrizioni, testo discorsivo.
     --fw-medium  500 · "Struttura": intestazioni, etichette, numeri, pulsanti,
                        titoli di riga (nomi squadra in elenco) — tutto ciò
                        che è piccolo o compatto e deve farsi notare.
   Mai semibold/bold: la gerarchia viene da dimensione e spaziatura, non dal peso.
   ========================================================================== */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #e9ebee;
  --ink: #16181c;
  --ink-2: #494d55;
  --muted: #80858e;
  --line: rgba(22, 24, 28, 0.08);
  --line-strong: rgba(22, 24, 28, 0.14);
  --accent: #0a66ff;          /* blu acceso: unico colore della pagina */
  --accent-ink: #ffffff;
  --danger: #c4281c;
  --glass: rgba(242, 243, 245, 0.78);
  --shadow: 0 1px 2px rgba(22, 24, 28, 0.05), 0 8px 26px rgba(22, 24, 28, 0.06);
  --scrim: rgba(10, 11, 13, 0.4);
  --wash: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);

  --r-surface: 20px;
  --r-control: 14px;
  --r-tile: 10px;

  /* Helvetica Neue è di sistema su iPhone e Mac; su Android e Windows ripiega su Helvetica/Arial */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --surface: #1b1d21;
    --surface-2: #26282d;
    --ink: #f1f2f4;
    --ink-2: #c6c9ce;
    --muted: #8c8f97;
    --line: rgba(241, 242, 244, 0.08);
    --line-strong: rgba(241, 242, 244, 0.15);
    --accent: #3b82ff;
    --accent-ink: #ffffff;
    --glass: rgba(18, 19, 22, 0.76);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --scrim: rgba(0, 0, 0, 0.55);
    --wash: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--fw-regular) 16px/1.5 var(--font); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; } /* Helvetica ha già cifre a larghezza fissa */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- testata ---------- */
.top { padding: calc(20px + env(safe-area-inset-top)) 0 20px; background: var(--wash); margin-bottom: -4px; }
.top .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; }
.top h1 { margin: 0; font-size: 32px; line-height: 1.05; font-weight: var(--fw-light); letter-spacing: -0.03em; }
.top p { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-weight: var(--fw-regular); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: var(--fw-regular); color: var(--muted); white-space: nowrap; padding-bottom: 3px; }
.status i { font-size: 15px; }
.status.live i { color: var(--ink); }

main.wrap { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.on { display: block; animation: view-in 320ms var(--out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

h2 { font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -0.02em; margin: 34px 0 14px; }
.h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.h-row h2 { margin-bottom: 12px; }
.note { color: var(--muted); font-size: 14px; font-weight: var(--fw-regular); margin: 10px 2px 0; }

/* ---------- scadenze ---------- */
.deadlines { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.deadline { background: var(--surface); border-radius: var(--r-control); padding: 12px 16px 14px; box-shadow: var(--shadow); }
.deadline .k { font-size: 13px; color: var(--muted); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline .num { font-size: 40px; font-weight: var(--fw-medium); letter-spacing: -0.02em; line-height: 1.05; margin-top: 2px; font-variant-numeric: tabular-nums; }
.deadline .num small { font-size: 15px; font-weight: var(--fw-regular); color: var(--muted); margin-left: 5px; }

/* ---------- segmented ---------- */
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 999px; gap: 2px; margin: 24px 0 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 999px; font-size: 15px; font-weight: var(--fw-medium); color: var(--muted); cursor: pointer; transition: background 200ms var(--out), color 200ms var(--out); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- tassello numero squadra ---------- */
.tile {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: var(--r-tile);
  background: var(--surface-2); color: var(--ink);
  font-size: 17px; font-weight: var(--fw-medium); line-height: 1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.tile.sm { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
.tile.lg { width: 56px; height: 56px; font-size: 26px; border-radius: 14px; }
.tile.xl { width: 72px; height: 72px; font-size: 34px; border-radius: 18px; background: var(--wash); }

/* ---------- classifica ---------- */
.gironi { display: grid; gap: 24px; }
.board { background: var(--surface); border-radius: var(--r-surface); box-shadow: var(--shadow); overflow: hidden; }
.board-head, .rowt { display: grid; grid-template-columns: 22px 1fr 30px 50px; align-items: center; gap: 10px; padding: 0 16px; }
.board-head { height: 42px; font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); }
.board-head .r, .rowt .r { text-align: right; }
.board-title { display: none; padding: 18px 16px 6px; font-size: 18px; font-weight: var(--fw-medium); letter-spacing: -0.015em; }
.rowt { min-height: 68px; border-top: 1px solid var(--line); width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: transparent; text-align: left; cursor: pointer; position: relative; transition: background 160ms var(--out); }
.rowt:active { background: var(--surface-2); }
@media (hover: hover) { .rowt:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); } }
.rowt .pos { font-size: 16px; font-weight: var(--fw-medium); color: var(--muted); font-variant-numeric: tabular-nums; }
.rowt .team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rowt .team .nm { font-size: 16px; font-weight: var(--fw-medium); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rowt .g { font-size: 15px; font-weight: var(--fw-regular); color: var(--muted); font-variant-numeric: tabular-nums; }
.rowt .pt { font-size: 23px; font-weight: var(--fw-medium); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rowt.po::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rowt.po .tile { background: var(--accent); color: var(--accent-ink); }
.rowt.cut { border-top: 1px dashed var(--line-strong); }
.rowt.out { cursor: default; }
.rowt.out .team .nm, .rowt.out .pt, .rowt.out .tile { opacity: 0.42; }
.rowt .tag { display: block; font-size: 12px; font-weight: var(--fw-medium); color: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: var(--fw-regular); margin: 12px 4px 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); display: inline-block; }

@media (max-width: 899px) { .board[data-hidden] { display: none; } }
@media (min-width: 900px) {
  .top h1 { font-size: 40px; }
  .gironi.both { grid-template-columns: 1fr 1fr; }
  .gironi.both .board-title { display: block; }
  #seg-class { display: none; }
}

/* ---------- liste partite ---------- */
.day { margin-top: 24px; }
.day-h { font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); margin: 0 4px 8px; }
.day-h::first-letter { text-transform: uppercase; }
.list { background: var(--surface); border-radius: var(--r-surface); box-shadow: var(--shadow); overflow: hidden; }
.match { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 16px; border-top: 1px solid var(--line);
  border-left: 0; border-right: 0; border-bottom: 0; background: transparent; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: background 160ms var(--out); }
.match:first-child { border-top: 0; }
.match:active { background: var(--surface-2); }
@media (hover: hover) { .match:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); } }
.match-go { font-size: 16px; color: var(--muted); }
.side { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; }
.side .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: var(--fw-regular); color: var(--muted); }
.side .sc { margin-left: auto; font-size: 18px; font-weight: var(--fw-medium); color: var(--muted); padding-left: 8px; font-variant-numeric: tabular-nums; }
.side.w .nm, .side.w .sc { color: var(--ink); font-weight: var(--fw-medium); }
.giochi-det { font-size: 12px; font-weight: var(--fw-regular); color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.match .meta { font-size: 12px; color: var(--muted); text-align: right; align-self: start; padding-top: 6px; display: none; }
.girone-chip { font-size: 12px; color: var(--muted); }

/* ---------- calendario, stile agenda ---------- */
.month-h { font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -0.02em; margin: 28px 4px 10px; }
.month-h::first-letter { text-transform: uppercase; }
.month-h:first-child { margin-top: 4px; }
.agenda { background: var(--surface); border-radius: var(--r-surface); box-shadow: var(--shadow); overflow: hidden; }
.agenda-row { display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: center; padding: 18px 16px; border-top: 1px solid var(--line); }
.agenda-row:first-child { border-top: 0; }
.date-chip { width: 58px; height: 58px; border-radius: 15px; background: var(--surface-2); display: grid; justify-items: center; align-content: center; line-height: 1.15; align-self: start; }
.date-chip .dow { font-size: 11px; font-weight: var(--fw-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.date-chip .num { font-size: 24px; font-weight: var(--fw-medium); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.agenda-row.oggi .date-chip { background: var(--ink); }
.agenda-row.oggi .date-chip .dow, .agenda-row.oggi .date-chip .num { color: var(--bg); }
.agenda-row.overdue .date-chip { background: color-mix(in srgb, var(--danger) 14%, var(--surface-2)); }
.agenda-row.overdue .date-chip .num, .agenda-row.overdue .date-chip .dow { color: var(--danger); }
.agenda-body { display: grid; gap: 6px; min-width: 0; }
.agenda-body .side { padding: 0; gap: 10px; }
.agenda-body .side .nm { font-size: 16px; font-weight: var(--fw-medium); color: var(--ink); white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.agenda-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; font-weight: var(--fw-regular); color: var(--muted); }
.agenda-meta .time { font-weight: var(--fw-medium); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tag-overdue { color: var(--danger); font-weight: var(--fw-medium); }
.cal-empty-ora { color: var(--muted); font-style: italic; }

/* ---------- stati vuoti / caricamento ---------- */
.empty { background: var(--surface); border-radius: var(--r-surface); box-shadow: var(--shadow); padding: 32px 20px; text-align: center; color: var(--muted); font-size: 15px; font-weight: var(--fw-regular); }
.empty i { font-size: 28px; color: var(--ink-2); display: block; margin-bottom: 8px; }
.skeleton { height: 360px; border-radius: var(--r-surface); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; margin-top: 24px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- barra tab (materiale traslucido) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
}
.tabbar nav { max-width: 420px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; height: var(--tabbar-h); }
.tab { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: var(--fw-medium); color: var(--muted); cursor: pointer; padding: 6px 0; transition: transform 120ms var(--out); }
.tab i { font-size: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab:active { transform: scale(0.94); }
.tab.add .plus { width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.tab.add .plus i { font-size: 22px; }
.tab.add { color: var(--ink); }
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--bg); backdrop-filter: none; } }

/* ---------- foglio (sheet) ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity 360ms var(--spring); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top)); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0;
  transform: translateY(105%); transition: transform 460ms var(--spring); will-change: transform;
  box-shadow: 0 -8px 40px rgba(0,0,0,.12);
}
.sheet.open { transform: translateY(0); }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet-grab { padding: 8px 0 4px; cursor: grab; touch-action: none; flex: none; }
.sheet-grab::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 8px; flex: none; touch-action: none; }
.sheet-head h3 { margin: 0; font-size: 20px; font-weight: var(--fw-medium); letter-spacing: -0.015em; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn i { font-size: 18px; }
.sheet-body { padding: 4px 20px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 700px) {
  .sheet { bottom: auto; top: 50%; border-radius: 24px; transform: translateY(-46%) scale(.98); opacity: 0; transition: transform 360ms var(--spring), opacity 240ms var(--out); pointer-events: none; max-height: min(760px, calc(100dvh - 48px)); }
  .sheet.open { transform: translateY(-50%); opacity: 1; pointer-events: auto; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 20px; }
}

/* passi del modulo */
.step-k { font-size: 13px; font-weight: var(--fw-regular); color: var(--muted); margin: 0 0 12px; }
.slots { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 8px; margin-bottom: 16px; }
.slot { border: 1.5px dashed var(--line-strong); border-radius: var(--r-control); min-height: 76px; padding: 10px; display: grid; justify-items: center; align-content: center; gap: 6px; background: transparent; cursor: pointer; text-align: center; }
.slot .ph { color: var(--muted); font-size: 14px; font-weight: var(--fw-regular); }
.slot.filled { border-style: solid; border-color: var(--ink); }
.slot .nm { font-size: 13px; font-weight: var(--fw-medium); line-height: 1.25; }
.slots .x { text-align: center; color: var(--muted); font-size: 13px; font-weight: var(--fw-regular); }
.grid-lab { font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); margin: 16px 0 8px; }
.picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pick { border: 0; border-radius: var(--r-control); background: var(--surface-2); padding: 18px 10px 16px; cursor: pointer; display: grid; justify-items: center; gap: 5px; text-align: center; transition: transform 120ms var(--out), background 160ms var(--out), opacity 200ms var(--out); }
.pick b { font-size: 30px; font-weight: var(--fw-medium); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1; }
.pick small { font-size: 14px; font-weight: var(--fw-regular); color: var(--muted); line-height: 1.25; }
.pick:active { transform: scale(0.96); }
.pick[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pick[aria-pressed="true"] small { color: inherit; opacity: .7; }
.pick:disabled { opacity: 0.28; cursor: not-allowed; }
@media (min-width: 460px) { .picker { grid-template-columns: repeat(3, 1fr); } }
.info { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: var(--r-control); padding: 12px 14px; font-size: 14px; font-weight: var(--fw-regular); color: var(--ink-2); margin-top: 16px; }
.info i { font-size: 18px; margin-top: 1px; }
.info a { color: var(--accent); font-weight: var(--fw-medium); text-decoration: none; }
.info + .info { margin-top: 8px; }
.info.err { color: var(--danger); }

/* punteggio set per set: campi da tastiera, non contatori a tocco ripetuto */
.sets { display: grid; gap: 10px; margin-bottom: 4px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface-2); border-radius: var(--r-control); padding: 14px 20px; }
.setrow .lab { font-size: 15px; font-weight: var(--fw-medium); color: var(--muted); }
.setfields { display: flex; align-items: center; gap: 10px; }
.setfield {
  width: 56px; height: 56px; border-radius: var(--r-control); border: 1.5px solid transparent;
  background: var(--surface); text-align: center; font-family: var(--font); font-size: 24px;
  font-weight: var(--fw-medium); color: var(--ink); font-variant-numeric: tabular-nums; padding: 0;
}
.setfield::placeholder { color: var(--line-strong); }
.setfield:focus { outline: none; border-color: var(--accent); }
.setfields .x { color: var(--muted); font-size: 16px; }
.set-summary { text-align: center; font-size: 14px; font-weight: var(--fw-regular); color: var(--muted); margin: 10px 0 16px; }
.set-summary b { font-weight: var(--fw-medium); color: var(--ink); font-variant-numeric: tabular-nums; font-size: 17px; }

.score-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.score-head div { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: var(--fw-medium); min-width: 0; }
.score-head div:last-child { justify-content: flex-end; text-align: right; }
.score-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.score { border: 0; border-radius: var(--r-control); background: var(--surface-2); padding: 14px 12px; cursor: pointer; display: grid; gap: 2px; text-align: center; transition: transform 120ms var(--out), background 160ms var(--out); }
.score b { font-size: 28px; font-weight: var(--fw-medium); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.score small { font-size: 12px; font-weight: var(--fw-regular); color: var(--muted); }
.score:active { transform: scale(0.97); }
.score[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.score[aria-pressed="true"] small { color: inherit; opacity: .75; }
.scores.three { grid-template-columns: repeat(3, 1fr); }
.scores.three .score b { font-size: 19px; white-space: nowrap; letter-spacing: -0.03em; }
.scores.three .score { padding: 14px 4px; }
.disclose { border: 0; background: none; padding: 14px 0 4px; color: var(--ink-2); font-size: 15px; font-weight: var(--fw-medium); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.disclose i { transition: transform 240ms var(--out); }
.disclose[aria-expanded="true"] i { transform: rotate(90deg); }
.more { display: none; }
.more.on { display: block; animation: view-in 280ms var(--out); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 0; border-radius: 999px; background: var(--surface-2); padding: 9px 16px; font-size: 15px; font-weight: var(--fw-medium); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
input[type=date], input[type=time], input[type=password], select {
  font-family: var(--font); font-size: 16px; font-weight: var(--fw-medium); color: var(--ink); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: var(--r-control); padding: 11px 14px; min-height: 46px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--ink); }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); }

.actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--surface) 70%, transparent); padding-top: 16px; margin-top: 8px; display: grid; gap: 4px; }
.btn { border: 0; border-radius: var(--r-control); background: var(--ink); color: var(--bg); min-height: 54px; padding: 0 20px; font-size: 17px; font-weight: var(--fw-medium); cursor: pointer; transition: transform 120ms var(--out), opacity 160ms; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.25; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink-2); min-height: 44px; font-size: 15px; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; min-height: 36px; font-size: 14px; padding: 0 12px; }

/* riepilogo / tabellone */
.scoreboard { background: var(--surface-2); border-radius: var(--r-surface); padding: 6px 16px; }
.scoreboard .side { padding: 12px 0; }
.scoreboard .side + .side { border-top: 1px solid var(--line); }
.scoreboard .side .nm { font-size: 16px; }
.scoreboard .tile, .stats + .tile, .info .tile { background: var(--surface); }
.scoreboard .side .sc { font-size: 32px; }
.done { text-align: center; padding: 24px 0 8px; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin: 0 auto 12px; animation: pop 520ms var(--spring); }
.done .check i { font-size: 32px; }
.done p { margin: 0; color: var(--muted); font-weight: var(--fw-regular); }
.done h4 { margin: 0 0 4px; font-size: 20px; font-weight: var(--fw-medium); letter-spacing: -0.015em; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* scheda squadra */
.team-hero { display: flex; align-items: center; gap: 16px; padding: 4px 0 16px; }
.team-hero h4 { margin: 0; font-size: 22px; font-weight: var(--fw-medium); line-height: 1.15; letter-spacing: -0.02em; }
.team-hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-weight: var(--fw-regular); }
.captain-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-radius: var(--r-control);
  padding: 14px 16px; margin-bottom: 16px; text-decoration: none; color: inherit;
}
.captain-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.captain-who i { font-size: 26px; color: var(--accent); flex: none; }
.captain-who > span { display: flex; flex-direction: column; min-width: 0; }
.captain-lab { font-size: 11px; font-weight: var(--fw-medium); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.captain-nm { font-size: 16px; font-weight: var(--fw-medium); }
.captain-tel { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: var(--fw-medium); padding: 9px 14px; border-radius: 999px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-control); overflow: hidden; }
.stats div { background: var(--surface-2); padding: 12px; }
.stats b { display: block; font-size: 22px; font-weight: var(--fw-medium); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats small { color: var(--muted); font-size: 12px; font-weight: var(--fw-regular); }
.res { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.setn { font-size: 13px; font-weight: var(--fw-regular); color: var(--muted); min-width: 92px; }
.setscore { font-size: 20px; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; color: var(--muted); display: flex; gap: 8px; }
.setscore .x { color: var(--line-strong); font-weight: var(--fw-regular); }
.setscore .w { color: var(--ink); }
.res:first-child { border-top: 0; }
.res .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-regular); }
.res .when { font-size: 12px; color: var(--muted); font-weight: var(--fw-regular); }
.res .pts { font-size: 16px; font-weight: var(--fw-medium); text-align: right; font-variant-numeric: tabular-nums; }
.res .pts small { display: block; font-size: 12px; font-weight: var(--fw-regular); color: var(--muted); }
.todo { display: flex; flex-wrap: wrap; gap: 8px; }
.todo span { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: var(--r-control); padding: 6px 12px 6px 6px; font-size: 14px; font-weight: var(--fw-regular); }
.todo em { font-style: normal; color: var(--muted); font-size: 12px; }

/* toast */
.toast { position: fixed; z-index: 30; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -140%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: var(--fw-medium); transition: transform 420ms var(--spring); display: flex; gap: 8px; align-items: center; }
.toast.show { transform: translate(-50%, 0); }

/* comparsa a cascata delle righe */
.stagger > * { animation: rise 420ms var(--out) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.quiet .stagger > *, .quiet .view.on { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .sheet, .scrim, .toast { transition: opacity 180ms ease !important; }
  .sheet:not(.open) { opacity: 0; }
}

/* ---------- area organizzatore ---------- */
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.admin-row:first-child { border-top: 0; }
.admin-row .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; font-weight: var(--fw-medium); }
.admin-row .s { font-size: 13px; color: var(--muted); font-weight: var(--fw-regular); margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
