/* Flickbuster - stile del sito: "Cinema Belle Époque" (brand/stitch/DESIGN.md).
   Regole: tutto il testo piccolo è avorio (mai oro); l'oro è per titoli, punteggi e pulsanti;
   il rosso solo per il timer urgente e gli errori. Font serviti dal sito stesso (licenza OFL). */

@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/Playfair-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --nero: #111014;
  --s1: #18171C;
  --s2: #211F26;
  --s3: #2B292E;
  --bianco: #F4F1EA;
  --oro: #F2B632;
  --oro-chiaro: #FFE9A8;
  --oro-scuro: #B57F1E;
  --rosso: #D64545;
  --testo-soft: rgba(244, 241, 234, 0.8);
  --titoli: "Playfair Display", Georgia, "Times New Roman", serif;
  --testi: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rivetto: radial-gradient(circle, var(--oro-scuro) 0 2px, transparent 2.6px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--nero);
  color: var(--bianco);
  font-family: var(--testi);
  font-size: 1rem;
  line-height: 1.5;
}

.app {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 16px;
}

[hidden] { display: none !important; }

h1, h2, h3, .biglietto .nome, .biglietto .num b, .timer-num, .punteggio, .frase, .account-titolo {
  font-variant-numeric: lining-nums; /* numeri alti, non "da libro antico" */
}

h1, h2, h3 {
  font-family: var(--titoli);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 0.4em;
}

a { color: var(--bianco); text-decoration-color: var(--oro); text-underline-offset: 3px; }
a:hover { color: var(--oro-chiaro); }

:focus-visible {
  outline: 3px solid var(--oro-chiaro);
  outline-offset: 3px;
  border-radius: 4px;
}
h1:focus, h2:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Logo ---- */
.logo { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto 4px; }

.testata { display: flex; justify-content: center; padding: 12px 0 4px; }
.testata a { display: block; border-radius: 4px; }
.marchio-c { display: block; width: 44px; height: auto; }

/* ---- Decorazioni ---- */
/* barra a pellicola 35 mm, con le perforazioni sopra e sotto */
.pellicola {
  height: 20px;
  margin: 24px 0;
  background-color: var(--s1);
  background-image:
    repeating-linear-gradient(90deg, var(--oro-scuro) 0 7px, transparent 7px 15px),
    repeating-linear-gradient(90deg, var(--oro-scuro) 0 7px, transparent 7px 15px);
  background-size: 100% 4px, 100% 4px;
  background-position: 0 3px, 0 calc(100% - 3px);
  background-repeat: no-repeat;
  border-top: 1px solid var(--oro-scuro);
  border-bottom: 1px solid var(--oro-scuro);
}

/* cornice con i rivetti agli angoli e un rombo al centro sopra e sotto */
.cornice {
  position: relative;
  padding: 28px 18px 24px;
  background-color: var(--s1);
  background-image: var(--rivetto), var(--rivetto), var(--rivetto), var(--rivetto);
  background-size: 12px 12px;
  background-position: 6px 6px, calc(100% - 6px) 6px, 6px calc(100% - 6px), calc(100% - 6px) calc(100% - 6px);
  background-repeat: no-repeat;
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
  text-align: center;
}
.cornice::before, .cornice::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 11px; height: 11px;
  background: var(--oro);
  transform: translateX(-50%) rotate(45deg);
}
.cornice::before { top: -6px; }
.cornice::after { bottom: -6px; }

/* ---- Pulsanti ---- */
.btn {
  position: relative;
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--testi);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* "biglietto d'oro": angoli smussati in alto a destra e in basso a sinistra */
.btn-oro {
  background: var(--oro);
  color: var(--nero);
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px var(--oro-chiaro);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.btn-oro:hover:not(:disabled) { background: var(--oro-chiaro); color: var(--nero); }
.btn-oro:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px var(--nero), inset 0 0 0 5px var(--oro-chiaro);
}

