[hidden] { display: none !important; }

/* Contenitori delle due modalità + selettore */
.vista { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.vista[hidden] { display: none; }
.seg-modalita { flex: 1; max-width: 300px; }
.seg-modalita button { height: 36px; font-size: 14px; }
.top { gap: 12px; }

:root { --verde: #16a34a; --verde-tenue: #eaf7ee; --rosso: #dc2626; --rosso-tenue: #fdeeee; }

/* ---------- Intro ---------- */
.sf-intro { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 18px; min-height: 0; overflow-y: auto; }
.sf-intro[hidden] { display: none; }
.sf-intro-testa { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sf-mic-grande { width: 72px; height: 72px; border-radius: 50%; background: var(--accento-tenue); color: var(--accento); display: grid; place-items: center; }
.sf-intro-testa h2 { font-size: 28px; letter-spacing: -.02em; }
.sf-intro-testa p { color: var(--testo-2); font-size: 16px; line-height: 1.45; max-width: 330px; }
.sf-riepilogo-imp { list-style: none; background: var(--superficie); border-radius: var(--raggio); padding: 4px 16px; }
.sf-riepilogo-imp li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--bordo); }
.sf-riepilogo-imp li:last-child { border: 0; }
.sf-riepilogo-imp span { color: var(--testo-2); flex: none; }
.sf-riepilogo-imp b { font-weight: 600; text-align: right; }
.sf-intro-azioni { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sf-avviso { background: #fff7e6; color: #8a5a00; border-radius: 16px; padding: 14px 16px; font-size: 15px; line-height: 1.45; }
.sf-avviso[hidden] { display: none; }
.sf-avviso b { display: block; margin-bottom: 4px; color: #6b4500; }
.sf-avviso-azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sf-avviso-azioni .btn { height: 48px; font-size: 16px; text-decoration: none; }

/* ---------- Gioco ---------- */
.sf-gioco { flex: 1; display: flex; flex-direction: column; min-height: 0; gap: 10px; padding-top: 6px; }
.sf-gioco[hidden] { display: none; }
.sf-barra { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 52px; }
.sf-link { color: var(--testo-2); font-size: 16px; font-weight: 600; justify-self: start; height: 44px; padding: 0 4px; }
.sf-punti { background: var(--accento-tenue); color: var(--accento); font-weight: 700; font-size: 15px; padding: 8px 14px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.sf-punti span { font-size: 17px; }
.sf-timer { justify-self: end; position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.sf-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.sf-timer circle { fill: none; stroke-width: 5; }
.sf-t-bg { stroke: var(--superficie); }
.sf-t-fg { stroke: var(--accento); stroke-linecap: round; stroke-dasharray: 163.36; }
.sf-timer span { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.sf-timer.urgente .sf-t-fg { stroke: var(--rosso); }
.sf-timer.urgente span { color: var(--rosso); animation: lampo 1s steps(1) infinite; }

.sf-lettera-riga { display: flex; flex-direction: column; align-items: center; }
.sf-lettera { font-size: min(110px, 14dvh); font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.sf-lettera.anim { animation: entra .42s cubic-bezier(.2, .9, .3, 1.25); }
.sf-progresso { font-size: 13px; color: var(--testo-2); margin-top: 4px; }

.sf-caselle { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sf-casella {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 12px 0 16px; border-radius: 16px;
  background: var(--superficie); border: 2px solid transparent;
  transition: background .2s, border-color .2s;
}
.sf-cat { flex: none; width: 112px; font-size: 13px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; letter-spacing: .03em; }
.sf-parola { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-casella.attiva { background: #fff; border-color: var(--accento); box-shadow: 0 4px 16px color-mix(in srgb, var(--accento) 14%, transparent); }
.sf-casella.attiva .sf-cat { color: var(--accento); }
.sf-casella.attiva .sf-parola { color: var(--testo-2); font-weight: 500; font-size: 16px; }
.sf-casella.giusta { background: var(--verde-tenue); }
.sf-casella.giusta .sf-cat { color: var(--verde); }
.sf-casella.giusta .sf-parola { color: #0f5f2c; }
.sf-casella.vuota .sf-parola { color: var(--spento); }
.sf-spunta { color: var(--verde); font-weight: 700; font-size: 18px; }
.sf-correggi { flex: none; font-size: 13px; font-weight: 600; color: var(--accento); height: 34px; padding: 0 10px; border-radius: 10px; background: var(--accento-tenue); }

.sf-stato { min-height: 44px; display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px;
  font-size: 15px; color: var(--testo-2); border-radius: 14px; padding: 6px 12px; transition: background .2s, color .2s; }
.sf-stato.ko { background: var(--rosso-tenue); color: var(--rosso); font-weight: 600; }
.sf-stato.ok { background: var(--verde-tenue); color: var(--verde); font-weight: 600; }
.sf-puntino { width: 10px; height: 10px; border-radius: 50%; background: var(--rosso); flex: none; animation: pulsa 1.2s ease-in-out infinite; }
@keyframes pulsa { 50% { transform: scale(.6); opacity: .5; } }

.sf-azioni { margin-top: auto; display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.sf-pausa { height: 64px; border-radius: 18px; }

/* ---------- Riepilogo / fine ---------- */
.sf-card { gap: 12px; padding-top: 26px; }
.sf-r-lettera { font-size: 64px; font-weight: 700; line-height: 1; color: var(--accento); }
.sf-r-griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sf-r-griglia div { background: var(--superficie); border-radius: 14px; padding: 10px 4px; display: flex; flex-direction: column; gap: 2px; }
.sf-r-griglia b { font-size: 22px; }
.sf-r-griglia span { font-size: 12px; color: var(--testo-2); }
.sf-r-punti b { font-size: 30px; color: var(--accento); }
.sf-r-punti span { display: block; font-size: 13px; color: var(--testo-2); }
.sf-r-countdown { color: var(--testo-2); font-size: 15px; margin: 0 !important; min-height: 20px; }
.sf-totale { font-size: 64px; font-weight: 700; color: var(--accento); line-height: 1.1; }

/* ---------- Correggi + impostazioni ---------- */
.sf-corr-sentite { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-corr-sentite[hidden] { display: none; }
.sf-chip-sentita { height: 44px; padding: 0 14px; background: var(--accento-tenue); color: var(--accento); flex: none; }
.sf-corr-form { display: flex; flex-direction: column; gap: 10px; }
.sf-input {
  height: 54px; border-radius: 14px; border: 2px solid var(--bordo); padding: 0 16px; font: inherit; font-size: 18px;
  -webkit-user-select: text; user-select: text; outline: none; background: #fff; color: var(--testo);
}
.sf-input:focus { border-color: var(--accento); }
.sf-errore { color: var(--rosso); }
.sf-categorie { display: flex; flex-direction: column; background: var(--superficie); border-radius: 16px; padding: 2px 14px; }
.sf-cat-riga { display: flex; padding: 6px 0; border-bottom: 1px solid var(--bordo); }
.sf-cat-riga:last-child { border: 0; }
.sf-cat-riga .etichetta { font-weight: 500; }
.sf-mie { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.sf-mie li { display: flex; align-items: center; gap: 8px; background: var(--superficie); border-radius: 12px; padding: 6px 6px 6px 12px; }
.sf-mie li span { flex: 1; font-weight: 600; }
.sf-mie li small { color: var(--testo-2); }
.sf-mie li button { width: 36px; height: 36px; border-radius: 10px; color: var(--testo-2); }

@media (max-height: 700px) {
  .sf-casella { min-height: 46px; }
  .sf-lettera { font-size: 11dvh; }
  .sf-gioco { gap: 7px; }
  .sf-caselle { gap: 6px; }
  .sf-stato { min-height: 36px; }
  .sf-pausa { height: 58px; }
}
