/* =========================================================
   BNI Ruota della Fortuna
   Tema "show": scuro, pensato per proiettore e TV
   ========================================================= */

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --rosso: #CF102D;
    --rosso-chiaro: #F0314B;
    --rosso-scuro: #8F0A1F;
    --oro: #F5C451;
    --oro-scuro: #D39A2A;
    --fondo: #0E0A0C;
    --fondo-2: #171013;
    --superficie: rgba(255, 255, 255, .045);
    --superficie-2: rgba(255, 255, 255, .08);
    --linea: rgba(255, 255, 255, .09);
    --linea-forte: rgba(255, 255, 255, .18);
    --testo: #F7F2F3;
    --testo-2: rgba(247, 242, 243, .68);
    --testo-3: rgba(247, 242, 243, .45);
    --ok: #3DD68C;
    --raggio: 16px;
    --lato: clamp(320px, 29vw, 460px);
    color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { height: 100%; }
body { margin: 0; min-height: 100%; }

body {
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
    color: var(--testo);
    background:
        radial-gradient(1100px 760px at 68% 52%, rgba(207, 16, 45, .30), transparent 66%),
        radial-gradient(800px 520px at 0% 100%, rgba(245, 196, 81, .07), transparent 60%),
        var(--fondo);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.2px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse at 65% 50%, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 65% 50%, #000 0%, transparent 70%);
}

button { font: inherit; color: inherit; }
svg { display: block; }

/* ---------- Pulsanti comuni ---------- */

.btn-gira {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px 30px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--rosso-chiaro), #B30C25);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(207, 16, 45, .42), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, opacity .2s;
}
.btn-gira:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 18px 40px rgba(207, 16, 45, .5), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-gira:active { transform: translateY(0); }
.btn-gira:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.btn-gira kbd {
    font: 600 .68rem/1 "Montserrat", sans-serif;
    letter-spacing: .06em;
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(0, 0, 0, .22);
    color: rgba(255, 255, 255, .85);
}
.btn-piccolo { padding: 16px 26px; font-size: .92rem; }
.in-giro .btn-gira { opacity: .45; pointer-events: none; }

.btn-icona,
.btn-accesso {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid var(--linea-forte);
    background: rgba(20, 13, 16, .55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--testo);
    text-decoration: none;
    font-weight: 700;
    font-size: .88rem;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s;
}
.btn-icona { width: 46px; justify-content: center; padding: 0; }
.btn-accesso { padding: 0 20px 0 16px; }
.btn-icona:hover,
.btn-accesso:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.btn-icona svg,
.btn-accesso svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Struttura schermata ruota ---------- */

.pagina-ruota { overflow: hidden; }

.scena {
    position: relative;
    display: grid;
    grid-template-columns: var(--lato) 1fr;
    height: 100vh;
    height: 100dvh;
}

.barra-alta {
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 30;
    display: flex;
    gap: 10px;
    transition: opacity .4s;
}
.in-giro .barra-alta { opacity: .25; }

.lato {
    position: relative;
    display: flex;
    align-items: center;
    padding: 40px clamp(28px, 3.6vw, 64px);
    border-right: 1px solid var(--linea);
    background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0));
    overflow-y: auto;
}
.lato-interno { width: 100%; container-type: inline-size; }

