/* ===== TOTOSCORE — tema in-app ============================================
   Identità TOTOSCORE (verde scuro + menta, Poppins per i titoli, Inter per il
   testo). Caricato DOPO tm-base.css per vincere sulle sue regole.
   Struttura: barra laterale scura su desktop, barra di navigazione in basso
   su telefono. Le icone sono Lucide.
   ========================================================================= */
:root {
    --tm-green-950: #04231a;
    --tm-green-900: #062a20;
    --tm-green-800: #0a3a2c;
    --tm-green-700: #0e4d39;
    --tm-green-600: #12805a;
    --tm-mint: #46e0a0;
    --tm-mint-soft: #d3f5e6;
    --tm-ink: #0b1f18;
    --tm-muted: #566a61;
    --tm-bg: #f3f6f4;              /* sfondo pagina */
    --tm-line: #dfe7e2;            /* bordo card */
    --tm-line-soft: #eef3f0;       /* divisori interni */
    --tm-card-border: #cfded5;     /* bordo controlli */
    --tm-chip: #e6eeea;
    --tm-head-bg: #f7faf8;         /* intestazioni di tabella */
    --tm-ok: #0e6b4b;
    --tm-alert: #c2410c;           /* conteggi e avvisi */
    --tm-alert-soft: #fff1e8;
    --tm-alert-ink: #9a3412;
    --tm-side-w: 248px;
    --tm-tabbar-h: 64px;
    --tm-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --tm-font-title: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Ruoli che cambiano col tema (vedi "Tema scuro" in fondo al file).
       I verdi --tm-green-* restano colori di SFONDO; come TESTO si usano i --tm-t-*,
       che nel tema scuro diventano chiari. */
    --tm-surface: #fff;            /* card, pannelli, campi */
    --tm-t-900: #062a20;
    --tm-t-800: #0a3a2c;
    --tm-t-700: #0e4d39;           /* link e azioni testuali */
    --tm-t-600: #12805a;
    --tm-testo-2: #33443d;         /* testo secondario più scuro del muted */
    --tm-placeholder: #9fb1a8;
    --tm-chip-tenue: #eef4f0;
    --tm-evidenza: #f2fbf6;        /* riga "mia" / selezionata */
    --tm-ok-soft: #e8f8f0;
    --tm-ok-line: #b9e8d2;
    --tm-alert-line: #f6d4bd;
    --tm-alert-line-forte: #f1b48c;
    --tm-alert-ink-forte: #7c2d12;
    --tm-alert-txt: #c2410c;       /* l'arancio usato come testo */
    --tm-pts0-bg: #e9ecea;
    --tm-pts0-ink: #4a5a53;
    color-scheme: light;
}

body {
    font-family: var(--tm-font);
    background: var(--tm-bg);
    color: var(--tm-ink);
}