/* "celluloide": superficie scura, bordo di ottone, rivetti agli angoli */
.btn-bordo, .btn-chiaro {
  color: var(--bianco);
  background-color: var(--s1);
  background-image:
    radial-gradient(circle at 8px 8px, var(--oro-scuro) 0 2px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 8px) 8px, var(--oro-scuro) 0 2px, transparent 2.6px),
    radial-gradient(circle at 8px calc(100% - 8px), var(--oro-scuro) 0 2px, transparent 2.6px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), var(--oro-scuro) 0 2px, transparent 2.6px);
  border-color: var(--oro-scuro);
}
.btn-bordo:hover:not(:disabled), .btn-chiaro:hover:not(:disabled) { border-color: var(--oro); color: var(--bianco); }

.btn-link {
  display: inline-block;
  padding: 10px 6px;
  background: none;
  border: 0;
  color: var(--bianco);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--oro);
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--oro-chiaro); }

/* ---- Testi ---- */
.titolo-grande {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--oro);
  margin-bottom: 0.15em;
}
.sottotitolo { font-size: 1.05rem; margin: 0 0 22px; }
.nota { font-size: 0.9rem; color: var(--testo-soft); margin: 14px 0 0; }

/* targhetta a biglietto: contatori e avvisi */
.chip, .contatore {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  background: var(--s2);
  border: 1px dashed var(--oro-scuro);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.3;
}

.avviso-sfida {
  margin: 8px 0 18px;
  padding: 14px 16px;
  background: var(--s2);
  border: 1px dashed var(--oro-scuro);
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

/* ---- Elenco delle sfide: ogni sfida è un biglietto con il tagliando a sinistra ---- */
.elenco-sfide { display: grid; gap: 12px; margin: 0; text-align: left; }

.biglietto {
  position: relative;
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 0;
  background: var(--s2);
  color: var(--bianco);
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
/* le due mezzelune della perforazione, sopra e sotto il tagliando */
.biglietto::before, .biglietto::after {
  content: "";
  position: absolute;
  left: 62px;
  width: 12px; height: 12px;
  background: var(--s1);
  border: 1px solid var(--oro-scuro);
  border-radius: 50%;
}
.biglietto::before { top: -7px; clip-path: inset(50% 0 0 0); }
.biglietto::after { bottom: -7px; clip-path: inset(0 0 50% 0); }

.biglietto:hover:not(:disabled) { border-color: var(--oro); box-shadow: 0 0 12px rgba(242, 182, 50, 0.2); }
.biglietto:disabled { cursor: not-allowed; background: var(--s1); }

.biglietto .num {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px dashed var(--oro-scuro);
}
.biglietto .num b {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  font-family: var(--titoli);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--oro);
  isolation: isolate;
}
.biglietto .num b::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 27px; height: 27px;
  background: var(--s1);
  border: 1px solid var(--oro-scuro);
  transform: rotate(45deg);
}
.biglietto .info { display: grid; gap: 2px; padding: 12px 12px 12px 18px; }
.biglietto .nome { font-family: var(--titoli); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.02em; }
.biglietto .dettaglio { font-size: 0.85rem; }
.biglietto .stato-sfida {
  margin-right: 14px;
  padding: 7px 14px;
  background: var(--oro);
  color: var(--nero);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.biglietto:disabled .num b { color: var(--bianco); }
.biglietto:disabled .stato-sfida {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--bianco);
  border: 1px dashed var(--oro-scuro);
}
.biglietto:disabled .nome, .biglietto:disabled .dettaglio { opacity: 0.75; }
.icona-lucchetto { width: 14px; height: 14px; flex: none; }

/* ---- Social: tasti rotondi col nome scritto ---- */
.social { margin: 26px 0 8px; text-align: center; }
.social-titolo {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.social-tasti { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social-tasti a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--s1);
  border: 1px solid var(--oro-scuro);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.social-tasti a:hover { border-color: var(--oro); }

/* ---- Domanda ---- */
.barra-alta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }

