/* ============================================================================
   QUIZ TEAM - stile condiviso dalle tre pagine (MOTORE).
   Le variabili hanno nomi di ruolo (primario, accento, oro, allarme,
   successo, chiaro, fondo): i valori li da' tema.css del cliente. Le quattro
   risposte hanno SEMPRE la lettera: il colore da solo non basta.
   ========================================================================== */
/* I colori, i font e lo sfondo NON stanno qui: sono del cliente, in tema.css.
   Qui ci sono solo misure e ombre, uguali per tutti. */
:root {
  --raggio: 18px;
  --ombra: 0 18px 40px rgba(0, 0, 0, .55);
  --ombra-tasto: 0 6px 0 rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo); color: var(--chiaro); font-family: var(--testo);
  -webkit-font-smoothing: antialiased; overflow: hidden; line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 6px; }

/* ---- le schermate: una sola viva alla volta -------------------------------- */
.schermata {
  position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px;
  text-align: center;
}
.schermata.viva { display: flex; animation: entra .32s cubic-bezier(.2, .8, .2, 1) both; }
.schermata.scorre { overflow-y: auto; justify-content: flex-start; padding-top: max(24px, env(safe-area-inset-top)); }
@keyframes entra { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---- tipografia ----------------------------------------------------------- */
.titolo {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  letter-spacing: .02em; line-height: .95;
}
.occhiello {
  font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--tenue);
  font-weight: 600;
}
.nota { color: var(--tenue); font-size: 15px; max-width: 46ch; }
.nota b { color: var(--chiaro); }
.grosso { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; }

/* ---- pannelli e bottoni --------------------------------------------------- */
.pannello {
  background: linear-gradient(180deg, var(--primario), var(--primario-scuro));
  border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--raggio);
  box-shadow: var(--ombra); padding: 22px;
}
/* l'attributo hidden vince sempre: .bottone e' inline-flex e altrimenti lo ignora */
[hidden] { display: none !important; }
.bottone {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; font-weight: 700; font-size: 17px; padding: 14px 26px;
  background: var(--accento); color: #fff; box-shadow: var(--ombra-tasto);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  user-select: none; -webkit-user-select: none; text-transform: uppercase; letter-spacing: .04em;
  font-family: var(--display); font-weight: 400; font-size: 22px;
}
.bottone:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.bottone.chiaro { background: var(--chiaro); color: var(--primario); }
.bottone.fantasma { background: rgba(var(--chiaro-rgb), .08); border: 1px solid var(--linea); box-shadow: none; }
.bottone.grande { font-size: 28px; padding: 18px 40px; }
.bottone:disabled { opacity: .4; cursor: default; transform: none; }
.tondo {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(var(--chiaro-rgb), .1); border: 1px solid var(--linea); font-size: 19px;
  color: var(--chiaro);
}
.tondo.spento { opacity: .45; text-decoration: line-through; }
.bottone.spento { opacity: .5; }   /* c'e' ma non e' il momento (es. Inizia a lobby vuota) */
.comandi { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; z-index: 20; }

/* ---- il marchio FRD, in basso ---------------------------------------------- */
.marchio-frd {
  position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); left: 0; right: 0;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fioco);
}
.marchio-frd b { color: var(--tenue); font-weight: 800; }