.sopratitolo {
    display: inline-block;
    margin: 0;
    padding: 7px 12px 6px;
    border-radius: 7px;
    background: var(--rosso);
    color: #fff;
    font-weight: 900;
    font-size: .82rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.titolo {
    margin: 22px 0 14px;
    font-size: clamp(2rem, 17.5cqi, 4.8rem);
    overflow-wrap: anywhere;
    font-weight: 900;
    line-height: .92;
    letter-spacing: -.035em;
    text-transform: uppercase;
    text-wrap: balance;
}
.titolo em {
    display: block;
    font-style: normal;
    background: linear-gradient(180deg, #FF4A62, var(--rosso) 70%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sottotitolo {
    margin: 0;
    color: var(--testo-2);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.numeri {
    display: flex;
    gap: 34px;
    margin: 38px 0 0;
}
.numeri div { display: flex; flex-direction: column-reverse; }
.numeri dt {
    margin-top: 4px;
    color: var(--testo-3);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.numeri dd {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.fuori-concorso {
    margin: 16px 0 0;
    color: var(--testo-3);
    font-size: .78rem;
    line-height: 1.5;
}
.fuori-concorso span { color: var(--testo-2); font-weight: 700; }

.lato .btn-gira { margin-top: 34px; width: 100%; }
@container (max-width: 300px) {
    .lato .btn-gira { padding: 18px 20px; letter-spacing: .05em; }
    .lato .btn-gira kbd { display: none; }
}

/* Nome sulla lancetta (solo quando gli spicchi sono troppi per scriverci i nomi) */
.sulla-lancetta {
    margin-top: 26px;
    padding: 16px 18px;
    border-radius: var(--raggio);
    border: 1px solid rgba(245, 196, 81, .28);
    background: linear-gradient(180deg, rgba(245, 196, 81, .10), rgba(245, 196, 81, .03));
}
.sulla-lancetta span {
    display: block;
    color: var(--oro);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.sulla-lancetta strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.01em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    min-height: 1.15em;
}

.form-lista { margin-top: 14px; }

.btn-lista {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    border: 1px dashed var(--linea-forte);
    border-radius: var(--raggio);
    background: var(--superficie);
    text-align: left;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.btn-lista:hover { background: var(--superficie-2); border-color: rgba(255, 255, 255, .34); }
.btn-lista svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--oro); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-lista span { display: flex; flex-direction: column; gap: 3px; font-weight: 700; font-size: .92rem; }
.btn-lista small { color: var(--testo-3); font-weight: 500; font-size: .76rem; }

.info-lista {
    margin: 10px 2px 0;
    color: var(--testo-3);
    font-size: .74rem;
}

.estratti {
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--linea);
}
.estratti-testa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.btn-azzera {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--linea-forte);
    border-radius: 999px;
    background: transparent;
    color: var(--testo-2);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-azzera svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-azzera:hover { background: var(--superficie-2); color: var(--testo); }
.btn-azzera.conferma { border-color: var(--rosso-chiaro); background: rgba(207, 16, 45, .22); color: #fff; }
.estratti h2 {
    margin: 0;
    color: var(--oro);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.estratti ol { margin: 0; padding: 0; list-style: none; }
.estratti li {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--linea);
    font-size: .9rem;
    font-weight: 700;
}
.estratti li:last-child { border-bottom: 0; }
.estratti li b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--superficie-2);
    color: var(--testo-2);
    font-size: .7rem;
}
.estratti li:first-child b { background: var(--oro); color: #2A1B05; }
.estratti time { color: var(--testo-3); font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Ruota ---------- */

.area-ruota {
    position: relative;
    display: grid;
    place-items: center;
    container-type: size;
    min-height: 0;
}

.ruota {
    --bordo: 6.4%;
    position: relative;
    width: min(88cqw, 88cqh);
    aspect-ratio: 1;
    container-type: inline-size;
}

.ruota-bordo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, .35) 100%),
        linear-gradient(150deg, #FF5068 0%, var(--rosso) 34%, #6E0515 100%);
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, .12),
        0 3cqw 8cqw rgba(0, 0, 0, .6),
        0 0 14cqw rgba(207, 16, 45, .35);
}

.ruota-disco {
    position: absolute;
    inset: var(--bordo);
    border-radius: 50%;
    overflow: hidden;
    background: #1a1013;
    box-shadow: 0 0 0 .55cqw var(--oro), 0 0 0 1.05cqw rgba(60, 10, 18, .9);
}
.ruota-disco canvas {
    display: block;
    width: 100%;
    height: 100%;
    will-change: transform;
}
.ruota-riflesso {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 42%);
    box-shadow: inset 0 0 0 .25cqw rgba(255, 255, 255, .18), inset 0 0 5cqw rgba(0, 0, 0, .38);
}

/* Luci sul bordo */
.ruota-luci { position: absolute; inset: 0; pointer-events: none; }
.luce {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.1cqw;
    height: 2.1cqw;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(-46.8cqw);
    background: radial-gradient(circle at 38% 34%, #fff 0 18%, #FFE9AE 34%, var(--oro) 62%, #A8731A 100%);
    box-shadow: 0 0 1.2cqw .25cqw rgba(255, 214, 120, .85);
    animation: luce-due 1.8s steps(1, end) infinite;
    animation-delay: calc(var(--g2) * -.9s);
}
@keyframes luce-due {
    0% { opacity: 1; box-shadow: 0 0 1.2cqw .25cqw rgba(255, 214, 120, .85); }
    50% { opacity: .38; box-shadow: none; }
}
@keyframes luce-tre {
    0% { opacity: 1; box-shadow: 0 0 1.4cqw .35cqw rgba(255, 214, 120, .95); }
    33.34% { opacity: .3; box-shadow: none; }
}
.ruota-luci.gira .luce {
    animation: luce-tre .33s steps(1, end) infinite;
    animation-delay: calc(var(--g3) * -.11s);
}
.ruota-luci.vince .luce {
    animation: luce-due .5s steps(1, end) infinite;
    animation-delay: 0s;
}

/* Perno centrale con logo */
.ruota-centro {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 19%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 30%, #fff 0%, #F4EFEF 55%, #D9CFD1 100%);
    box-shadow:
        0 0 0 .7cqw var(--rosso),
        0 0 0 1.15cqw var(--oro),
        0 1.6cqw 3.4cqw rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    z-index: 3;
}
.ruota-centro:hover { transform: translate(-50%, -50%) scale(1.045); }
.ruota-centro:focus-visible { outline: .5cqw solid #fff; outline-offset: 1.6cqw; }
.ruota-centro img { width: 74%; height: 74%; object-fit: contain; }
.centro-testo {
    color: var(--rosso);
    font-size: 4.4cqw;
    font-weight: 900;
    letter-spacing: -.02em;
    text-transform: uppercase;
}
.ruota-centro img + .centro-testo { display: none; }
.in-giro .ruota-centro { cursor: default; }
.in-giro .ruota-centro:hover { transform: translate(-50%, -50%); }

/* Lancetta in alto */
.lancetta {
    position: absolute;
    left: 50%;
    top: -2.4cqw;
    width: 7.4cqw;
    transform: translateX(-50%);
    z-index: 4;
    filter: drop-shadow(0 .8cqw 1cqw rgba(0, 0, 0, .5));
}
.lancetta svg { width: 100%; height: auto; overflow: visible; transform-origin: 50% 32%; }

/* ---------- Stato vuoto ---------- */

.vuoto {
    max-width: 520px;
    padding: 40px;
    text-align: center;
}
.vuoto-icona {
    width: 148px;
    height: 148px;
    margin: 0 auto 30px;
    padding: 22px;
    border: 2px dashed var(--linea-forte);
    border-radius: 50%;
}
.vuoto-icona svg { width: 100%; height: 100%; fill: none; stroke: var(--testo-3); stroke-width: 2; }
.vuoto-icona .pieno { fill: var(--rosso); stroke: none; }
.vuoto h2 { margin: 0 0 12px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.vuoto p { margin: 0 0 28px; color: var(--testo-2); line-height: 1.6; }

/* ---------- Trascina e rilascia ---------- */

.rilascia {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(14, 10, 12, .82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.rilascia.attivo { display: grid; }
.rilascia > div {
    display: grid;
    place-items: center;
    gap: 18px;
    width: 100%;
    height: 100%;
    border: 3px dashed var(--oro);
    border-radius: 28px;
    color: var(--testo);
    font-size: 1.5rem;
    font-weight: 800;
    align-content: center;
    pointer-events: none;
}
.rilascia svg { width: 64px; height: 64px; fill: none; stroke: var(--oro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rilascia p { margin: 0; }

.caricamento { cursor: progress; }
.caricamento .btn-lista { opacity: .6; pointer-events: none; }

/* ---------- Vincitore ---------- */

.vincitore {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 5, 6, .74);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    cursor: pointer;
    opacity: 0;
    transition: opacity .35s ease;
}
.vincitore[hidden] { display: none; }
.vincitore.visibile { opacity: 1; }

.vincitore-card {
    position: relative;
    width: min(94vw, 1180px);
    padding: clamp(36px, 5vw, 64px) clamp(24px, 5vw, 80px) clamp(30px, 4vw, 48px);
    border-radius: 32px;
    text-align: center;
    background:
        radial-gradient(900px 300px at 50% 0%, rgba(245, 196, 81, .16), transparent 70%),
        linear-gradient(180deg, #24151A, #140C0F);
    border: 1px solid rgba(245, 196, 81, .32);
    box-shadow: 0 50px 140px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .06);
    transform: scale(.7);
    transition: transform .6s cubic-bezier(.18, 1.35, .4, 1);
}
.vincitore.visibile .vincitore-card { transform: scale(1); }

.coppa {
    width: clamp(64px, 8vw, 104px);
    margin: 0 auto 14px;
    animation: coppa 2.2s ease-in-out infinite;
    filter: drop-shadow(0 0 22px rgba(245, 196, 81, .45));
}
@keyframes coppa {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-6px) rotate(-4deg); }
    75% { transform: translateY(-6px) rotate(4deg); }
}

.vincitore-etichetta {
    margin: 0 0 10px;
    color: var(--oro);
    font-size: clamp(.8rem, 1.3vw, 1.1rem);
    font-weight: 800;
    letter-spacing: .34em;
    text-transform: uppercase;
}
.vincitore-nome {
    margin: 0;
    font-size: clamp(2.6rem, 7.6vw, 8.4rem);
    font-weight: 900;
    line-height: .95;
    letter-spacing: -.035em;
    text-transform: uppercase;
    text-wrap: balance;
    overflow-wrap: anywhere;
    color: #fff;
    text-shadow: 0 0 60px rgba(207, 16, 45, .75), 0 4px 0 rgba(0, 0, 0, .25);
}
.vincitore-chiudi {
    margin: clamp(22px, 3vw, 36px) 0 0;
    color: var(--testo-3);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
}

/* ---------- Avvisi ---------- */

.avvisi {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 70;
    display: grid;
    gap: 10px;
    width: min(92vw, 640px);
    transform: translateX(-50%);
}
.avviso {
    padding: 14px 18px 14px 44px;
    border-radius: 14px;
    border: 1px solid var(--linea-forte);
    background: rgba(24, 16, 19, .94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.45;
    position: relative;
    animation: entra .45s cubic-bezier(.2, 1.2, .4, 1);
    transition: opacity .5s, transform .5s;
}
.avviso::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 19px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 12px var(--ok);
}
.avviso-errore { border-color: rgba(240, 49, 75, .5); }
.avviso-errore::before { background: var(--rosso-chiaro); box-shadow: 0 0 12px var(--rosso-chiaro); }
.avviso.via { opacity: 0; transform: translateY(-10px); }
@keyframes entra { from { opacity: 0; transform: translateY(-14px); } }

/* ---------- Schermi piccoli ---------- */

@media (max-width: 900px) {
    .pagina-ruota { overflow: auto; }
    .scena { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
    .lato { border-right: 0; border-bottom: 1px solid var(--linea); padding: 84px 20px 28px; background: none; }
    .titolo { font-size: clamp(2.2rem, 10vw, 3.4rem); }
    .numeri { margin-top: 24px; }
    .lato .btn-gira { margin-top: 24px; }
    .area-ruota { height: min(100vw, 82dvh); order: -1; margin-top: 76px; }
    .lato { order: 1; padding-top: 28px; }
    .ruota { width: min(92cqw, 92cqh); }
    .barra-alta { top: 16px; right: 16px; }
    .btn-gira kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .luce { animation-duration: 4s !important; }
    .coppa { animation: none; }
}

/* =========================================================
   Login e pannello
   ========================================================= */

.pagina-pannello { min-height: 100%; }
.pagina-pannello::before { display: none; }
.pagina-pannello .avvisi { top: 92px; }
.pagina-ruota .avvisi { top: auto; bottom: 24px; left: 24px; transform: none; width: min(calc(100vw - 48px), 520px); }
.pagina-ruota .avviso.via { transform: translateY(10px); }
.scheda { scroll-margin-top: 96px; }

.contenitore {
    width: min(100% - 32px, 980px);
    margin: 0 auto;
}

.testata {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--linea);
    background: rgba(14, 10, 12, .82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.testata .contenitore {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}
.marchio {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--testo);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.01em;
}
.marchio .sopratitolo { font-size: .68rem; padding: 5px 9px 4px; }
.testata-azioni { display: flex; gap: 10px; align-items: center; }
.testata-azioni form { margin: 0; }

.pannello-intro { padding: 44px 0 10px; }
.pannello-intro h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 900; letter-spacing: -.03em; }
.pannello-intro p { margin: 0; color: var(--testo-2); line-height: 1.6; }

.scheda {
    margin: 22px 0;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid var(--linea);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .02));
}
.scheda h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
}
.scheda h2 span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(207, 16, 45, .18);
    color: var(--rosso-chiaro);
    font-size: .8rem;
    font-weight: 900;
}
.scheda > p.nota { margin: 0 0 22px; color: var(--testo-2); font-size: .9rem; line-height: 1.6; }

.griglia { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.campo { display: flex; flex-direction: column; gap: 8px; }
.campo label,
.campo .etichetta { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--testo-2); }
.campo small { color: var(--testo-3); font-size: .78rem; line-height: 1.5; }

input[type="text"],
input[type="password"],
input[type="number"] {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--linea-forte);
    border-radius: 12px;
    background: rgba(0, 0, 0, .28);
    color: var(--testo);
    font: 600 .98rem "Montserrat", sans-serif;
    transition: border-color .2s, box-shadow .2s;
}
input:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(245, 196, 81, .2); }