/* cronometro: anello d'ottone, tacche e lancetta che gira */
.timer { position: relative; width: 64px; height: 64px; flex: none; border-radius: 50%; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; }
.timer-anello { stroke: var(--oro-scuro); stroke-width: 0.8; }
.timer-tacche { stroke: var(--oro-scuro); stroke-width: 2; stroke-dasharray: 0.7 6.8; }
.timer-fondo { stroke: var(--s3); stroke-width: 3.5; }
.timer-arco { stroke: var(--oro); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 119.38; } /* 2 x pi x 19 */
.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--titoli);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--bianco);
}
.timer.urgente { animation: pulsa 1s ease-in-out infinite; box-shadow: 0 0 20px rgba(214, 69, 69, 0.3); }
.timer.urgente .timer-arco, .timer.urgente .timer-anello, .timer.urgente .timer-tacche { stroke: var(--rosso); }
@keyframes pulsa { 50% { transform: scale(1.07); } }

/* barra di avanzamento a pellicola */
.progresso {
  position: relative;
  height: 22px;
  margin: 14px 0 22px;
  background-color: var(--s1);
  background-image:
    repeating-linear-gradient(90deg, var(--s3) 0 6px, transparent 6px 14px),
    repeating-linear-gradient(90deg, var(--s3) 0 6px, transparent 6px 14px);
  background-size: 100% 4px, 100% 4px;
  background-position: 0 3px, 0 calc(100% - 3px);
  background-repeat: no-repeat;
  border: 1px solid var(--oro-scuro);
}
.progresso div {
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 0;
  background: var(--oro);
  transition: width 0.3s ease;
}

.domanda {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 20px;
  text-wrap: balance;
}

.opzioni { display: grid; gap: 10px; }

.opzione {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px 8px 10px;
  background: var(--s1);
  color: var(--bianco);
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}
.opzione:hover:not(:disabled) { border-color: var(--oro); background: var(--s2); box-shadow: 0 0 12px rgba(242, 182, 50, 0.2); }
.opzione:active:not(:disabled) { background: var(--s2); border-color: var(--oro); }
.opzione:disabled { cursor: default; }

/* la lettera sta dentro un rombo */
.opzione .lettera {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  font-family: var(--titoli);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--oro-chiaro);
  isolation: isolate;
}
.opzione .lettera::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 28px; height: 28px;
  background: var(--s2);
  border: 1px solid var(--oro-scuro);
  transform: rotate(45deg);
}
.opzione .testo { flex: 1; }
.opzione .segno { flex: none; display: flex; }
.opzione .segno svg { width: 22px; height: 22px; }