/* ---- le quattro risposte -------------------------------------------------- */
.risposte { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.risposta {
  display: flex; align-items: center; gap: 14px; text-align: left;
  border-radius: var(--raggio); padding: 16px 18px; min-height: 76px;
  color: var(--contorno); font-weight: 700; font-size: 20px; line-height: 1.15;
  /* TASTI VERI (06/10/2026, da Smash Up): luce sul bordo di sopra, ombra
     dentro in basso, spessore sotto e un'ombra portata. Da quattro metri si
     capisce che sono cose da premere, non quattro rettangoli colorati. */
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .45),
    inset 0 -6px 14px -6px rgba(0, 0, 0, .45),
    0 8px 0 rgba(0, 0, 0, .28),
    0 18px 34px -14px rgba(0, 0, 0, .6);
  border: 3px solid transparent;
  transition: transform .12s ease, opacity .3s, filter .3s, box-shadow .12s;
  position: relative; overflow: hidden;
}
/* la lucentezza che taglia il tasto in alto a sinistra */
.risposta::after {
  content: ""; position: absolute; left: -20%; top: -60%; width: 60%; height: 220%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .16), rgba(255, 255, 255, 0));
  transform: rotate(8deg); pointer-events: none;
}
.risposta .lettera {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chiaro); color: var(--contorno); font-family: var(--display); font-size: 26px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .35);
}
.risposta.a { background: var(--risposta-a); color: var(--risposta-a-testo, #fff); }
.risposta.b { background: var(--risposta-b); color: var(--risposta-b-testo, #fff); }
.risposta.c { background: var(--risposta-c); color: var(--risposta-c-testo, #fff); }
.risposta.d { background: var(--risposta-d); color: var(--risposta-d-testo, #fff); }
/* premuto: il tasto scende e lo spessore sparisce */
.risposta:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), 0 2px 0 rgba(0, 0, 0, .3); }
.risposta.scelta { border-color: var(--chiaro); transform: scale(1.02); }
/* la giusta non si illumina solo lei: scalda anche l'aria intorno */
.risposta.giusta {
  border-color: var(--chiaro);
  box-shadow: 0 0 0 4px rgba(var(--chiaro-rgb), .55), 0 0 60px rgba(var(--successo-rgb), .85),
              inset 0 2px 0 rgba(255, 255, 255, .5), 0 14px 30px -12px rgba(0, 0, 0, .6);
  animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
.risposta.spenta { opacity: .28; filter: saturate(.4); box-shadow: none; }
.risposta:disabled { cursor: default; }
@keyframes pop { 0% { transform: scale(.94); } 55% { transform: scale(1.06); } 100% { transform: scale(1.02); } }

/* ---- la barra del tempo --------------------------------------------------- */
.tempo { position: relative; height: 14px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; width: 100%; }
.tempo .barra { position: absolute; inset: 0; width: 100%; background: linear-gradient(90deg, var(--oro), var(--accento)); border-radius: 999px; transform-origin: left center; }
.tempo.ultimi .barra { background: var(--allarme); }

/* ---- stemmi e schede squadra ---------------------------------------------- */
.stemma { width: 44px; height: 44px; flex: none; object-fit: contain; }
.scheda-squadra {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px; text-align: left;
}
.scheda-squadra .nome { font-weight: 800; font-size: 18px; }
.scheda-squadra .membri { color: var(--tenue); font-size: 13px; }
.scheda-squadra .punti { margin-left: auto; font-family: var(--display); font-size: 24px; color: var(--oro); }
.scheda-squadra.testa { border-color: var(--oro); box-shadow: 0 0 24px rgba(var(--oro-rgb), .35); }
.scheda-squadra.nuova { animation: pop .45s cubic-bezier(.34, 1.56, .64, 1) both; }

/* ---- modulo contatti ------------------------------------------------------ */
.modulo { display: flex; flex-direction: column; gap: 10px; width: min(420px, 92vw); }
.modulo input {
  width: 100%; padding: 15px 16px; border-radius: 14px; border: 2px solid var(--linea);
  background: rgba(0, 0, 0, .28); color: var(--chiaro); font-size: 17px;
}
.modulo input::placeholder { color: var(--fioco); }
.modulo input:focus { border-color: var(--accento); outline: none; }
.consenso {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; font-size: 14px;
  color: var(--tenue); padding: 8px 4px; cursor: pointer; line-height: 1.4;
}
.consenso input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--accento); }
.consenso a { color: var(--oro); text-decoration: underline; }
.errore { color: var(--oro); font-size: 14px; min-height: 18px; font-weight: 600; }

/* ---- la finestra dell'informativa ----------------------------------------- */
.velo {
  position: absolute; inset: 0; background: rgba(var(--fondo-rgb), .85); z-index: 40;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.velo.viva { display: flex; }
.finestra {
  background: var(--primario-scuro); border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--raggio);
  width: min(560px, 94vw); max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--ombra);
}
.finestra .testa { padding: 18px 20px 8px; }
.finestra .corpo { padding: 8px 20px; overflow-y: auto; text-align: left; }
.finestra .piede { padding: 12px 20px 18px; }
.testo-privacy h3 { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--oro); margin: 14px 0 4px; }
.testo-privacy h3:first-child { margin-top: 0; }
.testo-privacy p { margin: 0 0 8px; font-size: 14px; color: var(--tenue); }

/* ---- pausa ---------------------------------------------------------------- */
.pausa {
  position: absolute; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center;
  background: rgba(var(--fondo-rgb), .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pausa.viva { display: flex; }
.pausa .titolo { font-size: clamp(48px, 10vw, 140px); color: var(--oro); }

/* ---- animazioni riusate --------------------------------------------------- */
@keyframes pulsa { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes scuoti { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes sale { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes vola { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
.scuoti { animation: scuoti .45s ease both; }
.sale { animation: sale .4s cubic-bezier(.2, .8, .2, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- l'apertura: il video a tutto schermo all'avvio (comune.js G.apertura) ---
   Lo usa il cliente che mette `scenografia.apertura` in cliente.js; chi non ce
   l'ha non se ne accorge. Sta qui, nel motore, perche' il comportamento e' del
   motore: il cliente decide solo QUALE video. */
.apertura { position: fixed; inset: 0; z-index: 100; background: #000; transition: opacity 1.1s ease; cursor: pointer; }
.apertura video { width: 100%; height: 100%; object-fit: cover; display: block; }
.apertura.via { opacity: 0; pointer-events: none; }