/* Reset dei margini (era il "reboot" di Bootstrap, sparito con tm-base):
   senza, ogni <p> e ogni titolo ha anche un margine sopra. */
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: .5rem; }
p, ul, ol, dl { margin-top: 0; margin-bottom: 1rem; }
ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.01em; color: var(--tm-ink); }
h1, .h1, h2, .h2, h3, .h3 { font-family: var(--tm-font-title); }
h4, .h4, h5, .h5, h6, .h6 { font-weight: 600; }
a { color: var(--tm-t-700); }
a:hover { color: var(--tm-t-900); }
.opacity-75 { opacity: .75; }
.overflow-auto { overflow: auto !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-stretch { align-self: stretch !important; }
@media (min-width: 992px) { .align-self-lg-start { align-self: flex-start !important; } }
/* con la barra laterale lo spazio utile è più stretto: colonne extra-large */
@media (min-width: 1200px) {
    .col-xl-3 { width: 25%; } .col-xl-4 { width: 33.3333%; } .col-xl-5 { width: 41.6667%; } .col-xl-6 { width: 50%; }
    .col-xl-7 { width: 58.3333%; } .col-xl-8 { width: 66.6667%; } .col-xl-9 { width: 75%; }
}
/* utilità usate nelle pagine e mancanti in tm-base */
.align-items-baseline { align-items: baseline !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
@media (min-width: 576px) { .d-sm-inline { display: inline !important; } }
@media (min-width: 768px) { .d-md-inline { display: inline !important; } }
@media (min-width: 992px) { .mt-lg-0 { margin-top: 0 !important; } }
/* card interamente cliccabile */
.tm-card-link { color: inherit; transition: border-color .15s; }
.tm-card-link:hover { color: inherit; border-color: var(--tm-green-600); }
/* dato evidenziato su sfondo tenue (es. "Sei 2°", "112 punti") */
.tm-dato { flex: 1; background: var(--tm-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; }

/* ── Struttura: barra laterale + contenuto ────────────────────────────────
   La barra laterale c'è solo da 992px in su; sotto, la navigazione principale
   passa nella barra in basso (.tm-tabbar). */
body.tm-app { display: flex; min-height: 100vh; }
.tm-shell { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.tm-main { flex: 1 0 auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem 1rem 2rem; }
@media (min-width: 768px) { .tm-main { padding: 1.5rem 1.5rem 2.5rem; } }
@media (min-width: 992px) { .tm-main { padding: .5rem 2.5rem 3rem; } }

.tm-brand {
    font-family: var(--tm-font-title); font-weight: 700; font-size: 22px; letter-spacing: .5px;
    text-decoration: none; white-space: nowrap; color: var(--tm-t-900);
}
.tm-brand b { font-weight: 700; color: var(--tm-t-600); }
.tm-brand:hover { color: var(--tm-t-900); }

/* barra laterale (desktop) */
.tm-side { display: none; }
@media (min-width: 992px) {
    .tm-side {
        display: flex; flex-direction: column; gap: 22px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto;
        flex: 0 0 var(--tm-side-w); width: var(--tm-side-w); padding: 24px 16px;
        background: var(--tm-green-950); color: #fff;
    }
    .tm-side .tm-brand { color: #fff; padding: 0 12px; }
    .tm-side .tm-brand b { color: var(--tm-mint); }
}
.tm-side.is-admin { background: #1b2421; }
/* etichetta gialla dell'area admin, come nei mockup */
.tm-side-tag {
    align-self: flex-start; margin: -12px 12px 0; padding: 3px 10px; border-radius: 999px;
    background: #f2c94c; color: #3d2c00; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
}
.tm-sidenav { display: flex; flex-direction: column; gap: 4px; }
.tm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--tm-green-700); padding-top: 16px; }
.tm-side.is-admin .tm-side-foot { border-top-color: #33403b; }
.sv {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px;
    color: #c3d6cc; text-decoration: none; font-size: 15px; font-weight: 500;
    transition: background .15s, color .15s;
}
.sv:hover { background: var(--tm-green-800); color: #fff; }
.sv.on { background: var(--tm-green-700); color: #fff; font-weight: 600; }
.tm-side.is-admin .sv:hover { background: #29342f; }
.tm-side.is-admin .sv.on { background: #33403b; }
.sv [data-lucide], .sv svg { width: 20px; height: 20px; flex: none; vertical-align: 0; }

/* selettore della competizione ("Stai giocando · Cambia") */
.tm-comp-dd { position: relative; }
.tm-comp-dd .dropdown-menu { left: 0; right: 0; min-width: 0; }
.tm-comp {
    display: flex; align-items: center; gap: 10px; padding: 0 12px; text-decoration: none;
    box-sizing: border-box; transition: border-color .15s;
}
.tm-comp-ico { flex: none; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.tm-comp-ico svg { width: 18px; height: 18px; vertical-align: 0; }
.tm-comp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tm-comp-lbl { font-size: 11px; }
.tm-comp-nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-comp-cambia { flex: none; font-weight: 600; }
.tm-comp.is-dark .tm-comp-nome { white-space: normal; line-height: 1.25; }
.tm-comp.is-dark { min-height: 56px; padding-block: 8px; border-radius: 14px; border: 1px solid var(--tm-green-700); background: var(--tm-green-900); color: #fff; }
.tm-comp.is-dark:hover { color: #fff; border-color: var(--tm-green-600); }
.tm-comp.is-dark .tm-comp-ico { width: 30px; height: 30px; background: var(--tm-mint); color: var(--tm-green-950); }
.tm-comp.is-dark .tm-comp-lbl { color: #c3d6cc; }
.tm-comp.is-dark .tm-comp-nome { font-size: 14px; }
.tm-comp.is-dark .tm-comp-cambia { font-size: 12px; color: var(--tm-mint); }
.tm-comp.is-light { height: 48px; border-radius: 12px; border: 1px solid var(--tm-card-border); background: var(--tm-bg); color: var(--tm-ink); }
.tm-comp.is-light:hover { color: var(--tm-ink); border-color: var(--tm-green-600); }
.tm-comp.is-light .tm-comp-ico { width: 28px; height: 28px; background: var(--tm-green-900); color: var(--tm-mint); }
.tm-comp.is-light .tm-comp-lbl { color: var(--tm-muted); }
.tm-comp.is-light .tm-comp-nome { font-size: 15px; }
.tm-comp.is-light .tm-comp-cambia { font-size: 13px; color: var(--tm-t-700); }

/* intestazione: marchio + campanella/profilo (telefono), solo azioni (desktop) */
.tm-top {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; background: var(--tm-surface);
}
.tm-top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tm-comp-mobile { background: var(--tm-surface); padding: 0 16px 14px; border-bottom: 1px solid var(--tm-line); }
@media (min-width: 992px) {
    .tm-top { background: transparent; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 2.5rem 0; }
    .tm-top .tm-brand { display: none; }
    .tm-comp-mobile { display: none; }
}
@media (max-width: 991.98px) {
    /* senza selettore di competizione il bordo va sotto l'intestazione */
    .tm-top:not(:has(+ .tm-comp-mobile)) { border-bottom: 1px solid var(--tm-line); }
    /* sul telefono il profilo sta nella barra in basso */
    body.has-tabbar .tm-top-profilo { display: none; }
}

.tm-tondo {
    position: relative; width: 44px; height: 44px; border-radius: 22px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--tm-bg); color: var(--tm-t-900); text-decoration: none;
}
.tm-tondo:hover { color: var(--tm-t-900); background: var(--tm-chip); }
.tm-tondo.on, .tm-tondo.on:hover { background: var(--tm-mint-soft); border-color: var(--tm-mint-soft); }
.tm-tondo [data-lucide], .tm-tondo svg { width: 22px; height: 22px; vertical-align: 0; }
@media (min-width: 992px) { .tm-tondo { background: var(--tm-surface); border: 1px solid var(--tm-line); } .tm-tondo:hover { background: var(--tm-bg); } }
.tm-tondo-badge {
    position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--tm-alert); color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.tm-avatar-btn { display: flex; border-radius: 50%; text-decoration: none; }
.tm-avatar-btn:focus-visible { outline: 2px solid var(--tm-green-600); outline-offset: 2px; }

/* contatore dei pronostici da inserire sul pulsante "Gioca" */
.tm-conta {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; flex: none;
    background: var(--tm-alert); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.tm-tabbar .ic { position: relative; }
.tm-tabbar .ic .tm-conta { position: absolute; top: -6px; right: 2px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }

/* pagina Notifiche: una riga per avviso, icona colorata per tipo */
.tm-notif {
    display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px;
    color: var(--tm-ink); text-decoration: none; border-bottom: 1px solid var(--tm-line-soft);
}
.tm-notif:last-child { border-bottom: 0; }
a.tm-notif:hover { background: var(--tm-bg); color: var(--tm-ink); }
.tm-notif.is-new { background: var(--tm-evidenza); }
.tm-notif-ico {
    flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--tm-chip); color: var(--tm-t-700);
}
.tm-notif-ico [data-lucide], .tm-notif-ico svg { width: 20px; height: 20px; vertical-align: 0; }
.tm-notif-ico.is-chiusura { background: var(--tm-alert-soft); color: var(--tm-alert-ink); }
.tm-notif-ico.is-risultati { background: var(--tm-green-900); color: var(--tm-mint); }
.tm-notif-ico.is-obiettivo { background: var(--tm-mint-soft); color: var(--tm-t-800); }
.tm-notif-ico.is-sfida { background: var(--tm-alert-soft); color: var(--tm-alert-ink); }
.tm-notif-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.45; }
.tm-notif.is-new .tm-notif-txt > span:first-child { font-weight: 600; }
.tm-notif-when { font-size: 13px; color: var(--tm-muted); }
.tm-notif-azione { align-self: center; font-size: 14px; font-weight: 600; color: var(--tm-t-700); white-space: nowrap; }
.tm-notif-dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 5px; background: var(--tm-alert); }
@media (max-width: 575.98px) { .tm-notif { padding: 12px 14px; gap: 12px; } .tm-notif-azione { display: none; } }
/* barra di navigazione in basso (telefono) */
.tm-tabbar { display: none; }
@media (max-width: 991.98px) {
    body.has-tabbar .tm-shell { padding-bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom)); }
    .tm-tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; display: flex;
        height: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: var(--tm-surface); border-top: 1px solid var(--tm-line);
    }
    .tm-tabbar a {
        flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
        font-size: 11px; font-weight: 500; color: var(--tm-muted); text-decoration: none;
    }
    .tm-tabbar a.on { color: var(--tm-t-900); font-weight: 700; }
    .tm-tabbar .ic { width: 48px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
    .tm-tabbar a.on .ic { background: var(--tm-mint-soft); }
    .tm-tabbar .ic [data-lucide], .tm-tabbar .ic svg { width: 22px; height: 22px; vertical-align: 0; }
    /* con la tastiera aperta la barra sparisce (site.js) e la barra della schedina scende al suo posto */
    body.tastiera-aperta .tm-tabbar { display: none; }
    body.has-tabbar.tastiera-aperta .schedina-bar { bottom: 0; }
}

/* ── Intestazione di pagina ───────────────────────────────────────────────
   Blocco unico titolo + sottotitolo, stessa distanza dal contenuto su tutte
   le pagine. I titoli non hanno icona (come nei mockup). */
.page-head { margin-bottom: 1.25rem; }
.page-head > :last-child { margin-bottom: 0; }
.page-head h1, .page-head .h1, .page-head h2, .page-head .h2 {
    font-family: var(--tm-font-title); font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-bottom: .25rem;
}
@media (min-width: 992px) {
    .page-head { margin-bottom: 1.5rem; }
    .page-head h1, .page-head .h1 { font-size: 1.875rem; }
}
.page-head h1 > i[data-lucide], .page-head h1 > svg.lucide { display: none; }
.page-head .page-sub { color: var(--tm-muted); font-size: .95rem; max-width: 68ch; margin-bottom: 0; }
.page-head .page-kicker { display: block; font-size: 13px; color: var(--tm-muted); margin-bottom: .2rem; }
/* variante con azione a destra (es. "Le mie leghe" + bottone Crea) */
.page-head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.page-head-row > :first-child { margin-bottom: 0; }
.page-head.is-narrow { max-width: 720px; margin-inline: auto; }

/* ── Icone (Lucide) ───────────────────────────────────────────────────── */
[data-lucide], svg.lucide { width: 1.05em; height: 1.05em; vertical-align: -.16em; stroke-width: 2; }
.nav-link [data-lucide], .dropdown-item [data-lucide], .btn [data-lucide], svg.lucide { flex-shrink: 0; }

/* ── Dropdown ─────────────────────────────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--tm-line); border-radius: 14px;
    box-shadow: 0 18px 44px -18px rgba(4, 35, 26, .35); padding: .4rem; margin-top: .4rem;
}
.dropdown-item { border-radius: 10px; padding: .55rem .7rem; display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: 14px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--tm-bg); color: var(--tm-ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--tm-green-900); color: #fff; }

/* ── Bottoni ──────────────────────────────────────────────────────────────
   Rettangoli arrotondati, alti almeno 44px (bersaglio comodo col dito). */
.btn { border-radius: 12px; font-weight: 600; min-height: 44px; padding: .5rem 1.1rem; font-size: .95rem; gap: .45rem; }
.btn-sm { min-height: 36px; padding: .3rem .8rem; font-size: .85rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: .7rem 1.5rem; font-size: 1.05rem; border-radius: 14px; }
.btn-link { min-height: 0; }
.btn-primary { background: var(--tm-green-900); border-color: var(--tm-green-900); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
.btn-success { background: var(--tm-green-600); border-color: var(--tm-green-600); color: #fff; }
.btn-success:hover, .btn-success:active { background: var(--tm-green-700); border-color: var(--tm-green-700); color: #fff; }
.btn-outline-primary, .btn-outline-secondary { background: var(--tm-surface); color: var(--tm-ink); border: 1px solid var(--tm-card-border); }
.btn-outline-primary:hover, .btn-outline-primary:active,
.btn-outline-secondary:hover, .btn-outline-secondary:active { background: var(--tm-bg); border-color: var(--tm-green-600); color: var(--tm-ink); }
.btn-danger { background: var(--tm-danger); border-color: var(--tm-danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active { background: #a82b25; border-color: #a82b25; color: #fff; }
.btn-outline-danger { background: var(--tm-surface); border-width: 1px; }
.btn-outline-success, .btn-outline-warning { background: var(--tm-surface); border-width: 1px; }
/* azioni "di attenzione" (ricalcola, rinvia): arancio del tema invece del giallo */
.btn-warning { background: var(--tm-alert-soft); border: 1px solid var(--tm-alert-line); color: var(--tm-alert-ink); }
.btn-warning:hover, .btn-warning:active { background: #ffe4d2; border-color: var(--tm-alert-line-forte); color: var(--tm-alert-ink); filter: none; }
.btn-outline-warning { color: var(--tm-alert-ink); border-color: var(--tm-alert-line); }
.btn-outline-warning:hover, .btn-outline-warning:active { background: var(--tm-alert-soft); border-color: var(--tm-alert-line-forte); color: var(--tm-alert-ink); }
.btn-link { color: var(--tm-t-700); font-weight: 600; }
/* CTA chiara sulle superfici scure (card "Da fare adesso", riepilogo schedina) */
.btn-mint { background: var(--tm-mint); border-color: var(--tm-mint); color: var(--tm-green-950); font-weight: 700; }
.btn-mint:hover, .btn-mint:focus, .btn-mint:active { background: #6ae9b3; border-color: #6ae9b3; color: var(--tm-green-950); }
.btn-check:checked + .btn, .btn-check:checked + .btn-outline-primary { background: var(--tm-green-900); border-color: var(--tm-green-900); color: #fff; }
.btn-group > .btn:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.btn-group > .btn:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }
.btn-group > .btn:not(:first-child) { margin-left: -1px; }

/* ── Card ─────────────────────────────────────────────────────────────────
   Bianche, bordo sottile, niente ombra: lo stacco lo dà lo sfondo grigio-verde. */
.card, .card.shadow-sm { border: 1px solid var(--tm-line); border-radius: 20px; background: var(--tm-surface); box-shadow: none !important; }
.card-body { padding: 1.1rem 1.25rem; }
.card-header {
    background: transparent; border-bottom: 1px solid var(--tm-line-soft); font-weight: 600; font-size: 15px;
    padding: .9rem 1.25rem; border-radius: 20px 20px 0 0 !important;
}
.card-header [data-lucide], .card-header svg.lucide { color: var(--tm-muted); }
.card-footer { background: transparent; border-top: 1px solid var(--tm-line-soft); padding: .8rem 1.25rem; border-radius: 0 0 20px 20px; }
.card > .table:last-child > tbody > tr:last-child > td:first-child,
.card > .table-responsive:last-child > .table > tbody > tr:last-child > td:first-child { border-bottom-left-radius: 19px; }
.card > .table:last-child > tbody > tr:last-child > td:last-child,
.card > .table-responsive:last-child > .table > tbody > tr:last-child > td:last-child { border-bottom-right-radius: 19px; }
.card > .table-responsive:last-child > .table > tbody > tr:last-child > td { border-bottom: 0; }
.card > .list-group:last-child > .list-group-item:last-child { border-bottom-left-radius: 19px; border-bottom-right-radius: 19px; }
.card > .list-group:first-child > .list-group-item:first-child { border-top-left-radius: 19px; border-top-right-radius: 19px; }
.card > .table-responsive { border-radius: 0 0 19px 19px; }
.card > .table-responsive:first-child { border-radius: 19px; }
.card > .table, .card > .table-responsive > .table { margin-bottom: 0; }

/* superficie scura del brand (card "Da fare adesso", riepiloghi) */
.tm-hero {
    background: var(--tm-green-900); color: #fff; border-radius: 22px; padding: 20px;
    display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 992px) { .tm-hero { padding: 26px 28px; border-radius: 24px; gap: 16px; } }
/* home desktop: le partite della giornata aperta dentro il riquadro "Da fare adesso" */
.tm-hero-partite { background: var(--tm-surface); color: var(--tm-ink); border-radius: 16px; padding: 6px 18px; }
.tm-hero-partita {
    display: grid; grid-template-columns: 112px minmax(0, 1fr) auto minmax(0, 1fr) 84px; gap: 12px; align-items: center;
    min-height: 60px; border-bottom: 1px solid var(--tm-line-soft);
}
.tm-hero-partita:last-child { border-bottom: 0; }
.tm-hp-quando { font-size: 13px; color: var(--tm-muted); }
.tm-hp-casa, .tm-hp-ospite { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-hp-casa { text-align: right; }
.tm-hp-celle { display: flex; align-items: center; gap: 6px; }
.tm-hp-celle b { color: var(--tm-muted); }
.tm-hp-cella {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--tm-card-border); background: var(--tm-surface);
    display: flex; align-items: center; justify-content: center; font: 700 18px var(--tm-font-title);
}
.tm-hp-stato { justify-self: end; font-size: 12px; font-weight: 600; }
.tm-hp-stato.is-ok { color: var(--tm-ok); }
.tm-hp-stato.is-manca { color: var(--tm-alert-ink); }
.tm-hp-altre { min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--tm-muted); }
.tm-hero h2, .tm-hero .h2, .tm-hero h3 { color: #fff; margin: 0; }
.tm-hero a:not(.btn) { color: var(--tm-mint); }
.tm-hero .tm-hero-sub { color: #d4e4dc; font-size: 14px; }
.tm-hero .tm-hero-sub strong { color: #fff; }
.tm-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--tm-mint); }
.tm-pill-dark { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--tm-green-700); color: #fff; font-size: 14px; font-weight: 600; }
.tm-bar { height: 8px; border-radius: 4px; background: var(--tm-chip); overflow: hidden; }
.tm-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--tm-green-600); transition: width .3s ease; }
.tm-hero .tm-bar { background: var(--tm-green-700); }
.tm-hero .tm-bar > span { background: var(--tm-mint); }
.tm-kpi { flex: 1 1 140px; background: var(--tm-green-700); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tm-kpi strong { font-family: var(--tm-font-title); font-size: 22px; font-weight: 700; line-height: 1.15; }
.tm-kpi span { font-size: 13px; color: #d4e4dc; }
.tm-kpi strong small { font-size: 14px; font-weight: 600; color: #d4e4dc; }
.tm-kpi-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-kpi-row .tm-kpi { flex-basis: 96px; }

/* home: giornata in corso in primo piano (etichetta "live" e partite con risultato) */
.tm-live {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px;
    border-radius: 999px; background: var(--tm-alert); color: #fff;
    font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
}
.tm-live-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; animation: tm-live-pulse 1.4s ease-in-out infinite; }
@keyframes tm-live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .tm-live-dot { animation: none; } }
.tm-hp-quando.is-live { display: inline-flex; align-items: center; gap: 6px; color: var(--tm-alert-txt); font-weight: 700; }
.tm-hp-quando.is-fine { color: var(--tm-ink); font-weight: 600; }
.tm-hp-cella.is-vuota { color: var(--tm-muted); }
.tm-hp-tuo { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 11px; color: var(--tm-muted); white-space: nowrap; }
@media (max-width: 991.98px) {
    .tm-hero-partite.is-live { padding: 2px 12px; }
    .tm-hero-partite.is-live .tm-hero-partita {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 50px;
        grid-template-areas: "q q q s" "c x o s";
        column-gap: 6px; row-gap: 4px; padding: 10px 0;
    }
    .tm-hero-partite.is-live .tm-hp-quando { grid-area: q; font-size: 12px; }
    .tm-hero-partite.is-live .tm-hp-casa { grid-area: c; font-size: 13px; }
    .tm-hero-partite.is-live .tm-hp-celle { grid-area: x; gap: 3px; }
    .tm-hero-partite.is-live .tm-hp-ospite { grid-area: o; font-size: 13px; }
    .tm-hero-partite.is-live .tm-hp-tuo { grid-area: s; }
    .tm-hero-partite.is-live .tm-hp-cella { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
}

/* numeri grandi, chip, righe-link */
.tm-big { font-family: var(--tm-font-title); font-size: 40px; font-weight: 700; line-height: 1; color: var(--tm-t-900); }
.tm-big small { font-size: 16px; font-weight: 600; margin-left: 4px; }
.tm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--tm-chip); color: var(--tm-t-800); font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.tm-chip.is-mint { background: var(--tm-mint-soft); }
.tm-chip.is-alert { background: var(--tm-alert-soft); color: var(--tm-alert-ink); }
.tm-chip.is-dark { background: var(--tm-green-900); color: #fff; }
.tm-riga {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 1.25rem;
    color: var(--tm-ink); text-decoration: none; border-top: 1px solid var(--tm-line-soft);
}
.tm-riga:first-child { border-top: 0; }
a.tm-riga:hover { background: var(--tm-bg); color: var(--tm-ink); }
.tm-riga.is-on { background: var(--tm-evidenza); }
.tm-sigla { width: 48px; height: 48px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--tm-green-900); color: var(--tm-mint); }
.tm-sigla svg { width: 24px; height: 24px; vertical-align: 0; }
.tm-riga-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tm-riga-txt > :first-child { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-riga-txt > small { font-size: 12px; color: var(--tm-muted); }
.tm-riga-pos { font-family: var(--tm-font-title); font-size: 18px; font-weight: 700; }
.tm-riga-su { font-size: 12px; color: var(--tm-muted); min-width: 44px; }
.tm-riga-chev { color: var(--tm-muted); }
.tm-section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: .75rem; }
.tm-section-title h2, .tm-section-title .h2 { font-family: var(--tm-font); font-size: 16px; font-weight: 600; margin: 0; }
.tm-section-title a { font-size: 13px; font-weight: 600; text-decoration: none; }
.tm-section-title span { font-size: 13px; color: var(--tm-muted); }
.tm-form-title { font-family: var(--tm-font); font-size: 16px; font-weight: 700; margin: 0 0 1rem; }
.tm-h-section { margin: 1.25rem 2px .6rem; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--tm-muted); font-family: var(--tm-font); }

/* due colonne: contenuto principale + colonna laterale (va a capo da sola) */
.tm-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.tm-col-main { flex: 3 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tm-col-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tm-stack { display: flex; flex-direction: column; gap: 16px; }
/* pagine "a modulo" (Impostazioni): una colonna di lettura comoda, centrata */
.tm-stack.is-narrow { max-width: 720px; margin-inline: auto; }
.tm-stack.is-narrow .tm-indietro + .page-head { margin-top: 4px; }
@media (max-width: 991.98px) { .tm-cols { gap: 16px; } .tm-col-main { flex-basis: 100%; } }
/* finché le colonne vanno a capo (sotto ~1200px) la colonna laterale marcata sale in cima */
@media (max-width: 1199.98px) { .tm-side-first { order: -1; } }
/* card di contorno che sotto i 1200px (colonne impilate) sarebbe solo rumore */
@media (max-width: 1199.98px) { .tm-solo-largo { display: none !important; } }
button.tm-riga { font: inherit; color: var(--tm-ink); width: 100%; text-align: left; cursor: pointer; border: 0; border-top: 1px solid var(--tm-line-soft); background: transparent; border-radius: 0 0 19px 19px; }
button.tm-riga:hover { background: var(--tm-bg); }

/* controllo a segmenti (es. Giocatori / Squadre) */
.tm-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tm-chip); margin-bottom: 1.25rem; max-width: 420px; }
.tm-seg > a, .tm-seg > button {
    flex: 1; min-height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 14px; font-weight: 600; color: var(--tm-muted); text-decoration: none; border: 0; background: transparent; cursor: pointer;
}
.tm-seg > a:hover, .tm-seg > button:hover { color: var(--tm-ink); }
.tm-seg > .on { background: var(--tm-surface); color: var(--tm-ink); box-shadow: 0 1px 3px rgba(4, 35, 26, .14); }

/* punti di un pronostico (standard): stessi colori ovunque */
.pt-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.pts-3 { background: var(--tm-green-900); color: var(--tm-mint); }
.pts-2 { background: var(--tm-green-600); color: #fff; }
.pts-1 { background: var(--tm-mint-soft); color: var(--tm-t-800); }
.pts-0 { background: var(--tm-pts0-bg); color: var(--tm-pts0-ink); }
.pts-unico { background: var(--tm-mint); color: var(--tm-green-950); gap: 3px; }
.tm-esiti.progress { gap: 2px; background: transparent; }
/* nella barra degli esiti i toni chiari devono staccarsi dallo sfondo */
.tm-esiti .pts-1 { background: #a8e6c9; }
.tm-esiti .pts-0 { background: #cdd5d1; }
.pt-legenda { display: flex; flex-direction: column; gap: 8px; }
.pt-legenda > span { display: flex; justify-content: space-between; font-size: 14px; }
.pt-legenda > span.is-muted { color: var(--tm-muted); }

/* obiettivi: sbloccati in evidenza, gli altri spenti */
.tm-obiettivo-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--tm-pts0-bg); color: var(--tm-muted); }
.tm-obiettivo-ico [data-lucide], .tm-obiettivo-ico svg { width: 24px; height: 24px; vertical-align: 0; }
.tm-obiettivo.is-ok { border-color: var(--tm-ok-line); }
.tm-obiettivo.is-ok .tm-obiettivo-ico { background: var(--tm-green-900); color: var(--tm-mint); }
.tm-obiettivo:not(.is-ok) .fw-bold { color: var(--tm-pts0-ink); }

/* ── Classifica squadre (Squadre/_GironeCard) ─────────────────────────────
   Righe-link a griglia: su telefono POS · SQUADRA · G · DR · PT; con .is-esteso
   (tabella unica a tutta larghezza) dai 768px anche V, N, P, GF, GS. */
.tm-sq { background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 16px; overflow: hidden; }
.tm-sq-scroll { overflow-x: auto; }
.tm-sq-titolo { padding: 12px 14px 4px; font-size: 14px; font-weight: 700; }
.tm-sq-head, .tm-sq-riga {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) 28px 40px 40px; gap: 8px; align-items: center; padding: 0 14px;
}
.tm-sq-head {
    padding-top: 10px; padding-bottom: 10px; background: var(--tm-head-bg); border-bottom: 1px solid var(--tm-chip);
    font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted);
}
.tm-sq-riga { min-height: 48px; border-bottom: 1px solid var(--tm-line-soft); color: var(--tm-ink); text-decoration: none; transition: background .15s; }
.tm-sq-riga:last-child { border-bottom: 0; }
.tm-sq-riga:hover, .tm-sq-riga:focus-visible { background: var(--tm-head-bg); color: var(--tm-ink); }
.tm-sq-pos { font-size: 13px; font-weight: 700; color: var(--tm-muted); }
.tm-sq-nome { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 600; }
.tm-sq-nome img { width: 20px; height: 20px; object-fit: contain; flex: none; }
.tm-sq-nome span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-sq .n { text-align: right; font-size: 13px; color: var(--tm-muted); }
.tm-sq-head .n { font-size: 11px; }
.tm-sq-pt { text-align: right; font: 700 15px var(--tm-font-title); }
.tm-sq .x { display: none; }
.tm-sq-nota { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--tm-muted); }
@media (min-width: 768px) {
    .tm-sq.is-esteso { border-radius: 20px; }
    .tm-sq.is-esteso .tm-sq-head, .tm-sq.is-esteso .tm-sq-riga {
        grid-template-columns: 44px minmax(140px, 1fr) repeat(7, 52px) 60px; padding: 0 20px; min-width: 700px;
    }
    .tm-sq.is-esteso .tm-sq-head { padding-top: 12px; padding-bottom: 12px; font-size: 12px; }
    .tm-sq.is-esteso .tm-sq-riga { min-height: 50px; }
    .tm-sq.is-esteso .x { display: block; }
    .tm-sq.is-esteso .tm-sq-pos, .tm-sq.is-esteso .n { font-size: 14px; }
    .tm-sq.is-esteso .tm-sq-head .n { font-size: 12px; }
    .tm-sq.is-esteso .tm-sq-nome { font-size: 15px; }
    .tm-sq.is-esteso .tm-sq-pt { font-size: 16px; }
    .tm-sq-nota { font-size: 13px; }
}

/* testo solo per lettori di schermo (es. etichette dei filtri) */
.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ── Area admin (come nei mockup Admin*) ────────────────────────────────── */
.tm-adm-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.tm-adm-kpi {
    flex: 1 1 200px; background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 16px; padding: 16px 18px;
    display: flex; flex-direction: column; gap: 4px;
}
.tm-adm-kpi > span { font-size: 13px; color: var(--tm-muted); }
.tm-adm-kpi > b { font: 700 26px var(--tm-font-title); line-height: 1.15; }
.tm-adm-kpi > small { font-size: 13px; color: var(--tm-muted); }
.tm-adm-kpi > small.is-ok { color: var(--tm-ok); font-weight: 600; }
.tm-adm-kpi.is-alert { background: var(--tm-alert-soft); border-color: var(--tm-alert-line-forte); }
.tm-adm-kpi.is-alert > span { color: var(--tm-alert-ink); }
.tm-adm-kpi.is-alert > b { color: var(--tm-alert-ink-forte); }
.tm-adm-kpi > em { font-style: normal; font-size: 15px; font-weight: 600; }
.tm-adm-due { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.tm-adm-card {
    flex: 2 1 320px; min-width: 0; background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 18px; padding: 18px 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.tm-adm-card.is-largo { flex: 3 1 480px; }
.tm-adm-card h2 { margin: 0; font-family: var(--tm-font); font-size: 17px; font-weight: 700; }
.tm-adm-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tm-adm-card-head span { font-size: 13px; color: var(--tm-muted); }
.tm-adm-vuoto { margin: 0; font-size: 14px; color: var(--tm-muted); }
.tm-adm-todo {
    display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 4px;
    border-top: 1px solid var(--tm-line-soft); color: var(--tm-ink); text-decoration: none;
}
.tm-adm-todo:hover { background: var(--tm-head-bg); color: var(--tm-ink); }
.tm-adm-punto { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--tm-alert); }
.tm-adm-todo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-adm-todo-txt strong { font-size: 15px; font-weight: 600; }
.tm-adm-todo-txt small { font-size: 13px; color: var(--tm-muted); }
.tm-adm-todo-azione { font-size: 14px; font-weight: 600; color: var(--tm-t-700); }
.tm-adm-iscritto { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--tm-line-soft); }
.tm-adm-iscritto-nome { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-adm-iscritto-quando { font-size: 13px; color: var(--tm-muted); }
.tm-adm-link { display: flex; align-items: center; min-height: 40px; font-size: 14px; font-weight: 600; text-decoration: none; }
.tm-adm-scorciatoie { display: flex; flex-wrap: wrap; gap: 12px; }
.tm-adm-scorc {
    flex: 1 1 220px; background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 16px; padding: 18px;
    display: flex; flex-direction: column; gap: 6px; color: var(--tm-ink); text-decoration: none; transition: border-color .15s;
}
.tm-adm-scorc:hover { border-color: var(--tm-green-600); color: var(--tm-ink); }
.tm-adm-scorc strong { font-size: 16px; }
.tm-adm-scorc span { font-size: 13px; line-height: 1.5; color: var(--tm-muted); }
/* intestazione con titolo a sinistra e filtri/azioni a destra */
.tm-adm-testa { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tm-adm-testa .page-head { margin-bottom: 0; }
.tm-adm-filtri { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-adm-filtri .form-select { width: auto; min-height: 44px; }
/* etichette di stato */
.tm-adm-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tm-adm-tag.is-ok { background: var(--tm-mint-soft); color: var(--tm-t-800); }
.tm-adm-tag.is-manca { background: #fde0cc; color: var(--tm-alert-ink-forte); }
.tm-adm-tag.is-live { background: #dbe8f6; color: #163a63; }
.tm-adm-tag.is-grigio { background: var(--tm-pts0-bg); color: var(--tm-pts0-ink); }
.tm-adm-tag.is-futuro { background: var(--tm-bg); color: var(--tm-muted); }
.tm-adm-tag.is-corrente { background: var(--tm-green-900); color: var(--tm-mint); }
.tm-adm-tag.is-admin { background: #f2c94c; color: #3d2c00; }
/* avviso arancio (partite senza risultato) */
.tm-adm-avviso {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 20px;
    border-radius: 14px; background: var(--tm-alert-soft); border: 1px solid var(--tm-alert-line-forte); color: var(--tm-alert-ink-forte); font-size: 14px; line-height: 1.5;
}
.tm-adm-avviso > span { flex: 1 1 300px; }
/* tabelle a griglia (righe-form) */
.tm-adm-tabella { background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 18px; overflow-x: auto; margin-bottom: 14px; }
.tm-adm-righe { min-width: var(--min, 860px); }
.tm-adm-riga, .tm-adm-th {
    display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center; padding: 10px 20px;
    border-bottom: 1px solid var(--tm-line-soft);
}
.tm-adm-riga:last-child { border-bottom: 0; }
.tm-adm-riga { min-height: 60px; }
.tm-adm-riga.is-manca { background: var(--tm-alert-soft); }
.tm-adm-th {
    padding-block: 12px; background: var(--tm-head-bg); border-bottom-color: var(--tm-chip);
    font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted);
}
.tm-adm-riga .tm-adm-partita { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-adm-riga .tm-adm-partita strong { font-size: 15px; font-weight: 600; }
.tm-adm-riga .tm-adm-partita small { font-size: 12px; color: var(--tm-muted); }
.tm-adm-quando { font-size: 14px; color: var(--tm-muted); }
.tm-adm-gol { display: flex; align-items: center; gap: 6px; }
.tm-adm-gol input {
    width: 48px; height: 40px; padding: 0; border-radius: 10px; border: 1px solid var(--tm-card-border); text-align: center;
    font: 700 17px var(--tm-font-title); color: var(--tm-ink); background: var(--tm-surface);
}
.tm-adm-gol b { color: var(--tm-muted); }
.tm-adm-azioni { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tm-adm-nota { margin: 0; font-size: 13px; color: var(--tm-muted); }
.tm-adm-piede { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* riepilogo scuro del giocatore (pronostici) */
.tm-adm-riepilogo {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 14px;
    border-radius: 14px; background: var(--tm-green-900); color: #fff;
}
.tm-adm-riepilogo-txt { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.tm-adm-riepilogo-txt strong { font-size: 16px; }
.tm-adm-riepilogo-txt small { font-size: 13px; color: #d4e4dc; }
.tm-adm-riepilogo b { font: 700 26px var(--tm-font-title); }
.tm-adm-riepilogo b small { font-size: 14px; }
/* filtri in una card (pronostici) */
.tm-adm-filtri-card {
    background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 18px; padding: 16px 20px; margin-bottom: 14px;
    display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
}
.tm-adm-filtri-card > div { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; }
.tm-adm-filtri-card > div.is-largo { flex: 2 1 260px; }
.tm-adm-filtri-card label { font-size: 13px; font-weight: 600; }
/* competizioni */
.tm-adm-comp { background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 18px; overflow: hidden; margin-bottom: 16px; }
.tm-adm-comp-testa { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--tm-chip); }
.tm-adm-comp-nome { flex: 1 1 260px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tm-adm-comp-nome strong { font-size: 17px; }
.tm-adm-comp-nome small { font-size: 13px; color: var(--tm-muted); }
.tm-adm-sync { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tm-muted); }
.tm-adm-sync i { width: 8px; height: 8px; border-radius: 50%; background: #b9c3be; }
.tm-adm-sync.is-ok { color: var(--tm-ok); }
.tm-adm-sync.is-ok i { background: var(--tm-green-600); }
.tm-adm-sync.is-ko { color: var(--tm-alert-ink); font-weight: 600; }
.tm-adm-sync.is-ko i { background: var(--tm-alert); }
.tm-adm-stagione { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--tm-line-soft); }
.tm-adm-stagione.is-on { background: var(--tm-evidenza); }
.tm-adm-stagione-nome { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.tm-adm-stagione-nome strong { font-size: 15px; font-weight: 600; }
.tm-adm-stagione-nome small { font-size: 13px; color: var(--tm-muted); }
.tm-adm-stagione-tag { display: flex; gap: 6px; }
.tm-adm-comp-piede { padding: 12px 20px; background: var(--tm-head-bg); }
/* utenti: ricerca + filtri a pillola */
.tm-adm-cerca { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.tm-adm-cerca input[type=search] { flex: 1 1 320px; min-height: 46px; }
.tm-adm-pillole { display: flex; gap: 8px; }
.tm-adm-pillole button {
    height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--tm-card-border); background: var(--tm-surface);
    font: 600 13px var(--tm-font); color: var(--tm-ink); cursor: pointer;
}
.tm-adm-pillole button.on { border-color: var(--tm-green-900); background: var(--tm-green-900); color: #fff; }

/* ── Archivio competizioni: una card per stagione ────────────────────────── */
.tm-archivio-gruppo { margin: 18px 0 10px; font-family: var(--tm-font); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tm-muted); }
.tm-archivio-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.tm-archivio-card {
    background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 20px; padding: 18px;
    display: flex; flex-direction: column; gap: 14px;
}
.tm-archivio-card.is-on { border-color: var(--tm-ok-line); box-shadow: inset 0 0 0 1px var(--tm-ok-line); }
.tm-archivio-testa { display: flex; align-items: center; gap: 12px; }
.tm-archivio-titolo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-archivio-titolo h2 { margin: 0; font-family: var(--tm-font); font-size: 16px; font-weight: 700; }
.tm-archivio-titolo span { font-size: 13px; color: var(--tm-muted); }
.tm-archivio-mio { display: flex; gap: 10px; }
.tm-archivio-mio span { flex: 1; background: var(--tm-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.tm-archivio-mio strong { font: 700 18px var(--tm-font-title); }
.tm-archivio-nota { margin: 0; font-size: 13px; line-height: 1.5; color: var(--tm-muted); }

/* ── Statistiche: punti per giornata, distribuzione, stile ──────────────── */
.tm-barre { display: flex; align-items: flex-end; gap: 6px; height: 170px; overflow-x: auto; padding-top: 4px; }
.tm-barra-g { flex: 1 0 26px; max-width: 56px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.tm-barra-col { width: 100%; border-radius: 8px 8px 4px 4px; background: #a8e6c9; min-height: 4px; }
.tm-barra-g.is-sopra .tm-barra-col { background: var(--tm-green-600); }
.tm-barra-v { font: 700 12px var(--tm-font-title); color: var(--tm-ink); }
.tm-barra-l { font-size: 11px; color: var(--tm-muted); white-space: nowrap; }
.tm-distrib { display: flex; height: 18px; border-radius: 9px; overflow: hidden; background: var(--tm-line-soft); }
.tm-distrib > span { height: 100%; }
.tm-distrib .pts-1 { background: #a8e6c9; }
.tm-distrib .pts-0 { background: #cdd5d1; }
.tm-distrib-leg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; }
.tm-distrib-leg span { display: flex; align-items: center; gap: 8px; }
.tm-distrib-leg b { margin-left: auto; font-family: var(--tm-font-title); }
.tm-distrib-leg i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tm-distrib-leg .pts-1 { background: #a8e6c9; }
.tm-distrib-leg .pts-0 { background: #cdd5d1; }
/* numeri appoggiati sullo sfondo della pagina (non dentro una card): riquadri bianchi */
.tm-numeri.is-card .tm-numero { background: var(--tm-surface); border: 1px solid var(--tm-line); }
.tm-stile { margin: 0; font-size: 14px; line-height: 1.55; color: var(--tm-testo-2); }
.tm-stile strong { color: var(--tm-ink); }

/* ── Profilo: chi sei e i tuoi numeri, in cima ───────────────────────────── */
.tm-profilo-testa {
    background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 20px; padding: 18px;
    display: flex; flex-direction: column; gap: 16px; margin-bottom: 1rem;
}
.tm-profilo-chi { display: flex; align-items: center; gap: 14px; }
.tm-profilo-chi h1 { margin: 0; font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-profilo-sub { font-size: 14px; color: var(--tm-muted); }
.tm-profilo-numeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tm-profilo-numeri > div { background: var(--tm-bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tm-profilo-numeri b { font: 700 20px var(--tm-font-title); }
.tm-profilo-numeri span { font-size: 12px; color: var(--tm-muted); }
@media (min-width: 768px) {
    .tm-profilo-testa { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 22px 24px; gap: 20px; }
    .tm-profilo-chi h1 { font-size: 28px; }
    .tm-profilo-numeri { display: flex; gap: 10px; }
    .tm-profilo-numeri > div { min-width: 110px; padding: 12px 14px; }
    .tm-profilo-numeri b { font-size: 22px; }
}

/* ── Dettaglio squadra ────────────────────────────────────────────────────
   Una colonna su telefono (prossima partita in cima); dai 1200px due colonne
   3:2. Le colonne sono "display: contents" finché impilate, così l'ordine
   dei blocchi lo decide order. */
.tm-indietro {
    display: inline-flex; align-items: center; gap: 4px; height: 40px; margin-left: -6px; padding: 0 6px;
    font-size: 14px; font-weight: 600; color: var(--tm-t-900); text-decoration: none;
}
.tm-indietro:hover { color: var(--tm-t-700); }
.tm-team-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 6px 0 18px; }
.tm-team-stemma {
    width: 56px; height: 56px; flex: none; border-radius: 16px; background: var(--tm-surface); border: 1px solid var(--tm-line);
    display: flex; align-items: center; justify-content: center;
}
.tm-team-stemma img { width: 40px; height: 40px; object-fit: contain; }
.tm-team-stemma.is-sigla { background: var(--tm-green-900); border-color: var(--tm-green-900); color: #fff; font: 700 18px var(--tm-font-title); }
.tm-team-titolo { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-team-titolo h1 { margin: 0; font-size: 24px; }
.tm-team-sub { font-size: 14px; color: var(--tm-muted); }
.tm-team-sub strong { color: var(--tm-ink); }

.tm-team { display: flex; flex-direction: column; gap: 12px; }
.tm-team-col { display: contents; }
.tm-team .o-pross { order: 1; }
.tm-team .o-forma { order: 2; }
.tm-team .o-casa { order: 3; }
.tm-team .o-ultime { order: 4; }
.tm-team-card { background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tm-team-card h2 { margin: 0; font-family: var(--tm-font); font-size: 15px; font-weight: 600; }
.tm-team-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tm-team-card-head span { font-size: 12px; color: var(--tm-muted); }
.tm-team-vuoto { margin: 0; font-size: 14px; color: var(--tm-muted); }

/* forma: quadratini V / N / P */
.tm-forma-riga { display: flex; gap: 8px; }
.tm-forma {
    width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    font: 700 14px var(--tm-font-title);
}
.tm-forma.is-sm { width: 28px; height: 28px; font-size: 12px; }
.tm-forma.is-v { background: var(--tm-green-600); color: #fff; }
.tm-forma.is-n { background: #d5dbd8; color: #26312c; }
.tm-forma.is-p { background: var(--tm-alert-soft); color: var(--tm-alert-ink); }
.tm-numeri { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tm-numero { background: var(--tm-bg); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tm-numero b { font: 700 20px var(--tm-font-title); }
.tm-numero span { font-size: 12px; color: var(--tm-muted); }

/* casa e trasferta: barra = punti fatti su quelli disponibili */
.tm-casafuori { display: flex; flex-direction: column; gap: 14px; }
/* la base 240px vale solo affiancate (desktop): in colonna diventerebbe un'altezza */
.tm-casafuori-voce { display: flex; flex-direction: column; gap: 6px; }
.tm-casafuori-riga { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tm-barra { height: 8px; border-radius: 4px; background: var(--tm-chip); overflow: hidden; }
.tm-barra > div { height: 100%; background: var(--tm-green-600); }
.tm-casafuori-gol { font-size: 12px; color: var(--tm-muted); }

/* prossima partita: card scura che porta alla schedina */
.tm-team-prossima {
    background: var(--tm-green-900); color: #fff; border-radius: 16px; padding: 16px;
    display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: background .15s;
}
.tm-team-prossima:hover { background: var(--tm-green-800); color: #fff; }
.tm-team-prossima-quando { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--tm-mint); }
.tm-team-prossima-riga { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-team-prossima-match { font-size: 18px; font-weight: 700; min-width: 0; }
.tm-team-prossima-pron { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.tm-team-prossima-pron span { font-size: 12px; color: #d4e4dc; }
.tm-team-prossima-pron b { font: 700 22px var(--tm-font-title); }
.tm-team-prossima-cta { font-size: 14px; font-weight: 600; color: var(--tm-mint); }

/* ultime partite */
.tm-team-card.is-lista { padding: 0; gap: 0; overflow: hidden; }
.tm-team-card.is-lista h2 { padding: 14px 16px 6px; }
.tm-team-card.is-lista .tm-team-vuoto { padding: 0 16px 14px; }
.tm-ultima {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px 28px; gap: 8px; align-items: center;
    min-height: 48px; padding: 0 16px; border-top: 1px solid var(--tm-line-soft);
}
.tm-ultima-g { font-size: 12px; color: var(--tm-muted); }
.tm-ultima-match { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-ultima-ris { font: 700 15px var(--tm-font-title); text-align: center; }

@media (min-width: 992px) {
    .tm-team-head { gap: 18px; margin-bottom: 22px; }
    .tm-team-stemma { width: 72px; height: 72px; border-radius: 20px; }
    .tm-team-stemma img { width: 52px; height: 52px; }
    .tm-team-stemma.is-sigla { font-size: 22px; }
    .tm-team-titolo h1 { font-size: 32px; }
    .tm-team-sub { font-size: 15px; }
    .tm-team-card { border-radius: 20px; padding: 20px; gap: 14px; }
    .tm-team-card h2 { font-size: 17px; font-weight: 700; }
    .tm-team-card-head span { font-size: 13px; }
    .tm-forma { width: 40px; height: 40px; font-size: 15px; }
    .tm-forma.is-sm { width: 30px; height: 30px; font-size: 12px; }
    .tm-numeri { display: flex; flex-wrap: wrap; gap: 10px; }
    .tm-numero { flex: 1 1 140px; border-radius: 14px; padding: 14px; }
    .tm-numero b { font-size: 24px; }
    .tm-numero span { font-size: 13px; }
    .tm-casafuori { flex-direction: row; flex-wrap: wrap; gap: 24px; }
    .tm-casafuori-voce { flex: 1 1 240px; }
    .tm-casafuori-riga { font-size: 14px; }
    .tm-barra { height: 10px; border-radius: 5px; }
    .tm-casafuori-gol { font-size: 13px; }
    .tm-team-prossima { border-radius: 20px; padding: 20px; gap: 12px; }
    .tm-team-prossima-match { font-size: 20px; }
    .tm-team-prossima-pron b { font-size: 26px; }
    .tm-team-card.is-lista { padding: 8px 0 0; }
    .tm-team-card.is-lista h2 { padding: 12px 20px; }
    .tm-team-card.is-lista .tm-team-vuoto { padding: 0 20px 16px; }
    .tm-ultima { grid-template-columns: 40px minmax(0, 1fr) 52px 32px; gap: 10px; min-height: 52px; padding: 0 20px; }
    .tm-ultima-g { font-size: 13px; }
    .tm-ultima-match { font-size: 15px; }
    .tm-ultima-ris { font-size: 16px; }
}
@media (min-width: 1200px) {
    .tm-team { flex-direction: row; align-items: flex-start; gap: 24px; }
    .tm-team-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
    .tm-team-col.is-main { flex: 3 1 0; }
    .tm-team-col.is-side { flex: 2 1 0; }
}

/* posizione in classifica (medaglia per i primi tre) */
.tm-pos { width: 30px; height: 30px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--tm-muted); }
.tm-pos.is-1 { background: #f2c94c; color: #3d2c00; }
.tm-pos.is-2 { background: #d5dbd8; color: #26312c; }
.tm-pos.is-3 { background: #e3a56d; color: #3b1f06; }
.tm-punti { font-family: var(--tm-font-title); font-size: 16px; font-weight: 700; }

/* ── Tabelle ──────────────────────────────────────────────────────────── */
.table { color: var(--tm-ink); }
.table > thead { background: var(--tm-head-bg); }
.table > thead th, .table thead.table-light th {
    color: var(--tm-muted); font-weight: 600; font-size: 12px; letter-spacing: .6px; text-transform: uppercase;
    border-bottom: 1px solid var(--tm-line-soft); white-space: nowrap;
}
.table th, .table td { padding: .7rem .75rem; border-bottom: 1px solid var(--tm-line-soft); }
.table-sm th, .table-sm td { padding: .5rem .6rem; }
.table th:first-child, .table td:first-child { padding-left: 1.1rem; }
.table th:last-child, .table td:last-child { padding-right: 1.1rem; }
/* su telefono le tabelle a molte colonne (riepilogo squadra, classifiche) devono starci senza scorrere */
@media (max-width: 575.98px) {
    .table th, .table td { padding: .55rem .4rem; }
    .table th:first-child, .table td:first-child { padding-left: .85rem; }
    .table th:last-child, .table td:last-child { padding-right: .85rem; }
    .table > thead th, .table thead.table-light th { letter-spacing: .3px; }
}
.table-hover > tbody > tr:hover { background: var(--tm-bg); }
.table-light { background: var(--tm-head-bg); }
.table-primary, tr.table-primary > * { background: var(--tm-ok-soft) !important; font-weight: 600; }
.table-bordered, .table-bordered th, .table-bordered td { border-color: var(--tm-line-soft); }

/* ── Badge ────────────────────────────────────────────────────────────────
   Stati come "chip" tenui; restano piene solo le notifiche (rosso-arancio). */
.badge { font-weight: 600; border-radius: 999px; padding: .4em .7em; }
.badge.bg-success, .badge.text-bg-success { background: var(--tm-mint-soft) !important; color: var(--tm-t-800) !important; }
.badge.bg-primary, .badge.text-bg-primary { background: var(--tm-green-900) !important; color: #fff !important; }
.badge.bg-warning { background: var(--tm-alert-soft) !important; color: var(--tm-alert-ink) !important; }
.badge.bg-secondary { background: var(--tm-pts0-bg) !important; color: var(--tm-pts0-ink) !important; }
.badge.bg-danger { background: var(--tm-alert) !important; color: #fff !important; }
.badge.bg-info { background: #dff1f5 !important; color: #0c5460 !important; }
.badge.bg-light { background: var(--tm-chip) !important; color: var(--tm-t-800) !important; border-color: transparent !important; }
.badge.bg-dark { background: var(--tm-green-950) !important; color: #fff !important; }
.bg-primary { background-color: var(--tm-green-900) !important; }
.text-bg-primary { background-color: var(--tm-green-900) !important; color: #fff !important; }
.bg-success, .text-bg-success { background-color: var(--tm-green-600) !important; }
.text-primary, .text-success { color: var(--tm-ok) !important; }
.text-danger { color: var(--tm-alert-ink) !important; }
.text-muted { color: var(--tm-muted) !important; }

/* ── Form ─────────────────────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 14px; }
.form-control, .form-select {
    min-height: 44px; border-radius: 12px; border: 1px solid var(--tm-card-border); padding: .55rem .85rem;
}
/* spazio per la freccia: senza, il testo lungo finisce sotto il chevron */
.form-select { padding-right: 2.25rem; }
.form-select-sm { padding-top: .3rem; padding-bottom: .3rem; font-size: .85rem; }
.form-control-sm { min-height: 36px; border-radius: 10px; }
/* iOS ingrandisce la pagina se un campo ha testo sotto i 16px: da zoomata la barra
   fissa in basso non segue più lo schermo. Vale anche per i controlli "sm". */
@media (max-width: 767.98px) {
    .form-select-sm, .form-control-sm { font-size: 16px; }
}
textarea.form-control { min-height: 88px; }
.form-control-color { min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--tm-green-600); box-shadow: 0 0 0 .22rem rgba(18, 128, 90, .15); }
.form-check-input { border-color: var(--tm-card-border); }
.form-check-input:checked { background-color: var(--tm-green-600); border-color: var(--tm-green-600); }
.form-check-input:focus { border-color: var(--tm-green-600); box-shadow: 0 0 0 .22rem rgba(18, 128, 90, .15); }
.input-group > .form-control { border-radius: 12px; }
.input-group > :not(:first-child) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
.input-group > :not(:last-child) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.password-toggle { border-radius: 0 12px 12px 0; }

/* ── Progress ─────────────────────────────────────────────────────────── */
.progress { border-radius: 999px; background: var(--tm-chip); }
.progress-bar { background-color: var(--tm-green-600); }
.progress-bar.bg-success { background-color: var(--tm-green-600) !important; }

/* ── List group ───────────────────────────────────────────────────────── */
.list-group { border-radius: 20px; }
.list-group-item { padding: .85rem 1.1rem; border-color: var(--tm-line); }
.list-group-flush > .list-group-item { border-color: var(--tm-line-soft); }
.list-group-item:first-child { border-top-left-radius: 20px; border-top-right-radius: 20px; }
.list-group-item:last-child { border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; }
.list-group-flush > .list-group-item:first-child, .list-group-flush > .list-group-item:last-child { border-radius: 0; }
.list-group-item-action:hover { background: var(--tm-bg); }
.list-group-item.active { background: var(--tm-green-900); border-color: var(--tm-green-900); }
.list-group-item-primary { background: var(--tm-ok-soft); }

/* ── Nav tabs / pills ─────────────────────────────────────────────────────
   Le schede diventano un controllo a segmenti, come nei mockup. */
.nav-tabs { border-bottom: 0; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tm-chip); display: inline-flex; flex-wrap: wrap; }
.nav-tabs .nav-link {
    border: 0; border-radius: 9px; margin: 0; min-height: 40px; display: inline-flex; align-items: center; gap: 6px;
    color: var(--tm-muted); font-weight: 600; font-size: 14px;
}
.nav-tabs .nav-link:hover { color: var(--tm-ink); }
.nav-tabs .nav-link.active { color: var(--tm-ink); background: var(--tm-surface); border: 0; box-shadow: 0 1px 3px rgba(4, 35, 26, .14); }
.nav-pills .nav-link { color: var(--tm-muted); font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.nav-pills .nav-link:hover { color: var(--tm-ink); background: var(--tm-chip); }
.nav-pills .nav-link.active { background: var(--tm-green-900); color: #fff; }

/* ── Accordion ────────────────────────────────────────────────────────── */
.accordion-item { border-color: var(--tm-line); }
.accordion-item:first-of-type { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.accordion-item:last-of-type { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.accordion-item:first-of-type .accordion-button { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.accordion-button { min-height: 56px; font-weight: 600; font-size: 15px; background: transparent; }
.accordion-button:not(.collapsed) { background: transparent; color: var(--tm-t-900); }
.accordion-body { padding: 0 1rem 1rem; color: var(--tm-testo-2); font-size: 14px; line-height: 1.6; }

/* ── Alert ────────────────────────────────────────────────────────────── */
.alert { border-radius: 14px; font-size: 14px; }
.alert-info, .alert-success { background: var(--tm-ok-soft); border-color: var(--tm-ok-line); color: var(--tm-t-800); }
.alert-warning { background: var(--tm-alert-soft); border-color: var(--tm-alert-line); color: var(--tm-alert-ink); }
/* riepilogo errori di validazione: niente elenco puntato dentro l'avviso */
.alert ul { margin: 0; padding-left: 0; list-style: none; }
.alert ul li + li { margin-top: .25rem; }

/* ── Toast ────────────────────────────────────────────────────────────── */
/* Messaggi dopo un salvataggio e notifiche (window.tmToast, site.js): in alto a destra su desktop,
   a tutta larghezza sotto l'intestazione su telefono, così non coprono barra di salvataggio e tab bar.
   Il tipo (successo, errore, avviso, info) cambia solo colore e icona. */
.tm-toasts {
    position: fixed; z-index: 1090; top: 16px; right: 16px; width: min(380px, calc(100vw - 32px));
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
@media (max-width: 991.98px) {
    .tm-toasts { top: calc(env(safe-area-inset-top) + 12px); left: 16px; right: 16px; width: auto; }
}
.tm-toast {
    --tt: var(--tm-green-600); --tt-soft: var(--tm-mint-soft);
    position: relative; display: block; max-width: none; margin: 0; overflow: hidden; pointer-events: auto;
    background: var(--tm-surface); border: 1px solid var(--tm-line); border-left: 4px solid var(--tt) !important; border-radius: 14px;
    box-shadow: 0 14px 34px -16px rgba(6, 42, 32, .5);
    opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease;
}
.tm-toast.show { opacity: 1; transform: none; }
.tm-toast-errore { --tt: var(--tm-danger); --tt-soft: #fdeceb; }
.tm-toast-avviso { --tt: var(--tm-alert); --tt-soft: var(--tm-alert-soft); }
.tm-toast-info { --tt: var(--tm-green-900); --tt-soft: var(--tm-bg); }
.tm-toast .toast-header { display: flex; align-items: center; gap: .6rem; padding: .75rem .8rem .15rem .9rem; }
.tm-toast-ico {
    flex: none; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; background: var(--tt-soft); color: var(--tt);
}
.tm-toast .toast-header strong { margin-right: auto; font: 700 .85rem/1.2 var(--tm-font-title); color: var(--tm-ink); }
.tm-toast .btn-close { flex: none; width: 28px; height: 28px; padding: 0; background-size: 12px; opacity: .55; }
.tm-toast .btn-close:hover, .tm-toast .btn-close:focus-visible { opacity: 1; background-color: var(--tm-bg); }
.tm-toast .toast-body { padding: 0 1rem .95rem calc(.9rem + 26px + .6rem); font-size: .9rem; line-height: 1.45; color: var(--tm-ink); overflow-wrap: anywhere; }
/* conto alla rovescia: si ferma col mouse sopra (la durata la imposta il JS) */
.tm-toast-bar {
    position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--tt); opacity: .4;
    transform-origin: left; animation: tm-toast-bar 6s linear forwards;
}
.tm-toast:hover .tm-toast-bar, .tm-toast:focus-within .tm-toast-bar { animation-play-state: paused; }
@keyframes tm-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .tm-toast { transition: opacity .15s ease; transform: none; }
    .tm-toast-bar { animation: none; display: none; }
}

/* ── Stato vuoto ──────────────────────────────────────────────────────────
   Una schermata vuota è un invito ad agire: icona, spiegazione e, dove ha
   senso, un'azione. */
.empty-state { text-align: center; padding: 2.5rem 1.25rem; color: var(--tm-muted); }
.empty-state .empty-icon {
    width: 52px; height: 52px; margin: 0 auto .85rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--tm-mint-soft); color: var(--tm-t-700);
}
.empty-state .empty-icon [data-lucide], .empty-state .empty-icon svg { width: 26px; height: 26px; }
.empty-state .empty-title { font-size: 1.05rem; font-weight: 700; color: var(--tm-ink); margin-bottom: .35rem; }
.empty-state p { max-width: 46ch; margin: 0 auto 1rem; font-size: .92rem; }
.empty-state p:last-child { margin-bottom: 0; }

/* ── Elenco giornate ──────────────────────────────────────────────────── */
.list-group-item.giornata-attiva { border-left: 4px solid var(--tm-mint); background: var(--tm-evidenza); }
@media (max-width: 575.98px) {
    .giornata-riga { flex-direction: column; align-items: flex-start !important; gap: .4rem !important; }
    .giornata-riga > .text-end { text-align: left !important; }
    .giornata-riga > .text-end > .text-muted { margin-top: .15rem; }
}

/* ── Schedina: inserimento pronostici ─────────────────────────────────────
   Telefono: una card per partita, nomi sopra e +/- sotto ciascuna squadra.
   Desktop: una tabella unica (quando · casa · gol : gol · ospite · stato)
   accanto al riepilogo. Stesso markup: la griglia cambia con le aree. */
.schedina { display: flex; flex-direction: column; gap: 10px; }
.match {
    background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 16px; padding: 12px 14px 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) 14px minmax(0, 1fr); column-gap: 6px; row-gap: 8px;
    grid-template-areas: "meta meta meta" "hn . an" "hs sep as";
    align-items: center;
}
.match-meta { grid-area: meta; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 12px; color: var(--tm-muted); }
.match-stato { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.match-stato.is-ok { color: var(--tm-ok); }
.match-stato.is-todo { color: var(--tm-alert-ink); }
.match-stato.is-live { color: var(--tm-alert-txt); }
.match-team { display: flex; align-items: center; justify-content: center; gap: .4rem; min-width: 0; font-weight: 600; font-size: 15px; }
.match-team img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; display: block; }
.match-team .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-home { grid-area: hn; }
.match-away { grid-area: an; }
.match-gol { display: flex; align-items: center; justify-content: center; gap: 4px; }
.match-gol.is-home { grid-area: hs; }
.match-gol.is-away { grid-area: as; }
.match-sep { grid-area: sep; text-align: center; font-size: 22px; font-weight: 700; color: var(--tm-muted); }
.match-final { grid-column: 1 / -1; grid-row: 3; text-align: center; font-family: var(--tm-font-title); font-size: 24px; font-weight: 700; white-space: nowrap; }
.match-vs { grid-column: 1 / -1; grid-row: 3; text-align: center; color: var(--tm-muted); font-size: .9rem; }
.match-esito { grid-column: 1 / -1; padding-top: 8px; border-top: 1px dashed var(--tm-line); text-align: center; font-size: 13px; color: var(--tm-muted); }
.match-gol .form-control {
    width: 44px; min-height: 44px; padding: 0; text-align: center; border-radius: 12px;
    font-family: var(--tm-font-title); font-size: 24px; font-weight: 700; color: var(--tm-ink);
    border-color: transparent; background: transparent; -moz-appearance: textfield; appearance: textfield;
}
.match-gol .form-control:hover { border-color: var(--tm-card-border); }
.match-gol .form-control:focus { border-color: var(--tm-green-600); background: var(--tm-surface); }
.match-gol .form-control::placeholder { color: var(--tm-placeholder); }
.match-gol .form-control::-webkit-outer-spin-button,
.match-gol .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st {
    width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--tm-card-border); background: var(--tm-bg);
    color: var(--tm-t-900); font: 600 22px/1 var(--tm-font); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.st:hover { background: var(--tm-chip); }
.st:active { background: var(--tm-mint-soft); }
.st:focus-visible { outline: 2px solid var(--tm-green-600); outline-offset: 1px; }

/* intestazione colonne (solo schermi larghi) */
.schedina-head { display: none; }

/* schermi medi: le card si affiancano su due colonne */
@media (min-width: 768px) and (max-width: 1399.98px) {
    .schedina { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* Schermi larghi: tabella unica accanto al riepilogo. Sotto i 1400px la
   tabella non lascerebbe spazio ai nomi delle squadre (c'è anche la barra laterale). */
@media (min-width: 1400px) {
    .schedina { gap: 0; background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 20px; overflow: hidden; }
    .schedina-head, .schedina .match {
        display: grid; grid-template-columns: 84px minmax(0, 1fr) 124px 12px 124px minmax(0, 1fr) 84px; column-gap: 10px;
        grid-template-areas: "when hn hs sep as an stato" "esito esito esito esito esito esito esito";
        padding: 8px 20px; align-items: center;
    }
    .schedina-head {
        padding: 12px 20px; font-size: 12px; font-weight: 600; letter-spacing: .6px; color: var(--tm-muted);
        background: var(--tm-head-bg); border-bottom: 1px solid var(--tm-line-soft); text-transform: uppercase;
    }
    .schedina .match { border: 0; border-radius: 0; border-bottom: 1px solid var(--tm-line-soft); min-height: 62px; row-gap: 0; }
    .schedina .match:last-child { border-bottom: 0; }
    .schedina .match-meta { display: contents; }
    .schedina .match-when { grid-area: when; font-size: 13px; color: var(--tm-muted); }
    .schedina .match-stato { grid-area: stato; justify-self: end; font-size: 12px; font-weight: 700; }
    .schedina .match-home { justify-content: flex-end; text-align: right; }
    .schedina .match-away { justify-content: flex-start; }
    .schedina .st { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
    .schedina .match-gol .form-control { width: 40px; font-size: 22px; }
    .schedina .match-final, .schedina .match-vs { grid-row: 1; grid-column: 3 / 6; }
    .schedina .match-esito { grid-area: esito; border-top: 0; padding: 0 0 6px; text-align: center; }
    .schedina-head > :nth-child(2) { text-align: right; }
    .schedina-head > :nth-child(3), .schedina-head > :nth-child(5) { text-align: center; }
    .schedina-head > :last-child { text-align: right; }
}

/* riepilogo laterale (schermi larghi) / barra fissa in basso (gli altri) */
.schedina-side .tm-hero { gap: 14px; }
.schedina-side .tm-hero .tm-big { color: #fff; font-size: 34px; }
.schedina-bar {
    position: sticky; bottom: 0; z-index: 20; margin: 12px -1rem 0;
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    background: var(--tm-surface); border-top: 1px solid var(--tm-line);
}
.schedina-bar .avanzamento { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.schedina-bar .avanzamento strong { font-size: 14px; }
.schedina-bar .avanzamento small { font-size: 12px; color: var(--tm-muted); }
.schedina-bar .btn { min-height: 52px; border-radius: 14px; padding: 0 22px; }
body.has-tabbar .schedina-bar { bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .schedina-bar { margin-inline: -1.5rem; padding-inline: 1.5rem; } }
@media (min-width: 992px) {
    body.has-tabbar .schedina-bar { bottom: 0; }
    .schedina-bar { margin-inline: -2.5rem; padding-inline: 2.5rem; }
}
@media (min-width: 1400px) { .schedina-bar { display: none; } }
.schedina-intesta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.schedina-legenda { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.schedina-legenda > span { padding: 4px 8px; border-radius: 8px; background: var(--tm-chip); color: var(--tm-t-800); }
.schedina-legenda > span:first-child { background: var(--tm-green-900); color: #fff; }
.schedina-legenda > span:first-child strong { color: var(--tm-mint); }
@media (min-width: 1400px) { .schedina-intesta { display: none; } }
@media (max-width: 1399.98px) { .schedina-side { display: none; } }
/* Su schermo stretto lo spazio va ai nomi delle squadre */
@media (max-width: 380px) {
    .match { padding: 10px 10px 12px; }
    .st { width: 38px; height: 38px; }
    .match-gol .form-control { width: 38px; font-size: 22px; }
    .match-team { font-size: 14px; }
}

/* ── Risultati di una giornata conclusa ───────────────────────────────── */
.risultati { background: var(--tm-surface); border: 1px solid var(--tm-line); border-radius: 20px; overflow: hidden; }
.risultati-head, .risultati-riga {
    display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 92px; gap: 10px; align-items: center; padding: 0 14px;
}
.risultati-head { padding-block: 10px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted); background: var(--tm-head-bg); border-bottom: 1px solid var(--tm-line-soft); }
.risultati-riga { min-height: 56px; border-bottom: 1px solid var(--tm-line-soft); }
.risultati-riga:last-child { border-bottom: 0; }
.risultati-partita { font-size: 14px; font-weight: 600; min-width: 0; display: flex; flex-direction: column; }
.risultati-partita small { font-size: 12px; font-weight: 400; color: var(--tm-muted); }
.risultati-finale { text-align: center; font-family: var(--tm-font-title); font-size: 17px; font-weight: 700; white-space: nowrap; }
.risultati-tuo { text-align: center; font-size: 14px; color: var(--tm-testo-2); white-space: nowrap; }
.risultati-punti { justify-self: end; }
.risultati-head > :nth-child(2), .risultati-head > :nth-child(3) { text-align: center; }
.risultati-head > :last-child { text-align: right; }
@media (min-width: 992px) {
    .risultati-head, .risultati-riga { grid-template-columns: minmax(0, 1fr) 90px 110px 140px; gap: 14px; padding-inline: 20px; }
    .risultati-partita { font-size: 15px; }
    .risultati-finale { font-size: 18px; }
}
/* telefono (come nel mockup): niente colonna "Il tuo", il pronostico va sotto la partita */
.risultati-tuo-mob { display: none; }
@media (max-width: 575.98px) {
    .risultati-head, .risultati-riga { grid-template-columns: minmax(0, 1fr) 52px 104px; gap: 8px; padding-inline: 14px; }
    .risultati-riga { padding-block: 10px; }
    .risultati-tuo, .risultati-head > :nth-child(3) { display: none; }
    .risultati-tuo-mob { display: block; }
    .risultati-quando { display: none; }
    .risultati-punti .pt-badge { white-space: nowrap; }
}
@media (max-width: 359.98px) {
    .risultati-head, .risultati-riga { grid-template-columns: minmax(0, 1fr) 48px auto; }
    .risultati-punti .pt-label { display: none; }
}

/* frecce giornata precedente / successiva */
.tm-freccia {
    width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--tm-line); background: var(--tm-surface);
    display: inline-flex; align-items: center; justify-content: center; color: var(--tm-t-900); text-decoration: none;
}
.tm-freccia:hover { border-color: var(--tm-green-600); color: var(--tm-t-900); }
.tm-freccia.is-off { opacity: .35; }
@media (max-width: 575.98px) { .tm-freccia { width: 44px; height: 44px; } }
.tm-riga.tm-riga-compatta { min-height: 44px; padding: 6px 4px; }

/* ── Bracket fase a eliminazione (Squadre, tornei) ───────────────────────── */
.tm-bk-desktop { display: none; }                              /* di default (mobile) si mostra lo stack */
@media (min-width: 992px) {
    .tm-has-tree .tm-bk-desktop { display: block; }
    .tm-has-tree .tm-bk-stack { display: none; }
}

/* box partita (condiviso albero / stack / preliminari) */
.tm-bk-match { width: 100%; border: 1px solid var(--tm-card-border); border-radius: 8px; background: var(--tm-surface); overflow: hidden; }
.tm-bk-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .25rem .5rem; white-space: nowrap; font-size: .85rem; }
.tm-bk-row + .tm-bk-row { border-top: 1px solid var(--tm-line-soft); }
.tm-bk-team { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; }
.tm-bk-team img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.tm-bk-name { overflow: hidden; text-overflow: ellipsis; }
.tm-bk-score { font-weight: 700; }
.tm-bk-win { font-weight: 700; }
.tm-bk-lose { color: var(--tm-placeholder); }
.tm-bk-date { padding: .2rem .5rem; font-size: .72rem; color: var(--tm-muted); border-top: 1px solid var(--tm-line-soft); }
.tm-bk-legs { padding: .15rem .5rem; font-size: .7rem; color: var(--tm-muted); border-top: 1px solid var(--tm-line-soft); text-align: center; white-space: nowrap; }

/* turni preliminari (es. Spareggi Champions) */
.tm-bk-prelim { display: flex; flex-wrap: wrap; gap: .6rem; }
.tm-bk-prelim .tm-bk-match { width: 210px; }

/* albero convergente (desktop) */
.tm-bk-tree { display: flex; justify-content: center; align-items: stretch; overflow-x: auto; padding-bottom: .5rem; }
.tm-bk-side { display: flex; }
.tm-bk-col { display: flex; flex-direction: column; flex: 0 0 128px; }
.tm-bk-col-title { text-align: center; font-size: .72rem; font-weight: 600; color: var(--tm-muted); padding-bottom: .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-bk-col-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.tm-bk-mw { flex: 1; display: flex; align-items: center; position: relative; padding: 5px 0; }
.tm-bk-tree .tm-bk-match { width: 108px; position: relative; z-index: 1; }
.tm-bk-left .tm-bk-mw { justify-content: flex-start; }
.tm-bk-right .tm-bk-mw { justify-content: flex-end; }
.tm-bk-center { display: flex; flex-direction: column; justify-content: center; gap: 1.4rem; flex: 0 0 148px; padding: 0 .4rem; }
.tm-bk-center .tm-bk-match { width: 100%; }
.tm-bk-final .tm-bk-match { border-color: var(--tm-green-700); }

/* connettori: braccio orizzontale per ogni match verso il centro + verticale che unisce ogni coppia */
.tm-bk-left .tm-bk-mw::after { content: ""; position: absolute; left: 108px; right: 0; top: 50%; height: 2px; background: var(--tm-card-border); }
.tm-bk-left .tm-bk-col:not(:last-child) .tm-bk-mw:nth-child(odd)::before { content: ""; position: absolute; right: 0; top: 50%; height: 100%; width: 2px; background: var(--tm-card-border); }
.tm-bk-right .tm-bk-mw::after { content: ""; position: absolute; right: 108px; left: 0; top: 50%; height: 2px; background: var(--tm-card-border); }
.tm-bk-right .tm-bk-col:not(:first-child) .tm-bk-mw:nth-child(odd)::before { content: ""; position: absolute; left: 0; top: 50%; height: 100%; width: 2px; background: var(--tm-card-border); }

/* stack (mobile): il box riempie la riga della lista, senza bordo proprio */
.tm-bk-stack .tm-bk-match { border: 0; border-radius: 0; }

/* ── Pagine legali (privacy, termini…) ────────────────────────────────── */
.legal-hero {
    background: var(--tm-green-900);
    color: #fff; border-radius: 22px; padding: 2rem 2rem 1.75rem; position: relative; overflow: hidden;
}
.legal-hero h1 { color: #fff; }
.legal-hero .legal-badge {
    display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.14);
    color: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; font-weight: 600;
}
.legal-toc { position: sticky; top: 1rem; }
.legal-toc .list-group-item { border: 0; padding: .4rem .6rem; border-radius: 8px; color: var(--tm-muted); font-size: .9rem; }
.legal-toc .list-group-item:hover { background: var(--tm-bg); color: var(--tm-t-700); }
.legal-section { scroll-margin-top: 1rem; }
.legal-section .card-header { display: flex; align-items: center; gap: .6rem; }
.legal-num {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tm-mint-soft); color: var(--tm-t-700); font-weight: 700; font-size: .9rem;
}
.legal-body p:last-child, .legal-body ul:last-child { margin-bottom: 0; }
.legal-body li { margin-bottom: .35rem; }
html { scroll-behavior: smooth; }

/* ── Benvenuto (dopo la registrazione) ─────────────────────────────────── */
body.tm-benvenuto { margin: 0; min-height: 100vh; background: var(--tm-green-950); color: #fff; font-family: var(--tm-font); }
.tm-benv {
    max-width: 1120px; min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
}
.tm-benv-top { display: flex; justify-content: space-between; align-items: center; }
.tm-benv .tm-brand { color: #fff; font-size: 20px; }
.tm-benv .tm-brand b { color: var(--tm-mint); }
.tm-benv-salta, .tm-benv-link { color: var(--tm-mint); font-weight: 600; font-size: 15px; text-decoration: none; }
.tm-benv-salta:hover, .tm-benv-link:hover { color: #8af0c4; }
.tm-benv-intro { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.tm-benv-intro h1 { color: #fff; margin: 0; font-size: 30px; line-height: 1.15; }
.tm-benv-intro p { color: #c3d6cc; margin: 0; font-size: 15px; }
.tm-benv-passi { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tm-benv-passo { background: var(--tm-green-900); border: 1px solid var(--tm-green-700); border-radius: 16px; padding: 14px 16px; display: flex; gap: 14px; }
.tm-benv-num {
    flex: none; width: 32px; height: 32px; border-radius: 16px; background: var(--tm-mint); color: var(--tm-green-950);
    display: flex; align-items: center; justify-content: center; font: 700 15px var(--tm-font-title);
}
.tm-benv-passo h2 { color: #fff; font-family: var(--tm-font); font-size: 16px; margin: 0 0 4px; }
.tm-benv-passo p { color: #c3d6cc; font-size: 13px; line-height: 1.5; margin: 0; }
.tm-benv-passo p strong { color: #fff; }
.tm-benv-esempi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 8px; font-size: 13px; }
.tm-benv-esempi span { display: flex; justify-content: space-between; gap: 6px; background: var(--tm-green-800); border-radius: 10px; padding: 8px 10px; }
.tm-benv-esempi strong { color: var(--tm-mint); white-space: nowrap; }
.tm-benv-esempi .is-zero strong { color: #c3d6cc; }
.tm-benv-link { margin-top: 8px; }
.tm-benv-cta { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.tm-benv-chiude { color: #c3d6cc; font-size: 14px; text-align: center; }
.tm-benv-dopo { min-height: 48px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; text-decoration: none; }
.tm-benv-dopo:hover { color: var(--tm-mint); }
@media (min-width: 992px) {
    .tm-benv { gap: 40px; padding: 40px 40px 56px; }
    .tm-benv .tm-brand { font-size: 24px; }
    .tm-benv-intro { gap: 12px; }
    .tm-benv-intro h1 { font-size: 46px; line-height: 1.1; }
    .tm-benv-intro p { font-size: 18px; }
    .tm-benv-passi { flex-direction: row; flex-wrap: wrap; gap: 20px; }
    .tm-benv-passo { flex: 1 1 280px; flex-direction: column; gap: 12px; padding: 24px; border-radius: 22px; }
    .tm-benv-passo > div { flex: 1; }
    .tm-benv-num { width: 40px; height: 40px; border-radius: 20px; font-size: 17px; }
    .tm-benv-passo h2 { font-size: 20px; margin-bottom: 8px; }
    .tm-benv-passo p { font-size: 15px; line-height: 1.55; }
    .tm-benv-esempi { grid-template-columns: 1fr; font-size: 14px; }
    .tm-benv-cta { margin-top: 0; flex-direction: row; align-items: center; gap: 16px; }
    .tm-benv-chiude { font-size: 15px; text-align: left; }
}

/* ── Nuova lega (crea / entra / pubbliche) ─────────────────────────────── */
.tm-nuova-crea fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tm-nuova-crea legend { float: none; width: auto; padding: 0; }
.tm-scelte { display: flex; flex-wrap: wrap; gap: 10px; }
.tm-scelta {
    flex: 1 1 200px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0;
    border: 1px solid var(--tm-card-border); border-radius: 12px; cursor: pointer; background: var(--tm-surface);
    transition: border-color .15s, background .15s;
}
.tm-scelta:hover { border-color: var(--tm-green-600); }
.tm-scelta:has(input:checked) { border-color: var(--tm-green-600); background: var(--tm-evidenza); }
.tm-scelta input { margin-top: 3px; accent-color: var(--tm-green-600); width: 18px; height: 18px; flex: none; }
.tm-scelta span { display: flex; flex-direction: column; gap: 2px; }
.tm-scelta strong { font-size: 14px; }
.tm-scelta small { font-size: 12px; color: var(--tm-muted); }
.tm-codice { font-family: var(--tm-font-title); font-size: 22px; letter-spacing: 5px; text-transform: uppercase; min-height: 52px; }
.tm-codice::placeholder { letter-spacing: 2px; text-transform: none; font-size: 16px; font-family: var(--tm-font); }
@media (max-width: 991.98px) { [data-pannello].is-nascosto { display: none !important; } }

/* ── Dettaglio lega: elenco delle proprie leghe accanto (schermi larghi) ── */
.tm-lega-layout { display: block; }
.tm-lega-lato { display: none; }
.tm-lega-elenco { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
@media (min-width: 1200px) {
    .tm-lega-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
    .tm-lega-lato { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 1rem; }
    .tm-solo-stretto { display: none !important; }
}
.tm-lega-invito { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tm-lega-invito h2 { margin: 0; font-family: var(--tm-font); font-size: 15px; font-weight: 700; }
.tm-lega-invito p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--tm-muted); }
.tm-lega-codice { font-size: 13px; color: var(--tm-muted); }
.tm-lega-codice strong { font-family: ui-monospace, monospace; letter-spacing: 1px; color: var(--tm-ink); }
.tm-lega-mia { font-size: 14px; color: var(--tm-muted); margin-bottom: 14px; }
.tm-lega-mia strong { color: var(--tm-ink); }
.tm-lega-elenco h2 { margin: 6px 8px; font-family: var(--tm-font); font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--tm-muted); }
.tm-lega-voce { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--tm-ink); text-decoration: none; }
.tm-lega-voce:hover { background: var(--tm-bg); color: var(--tm-ink); }
.tm-lega-voce.on { background: var(--tm-ok-soft); }
.tm-lega-voce span:last-child { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tm-lega-voce strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-lega-voce small { font-size: 12px; color: var(--tm-muted); }
.tm-lega-nuova {
    margin-top: 6px; min-height: 46px; border-radius: 12px; border: 1px dashed var(--tm-green-600);
    display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 700; text-decoration: none;
}
.tm-lega-nuova:hover { background: var(--tm-evidenza); }

/* "La tua forma" in dashboard: punti delle ultime giornate, una tessera ciascuna */
.tm-forma-giornate { display: flex; gap: 8px; flex: 1 1 260px; max-width: 360px; min-width: 0; }
a.tm-fg {
    flex: 1 1 0; min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 9px 4px 7px; border-radius: 12px; background: var(--tm-chip); color: var(--tm-ink); text-decoration: none;
}
a.tm-fg b { font: 700 22px/1.1 var(--tm-font-title); }
a.tm-fg span { font-size: 11px; font-weight: 600; color: var(--tm-muted); }
a.tm-fg.is-sopra { background: var(--tm-mint-soft); color: var(--tm-t-800); }
a.tm-fg.is-sopra span { color: var(--tm-t-800); }
a.tm-fg:hover, a.tm-fg:focus-visible { box-shadow: inset 0 0 0 1.5px var(--tm-green-600); outline: 0; }

/* ── Scheda di un altro giocatore ─────────────────────────────────────────
   Avatar + nome che aprono la scheda (classifiche, membri di lega, tabellone). */
a.tm-giocatore { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; color: inherit; font-weight: 600; text-decoration: none; }
a.tm-giocatore:hover, a.tm-giocatore:focus-visible { color: var(--tm-t-700); text-decoration: underline; }
/* "Tu e lui": etichetta + due colonne di valori, vince chi sta meglio */
.tm-vs { display: flex; flex-direction: column; }
.tm-vs-riga { display: grid; grid-template-columns: minmax(0, 1fr) minmax(72px, 120px) minmax(72px, 120px); gap: 8px; align-items: center; min-height: 48px; border-top: 1px solid var(--tm-line-soft); }
.tm-vs-riga.is-testa { min-height: 36px; border-top: 0; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted); }
.tm-vs-riga > span:not(:first-child) { text-align: center; min-width: 0; }
.tm-vs-etichetta { font-size: 14px; color: var(--tm-muted); }
/* elenco compatto etichetta + valore (colonne strette) */
.tm-dati { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tm-dati li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-height: 40px; padding-block: 8px; border-top: 1px solid var(--tm-line-soft); font-size: 14px; }
.tm-dati li:first-child { border-top: 0; }
.tm-dati li span { color: var(--tm-muted); }
.tm-dati li b { font: 700 16px var(--tm-font-title); }
.tm-vs-riga b { display: inline-block; min-width: 3.2ch; padding: 3px 10px; border-radius: var(--radius-xs, 8px); font: 700 17px var(--tm-font-title); }
.tm-vs-riga b.is-meglio { background: var(--tm-mint-soft); color: var(--tm-t-800); }

/* ── Sfide 1 contro 1 ─────────────────────────────────────────────────────
   Riga di una sfida (elenco, home, giornata), "tu contro lui", confronto partita per partita. */
.tm-sfida { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 1.25rem; border-top: 1px solid var(--tm-line-soft); }
.tm-sfida:first-child { border-top: 0; }
.tm-sfida-link { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--tm-ink); text-decoration: none; }
.tm-sfida-link:hover, .tm-sfida-link:focus-visible { color: var(--tm-ink); }
.tm-sfida-link:hover .tm-riga-txt > :first-child { text-decoration: underline; }
.tm-sfida-punti { font: 700 18px var(--tm-font-title); white-space: nowrap; }
.tm-sfida-punti span { margin: 0 3px; color: var(--tm-muted); font-weight: 600; }
.tm-sfida-azioni { display: flex; gap: 8px; margin-left: auto; }
.tm-sfida-azioni form { margin: 0; }

.tm-sfida-vs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.tm-sfida-lato { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; font-size: 15px; font-weight: 600; text-decoration: none; }
.tm-hero a.tm-sfida-lato { color: #fff; }
.tm-hero a.tm-sfida-lato:hover span, .tm-hero a.tm-sfida-lato:focus-visible span { text-decoration: underline; }
.tm-sfida-centro { text-align: center; }
.tm-sfida-contro { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--tm-mint); }
.tm-sfida-vs.is-chiaro .tm-sfida-contro { color: var(--tm-muted); }
.tm-sfida-risultato { font: 700 44px/1 var(--tm-font-title); color: #fff; white-space: nowrap; }
.tm-sfida-risultato small { margin: 0 8px; font-size: 28px; color: var(--tm-on-dark-muted); }
.tm-sfida-avanz { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tm-sfida-avanz > div { display: flex; flex-direction: column; gap: 6px; }

.tm-confronto { display: flex; flex-direction: column; }
.tm-confronto-riga { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px; gap: 10px; align-items: center; min-height: 56px; padding: 6px 1.25rem; border-top: 1px solid var(--tm-line-soft); }
.tm-confronto-riga.is-testa { min-height: 36px; background: var(--tm-head-bg); font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--tm-muted); }
.tm-confronto-riga > span:not(:first-child) { text-align: center; min-width: 0; }
.tm-confronto-partita { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 600; }
.tm-confronto-partita small { font-size: 12px; font-weight: 400; color: var(--tm-muted); }
.tm-confronto-partita small strong { color: var(--tm-ink); }
.tm-confronto-pron { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tm-confronto-pron b { font: 700 15px var(--tm-font-title); }
@media (max-width: 575.98px) {
    .tm-confronto-riga { grid-template-columns: minmax(0, 1fr) 64px 64px; gap: 8px; padding-inline: 14px; }
}

/* bilancio vinte · pari · perse · % in una riga (colonne strette) */
.tm-bilancio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tm-bilancio > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: var(--radius-md, 12px); background: var(--tm-bg); }
.tm-bilancio b { font: 700 20px/1.1 var(--tm-font-title); }
.tm-bilancio span { font-size: 12px; color: var(--tm-muted); }

/* elenco breve di regole */
.tm-regole { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; color: var(--tm-testo-2); }

/* ── Tema scuro ───────────────────────────────────────────────────────────
   Attivo con <html data-theme="dark">, impostato prima del disegno dallo script
   in testa a _Layout (scelta salvata: Automatico / Chiaro / Scuro, vedi site.js).
   Stessa identità: fondo verde-nero, superfici verde scuro, menta come accento.
   Il verde del marchio (--tm-green-900) si schiarisce un poco per staccarsi dal fondo
   e il pulsante principale diventa menta, come già sulle superfici scure. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --tm-bg: #0b1612;
    --tm-surface: #12201a;
    --tm-ink: #e3eee8;
    --tm-muted: #9ab0a5;
    --tm-testo-2: #c4d4cb;
    --tm-placeholder: #6f857b;
    --tm-line: #24382f;
    --tm-line-soft: #1b2c25;
    --tm-card-border: #304b3f;
    --tm-chip: #1c2f27;
    --tm-chip-tenue: #172821;
    --tm-head-bg: #15251f;
    --tm-green-900: #0f3a2c;
    --tm-t-900: #e0f6eb;
    --tm-t-800: #bdebd5;
    --tm-t-700: #5fdca4;
    --tm-t-600: #46e0a0;
    --tm-mint-soft: #133d2e;
    --tm-evidenza: #13281f;
    --tm-ok-soft: #12352a;
    --tm-ok-line: #1f5a43;
    --tm-ok: #4fd69a;
    --tm-alert-soft: #3b1d0f;
    --tm-alert-line: #6a3418;
    --tm-alert-line-forte: #8a4220;
    --tm-alert-ink: #ffb38a;
    --tm-alert-ink-forte: #ffc7a8;
    --tm-alert-txt: #ff8f57;
    --tm-pts0-bg: #26332d;
    --tm-pts0-ink: #b8c6bf;
}

/* superfici del marchio: un filo le stacca dal fondo scuro */
[data-theme="dark"] .tm-hero, [data-theme="dark"] .tm-team-prossima,
[data-theme="dark"] .tm-adm-riepilogo, [data-theme="dark"] .legal-hero { box-shadow: inset 0 0 0 1px var(--tm-ok-line); }
[data-theme="dark"] .tm-side { border-right: 1px solid var(--tm-line); }

/* azione principale: menta, come sulle superfici scure */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-check:checked + .btn,
[data-theme="dark"] .btn-check:checked + .btn-outline-primary { background: var(--tm-mint); border-color: var(--tm-mint); color: var(--tm-green-950); }
[data-theme="dark"] .btn-primary:hover, [data-theme="dark"] .btn-primary:focus, [data-theme="dark"] .btn-primary:active { background: #6ae9b3; border-color: #6ae9b3; color: var(--tm-green-950); }
[data-theme="dark"] .btn-outline-danger { color: #ff8a80; border-color: #6b2a26; background: var(--tm-surface); }
[data-theme="dark"] .btn-warning:hover, [data-theme="dark"] .btn-warning:active { background: #4a2512; }

/* voce attiva dei controlli a segmenti: più chiara del binario */
[data-theme="dark"] .tm-seg > .on,
[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--tm-card-border); color: var(--tm-ink); box-shadow: none; }

/* icone disegnate in SVG scuro (chiudi, freccia accordion e select) */
[data-theme="dark"] .btn-close,
[data-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(1) brightness(1.6); }
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ab0a5' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* stati con colori propri */
[data-theme="dark"] .tm-toast-info { --tt: var(--tm-mint); --tt-soft: var(--tm-mint-soft); }
[data-theme="dark"] .tm-toast-errore { --tt-soft: #3d1614; }
[data-theme="dark"] .alert-danger { background: #3d1614; border-color: #6b2a26; color: #ffb4ae; }
[data-theme="dark"] .badge.bg-info { background: #16323a !important; color: #9fdcea !important; }
[data-theme="dark"] .tm-adm-tag.is-manca { background: var(--tm-alert-soft); color: var(--tm-alert-ink); }
[data-theme="dark"] .tm-adm-tag.is-live { background: #16283d; color: #a9c8ee; }
[data-theme="dark"] .tm-forma.is-n { background: #2c3a34; color: #d5dbd8; }
/* barre degli esiti: sul fondo scuro la scala si rovescia (più punti = più chiaro) */
[data-theme="dark"] :is(.tm-distrib, .tm-distrib-leg, .tm-esiti) .pts-3 { background: var(--tm-mint); }
[data-theme="dark"] :is(.tm-distrib, .tm-distrib-leg, .tm-esiti) .pts-2 { background: var(--tm-green-600); }
[data-theme="dark"] :is(.tm-distrib, .tm-distrib-leg, .tm-esiti) .pts-1 { background: #1f5a43; }
[data-theme="dark"] :is(.tm-distrib, .tm-distrib-leg, .tm-esiti) .pts-0 { background: #3b4a43; }
[data-theme="dark"] .bg-warning { color: #1a2c24 !important; }
/* gli stemmi delle squadre sono pensati per il bianco: un riquadro chiaro li tiene leggibili */
[data-theme="dark"] .tm-team-stemma:not(.is-sigla) { background: #e9efec; border-color: #e9efec; }