.opzione.giusta {
  border-color: var(--oro);
  background: linear-gradient(135deg, var(--s1) 0%, #292419 100%);
  box-shadow: inset 0 0 0 3px var(--s1), inset 0 0 0 4px var(--oro), 0 0 12px rgba(242, 182, 50, 0.2);
}
.opzione.giusta .segno { color: var(--oro); }
.opzione.sbagliata {
  border-color: var(--rosso);
  background: linear-gradient(135deg, var(--s1) 0%, #261616 100%);
}
.opzione.sbagliata .segno { color: var(--rosso); }
.opzione.spenta { opacity: 0.5; }
/* risposta scelta: si accende, ma non si dice se è giusta (lo si scopre nel risultato) */
.opzione.scelta {
  border-color: var(--oro);
  background: linear-gradient(135deg, var(--s1) 0%, #292419 100%);
  box-shadow: inset 0 0 0 3px var(--s1), inset 0 0 0 4px var(--oro);
}
.opzione.scelta .segno { color: var(--oro); }
.opzione .segno svg { width: 22px; height: 22px; }

/* ---- Annunci: spazio con cornice e scritta "Pubblicità" ---- */
.annuncio { margin: 24px 0; text-align: center; }
.annuncio-etichetta { margin: 0 0 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--testo-soft); }
.annuncio-quadro {
  min-height: 250px; /* posto riservato: la pagina non salta quando arriva l'annuncio */
  padding: 8px;
  overflow: hidden;
  background-color: var(--s1);
  background-image: var(--rivetto), var(--rivetto), var(--rivetto), var(--rivetto);
  background-size: 12px 12px;
  background-position: 6px 6px, calc(100% - 6px) 6px, 6px calc(100% - 6px), calc(100% - 6px) calc(100% - 6px);
  background-repeat: no-repeat;
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
}

/* ---- Momento "pubblicità" prima del risultato: cornice d'oro e bobina che gira ---- */
.pubblicita-fine { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--nero); }
.cornice-pubb { width: 100%; max-width: 420px; }
.bobina { width: 96px; height: 96px; margin: 14px auto 18px; color: var(--oro); animation: gira 3s linear infinite; }
.bobina svg { display: block; width: 100%; height: 100%; }
@keyframes gira { to { transform: rotate(360deg); } }
.pubb-testo { margin: 0; font-family: var(--titoli); font-size: 1.3rem; font-weight: 600; line-height: 1.35; text-wrap: balance; }

/* ---- Domande da rivedere (nel risultato) ---- */
.revisione { margin: 4px 0 22px; text-align: left; }
.revisione h2 { margin: 0 0 12px; font-size: 1.25rem; text-align: center; }
.rev-lista { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rev-lista li { margin: 0; padding: 12px 14px; background: var(--s1); border: 1px dashed var(--oro-scuro); border-radius: 4px; }
.rev-lista p { margin: 0; }
.rev-num { margin-bottom: 4px !important; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.rev-domanda { margin-bottom: 8px !important; font-weight: 600; }
.rev-giusta { padding-left: 10px; border-left: 3px solid var(--oro); font-weight: 600; }
.rev-tua { margin-top: 4px !important; font-size: 0.9rem; color: var(--testo-soft); }

.esito { min-height: 1.6em; margin: 16px 0 8px; font-weight: 600; text-align: center; }
.esito.ok::before, .esito.no::before {
  content: "";
  display: inline-block;
  width: 0.5em; height: 0.5em;
  margin-right: 0.7em;
  vertical-align: 0.1em;
  transform: rotate(45deg);
}
.esito.ok::before { background: var(--oro); }
.esito.no::before { background: var(--rosso); }

#btn-avanti { margin-top: 10px; }

/* ---- Risultato ---- */
.risultato { text-align: center; }
.punteggio {
  font-family: var(--titoli);
  font-size: 5.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--oro);
  margin: 12px 0 0;
}
.tempo { font-size: 1.2rem; font-weight: 600; margin: 6px 0 0; }
.punti { font-size: 1rem; color: var(--testo-soft); margin: 2px 0 0; }
.frase {
  font-family: var(--titoli);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 18px 0 0;
  text-wrap: balance;
}
.confronto {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--s2);
  border: 1px dashed var(--oro-scuro);
  border-radius: 4px;
  font-weight: 600;
}

/* una casella per domanda: oro = giusta, grigio scuro = sbagliata o scaduta */
.quadratini {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}
.quadratini li {
  width: 29px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
}
.quadratini li svg { width: 16px; height: 16px; }
.quadratini .giusta { background: var(--oro); color: var(--nero); border: 1px solid var(--oro-chiaro); }
.quadratini .sbagliata { background: var(--s3); color: var(--bianco); border: 1px solid var(--oro-scuro); }

.azioni { display: grid; gap: 12px; margin-top: 8px; }
.stato { min-height: 1.5em; margin: 10px 0 0; font-size: 0.95rem; font-weight: 600; }

/* ---- Accesso e soprannome ---- */
.box-account {
  margin: 20px 0;
  padding: 18px 16px;
  background-color: var(--s1);
  background-image: var(--rivetto), var(--rivetto), var(--rivetto), var(--rivetto);
  background-size: 12px 12px;
  background-position: 6px 6px, calc(100% - 6px) 6px, 6px calc(100% - 6px), calc(100% - 6px) calc(100% - 6px);
  background-repeat: no-repeat;
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
  text-align: center;
}
.box-account[hidden] { display: none; }
.account-titolo { margin: 0 0 6px; font-family: var(--titoli); font-size: 1.2rem; font-weight: 600; }
.account-nota, .account-riga { margin: 0 0 14px; font-size: 0.95rem; }
.account-errore { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--rosso); border-radius: 4px; font-size: 0.95rem; }
.account-campo {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--bianco);
  background: var(--s1);
  border: 1px solid var(--oro-scuro);
  border-radius: 4px;
}
.account-campo::placeholder { color: var(--bianco); opacity: 0.5; }
.account-campo:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 2px var(--s1), 0 0 0 3px var(--oro-chiaro); }
.account-spunta { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; text-align: left; font-size: 0.9rem; }
.account-spunta input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--oro); }
.account-azioni { display: grid; gap: 10px; }
.account-secondarie { gap: 4px; margin-top: 4px; }
.account-form { display: grid; }
.profilo-anteprima { display: block; width: 96px; height: 96px; margin: 0 auto 14px; }
.avatar-griglia { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0 0 16px; }
.avatar-scelta {
  padding: 2px; background: none; cursor: pointer;
  border: 2px solid transparent; border-radius: 50%;
}
.avatar-scelta img { display: block; width: 100%; height: auto; }
.avatar-scelta[aria-pressed="true"] { border-color: var(--oro-chiaro); box-shadow: 0 0 0 2px var(--oro); }
.avatar-scelta:focus-visible { outline: 2px solid var(--oro-chiaro); outline-offset: 2px; }
.account-profilo { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 14px; }
.account-profilo .account-riga { margin: 0; text-align: left; }
.mio-avatar { flex: none; width: 44px; height: 44px; }
.account-pwd { position: relative; }
.account-pwd .account-campo { padding-right: 96px; }
.account-mostra {
  position: absolute; top: 0; right: 0;
  height: calc(100% - 14px);
  padding: 0 14px;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--bianco);
  background: none; border: 0;
  text-decoration: underline; text-decoration-color: var(--oro); text-underline-offset: 3px;
  cursor: pointer;
}
.account-mostra:focus-visible { outline: 2px solid var(--oro-chiaro); outline-offset: -4px; }
.account-info { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--oro-scuro); border-radius: 4px; font-size: 0.95rem; }