.interruttore {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--linea);
    border-radius: 14px;
    background: rgba(0, 0, 0, .18);
    cursor: pointer;
}
.interruttore input { appearance: none; flex: none; position: relative; width: 44px; height: 26px; margin: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); cursor: pointer; transition: background .2s; }
.interruttore input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.interruttore input:checked { background: var(--rosso); }
.interruttore input:checked::after { transform: translateX(18px); }
.interruttore input:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; }
.interruttore b { display: block; font-size: .92rem; }
.interruttore small { display: block; margin-top: 3px; color: var(--testo-3); font-size: .8rem; line-height: 1.45; }

.azioni-scheda { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: var(--rosso);
    color: #fff;
    font-weight: 800;
    font-size: .88rem;
    letter-spacing: .04em;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s, transform .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn-secondario { background: var(--superficie-2); border: 1px solid var(--linea-forte); color: var(--testo); }
.btn-pericolo { background: transparent; border: 1px solid rgba(240, 49, 75, .45); color: #FF8394; }

/* Tabella partecipanti */
.tabella-wrap { overflow-x: auto; border: 1px solid var(--linea); border-radius: 16px; }
.tabella { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabella th, .tabella td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--linea); white-space: nowrap; }
.tabella th { color: var(--testo-3); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: rgba(0, 0, 0, .2); }
.tabella tr:last-child td { border-bottom: 0; }
.tabella td.num { font-variant-numeric: tabular-nums; text-align: right; }
.tabella th.num { text-align: right; }
.tabella .barra { display: inline-block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--rosso), var(--oro)); vertical-align: middle; margin-right: 10px; }
.tabella tr.stato-visiva td { color: var(--testo-3); }
.tabella tr.stato-visiva td:first-child { text-decoration: line-through; }
.tabella tr.stato-light td:first-child { color: var(--oro); }
.scelta-stato {
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--linea-forte);
    border-radius: 10px;
    background: rgba(0, 0, 0, .28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
    color: var(--testo);
    font: 600 .84rem "Montserrat", sans-serif;
    appearance: none;
    cursor: pointer;
}
.scelta-stato:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(245, 196, 81, .2); }
.scelta-stato option { background: #1a1013; color: var(--testo); }
.tabella tr.stato-light .scelta-stato { border-color: rgba(245, 196, 81, .55); }
.tabella tr.stato-visiva .scelta-stato { border-color: rgba(240, 49, 75, .55); }
.tabella input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--rosso); cursor: pointer; }

