/* PadelDraw – stile. Palette dal logo: navy, blu, lime pallina. */
:root {
  --navy: #0B1533;
  --navy-2: #14214a;
  --blue: #2563EB;
  --blue-2: #1D4ED8;
  --blue-soft: #e8efff;
  --lime: #C8E81A;
  --lime-soft: #f4fbd2;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--navy); }

/* --- Barra superiore --- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px; }
.topbar a { color: #fff; }
/* Zona sopra il logo (barra di stato del telefono, app aperta dalla schermata Home): tutta blu come la barra, senza sfumature.
   Il telefono colora quella zona partendo dal colore di fondo della pagina: qui il fondo è blu e il grigio chiaro sta solo dentro #app. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { background: var(--navy); }
  #app { background: var(--bg); min-height: 100vh; min-height: 100dvh; }
}
/* striscia fissa e sempre presente sotto la barra di stato: niente contenuti che scorrono lì sotto, anche cambiando pagina */
.sbar { display: none; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--navy); z-index: 31; pointer-events: none; }
body:has(.topbar) .sbar { display: block; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-style: italic; font-size: 1.25rem; letter-spacing: -.03em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { color: #4F8BFF; font-weight: 800; }
.brand:hover { text-decoration: none; }
.topbar .spacer { flex: 1; }
.club-select-wrap { display: flex; min-width: 0; }
.topbar .club-select { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23fff' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #fff; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; padding: 6px 30px 6px 10px; font: inherit; font-size: .9rem; font-weight: 700;
  max-width: 240px; width: auto; min-height: 0; text-overflow: ellipsis; cursor: pointer; margin: 0; }
.topbar .club-select:focus { outline: 2px solid var(--lime, #c6f432); outline-offset: 1px; }
.topbar .club-select option { color: #0f172a; background: #fff; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; text-align: inherit; }
.topbar .navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar .navlinks a { padding: 6px 10px; border-radius: 8px; font-size: .9rem; opacity: .85; }
.topbar .navlinks a.active, .topbar .navlinks a:hover { background: rgba(255,255,255,.12); opacity: 1; text-decoration: none; }
@media (max-width: 640px) {
  /* su telefono: se le voci non stanno accanto al logo vanno tutte sulla riga sotto (scorrevole se serve).
     13px in più sopra: logo e voci scendono sotto la sfumatura che il telefono disegna dietro ora e batteria */
  .topbar { flex-wrap: wrap; row-gap: 6px; padding-top: calc(env(safe-area-inset-top) + 23px); }
  .topbar .navlinks { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .topbar .club-select { max-width: 52vw; font-size: .85rem; }
  .topbar .navlinks::-webkit-scrollbar { display: none; }
  .topbar .navlinks a { white-space: nowrap; padding: 6px 9px; }
}

.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px calc(env(safe-area-inset-bottom) + 40px); }
.page.narrow { max-width: 560px; }
.page.wide { max-width: 1400px; }

/* --- Card, griglie --- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

/* --- Pulsanti --- */
.btn { appearance: none; border: 1px solid transparent; background: var(--blue); color: #fff; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--blue-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: #f8fafc; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { background: #fff; color: var(--bad); border-color: #f3c4c4; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.lime { background: var(--lime); color: var(--navy); }
.btn.lime:hover { background: #b9d815; }
.btn.small { padding: 6px 11px; font-size: .87rem; border-radius: 8px; }
.btn.big { padding: 13px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; justify-content: center; }

/* --- Moduli --- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--ink-2); }
.field { margin-bottom: 12px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 3px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], input[type=tel], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, .35); border-color: var(--blue); }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.check input { margin-top: 3px; }
.inline-fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.inline-fields.billing-place { grid-template-columns: 90px 1fr 100px; }
.inline-fields.city-prov { grid-template-columns: 1fr 110px; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; color: var(--muted, #64748b); font-size: 1.15rem; padding: 4px 6px; margin-left: -6px; line-height: 1; }
.court-row.dragging { background: var(--blue-soft); border-radius: 10px; box-shadow: 0 6px 18px rgba(15, 23, 42, .15); position: relative; z-index: 2; }
.court-row.dragging .drag-handle { cursor: grabbing; }
/* Elenco tornei (app giocatori) */
.ttable tbody tr { cursor: pointer; }
.ttable tbody tr:hover { background: #f6f8fc; }
.ttable td { vertical-align: middle; }
.ttable .tlogo { width: 52px; padding-right: 4px; }
.ttable .tlogo img, .ttable .tlogo .logo-ph { width: 40px; height: 40px; }
.ttable .tname { font-weight: 800; color: inherit; }
.ttable .tmeta { display: none; font-size: .86rem; margin-top: 3px; line-height: 1.35; }
@media (max-width: 640px) {
  /* su telefono ogni torneo è una riga compatta: logo, nome, club · città (prov), date */
  .ttable thead { display: none; }
  .ttable td[data-label] { display: none; }
  .ttable .tmeta { display: block; }
  .ttable td { padding-top: 10px; padding-bottom: 10px; }
}

.icon-btn { min-width: 34px; padding-left: 0; padding-right: 0; justify-content: center; }
.susp-banner { background: #fff7ed; color: #9a3412; border-bottom: 1px solid #fed7aa; padding: 8px 16px; font-size: .88rem; text-align: center; }
.susp-banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.prov-msg { min-height: 1em; font-size: .78rem; line-height: 1.25; }
.prov-msg.ok { color: var(--ok, #15803d); }
.prov-msg.bad { color: var(--bad); }
/* Filtri elenco club (admin) */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 10px; margin-top: 10px; }
.filters .f-search { grid-column: 1 / -1; }
.filters .f-dates { grid-column: span 2; }
.filters .f-dates input { min-width: 0; flex: 1; }
.filters .field { margin-bottom: 8px; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; white-space: nowrap; text-align: inherit; }
.club-table td { vertical-align: middle; }
/* incassi a destra (la regola generale delle tabelle allinea tutto a sinistra e vinceva su .num) */
.club-table th.num, .club-table td.num { text-align: right; white-space: nowrap; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }

/* --- Avvisi, chip --- */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 12px; font-size: .92rem; }
.alert.info { background: var(--blue-soft); color: #1e3a8a; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef2f7; color: var(--ink-2); white-space: nowrap; text-align: inherit; }
.chip.blue { background: var(--blue-soft); color: var(--blue-2); }
.chip.lime { background: var(--lime-soft); color: #4d5c00; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.badge-seed { background: var(--blue); color: #fff; font-size: .68rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; white-space: nowrap; flex: none; line-height: 1.3; }

/* --- Schede (tab) --- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; text-align: inherit; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pills button { font: inherit; border: 1px solid var(--line); background: #fff; padding: 6px 13px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.pills button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* --- Elenchi --- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.tlink { display: flex; gap: 12px; align-items: center; color: inherit; }
.tlink:hover { text-decoration: none; }
.tlink:hover .tname { color: var(--blue); }
.tname { font-weight: 700; }
.logo-sm { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.logo-ph { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; flex: none; }
.club-band { height: 5px; }
/* Regolamento di gioco */
.rules-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 4px 0 16px; background: #fafbfd; }
.rules-box h3 { margin: 0 0 10px; font-size: 1rem; }
.phase-box { border-left: 3px solid var(--blue); padding: 4px 0 4px 12px; margin: 4px 0 6px; }
/* Registro attività */
.act-day { font-size: .95rem; margin: 18px 0 6px; text-transform: capitalize; color: var(--ink-2); }
.list.act li { display: flex; gap: 10px; align-items: flex-start; }
.act-time { font-variant-numeric: tabular-nums; color: var(--muted, #64748b); font-size: .85rem; padding-top: 2px; flex: none; width: 42px; }
.act-icon { flex: none; width: 22px; text-align: center; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.table th, table.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- Hero pubblico --- */
.hero { background: linear-gradient(160deg, var(--navy) 0%, #172a66 100%); color: #fff; padding: 26px 16px 30px; }
.hero .inner { max-width: 1100px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: 1.7rem; }
.hero p { color: #c7d2fe; }
.hero .search { display: flex; gap: 8px; margin-top: 14px; max-width: 560px; }
.hero .search input { border: 0; }
.thead { display: flex; gap: 14px; align-items: center; }
.thead .logo-sm, .thead .logo-ph { width: 58px; height: 58px; border-radius: 12px; }
.thead h1 { margin: 0; }
.thead .meta { color: #c7d2fe; font-size: .92rem; }

/* --- La mia coppia --- */
.next-card { border-radius: var(--radius); padding: 18px; color: #fff; background: linear-gradient(140deg, var(--blue) 0%, #1e3fae 100%); box-shadow: var(--shadow); margin-bottom: 14px; }
.next-card.live { background: linear-gradient(140deg, #0f7a3b 0%, #14532d 100%); }
.next-card.done { background: linear-gradient(140deg, #334155 0%, #1e293b 100%); }
.next-card .label { text-transform: uppercase; font-size: .75rem; letter-spacing: .08em; opacity: .85; font-weight: 700; }
.next-card .big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.next-card .vs { font-size: 1rem; opacity: .95; }
.next-card .sub { opacity: .85; font-size: .9rem; margin-top: 6px; }

/* --- Campi live (area club) --- */
.courts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.court { border-radius: var(--radius); border: 2px solid var(--line); background: #fff; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.court.busy { border-color: #86efac; background: #f6fdf8; }
.court.free { border-style: dashed; }
.court .cname { font-weight: 800; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; }
.court .teams { font-weight: 600; }
.court .vs { color: var(--muted); font-size: .8rem; }
.court .actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Tabellone --- */
.bracket-wrap { position: relative; overflow-x: auto; padding: 8px 4px 16px; -webkit-overflow-scrolling: touch; }
.bracket { position: relative; display: flex; gap: 44px; width: max-content; padding-top: 30px; }
.bracket svg.lines { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.bcol { display: flex; flex-direction: column; justify-content: space-around; min-width: 250px; width: max-content; position: relative; }
.bcol .rtitle { position: absolute; top: -28px; left: 0; right: 0; text-align: center; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.match { position: relative; background: #fff; border: 1px solid #d5dce7; border-radius: 11px; margin: 7px 0; box-shadow: 0 1px 2px rgba(15,23,42,.05); overflow: hidden; z-index: 1; }
.match.clickable { cursor: pointer; }
.match.clickable:hover { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.match.bye { border-style: dashed; box-shadow: none; background: #fafbfd; }
.match.bye .team .names { color: #94a3b8; font-weight: 600; }
.match.bye .team.win { background: transparent; }
.match.oncourt { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.match.mine { box-shadow: 0 0 0 3px rgba(200,232,26,.85); border-color: #a3be12; }
.match .mhead { display: flex; justify-content: space-between; gap: 6px; padding: 5px 9px; font-size: .72rem; color: var(--muted); background: #f8fafc; border-bottom: 1px solid #eef2f7; }
.match .mhead .st { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .mhead .st.live { color: var(--ok); }
.team { display: flex; align-items: center; gap: 6px; padding: 6px 9px; min-height: 44px; }
.team + .team { border-top: 1px solid #eef2f7; }
.team .names { flex: 1 1 auto; font-size: .86rem; line-height: 1.25; }
.team .names span { display: block; white-space: nowrap; text-align: inherit; }
.team.win { background: var(--lime-soft); }
.team.win .names { font-weight: 800; }
.team.tbd .names { color: #94a3b8; font-style: italic; }
.team .sets { display: flex; gap: 3px; }
.team .sets b { width: 22px; height: 24px; display: grid; place-items: center; border-radius: 5px; background: #f1f5f9; font-size: .85rem; font-variant-numeric: tabular-nums; }
.team.win .sets b.w { background: var(--navy); color: #fff; }
.winner-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--lime-soft); border: 1px solid #dbe98a; margin-bottom: 12px; }
.winner-banner .trophy { font-size: 1.6rem; }

/* --- Modale e notifiche --- */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 21, 51, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin-top: 0; }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
#toasts { position: fixed; bottom: calc(env(safe-area-inset-bottom) + 16px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: .93rem; animation: up .2s ease-out; }
.toast.bad { background: #7f1d1d; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

/* Punteggio: modalità campo */
.score-grid { display: grid; grid-template-columns: 1fr repeat(3, 58px); gap: 8px; align-items: center; }
.score-grid .tn { font-weight: 700; font-size: .92rem; line-height: 1.2; }
.score-grid input { text-align: center; font-size: 1.35rem; font-weight: 800; padding: 9px 4px; }
.score-grid .sh { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .ico { font-size: 2rem; margin-bottom: 6px; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.kpi { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .82rem; }
.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 26px 16px; }
.footer a { color: var(--muted); text-decoration: underline; }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; }
.qr svg { width: 220px; height: 220px; display: block; }
.sponsors { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .card { padding: 14px; }
  .bcol { min-width: 220px; }
  .bracket { gap: 32px; }
  .topbar .navlinks a { padding: 6px 7px; }
  .tabs.fit a { flex: 1; text-align: center; padding: 10px 4px; font-size: .9rem; }
  .hide-sm { display: none !important; }
}

/* Tabellone compatto per la stampa */
.compact .bracket { gap: 30px; padding-top: 24px; }
.compact .bcol { min-width: 205px; }
.compact .bcol .rtitle { top: -22px; font-size: .68rem; }
.compact .match { margin: 3px 0; border-radius: 7px; box-shadow: none; }
.compact .match .mhead { padding: 1px 7px; font-size: .64rem; }
.compact .team { min-height: 30px; padding: 2px 7px; }
.compact .team .names { font-size: .76rem; line-height: 1.15; }
.compact .team .sets b { width: 17px; height: 18px; font-size: .74rem; }
.compact .badge-seed { font-size: .6rem; padding: 1px 4px; }

/* --- Stampa: solo il tabellone, A4 orizzontale --- */
@page { size: A4 landscape; margin: 10mm; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body, #app { background: #fff; }
  .sbar,
  .topbar, .tabs, .pills, .no-print, #toasts, .footer { display: none !important; }
  .page { max-width: none; padding: 0; }
  .card { box-shadow: none; padding: 0; }
  .bracket-wrap { overflow: visible; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
/* Niente cursore di testo lampeggiante cliccando su testi e immagini (navigazione con cursore del browser, tasto F7): resta solo nei campi da compilare. */
body { caret-color: transparent; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; }
.printbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px) 10px calc(env(safe-area-inset-left) + 16px); }
.printbar a { font-weight: 700; }
.capturing:not(.poster) { width: max-content; min-width: 100%; }
.capturing .bracket-wrap { overflow: visible !important; }
/* Fogli di stampa dei tabelloni (A4/A3): sullo schermo come sulla carta. --k ingrandisce intestazione e piè
   di pagina nelle copie per il PDF (il contenuto lì resta alla misura naturale, poi tutto si rimpicciolisce). */
.ps-wrap { overflow: hidden; }
.ps-list { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 12px 48px; width: max-content; min-width: 100%; box-sizing: border-box; }
.psheet { --k: 1; font-size: calc(15px * var(--k)); background: #fff; display: flex; flex-direction: column; overflow: hidden; position: relative; box-sizing: content-box; flex: none; }
.ps-list .psheet { padding: 38px; box-shadow: 0 2px 14px rgba(15,23,42,.16); border-radius: 4px; }
.psheet .club-band { flex: none; }
.ps-head { display: flex; align-items: center; gap: .9em; margin: .7em 0 .55em; flex: none; }
.ps-head .logo-sm, .ps-head .logo-ph { width: 2.9em; height: 2.9em; border-radius: .65em; font-size: 1em; }
.ps-title { flex: 1; min-width: 0; }
.ps-head h1 { font-size: 1.45em; margin: 0; line-height: 1.15; letter-spacing: -.02em; }
.ps-sub { color: var(--muted); font-size: .92em; margin-top: .15em; }
.ps-pd { height: 2.2em; flex: none; }
.ps-tag { margin: 0 0 .55em; flex: none; }
.ps-tag span { display: inline-block; background: #0d1b33; color: #fff; border-radius: 999px; padding: .28em .85em; font-weight: 700; font-size: .85em; }
.psheet .winner-banner { gap: .8em; padding: .55em 1em; border-radius: .8em; margin-bottom: .6em; flex: none; font-size: 1em; }
.psheet .winner-banner .trophy { font-size: 1.5em; }
.psheet .winner-banner .muted { font-size: .75em !important; }
.psheet .winner-banner div div:last-child { font-size: 1.05em !important; }
.ps-body { flex: 1; min-height: 0; position: relative; overflow: hidden; font-size: 15px; }
.ps-wm { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .07; pointer-events: none; }
.ps-fit { position: relative; display: flow-root; column-gap: 28px; }
.psheet .bracket-wrap { overflow: visible; padding: 0; }
.psheet .table td.num { white-space: nowrap; }
/* gironi sul foglio: più fitti che sullo schermo (due gironi da 4 stanno in un A4) */
.psheet table.table { font-size: .84rem; }
.psheet table.table th, .psheet table.table td { padding: 4px 7px; }
.psheet table.table th { font-size: .68rem; }
.psheet .gmatch { padding: 3px 4px; font-size: .82rem; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr) 130px; gap: 8px; }
.psheet .g-day { margin: 8px 0 1px; font-size: .66rem; }
.psheet .g-winner { margin-top: 5px; padding: 5px 10px; font-size: .84rem; }
.psheet .g-note { margin-top: 3px; font-size: .74rem; }
.psheet .g-print { margin-bottom: 14px; }
.psheet .g-print h2 { font-size: 1.05rem; margin-bottom: 4px; }
.psheet .team.feeder .names span { font-style: italic; font-size: .92em; color: var(--muted); white-space: normal; }
.ps-foot { display: flex; justify-content: space-between; gap: 1em; font-size: .75em; color: #5b6b85; border-top: 1px solid #e3e8f0; padding-top: .45em; margin-top: .45em; flex: none; }
.ps-foot span:last-child { white-space: nowrap; }
.ps-offscreen { position: fixed; left: -30000px; top: 0; width: 6000px; pointer-events: none; }
.psheet.capturing { min-width: 0; }
/* elenco partite */
.el-g { font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: #36507a; margin: 0; padding: 12px 0 4px; }
.el-day { font-size: .78rem; font-weight: 800; color: var(--muted); padding: 8px 0 2px; }
.el-row { display: grid; grid-template-columns: 2.6em 1fr .9em 1fr auto; gap: 0 6px; align-items: baseline; font-size: .8rem; padding: 4px 0; border-bottom: 1px solid #e8edf4; }
.el-row .n { color: #7a879c; }
.el-row .vs { color: #9aa6b8; text-align: center; }
.el-row .t.w { font-weight: 800; }
.el-row .fd { color: var(--muted); }
.el-row .sc { text-align: right; white-space: nowrap; color: #5b6b85; padding-left: 8px; }
.el-row .sc.done { color: var(--ink); font-weight: 700; }
.el-row .badge-seed { font-size: .62rem; padding: 1px 4px; }
/* finestra di scelta */
.pchoice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; }
.pchoice:has(input:checked) { border: 2px solid var(--blue); padding: 11px 13px; }
.pchoice input { margin-top: 4px; }
.pchoice .muted { font-size: .88rem; }
.pchoice-wa { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; gap: 8px; flex-wrap: wrap; }
.pchoice-wa .muted { font-size: .88rem; }
#ps-format { width: auto; max-width: 52vw; padding: 7px 10px; }
@media print {
  .ps-wrap { overflow: visible; height: auto !important; }
  .ps-list { transform: none !important; }
  .ps-offscreen { display: none !important; }
  .ps-list { display: block; padding: 0; width: auto; min-width: 0; }
  .ps-list .psheet { padding: 0; box-shadow: none; border-radius: 0; margin: 0; break-after: page; }
  .ps-list .psheet:last-child { break-after: auto; }
}
.poster { width: 190mm; margin: 0 auto; text-align: center; padding: 10mm; }
.poster h1 { font-size: 30pt; margin: 8mm 0 4mm; }
.poster .club-logo { max-height: 35mm; }
.poster .qr svg { width: 95mm; height: 95mm; }
.poster .cta { font-size: 18pt; font-weight: 800; margin-top: 6mm; }
.poster .url { font-size: 13pt; color: var(--muted); margin-top: 3mm; word-break: break-all; }

/* Token di benvenuto: doppioni di P.IVA / CF */
.dup-list { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; line-height: 1.5; }
.dup-list li { margin: 2px 0; }
.sig-line { margin-top: 6px; font-size: .9rem; line-height: 1.45; }
.sig-line .btn.small { padding: 2px 8px; font-size: .78rem; }
.bonus-table .sig-cell { min-width: 240px; }
.card.bonus-pending { border: 2px solid var(--warn-soft); }

/* Contatore nella barra blu (richieste da approvare) e notifiche dell'amministratore */
.nav-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--lime, #c6f432); color: #0f172a; font-size: .75rem; font-weight: 800; line-height: 1.4; vertical-align: 1px; }
.adm-head { margin-bottom: 14px; gap: 10px; align-items: flex-start; }
.push-ctl { gap: 6px; align-items: center; justify-content: flex-end; }
.push-info { position: relative; display: inline-block; }
.push-i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 700; font-size: .85rem; color: var(--muted); cursor: pointer; }
.push-i[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); }
.push-pop { position: absolute; right: 0; top: 34px; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font-size: .88rem; z-index: 30; text-align: left; }
.push-pop ul { margin: 6px 0 0; padding-left: 18px; }
.push-pop li { margin: 3px 0; }
@media (max-width: 640px) { .push-ctl { justify-content: flex-start; } .push-pop { width: min(290px, calc(100vw - 48px)); } }
.push-events { margin-top: 6px; font-size: .85rem; text-align: right; }
.push-events summary { cursor: pointer; color: var(--blue-2, #1d4ed8); font-weight: 600; }
.push-events .check { justify-content: flex-end; margin: 4px 0; }
@media (max-width: 640px) { .push-events { text-align: left; } .push-events .check { justify-content: flex-start; } }

/* Anagrafica giocatori: scelta degli omonimi, doppioni, scheda */
.pq { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.pq-opt { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 400; }
.pq-opt input[type=radio] { margin-top: 4px; flex: none; }
.pq-opt.on { background: var(--blue-soft); }
.pq-opt .muted { font-size: .82rem; }
.pq-birth input { margin-top: 4px; max-width: 220px; }
.sus-card { background: var(--warn-soft); }
.sus-row { gap: 8px; padding: 8px 0; border-top: 1px solid rgba(0,0,0,.06); flex-wrap: wrap; }
.sus-row:first-of-type { border-top: 0; }
.pl-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.merge-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 14px 0; }
.merge-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.merge-box.on { border: 2px solid var(--blue); background: var(--blue-soft); }
.merge-box select { width: 100%; }
.merge-arrow { font-size: 1.4rem; }
@media (max-width: 560px) { .merge-grid { grid-template-columns: 1fr; } .merge-arrow { transform: rotate(90deg); justify-self: center; } }

/* Pannello Utenti */
.users-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 14px 0; }
.kpi-sub { font-size: .75rem; }
.users-trend { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; align-items: end; }
.users-trend .bars { display: flex; gap: 8px; align-items: flex-end; height: 140px; }
.users-trend .bar { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.users-trend .bar > div { background: var(--blue); border-radius: 6px 6px 0 0; min-height: 2px; }
.users-trend .bar .n { font-size: .75rem; font-weight: 700; }
.users-trend .bar .m { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.u-list { margin: 0; padding-left: 18px; line-height: 1.8; font-size: .9rem; }
@media (max-width: 1000px) { .users-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .users-kpis { grid-template-columns: repeat(2, 1fr); } .users-trend { grid-template-columns: 1fr; } }
.users-table .u-who { min-width: 170px; }
.users-table .u-clubs { min-width: 250px; }
.users-table .u-clubs > div { white-space: nowrap; text-align: inherit; }
.users-table .u-act { min-width: 200px; max-width: 320px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.role-select { width: auto; padding: 4px 28px 4px 10px; font-size: .85rem; min-height: 0; }

/* Verifica in due passaggi */
.tfa-steps { padding-left: 20px; line-height: 1.6; }
.tfa-steps li { margin-bottom: 8px; }
.tfa-qr { width: 200px; margin: 10px 0; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.tfa-qr svg { width: 100%; height: auto; display: block; }
.tfa-key { font-size: .9rem; letter-spacing: .04em; word-break: break-all; }
.tfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.tfa-codes code { background: var(--blue-soft); border-radius: 8px; padding: 6px 10px; text-align: center; font-size: 1rem; letter-spacing: .05em; }

/* Calcolatore della durata */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.calc-out { position: sticky; top: 12px; scroll-margin-top: 90px; }
.calc-bracket { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 8px; margin-bottom: 12px; background: #fafbfd; }
.calc-bracket .check { margin: 0 0 8px; }
.calc-lv { margin: 0; }
.calc-lv th, .calc-lv td { padding: 5px 4px; font-size: .86rem; vertical-align: middle; }
.calc-lv input, .calc-lv select { padding: 5px 6px; font-size: .86rem; width: 100%; min-width: 0; }
.calc-lv td:nth-child(2) { width: 64px; }
.calc-lv td:nth-child(4) { width: 64px; }
.calc-lv td:nth-child(5) { width: 34px; }
.calc-lv tr.fin { background: #f4f8e6; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 10px; }
.calc-grid.ph { grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) minmax(0, .8fr); }
.calc select, .calc input { min-width: 0; max-width: 100%; }
.calc-mode { margin: 4px 0 12px; }
.calc-mode label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; padding: 6px 13px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; margin: 0; }
.calc-mode label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.calc-mode input { margin: 0; }
.calc-slot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) auto; gap: 0 8px; align-items: end; }
.calc-slot .icon-btn { margin-bottom: 12px; }
.stepper { display: flex; gap: 6px; align-items: center; }
.stepper input { text-align: center; }
.stepper .btn { min-width: 38px; justify-content: center; font-size: 1.1rem; }
.calc-big { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--navy); }
.calc-big.bad { color: var(--bad); }
.calc-kpis { margin: 14px 0 6px; grid-template-columns: repeat(3, 1fr); }
.calc-kpis .kpi { box-shadow: none; border: 1px solid var(--line); }
.calc-kpis .v { font-size: 1.25rem; }
.calc-result h3 { margin: 16px 0 6px; font-size: 1rem; }
.calc table.table .num { text-align: right; }
.calc-cmp tbody tr { cursor: pointer; }
.calc-cmp tbody tr:hover { background: #f6f8fc; }
.calc-cmp tr.cur { background: var(--blue-soft); font-weight: 700; }
.calc-cmp .linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; font-weight: 700; }
.calc-note { font-size: .82rem; margin: 14px 0 0; }
.calc-sum { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--navy); color: #fff; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.15); font-size: .92rem; }
.calc-sum b { font-size: 1.05rem; }
.calc-sum.bad b { color: #fca5a5; }
.calc-sum button { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; text-align: inherit; }
@media (max-width: 900px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .calc-out { position: static; }
  /* sul telefono il risultato è in fondo: un riepilogo resta sempre visibile */
  .calc-sum { display: flex; }
  .calc-page { padding-bottom: 70px; }
}
@media (max-width: 520px) {
  .calc-grid, .calc-grid.ph { grid-template-columns: minmax(0, 1fr); }
  .calc-slot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 0; margin-bottom: 10px; background: #fafbfd; }
  .calc-slot .icon-btn { grid-column: 1 / -1; justify-self: end; margin-bottom: 10px; }
  .calc-kpis { grid-template-columns: 1fr 1fr; }
}

.calc-bracket.guess { border-color: #f59e0b; background: #fffbeb; }
.calc-bracket.guess input[data-k="pairs"] { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.guess-hint { margin: 0 0 10px; font-size: .88rem; color: #92400e; }

/* Elenchi delle coppie: svuota e salvataggio automatico */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.list-head label { margin: 0; }
.list-head .btn { padding: 3px 9px; }
.clear-both { margin-left: auto; }
.lists-status { font-size: .84rem; color: var(--muted); }
.lists-status.ok { color: var(--ok); }
.lists-status.warn { color: var(--warn); font-weight: 600; }
.lists-status.bad { color: var(--bad); font-weight: 600; }
.toast.with-action { display: flex; align-items: center; gap: 14px; }
.toast.with-action button { background: none; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 8px; padding: 4px 10px; font: inherit; font-weight: 700; cursor: pointer; }

/* --- Vista del tabellone: riquadro largo, adatta alla pagina, a tutta pagina, un turno alla volta --- */
.bcol[hidden] { display: none !important; }
.bv-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 6px 6px; }
.bv-rounds { display: none; }
.bv.phone .bv-rounds { display: flex; gap: 6px; overflow-x: auto; width: 100%; padding: 2px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bv-rounds::-webkit-scrollbar { display: none; }
.bv-rounds button { font: inherit; font-size: .88rem; font-weight: 700; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.bv-rounds button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.bv-rounds button[data-bv-round="all"] { color: var(--blue); }
.bv-rounds button[data-bv-round="all"].active { color: #fff; }
.bv-tools { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.bv-tools .bv-zoom { font-size: .82rem; margin-right: 4px; }
.bv-tools .on { background: var(--navy); color: #fff; border-color: var(--navy); }
.bv-tools .on:hover { background: var(--navy-2); }
.bv.phone .bv-tools [data-bv-act="fit"], .bv.phone .bv-tools [data-bv-act="real"] { display: none; }
.bv.phone.by-round:not(.full) .bv-tools { display: none; }
.bv-close { display: none; }
.bv.full .bv-close { display: inline-flex; }
.bv.full [data-bv-act="full"] { display: none; }
.bv-swipe { display: none; }
.bv.by-round .bv-swipe { display: flex; justify-content: space-between; font-size: .8rem; padding: 0 6px 6px; }
.bv-swipe span { cursor: pointer; }
.bv.by-round .bracket-wrap { overflow: visible; padding-top: 0; }
.bv.by-round .bracket { width: 100%; padding-top: 0; display: block; }
.bv.by-round .bracket svg.lines { display: none; }
.bv.by-round .bcol { min-width: 0; width: 100%; display: block; }
.bv.by-round .bcol .rtitle { display: none; }
.bv.by-round .match { margin: 0 0 10px; }
.bv.full { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow: auto; padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 20px) calc(env(safe-area-inset-left) + 12px); }
.bv.full .bv-bar { position: sticky; top: 0; left: 0; z-index: 5; background: var(--bg); padding-top: 6px; }
body.bv-lock { overflow: hidden; }
@media print { .bv-bar, .bv-swipe { display: none !important; } }
.bv.by-round .match.bye { display: none; }
.bv.by-round .bv-swipe { flex-wrap: wrap; }
.bv-byes { order: 3; flex-basis: 100%; padding-top: 2px; }
.bv-byes:empty { display: none; }

/* Sponsor: logo se c'è, altrimenti il nome */
.sponsors { gap: 12px; }
.sponsors .sp, .sp-list .sp { display: inline-flex; align-items: center; justify-content: center; min-height: 58px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.sponsors .sp.logo img, .sp-list .sp.logo img { height: 42px; max-width: 150px; object-fit: contain; display: block; }
.sponsors .sp.name b, .sp-list .sp.name b { font-weight: 700; }
.sponsors a.sp:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(37, 99, 235, .12); }
.sp-list .sp { min-height: 48px; min-width: 64px; padding: 4px 8px; flex-shrink: 0; }
.sp-list .sp.logo img { height: 34px; max-width: 110px; }
.sp-list .sp.name b { font-size: .85rem; }
.sp-pick { display: grid; gap: 6px; margin: 2px 0 8px 26px; }
.sp-pick[hidden] { display: none; }
.sp-opt { margin: 0; }
.sp-opt img { height: 24px; max-width: 70px; object-fit: contain; }
.sp-list .sp.sp-empty { color: var(--muted); font-weight: 700; background: #f8fafc; border-style: dashed; }
.sp-list li { flex-wrap: wrap; row-gap: 6px; }
.sp-list li > .row:first-child { flex: 1 1 260px !important; }
.sp-actions { margin-left: auto; }

.sp-h { font-size: .95rem; margin: 16px 0 6px; }
.sp-h .muted { font-weight: 500; font-size: .82rem; }
.sp-add { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.sp-actions { flex-wrap: wrap !important; justify-content: flex-end; }
@media (max-width: 640px) { .sp-list li { flex-wrap: wrap; } .sp-actions { width: 100%; } }
.sp-now { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .88rem; }
.sp-now .sponsors { margin-top: 8px; }
.sp-now .sp { min-height: 44px; padding: 4px 10px; }
.sp-now .sp.logo img { height: 30px; }
.past-list { margin: 0 0 6px; padding-left: 20px; font-size: .92rem; }
.past-list li { margin-bottom: 6px; }

/* Tornei terminati */
.chip.ended { background: #e2e8f0; color: #334155; }
.ended-tag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; font-size: .88rem; color: rgba(255,255,255,.85); }
.ended-tag .chip.ended { background: #fff; color: var(--navy); font-size: .82rem; }
.ttabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -4px 0; }
.ttabs button { font: inherit; font-weight: 700; font-size: .95rem; background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px 9px; color: var(--muted); cursor: pointer; }
.ttabs button.active { color: var(--navy); border-bottom-color: var(--blue); }
.ttabs button:hover { color: var(--ink); }
.t-chips { flex-wrap: nowrap; }
.club-link { color: inherit; text-decoration: none; font-weight: 600; }
.club-link:hover { color: var(--blue); text-decoration: underline; }
.tmeta .club-link { font-weight: 600; }
.name-hint { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: #7c4a03; font-size: .85rem; line-height: 1.35; }

/* Copia dei dati */
.bk-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.bk-bar > div { height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.bk-log { margin-top: 8px; font-size: .88rem; }
.bk-log summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.bk-log ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

/* ---------- Pagina «Tornei» del club ---------- */
.tm-today { border: 2px solid var(--lime); background: linear-gradient(180deg, #fbfee9, #fff 60%); }
.tm-today h2 { display: flex; align-items: center; gap: 8px; }
.tm-live { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.tm-live + .tm-live { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.tm-bar { height: 8px; border-radius: 99px; background: #e9eef5; overflow: hidden; margin: 8px 0 4px; }
.tm-bar i { display: block; height: 100%; background: var(--blue); }
.tm-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tm-label { font-size: .8rem; color: var(--muted); }
.tm-todo li { display: flex; gap: 10px; align-items: center; padding: 9px 0; }
.tm-todo .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--warn-soft); flex: none; }
.tm-tools { display: flex; gap: 10px; align-items: center; margin: 12px 0 4px; }
.tm-tools input { flex: 1; min-width: 0; width: auto; }
.tm-tools select { width: auto; flex: none; }
.tm-count { padding: 1px 7px; margin-left: 2px; }
.tm-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tm-row:last-child { border-bottom: 0; }
.tm-date { width: 54px; text-align: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; color: var(--ink); }
.tm-date:hover { text-decoration: none; }
.tm-date b { display: block; font-size: 1.25rem; line-height: 1.5rem; padding: 3px 0 2px; }
.tm-date span { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; background: var(--navy); color: #fff; padding: 2px 0; }
.tm-date.nod { border-style: dashed; color: var(--muted); }
.tm-date.nod span { background: #cbd5e1; }
.tm-name { font-weight: 700; color: var(--ink); }
.tm-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
/* tornei terminati: vincitori di ogni tabellone, o cosa manca ancora */
.tm-lines { list-style: none; margin: 6px 0 0; padding: 0; font-size: .88rem; }
.tm-lines li { margin: 2px 0; }
.tm-lines.warn li, .tm-lines li.warn { color: #9a3412; }
.tm-lines li.warn .part { color: var(--muted); }
.tm-lines li.q { color: var(--muted); }
.tm-lines li.q b { color: var(--ink); font-weight: 600; }
.tm-when { font-size: .85rem; color: var(--ink-2); white-space: nowrap; text-align: right; }
.tm-more { position: relative; }
.tm-kebab { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.tm-kebab[aria-expanded="true"] { background: var(--bg); }
.tm-menu { position: absolute; right: 0; top: 40px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 20; }
.tm-menu a, .tm-menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: .92rem; color: var(--ink); background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tm-menu a:hover, .tm-menu button:hover { background: var(--bg); text-decoration: none; }
.tm-month { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 0; }
@media (max-width: 640px) {
  .tm-live { grid-template-columns: 1fr; }
  .tm-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; }
  .tm-row .tm-when { grid-column: 2; text-align: left; margin-top: -6px; }
  .tm-row .tm-more { grid-row: 1; grid-column: 3; align-self: start; }
  .tm-date { width: 46px; }
  #t-all .ttabs { overflow-x: auto; scrollbar-width: none; }
  #t-all .ttabs button { white-space: nowrap; padding: 8px 9px 9px; font-size: .9rem; }
}
.arch-reasons { display: grid; gap: 8px; }
.arch-reason { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.arch-reason:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.arch-reason input { margin-top: 3px; }
.arch-reason > span { display: flex; flex-direction: column; gap: 2px; }
.arch-reason .muted { font-size: .85rem; }
.arch-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }
.arch-person { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.arch-person:last-child { border-bottom: 0; }
.arch-person:has(input:checked) { background: var(--blue-soft); }
.arch-person input { margin-top: 3px; }
.arch-person > span { display: flex; flex-direction: column; }
.arch-person .muted { font-size: .82rem; }
.club-link { font-weight: 700; color: var(--blue-2); }
.club-link:hover { text-decoration: underline; }

/* ---------- Gironi ---------- */
.st td.num, .st th.num { text-align: center; }
.st tr.q td { background: #f3fbe0; }
.st tr.q td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.st tr.qs td { background: #eef5fc; }
.st tr.qs td:first-child { box-shadow: inset 3px 0 0 #7fb2e5; }
.st tr.qb td { background: #fbf0e6; }
.st tr.qb td:first-child { box-shadow: inset 3px 0 0 #d9965b; }
.s-pos { gap: 4px 14px; margin: 8px 0 0 4px; }
.s-pos .check { margin: 0; }
.ph-pills { margin-bottom: 10px; }
.st tr.is-mine td { font-weight: 600; }
.st tr.is-mine td:nth-child(2)::after { content: ' ⭐'; }
.st .pos { width: 28px; font-weight: 800; color: var(--muted); }
.g-note { font-size: .8rem; margin-top: 6px; }
.g-winner { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: var(--lime-soft, #f3fbe0); font-size: .92rem; }
.g-day { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 2px; }
.gmatch { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr) 150px; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: .92rem; border-radius: 8px; }
.gmatch .r { text-align: center; font-weight: 700; }
.gmatch .t2 { text-align: right; }
.gmatch .w { font-weight: 800; }
.gmatch .when { color: var(--muted); font-size: .8rem; text-align: right; }
.gmatch.clickable { cursor: pointer; }
.gmatch.clickable:hover { background: var(--bg); }
.gmatch.mine { background: var(--lime-soft, #f3fbe0); }
.g-act { color: var(--blue); font-weight: 700; margin-left: 4px; }
.g-pills { margin-bottom: 10px; }
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gm-g { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.gm-g h3 { margin: 0; padding: 10px 14px; background: var(--navy); color: #fff; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; }
.gm-g h3 small { font-weight: 500; opacity: .8; font-size: .8rem; }
.gm-g ol { list-style: none; margin: 0; padding: 0; }
.gm-g li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.gm-g li:last-child { border-bottom: 0; }
.gm-g li .nm { flex: 1; min-width: 0; }
.gm-g .mv { border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: .78rem; padding: 3px 8px; color: var(--ink-2); cursor: pointer; }
.gm-g .ord { display: inline-flex; gap: 3px; }
.gm-g .ord .mv { padding: 3px 7px; }
.gm-g .mv:disabled { opacity: .35; cursor: default; }
.tds { font-size: .68rem; font-weight: 800; background: var(--lime); color: var(--navy); border-radius: 5px; padding: 2px 5px; }
.tok-box { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; margin-top: 14px; }
.tok-box .big { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.f-opt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.f-opt label { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; gap: 10px; cursor: pointer; background: #fff; }
.f-opt label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.f-opt b { display: block; }
.f-opt .muted { font-size: .84rem; }
.tb-list { list-style: none; margin: 0; padding: 0; }
.tb-list li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; margin-bottom: 6px; background: #fff; font-size: .9rem; }
.tb-list .n { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.tb-list .ar { margin-left: auto; display: flex; gap: 4px; }
.tb-list .ar button { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 28px; height: 26px; cursor: pointer; }
.tb-list .ar button:disabled { opacity: .35; cursor: default; }
.g-print { break-inside: avoid; margin-bottom: 18px; }
.g-print h2 { margin: 0 0 6px; }
@media (max-width: 640px) {
  .gmatch { grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); row-gap: 2px; }
  .gmatch .when { grid-column: 1 / -1; order: -1; text-align: left; }
  .st .hide-sm { display: none; }
  .f-opt { grid-template-columns: 1fr; }
}
.st .sm { display: none; }
@media (max-width: 640px) {
  .st th, .st td { padding: 7px 5px; }
  .st { font-size: .86rem; }
  .st .lg { display: none; }
  .st .sm { display: inline; }
  .st .badge-seed { display: none; }
}

/* formula del tabellone accanto al nome nei pulsanti dei tabelloni */
.pill-kind { font-weight: 500; opacity: .75; }

/* profilo collegato: iniziali in alto a destra e menu */
.me-wrap { position: relative; flex: none; }
.me-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--lime, #c6f432); color: var(--navy); font-weight: 800; font-size: .85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.me-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.me-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 270px; max-width: calc(100vw - 24px); background: #fff; color: var(--ink, #0f172a); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.08); padding: 6px; }
.me-head { padding: 10px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.me-head b { font-size: .98rem; }
.me-head span { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.me-head .me-role { color: var(--ink, #0f172a); font-weight: 600; margin-top: 4px; }
.me-sub { padding: 8px 10px 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.topbar .me-menu a.me-item, .me-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; color: var(--ink, #0f172a); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none; }
.me-item:hover { background: #f1f5f9; text-decoration: none; }
.me-item:disabled { color: var(--muted); cursor: not-allowed; }
.topbar .me-menu a.me-out { color: var(--bad, #b91c1c); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
@media (max-width: 640px) {
  .topbar.many .me-wrap { order: 1; }
  .topbar.many .navlinks { order: 2; flex-basis: 100%; }
}
#account, #sicurezza, #fatturazione { scroll-margin-top: 84px; }

/* pagina Aiuto */
.help-hero .search input { flex: 1; }
.help-sec { scroll-margin-top: 80px; }
.help-card .help-intro { margin-top: 14px; }
.help-card .faq-title { margin: 22px 0 0; }
.help-card .sec-title { display: none; margin: 18px 0 0; }
/* durante la ricerca: le due schede insieme, solo le domande trovate */
.help-card.searching .ttabs, .help-card.searching .help-intro, .help-card.searching .faq-title { display: none; }
.help-card.searching .sec-title { display: block; }
@media (max-width: 640px) { .help-card .ttabs button { white-space: nowrap; padding: 8px 9px 9px; } }
.help-steps { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.help-steps li { display: flex; gap: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.help-steps .hs-ico { font-size: 1.6rem; line-height: 1; }
.help-steps .hs-n { color: var(--muted); }
.help-steps p { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.faq-group { margin-top: 14px; }
.faq-group h3 { margin: 0 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-2); border-left: 3px solid var(--lime); padding: 2px 0 2px 8px; }
details.faq { border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
details.faq summary { cursor: pointer; padding: 12px 28px 12px 0; font-weight: 600; list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: '+'; position: absolute; right: 4px; top: 9px; font-size: 1.3rem; color: var(--muted); font-weight: 400; }
details.faq[open] summary::after { content: '−'; }
details.faq .faq-a { padding: 0 0 14px; color: var(--ink-2); line-height: 1.55; }
details.faq .faq-a ul { margin: 6px 0; padding-left: 20px; }
details.faq .faq-a li { margin: 4px 0; }
/* striscia «Come funziona» in home */
.help-strip .hs-mini { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.help-strip .hs-mini li { display: flex; flex-direction: column; gap: 2px; background: var(--lime-soft); border-radius: 10px; padding: 10px 12px; }
.help-strip .hs-mini span { color: var(--ink-2); font-size: .88rem; }

/* Guida completa (area club) */
.guide-head { margin-bottom: 14px; }
.guide-head h1 { margin: 0 0 4px; }
.guide-head p { margin: 0; max-width: 760px; }
.guide-jump { display: none; margin-top: 12px; }
.guide-jump select { width: 100%; }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.guide-toc { position: sticky; top: 76px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; max-height: calc(100vh - 96px); overflow: auto; }
.guide-toc .gt-title { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 2px 10px 8px; }
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc button { display: flex; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 8px; font: inherit; font-size: .9rem; color: var(--ink-2); cursor: pointer; line-height: 1.3; }
.guide-toc button:hover { background: #f1f5f9; }
.guide-toc button.on { background: var(--blue-soft); color: var(--navy); font-weight: 700; }
.guide-toc .gt-n { flex: none; width: 20px; color: var(--muted); font-weight: 700; }
.guide-toc .gt-help { display: block; padding: 10px 10px 2px; font-size: .88rem; border-top: 1px solid var(--line); margin-top: 8px; }
.guide-body { min-width: 0; max-width: 860px; }
.g-chap { scroll-margin-top: 76px; padding-bottom: 18px; }
.g-chap-head { display: flex; gap: 12px; align-items: center; }
.g-chap-head .g-ico { font-size: 2rem; width: 52px; height: 52px; border-radius: 14px; background: var(--lime-soft); display: flex; align-items: center; justify-content: center; flex: none; }
.g-chap-head .g-num { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--blue-2); }
.g-chap-head h2 { margin: 0; }
.g-intro { font-size: 1.05rem; color: var(--ink-2); margin: 12px 0 4px; }
.g-chap h3 { margin: 22px 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g-chap p, .g-chap li { line-height: 1.6; }
.g-chap ul { padding-left: 22px; }
.g-owner { display: inline-block; font-size: .72rem; font-weight: 700; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.g-fig { margin: 12px 0 16px; }
.g-fig .g-zoomable, .ga-stage { display: block; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; cursor: zoom-in; overflow: hidden; max-width: 100%; }
.g-fig img { display: block; max-width: 100%; height: auto; }
.g-fig.phone .g-zoomable { max-width: 300px; }
.g-fig figcaption { font-size: .86rem; color: var(--muted); margin-top: 6px; }
.g-tip { background: var(--blue-soft); border-radius: 12px; padding: 10px 14px; margin: 12px 0; line-height: 1.55; }
.g-anim { border: 2px solid var(--lime); border-radius: 14px; padding: 12px; margin: 14px 0 18px; background: #fbfdf2; }
.ga-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ga-badge { font-size: .72rem; font-weight: 800; background: var(--navy); color: #fff; border-radius: 999px; padding: 3px 9px; letter-spacing: .03em; }
.ga-stage { width: 100%; height: 420px; display: flex; align-items: center; justify-content: center; background: #eef2f7; }
.ga-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity .16s; }
.ga-stage img.fade { opacity: 0; }
.g-anim.phone .ga-stage { height: 560px; }
.g-anim.wide .ga-stage { height: 300px; }
.ga-cap { margin: 10px 2px 6px; min-height: 2.6em; line-height: 1.4; }
.ga-n { display: inline-block; font-size: .78rem; font-weight: 800; color: var(--blue-2); background: var(--blue-soft); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.ga-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ga-dots { display: flex; gap: 6px; margin-left: 6px; }
.ga-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #cbd5e1; padding: 0; cursor: pointer; }
.ga-dots button.on { background: var(--blue); width: 22px; border-radius: 6px; }
.g-next { display: block; margin: 22px 0 0 auto; background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.g-zoom { position: fixed; inset: 0; z-index: 80; background: rgba(11, 21, 51, .88); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.g-zoom[hidden] { display: none; }
.g-zoom img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; }
.g-zoom-x { position: absolute; top: 14px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { display: none; }
  .guide-jump { display: block; }
  .ga-stage { height: 260px; }
  .g-anim.phone .ga-stage { height: 480px; }
  .g-anim.wide .ga-stage { height: 170px; }
}

/* Nome e cognome (fix71) */
.names-hint { margin: 0 0 12px; font-size: .9rem; }
.names-hint code { font-size: .88em; }
.names-read { margin-top: 10px; font-size: .86rem; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fbfcfe; }
.names-read summary { cursor: pointer; }
.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 3px 16px; }
.names-check { background: var(--warn-soft, #fff4e0); border-radius: 6px; padding: 0 6px; margin: 0 -6px; }
.names-card { border: 2px solid var(--lime); }
.names-list { margin-top: 10px; display: grid; gap: 8px; }
.names-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.name-opt .name-sep { opacity: .55; margin: 0 2px; }

/* Rete assente: avviso fisso in basso finché le richieste non tornano a funzionare */
.net-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--warn); color: #fff; font-size: .85rem; font-weight: 600; text-align: center; padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px); box-shadow: 0 -2px 8px rgba(0,0,0,.15); }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 210; display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 10px 10px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .92rem; max-width: calc(100vw - 24px); animation: up .2s ease-out; }
.update-bar[hidden] { display: none; }
.update-bar .btn { background: var(--lime, #c6f432); color: var(--navy); border-color: transparent; white-space: nowrap; }
.update-x { background: none; border: 0; color: #fff; opacity: .7; font-size: 1rem; cursor: pointer; padding: 4px 6px; }
.update-x:hover { opacity: 1; }
body.offline .update-bar { bottom: calc(env(safe-area-inset-bottom) + 56px); }
body.offline { padding-bottom: 56px; }
body.offline #toasts { bottom: calc(env(safe-area-inset-bottom) + 64px); }
/* Pagina che tarda ad arrivare (rete lenta): barra che scorre in alto, così si vede che sta caricando */
body.loading::before { content: ''; position: fixed; left: 0; top: 0; height: 3px; width: 40%; z-index: 210; background: var(--lime); animation: pd-load 1s ease-in-out infinite; }
@keyframes pd-load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { body.loading::before { animation: none; width: 100%; opacity: .6; } }

/* Avviso «Luca sta modificando questo tabellone»: resta in vista scorrendo fino alle coppie */
.presence { position: sticky; top: calc(var(--topbar-h, 60px) + 6px); z-index: 20; display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.presence.warn { border: 2px solid #f0b25a; box-shadow: 0 4px 14px rgba(180, 83, 9, .18); }
.presence .pres-ico { font-size: 1.35rem; line-height: 1; }
@media (max-width: 640px) { .presence .pres-more { display: none; } .presence { padding: 10px 12px; } }
/* Finestra «Le coppie sono cambiate mentre scrivevi» */
.merge-list { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; max-height: 180px; overflow: auto; }
.merge-preview { margin: 6px 0 0; padding: 8px 10px; background: var(--bg, #f4f6fa); border-radius: 8px; max-height: 220px; overflow: auto; font: inherit; font-size: .88rem; white-space: pre-wrap; }

/* Profilo del club: dove si trova (via + CAP, oppure link di Google Maps) */
.loc-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 0 0 14px; }
.loc-box legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.loc-box > .hint { margin: 0 0 10px; font-size: .82rem; }
.inline-fields.addr-zip { grid-template-columns: 1fr 110px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 10px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
/* avviso token di benvenuto non accolti, con «Ho capito» */
.bonus-no { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bonus-no > span { flex: 1 1 260px; }
.bonus-no .btn { flex: none; }
/* possibili riutilizzi dei tabelloni (pannello amministratore) */
.reuse-card { border-left: 4px solid #d97706; }
.reuse-why { margin: 6px 0 0; padding-left: 16px; font-size: .82rem; color: #475569; }
.reuse-how { margin-top: 10px; font-size: .85rem; }
.reuse-how summary { cursor: pointer; }
.reuse-how p { margin: 6px 0 0; }
.list.act li.act-hot { background: #fff7ed; border-radius: 8px; }
.g-tip.g-warn { background: var(--warn-soft); }
.guide-body code { background: #eef2f7; border-radius: 6px; padding: 2px 6px; font-size: .86em; overflow-wrap: anywhere; }

/* Tornei FITP e TPRA: fascia accanto ai nomi, graduatoria accanto all'elenco, anagrafica */
.fa-tag { color: #7a879c; font-weight: 800; font-size: .74em; margin-left: 2px; letter-spacing: 0; }
.team.win .fa-tag { color: #5b6b85; }
.fitp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .fitp-grid { grid-template-columns: 1fr; } }
#fitp-panel .fitp-head { gap: 10px; align-items: center; margin: 0 0 6px; flex-wrap: wrap; }
#fitp-panel .fitp-head label { margin: 0; font-weight: 600; font-size: .88rem; }
#fitp-panel .fitp-head select { width: auto; padding: 5px 8px; }
.fitp-warn { margin: 0 0 8px; font-size: .85rem; padding: 8px 12px; }
.fitp-conf { margin: 0 0 10px; font-size: .86rem; padding: 10px 12px; border-radius: 12px; background: var(--blue-soft); color: var(--ink-2); }
.fitp-table { font-size: .86rem; }
.fitp-table tr.fitp-ts { background: #f4f8e6; }
.fitp-table tr.fitp-cut td { border-bottom: 3px solid var(--lime); }
.fitp-table tr.fitp-out { background: #fdecec; }
.fitp-x { color: #b42318; font-weight: 800; }
.fitp-bad { color: #b42318; }
.fitp-note { font-size: .78rem; max-width: 250px; }
.fitp-r { font-size: .82rem; }
.fitp-foot { font-size: .78rem; margin: 6px 0 0; }
.fitp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-left: 5px; vertical-align: middle; }
.fitp-draft { margin-top: 12px; }
.fitp-draft summary { cursor: pointer; }
.fitp-draft #fitp-panel { margin-top: 10px; }
.tpra-level { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tpra-level select { width: auto; padding: 6px 10px; }
.circuit-box { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.fitp-cell { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: inherit; cursor: pointer; }
.fitp-cell:hover b, .fitp-cell:hover .chip { text-decoration: underline; }
/* colonne centrate (scheda Giocatori): numeri allineati come cifre */
.table th.ctr, .table td.ctr { text-align: center; font-variant-numeric: tabular-nums; }
/* scheda Giocatori: nome che apre la scheda, selezione per eliminare più giocatori */
.pl-name { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.pl-name:hover { color: var(--blue); text-decoration: underline; }
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin: 0 0 10px; border-radius: 10px; background: var(--blue-soft); font-size: .9rem; }
.pl-box { width: 34px; text-align: center !important; }
.pl-box input { width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }
.pl-box input:disabled { cursor: not-allowed; opacity: .45; }
.pl-selecting tr.sel td { background: var(--blue-soft); }
.pl-del-list { max-height: 260px; overflow: auto; margin: 6px 0 12px; padding-left: 20px; }
.pl-checks { gap: 6px 22px; flex-wrap: wrap; margin: 0 0 10px; font-size: .9rem; }
.pl-checks .check { margin: 0; }
.fitp-notice { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
/* Tabelloni collegati (FITP) */
.team.qual .names span { color: var(--muted); font-style: italic; }
.team.qual .q-from { display: block; font-size: .78em; font-style: italic; color: #94a3b8; }
.badge-q { font-size: .66rem; font-weight: 800; color: #1d4ed8; background: var(--blue-soft); border-radius: 6px; padding: 1px 5px; margin-left: 4px; align-self: center; }
.ch-head { padding: 12px 14px; }
.q-table tr.q { background: #f4f8e6; }
.q-table td { vertical-align: middle; }
.ch-gnote { margin: 10px 0 0; font-size: .9rem; background: #f8fafc; border: 1px solid var(--line); }
#ch-fmt, #ch-gsize { width: auto; padding: 4px 8px; }
.ch-head summary { cursor: pointer; }
.ch-head .inline-fields select { width: 100%; }
.ch-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.ch-chips .chip { font-size: .82rem; cursor: pointer; border: 0; font-family: inherit; }
.ch-chips .chip:not(.blue) .muted { font-weight: 400; }
.modal.ch-modal { max-width: 980px; }
.modal .ch-table td, .modal .ch-table th { vertical-align: middle; }
.ch-table tr.ch-final { background: #f4f8e6; }
.ch-table select, #ch-cut { width: auto; padding: 4px 8px; }
.ch-pairs { margin-top: 10px; }
.ch-pairs summary { cursor: pointer; }
.ch-lv { margin-top: 10px; }
.ch-lv-h { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.ch-pair { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.ch-pair span { flex: 1; }
.ch-pair .btn { padding: 2px 10px; }
.ch-cost { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; gap: 10px; flex-wrap: wrap; }
.fitp-card-line { justify-content: space-between; gap: 10px; margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; }

/* Classifiche FITP (amministratore) */
.rk-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border: 2px dashed #c6cfdc; border-radius: 12px; cursor: pointer; text-align: center; background: #fafbfd; }
.rk-drop:hover, .rk-drop.over { border-color: var(--blue); background: var(--blue-soft); }
.rk-drop u { color: var(--blue); text-decoration: none; }
.rk-h { font-size: 1rem; margin: 18px 0 6px; }
.rk-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rk-files td.num, .rk-files th.num, .rk-sum td.num, .rk-sum th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rk-list { margin: 6px 0 0; padding-left: 18px; font-size: .82rem; max-height: 320px; overflow: auto; }
.alert details summary { cursor: pointer; text-decoration: underline; display: inline; }
/* Classifica FITP nell'area club */
.rk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; }
.rk-kpis { grid-template-columns: repeat(4, 1fr); }
.rk-kpis .kpi { box-shadow: none; border: 1px solid var(--line); padding: 10px 12px; }
.rk-kpis .kpi .v { font-size: 1.35rem; }
.rk-up td, .rk-hom td { padding: 7px 8px; }
.rk-up td.num { text-align: right; }
.rk-hom select { width: 100%; max-width: 440px; }
.rk-det { margin: 12px 0 4px; }
.rk-det summary { cursor: pointer; padding: 4px 0; }
.fitp-card-no { font-size: .9rem; margin: 6px 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rk-cands { display: grid; gap: 6px; margin-top: 6px; }
.rk-cands .row { background: rgba(255,255,255,.7); border-radius: 8px; padding: 6px 10px; gap: 8px; }
.rk-box { margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--blue-soft); color: #1e3a8a; font-size: .9rem; }
.rk-box.ok { padding: 9px 14px; }
.rk-rows { margin-top: 8px; background: #fff; border-radius: 10px; color: var(--ink); }
.rk-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.rk-row > span { justify-self: start; }
.rk-row > span.rk-sel { justify-self: stretch; }
.rk-row > :last-child { justify-self: end; }
.rk-row:last-child { border-bottom: 0; }
.rk-row .rk-n { color: #1e3a8a; }
.rk-row select { width: 100%; max-width: 520px; }
@media (max-width: 640px) { .rk-row { grid-template-columns: 1fr auto; } .rk-row > span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; } .rk-kpis { grid-template-columns: repeat(2, 1fr); } }
.rk-drop { margin-bottom: 4px; }
.rk-row > .rk-ask { grid-column: 1 / -1; justify-self: stretch; background: var(--warn-soft); color: var(--ink); border-radius: 8px; padding: 8px 12px; font-size: .86rem; display: grid; gap: 4px; }
.rk-ask[hidden] { display: none; }
.rk-ask .check { margin: 0; }

/* ---------- Tornei a squadre (TPRA) ---------- */
.sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.sq-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.sq-box .field { margin-bottom: 10px; }
.sq-roster { list-style: none; margin: 8px 0; padding: 0; font-size: .92rem; }
.sq-roster li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.sq-roster li:first-child { border-top: 0; }
.sq-cap { margin-top: 6px; font-size: .88rem; background: var(--bg); border-radius: 8px; padding: 5px 8px; }
.cap-chip { background: var(--navy); color: var(--lime); font-size: .68rem; font-weight: 700; padding: 1px 7px; }
.gmatch .tie-rubs { grid-column: 1 / -1; }
.tie-rubs { margin: 4px 0 2px; background: #fafbfd; border-radius: 8px; padding: 4px 10px; font-size: .84rem; }
.tie-rub-line { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 2px 0; align-items: baseline; }
.tie-rub-line .n { color: var(--muted); }
.tie-rub-line .w { font-weight: 700; }
.tie-rub-line .sc { font-weight: 600; white-space: nowrap; margin-left: auto; }
.tie-item { padding: 8px 0; border-top: 1px solid var(--line); }
.tie-item:first-of-type { border-top: 0; }
.tie-rub { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0 0 12px; }
.tie-rub legend { font-weight: 700; padding: 0 6px; }
.tie-lineup { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 8px; }
.tie-lineup select { width: 100%; margin-top: 4px; }
.tie-lineup .tn { font-weight: 700; font-size: .88rem; }