/* ---- Pagine di testo (privacy, segnala) ---- */
.pagina h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: 0.03em; color: var(--oro); }
.pagina h2 { font-size: 1.35rem; margin-top: 1.8em; }
.pagina h2::before {
  content: "";
  display: inline-block;
  width: 0.45em; height: 0.45em;
  margin-right: 0.6em;
  vertical-align: 0.12em;
  background: var(--oro);
  transform: rotate(45deg);
}
.pagina ul { padding-left: 1.2em; }
.pagina ol { padding-left: 1.5em; }
.pagina li { margin-bottom: 0.4em; }
.pagina .data { font-size: 0.9rem; color: var(--testo-soft); }
.torna { display: inline-block; margin-bottom: 10px; padding: 8px 0; font-weight: 600; }
.pagina .btn { margin-top: 18px; }

/* ---- Piè di pagina ---- */
.piede {
  width: 100%;
  max-width: 600px;
  margin: 24px auto 0;
  padding: 18px 16px 28px;
  border-top: 1px solid var(--oro-scuro);
  font-size: 0.82rem;
  color: var(--testo-soft);
  text-align: center;
}
.piede p { margin: 0 0 10px; }
.piede a { display: inline-block; padding: 6px 8px; font-weight: 600; }

/* ---- "Vai al contenuto" (si vede solo con la tastiera) ---- */
.salta {
  position: absolute;
  left: 8px; top: -64px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--oro);
  color: var(--nero);
  font-weight: 600;
  border-radius: 4px;
}
.salta:focus { top: 8px; }
.salta:hover { color: var(--nero); }

/* ---- Barra di navigazione: in basso su telefono, in alto su PC ---- */
html { scroll-padding-bottom: 80px; }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.barra-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--s1);
  border-top: 1px solid var(--oro-scuro);
}
.barra-nav ul { display: flex; max-width: 600px; margin: 0 auto; padding: 0; list-style: none; }
.barra-nav li { flex: 1; }
.barra-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 6px 4px;
  color: var(--testo-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}
.barra-nav a:hover { color: var(--bianco); }
.barra-nav svg { width: 24px; height: 24px; }
.barra-nav a[aria-current="page"] { color: var(--bianco); box-shadow: inset 0 3px 0 var(--oro); }
.barra-nav a[aria-current="page"] svg { color: var(--oro); }
.barra-nav a:focus-visible { outline-offset: -4px; }
/* durante le domande la barra si nasconde per lasciare spazio */
body.in-gioco { padding-bottom: 0; }
body.in-gioco .barra-nav { display: none; }