.info-riga { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 18px; color: var(--testo-2); font-size: .86rem; }
.info-riga b { color: var(--testo); }

.logo-anteprima {
    display: grid;
    place-items: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 30%, #fff, #E9E2E3);
    box-shadow: 0 0 0 5px var(--rosso), 0 0 0 8px var(--oro);
    margin: 6px 0 12px 8px;
}
.logo-anteprima img { width: 74%; height: 74%; object-fit: contain; }
.logo-anteprima span { color: var(--rosso); font-weight: 900; font-size: 1.4rem; text-transform: uppercase; }

input[type="file"] { color: var(--testo-2); font: 500 .86rem "Montserrat", sans-serif; }
input[type="file"]::file-selector-button {
    margin-right: 14px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--linea-forte);
    border-radius: 10px;
    background: var(--superficie-2);
    color: var(--testo);
    font: 700 .82rem "Montserrat", sans-serif;
    cursor: pointer;
}

.piede { padding: 30px 0 60px; color: var(--testo-3); font-size: .78rem; text-align: center; }

/* Login */
.pagina-login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
}
.login-card {
    position: relative;
    width: min(100%, 440px);
    padding: 40px clamp(24px, 5vw, 44px) 34px;
    border: 1px solid var(--linea);
    border-radius: 26px;
    background: linear-gradient(180deg, #1D1216, #130C0F);
    box-shadow: 0 40px 120px rgba(0, 0, 0, .55);
}
.login-card h1 { margin: 18px 0 6px; font-size: 1.8rem; font-weight: 900; letter-spacing: -.03em; }
.login-card > p { margin: 0 0 26px; color: var(--testo-2); font-size: .92rem; line-height: 1.55; }
.login-card form { display: grid; gap: 16px; }
.login-card .btn { height: 52px; margin-top: 8px; font-size: .95rem; }
.login-card .indietro { display: inline-block; margin-top: 22px; color: var(--testo-3); font-size: .84rem; text-decoration: none; }
.login-card .indietro:hover { color: var(--testo); }
.login-card .avviso { margin-bottom: 18px; animation: none; }

/* Controllo sicurezza nel pannello */
.controlli { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.controlli li {
    display: grid;
    grid-template-columns: 26px 1fr;
    column-gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--linea);
    border-radius: 12px;
    background: rgba(0, 0, 0, .18);
    font-size: .88rem;
    line-height: 1.45;
}
.controlli li::before {
    content: "";
    grid-row: span 2;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--ok) center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23062' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
.controlli li.ko { border-color: rgba(240, 49, 75, .45); }
.controlli li.ko::before {
    background: var(--rosso-chiaro) center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round'%3E%3Cpath d='M12 5v9M12 19v.5'/%3E%3C/svg%3E");
}
.controlli b { font-weight: 700; }
.controlli span { color: var(--testo-2); }

/* Più capitoli: gestione, menu dei capitoli, moduli in riga */
.link-ruota { margin-top: 10px !important; font-size: .9rem; }
.link-ruota a { color: var(--oro); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.link-ruota a:hover { text-decoration: underline; }
.btn-mini { height: 36px; padding: 0 14px; font-size: .78rem; border-radius: 10px; }
.riga-modulo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.riga-modulo input[type="text"] { height: 38px; width: auto; min-width: 180px; flex: 1; font-size: .9rem; }
.riga-modulo.principale { margin-top: 20px; gap: 12px; }
.riga-modulo.principale label { color: var(--testo-2); font-size: .88rem; }
.etichetta-mini { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 6px; background: rgba(245, 196, 81, .16); color: var(--oro); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tabella td { vertical-align: middle; }
.tabella td small { color: var(--testo-3); }
.tabella-capitoli td { white-space: normal; }
.tabella a { color: var(--oro); text-decoration: none; font-weight: 700; }
.azioni-riga { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.azioni-riga form { margin: 0; }
details.archivia { position: relative; }
details.archivia summary { list-style: none; cursor: pointer; }
details.archivia summary::-webkit-details-marker { display: none; }
details.archivia[open] form {
    position: absolute; right: 0; top: 44px; z-index: 5;
    display: grid; gap: 10px; width: 260px; padding: 14px;
    border: 1px solid rgba(240, 49, 75, .45); border-radius: 12px; background: #1a1013;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5); white-space: normal;
}
details.archivia label { display: grid; gap: 6px; font-size: .8rem; color: var(--testo-2); }
details.archivia input[type="text"] { height: 38px; }
.spunte { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.spunte label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; white-space: nowrap; cursor: pointer; }
.spunte input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--rosso); }
.sottotitolo-scheda { margin: 28px 0 14px; font-size: 1rem; font-weight: 800; }
.menu-capitoli { position: relative; }
.menu-capitoli summary { list-style: none; }
.menu-capitoli summary::-webkit-details-marker { display: none; }
.menu-capitoli-elenco {
    position: absolute; right: 0; top: 54px; z-index: 30; display: grid; min-width: 220px; padding: 8px;
    border: 1px solid var(--linea-forte); border-radius: 14px; background: #1a1013; box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.menu-capitoli-elenco a { padding: 10px 12px; border-radius: 8px; color: var(--testo); text-decoration: none; font-weight: 600; font-size: .9rem; }
.menu-capitoli-elenco a:hover, .menu-capitoli-elenco a.attivo { background: var(--superficie-2); }
.sopratitolo { max-width: 100%; }
.campo .spunte label { text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 600; color: var(--testo); }

/* Verifica in due passaggi */
.qr-blocco { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin: 0 0 22px; }
.qr-code { width: 220px; height: 220px; padding: 10px; border-radius: 16px; background: #fff; display: grid; place-items: center; color: #333; font-size: .8rem; text-align: center; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.qr-manuale { margin: 0; color: var(--testo-2); font-size: .86rem; line-height: 1.6; max-width: 360px; }
.qr-manuale code { display: inline-block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); color: var(--oro); font-size: .95rem; letter-spacing: .06em; }
.campo-codice { font-size: 1.4rem !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.codici-recupero { margin: 0 0 22px; padding: 18px 20px; border: 1px solid rgba(245, 196, 81, .45); border-radius: 14px; background: rgba(245, 196, 81, .08); }
.codici-recupero p { margin: 0 0 12px; font-size: .9rem; line-height: 1.5; color: var(--testo-2); }
.codici-recupero ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codici-recupero code { display: block; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .3); color: #fff; font-size: 1rem; letter-spacing: .08em; text-align: center; }
.annulla-accesso { margin-top: 18px; }
.annulla-accesso .indietro { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

.annulla-attivazione { margin: 0 0 14px; }
details.archivia input[type="password"] { height: 38px; }