@media (min-width: 640px) {
  html { scroll-padding-bottom: 0; scroll-padding-top: 72px; }
  body { padding-bottom: 0; }
  .barra-nav { position: sticky; top: 0; bottom: auto; padding-bottom: 0; border-top: 0; border-bottom: 1px solid var(--oro-scuro); }
  .barra-nav ul { justify-content: center; }
  .barra-nav li { flex: 0 1 160px; }
  .barra-nav a { flex-direction: row; gap: 8px; min-height: 52px; }
}

/* ---- Schede delle sfide come link / sfide chiuse ---- */
a.biglietto { text-decoration: none; }
.biglietto.chiusa { cursor: default; background: var(--s1); }
.biglietto.chiusa .num b { color: var(--bianco); }
.biglietto.chiusa .stato-sfida {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--bianco);
  border: 1px dashed var(--oro-scuro);
}
.biglietto.chiusa .nome, .biglietto.chiusa .dettaglio { opacity: 0.75; }

/* ---- Blocchi di testo nelle pagine di gioco (Home, Sfide, Sfida N) ---- */
.testo-pagina { margin: 26px 0; }
.testo-pagina h2 { font-size: 1.35rem; margin: 0 0 0.6em; }
.testo-pagina h2::before {
  content: "";
  display: inline-block;
  width: 0.45em; height: 0.45em;
  margin-right: 0.6em;
  vertical-align: 0.12em;
  background: var(--oro);
  transform: rotate(45deg);
}
.testo-pagina ol { padding-left: 1.5em; }
.testo-pagina li { margin-bottom: 0.4em; }
.in-arrivo { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.in-arrivo li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: 0;
  padding: 12px 14px;
  background: var(--s1);
  border: 1px dashed var(--oro-scuro);
  border-radius: 4px;
}
.in-arrivo b { font-family: var(--titoli); font-size: 1.1rem; font-weight: 600; }
.in-arrivo span { grid-column: 1; font-size: 0.9rem; color: var(--testo-soft); }
.in-arrivo i {
  grid-column: 2; grid-row: 1 / span 2;
  align-self: center;
  padding: 6px 10px;
  border: 1px dashed var(--oro-scuro);
  border-radius: 2px;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nota-centro { text-align: center; }
.altre-sfide { margin: 18px 0; text-align: center; }
.altre-sfide a { display: inline-block; padding: 10px 6px; font-weight: 600; }

@media (max-width: 380px) {
  .titolo-grande { font-size: 2.2rem; }
  .punteggio { font-size: 4.6rem; }
  .domanda { font-size: 1.5rem; }
  .quadratini li { width: 26px; }
  .biglietto { grid-template-columns: 58px 1fr auto; }
  .biglietto::before, .biglietto::after { left: 52px; }
  .biglietto .info { padding-left: 14px; }
  .biglietto .stato-sfida { margin-right: 10px; padding: 6px 10px; }
}

@media (min-width: 640px) {
  .titolo-grande { font-size: 3.2rem; }
  .domanda { font-size: 2rem; }
  .app { padding-top: 16px; }
}

/* Telefoni bassi (740 px di altezza o meno): in partita si toglie il logo e si stringono gli spazi,
   così le cinque risposte entrano senza scorrere (con 10 secondi non c'è tempo per cercarle). */
@media (max-height: 740px) {
  main:has(#schermata-domanda:not([hidden])) #testata { display: none; }
  .barra-alta { margin-top: 2px; }
  .timer { width: 54px; height: 54px; }
  .timer-num { font-size: 1.2rem; }
  .progresso { margin: 8px 0 12px; }
  .domanda { margin-bottom: 12px; }
  .opzioni { gap: 8px; }
  .opzione { min-height: 52px; }
  .esito { margin: 8px 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .bobina { animation: none; }
  .timer.urgente { animation: none; }
  .progresso div { transition: none; }
}
