/* ==========================================================================
   GameNight Show – tema pop: carte, dadi, bordi spessi e ombre piene
   ========================================================================== */

/* Titoli e numeri: Fredoka (forme tonde e aperte, leggibile anche piccolo e da lontano).
   Due istanze statiche: "400" nei fogli di stile è il seminero (600), "700" il nero. */
@font-face {
  font-family: 'Fredoka';
  src: url('../assets/fonts/fredoka-600.woff2') format('woff2');
  font-weight: 100 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fredoka';
  src: url('../assets/fonts/fredoka-700.woff2') format('woff2');
  font-weight: 601 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('../assets/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
/* Testi dell'interfaccia: Atkinson Hyperlegible Next, disegnato per essere leggibile
   (I l 1, O 0, rn m ben distinte). Tre istanze statiche, assegnate ai pesi usati nei fogli di stile:
   fino a 549 regolare, 550–749 medio (il testo normale, "700"), da 750 in su grassetto (800–900). */
@font-face { font-family: 'GNR UI'; src: url('../assets/fonts/atkinson-400.woff2') format('woff2'); font-weight: 100 549; font-style: normal; font-display: swap; }
@font-face { font-family: 'GNR UI'; src: url('../assets/fonts/atkinson-500.woff2') format('woff2'); font-weight: 550 749; font-style: normal; font-display: swap; }
@font-face { font-family: 'GNR UI'; src: url('../assets/fonts/atkinson-700.woff2') format('woff2'); font-weight: 750 1000; font-style: normal; font-display: swap; }

:root {
  --cream: #FFF4DE;
  --paper: #FFFFFF;
  --ink: #1F1A3D;
  --ink-soft: #4A4468;
  --tomato: #FF5A4E;
  --sun: #FFC93C;
  --teal: #2EC4B6;
  --violet: #7B5CFA;
  --pink: #FF8FB1;
  --sky: #4D96FF;
  --error: #B3261E;
  --display: 'Fredoka', 'Nunito', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'GNR UI', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bw: 0.19rem;
  --pop: cubic-bezier(.2, 1.6, .4, 1);
  /* 2.3 · Sistema di design comune a tutte le pagine (anche la TV): misure minime dei controlli,
     contorno del focus e colori degli avvisi. Gli avvisi hanno fondo chiaro e inchiostro scuro in tutti
     i temi: contrasto da 10:1 a 13:1 (WCAG AA chiede 4,5:1). css/ui.css aggiunge il resto per le pagine nuove. */
  --ctl-h: 3rem;          /* controlli normali: 48–54 px */
  --ctl-h-sm: 2.75rem;    /* controlli compatti (barre, filtri): mai sotto i 44 px */
  --focus: #FFD23F;
  --focus-ring: 0 0 0 3px #1A1236, 0 0 0 6px var(--focus);
  --al-warn-bg: #FFF1C7; --al-warn-ink: #3D2E00; --al-warn-line: #E0A800;
  --al-ok-bg: #D6F5E7;   --al-ok-ink: #0B3D27;   --al-ok-line: #1FA56A;
  --al-new-bg: #FFE58F;  --al-new-ink: #2B2000;  --al-new-line: #E0B000;
  --al-err-bg: #FFE1DE;  --al-err-ink: #6B0F0F;  --al-err-line: #D9342B;
  --al-info-bg: #DCEBFF; --al-info-ink: #13315C; --al-info-line: #2B7FE0;
}

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

html { -webkit-text-size-adjust: 100%; }
html.tv { font-size: clamp(11px, min(1.12vw, 1.95vh), 30px); }
html.tv body { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(31, 26, 61, 0.10) 1.5px, transparent 1.6px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.35;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.01em;
}
p { margin: 0; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; }
code { font-size: 0.95em; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 0 0.3em; }

/* Focus da tastiera: giallo con un anello scuro, visibile sia sui fondi chiari sia su quelli scuri */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(26, 18, 54, 0.55); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-soft); font-weight: 700; }
.center { text-align: center; }
.small { font-size: 0.875rem; }
.full-width { align-self: stretch; }

.ico { width: 1.2em; height: 1.2em; flex-shrink: 0; }

/* ---------- Logo ---------- */

.logo, .brand { font-family: var(--display); font-weight: 400; line-height: 1; white-space: nowrap; }
.logo--xl { font-size: 5rem; }
.logo--home { font-size: clamp(2.6rem, 9vw, 4.6rem); }
.brand { font-size: 1.7rem; }
.brand--sm { font-size: 1.3rem; }

.logo-tag {
  display: inline-block;
  font-size: 0.62em;
  background: var(--sun);
  border: 0.08em solid var(--ink);
  border-radius: 0.28em;
  box-shadow: 0.08em 0.08em 0 var(--ink);
  padding: 0.04em 0.32em 0.1em;
  margin-left: 0.12em;
  transform: rotate(-4deg);
  vertical-align: 0.1em;
}
.logo-tag--sm { font-size: 0.72em; }
.logo-tag--xs { font-size: 0.78em; box-shadow: none; border-width: 2px; }

/* ---------- Pulsanti e campi ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--display); font-weight: 400; font-size: 1.35rem; line-height: 1.1;
  color: var(--cream); background: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.32rem 0.32rem 0 var(--tomato);
  padding: 0.7em 1.3em; min-height: var(--ctl-h);
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active:not(:disabled) { transform: translate(0.2rem, 0.2rem); box-shadow: 0.12rem 0.12rem 0 var(--tomato); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn .ico { color: var(--sun); }
.btn-big { font-size: 1.75rem; }
.btn-block { width: 100%; min-height: 3.6rem; }

.btn-sec {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  font-family: var(--body); font-weight: 900; font-size: 1.05rem;
  background: var(--paper); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: 0.8rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
  padding: 0.5em 0.95em; min-height: var(--ctl-h);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn-sec:active:not(:disabled) { transform: translate(0.12rem, 0.12rem); box-shadow: 0.08rem 0.08rem 0 var(--ink); }
.btn-sec:disabled, .btn-sec[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-sec[aria-pressed="true"], .btn-sec[aria-expanded="true"] { background: var(--sun); }
.btn-sec--sm { font-size: 0.95rem; padding: 0.4em 0.8em; min-height: var(--ctl-h-sm); }

.link-btn {
  background: none; border: none; padding: 0.6rem; min-height: var(--ctl-h-sm);
  font-weight: 900; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer;
}
.text-btn {
  background: none; border: none; font-weight: 900; font-size: 1rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.2em; padding: 0.4rem;
}
.icon-btn {
  width: var(--ctl-h-sm); height: var(--ctl-h-sm); display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.7rem; cursor: pointer;
}

.input {
  width: 100%; min-height: var(--ctl-h);
  border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  background: var(--paper); color: var(--ink);
  padding: 0.55rem 0.9rem;
  font-family: var(--body); font-weight: 800; font-size: 1.15rem;
}
.input::placeholder { color: #8C87A6; }
.input--xl { font-family: var(--display); font-weight: 400; font-size: 1.8rem; }
.code-input {
  font-family: var(--display); font-weight: 400; font-size: 2.4rem;
  text-align: center; letter-spacing: 0.25em; text-transform: uppercase;
}
.form-error { color: var(--error); font-weight: 900; min-height: 1.35em; }

/* ---------- Elementi comuni ---------- */

.card {
  background: var(--paper);
  border: 0.25rem solid var(--ink);
  border-radius: 1.4rem;
  box-shadow: 0.45rem 0.45rem 0 var(--ink);
}
.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 999px;
  padding: 0.15em 0.85em; font-weight: 900; white-space: nowrap;
}
.chip--tomato { background: var(--tomato); font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.code-text { letter-spacing: 0.08em; }
.tilt-left { transform: rotate(-2.5deg); }

.avatar {
  --s: 4rem;
  --pc: var(--sun);
  position: relative;
  width: var(--s); height: var(--s);
  display: inline-grid; place-items: center;
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--pc);
  border: var(--bw) solid var(--ink);
}
.avatar img { width: 100%; height: 100%; display: block; }
.avatar-initial { font-family: var(--display); font-size: calc(var(--s) * 0.42); }
.avatar--shadow { box-shadow: 0.3rem 0.3rem 0 var(--ink); }

.game-img {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 3; max-width: 100%;
  background: #1F1A3D;
  border: 0.25rem solid var(--ink); border-radius: 1.3rem;
}
/* Ogni foto, di qualsiasi forma, resta dentro lo stesso riquadro: sfondo sfocato + foto intera sopra */
.game-img img { display: block; width: 100%; height: 100%; }
.game-img .gi-bg { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(16px) saturate(1.2) brightness(0.72); z-index: -1; transform: translateZ(0); }
.game-img .gi-fg { position: relative; object-fit: contain; }
/* Le miniature piccole riempiono il riquadro (ritagliate al centro): più pulite da lontano */
.game-img--chip .gi-fg, .game-img--mini .gi-fg, .game-img--thumb .gi-fg, .game-img--opt .gi-fg, .game-img--lib .gi-fg, .game-img--poll .gi-fg { object-fit: cover; }
.game-img--chip .gi-bg, .game-img--mini .gi-bg, .game-img--thumb .gi-bg { display: none; }
.game-img--empty {
  display: grid; place-items: center; background-color: var(--paper);
  background-image: repeating-linear-gradient(45deg, rgba(123, 92, 250, 0.18) 0 0.9rem, transparent 0.9rem 1.8rem);
}
.game-img--empty span {
  font-family: var(--display); font-size: 3rem; line-height: 1;
  background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.15em 0.4em;
}
.game-img--hero { width: 100%; box-shadow: 0.5rem 0.5rem 0 var(--ink); }
.game-img--thumb { width: 4.6rem; aspect-ratio: 1; border-width: var(--bw); border-radius: 0.8rem; }
.game-img--mini { width: 3.4rem; aspect-ratio: 1; border-width: 0.16rem; border-radius: 0.6rem; }
.game-img--thumb span, .game-img--mini span { font-size: 1.1rem; border-width: 0.12rem; border-radius: 0.4rem; }
.game-img--pod { width: 9rem; aspect-ratio: 1; box-shadow: 0.3rem 0.3rem 0 var(--ink); }
.game-img--award { width: 5.6rem; aspect-ratio: 1; border-width: var(--bw); border-radius: 0.9rem; }
.game-img--award span, .game-img--pod span { font-size: 1.8rem; }

.crown { display: block; }
.crowned { position: relative; display: inline-block; padding-top: 0.9rem; }
.crowned .crown {
  position: absolute; z-index: 1; width: 2rem; left: 50%; top: -0.15rem;
  transform: translateX(-50%) rotate(-8deg);
}
.crowned + .crowned { margin-left: -0.7rem; }

.empty-board {
  border: var(--bw) dashed var(--ink); border-radius: 1.2rem;
  padding: 1.6rem; text-align: center; display: flex; flex-direction: column; gap: 0.4rem;
}
.empty-title { font-family: var(--display); font-size: 1.6rem; }

.toast {
  position: fixed; left: 50%; bottom: max(1.5rem, env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 150%);
  /* 1.11: max-content, altrimenti con left: 50% il messaggio si stringeva a metà schermo (testo grande, telefoni) */
  width: max-content; max-width: min(92vw, 34rem);
  background: var(--ink); color: var(--cream);
  border-radius: 1rem; padding: 0.8rem 1.2rem;
  font-weight: 800; text-align: center;
  box-shadow: 0.3rem 0.3rem 0 var(--sun);
  transition: transform .3s var(--pop);
}
.toast.is-on { transform: translate(-50%, 0); }
.toast--error { box-shadow: 0.3rem 0.3rem 0 var(--tomato); }

.loading, .fatal {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; align-content: center; gap: 1.2rem;
  padding: 1.5rem; text-align: center;
}
.loading p { font-weight: 900; }
.loading-die {
  position: relative; width: 4rem; height: 4rem;
  background: var(--tomato); border: 0.25rem solid var(--ink); border-radius: 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  animation: tumble 1.1s ease-in-out infinite;
}
.loading-die i { position: absolute; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--cream); }
.loading-die i:nth-child(1) { top: 0.55rem; left: 0.55rem; }
.loading-die i:nth-child(2) { top: calc(50% - 0.35rem); left: calc(50% - 0.35rem); }
.loading-die i:nth-child(3) { bottom: 0.55rem; right: 0.55rem; }
.fatal-card { max-width: 34rem; padding: 2rem; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.fatal-card h1 { font-size: 2.2rem; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti i {
  position: absolute; top: -6vh;
  border: 2px solid var(--ink); border-radius: 3px;
  animation-name: fall; animation-timing-function: cubic-bezier(.3, .2, .6, 1); animation-fill-mode: both;
}

/* ---------- Stepper ---------- */

.stepper {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 999px;
  box-shadow: 0.22rem 0.22rem 0 var(--ink);
  padding: 0.3rem;
}
.stepper output { font-family: var(--display); font-size: 1.8rem; min-width: 4.6rem; text-align: center; }
.step-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); border: var(--bw) solid var(--ink); cursor: pointer;
}
.step-btn .ico { width: 1.5em; height: 1.5em; }
.step-btn:active { transform: scale(.92); }
.stepper--xl { padding: 0.5rem; gap: 1.2rem; }
.stepper--xl output { font-size: 4.4rem; min-width: 7rem; }
.stepper--xl .step-btn { width: 4rem; height: 4rem; }

/* ==========================================================================
   TV
   ========================================================================== */

.tv-shell {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 1.1rem;
  padding: 1.3rem 2.4rem 1.7rem;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; }
/* Barra della TV (2.4): marchio | informazioni | comandi. Va su più righe invece di sforare di lato. */
.tvbar { flex-wrap: wrap; row-gap: 0.5rem; }
.tvbar-brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; flex: 0 1 auto; }
.tvbar-brand .brand { font-size: 1.55rem; }
.tvbar-brand .hdr-back { width: var(--ctl-h-sm); height: var(--ctl-h-sm); flex-shrink: 0; font-size: 1.2rem; font-weight: 900; }
.tvbar-info { display: flex; align-items: center; gap: 0.45rem; flex: 1 1 auto; justify-content: center; min-width: 0; flex-wrap: wrap; }
.tvbar-acts { display: flex; align-items: center; gap: 0.45rem; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.tvbar .chip, .tvbar .chip-btn { min-height: var(--ctl-h-sm); font-size: 0.9rem; padding: 0.2em 0.75em; }
.tvbar .quick-btn { min-width: var(--ctl-h-sm); }
.tvbar .icon-btn { width: var(--ctl-h-sm); height: var(--ctl-h-sm); }
.tvbar-info, .tvbar-acts { gap: 0.35rem; }
.tvbar .chip--code b { margin-left: 0.25em; }
.chip--lock { border-color: color-mix(in srgb, var(--tomato) 60%, var(--ink)); }
.chip--lock.is-locked { background: var(--tomato); color: #1F1A3D; }
.chip--end { font-weight: 900; }
/* Su TV non larghissime le etichette dei comandi secondari diventano icone (il nome resta nel tooltip) */
@media (max-width: 1500px) { html.tv .tvbar-acts #hdrTools span, html.tv .tvbar-acts #lobbyLock span { display: none; } }
/* Nella lobby il gruppo è già nella colonna del QR: la barra resta su una riga */
.topbar--lobby .tvbar-brand .topbar-group { display: none; }
@media (max-width: 1100px) { html.tv .tvbar-brand .topbar-group { display: none; } }
.pcard[hidden] { display: none; }
html.tv-far .tvbar-acts .quick-bar, html.tv-far .tvbar-acts #fsBtn { display: none; }
.screen { flex: 1; min-height: 0; display: flex; }
.screen > section { flex: 1; min-height: 0; }

/* ---------- Creazione stanza ---------- */

.create {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; gap: 5rem;
  padding: 3rem; flex-wrap: wrap;
}
.create-hero { display: flex; flex-direction: column; gap: 1.6rem; }
.create-lead { font-size: 1.5rem; font-weight: 800; max-width: 26ch; }
.create-card {
  width: min(32rem, 100%); padding: 2.2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1.3rem; text-align: center;
}
.create-card h2 { font-size: 2.2rem; }

/* ---------- ROOM: lobby della TV (2.4) ----------
   I partecipanti sono il centro: colonna stretta a sinistra (QR, codice, gruppo, codice regia), griglia dei
   partecipanti al centro (colonne e misura calcolate da host.js › SCREENS.lobby.layout), pannelli opzionali in
   una fascia compatta sotto, piede sempre visibile in fondo. La sezione occupa l'altezza dello schermo senza mai
   uscirne: prima "Inizia la serata" e il codice regia finivano sotto il bordo (1099 px su uno schermo da 1080).
   Card dritte (niente rotazioni), posti liberi in UNA card discreta invece di tanti segnaposto. */
.room {
  display: grid; height: 100%; min-height: 0; width: 100%;
  grid-template-columns: clamp(14rem, 21vw, 22rem) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "side main" "foot foot";
  gap: 1rem 2rem;
}
.room-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
/* 2.5: la colonna contiene SOLO QR, "Inquadra per entrare", codice stanza e codice regia, in una card che occupa
   l'altezza disponibile. Il QR è l'unico elemento elastico: prende lo spazio che resta (quadrato, largo al massimo
   quanto la colonna) e si rimpicciolisce quando lo schermo è basso. Prima la colonna aveva un'altezza fissa
   (riga della griglia) ma contenuti di altezza fissa più alti (QR a 34vh + link + gruppo + regia): da qui la
   barra di scorrimento interna e il codice regia da cercare scorrendo. */
.room-qr { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(0.35rem, 1.2vh, 0.8rem); padding: clamp(0.7rem, 1.6vh, 1.2rem); text-align: center; }
.room-qr .qr { flex: none; width: 14rem; height: 14rem; max-width: 100%; } /* misura vera data da fitQr() */
.room-qr .qr svg { width: 100%; height: 100%; border-radius: 0.6rem; }
.room-qr > :not(.qr) { flex-shrink: 0; }
.room-scan { font-family: var(--display); font-size: 1.55rem; line-height: 1.05; }
.room-code { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; font-weight: 800; }
.room-code .code-chip { font-size: 2.1rem; padding: 0.05em 0.5em; letter-spacing: 0.16em; }
.room-qr--locked { border-style: dashed; }
.room-group { display: flex; align-items: center; gap: 0.6rem; font-weight: 900; font-size: 1.05rem; line-height: 1.2; }
/* 2.5: avviso dei giocatori minimi e stato della stanza: piccolo, in alto accanto ai collegati */
.room-status { font-size: 0.95rem; font-weight: 800; line-height: 1.25; padding: 0.3rem 0.75rem; border-radius: 999px; background: color-mix(in srgb, var(--paper) 75%, transparent); border: 0.1rem solid color-mix(in srgb, var(--ink-soft) 35%, transparent); max-width: 100%; }
.room-status[data-kind="wait"] { border-color: var(--sun); color: var(--ink); }
.room-status:empty { display: none; }
.room-manager { font-size: 0.95rem; font-weight: 800; padding: 0.3rem 0.75rem; border-radius: 999px; background: color-mix(in srgb, var(--teal) 25%, transparent); border: 0.1rem solid var(--teal); }
.room-regia {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.1rem 0.6rem;
  padding: 0.5rem 0.75rem; border-radius: 0.8rem; font-size: 0.95rem; line-height: 1.35;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  border: 0.12rem solid color-mix(in srgb, var(--sun) 55%, transparent);
}
.room-regia .regia-code { font: 900 1.2rem/1.1 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.08em; color: var(--sun); user-select: all; white-space: nowrap; }
.room-regia small { color: var(--ink-soft); }
.room-regia .link-btn { font-size: 0.9rem; grid-column: 2; grid-row: 1 / span 2; }
.room-main { grid-area: main; display: flex; flex-direction: column; gap: 0.9rem; min-height: 0; min-width: 0; }
.room-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; }
.room-head .room-seats { margin-left: auto; }
.room-count { font-size: 1.35rem; font-weight: 800; }
.room-count b { font-family: var(--display); font-weight: 400; font-size: 2.2rem; vertical-align: -0.08em; margin-right: 0.15em; }
.room-count small { font-size: 0.95rem; color: var(--ink-soft); font-weight: 700; }
.room-seats { display: flex; align-items: center; gap: 0.7rem; }
.room-seats-label { font-weight: 800; color: var(--ink-soft); }
.room-people { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.room-people.is-scroll { overflow-y: auto; scrollbar-width: thin; }
.people-grid {
  --pc-size: 12rem; --pc-cols: 4;
  --pc-av: calc(var(--pc-size) * 0.56);
  margin: auto; display: grid; gap: clamp(0.7rem, 1.4vw, 1.4rem);
  grid-template-columns: repeat(var(--pc-cols), var(--pc-size)); justify-content: center; align-content: center;
}
.room-people.is-scroll .people-grid { margin: 0 auto; align-content: start; padding-bottom: 0.6rem; }
.pcard {
  position: relative; width: var(--pc-size); height: calc(var(--pc-size) * 1.18);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--pc-size) * 0.035);
  padding: calc(var(--pc-size) * 0.07); border-radius: calc(var(--pc-size) * 0.1);
  background: var(--paper); border: var(--bw) solid var(--ink); box-shadow: 0.3rem 0.3rem 0 var(--ink);
  text-align: center; container-type: inline-size;
}
.pcard.is-new { animation: slotIn .55s var(--pop) both; }
.pcard-av { line-height: 0; }
.pcard-name {
  max-width: 100%; font-family: var(--body); font-weight: 900; line-height: 1.12;
  font-size: clamp(0.9rem, calc(var(--pc-size) * 0.105), 2.6rem);
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere;
}
.pcard-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem; font-size: clamp(0.7rem, calc(var(--pc-size) * 0.06), 1.15rem); }
.pcard-meta .lv-badge { font-size: 1em; }
.pcard-title { font-weight: 900; background: var(--sun); color: #1F1A3D; border-radius: 999px; padding: 0.05rem 0.6rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-motto { font-size: clamp(0.7rem, calc(var(--pc-size) * 0.06), 1.1rem); font-style: italic; font-weight: 700; color: var(--ink-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Card piccole: solo avatar e nome (meno testo, più leggibile) */
@container (max-width: 9.5rem) { .pcard .pcard-motto, .pcard .pcard-title { display: none; } }
/* Stato del telefono: pallino verde = collegato, grigio barrato = non collegato (anche per gli screen reader) */
.pcard-status { position: absolute; top: calc(var(--pc-size) * 0.06); left: calc(var(--pc-size) * 0.06); display: inline-flex; }
.pcard-status i { width: clamp(0.7rem, calc(var(--pc-size) * 0.075), 1.3rem); height: clamp(0.7rem, calc(var(--pc-size) * 0.075), 1.3rem); border-radius: 50%; background: #3DDC97; box-shadow: 0 0 0 0.18rem var(--paper), 0 0 0.6rem rgba(61, 220, 151, 0.7); }
.pcard-status.is-off i { background: #8C87A6; box-shadow: 0 0 0 0.18rem var(--paper); }
.pcard.is-offline .avatar { filter: grayscale(1); opacity: 0.5; }
.pcard.is-offline .pcard-name { color: var(--ink-soft); }
/* 2.5: la X sta DENTRO l'angolo della card. Fuori (top/right negativi) veniva tagliata dal contenitore dei
   partecipanti, che non scorre (overflow nascosto) e che la griglia riempie fino al bordo. */
.pcard .kick { top: calc(var(--pc-size) * 0.045); right: calc(var(--pc-size) * 0.045); width: clamp(1.7rem, calc(var(--pc-size) * 0.15), 2.6rem); height: clamp(1.7rem, calc(var(--pc-size) * 0.15), 2.6rem); z-index: 2; }
.pcard .kick svg { width: 55%; height: 55%; }
.pcard:hover .kick, .pcard:focus-within .kick, .kick:focus-visible { opacity: 1; }
html.tv-far .pcard .kick { display: none; }
.pcard--free, .pcard--empty { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--ink-soft) 45%, transparent); box-shadow: none; }
.pcard-ghost { font-size: calc(var(--pc-size) * 0.3); line-height: 1; opacity: 0.55; font-family: var(--display); }
.pcard--free .pcard-name, .pcard--empty .pcard-name { color: var(--ink-soft); }
.pcard--empty { width: min(100%, 34rem); height: auto; min-height: 14rem; }
.people-grid:has(> .pcard--empty:only-child) { grid-template-columns: minmax(0, 34rem); }
/* Pannelli opzionali: una fascia compatta che non toglie mai il posto ai partecipanti */
.room-panels { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.7rem; max-height: 26%; overflow-y: auto; scrollbar-width: thin; flex-shrink: 0; }
.room-panels > .prep-block { flex: 1 1 18rem; min-width: 0; margin: 0; }
.room-panels .prep-title { display: block; margin-bottom: 0.3rem; }
.room-panels .ready-list { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.room-panels > .prep-plan { flex: 0 0 auto; align-self: center; }
.room-foot { grid-area: foot; display: flex; align-items: center; justify-content: flex-end; gap: 1rem; flex-wrap: wrap; }
.room-foot #lobbyLib { flex: 0 1 auto; min-width: 0; max-width: 26rem; white-space: nowrap; }
.room-foot #lobbyLib span { overflow: hidden; text-overflow: ellipsis; }
.room-foot #startBtn { flex: 0 0 auto; white-space: nowrap; }
.room-foot #startBtn:disabled { opacity: 0.55; filter: saturate(0.6); }
/* Modalità Minimal: niente gruppo né codice regia in colonna (il codice regia resta negli Strumenti) */
.room[data-mode="minimal"] .room-group { display: none; }
/* Schermi bassi o stretti (laptop, tablet): colonna più stretta, QR più piccolo */
@media (max-height: 820px), (max-width: 1280px) {
  .room { grid-template-columns: clamp(12rem, 19vw, 17rem) minmax(0, 1fr); gap: 0.8rem 1.4rem; }
  .room-scan { font-size: 1.25rem; }
  .room-code .code-chip { font-size: 1.6rem; }
  .room-regia small { font-size: 0.85rem; }
}
/* Telefono o finestra in verticale: una colonna, la pagina scorre (niente tagli) */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .room { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "main" "side" "foot"; }
  .room-side { align-items: center; }
  .room-qr { width: min(22rem, 100%); flex: 0 0 auto; }
  .room-qr .qr { height: auto; width: 100%; }
  .room-people { min-height: 18rem; overflow: visible; }
  .room-panels { max-height: none; }
  .screen--lobby { overflow-y: auto; }
}


.qr { width: 100%; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.qr-title { font-family: var(--display); font-size: 1.8rem; line-height: 1; }
.code-chip {
  display: inline-block; background: var(--teal);
  border: var(--bw) solid var(--ink); border-radius: 0.6rem;
  padding: 0.05em 0.45em; letter-spacing: 0.12em;
  font-family: var(--display); font-weight: 400; font-size: 1.4rem;
}
.kick {
  position: absolute; top: -0.8rem; right: -0.8rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--ink);
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.hint-line { font-size: 1.25rem; font-weight: 800; max-width: 34ch; }

/* ---------- Prossimo gioco ---------- */

.idle { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.next-card { padding: 1.5rem 1.8rem; display: flex; flex-direction: column; gap: 0.7rem; }
.next-card h1 { font-size: 3rem; }
.field-label { font-weight: 900; font-size: 1.1rem; margin-top: 0.3rem; }
.dropzone {
  position: relative; height: 11.5rem; overflow: hidden;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.55);
  border: var(--bw) dashed var(--ink); border-radius: 1.1rem;
  cursor: pointer; transition: background .15s;
}
.next-card.has-url .dropzone { height: 8.5rem; }
.dropzone.is-over { background: #FFE9A8; border-style: solid; }
.dropzone.has-img, .dropzone.is-phone { border-style: solid; background: var(--paper); cursor: default; }
.dropzone img { width: 100%; height: 100%; object-fit: contain; }
/* 2.0 · L'anteprima non si taglia più: nella griglia l'altezza in percentuale non vale (l'immagine usciva dal
   riquadro e se ne vedeva solo una striscia). Ora l'immagine sta dentro al riquadro, intera, con la stessa foto
   sfocata ai lati come le schede dei giochi. */
.dropzone .drop-fg { position: absolute; inset: 0; z-index: 1; }
.dropzone .drop-bg { position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover; filter: blur(14px) saturate(1.15) brightness(0.7); }
.dropzone .drop-clear { z-index: 2; }
.drop-hint { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1rem; text-align: center; font-weight: 800; }
.drop-hint .ico { width: 2.4rem; height: 2.4rem; }
.drop-clear {
  position: absolute; top: 0.6rem; right: 0.6rem;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--ink); cursor: pointer;
}
.phone-drop { display: flex; align-items: center; gap: 1.3rem; padding: 0.9rem 1.3rem; font-weight: 800; font-size: 1.1rem; }
.qr--sm { width: 9rem; flex-shrink: 0; }
.img-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.url-panel { display: flex; gap: 0.7rem; }
.url-panel .btn-sec { white-space: nowrap; }

.side-board { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.side-head h2 { font-size: 2.6rem; }
.mini-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.mini-row {
  display: grid; grid-template-columns: 2.2rem 3.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.8rem;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
}
.mini-row:first-child { background: var(--sun); }
.mini-rank { font-family: var(--display); font-size: 1.7rem; text-align: center; }
.mini-name { font-family: var(--display); font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-avg { font-family: var(--display); font-size: 1.9rem; }
.side-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- Votazione ---------- */

.voting { display: grid; grid-template-columns: 27rem minmax(0, 1fr); gap: 3.2rem; }
.voting-game { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; }
.game-title { font-size: 3.6rem; overflow-wrap: anywhere; }
.voting-status { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.voting-title { font-size: 3.4rem; }
.secret-line { display: flex; align-items: center; gap: 0.5rem; font-size: 1.2rem; font-weight: 800; }
.voters {
  --voter-av: 6rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr));
  gap: 1.1rem 1rem; margin-top: 0.8rem;
}
.voters--many { --voter-av: 4.6rem; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); }
.voter { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; min-width: 0; }
.voter-av { position: relative; display: inline-block; }
.voter .avatar { transition: filter .3s, opacity .3s; }
.voter:not(.is-voted) .avatar { filter: grayscale(1); opacity: 0.4; }
.voter.is-voted .avatar { box-shadow: 0.25rem 0.25rem 0 var(--ink); }
.voter.is-fresh .voter-av { animation: bump .5s var(--pop); }
.voter-badge {
  position: absolute; right: -0.3rem; top: -0.2rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); border: var(--bw) solid var(--ink);
}
.voter-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 900; font-size: 1.15rem;
}
.voter:not(.is-voted) .voter-name { color: var(--ink-soft); }
.vote-count { margin-top: auto; font-family: var(--display); font-size: 2.2rem; }
.vote-count.is-done { color: var(--ink); background: var(--sun); align-self: flex-start; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.1em 0.5em; transform: rotate(-1.5deg); animation: bump .5s var(--pop); }
.voting-actions { display: flex; justify-content: flex-end; gap: 1rem; }

/* ---------- Reveal ---------- */

.reveal { display: grid; grid-template-columns: 26rem minmax(0, 1fr); gap: 3rem; }
.reveal-left { display: flex; flex-direction: column; align-items: flex-start; gap: 0.9rem; }
.reveal-photo { position: relative; width: 100%; margin: 0.4rem 0 2.4rem; }
.avg-badge {
  position: absolute; right: -1.2rem; bottom: -3rem;
  width: 11rem; height: 11rem; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--sun);
  border: 0.32rem solid var(--ink);
  box-shadow: 0.4rem 0.4rem 0 var(--ink);
  transform: rotate(6deg);
  animation: badgeIn .65s var(--after, 0s) var(--pop) both;
}
.avg-badge span { font-weight: 900; font-size: 1.1rem; }
.avg-badge b { font-family: var(--display); font-weight: 400; font-size: 4.6rem; line-height: 0.95; }
.verdict-chip {
  font-family: var(--display); font-size: 1.8rem;
  background: var(--teal);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  padding: 0.25rem 1rem; --tilt-end: -2deg; transform: rotate(-2deg);
  animation: riseIn .5s calc(var(--after, 0s) + .25s) both;
}
.rank-line { font-size: 1.2rem; font-weight: 800; animation: riseIn .5s calc(var(--after, 0s) + .4s) both; }

.reveal-right { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.reveal-head { display: flex; align-items: baseline; justify-content: space-between; }
.reveal-head h2 { font-size: 2.8rem; }
.vcards {
  --vc-av: 2.8rem;
  display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 1rem;
  perspective: 1200px;
}
.vcard { height: 10rem; }
.vcards--dense .vcard { height: 8.6rem; }
.vcard-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: flipIn .6s var(--d, 0s) ease-out both;
}
.vcard-front, .vcard-back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border: var(--bw) solid var(--ink); border-radius: 1.1rem;
  box-shadow: 0.28rem 0.28rem 0 var(--ink);
}
.vcard-back {
  transform: rotateY(180deg);
  display: grid; place-items: center;
  background-color: var(--ink);
  background-image: radial-gradient(rgba(255, 244, 222, 0.22) 0.2rem, transparent 0.22rem);
  background-size: 1.3rem 1.3rem;
}
.vcard-back span { font-family: var(--display); font-size: 3.4rem; color: var(--cream); }
.vcard-front {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.6rem 0.45rem;
  background: var(--paper);
}
.vcard-front.is-top { background: var(--sun); }
.vcard-who { align-self: stretch; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.vcard-who > span:last-child { font-weight: 900; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-num { font-family: var(--display); font-weight: 400; font-size: 4.2rem; line-height: 0.9; }
.vcards--dense .vcard-num { font-size: 3.4rem; }
.vcards--dense { --vc-av: 2.2rem; }
.vcard-tag { font-size: 0.85rem; font-weight: 900; min-height: 1.1rem; }

.crit-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
  animation: riseIn .5s calc(var(--after, 0s) + .55s) both;
}
.crit-tile {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  padding: 0.65rem 0.9rem;
}
.crit-label { font-weight: 900; font-size: 1rem; }
.crit-tile b { font-family: var(--display); font-weight: 400; font-size: 2.3rem; line-height: 1; }
.crit-tile small { font-family: var(--body); font-weight: 800; font-size: 1rem; margin-left: 0.25rem; }
.pips { display: flex; gap: 0.3rem; }
.pips i { width: 1.4rem; height: 0.65rem; border: 0.15rem solid var(--ink); border-radius: 0.4rem; background: var(--paper); }
.pips i.on { background: var(--cc); }
.mvp-tile {
  --mvp-av: 3.3rem;
  display: flex; align-items: center; gap: 0.8rem; min-width: 0;
  background: var(--ink); color: var(--cream);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  padding: 0.5rem 0.9rem;
}
.mvp-tile .avatar { border-color: var(--sun); }
.mvp-avs { display: flex; flex-shrink: 0; }
.mvp-text { min-width: 0; }
.mvp-label { display: block; font-weight: 900; font-size: 0.95rem; color: var(--sun); }
.mvp-name { display: block; font-family: var(--display); font-weight: 400; font-size: 1.55rem; line-height: 1.05; overflow-wrap: anywhere; }
.mvp-votes { font-size: 0.95rem; font-weight: 800; }
.reveal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: auto; }

/* ---------- Classifica ---------- */

.board { display: flex; flex-direction: column; gap: 1.2rem; }
.board-head { display: flex; align-items: baseline; gap: 1.4rem; }
.board-head h1 { font-size: 3.6rem; }
.board-list {
  list-style: none; margin: 0;
  flex: 1; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 0.8rem;
  padding: 0.2rem 0.7rem 0.7rem 0.2rem;
}
.board-list--two {
  display: grid; grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), min-content);
  gap: 0.8rem 1.6rem; align-content: start;
}
.brow {
  display: grid; grid-template-columns: 3.4rem 4.6rem minmax(0, 1fr) auto 6.2rem;
  align-items: center; gap: 1.1rem;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 1.2rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  padding: 0.55rem 1.1rem 0.55rem 0.8rem;
  animation: riseIn .45s calc(var(--i, 0) * .08s) both;
}
.board-list--two .brow { grid-template-columns: 2.8rem 4rem minmax(0, 1fr) 5.2rem; }
.board-list--two .bcrit { display: none; }
.board-list--two .game-img--thumb { width: 4rem; }
.brow--r1 { background: var(--sun); }
.brow--r2 { background: #E7E1FF; }
.brow--r3 { background: #FFDCCF; }
.brank { font-family: var(--display); font-size: 2.5rem; text-align: center; }
.bname { min-width: 0; }
.bname b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbar { display: block; height: 0.55rem; margin-top: 0.45rem; border-radius: 1rem; background: rgba(31, 26, 61, 0.14); overflow: hidden; }
.bbar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.bcrit { display: flex; gap: 0.5rem; }
.bcrit-item {
  display: inline-block; white-space: nowrap;
  background: var(--cc);
  border: 0.15rem solid var(--ink); border-radius: 999px;
  padding: 0.12rem 0.6rem; font-size: 0.95rem; font-weight: 900;
}
.bavg { font-family: var(--display); font-size: 3rem; text-align: right; }
.board-actions { display: flex; justify-content: flex-end; gap: 1rem; }

/* ---------- Premiazione ---------- */

.awards { display: flex; flex-direction: column; gap: 1.2rem; }
.awards--empty { align-items: center; justify-content: center; gap: 2rem; }
.awards-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.awards-head h1 { font-size: 3.4rem; }
.awards-actions { display: flex; align-items: center; gap: 1rem; }
.key-hint { font-size: 1rem; }
.podium { display: grid; grid-template-columns: repeat(3, 15rem); justify-content: center; align-items: end; gap: 1.8rem; }
.pod { display: flex; flex-direction: column; }
.pod-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  padding-bottom: 0.7rem; text-align: center;
  transition: opacity .45s ease, transform .6s var(--pop);
}
.pod-card.is-hidden { opacity: 0; transform: translateY(2rem) scale(0.85); }
.pod--1 .game-img--pod { width: 10.5rem; }
.pod-name { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.05; overflow-wrap: anywhere; }
.pod-avg {
  font-family: var(--display); font-size: 1.8rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0 0.8rem;
}
.pod-base {
  display: grid; place-items: center;
  border: 0.25rem solid var(--ink); border-bottom: none; border-radius: 1rem 1rem 0 0;
  font-family: var(--display); font-size: 3rem;
}
.pod--1 .pod-base { height: 6rem; background: var(--sun); }
.pod--2 .pod-base { height: 4.3rem; background: var(--teal); }
.pod--3 .pod-base { height: 3rem; background: var(--tomato); }
.pod--none { visibility: hidden; }

.award-grid {
  display: grid; grid-template-columns: repeat(var(--n), minmax(0, 13rem));
  justify-content: center; gap: 1.2rem;
  perspective: 1400px;
}
.award { height: 13.5rem; }
.award-inner {
  position: relative; height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform .75s var(--pop);
}
.award.is-shown .award-inner { transform: rotateY(0deg); }
.award-front, .award-back {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  border: var(--bw) solid var(--ink); border-radius: 1.2rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}
.award-back {
  transform: rotateY(180deg);
  display: grid; place-items: center;
  background-color: var(--ac);
  background-image: radial-gradient(rgba(31, 26, 61, 0.18) 0.2rem, transparent 0.22rem);
  background-size: 1.3rem 1.3rem;
}
.award-back .ico { width: 4rem; height: 4rem; }
.award-front {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.35rem;
  padding: 0.75rem 0.7rem; text-align: center;
  background: var(--paper);
}
.award-front h3 {
  font-size: 1.15rem; background: var(--ac);
  border: 0.15rem solid var(--ink); border-radius: 999px; padding: 0.12rem 0.7rem;
}
.award-name { font-family: var(--display); font-weight: 400; font-size: 1.35rem; line-height: 1.05; overflow-wrap: anywhere; }
.award-value { font-size: 0.9rem; font-weight: 900; }
.award-people { display: flex; }

/* ==========================================================================
   Telefono
   ========================================================================== */

.phone {
  width: 100%; max-width: 30rem; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.6rem, env(safe-area-inset-bottom));
}
.phone--center { align-items: center; text-align: center; }
.phone h2 { font-size: 1.45rem; }
.ph-top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; }
.ph-room { font-weight: 900; font-size: 0.9rem; }
.ph-title { font-size: 2.5rem; }
.ph-lead { font-size: 1.05rem; font-weight: 700; max-width: 32ch; }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }

.code-form { align-self: stretch; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }

.me-row { display: flex; align-items: center; gap: 1rem; }
.field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 900; }

.av-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.av-opt {
  aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--pc);
  border: var(--bw) solid var(--ink); border-radius: 50%;
  opacity: 0.8;
  transition: transform .15s var(--pop), opacity .15s;
}
.av-opt img { width: 100%; height: 100%; display: block; }
.av-opt[aria-checked="true"] { opacity: 1; border-width: 0.28rem; box-shadow: 0.25rem 0.25rem 0 var(--ink); transform: translate(-2px, -2px); }
.swatches { display: grid; grid-template-columns: repeat(6, 2.75rem); justify-content: space-between; row-gap: 0.85rem; }
.swatch {
  width: 2.75rem; height: 2.75rem; padding: 0; cursor: pointer;
  background: var(--sc);
  border: var(--bw) solid var(--ink); border-radius: 50%;
}
.swatch[aria-checked="true"] { box-shadow: 0 0 0 0.2rem var(--cream), 0 0 0 0.42rem var(--ink); }
.swatch:disabled {
  cursor: not-allowed; opacity: 0.3;
  background-image: linear-gradient(135deg, transparent 45%, var(--ink) 45%, var(--ink) 55%, transparent 55%);
}

.wait-hero { margin-top: 1.2rem; }
.wait-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin-top: 0.4rem; }
.photo-ico {
  width: 5.5rem; height: 5.5rem; margin-top: 1.5rem;
  display: grid; place-items: center;
  background: var(--teal); border: 0.25rem solid var(--ink); border-radius: 50%;
  box-shadow: 0.28rem 0.28rem 0 var(--ink);
}
.photo-ico .ico { width: 2.6rem; height: 2.6rem; }
.photo-ico--sun { background: var(--sun); }
.photo-prev img { max-height: 14rem; border: var(--bw) solid var(--ink); border-radius: 1rem; }

.p-board { align-self: stretch; text-align: left; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.p-board ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.p-row {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: 0.7rem;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  padding: 0.45rem 0.8rem;
}
.p-row:first-child { background: var(--sun); }
.p-rank, .p-avg { font-family: var(--display); font-size: 1.4rem; }
.p-name { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-board h2 { font-size: 1.5rem; }
.p-awards { align-self: stretch; text-align: left; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.8rem; }
.p-awards h2 { font-size: 1.5rem; }
.p-award-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.p-award {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  padding: 0.55rem 0.8rem;
}
.p-award-dot { width: 0.9rem; height: 0.9rem; flex-shrink: 0; border-radius: 50%; background: var(--ac); border: 2px solid var(--ink); }
.p-award-text { display: flex; flex-direction: column; min-width: 0; }
.p-award-title { font-weight: 900; font-size: 0.85rem; color: var(--ink-soft); }
.p-award-win { font-family: var(--display); font-size: 1.25rem; line-height: 1.1; overflow-wrap: anywhere; }

/* Voto */
.phone--vote { gap: 1.25rem; }
.secret { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 900; font-size: 0.95rem; }
.vgame { overflow: hidden; }
.game-img--vote { border: none; border-bottom: var(--bw) solid var(--ink); border-radius: 0; aspect-ratio: 2 / 1; }
.vgame-name { display: block; font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.05; padding: 0.55rem 1rem 0.75rem; overflow-wrap: anywhere; }
.vblock { border: none; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.vlabel { font-family: var(--display); font-size: 1.5rem; padding: 0; }
.vhint { font-size: 0.88rem; font-weight: 800; color: var(--ink-soft); }
.score-badge {
  width: 4.3rem; height: 4.3rem; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--paper);
  border: 0.25rem solid var(--ink); border-radius: 50%;
  font-family: var(--display); font-size: 2.3rem;
  transition: background .2s, transform .2s var(--pop);
}
.score-badge.is-set { background: var(--sun); box-shadow: 0.22rem 0.22rem 0 var(--ink); }

.range {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2.9rem; margin: 0; background: transparent; cursor: pointer;
  touch-action: pan-y;
}
.range::-webkit-slider-runnable-track {
  height: 0.95rem;
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  background: linear-gradient(to right, var(--tomato) var(--p), var(--paper) var(--p));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 2.3rem; height: 2.3rem; margin-top: -0.87rem;
  background: var(--sun);
  border: var(--bw) solid var(--ink); border-radius: 50%;
  box-shadow: 0.15rem 0.15rem 0 var(--ink);
}
.range::-moz-range-track { height: 0.57rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; }
.range::-moz-range-progress { height: 0.57rem; background: var(--tomato); border-radius: 1rem; }
.range::-moz-range-thumb {
  width: 2.3rem; height: 2.3rem;
  background: var(--sun);
  border: var(--bw) solid var(--ink); border-radius: 50%;
  box-shadow: 0.15rem 0.15rem 0 var(--ink);
}
.range.is-untouched::-webkit-slider-thumb { background: var(--paper); }
.range.is-untouched::-moz-range-thumb { background: var(--paper); }
.range.is-untouched::-moz-range-progress { background: transparent; }
.ticks { display: flex; justify-content: space-between; padding: 0 0.7rem; font-size: 0.8rem; font-weight: 900; color: var(--ink-soft); }
.ticks span { width: 1ch; text-align: center; }

.pips-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.pip-btn {
  min-height: 3rem; cursor: pointer;
  background: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 0.8rem;
  font-family: var(--display); font-size: 1.4rem;
  transition: transform .12s var(--pop), background .12s;
}
.pip-btn.is-on { background: var(--cc); }
.pip-btn.is-picked { box-shadow: 0.2rem 0.2rem 0 var(--ink); transform: translate(-1px, -2px); }

.mvp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem 0.4rem; }
.mvp-btn {
  min-width: 0; padding: 0.2rem 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  background: none; border: none;
}
.mvp-av { position: relative; display: inline-block; padding-top: 0.8rem; }
.mvp-av .crown {
  position: absolute; z-index: 1; width: 1.9rem; left: 50%; top: -0.1rem;
  transform: translateX(-50%) rotate(-8deg) scale(0.4); opacity: 0;
  transition: opacity .2s, transform .3s var(--pop);
}
.mvp-btn .avatar { opacity: 0.75; transition: opacity .15s, box-shadow .15s; }
.mvp-btn[aria-pressed="true"] .avatar { opacity: 1; box-shadow: 0 0 0 0.2rem var(--sun), 0 0 0 0.4rem var(--ink); }
.mvp-btn[aria-pressed="true"] .crown { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); }
.mvp-n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; font-size: 0.85rem; }

.sent-badge {
  width: 6rem; height: 6rem; margin-top: 1.5rem;
  display: grid; place-items: center;
  background: var(--teal); border: 0.3rem solid var(--ink); border-radius: 50%;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  animation: badgeIn .55s var(--pop) both;
}
.sent-badge .ico { width: 3rem; height: 3rem; stroke-width: 3.2; }
.my-vote { align-self: stretch; text-align: left; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.my-vote .vgame-name { padding: 0; font-size: 1.6rem; }
.my-vote-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.my-vote-crit { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.my-vote-crit .bcrit-item { font-size: 0.85rem; }
.my-vote-mvp { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; }
.vote-progress { font-family: var(--display); font-size: 1.5rem; }

.p-reveal { align-self: stretch; overflow: hidden; text-align: left; margin-top: 0.5rem; }
.p-reveal-body { padding: 0.2rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.p-reveal .vgame-name { padding: 0.4rem 0 0; }
.p-reveal-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.p-reveal-nums > div { display: flex; flex-direction: column; gap: 0.2rem; }
.p-num { font-family: var(--display); font-weight: 400; font-size: 3.2rem; line-height: 1; }
.p-num--avg { display: inline-block; align-self: flex-start; background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.05em 0.3em; }
.p-verdict { font-family: var(--display); font-size: 1.4rem; }
.p-late { animation: riseIn .5s var(--after, 0s) both; }

/* ==========================================================================
   Home
   ========================================================================== */

.home {
  max-width: 64rem; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center; gap: 1.6rem;
  padding: max(2rem, env(safe-area-inset-top)) 1.4rem 2rem;
}
.home-lead { font-size: 1.2rem; font-weight: 800; max-width: 46ch; }
.home-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.6rem; margin-top: 0.6rem; }
.home-card {
  display: flex; flex-direction: column; gap: 0.8rem; align-items: stretch;
  padding: 1.5rem; color: var(--ink); text-decoration: none;
}
.home-card h2 { font-size: 2rem; }
.home-card .btn { align-self: flex-start; }
.home-card--tv { transform: none; }
.home-card--tv:hover .btn { transform: translate(-1px, -1px); }
.credits { font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-top: 1rem; }

/* ==========================================================================
   Animazioni
   ========================================================================== */

@keyframes slotIn {
  from { opacity: 0; transform: rotate(var(--tilt, 0deg)) scale(0.6); }
  to { opacity: 1; transform: rotate(var(--tilt, 0deg)) scale(1); }
}
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes flipIn {
  from { transform: rotateY(180deg); }
  to { transform: rotateY(0deg); }
}
@keyframes badgeIn {
  from { opacity: 0; transform: rotate(-20deg) scale(0.3); }
  to { opacity: 1; transform: rotate(6deg) scale(1); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(0.8rem) rotate(var(--tilt-end, 0deg)); }
  to { opacity: 1; transform: rotate(var(--tilt-end, 0deg)); }
}
@keyframes tumble {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(0.9); }
  100% { transform: rotate(360deg); }
}
@keyframes fall {
  to { transform: translate(var(--drift, 0), 112vh) rotate(var(--rot, 360deg)); }
}

/* ---------- Pannello giocatori (TV) ---------- */

.chip-btn { cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; font: inherit; font-weight: 900; }
.chip-btn:hover { background: var(--sun); }
.chip-btn .ico { width: 1.1em; height: 1.1em; }

.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 2rem;
  background: rgba(31, 26, 61, 0.45);
  animation: fadeIn .18s ease both;
}
.panel {
  width: min(46rem, 100%); max-height: calc(100vh - 4rem); max-height: calc(100dvh - 4rem);
  overflow: auto; padding: 1.6rem 1.8rem;
  display: flex; flex-direction: column; gap: 1.1rem;
  animation: panelIn .28s var(--pop) both;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-head h2 { font-size: 2.4rem; }
.panel-join {
  display: flex; align-items: center; gap: 1.4rem;
  background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 1.1rem;
  padding: 1rem 1.2rem;
}
.qr--panel { width: 9.5rem; flex-shrink: 0; }
.panel-join-text { display: flex; flex-direction: column; gap: 0.6rem; font-size: 1.05rem; }
.panel-strong { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.code-chip--sm { font-size: 1.1rem; }
.seat-row { display: flex; align-items: center; gap: 1rem; }
.seat-row .field-label { margin: 0; }
.panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.panel-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.9rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  padding: 0.5rem 0.7rem;
}
.panel-row.is-away { background: transparent; border-style: dashed; }
.panel-row.is-away .avatar { filter: grayscale(1); opacity: 0.55; }
.panel-name { font-family: var(--display); font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-status { font-weight: 900; font-size: 0.95rem; color: var(--ink-soft); }

.ph-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; }
.wait-hero--away .avatar { filter: grayscale(1); opacity: 0.6; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(1rem) scale(0.96); } to { opacity: 1; transform: none; } }

/* ---------- Gruppo (creazione stanza) ---------- */

.group-field { align-self: stretch; display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.group-field .field-label { margin: 0; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F1A3D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; background-size: 1.2rem;
}
.code-input--6 { font-size: 1.8rem; letter-spacing: 0.18em; }
.create-card .group-field + .form-error { min-height: 0; }

.brand-wrap { display: flex; align-items: baseline; gap: 0.9rem; min-width: 0; }
.topbar-group { font-weight: 900; font-size: 1.05rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }
.chip-lg { font-family: var(--display); font-weight: 400; font-size: 1.5rem; padding: 0.15em 0.8em; }
.lead-line { font-size: 1.3rem; font-weight: 800; }
.inline-link { background: none; border: none; padding: 0; font: inherit; font-weight: 900; text-decoration: underline; cursor: pointer; color: inherit; }

/* ---------- Ludoteca: pannello TV ---------- */

.panel--wide { width: min(64rem, 100%); }
.panel-note { font-size: 1.05rem; }
.lib-add { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; }
.lib-add-img {
  width: 3.4rem; height: 3.4rem; padding: 0; cursor: pointer; overflow: hidden;
  display: grid; place-items: center;
  background: var(--cream); border: var(--bw) dashed var(--ink); border-radius: 0.8rem;
}
.lib-add-img .ico { width: 1.6rem; height: 1.6rem; }
.lib-add-img.has-img { border-style: solid; }
.lib-add-img img { width: 100%; height: 100%; object-fit: cover; }
.lib-grid {
  list-style: none; margin: 0; padding: 0.3rem 0.3rem 0.5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 1rem;
}
.lib-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  padding: 0.55rem;
}
.lib-tile.is-played { background: var(--cream); }
.lib-tile.is-played .game-img { opacity: 0.55; }
.game-img--lib { width: 100%; aspect-ratio: 4 / 3; border-width: var(--bw); border-radius: 0.7rem; }
.game-img--lib span { font-size: 1.6rem; }
.lib-name { font-family: var(--display); font-size: 1.25rem; line-height: 1.05; overflow-wrap: anywhere; }
.lib-meta { font-size: 0.85rem; font-weight: 900; color: var(--ink-soft); min-height: 1.1em; }
.lib-del {
  position: absolute; top: -0.7rem; right: -0.7rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--ink);
  opacity: 0; transition: opacity .15s;
}
.lib-tile:hover .lib-del, .lib-del:focus-visible { opacity: 1; }
.lib-empty { grid-column: 1 / -1; font-weight: 800; color: var(--ink-soft); padding: 1rem 0; }

/* ---------- Ludoteca: riga di scelta nella schermata "Prossimo gioco" ---------- */

.lib-pick { display: flex; flex-direction: column; gap: 0.45rem; }
.lib-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.lib-pick-head .field-label { margin: 0; }
.lib-chips { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.2rem 0.35rem 0.55rem 0.1rem; scrollbar-width: thin; }
.lib-chip {
  flex-shrink: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
  padding: 0.3rem 0.8rem 0.3rem 0.3rem;
  font-family: var(--display); font-size: 1.15rem; white-space: nowrap;
}
.lib-chip[aria-pressed="true"] { background: var(--sun); }
.lib-chip.is-played { opacity: 0.55; box-shadow: none; }
.game-img--chip { width: 2.4rem; aspect-ratio: 1; border-width: 0.15rem; border-radius: 0.5rem; }
.game-img--chip span { font-size: 0.85rem; border-width: 0.1rem; border-radius: 0.3rem; padding: 0.05em 0.25em; }
.lib-hint { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; color: var(--ink-soft); }
.lib-hint .ico { width: 1.5rem; height: 1.5rem; }
.next-card.has-lib .dropzone { height: 8.2rem; }
.next-card.has-lib h1 { font-size: 2.6rem; }

/* ---------- Cosa giochiamo adesso? ---------- */

.poll { display: flex; flex-direction: column; gap: 1.3rem; }
.poll-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.poll-head h1 { font-size: 3.6rem; }
.poll-grid {
  flex: 1; min-height: 0; overflow: auto;
  display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  align-content: start; gap: 1.3rem; padding: 0.3rem 0.6rem 0.6rem 0.2rem;
}
.poll-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1.2rem;
  box-shadow: 0.35rem 0.35rem 0 var(--ink);
  padding: 0.8rem;
  transition: transform .3s var(--pop), background .2s;
}
.poll-card.is-lead { background: var(--sun); transform: rotate(-1.5deg) scale(1.02); }
.game-img--poll { width: 100%; aspect-ratio: 16 / 9; border-width: var(--bw); border-radius: 0.8rem; }
.poll-grid--dense .game-img--poll { aspect-ratio: 5 / 2; }
.poll-info { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.poll-name { font-family: var(--display); font-weight: 400; font-size: 1.6rem; line-height: 1.05; overflow-wrap: anywhere; }
.poll-votes {
  flex-shrink: 0; min-width: 2.8rem; text-align: center;
  font-family: var(--display); font-size: 2rem; line-height: 1.3;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px;
}
.poll-bar { display: block; height: 0.6rem; border-radius: 1rem; background: rgba(31, 26, 61, 0.14); overflow: hidden; }
.poll-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .4s var(--pop); }
.poll-actions { display: flex; justify-content: flex-end; gap: 1rem; }
.poll-win { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 4rem; padding: 0 2rem; }
.poll-win-art { animation: slotIn .6s var(--pop) both; }
.game-img--win { width: 100%; box-shadow: 0.6rem 0.6rem 0 var(--ink); }
.game-img--win span { font-size: 5rem; }
.poll-win-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; }
.win-title { font-size: 5rem; line-height: 0.95; overflow-wrap: anywhere; }

/* ---------- Premiazione in due tempi ---------- */

.awards.stage-podium .prizes { display: none; }
.awards.stage-podium .podium {
  flex: 1; min-height: 0;
  grid-template-columns: repeat(3, 17rem); gap: 2.2rem;
  border-bottom: 0.35rem solid var(--ink); margin: 0 6rem;
}
.stage-podium .game-img--pod { width: 11rem; }
.stage-podium .pod--1 .game-img--pod { width: 13rem; }
.stage-podium .pod-name { font-size: 1.9rem; }
.stage-podium .pod-avg { font-size: 2.2rem; }
.stage-podium .pod-base { font-size: 4.4rem; }
.stage-podium .pod--1 .pod-base { height: 11rem; }
.stage-podium .pod--2 .pod-base { height: 8rem; }
.stage-podium .pod--3 .pod-base { height: 5.5rem; }
.awards.stage-prizes .podium { display: none; }
.prizes { display: flex; flex-direction: column; gap: 1.1rem; }
.prize-row { display: flex; flex-direction: column; gap: 0.6rem; }
.prize-title { font-size: 1.8rem; }
.award-people { gap: 0.4rem; justify-content: center; }
.award .person { display: inline-block; padding-top: 0.9rem; }

/* ---------- Classifica di sempre ---------- */

.alltime { display: flex; flex-direction: column; gap: 1.2rem; }
.alltime-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.alltime-head h1 { font-size: 3.6rem; }
.alltime-head .muted { font-size: 1.2rem; margin-top: 0.3rem; }
.alltime-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 2rem; align-items: start; }
.alltime-main { min-width: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.brow--at { grid-template-columns: 3.4rem 4.6rem minmax(0, 1fr) 6.2rem; }
.bsub { display: block; font-size: 1rem; font-weight: 900; color: var(--ink-soft); margin-top: 0.3rem; }
.alltime-side { padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.8rem; }
.alltime-side h2 { font-size: 1.8rem; }
.at-list { list-style: none; margin: 0 0 0.4rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.at-row { display: flex; align-items: center; gap: 0.7rem; }
.at-pos { font-family: var(--display); font-size: 1.5rem; width: 1.4rem; text-align: center; }
.at-name { flex: 1; min-width: 0; font-family: var(--display); font-size: 1.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-val { font-weight: 900; font-size: 1rem; white-space: nowrap; }

/* ---------- Telefono: ludoteca, scelta del gioco, condivisione ---------- */

.ph-addgame { margin-top: 0.6rem; }
.field--stack { flex: none; }
.photo-btn { align-self: flex-start; cursor: pointer; }
.lib-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.lib-mini li { display: flex; align-items: center; gap: 0.7rem; font-weight: 900; }
.lib-mini .game-img--mini { width: 2.6rem; }
.poll-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.poll-opt {
  position: relative; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 0.45rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.22rem 0.22rem 0 var(--ink);
  padding: 0.5rem;
  transition: transform .15s var(--pop);
}
.poll-opt[aria-checked="true"] { background: var(--sun); transform: translate(-2px, -2px); box-shadow: 0.35rem 0.35rem 0 var(--ink); }
.game-img--opt { width: 100%; aspect-ratio: 4 / 3; border-width: 0.16rem; border-radius: 0.7rem; }
.game-img--opt span { font-size: 1.4rem; }
.poll-opt-name { font-family: var(--display); font-size: 1.2rem; line-height: 1.05; overflow-wrap: anywhere; }
.poll-opt-check {
  position: absolute; top: -0.6rem; right: -0.6rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal); border: var(--bw) solid var(--ink);
}
.p-win { align-self: stretch; overflow: hidden; }
.p-at-mvp { display: flex; align-items: center; gap: 0.5rem; justify-content: center; font-weight: 800; margin-top: 0.5rem; }
.p-at-mvp .crown { width: 1.6rem; }

/* ---------- Chi ha vinto ---------- */

.photo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.8rem; align-items: stretch; }
.photo-row .dropzone { height: 7rem; }
.photo-row .img-actions { flex-direction: column; flex-wrap: nowrap; justify-content: space-between; gap: 0.35rem; }
.photo-row .img-actions .btn-sec { font-size: 0.9rem; padding: 0.35em 0.75em; }
.next-card.has-lib .photo-row .dropzone { height: 7rem; }
.next-card.has-lib .photo-label { display: none; }
.next-card { gap: 0.6rem; }
.vote-note { font-weight: 900; font-size: 1.05rem; color: var(--ink-soft); min-height: 1.3em; }
.win-pick { display: flex; flex-direction: column; gap: 0.4rem; }
.win-pick .field-label { margin: 0; }
.win-avs { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.8rem 0.3rem 0.3rem 0.1rem; }
.win-av {
  position: relative; flex-shrink: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  width: 4.2rem; padding: 0.25rem 0.2rem 0.3rem;
  background: transparent; border: var(--bw) solid transparent; border-radius: 0.9rem;
  font-weight: 900; font-size: 0.85rem;
}
.win-av span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-av .avatar { opacity: 0.55; filter: grayscale(0.6); transition: opacity .15s, filter .15s; }
.win-av[aria-pressed="true"] { background: var(--sun); border-color: var(--ink); box-shadow: 0.2rem 0.2rem 0 var(--ink); }
.win-av[aria-pressed="true"] .avatar { opacity: 1; filter: none; }
.win-av .crown { position: absolute; top: -0.85rem; left: 50%; width: 1.7rem; transform: translateX(-50%); z-index: 1; }
.win-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start;
  font-family: var(--display); font-size: 1.5rem;
  background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); padding: 0.25rem 0.9rem;
}
.p-win-line { display: flex; align-items: center; gap: 0.45rem; font-weight: 900; margin-top: 0.3rem; }

/* ---------- Chi è connesso ---------- */

.offline-badge, .voter-badge--off {
  display: grid; place-items: center;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 50%;
}
.offline-badge { position: absolute; top: -0.8rem; left: -0.8rem; width: 2.3rem; height: 2.3rem; z-index: 1; }
.offline-badge .ico, .voter-badge--off .ico { width: 1.2rem; height: 1.2rem; }
.voter.is-offline .voter-name { text-decoration: line-through; color: var(--ink-soft); }
.voter-badge.voter-badge--off { background: var(--paper); }
.panel-status.is-offline { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--error); }
.net-banner {
  position: fixed; z-index: 80; left: 0; right: 0; top: max(0.8rem, env(safe-area-inset-top));
  margin: 0 auto; width: min(30rem, calc(100% - 1.6rem));
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink); color: var(--cream);
  border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--tomato);
  padding: 0.75rem 1rem; font-weight: 900;
  animation: panelIn .25s var(--pop) both;
}
.net-banner .ico { width: 1.6rem; height: 1.6rem; color: var(--sun); }

/* ---------- Ludoteca: giocatori e durata ---------- */

.lib-add { grid-template-columns: auto minmax(0, 1fr) auto; }
.lib-add-more { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.lib-add-more .field-label { margin: 0 0.2rem 0 0; }
.select--sm { width: auto; min-height: var(--ctl-h-sm); padding-top: 0.3rem; padding-bottom: 0.3rem; font-size: 1rem; }
.lib-info { font-size: 0.85rem; font-weight: 900; min-height: 1.1em; }
.lib-edit {
  position: absolute; top: -0.7rem; left: -0.7rem;
  width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--sun); border: var(--bw) solid var(--ink);
  opacity: 0; transition: opacity .15s;
}
.lib-edit .ico { width: 1.1rem; height: 1.1rem; }
.lib-tile:hover .lib-edit, .lib-edit:focus-visible { opacity: 1; }
.lib-chip.is-unfit { opacity: 0.45; border-style: dashed; box-shadow: none; }
.poll-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.poll-meta { font-weight: 900; font-size: 0.95rem; color: var(--ink-soft); }
.poll-card.is-lead .poll-meta { color: var(--ink); }
.poll-excluded { font-size: 1rem; margin-top: 0.3rem; min-height: 1.2em; }
.ag-info { display: flex; flex-direction: column; gap: 0.5rem; }
.ag-info .field-label { margin: 0; }
.ag-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.lib-mini-text { display: flex; flex-direction: column; min-width: 0; }
.lib-mini-text small { font-weight: 800; color: var(--ink-soft); }
.poll-opt-meta { font-size: 0.8rem; font-weight: 900; color: var(--ink-soft); }
.poll-opt[aria-checked="true"] .poll-opt-meta { color: var(--ink); }

/* ---------- Rientro dopo un crash ---------- */

.reclaim { align-self: stretch; text-align: left; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.6rem; background: #FFF9EC; }
.reclaim h2 { font-size: 1.5rem; }
.reclaim .muted { font-size: 0.9rem; }
.reclaim-list { display: flex; flex-direction: column; gap: 0.5rem; }
.reclaim-btn {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.7rem;
  width: 100%; cursor: pointer; text-align: left;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink); padding: 0.4rem 0.7rem;
  font-family: var(--display); font-size: 1.2rem;
}
.reclaim-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reclaim-btn b { font-family: var(--body); font-weight: 900; font-size: 0.9rem; background: var(--sun); border: 0.15rem solid var(--ink); border-radius: 999px; padding: 0.1rem 0.6rem; }
.panel--claim { width: min(44rem, 100%); }
.claim-head { display: flex; align-items: center; gap: 1.3rem; }
.claim-head h2 { font-size: 2.4rem; }
.claim-warn { display: flex; align-items: center; gap: 0.6rem; font-weight: 900; color: var(--error); }
.claim-actions { display: flex; justify-content: flex-end; gap: 1rem; }
.vote-note p { margin: 0.2rem 0; }
.vote-wait { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; color: var(--ink); }
.vote-wait .ico { color: var(--error); }

/* ==========================================================================
   Versione 2: ripresa, regia, profili, app installabile
   ========================================================================== */

.upd-banner {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: max(0.8rem, env(safe-area-inset-bottom));
  margin: 0 auto; width: min(30rem, calc(100% - 1.6rem));
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink); padding: 0.6rem 0.8rem; font-weight: 900;
}

/* ---------- TV: riprendi una serata ---------- */

.code-input--8 { font-size: 1.7rem; letter-spacing: 0.12em; }
.resume-fields { display: grid; grid-template-columns: 1fr 1.6fr; gap: 0.8rem; align-self: stretch; text-align: left; }
.resume-fields .field-label { margin: 0 0 0.3rem; display: block; }
.recent-rooms { align-self: stretch; display: flex; flex-direction: column; gap: 0.45rem; text-align: left; }
.recent-room {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.7rem;
  background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem;
  padding: 0.45rem 0.7rem; cursor: pointer; font-weight: 800; text-align: left;
}
.recent-room b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-room:hover { background: var(--sun); }
.regia-line { font-weight: 800; font-size: 0.95rem; color: var(--ink-soft); }
.regia-line b { color: var(--ink); letter-spacing: 0.06em; }

/* ---------- TV: voto veloce, oracolo, riapri, voto per conto di ---------- */

.win-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.quick-toggle { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 900; font-size: 0.95rem; cursor: pointer; white-space: normal; text-align: left; }
.quick-toggle input { width: 1.2rem; height: 1.2rem; accent-color: var(--tomato); }
/* 1.11: caselle delle impostazioni comode da toccare (almeno 44 px di altezza) */
.sheet .quick-toggle, .ph-card .quick-toggle, .a11y-box .quick-toggle { min-height: 2.75rem; }
.oracle-chip {
  display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start;
  font-weight: 900; font-size: 1.05rem;
  background: #CFF3FA; border: var(--bw) solid var(--ink); border-radius: 0.9rem; padding: 0.25rem 0.8rem;
}
.crit-row--quick { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.quick-note {
  display: grid; place-items: center; text-align: center; font-weight: 900; color: var(--ink-soft);
  border: var(--bw) dashed var(--ink); border-radius: 1rem; padding: 0.8rem;
}
.brow { position: relative; }
.brow-reopen {
  position: absolute; right: 0.8rem; top: -0.9rem;
  font-weight: 900; font-size: 0.85rem; cursor: pointer;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0.15rem 0.7rem;
  opacity: 0; transition: opacity .15s;
}
.brow:hover .brow-reopen, .brow-reopen:focus-visible { opacity: 1; }
button.voter-btn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
button.voter-btn:hover .avatar { opacity: 0.8; filter: grayscale(0.3); }
.panel--proxy { width: min(46rem, 100%); }
.pv-row { display: flex; flex-direction: column; gap: 0.4rem; }
.pv-row .field-label { margin: 0; }
.pv-btns { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.45rem; }
.pv-btns--10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.pv-btn {
  min-height: 2.6rem; cursor: pointer;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.7rem;
  font-family: var(--display); font-size: 1.3rem;
}
.pv-btn[aria-pressed="true"] { background: var(--cc, var(--sun)); box-shadow: 0.2rem 0.2rem 0 var(--ink); }
.pv-mvp { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pv-av { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.7rem 0.25rem 0.3rem; font-family: var(--body); font-weight: 900; font-size: 1rem; }

/* ---------- Telefono: schermata iniziale, profilo, installazione ---------- */

.ph-card { align-self: stretch; padding: 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.ph-card h2 { font-size: 1.5rem; }
.ph-card .btn-sec { align-self: flex-start; }
.home-nights { display: flex; flex-direction: column; gap: 1rem; }
.home-night { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; background: #FFF9EC; }
.home-me { display: flex; align-items: center; gap: 0.9rem; text-align: left; }
.home-me > div { display: flex; flex-direction: column; min-width: 0; }
.home-name { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.1; }
.home-night .btn { text-decoration: none; justify-content: center; }
.install-card { align-self: stretch; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; text-align: left; background: #E7F9F7; }
.install-card h2 { font-size: 1.4rem; }
.install-card .btn-sec { align-self: flex-start; }
.profile-join { align-self: stretch; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; background: #FFF9EC; }
.profile-code { align-self: stretch; text-align: left; font-weight: 800; }
.profile-code summary { cursor: pointer; text-decoration: underline; }
.profile-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; margin-top: 0.5rem; align-items: center; }
.new-code {
  align-self: stretch; text-align: left; font-weight: 800;
  background: var(--sun); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); padding: 0.75rem 0.9rem;
}
.new-code b { letter-spacing: 0.08em; }
.profile-head { display: flex; align-items: center; gap: 1rem; }
.profile-code-line { font-weight: 900; margin-top: 0.3rem; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin: 0; }
.stats-grid div { background: var(--cream); border: 0.15rem solid var(--ink); border-radius: 0.8rem; padding: 0.45rem 0.6rem; }
.stats-grid dt { font-size: 0.8rem; font-weight: 900; color: var(--ink-soft); }
.stats-grid dd { margin: 0; font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.stats-line { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; }

/* ---------- Telefono: regia ---------- */

.regia-fab {
  position: fixed; z-index: 70; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  background: var(--ink); color: var(--cream);
  border: var(--bw) solid var(--ink); border-radius: 999px;
  box-shadow: 0.25rem 0.25rem 0 var(--tomato);
  padding: 0.7rem 1.1rem; font-family: var(--display); font-size: 1.2rem;
}
.regia-fab .ico { color: var(--sun); }
.overlay--sheet { place-items: end center; padding: 0.8rem; z-index: 75; }
.phone .code-input--8, .sheet .code-input--8 { font-size: 1.25rem; letter-spacing: 0.06em; }
.sheet {
  width: min(32rem, 100%); max-height: 85vh; max-height: 85dvh; overflow: auto;
  padding: 1rem 1.1rem max(1.1rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 0.8rem;
}
/* 1.11: i figli della finestra non si schiacciano. Senza questa riga, quando il contenuto supera l'altezza
   (telefoni), il flex ridimensionava i selettori con overflow nascosto (Lingua, Tema) fino a 2 px: invisibili e non toccabili. */
.sheet > * { flex-shrink: 0; }
.sheet .panel-head h2 { font-size: 1.8rem; }
#rgBody { display: flex; flex-direction: column; gap: 0.7rem; }
#rgBody .field-label { margin: 0; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.rg-chips .lib-chip { padding: 0.3rem 0.75rem; font-size: 1rem; }
.rg-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rg-missing { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; font-weight: 800; }

/* ---------- Telefono: voto veloce e previsione ---------- */

.quick-badge { align-self: flex-start; font-weight: 900; background: #CFF3FA; border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0.2rem 0.8rem; }
.guess-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; }
.score-badge--sm { width: 3.4rem; height: 3.4rem; font-size: 1.6rem; }
.guess-block .link-btn { align-self: flex-start; }
.my-vote-guess { font-weight: 800; margin-top: 0.4rem; }
.p-guess { font-weight: 900; margin-top: 0.3rem; }

/* ==========================================================================
   Tema notte (generato dalle regole del tema giorno: fondi scuri, testo chiaro,
   testo scuro sui colori accesi, pulsanti scuri che diventano chiari)
   ========================================================================== */

html[data-theme="night"] {
  --cream: #15112B;
  --paper: #241D47;
  --ink: #05040C;
  --ink-soft: #C3B9E6;
  --fg: #F4ECDC;
  --night-fill: #F4ECDC;
  --error: #FF8A80;
  color-scheme: dark;
}
html[data-theme="night"] body { color: var(--fg); background-image: radial-gradient(rgba(244, 236, 220, 0.07) 1.5px, transparent 1.5px); }
html[data-theme="night"] .input { color: var(--fg); }
html[data-theme="night"] .input::placeholder { color: rgba(244, 236, 220, 0.45); }
html[data-theme="night"] .avatar { border-color: #05040C; }
html[data-theme="night"] .game-img { background-color: #2E2757; }
html[data-theme="night"] body { color: var(--fg); }
html[data-theme="night"] .logo-tag { color: #1F1A3D; }
html[data-theme="night"] .btn { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .btn-sec { color: var(--fg); }
html[data-theme="night"] .btn-sec[aria-pressed="true"], html[data-theme="night"] .btn-sec[aria-expanded="true"] { color: #1F1A3D; }
html[data-theme="night"] .input { color: var(--fg); }
html[data-theme="night"] .chip--tomato { color: #1F1A3D; }
html[data-theme="night"] .avatar { color: #1F1A3D; }
html[data-theme="night"] .toast { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .loading-die { color: #1F1A3D; }
html[data-theme="night"] .step-btn { color: #1F1A3D; }
html[data-theme="night"] .code-chip { color: #1F1A3D; }
html[data-theme="night"] .dropzone.is-over { color: #1F1A3D; }
html[data-theme="night"] .mini-row:first-child { color: #1F1A3D; }
html[data-theme="night"] .voter-badge { color: #1F1A3D; }
html[data-theme="night"] .vote-count.is-done { color: #1F1A3D; }
html[data-theme="night"] .avg-badge { color: #1F1A3D; }
html[data-theme="night"] .verdict-chip { color: #1F1A3D; }
html[data-theme="night"] .vcard-back { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .vcard-back span { color: var(--fg); }
html[data-theme="night"] .vcard-front.is-top { color: #1F1A3D; }
html[data-theme="night"] .pips i.on { color: #1F1A3D; }
html[data-theme="night"] .mvp-tile { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .brow--r1 { color: #1F1A3D; }
html[data-theme="night"] .brow--r2 { color: #1F1A3D; }
html[data-theme="night"] .brow--r3 { color: #1F1A3D; }
html[data-theme="night"] .bbar i { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .bcrit-item { color: #1F1A3D; }
html[data-theme="night"] .pod--1 .pod-base { color: #1F1A3D; }
html[data-theme="night"] .pod--2 .pod-base { color: #1F1A3D; }
html[data-theme="night"] .pod--3 .pod-base { color: #1F1A3D; }
html[data-theme="night"] .award-back { color: #1F1A3D; }
html[data-theme="night"] .award-front h3 { color: #1F1A3D; }
html[data-theme="night"] .av-opt { color: #1F1A3D; }
html[data-theme="night"] .photo-ico { color: #1F1A3D; }
html[data-theme="night"] .photo-ico--sun { color: #1F1A3D; }
html[data-theme="night"] .p-row:first-child { color: #1F1A3D; }
html[data-theme="night"] .p-award-dot { color: #1F1A3D; }
html[data-theme="night"] .score-badge.is-set { color: #1F1A3D; }
html[data-theme="night"] .range::-webkit-slider-runnable-track { color: #1F1A3D; }
html[data-theme="night"] .range::-webkit-slider-thumb { color: #1F1A3D; }
html[data-theme="night"] .range::-moz-range-progress { color: #1F1A3D; }
html[data-theme="night"] .range::-moz-range-thumb { color: #1F1A3D; }
html[data-theme="night"] .pip-btn.is-on { color: #1F1A3D; }
html[data-theme="night"] .sent-badge { color: #1F1A3D; }
html[data-theme="night"] .p-num--avg { color: #1F1A3D; }
html[data-theme="night"] .home-card { color: var(--fg); }
html[data-theme="night"] .chip-btn:hover { color: #1F1A3D; }
html[data-theme="night"] .lib-chip[aria-pressed="true"] { color: #1F1A3D; }
html[data-theme="night"] .poll-card.is-lead { color: #1F1A3D; }
html[data-theme="night"] .poll-bar i { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .poll-opt[aria-checked="true"] { color: #1F1A3D; }
html[data-theme="night"] .poll-opt-check { color: #1F1A3D; }
html[data-theme="night"] .win-av[aria-pressed="true"] { color: #1F1A3D; }
html[data-theme="night"] .win-chip { color: #1F1A3D; }
html[data-theme="night"] .net-banner { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .lib-edit { color: #1F1A3D; }
html[data-theme="night"] .poll-card.is-lead .poll-meta { color: var(--fg); }
html[data-theme="night"] .poll-opt[aria-checked="true"] .poll-opt-meta { color: var(--fg); }
html[data-theme="night"] .reclaim { color: #1F1A3D; }
html[data-theme="night"] .reclaim-btn b { color: #1F1A3D; }
html[data-theme="night"] .vote-wait { color: var(--fg); }
html[data-theme="night"] .upd-banner { color: #1F1A3D; }
html[data-theme="night"] .recent-room:hover { color: #1F1A3D; }
html[data-theme="night"] .regia-line b { color: var(--fg); }
html[data-theme="night"] .oracle-chip { color: #1F1A3D; }
html[data-theme="night"] .pv-btn[aria-pressed="true"] { color: #1F1A3D; }
html[data-theme="night"] .home-night { color: #1F1A3D; }
html[data-theme="night"] .install-card { color: #1F1A3D; }
html[data-theme="night"] .profile-join { color: #1F1A3D; }
html[data-theme="night"] .new-code { color: #1F1A3D; }
html[data-theme="night"] .regia-fab { background: var(--night-fill); color: #1F1A3D; }
html[data-theme="night"] .quick-badge { color: #1F1A3D; }

/* ==========================================================================
   pausa, strumenti, trofei, editor del personaggio, statistiche
   ========================================================================== */

html.save-power *, html.save-power *::before, html.save-power *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }

.pause-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(21, 17, 43, 0.82); padding: 2rem;
}
.pause-box {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem;
  background: var(--sun); color: #1F1A3D; border: 0.3rem solid #05040C; border-radius: 2rem;
  box-shadow: 0.6rem 0.6rem 0 #05040C; padding: 2.5rem 3.5rem; max-width: 46rem;
}
.pause-kicker { font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.pause-title { font-family: var(--display); font-weight: 400; font-size: 7rem; line-height: 0.9; }
.pause-box .muted { color: #3A3456; }

.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tools-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
/* 2.4: Azioni in cima agli Strumenti (spostate dalla barra in alto), divise per categoria */
.tool-acts { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.tool-acts > h3, .tools-more { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 0; }
.tools-more { margin: 0.2rem 0 0.6rem; }
.acts-grid { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.acts-cat { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0.9rem; border-radius: 1rem; background: var(--cream); border: var(--bw) solid var(--ink); }
.acts-cat h4 { margin: 0; font-size: 1rem; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.acts-cat > .btn-sec { justify-content: flex-start; text-decoration: none; }
.acts-cat--wide { grid-column: 1 / -1; }
.btn-sec--danger { border-color: var(--tomato); color: var(--tomato); }
html.theme-show .btn-sec--danger, html[data-theme="night"] .btn-sec--danger { color: #FF8A7A; }
.acts-cat .lobby-prefs { gap: 0.5rem; }
.acts-cat .lobby-toggles, .acts-cat .lobby-items-grid { display: grid; gap: 0.3rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.acts-cat .lobby-toggles .quick-toggle span { display: flex; flex-direction: column; white-space: normal; }
.acts-cat .lobby-items { border: var(--bw) dashed color-mix(in srgb, var(--ink-soft) 40%, transparent); border-radius: 0.8rem; padding: 0.4rem 0.8rem 0.6rem; margin: 0; }
.acts-cat .lobby-items:disabled { opacity: 0.55; }
.acts-cat .seg--wide, .show-ready .seg--wide { display: flex; width: 100%; }
.acts-cat .seg--wide > button, .show-ready .seg--wide > button { flex: 1 1 0; }
.tool { display: flex; flex-direction: column; gap: 0.55rem; align-items: flex-start; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.9rem 1rem; }
.tool h3 { font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.tool a.btn-sec { text-decoration: none; }
.trash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; align-self: stretch; }
.trash-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.trash-list [aria-pressed="true"] { background: var(--tomato); }
.seg { display: inline-flex; border: var(--bw) solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg button { border: none; background: transparent; padding: 0.45rem 0.9rem; font: inherit; font-weight: 900; cursor: pointer; color: inherit; min-height: var(--ctl-h-sm); }
.seg button + button { border-left: var(--bw) solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
/* 1.11: sui telefoni stretti i selettori vanno a capo invece di tagliare l'ultima scelta ("Automatico" a 360 px) */
.seg { max-width: 100%; flex-wrap: wrap; }
.seg button { flex: 1 1 auto; }
.sheet .seg, .ph-card .seg, .tool .seg { border-radius: 1rem; }
.undo-toast {
  position: fixed; z-index: 95; left: 0; right: 0; bottom: max(1rem, env(safe-area-inset-bottom));
  margin: 0 auto; width: min(32rem, calc(100% - 1.6rem));
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  background: var(--paper); color: inherit; border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink); padding: 0.6rem 0.8rem; font-weight: 900;
  animation: panelIn .25s var(--pop) both;
}

.slot-av { position: relative; display: inline-block; }
.trophy { position: absolute; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: var(--bw) solid var(--ink); }
.trophy .ico, .trophy svg { width: 1.3rem; height: 1.3rem; }
.trophy--crown { top: -0.9rem; left: 50%; transform: translateX(-50%); background: var(--sun); color: #1F1A3D; }
.trophy--star { bottom: -0.3rem; right: -0.4rem; background: var(--violet); color: #fff; }
.panel-title { font-family: var(--body); font-weight: 900; font-size: 0.8rem; color: var(--ink-soft); }

.brow-tools { position: absolute; right: 0.8rem; top: -0.9rem; display: flex; gap: 0.4rem; opacity: 0; transition: opacity .15s; }
.brow-tools .brow-reopen { position: static; opacity: 1; }
.brow:hover .brow-tools, .brow-tools:focus-within { opacity: 1; }
.poll-fresh { font-weight: 900; font-size: 0.85rem; color: var(--violet); }
.eg-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: end; }

.stats-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.stat-card { padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.stat-card h2 { font-size: 1.6rem; }
.stat-card--wide { grid-row: span 2; }
.trend { width: 100%; height: auto; }
.trend-grid { stroke: var(--ink-soft); stroke-opacity: 0.25; stroke-width: 1; }
.trend-axis { font: 800 13px var(--body); fill: var(--ink-soft); }
.trend-line { fill: none; stroke: var(--tomato); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.trend-dot { fill: var(--sun); stroke: var(--ink); stroke-width: 3; }
.trend-val { font: 400 17px var(--display); fill: currentColor; }

.av-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.av-tools label.btn-sec { cursor: pointer; }
.av-editor { display: flex; flex-direction: column; gap: 0.5rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.7rem 0.8rem; }
.ed-row { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); align-items: center; gap: 0.6rem; }
.ed-label { font-weight: 900; font-size: 0.9rem; }
.ed-ctrl { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; align-items: center; gap: 0.4rem; }
.ed-btn { height: 2.75rem; cursor: pointer; font-family: var(--display); font-size: 1.6rem; line-height: 1; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.7rem; color: inherit; }
.ed-val { text-align: center; font-weight: 900; font-size: 0.9rem; }
.ed-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ed-sw { width: 2rem; height: 2rem; border-radius: 50%; border: var(--bw) solid var(--ink); background: var(--c); cursor: pointer; }
.ed-sw[aria-pressed="true"] { box-shadow: 0 0 0 0.18rem var(--cream), 0 0 0 0.36rem var(--ink); }
.avatar--photo img { object-fit: cover; }

.selftest { gap: 1rem; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.check { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.7rem; align-items: start; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem; padding: 0.6rem 0.8rem; }
.check-ico { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; border: var(--bw) solid var(--ink); font-weight: 900; }
.check.is-ok .check-ico { background: var(--teal); color: #1F1A3D; }
.check.is-fail .check-ico { background: var(--tomato); color: #1F1A3D; }
.check p { margin-top: 0.2rem; font-size: 0.9rem; }
.summary-ok { background: #E7F9F7; color: #1F1A3D; }
.summary-fail { background: #FFE3E0; color: #1F1A3D; }
.home-foot { text-align: center; font-weight: 800; margin-top: 1rem; }
.tv-banner a { color: var(--sun); font-weight: 900; }

/* ==========================================================================
   giocatori e spettatori, timer, consigli, Chaos, progressione
   ========================================================================== */

.chip--clock { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 900; }
.chip--clock .ico { width: 1em; height: 1em; }

/* Chi ha giocato, chi ha vinto, chi guardava */
.win-av { width: 4.6rem; }
.win-state { font-size: 0.7rem; font-weight: 900; color: var(--ink-soft); }
.win-av--player .avatar { opacity: 1; filter: none; }
.win-av--spectator { border-color: var(--ink); border-style: dashed; }
.win-av--spectator .avatar { opacity: 0.35; filter: grayscale(1); }
.win-av--winner .win-state { color: #1F1A3D; }
.ov-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.8rem; align-items: stretch; }
.ov-row .btn-sec { white-space: nowrap; }
.play-timer { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.35rem 0.8rem; }
.play-timer b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.best-pick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; cursor: pointer; text-align: left; width: 100%;
  background: #FFF3C4; color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 0.9rem; padding: 0.4rem 0.8rem; font-weight: 800;
}
.best-pick small { color: #4A4468; font-weight: 800; }

/* Reveal: pubblico, commenti, consenso */
.aud-chip { align-self: flex-start; font-weight: 800; font-size: 1rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.2rem 0.75rem; }
.vcard.is-audience .vcard-front { border-style: dashed; background: var(--cream); }
.vcard.is-audience .vcard-num { opacity: 0.75; }
.vcard-quote { font-size: 0.8rem; font-weight: 800; font-style: italic; text-align: center; line-height: 1.15; max-height: 2.4em; overflow: hidden; color: var(--ink-soft); }
.voter-aud { display: block; text-align: center; font-weight: 900; font-size: 0.75rem; color: var(--ink-soft); }

/* Livelli e traguardi */
.lv-badge { font-family: var(--body); font-weight: 900; font-size: 0.7em; background: var(--violet); color: #fff; border-radius: 999px; padding: 0.05em 0.5em; vertical-align: middle; }
.xp-bar { display: block; height: 0.65rem; border-radius: 1rem; background: rgba(127, 120, 160, 0.25); overflow: hidden; border: 0.12rem solid var(--ink); }
.xp-bar i { display: block; height: 100%; background: var(--teal); }
.hof-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.hof-row { display: grid; grid-template-columns: 1.6rem auto minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; }
.hof-who { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.hof-who b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.hof-who small { font-weight: 800; color: var(--ink-soft); }
.hof-ach { font-size: 1.3rem; max-width: 12rem; text-align: right; }
.at-row--stack { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.stats-body--hof { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* Evento casuale e pannelli */
.event-card { width: min(38rem, 100%); text-align: center; align-items: center; background: var(--sun); color: #1F1A3D; }
.event-card .lead-line { color: #1F1A3D; }
.event-kicker { font-weight: 900; text-transform: uppercase; letter-spacing: 0.12em; }
.event-card h2 { font-size: 3rem; line-height: 1; }
.event-dice { font-size: 5rem; line-height: 1; animation: slotIn .6s var(--pop) both; }
.game-img--event { width: 14rem; }
.event-card .claim-actions { justify-content: center; }
.event-mini { align-self: stretch; text-align: left; padding: 0.9rem 1rem; background: var(--sun); color: #1F1A3D; display: flex; flex-direction: column; gap: 0.3rem; }
.event-mini h2 { font-size: 1.6rem; }
.rc-filter { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.rc-filter .field-label { margin: 0; }
.rc-sec h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 0.4rem; }
.rc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.rc-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.8rem; align-items: center; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.9rem; padding: 0.4rem 0.6rem; }
.rc-text { display: flex; flex-direction: column; min-width: 0; }
.rc-text b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.rc-text .muted { font-size: 0.9rem; font-weight: 800; }
.rc-score { font-family: var(--display); font-size: 1.7rem; background: var(--sun); color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0 0.6rem; }
.vp-list { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; }
.chaos-toggle { margin-top: 0.4rem; }

/* Telefono: voto */
.spectator-note { align-self: stretch; text-align: left; font-weight: 800; background: #CFF3FA; color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.7rem 0.9rem; }
.na-btn { align-self: flex-start; margin-top: 0.4rem; cursor: pointer; font: inherit; font-weight: 900; font-size: 0.85rem; background: transparent; color: inherit; border: 0.15rem dashed var(--ink); border-radius: 999px; padding: 0.25rem 0.8rem; min-height: 2.4rem; }
.na-btn[aria-pressed="true"] { background: var(--ink-soft); color: var(--cream); border-style: solid; }
.pips-row.is-na .pip-btn { opacity: 0.35; }
.priv-note summary { cursor: pointer; }
.priv-note textarea { margin-top: 0.5rem; resize: vertical; min-height: 3.5rem; font: inherit; }
.buzz-fab {
  position: fixed; z-index: 69; left: 1rem; bottom: max(1rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  background: var(--tomato); color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 999px;
  box-shadow: 0.2rem 0.2rem 0 var(--ink); padding: 0.55rem 0.95rem; font-family: var(--display); font-size: 1.05rem;
}
.phone { padding-bottom: 5rem; }
.rg-state--spectator { border-style: dashed; opacity: 0.7; }

.stats-line svg, .stats-line .ico, .stats-line .crown { width: 1.3rem; height: 1.3rem; flex-shrink: 0; }

/* Telefono: livello, traguardi, note */
.lv-head { display: flex; align-items: center; gap: 0.9rem; }
.lv-num { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; flex-shrink: 0; border-radius: 50%; background: var(--sun); color: #1F1A3D; border: var(--bw) solid var(--ink); font-family: var(--display); font-size: 1.8rem; }
.lv-head h2 { font-size: 1.4rem; }
.ach-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.ach { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.6rem; align-items: center; border: 0.15rem solid var(--ink); border-radius: 0.8rem; padding: 0.4rem 0.6rem; opacity: 0.6; }
.ach.is-got { opacity: 1; background: #E3F6CF; color: #1F1A3D; }
.ach.is-got small { color: #3A3456; }
.ach-ico { font-size: 1.6rem; text-align: center; }
.ach-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ach-text small { font-weight: 700; color: var(--ink-soft); }
.ach-prog { display: block; height: 0.4rem; border-radius: 1rem; background: rgba(127, 120, 160, 0.25); overflow: hidden; }
.ach-prog i { display: block; height: 100%; background: var(--teal); }
.notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.notes-list p { margin-top: 0.15rem; white-space: pre-wrap; }
.ach-new { background: #E3F6CF; color: #1F1A3D; border: 0.15rem solid var(--ink); border-radius: 0.8rem; padding: 0.4rem 0.6rem; }

/* Modulo "Prossimo gioco" sempre dentro lo schermo (TV a 720p comprese) */
.screen--idle .idle { flex: 1; min-height: 0; height: 100%; grid-template-rows: minmax(0, 1fr); }
.screen--idle .next-card { max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
.next-card.has-lib { gap: 0.5rem; padding-top: 1.1rem; padding-bottom: 1.1rem; }
.next-card.has-lib h1 { font-size: 2.2rem; }
.next-card.has-lib .photo-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.next-card.has-lib .photo-row .dropzone { height: 4.4rem; }
.next-card.has-lib .photo-row .img-actions { flex-direction: row; gap: 0.4rem; }
.next-card.has-lib .photo-row .img-actions .btn-sec { padding: 0.3em 0.6em; font-size: 0.85rem; }
.next-card.has-lib .photo-row .dropzone p, .next-card.has-lib .photo-row .dropzone span { font-size: 0.85rem; }
.next-card.has-lib .win-avs { padding-top: 0.6rem; }
.next-card.has-lib .best-pick { padding: 0.3rem 0.7rem; }

/* Premi su tre righe (con i traguardi): carte più basse, e scorrimento se servisse */
.screen--awards .awards { flex: 1; min-height: 0; }
.awards.stage-prizes .prizes { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-bottom: 0.4rem; }
.prizes--dense { gap: 0.55rem; }
.prizes--dense .prize-title { font-size: 1.35rem; }
.prizes--dense .award { height: 10.2rem; }
.prizes--dense .game-img--award { width: 3.6rem; }
.prizes--dense .award .avatar { --s: 2.9rem !important; }
.prizes--dense .award .person { padding-top: 0.5rem; }
.prizes--dense .award-name { font-size: 1.1rem; }
.prizes--dense .award-value { font-size: 0.78rem; }
.prizes--dense .award-front { gap: 0.25rem; overflow: hidden; }
.prizes--dense .award-front h3 { font-size: 0.95rem; }
.prizes--dense .award-value { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.15; }

/* ==========================================================================
   identità del gruppo, album, ricordi, Wrapped, calendario,
   coppie, statistiche avanzate, ludoteca avanzata
   ========================================================================== */

/* Colore del gruppo (se scelto) al posto del giallo nei dettagli di marca */
.logo-tag { background: var(--group, var(--sun)); }

/* Emblema */
.emblem {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 2.4rem; height: 2.4rem; font-size: 1.45rem; line-height: 1;
  background: var(--group, var(--sun)); border: var(--bw) solid var(--ink); border-radius: 50%;
  box-shadow: 0.15rem 0.15rem 0 var(--ink);
}
.emblem--img { padding: 0; object-fit: cover; background: var(--paper); }
.emblem--lobby { width: 3rem; height: 3rem; font-size: 1.8rem; }
#lobbyIdentity { line-height: 1.2; }
.topbar-emblem { align-self: center; display: inline-flex; }
.topbar-emblem:not(:empty) + .brand + .topbar-group { min-width: 4.2rem; }
.topbar-emblem:empty { display: none; }
#lobbyIdentity { display: flex; align-items: center; gap: 0.8rem; }
#lobbyIdentity i { font-weight: 800; color: var(--ink-soft); }
.brand-row { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.ph-emblem { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; font-size: 1.2rem; line-height: 1; border-radius: 50%; background: var(--group, var(--sun)); border: 0.15rem solid var(--ink); overflow: hidden; flex-shrink: 0; }
.ph-emblem:empty { display: none; }
.ph-emblem img { width: 100%; height: 100%; object-fit: cover; }

.emblem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.3rem, 1fr)); gap: 0.5rem; }
.emblem-btn {
  aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; font-size: 1.7rem; line-height: 1;
  background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem;
  transition: transform .12s var(--pop);
}
.emblem-btn[aria-pressed="true"] { background: var(--group, var(--sun)); box-shadow: 0.2rem 0.2rem 0 var(--ink); transform: translate(-1px, -1px); }
.emblem-btn--img img { width: 100%; height: 100%; object-fit: cover; }
.emblem-btn .ico { width: 1.5rem; height: 1.5rem; }
.panel .ed-swatches { gap: 0.6rem; }
.panel .ed-sw { width: 2.6rem; height: 2.6rem; }

/* Album: polaroid e presentazione */
.panel--album { width: min(78rem, 100%); }
.panel--album .panel-head { flex-wrap: wrap; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.5rem; padding: 0.7rem 0.5rem 1rem; }
.album-grid > p { grid-column: 1 / -1; }
.polaroid {
  position: relative; margin: 0;
  background: #FFFFFF; color: #1F1A3D;
  border: var(--bw) solid #1F1A3D; border-radius: 0.35rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  padding: 0.6rem 0.6rem 0.55rem;
  transform: rotate(var(--r, 0deg)); transition: transform .2s var(--pop);
}
.polaroid:hover, .polaroid:focus-within { transform: rotate(0deg) scale(1.03); z-index: 1; }
.polaroid-img { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: none; overflow: hidden; background: #EEE; cursor: zoom-in; }
.polaroid-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption { display: flex; flex-direction: column; gap: 0.1rem; min-height: 1.4em; margin-top: 0.45rem; font-weight: 800; font-size: 0.95rem; line-height: 1.2; overflow-wrap: anywhere; }
.polaroid figcaption small { color: #4A4468; font-size: 0.78rem; }
.polaroid:hover .lib-del, .polaroid .lib-del:focus-visible { opacity: 1; }
.slideshow {
  position: fixed; inset: 0; z-index: 120; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  padding: 2rem; background: rgba(5, 4, 12, 0.94); color: #F4ECDC;
  animation: fadeIn .2s ease both;
}
.slideshow figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.slideshow img { max-width: 92vw; max-height: 70vh; object-fit: contain; border: 0.4rem solid #FFFFFF; border-radius: 0.35rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5); animation: panelIn .5s var(--pop) both; }
.slideshow figcaption { font-family: var(--display); font-size: 2.1rem; text-align: center; }
.slideshow figcaption small { display: block; font-family: var(--body); font-weight: 800; font-size: 1rem; opacity: 0.8; }
.slideshow .muted { color: #C3B9E6; }

/* Prossima serata e presenze */
.next-when { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.next-when::first-letter { text-transform: uppercase; }
.rsvp-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.rsvp-cols > div { display: flex; flex-direction: column; gap: 0.2rem; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.5rem 0.7rem; }
.rsvp-cols > div:first-child { background: #E3F6CF; color: #1F1A3D; }
.rsvp-cols p { font-weight: 800; font-size: 0.95rem; overflow-wrap: anywhere; }
.next-form { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; }
.next-form .input { min-height: 2.75rem; font-size: 1rem; }
.next-form .link-btn { grid-column: 1 / -1; justify-self: start; min-height: 0; padding: 0.2rem 0; }
.rsvp-btns { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.rsvp-btns .lib-chip { padding: 0.35rem 0.8rem; font-size: 1rem; }
.next-set summary { cursor: pointer; font-weight: 900; text-decoration: underline; text-underline-offset: 0.2em; }
.next-set-body { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.next-set-body .btn-sec { align-self: flex-start; }

/* Pagine "di sempre": schede in alto e scorrimento */
.alltime { overflow-y: auto; scrollbar-width: thin; padding: 0.2rem 0.7rem 1rem 0.2rem; gap: 1rem; }
.alltime-head h1 { font-size: 3.2rem; }
.at-tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.at-tabs button {
  cursor: pointer; min-height: 2.5rem; padding: 0.35rem 0.95rem;
  font-weight: 900; font-size: 1rem; color: inherit;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 999px;
}
.at-tabs button[aria-pressed="true"] { background: var(--group, var(--sun)); color: #1F1A3D; box-shadow: 0.16rem 0.16rem 0 var(--ink); }

/* Statistiche avanzate */
.stats-body--grid { display: block; columns: 3; column-gap: 1.2rem; }
.stats-body--grid > .stat-card { break-inside: avoid; margin-bottom: 1.2rem; }
.stat-card--sm { padding: 0.8rem 1rem; gap: 0.45rem; }
.stat-card--sm h2 { font-size: 1.3rem; }
.stat-card--sm .at-list { gap: 0.35rem; margin: 0; }
.stat-card--sm .at-row { align-items: baseline; }
.stat-card--sm .at-name { font-size: 1.1rem; }
.stat-card--sm .at-val { font-size: 0.82rem; white-space: normal; text-align: right; max-width: 58%; color: var(--ink-soft); }
.stat-card--sm .muted { font-size: 0.9rem; }

/* Coppie */
.pairs-hl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.pair-hl {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  padding: 0.8rem 1rem; text-align: left; cursor: pointer; font-weight: 800;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}
.pair-hl:disabled { cursor: default; opacity: 0.65; box-shadow: none; }
.pair-hl b { font-family: var(--display); font-weight: 400; font-size: 1.35rem; }
.pair-hl span:not(.pair-ico) { font-weight: 900; }
.pair-hl small { color: var(--ink-soft); font-weight: 800; }
.pair-ico { font-size: 1.8rem; line-height: 1; }
.pairs-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.pair-matrix-wrap { overflow-x: auto; }
.pair-matrix { border-collapse: separate; border-spacing: 0.25rem; font-weight: 900; margin: 0 auto; }
.pair-matrix thead th { vertical-align: bottom; font-size: 0.75rem; padding: 0 0.1rem; }
.pair-matrix thead th .avatar { margin: 0 auto; }
.pair-matrix thead th span { display: block; max-width: 4rem; margin: 0.2rem auto 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pair-matrix tbody th { text-align: right; font-size: 0.9rem; padding-right: 0.4rem; white-space: nowrap; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
.pair-matrix td { padding: 0; }
.pair-matrix td button {
  width: 3.3rem; height: 2.4rem; cursor: pointer;
  font-weight: 900; font-size: 0.85rem; color: #1F1A3D;
  background: var(--h, transparent); border: 0.15rem solid var(--ink); border-radius: 0.5rem;
  transition: transform .12s var(--pop);
}
.pair-matrix td button:hover { transform: scale(1.1); }
.pair-matrix td button.is-na { background: transparent; color: var(--ink-soft); border-style: dashed; }
.pair-matrix td.is-self { border-radius: 0.5rem; background: repeating-linear-gradient(45deg, transparent 0 4px, rgba(127, 120, 160, 0.25) 4px 8px); }
.pair-compat { font-size: 1.2rem; font-weight: 800; }
.pair-facts { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; font-weight: 800; }

/* Ricordi e pagina della serata */
.otd { background: #FFF3C4; color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.7rem 1rem; font-weight: 800; font-size: 1.1rem; }
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.1rem; }
.mem-card {
  display: flex; flex-direction: column; gap: 0.3rem; text-align: left; cursor: pointer;
  padding: 0.9rem 1.1rem; font-weight: 800; box-shadow: 0.3rem 0.3rem 0 var(--ink);
  transition: transform .15s var(--pop);
}
.mem-card:hover, .mem-card:focus-visible { transform: translate(-2px, -2px) rotate(-0.6deg); }
.mem-num { font-weight: 900; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.mem-date { display: block; font-family: var(--display); font-weight: 400; font-size: 1.55rem; line-height: 1.05; }
.mem-date::first-letter { text-transform: uppercase; }
.mem-facts { color: var(--ink-soft); font-size: 0.95rem; }
.night-side p { font-weight: 800; }
.night-side .btn-sec { align-self: flex-start; }
.night-side .link-btn { align-self: flex-start; padding-left: 0; }
.quote-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.quote-list li { background: var(--cream); border: 0.15rem solid var(--ink); border-radius: 0.8rem 0.8rem 0.8rem 0.2rem; padding: 0.4rem 0.7rem; font-weight: 800; font-style: italic; }
.quote-list small { display: block; font-style: normal; font-size: 0.8rem; color: var(--ink-soft); }

/* Wrapped */
.wrapped { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.4rem; min-height: 22rem; }
.wr-nav {
  width: 4.2rem; height: 4.2rem; padding: 0 0 0.3rem; cursor: pointer;
  font-family: var(--display); font-size: 3rem; line-height: 1; color: inherit;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 50%;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
}
.wr-nav:disabled { opacity: 0.3; cursor: default; box-shadow: none; }
.wr-slide {
  position: relative; overflow: hidden; min-height: 22rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center;
  background: var(--wc, var(--tomato)); color: #1F1A3D;
  border: 0.3rem solid var(--ink); border-radius: 2rem; box-shadow: 0.6rem 0.6rem 0 var(--ink);
  padding: 2.5rem 3rem;
  animation: wrIn .45s var(--pop) both;
}
.wr-slide::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(31, 26, 61, 0.13) 2px, transparent 2.2px); background-size: 22px 22px; }
.wr-slide > * { position: relative; }
.wr-k { font-weight: 900; font-size: 1.3rem; text-transform: uppercase; letter-spacing: 0.14em; }
.wr-big { font-size: clamp(3rem, 7vw, 6.5rem); line-height: 0.95; overflow-wrap: anywhere; }
.wr-small { font-size: 1.5rem; font-weight: 800; }
.wr-dots { display: flex; justify-content: center; gap: 0.45rem; margin-top: 0.8rem; }
.wr-dots span { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: rgba(31, 26, 61, 0.3); }
.wr-dots span.on { background: #1F1A3D; transform: scale(1.3); }
@keyframes wrIn { from { opacity: 0; transform: scale(0.92) rotate(-2deg); } to { opacity: 1; transform: none; } }
.wr-mini { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; font-weight: 800; }

/* Calendario */
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.2rem; align-items: start; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cal-head h2 { margin-right: auto; }
.cal-head .lib-chip { padding: 0.2rem 0.7rem; font-size: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.cal-month { display: flex; flex-direction: column; gap: 0.3rem; min-height: 4.6rem; padding: 0.45rem 0.55rem; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem; opacity: 0.7; }
.cal-month.has { background: var(--paper); opacity: 1; box-shadow: 0.18rem 0.18rem 0 var(--ink); }
.cal-month b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cal-dot { min-width: 2rem; height: 2rem; padding: 0 0.25rem; cursor: pointer; font-weight: 900; font-size: 0.85rem; color: #1F1A3D; background: var(--group, var(--sun)); border: 0.15rem solid var(--ink); border-radius: 999px; }

/* Scheda gioco e ricerca in ludoteca */
.gs-record { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gs-record span { display: flex; flex-direction: column; line-height: 1.15; font-weight: 800; font-size: 0.85rem; color: var(--ink-soft); background: var(--cream); border: 0.15rem solid var(--ink); border-radius: 0.8rem; padding: 0.3rem 0.7rem; }
.gs-record b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--fg, var(--ink)); }
.gs-grid { display: grid; grid-template-columns: 7rem repeat(4, minmax(0, 1fr)); gap: 0.6rem 0.9rem; align-items: end; }
.gs-grid .lib-add-img { width: 7rem; height: 7rem; grid-row: span 2; align-self: start; }
.gs-grid .lib-add-img .ico { width: 2.2rem; height: 2.2rem; }
.gs-f { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.gs-f .field-label { margin: 0; font-size: 0.9rem; }
.gs-f .input { min-height: 2.7rem; font-size: 1rem; }
.gs-f--wide { grid-column: span 2; }
.lib-search { display: flex; flex-direction: column; gap: 0.45rem; }
.lib-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.lib-chips-row:empty { display: none; }
.lib-chips-row .chip { font-size: 0.9rem; background: var(--group, var(--sun)); color: #1F1A3D; }
.lib-chips-row .muted { font-size: 0.9rem; }
.lib-tile.is-away { border-style: dashed; box-shadow: none; }
.lib-tile.is-away .game-img { filter: grayscale(1); opacity: 0.5; }
.lib-status { position: absolute; top: 1rem; left: 1rem; right: 1rem; text-align: center; transform: rotate(-3deg); font-weight: 900; font-size: 0.8rem; color: #1F1A3D; background: var(--tomato); border: 0.15rem solid var(--ink); border-radius: 0.5rem; padding: 0.1rem 0.4rem; }
.lib-exp { font-size: 0.8rem; font-weight: 900; color: var(--violet); }
.lib-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.lib-tags span { font-size: 0.72rem; font-weight: 900; background: var(--cream); border: 0.12rem solid var(--ink); border-radius: 999px; padding: 0 0.45rem; }

/* Telefono: foto ricordo, ricordi, serata passata */
.photo-prev-big { width: 100%; max-height: 45vh; object-fit: contain; background: #000; border: var(--bw) solid var(--ink); border-radius: 0.8rem; }
.mem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.mem-row { width: 100%; display: flex; flex-direction: column; gap: 0.1rem; text-align: left; cursor: pointer; font-weight: 800; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.5rem 0.75rem; }
.mem-row span { font-size: 0.9rem; color: var(--ink-soft); }
.sheet--tall { max-height: 90vh; max-height: 90dvh; }
.sheet h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.album-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.album-mini > p { grid-column: 1 / -1; }
.album-mini figure { margin: 0; background: #FFFFFF; color: #1F1A3D; border: 0.15rem solid #1F1A3D; border-radius: 0.35rem; padding: 0.35rem; }
.album-mini img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.album-mini figcaption { font-size: 0.8rem; font-weight: 800; margin-top: 0.25rem; }
.album-mini figcaption:empty { display: none; }
.p-name small { font-weight: 800; color: var(--ink-soft); }

/* Tema notte per le novità */
html[data-theme="night"] .emblem, html[data-theme="night"] .ph-emblem { color: #1F1A3D; }
html[data-theme="night"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4ECDC' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
html[data-theme="night"] .emblem-btn[aria-pressed="true"] { color: #1F1A3D; }
html[data-theme="night"] .lib-exp { color: #B9A8FF; }
html[data-theme="night"] .rsvp-cols > div:first-child b { color: #1F1A3D; }
html[data-theme="night"] .wr-nav { color: var(--fg); }
html[data-theme="night"] .at-tabs button { color: var(--fg); }
html[data-theme="night"] .at-tabs button[aria-pressed="true"] { color: #1F1A3D; }
html[data-theme="night"] .pair-matrix td button { color: #1F1A3D; }
html[data-theme="night"] .pair-matrix td button.is-na { color: var(--ink-soft); border-color: #5A5288; }

@media (max-width: 760px) {
  .pairs-hl, .cal-body, .pairs-body { grid-template-columns: 1fr; }
  .stats-body--grid { columns: 1; }
  .gs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gs-f--wide { grid-column: 1 / -1; }
  .wrapped { grid-template-columns: 1fr; }
  .wr-nav { display: none; }
}

/* ==========================================================================
   musica, atmosfere, ticker, soundboard, pronostici, intervallo,
   commentatore, esportazioni e QR
   ========================================================================== */

/* Atmosfera animata dietro le schermate */
.atmo { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
html.tv .tv-shell { position: relative; z-index: 1; }

/* Strumenti: volumi e soundboard */
.vol-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.7rem; align-self: stretch; font-weight: 900; font-size: 0.95rem; }
.range--vol { height: 2rem; }
.range--vol::-webkit-slider-runnable-track { height: 0.7rem; }
.range--vol::-webkit-slider-thumb { width: 1.6rem; height: 1.6rem; margin-top: -0.6rem; }
.range--vol::-moz-range-thumb { width: 1.6rem; height: 1.6rem; }
.tool .select--sm { width: 100%; }
.sfx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 0.45rem; align-self: stretch; }
.sfx-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem; cursor: pointer;
  font: inherit; color: inherit; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.8rem;
  box-shadow: 0.15rem 0.15rem 0 var(--ink); padding: 0.35rem 0.25rem;
  transition: transform .1s ease;
}
.sfx-btn span { font-size: 1.5rem; line-height: 1; }
.sfx-btn small { font-size: 0.7rem; font-weight: 900; line-height: 1.1; text-align: center; }
.sfx-btn:active, .sfx-btn.is-sent { transform: translate(0.1rem, 0.1rem) scale(0.96); background: var(--sun); color: #1F1A3D; box-shadow: none; }
.sfx-bubble {
  position: fixed; z-index: 96; top: 4.4rem; right: 2rem;
  background: var(--paper); color: inherit; border: var(--bw) solid var(--ink); border-radius: 999px;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); padding: 0.45rem 1rem; font-weight: 900; font-size: 1.1rem;
  animation: panelIn .25s var(--pop) both, fadeOut .4s ease 2.2s forwards;
}
@keyframes fadeOut { to { opacity: 0; transform: translateY(-0.5rem); } }

/* Ticker "Ultim'ora" */
html.has-ticker .tv-shell { padding-bottom: 4.4rem; }
.ticker {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: 3rem;
  display: flex; align-items: stretch; overflow: hidden;
  background: var(--ink); color: #F4ECDC; border-top: 0.25rem solid var(--group, var(--sun));
  font-weight: 900; font-size: 1.15rem;
}
html[data-theme="night"] .ticker { background: #05040C; }
.ticker-label {
  flex-shrink: 0; display: grid; place-items: center; padding: 0 1.1rem;
  font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: 0.03em; text-transform: uppercase;
  background: var(--tomato); color: #1F1A3D; position: relative; z-index: 1;
  box-shadow: 0.4rem 0 0 rgba(0, 0, 0, 0.25);
}
.ticker-view { flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: inline-flex; align-items: center; gap: 1.3rem; white-space: nowrap; padding-left: 1.3rem; will-change: transform; }
.ticker-track.is-running { animation: ticker var(--dur, 40s) linear infinite; }
.ticker-item--g { color: var(--group, var(--sun)); }
.ticker-sep { color: var(--tomato); font-size: 0.8em; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Il pulsante "Apri la votazione" resta sempre visibile anche quando il modulo scorre */
.screen--idle .next-card .ov-row { position: sticky; bottom: -1.1rem; z-index: 2; background: var(--paper); padding: 0.5rem 0 0.2rem; margin-bottom: -0.2rem; }

/* Pronostici */
.bet-count { margin-left: auto; font-weight: 900; background: #EFE7FF; color: #1F1A3D; border: 0.15rem solid var(--ink); border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.95rem; }
.play-timer { flex-wrap: wrap; }
.bet-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 900; font-size: 1rem; background: #EFE7FF; color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.2rem 0.75rem; }
.bet-card h2 { font-size: 1.35rem; }
.bet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: 0.45rem; }
.bet-opt {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 0.85rem; color: inherit;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem; padding: 0.45rem 0.3rem;
}
.bet-opt span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-opt[aria-pressed="true"] { background: #C9B8FF; color: #1F1A3D; box-shadow: 0.2rem 0.2rem 0 var(--ink); transform: translate(-1px, -1px); }
.p-bet { font-weight: 800; margin-top: 0.3rem; }

/* Telefono: foglio "Tavolo" */
.tb-sec { display: flex; flex-direction: column; gap: 0.5rem; }
.tb-sec + .tb-sec { border-top: 0.15rem dashed var(--ink-soft); padding-top: 0.8rem; }
.tb-sec h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.tb-sec textarea { resize: none; min-height: 3.6rem; font: inherit; font-weight: 800; }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tb-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.tb-reasons .btn-sec { font-size: 0.95rem; padding: 0.45em 0.6em; }
.sheet .sfx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rg-sfx summary, .rg-safety summary { cursor: pointer; font-weight: 900; text-decoration: underline; text-underline-offset: 0.2em; padding: 0.3rem 0; }
.rg-sfx .sfx-grid { margin-top: 0.5rem; }

/* Intervallo */
.interval {
  position: fixed; inset: 0; z-index: 45; cursor: pointer;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1.2rem;
  padding: 1.6rem 2.6rem 1.4rem;
  background: rgba(255, 244, 222, 0.86);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .4s ease both;
}
html[data-theme="night"] .interval { background: rgba(21, 17, 43, 0.86); }
html.has-ticker .interval { bottom: 3rem; }
.int-top { display: flex; align-items: center; gap: 1rem; }
.int-kicker { font-family: var(--display); font-size: 2rem; background: var(--group, var(--sun)); color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 999px; box-shadow: 0.2rem 0.2rem 0 var(--ink); padding: 0.1rem 1rem; }
.int-group { font-weight: 900; font-size: 1.2rem; color: var(--ink-soft); }
.int-clock { margin-left: auto; font-family: var(--display); font-size: 2.2rem; }
.int-stage { display: grid; place-items: center; min-height: 0; }
.int-card {
  width: min(62rem, 100%); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  background: var(--paper); border: 0.3rem solid var(--ink); border-radius: 2rem; box-shadow: 0.6rem 0.6rem 0 var(--ink);
  padding: 2.4rem 3rem; animation: wrIn .6s var(--pop) both;
}
.int-icon { font-size: 4.5rem; line-height: 1; }
.int-k { font-weight: 900; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-soft); }
.int-text { font-family: var(--display); font-size: clamp(2rem, 3.4vw, 3.4rem); line-height: 1.08; }
.int-card--trivia { background: #E7F9F7; color: #1F1A3D; }
.int-card--trivia .int-k { color: #3A3456; }
.int-card--news { background: #FFF3C4; color: #1F1A3D; }
.int-card--news .int-k { color: #3A3456; }
.int-card--board ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; align-self: stretch; }
.int-card--board li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; font-family: var(--display); font-size: 2.4rem; text-align: left; }
.int-card--board li span { color: var(--ink-soft); }
.int-card--board li em { font-style: normal; background: var(--sun); color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0 0.7rem; }
.int-photo { margin: 0; max-height: 100%; display: flex; flex-direction: column; align-items: center; background: #FFFFFF; color: #1F1A3D; border: var(--bw) solid #1F1A3D; border-radius: 0.4rem; box-shadow: 0.5rem 0.5rem 0 var(--ink); padding: 0.9rem 0.9rem 0.8rem; transform: rotate(-1.5deg); animation: wrIn .6s var(--pop) both; }
.int-photo img { max-height: 52vh; max-width: 80vw; object-fit: contain; display: block; }
.int-photo figcaption { font-family: var(--display); font-size: 1.9rem; margin-top: 0.6rem; text-align: center; }
.int-photo figcaption small { display: block; font-family: var(--body); font-weight: 800; font-size: 1rem; color: #4A4468; }
.int-foot { display: flex; justify-content: space-between; gap: 1rem; font-weight: 900; color: var(--ink-soft); }
.int-foot span:first-child { color: inherit; }
.pause-fact { max-width: 46rem; margin-top: 1.4rem; text-align: center; font-weight: 900; font-size: 1.25rem; color: #F4ECDC; min-height: 3.2em; }
.pause-overlay { flex-direction: column; display: flex; align-items: center; justify-content: center; }

/* Reveal più compatto: le etichette piccole stanno su una riga che va a capo */
.reveal-left { gap: 0.7rem; min-height: 0; }
.reveal .game-title { font-size: 3rem; line-height: 1; }
.reveal-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-self: stretch; animation: riseIn .5s calc(var(--after, 0s) + .35s) both; }
.reveal-chips:empty { display: none; }
.reveal-chips > p { font-size: 0.92rem; padding: 0.12rem 0.6rem; max-width: 100%; }
.reveal-chips .bet-chip span:last-child { min-width: 0; }
.reveal-chips .oracle-chip .ico, .reveal-chips .oracle-chip svg { width: 1rem; height: 1rem; }
.reveal-photo { margin-bottom: 2.1rem; }
.reveal-photo .game-img--hero { max-height: 33vh; }
html.has-ticker .reveal-photo .game-img--hero { max-height: 28vh; }

/* Sottotitoli del commentatore */
.speech-cap {
  position: fixed; z-index: 97; left: 0; right: 0; bottom: 4.6rem; margin: 0 auto; pointer-events: none;
  width: min(50rem, calc(100% - 3rem));
  display: flex; align-items: flex-start; gap: 0.7rem;
  background: var(--ink); color: #F4ECDC; border: var(--bw) solid var(--ink); border-radius: 1.1rem;
  box-shadow: 0.35rem 0.35rem 0 var(--tomato); padding: 0.8rem 1.1rem;
  font-weight: 800; font-size: 1.08rem; line-height: 1.3;
  animation: panelIn .25s var(--pop) both;
}
html[data-theme="night"] .speech-cap { background: #F4ECDC; color: #1F1A3D; }
.speech-cap span:first-child { font-size: 1.5rem; }
html:not(.has-ticker) .speech-cap { bottom: 1.6rem; }

/* Condividi ed esporta, QR */
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.export-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left; cursor: pointer;
  font: inherit; color: inherit; background: var(--cream); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); padding: 0.9rem 1rem;
}
.export-opt span { font-size: 2rem; line-height: 1; }
.export-opt b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.export-opt small { font-weight: 800; color: var(--ink-soft); }
.export-opt:disabled { opacity: 0.5; cursor: wait; }
.qr-panel { width: min(30rem, 100%); align-items: center; text-align: center; }
.qr-panel .panel-head { align-self: stretch; }
.qr--big { width: 17rem; background: #fff; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.6rem; }
.qr-panel .qr-url { max-width: 100%; }
.panel-note .btn-sec--sm { margin-left: 0.4rem; vertical-align: middle; }
.share-row { align-self: stretch; display: flex; flex-direction: column; gap: 0.6rem; }
.prof-qr { align-self: stretch; }
.prof-qr summary { cursor: pointer; font-weight: 900; }
.qr--prof { width: min(15rem, 100%); margin: 0.8rem auto 0.4rem; background: #fff; border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.5rem; }

/* Ludoteca sul telefono */
.lb-search { align-self: stretch; display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.lb-list { align-self: stretch; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.lb-item { padding: 0; box-shadow: 0.25rem 0.25rem 0 var(--ink); border-radius: 1rem; overflow: hidden; }
.lb-item.is-away { border-style: dashed; box-shadow: none; }
.lb-item.is-away .game-img { filter: grayscale(1); opacity: 0.55; }
.lb-head { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; background: none; border: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lb-head .game-img--mini { width: 3.6rem; }
.lb-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.lb-text b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.05; }
.lb-away { font-weight: 900; font-size: 0.75rem; color: #1F1A3D; background: var(--tomato); border: 0.15rem solid var(--ink); border-radius: 0.5rem; padding: 0.1rem 0.4rem; transform: rotate(-3deg); text-align: center; max-width: 6.5rem; }
.lb-more { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0.7rem 0.7rem; }
.lb-more span { display: flex; flex-direction: column; font-size: 0.75rem; font-weight: 800; color: var(--ink-soft); background: var(--cream); border: 0.15rem solid var(--ink); border-radius: 0.6rem; padding: 0.2rem 0.5rem; }
.lb-more b { font-family: var(--display); font-weight: 400; font-size: 1.05rem; color: var(--fg, var(--ink)); }

.ph-top a.ph-room { color: inherit; font-weight: 900; text-underline-offset: 0.2em; }
html[data-theme="night"] .sfx-btn:active, html[data-theme="night"] .sfx-btn.is-sent { color: #1F1A3D; }
html[data-theme="night"] .int-kicker { color: #1F1A3D; }

/* ==========================================================================
   stabilità e sicurezza (salvataggi, macchina del tempo,
   controllo integrità, stanza chiusa, espulsioni, rete, Safe Mode)
   ========================================================================== */

/* Safe Mode: niente animazioni, niente sfondi animati, niente ticker o sottotitoli */
html.safe-mode *, html.safe-mode *::before, html.safe-mode *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
html.safe-mode .atmo, html.safe-mode .ticker, html.safe-mode .speech-cap, html.safe-mode .confetti { display: none !important; }
.chip--safe { background: var(--tomato); color: #1F1A3D; }
.safe-offer { flex-wrap: wrap; width: min(46rem, calc(100% - 1.6rem)); }
.safe-offer .link-btn { color: inherit; min-height: 0; }
html[data-theme="night"] .chip--safe { color: #1F1A3D; }

.tool .quick-toggle, .panel .quick-toggle { white-space: normal; align-items: flex-start; }
.tool .quick-toggle input, .panel .quick-toggle input { flex-shrink: 0; margin-top: 0.12rem; }
/* Strumenti: salvataggi e spazio */
.tool--wide { grid-column: 1 / -1; }
.save-line { font-weight: 800; background: var(--paper); border: 0.15rem solid var(--ink); border-radius: 0.7rem; padding: 0.4rem 0.7rem; }
.space-list { display: flex; flex-direction: column; gap: 0.3rem; }
.space-list p { font-weight: 800; }

/* Macchina del tempo */
.tm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; max-height: 60vh; overflow-y: auto; scrollbar-width: thin; }
.tm-row { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr) auto; align-items: center; gap: 0.7rem; padding: 0.3rem 0.5rem; border-radius: 0.6rem; font-weight: 700; }
.tm-row--snap { background: var(--cream); border: 0.15rem solid var(--ink); font-weight: 800; }
.tm-row.is-bad { opacity: 0.6; border-style: dashed; }
.tm-time { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--ink-soft); }
.tm-text { min-width: 0; overflow-wrap: anywhere; }

/* Controllo integrità */
.ic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.ic-row { display: grid; grid-template-columns: 1.8rem 7rem minmax(0, 1fr); align-items: baseline; gap: 0.6rem; padding: 0.45rem 0.7rem; border: 0.15rem solid var(--ink); border-radius: 0.7rem; background: var(--paper); font-weight: 800; }
.ic-row b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.ic-row--error { background: #FFE3E0; color: #1F1A3D; }
.ic-row--warn { background: #FFF3C4; color: #1F1A3D; }
.ic-row--info { background: #E7F1FF; color: #1F1A3D; }
.ic-ico { font-size: 1.2rem; }
.ic-summary { text-align: center; font-size: 1.2rem; }
.ic-ready { display: inline-block; font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: 0.06em; color: #1F1A3D; background: var(--teal); border: var(--bw) solid var(--ink); border-radius: 0.8rem; padding: 0.15rem 0.9rem; box-shadow: 0.2rem 0.2rem 0 var(--ink); }

/* Ripresa dopo un crash */
.recover-card { order: -1; flex-basis: 100%; max-width: 62rem; padding: 1.4rem 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; background: #FFF3C4; color: #1F1A3D; transform: rotate(-0.6deg); }
.recover-kicker { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; }
.recover-card p { font-weight: 800; }
.recover-card .claim-actions { justify-content: flex-start; }
.recover-card .btn-sec { color: #1F1A3D; }

/* Stanza chiusa ed espulsioni */
.lock-big { font-size: 4.5rem; line-height: 1; }
.lock-box { width: 9.5rem; flex-shrink: 0; aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 0.3rem; background: var(--paper); border: var(--bw) dashed var(--ink); border-radius: 1rem; font-size: 2.6rem; }
.lock-box b { font-size: 1rem; }
.hdr-lock { font-size: 0.9em; }
.panel-acts { display: inline-flex; align-items: center; gap: 0.4rem; }
.icon-btn--sm { width: 2.3rem; height: 2.3rem; font-size: 1rem; }
.btn--danger { box-shadow: 0.32rem 0.32rem 0 var(--ink); background: #B3261E; border-color: #5A0F0A; color: #FFF; }
.panel-join .btn-sec { align-self: flex-start; }

/* Trasferisci la regia */
.transfer { display: flex; gap: 1.4rem; align-items: center; }
.transfer .qr { width: 12rem; flex-shrink: 0; }
.transfer-text { display: flex; flex-direction: column; gap: 0.6rem; font-weight: 800; }
.transfer-codes { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 1.2rem; }

/* Telefono: stato della rete e watchdog della regia */
.ph-right { display: inline-flex; align-items: center; gap: 0.5rem; }
.net-pill { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 1.9rem; padding: 0.15rem 0.55rem; cursor: pointer; font: inherit; font-weight: 900; font-size: 0.8rem; color: inherit; background: var(--paper); border: 0.15rem solid var(--ink); border-radius: 999px; }
.net-pill--ok { padding: 0.15rem 0.4rem; }
.net-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #38B000; border: 0.12rem solid var(--ink); }
.net-pill--off .net-dot { background: var(--sun); }
.net-pill--queue .net-dot { background: var(--sky); animation: netPulse 1s ease-in-out infinite alternate; }
.net-pill--off, .net-pill--queue { background: #FFF3C4; color: #1F1A3D; }
.net-pill--queue { background: #DCEBFF; }
@keyframes netPulse { from { transform: scale(0.8); } to { transform: scale(1.15); } }
#rgSafeBody { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.5rem; }
.rg-watch { font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }
.rg-watch.is-bad { color: #1F1A3D; background: #FFE3E0; border: 0.15rem solid var(--ink); border-radius: 0.7rem; padding: 0.45rem 0.6rem; }
.rg-watch a { color: inherit; font-weight: 900; }

@media (max-width: 760px) {
  .transfer { flex-direction: column; align-items: flex-start; }
  .ic-row { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .ic-row span:last-child { grid-column: 2; }
}

/* ==========================================================================
   modalità prova, reveal cinematico, accessibilità,
   tutorial, chiave del gruppo, profili ritrovati
   ========================================================================== */

/* Reveal cinematico */
.reveal--cine .cine-dim {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse at 66% 42%, rgba(5, 4, 12, 0.35), rgba(5, 4, 12, 0.88) 70%);
  animation: cineDim var(--after, 4s) linear both;
}
.reveal--cine .vcards { position: relative; z-index: 6; }
.reveal--cine .vcard { border-radius: 1.1rem; animation: cineSpot 1.1s var(--d, 0s) ease-out both; }
.reveal--cine .vcard.is-slow { animation: cineSpotSlow 2.1s var(--d, 0s) ease-out both; }
.reveal--cine .vcard.is-slow .vcard-inner { animation-duration: 1.5s; animation-timing-function: cubic-bezier(0.15, 0.85, 0.2, 1); }
.reveal--cine .avg-badge { animation: cineBadge 1s var(--after, 0s) var(--pop) both; }
@keyframes cineDim { 0% { opacity: 0; } 6% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cineSpot {
  0% { filter: brightness(0.55); }
  30% { filter: brightness(1.15); box-shadow: 0 0 0 0.3rem var(--sun), 0 0 3rem 1rem rgba(255, 215, 120, 0.55); }
  100% { filter: none; box-shadow: none; }
}
@keyframes cineSpotSlow {
  0% { filter: brightness(0.55); transform: scale(1); }
  45% { filter: brightness(1.2); transform: scale(1.14); box-shadow: 0 0 0 0.35rem var(--sun), 0 0 4rem 1.4rem rgba(255, 215, 120, 0.7); }
  100% { filter: none; transform: scale(1); box-shadow: none; }
}
@keyframes cineBadge {
  0% { opacity: 0; transform: rotate(-30deg) scale(0.2); filter: brightness(2); }
  60% { opacity: 1; transform: rotate(10deg) scale(1.18); filter: brightness(1.4); }
  100% { opacity: 1; transform: rotate(6deg) scale(1); filter: none; }
}

/* Accessibilità */
html.a11y-l:not(.tv) { font-size: 112.5%; }
html.a11y-xl:not(.tv) { font-size: 125%; }
html.tv.a11y-l { font-size: clamp(12px, min(1.26vw, 2.2vh), 34px); }
html.tv.a11y-xl { font-size: clamp(13px, min(1.4vw, 2.45vh), 38px); }
html.a11y-contrast { --ink-soft: var(--ink); --bw: 0.25rem; }
html.a11y-contrast body { background-image: none; }
html.a11y-contrast .muted { color: var(--ink); }
html.a11y-contrast[data-theme="night"] { --paper: #000000; --cream: #000000; --ink: #FFFFFF; --ink-soft: #FFFFFF; --fg: #FFFFFF; }
html.a11y-cb { --tomato: #D55E00; --teal: #009E73; --sun: #F0E442; --violet: #0072B2; --pink: #CC79A7; --sky: #56B4E9; }
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
.a11y-box { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.a11y-l-label { font-size: 1.15em; }
.a11y-xl-label { font-size: 1.3em; }

/* Tutorial */
.tour { position: fixed; inset: 0; z-index: 130; }
.tour-hole { position: fixed; border-radius: 1rem; box-shadow: 0 0 0 9999px rgba(21, 17, 43, 0.62); outline: 0.25rem solid var(--sun); transition: all 0.25s ease; pointer-events: none; }
.tour-tip { position: fixed; z-index: 131; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.tour-step { font-size: 0.8rem; font-weight: 900; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.tour-tip h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.tour-tip p { font-weight: 700; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.3rem; }
.tour-actions > span { display: inline-flex; gap: 0.5rem; }
.tour-actions .link-btn { min-height: 0; padding: 0.3rem 0; }
.btn--sm { font-size: 1.05rem; padding: 0.45em 0.95em; min-height: 2.5rem; }
.ft-list { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; font-weight: 700; text-align: left; }

/* Modalità prova */
.chip--demo { background: var(--violet); color: #FFFFFF; }
.demo-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-weight: 800; background: #EFE9FF; color: #1F1A3D; border: var(--bw) dashed var(--ink); border-radius: 1rem; padding: 0.6rem 0.9rem; }
.demo-note .btn-sec { color: #1F1A3D; }

/* Chiave del gruppo */
.gk-banner { flex-wrap: wrap; width: min(54rem, calc(100% - 1.6rem)); }
.gk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.gk-row .input { width: 12rem; min-height: 2.5rem; font-size: 1.2rem; }
.gk-row .link-btn { color: inherit; min-height: 0; }
.gk-line { font-weight: 800; font-size: 0.95rem; }

/* Telefono: "Sei tu?" */
.same-name { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.9rem 1rem; text-align: left; background: #FFF3C4; color: #1F1A3D; }
.same-name .link-btn { align-self: flex-start; color: inherit; padding-left: 0; }
.same-name .btn-sec { color: #1F1A3D; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Schermi stretti per la pagina TV (per esempio aperta per sbaglio sul telefono) */
@media (max-width: 760px) {
  html.tv { font-size: 12px; }
  html.tv body { overflow: auto; }
  .tv-shell { height: auto; min-height: 100vh; padding: 1rem; }
  .lobby, .idle, .voting, .reveal, .alltime-body, .poll-win { grid-template-columns: 1fr; }
  .create { gap: 2rem; }
}

/* ==========================================================================
   tema Show per la TV, timer del voto, carte dei giocatori,
   reveal a ritmo crescente, campioni sul podio, controller da tavolo sul telefono
   ========================================================================== */

:root {
  --num: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --stairs: linear-gradient(to bottom, transparent calc(33.3% - 0.12rem), rgba(0, 0, 0, 0.22) calc(33.3% - 0.12rem), rgba(0, 0, 0, 0.22) calc(33.3% + 0.12rem), transparent calc(33.3% + 0.12rem), transparent calc(66.6% - 0.12rem), rgba(0, 0, 0, 0.22) calc(66.6% - 0.12rem), rgba(0, 0, 0, 0.22) calc(66.6% + 0.12rem), transparent calc(66.6% + 0.12rem));
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibers: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04 .9' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .18 0 0 0 .13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
}

/* Effetti speciali (coriandoli e fuochi su canvas) */
.fx-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 90; pointer-events: none; }
html.safe-mode .fx-layer { display: none !important; }

/* ---------- Tema Show (solo TV): studio televisivo, luci basse e neon caldi ---------- */

html.theme-show {
  --cream: #140B2E;
  --paper: #251A52;
  --ink: #06030F;
  --ink-soft: #C2B5F2;
  --fg: #FFF3E0;
  --night-fill: #FFF3E0;
  --sun: #FFD34D;
  --tomato: #FF6A3D;
  --teal: #2BE3C9;
  --violet: #9B7BFF;
  --pink: #FF4FD2;
  --sky: #4DB0FF;
  --neon-o: #FF8A3D;
  --neon-m: #FF3DCB;
  --neon-g: #FFD34D;
  --neon-c: #3DF5E0;
  --x3d: 0 0.035em 0 #D9327F, 0 0.07em 0 #B0266A, 0 0.105em 0 #861B55, 0 0.14em 0 #5B1140, 0 0.2em 0.06em rgba(0, 0, 0, 0.65), 0 0 0.55em rgba(255, 61, 203, 0.4);
  --x3d-gold: 0 0.035em 0 #F0A800, 0 0.07em 0 #C98500, 0 0.105em 0 #9C6300, 0 0.14em 0 #6B4200, 0 0.2em 0.06em rgba(0, 0, 0, 0.65), 0 0 0.6em rgba(255, 211, 77, 0.55);
  --x3d-cyan: 0 0.035em 0 #1FB8A6, 0 0.07em 0 #168C80, 0 0.105em 0 #0F635B, 0 0.14em 0 #083B36, 0 0.2em 0.06em rgba(0, 0, 0, 0.65), 0 0 0.55em rgba(61, 245, 224, 0.4);
}
html.theme-show body {
  background-color: #120A28;
  background-image:
    var(--noise),
    radial-gradient(ellipse 70% 55% at 10% 6%, rgba(126, 46, 196, 0.55), transparent 70%),
    radial-gradient(ellipse 60% 60% at 94% 16%, rgba(20, 56, 140, 0.6), transparent 70%),
    radial-gradient(ellipse 80% 60% at 68% 108%, rgba(8, 96, 78, 0.5), transparent 70%),
    linear-gradient(160deg, #1B0E3C 0%, #0F1232 55%, #0A201F 100%);
  background-size: 220px 220px, auto, auto, auto, auto;
  background-attachment: fixed;
}
/* Vignetta da palcoscenico */
html.theme-show body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
}
html.theme-show .tv-shell, html.theme-show .create { position: relative; z-index: 1; }

/* Titoli che "bucano" lo schermo: estrusione a strati e alone neon */
html.theme-show .game-title, html.theme-show .voting-title, html.theme-show .reveal-head h2,
html.theme-show .board-head h1, html.theme-show .awards-head h1,
html.theme-show .win-title, html.theme-show .idle h1, html.theme-show .alltime-head h1, html.theme-show .poll h1 {
  color: var(--fg); text-shadow: var(--x3d); letter-spacing: 0.015em;
}
html.theme-show .awards-head h1, html.theme-show .win-title { color: #FFE27A; text-shadow: var(--x3d-gold); }
html.theme-show .lobby .logo, html.theme-show .create .logo { text-shadow: var(--x3d); }
html.theme-show .brand { text-shadow: 0 0.06em 0 #861B55, 0 0 0.5em rgba(255, 61, 203, 0.45); }

/* Materiali: carte scure con un riflesso e il bordo pieno del tema pop */
html.theme-show .card, html.theme-show .crit-tile, html.theme-show .brow, html.theme-show .vcard-front,
html.theme-show .award-front, html.theme-show .panel, html.theme-show .mini-row, html.theme-show .poll-card {
  background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 42%), var(--noise);
  background-size: auto, 220px 220px;
}
html.theme-show .card { box-shadow: 0.45rem 0.45rem 0 var(--ink), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
html.theme-show .topbar .chip { background: rgba(20, 11, 46, 0.72); border-color: rgba(255, 255, 255, 0.14); backdrop-filter: blur(6px); }
html.theme-show .topbar .chip-btn:hover { background: var(--sun); color: #1F1A3D; }
html.theme-show .chip--tomato {
  background: linear-gradient(135deg, #FF8A3D, #FF3DCB); color: #FFF7EC; border-color: var(--ink);
  box-shadow: 0 0 1.1rem rgba(255, 106, 61, 0.55); text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.35);
}
html.theme-show .btn {
  background: linear-gradient(180deg, #FFE27A, #FFC21F); color: #1F1A3D;
  box-shadow: 0.32rem 0.32rem 0 var(--neon-m), 0 0 1.6rem rgba(255, 61, 203, 0.35);
}
html.theme-show .btn:active:not(:disabled) { box-shadow: 0.12rem 0.12rem 0 var(--neon-m), 0 0 0.8rem rgba(255, 61, 203, 0.3); }
html.theme-show .btn .ico { color: #FF3DCB; }
html.theme-show .btn-sec { background: rgba(37, 26, 82, 0.9); }
html.theme-show .game-img { box-shadow: 0.45rem 0.45rem 0 var(--ink), 0 0 2.4rem rgba(155, 123, 255, 0.35); }

/* Numeri da tabellone */
html.theme-show .vcard-num, html.theme-show .avg-badge b, html.theme-show .bavg, html.theme-show .brank,
html.theme-show .pod-base, html.theme-show .pod-avg, html.theme-show .mini-avg, html.theme-show .crit-tile b, html.theme-show .champ-base {
  font-family: var(--num); letter-spacing: -0.02em;
}
html.theme-show .vcard-num { font-size: 3.6rem; text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.5), 0 0 0.5em rgba(61, 245, 224, 0.45); }
html.theme-show .vcards--dense .vcard-num { font-size: 2.9rem; }
html.theme-show .vcard-front.is-top {
  background-color: #FFD34D; color: #1F1A3D;
  box-shadow: 0.28rem 0.28rem 0 var(--ink), 0 0 2rem rgba(255, 211, 77, 0.65);
}
html.theme-show .vcard-front.is-top .vcard-num { text-shadow: 0 0.06em 0 #C98500, 0 0.12em 0 #9C6300, 0 0 0.4em rgba(255, 255, 255, 0.6); }
html.theme-show .vcard-front.is-top .vcard-quote, html.theme-show .vcard-front.is-top .vcard-tag { color: #1F1A3D; }
html.theme-show .avg-badge {
  background: radial-gradient(circle at 35% 30%, #FFF0A8, #FFD34D 45%, #F2A900);
  box-shadow: 0.4rem 0.4rem 0 var(--ink), 0 0 3rem rgba(255, 211, 77, 0.7);
}
html.theme-show .avg-badge b { font-size: 3.9rem; text-shadow: 0 0.05em 0 rgba(255, 255, 255, 0.55); }
html.theme-show .verdict-chip { background: linear-gradient(135deg, #2BE3C9, #3DA9FF); box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 1.4rem rgba(61, 245, 224, 0.45); }
html.theme-show .mvp-tile { background: linear-gradient(135deg, #3A1670, #1B0C3E); color: var(--fg); box-shadow: 0 0 1.4rem rgba(255, 61, 203, 0.35); border-color: rgba(255, 61, 203, 0.6); }
html.theme-show .brow--r1 { background-color: #FFD34D; color: #1F1A3D; box-shadow: 0.3rem 0.3rem 0 var(--ink), 0 0 1.8rem rgba(255, 211, 77, 0.45); }
html.theme-show .brow--r2 { background-color: #C9D3F0; color: #1F1A3D; }
html.theme-show .brow--r3 { background-color: #F2A979; color: #1F1A3D; }
html.theme-show .bbar { background: rgba(255, 255, 255, 0.12); }
html.theme-show .bbar i { background: linear-gradient(90deg, var(--neon-m), var(--neon-o)); box-shadow: 0 0 0.8rem rgba(255, 61, 203, 0.6); }
html.theme-show .brow--r1 .bbar i, html.theme-show .brow--r2 .bbar i, html.theme-show .brow--r3 .bbar i { background: #1F1A3D; box-shadow: none; }
html.theme-show .vote-count { text-shadow: var(--x3d-cyan); }
html.theme-show .vote-count.is-done { background: #FFD34D; color: #1F1A3D; text-shadow: none; box-shadow: 0 0 2rem rgba(255, 211, 77, 0.6); }
html.theme-show .pod--1 .pod-base { background: linear-gradient(180deg, #FFE27A, #F2A900); }
html.theme-show .champ-base--r1 { background: var(--stairs), linear-gradient(180deg, #FFE27A, #F2A900); box-shadow: 0 0 2.4rem rgba(255, 211, 77, 0.55); }
html.theme-show .pod--2 .pod-base { background: linear-gradient(180deg, #E6ECFF, #9FAED6); }
html.theme-show .champ-base--r2 { background: var(--stairs), linear-gradient(180deg, #E6ECFF, #9FAED6); box-shadow: 0 0 1.6rem rgba(200, 215, 255, 0.35); }
html.theme-show .pod--3 .pod-base { background: linear-gradient(180deg, #FFC08F, #D9733A); }
html.theme-show .champ-base--r3 { background: var(--stairs), linear-gradient(180deg, #FFC08F, #D9733A); box-shadow: 0 0 1.6rem rgba(255, 138, 61, 0.4); }
html.theme-show .pod-base { box-shadow: 0 0 1.8rem rgba(255, 211, 77, 0.3); }
html.theme-show .stage-podium .podium, html.theme-show .stage-players .champions { border-bottom-color: rgba(255, 255, 255, 0.25); }

/* ---------- Votazione: i giocatori sono carte vive ---------- */

.voters .voter {
  position: relative; padding: 0.8rem 0.4rem 0.6rem; min-height: 0;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1.1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  transition: transform .25s var(--pop), box-shadow .3s, background-color .3s;
}
.voters .voter.is-voted { background-color: var(--paper); background-image: linear-gradient(170deg, var(--pc), transparent 75%); }
.voters .voter.is-voted .voter-name { color: inherit; }
.voters button.voter-btn:hover { transform: translateY(-3px); }
.voter:not(.is-voted):not(.is-offline) .voter-av { animation: think 1.9s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.37s); }
.voter:not(.is-voted):not(.is-offline) .avatar { opacity: 0.6; filter: grayscale(0.75); }
@keyframes think {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); filter: drop-shadow(0 0 0.6rem rgba(155, 123, 255, 0.55)); }
}
.voter-think {
  position: absolute; right: -0.9rem; top: -0.5rem; z-index: 2;
  display: flex; gap: 0.18rem; align-items: center;
  background: var(--paper); border: 0.15rem solid var(--ink); border-radius: 999px; padding: 0.28rem 0.42rem;
}
.voter-think i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; animation: dots 1.2s ease-in-out infinite; }
.voter-think i:nth-child(2) { animation-delay: .15s; }
.voter-think i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-0.25rem); opacity: 1; } }
.voters .voter.is-fresh { animation: voteFlash 0.9s var(--pop); z-index: 2; }
.voter-flash {
  position: absolute; inset: -1.6rem; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 200, 0.7) 25%, transparent 62%);
  animation: flashOut 0.8s ease-out forwards;
}
@keyframes voteFlash {
  0% { transform: scale(1); }
  30% { transform: scale(1.14) rotate(-2deg); box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 0 0.3rem #FFF, 0 0 3rem 1rem var(--pc); }
  100% { transform: scale(1); }
}
@keyframes flashOut { from { opacity: 1; transform: scale(0.4); } to { opacity: 0; transform: scale(1.5); } }
html.theme-show .voters .voter.is-voted { box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 1.5rem -0.2rem var(--pc); }
/* Tempo scaduto: chi non ha votato trema */
.voters--late .voter:not(.is-voted) { animation: lateShake 0.45s ease-in-out infinite; border-color: #E0263A; box-shadow: 0.25rem 0.25rem 0 #7A0E1B, 0 0 1.2rem rgba(224, 38, 58, 0.5); }
.voters--late .voter:not(.is-voted) .voter-av { animation: none; }
@keyframes lateShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-3px, 1px) rotate(-2deg); }
  40% { transform: translate(3px, -1px) rotate(2deg); }
  60% { transform: translate(-2px, 0) rotate(-1deg); }
  80% { transform: translate(2px, 1px) rotate(1deg); }
}

/* ---------- Timer del voto (TV): anello che si consuma ---------- */

.voting-head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.vtimer {
  --tc: rgb(61, 220, 132);
  position: relative; flex-shrink: 0; width: 9.5rem; height: 9.5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--paper); border: var(--bw) solid var(--ink);
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
}
.vtimer svg { position: absolute; inset: 0.25rem; width: calc(100% - 0.5rem); height: calc(100% - 0.5rem); overflow: visible; filter: drop-shadow(0 0 0.35rem var(--tc)); }
.vt-track { fill: none; stroke: rgba(128, 120, 160, 0.25); stroke-width: 10; }
.vt-arc { fill: none; stroke: var(--tc); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset .25s linear; }
.vt-spark { fill: #FFF6D0; stroke: var(--tc); stroke-width: 2; animation: sparkle .18s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes sparkle { from { transform: scale(0.75); } to { transform: scale(1.35); } }
.vtimer b { position: relative; font-family: var(--num); font-weight: 400; font-size: 2.7rem; line-height: 1; color: var(--fg, var(--ink)); }
.vtimer small { position: relative; font-weight: 900; font-size: 0.85rem; color: var(--ink-soft); }
html.theme-show .vtimer { background: radial-gradient(circle, #2A1C5C, #150C33); box-shadow: 0.3rem 0.3rem 0 var(--ink), 0 0 2rem -0.3rem var(--tc); }
html.theme-show .vtimer b { text-shadow: 0 0 0.45em var(--tc); }
.vtimer.is-hot { animation: hotPulse 0.5s ease-in-out infinite alternate; }
.vtimer.is-hot b { color: var(--tc); }
@keyframes hotPulse { from { transform: scale(1) rotate(-1deg); } to { transform: scale(1.08) rotate(1.5deg); } }
.vtimer.is-over, html.theme-show .vtimer.is-over { background: radial-gradient(circle, #B3121E, #5E0710); animation: lateShake 0.5s ease-in-out 3; }
.vtimer.is-over b { font-size: 1.55rem; color: #FFF3E0; text-shadow: 0 0.06em 0 #000; }
.vtimer.is-over .vt-spark { display: none; }
.vtimer.is-paused .vt-spark { animation: none; opacity: 0.4; }

/* ---------- Reveal: carte che si girano sempre più in fretta ---------- */

.vcard-inner { animation-name: flipIn3d; animation-duration: 0.72s; animation-timing-function: cubic-bezier(.3, .7, .3, 1.12); }
@keyframes flipIn3d {
  0% { transform: rotateY(180deg) translateY(0) scale(1); }
  45% { transform: rotateY(95deg) translateY(-0.7rem) scale(1.1); }
  100% { transform: rotateY(0deg) translateY(0) scale(1); }
}
.reveal:not(.reveal--cine) .vcard { border-radius: 1.1rem; animation: cardLand 0.9s calc(var(--d, 0s) + 0.38s) ease-out both; }
@keyframes cardLand {
  0% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0); }
  25% { box-shadow: 0 0 0 0.25rem rgba(255, 244, 200, 0.9), 0 0 2.2rem 0.5rem rgba(255, 211, 77, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0); }
}
html.theme-show .vcard-back {
  background-color: #1B0E40;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 61, 203, 0.22) 0 0.3rem, transparent 0.3rem 0.95rem),
    repeating-linear-gradient(-45deg, rgba(61, 245, 224, 0.16) 0 0.3rem, transparent 0.3rem 0.95rem),
    radial-gradient(circle at 50% 50%, rgba(255, 211, 77, 0.35), transparent 60%);
  background-size: auto;
  border-color: #06030F; box-shadow: 0.28rem 0.28rem 0 var(--ink), inset 0 0 0 0.35rem rgba(255, 211, 77, 0.35);
}
html.theme-show .vcard-back span { font-family: var(--num); color: #FFD34D; text-shadow: 0 0 0.5em rgba(255, 211, 77, 0.8); }
.mvp-avs .crowned + .crowned { margin-left: -1rem; }
.mvp-name { overflow-wrap: break-word; }

/* ---------- Premiazione: campioni della serata sul podio a gradini ---------- */

.awards .champions, .awards .champ-rule { display: none; }
.awards.stage-players .podium, .awards.stage-players .prizes { display: none; }
.awards.stage-players .champions {
  display: grid; flex: 1; min-height: 0;
  grid-template-columns: repeat(3, 17rem); justify-content: center; align-items: end; gap: 2.2rem;
  border-bottom: 0.35rem solid var(--ink); margin: 0 6rem;
}
.awards.stage-players .champ-rule { display: block; text-align: center; font-weight: 800; color: var(--ink-soft); font-size: 1rem; }
.champ { --h: 6rem; display: flex; flex-direction: column; }
.champ--1 { --h: 11rem; }
.champ--2 { --h: 8rem; }
.champ--3 { --h: 5.5rem; }
.champ--none { visibility: hidden; }
.champ-who {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  padding-bottom: 0.8rem; text-align: center;
  transition: opacity .3s;
}
.champ-who.is-hidden { opacity: 0; transform: translateY(var(--h)) scale(0.85); }
.champ-who.is-climbing { animation: climb 1.2s ease-in-out both; }
@keyframes climb {
  0% { opacity: 0; transform: translateY(var(--h)) scale(1, 0.9); }
  5% { opacity: 1; transform: translateY(var(--h)) scale(1.06, 0.88); }
  14% { transform: translateY(calc(var(--h) * 0.667 - 2.2rem)) scale(0.95, 1.06); }
  24% { transform: translateY(calc(var(--h) * 0.667)) scale(1.07, 0.9); }
  38% { transform: translateY(calc(var(--h) * 0.333 - 2.2rem)) scale(0.95, 1.06); }
  50% { transform: translateY(calc(var(--h) * 0.333)) scale(1.07, 0.9); }
  66% { transform: translateY(-2.6rem) scale(0.94, 1.08); }
  78% { transform: translateY(0) scale(1.1, 0.88); }
  89% { transform: translateY(-0.45rem) scale(0.98, 1.03); }
  100% { opacity: 1; transform: none; }
}
.champ-trophy { font-size: 3.4rem; line-height: 1; display: block; filter: drop-shadow(0 0.25rem 0 rgba(0, 0, 0, 0.35)); }
.champ--1 .champ-trophy { font-size: 4.6rem; }
.champ-who.is-climbing .champ-trophy { animation: trophyDrop 1s 1.05s var(--bounce) both; }
@keyframes trophyDrop {
  0% { opacity: 0; transform: translateY(-70vh) rotate(-35deg) scale(1.4); }
  55% { opacity: 1; transform: translateY(0.5rem) rotate(10deg) scale(0.92); }
  75% { transform: translateY(-0.9rem) rotate(-6deg) scale(1.06); }
  100% { opacity: 1; transform: none; }
}
.champ-av { position: relative; display: inline-block; }
.champ-av .avatar { box-shadow: 0 0 0 0.3rem var(--pc), 0.4rem 0.4rem 0 0.3rem var(--ink); }
html.theme-show .champ-av .avatar { box-shadow: 0 0 0 0.3rem var(--pc), 0 0 2.4rem 0.4rem var(--pc); }
.champ-name { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.05; overflow-wrap: anywhere; }
.champ--1 .champ-name { font-size: 2.6rem; }
html.theme-show .champ--1 .champ-name { color: #FFE27A; text-shadow: var(--x3d-gold); }
html.theme-show .champ-name { text-shadow: var(--x3d); }
.champ-pts { font-family: var(--num); font-size: 1.35rem; background: var(--sun); color: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0.05rem 0.8rem; }
.champ-why { font-weight: 800; font-size: 0.92rem; color: var(--ink-soft); max-width: 17rem; }
.champ-base {
  height: var(--h); display: grid; place-items: center; color: #1F1A3D;
  border: 0.25rem solid var(--ink); border-bottom: none; border-radius: 1rem 1rem 0 0;
  font-family: var(--display); font-size: 4.4rem;
  /* gradini: due linee che dividono il blocco in tre scalini */
  background-image: var(--stairs);
}
.champ-base--r1 { background-color: var(--sun); }
.champ-base--r2 { background-color: #C9D3F0; }
.champ-base--r3 { background-color: #F2A979; }
/* I giochi del podio cadono dall'alto e rimbalzano */
.pod-card.is-hidden { transform: translateY(-3.5rem) scale(0.7) rotate(-6deg); }
.pod-card { transition: opacity .35s ease, transform .75s var(--bounce); }
/* I premi speciali entrano come trofei che rimbalzano */
.award.is-shown { animation: trophyIn 0.8s var(--bounce) both; }
@keyframes trophyIn {
  0% { transform: translateY(-2.5rem) scale(0.6); }
  60% { transform: translateY(0.4rem) scale(1.06); }
  100% { transform: none; }
}
.awards-title { display: flex; align-items: center; gap: 1.2rem; min-width: 0; }
.awards-title h1 { white-space: nowrap; }
.awards-title:has(.seg) h1 { font-size: 2.5rem; }
.awards-head { flex-wrap: wrap; row-gap: 0.6rem; }
.awards-actions .btn, .awards-actions .btn-sec, .seg--stage button { white-space: nowrap; }
.seg--stage button { font-size: 1rem; }

/* ---------- Telefono: controller da tavolo (neobrutalista) ---------- */

html:not(.tv) body { background-image: radial-gradient(rgba(31, 26, 61, 0.10) 1.5px, transparent 1.6px), var(--fibers); background-size: 24px 24px, 180px 180px; }
html[data-theme="night"]:not(.tv) body { background-image: radial-gradient(rgba(244, 236, 220, 0.06) 1.5px, transparent 1.5px), var(--noise); background-size: 24px 24px, 220px 220px; }
/* Ogni sezione del voto è un porta-carte di cartone pressato */
.phone--vote .vblock {
  background-color: var(--paper); background-image: var(--fibers); background-size: 180px 180px;
  border: 0.22rem solid var(--ink); border-radius: 1.25rem;
  box-shadow: 0.3rem 0.3rem 0 var(--ink);
  padding: 0.9rem 1rem 1rem;
}
html[data-theme="night"] .phone--vote .vblock { background-image: var(--noise); background-size: 220px 220px; }
.phone--vote .vblock > legend { float: left; width: 100%; margin-bottom: 0.2rem; }
.phone--vote .vblock > legend + * { clear: both; }
.phone .card { background-image: var(--fibers); background-size: 180px 180px; }
html[data-theme="night"] .phone .card { background-image: var(--noise); background-size: 220px 220px; }
/* Pulsanti di plastica pesante: si schiacciano perdendo l'ombra */
.pip-btn { box-shadow: 0.22rem 0.22rem 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease, background .12s; }
.pip-btn:active { transform: translate(0.2rem, 0.2rem); box-shadow: 0 0 0 var(--ink); }
.pip-btn.is-picked { box-shadow: 0.08rem 0.08rem 0 var(--ink); transform: translate(0.14rem, 0.14rem); }
.na-btn {
  border-style: solid; border-radius: 0.6rem; background: var(--cream);
  box-shadow: 0.18rem 0.18rem 0 var(--ink); transition: transform .2s var(--pop), box-shadow .08s;
}
.na-btn::before { content: '🃏 '; }
.na-btn:active { transform: translate(0.15rem, 0.15rem); box-shadow: none; }
.na-btn[aria-pressed="true"] { transform: rotate(-4deg) translate(0.2rem, 0.1rem); box-shadow: 0.08rem 0.08rem 0 var(--ink); }
.btn-sec:active, .chip-btn:active { box-shadow: 0 0 0 var(--ink); }

/* Slider gigante per il voto da 1 a 10 */
.giant-wrap { position: relative; padding: 0.2rem 0 0; }
.range--giant { height: 4.4rem; --vc: var(--paper); }
.range--giant::-webkit-slider-runnable-track {
  height: 2.6rem; border: 0.25rem solid var(--ink); border-radius: 1.3rem;
  background: linear-gradient(to right, var(--vc) calc(var(--p) + 1.3rem), var(--paper) calc(var(--p) + 1.3rem));
  box-shadow: inset 0 0.25rem 0 rgba(0, 0, 0, 0.12), 0.25rem 0.25rem 0 var(--ink);
}
.range--giant::-webkit-slider-thumb {
  width: 3.7rem; height: 3.7rem; margin-top: -0.8rem; border-radius: 1rem;
  border: 0.25rem solid var(--ink); background: var(--sun);
  background-image: radial-gradient(circle at 50% 50%, var(--ink) 0.32rem, transparent 0.34rem);
  box-shadow: 0.25rem 0.25rem 0 var(--ink);
  transform: rotate(-6deg);
}
.range--giant:active::-webkit-slider-thumb { transform: rotate(4deg) scale(1.08); box-shadow: 0.1rem 0.1rem 0 var(--ink); }
.range--giant::-moz-range-track { height: 2.1rem; border: 0.25rem solid var(--ink); border-radius: 1.3rem; background: var(--paper); }
.range--giant::-moz-range-progress { height: 2.1rem; border-radius: 1.3rem 0 0 1.3rem; background: var(--vc); }
.range--giant::-moz-range-thumb { width: 3.2rem; height: 3.2rem; border-radius: 1rem; border: 0.25rem solid var(--ink); background: var(--sun); box-shadow: 0.25rem 0.25rem 0 var(--ink); }
.range--giant.is-untouched::-webkit-slider-thumb { background-color: var(--paper); }
.ticks--giant { padding: 0 1.55rem; font-family: var(--display); font-size: 1.05rem; }
.phone--vote .score-badge { width: 4.8rem; height: 4.8rem; font-size: 2.6rem; }
.phone--vote .score-badge.is-set { animation: bump .3s var(--pop); }

/* MVP: la mano di carte e il tavolo dove giocarla */
.mvp-slot {
  min-height: 6.2rem; display: grid; place-items: center; text-align: center;
  border: 0.22rem dashed var(--ink); border-radius: 1.1rem;
  background-color: #2E7D5B;
  background-image: var(--noise), radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.14), transparent 70%);
  background-size: 220px 220px, auto;
  color: #F4FFF8; padding: 0.6rem; transition: transform .15s var(--pop), box-shadow .15s;
}
.mvp-slot.is-over { transform: scale(1.03); box-shadow: 0 0 0 0.25rem var(--sun), 0 0 1.4rem rgba(255, 211, 77, 0.6); border-style: solid; }
.mvp-slot.is-set { border-style: solid; }
.mvp-slot.is-slap { animation: slap .45s var(--pop); }
@keyframes slap { 0% { transform: scale(1.06); } 40% { transform: scale(0.97); } 100% { transform: scale(1); } }
.mvp-slot-empty { display: flex; flex-direction: column; gap: 0.15rem; }
.mvp-slot-empty b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.mvp-slot-empty small { font-weight: 800; font-size: 0.85rem; opacity: 0.85; }
.mvp-played {
  display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left;
  background: var(--paper); color: var(--fg, var(--ink)); border: 0.2rem solid var(--ink); border-radius: 0.9rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); padding: 0.35rem 0.6rem; transform: rotate(-2deg);
  border-left: 0.6rem solid var(--pc);
}
.mvp-played .mvp-av .crown { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); }
.mvp-played-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mvp-played-txt small { font-weight: 900; font-size: 0.8rem; color: var(--ink-soft); }
.mvp-played-txt b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.05; overflow-wrap: anywhere; }
.mvp-played .link-btn { color: inherit; min-height: 2.4rem; padding: 0.3rem; }
.mvp-grid.mvp-hand {
  display: flex; gap: 0.6rem; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 0.9rem 0.3rem 0.7rem; margin: 0 -0.3rem; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.mvp-card {
  flex: 0 0 5.6rem; min-height: 7.6rem; scroll-snap-align: center; touch-action: pan-x;
  background: var(--paper); background-image: linear-gradient(170deg, var(--pc) 0 2.2rem, transparent 2.2rem);
  border: 0.2rem solid var(--ink); border-radius: 0.8rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink);
  padding: 0.35rem 0.25rem 0.4rem; justify-content: flex-start;
  transform: rotate(calc(var(--k, 0) * 2deg)) translateY(calc(var(--k, 0) * var(--k, 0) * 0.12rem));
  transition: transform .2s var(--pop), box-shadow .15s, opacity .2s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mvp-card:active { transform: translateY(-0.4rem) scale(1.03); }
.mvp-card .avatar { opacity: 1; }
.mvp-card[aria-pressed="true"] { transform: translateY(-0.7rem) rotate(0deg); box-shadow: 0 0 0 0.2rem var(--sun), 0.25rem 0.35rem 0 0.2rem var(--ink); }
.mvp-card.is-lifting { opacity: 0.25; }
.mvp-ghost {
  position: fixed !important; z-index: 95; margin: 0; pointer-events: none;
  box-shadow: 0.6rem 0.8rem 0 rgba(0, 0, 0, 0.35) !important; transform-origin: 50% 80%;
}

/* Miccia del timer sul telefono */
.fuse {
  --tc: rgb(61, 220, 132);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.7rem;
  margin: calc(-1 * max(1rem, env(safe-area-inset-top))) -1.25rem 0; padding: max(0.7rem, env(safe-area-inset-top)) 1.25rem 0.6rem;
  background: var(--cream); border-bottom: 0.2rem solid var(--ink);
}
.fuse-track { position: relative; flex: 1; height: 0.9rem; border-radius: 1rem; background: rgba(128, 120, 160, 0.22); border: 0.15rem solid var(--ink); }
.fuse-rope {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 1rem; display: block;
  background: repeating-linear-gradient(-55deg, var(--tc) 0 0.45rem, color-mix(in srgb, var(--tc) 70%, #000) 0.45rem 0.7rem);
  background-color: var(--tc);
  transition: width .25s linear;
}
.fuse-spark {
  position: absolute; top: 50%; left: var(--fx, 0); width: 1.3rem; height: 1.3rem; margin: -0.65rem 0 0 -0.65rem; border-radius: 50%;
  background: radial-gradient(circle, #FFF8D6 0 25%, #FFD34D 40%, rgba(255, 106, 61, 0.7) 60%, transparent 72%);
  animation: sparkle .12s ease-in-out infinite alternate;
}
.fuse-spark i { position: absolute; left: 50%; top: 50%; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(160, 150, 180, 0.55); animation: smoke 1.2s ease-out infinite; }
.fuse-spark i:nth-child(2) { animation-delay: .4s; }
.fuse-spark i:nth-child(3) { animation-delay: .8s; }
@keyframes smoke { from { opacity: 0.8; transform: translate(-50%, -50%) scale(0.6); } to { opacity: 0; transform: translate(calc(-50% - 0.6rem), -2.2rem) scale(2.4); } }
.fuse-txt { font-family: var(--num); font-size: 1.05rem; min-width: 3.6rem; text-align: right; color: var(--tc); text-shadow: 0 1px 0 var(--ink); }
.fuse.is-hot .fuse-txt { animation: hotPulse .5s ease-in-out infinite alternate; }
.fuse.is-over { background: #B3121E; color: #FFF3E0; }
.fuse.is-over .fuse-track, .fuse.is-over .fuse-spark { display: none; }
.fuse.is-over .fuse-txt { flex: 1; text-align: center; color: #FFF3E0; font-size: 1.1rem; animation: lateShake .45s ease-in-out 4; }
.fuse.is-paused .fuse-spark { animation: none; opacity: 0.5; }
.fuse.is-paused .fuse-spark i { display: none; }

/* Campioni sul telefono */
.p-champs { text-align: left; display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.p-champs h2 { font-size: 1.5rem; }
.p-champ-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.p-champ { display: flex; align-items: center; gap: 0.7rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 0.9rem; box-shadow: 0.2rem 0.2rem 0 var(--ink); padding: 0.4rem 0.8rem; }
.p-champ:first-child { background: var(--sun); color: #1F1A3D; }
.p-champ.is-me { outline: 0.2rem dashed var(--tomato); outline-offset: 0.15rem; }
.p-champ-medal { font-size: 1.7rem; }
.p-champ b { flex: 1; min-width: 0; font-family: var(--display); font-weight: 400; font-size: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-champ-pts { font-family: var(--num); font-size: 1rem; }

/* Meno animazioni / Safe Mode: niente tremolii continui */
html.a11y-motion .voter-av, html.a11y-motion .voters--late .voter, html.a11y-motion .vtimer, html.a11y-motion .voter-think i,
html.safe-mode .voter-av, html.safe-mode .voters--late .voter, html.safe-mode .vtimer { animation: none !important; }

/* TV a 3 metri: carte dei giocatori e voti più grandi quando c'è spazio */
.voters:not(.voters--many) { --voter-av: 7rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.vcards--one .vcard { height: 13rem; }
.vcards--one .vcard-num { font-size: 5.4rem; }
html.theme-show .vcards--one .vcard-num { font-size: 4.6rem; }
.vcard-front.is-top .vcard-quote { color: #1F1A3D; opacity: 0.85; }
.awards-actions { gap: 0.6rem; }
.awards-actions .btn-sec { padding: 0.45em 0.75em; font-size: 0.98rem; }
.awards-title:has(.seg) .seg button { padding: 0.4rem 0.75rem; }
.awards-title:has(.seg) + .awards-actions .btn { font-size: 1.2rem; padding: 0.6em 1em; }

/* ==========================================================================
   tavolo (ruota, squadre, clessidra), segnapunti, quiz, stagioni,
   rivalità, figurine, video, allarme intrusi, modalità leggera
   ========================================================================== */

/* ---------- Ruota ---------- */
.overlay--table { z-index: 65; }
.table-panel { display: flex; flex-direction: column; gap: 1rem; }
.tb-tabs { margin-top: -0.2rem; }
.tb-wheel { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: center; }
.tb-side { display: flex; flex-direction: column; gap: 1rem; align-items: flex-start; }
.tb-lead { font-weight: 800; font-size: 1.15rem; }
.tb-result { font-family: var(--display); font-size: 2.2rem; min-height: 2.6rem; }
html.theme-show .tb-result b { color: #FFE27A; text-shadow: var(--x3d-gold); }
.wheel { position: relative; width: min(30rem, 58vh); aspect-ratio: 1; margin: 0 auto; }
.wheel-disc {
  position: absolute; inset: 0; border-radius: 50%;
  border: 0.45rem solid var(--ink); box-shadow: 0.5rem 0.5rem 0 var(--ink), 0 0 2.4rem rgba(255, 211, 77, 0.25);
  overflow: hidden; will-change: transform;
}
.wheel-label { position: absolute; left: 50%; top: 0; height: 50%; width: 0; transform-origin: 50% 100%; transform: rotate(var(--a)); }
.wheel-text {
  position: absolute; left: 50%; top: 0.9rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 8.5rem; text-align: center;
}
.wheel-text b {
  font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1.05; color: #1F1A3D;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); overflow-wrap: anywhere; max-height: 2.7em; overflow: hidden;
}
.wheel--many .wheel-text { width: 6rem; }
.wheel--many .wheel-text b { font-size: 0.98rem; }
.wheel-text .avatar { border-width: 0.18rem; }
.wheel-pin {
  position: absolute; left: 50%; top: -1.1rem; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 1.3rem solid transparent; border-right: 1.3rem solid transparent; border-top: 2.4rem solid var(--tomato);
  filter: drop-shadow(0.2rem 0.25rem 0 var(--ink));
}
.wheel.is-spinning .wheel-pin { animation: pinWobble .12s ease-in-out infinite alternate; }
@keyframes pinWobble { from { transform: translateX(-50%) rotate(-7deg); } to { transform: translateX(-50%) rotate(7deg); } }
.wheel-hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 5rem; height: 5rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem;
  background: var(--sun); border: 0.35rem solid var(--ink); box-shadow: 0.25rem 0.25rem 0 var(--ink);
}

/* ---------- Squadre ---------- */
.tb-teams-head { display: flex; flex-direction: column; gap: 0.7rem; }
.tb-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.tb-team {
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1.2rem; border-top: 0.7rem solid var(--tc);
  box-shadow: 0.3rem 0.3rem 0 var(--ink), 0 0 1.6rem -0.4rem var(--tc); padding: 0.8rem 1rem;
  animation: trophyIn .6s calc(var(--i) * .12s) var(--bounce) both;
}
.tb-team h3 { font-size: 1.6rem; color: var(--tc); text-shadow: 0 0.06em 0 var(--ink); margin-bottom: 0.4rem; }
.tb-team ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.tb-team li { display: flex; align-items: center; gap: 0.6rem; font-weight: 900; font-size: 1.15rem; }

/* ---------- Clessidra ---------- */
.tb-sand { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2.4rem; align-items: center; }
.sand-num { font-family: var(--num); font-size: 5rem; line-height: 1; color: var(--fg, var(--ink)); }
.hourglass {
  --f: 1; --tc: #FFD34D;
  position: relative; width: 12rem; height: 18rem; margin: 0 auto;
  border-top: 0.6rem solid var(--ink); border-bottom: 0.6rem solid var(--ink); border-radius: 0.4rem;
}
.hourglass::before {
  content: ''; position: absolute; inset: 0.3rem 0.6rem;
  clip-path: polygon(0 0, 100% 0, 54% 50%, 100% 100%, 0 100%, 46% 50%);
  background: rgba(160, 200, 255, 0.18); outline: none;
}
.hg-top, .hg-bot { position: absolute; left: 0.6rem; right: 0.6rem; display: block; background: var(--tc); transition: clip-path .25s linear, background .3s; }
/* Sabbia sopra: un triangolo che si abbassa; sotto: un mucchio che cresce */
.hg-top { top: 0.3rem; height: calc(50% - 0.3rem); clip-path: polygon(calc(50% - 50% * var(--f)) calc(100% - 100% * var(--f)), calc(50% + 50% * var(--f)) calc(100% - 100% * var(--f)), 54% 100%, 46% 100%); }
.hg-bot { bottom: 0.3rem; height: calc(50% - 0.3rem); clip-path: polygon(50% calc(100% - (1 - var(--f)) * 70%), calc(50% + (1 - var(--f)) * 50%) 100%, calc(50% - (1 - var(--f)) * 50%) 100%); }
.hg-stream { position: absolute; left: calc(50% - 0.12rem); top: 50%; width: 0.24rem; height: 0; background: var(--tc); }
.hourglass.is-running .hg-stream { height: 45%; animation: stream .3s linear infinite; }
@keyframes stream { from { opacity: 0.6; } to { opacity: 1; } }
.hourglass.is-over { animation: lateShake .45s ease-in-out 3; }
.sand-chip {
  --tc: #3DDC84;
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 55; cursor: pointer;
  font: inherit; font-weight: 900; font-size: 1.4rem; color: #1F1A3D;
  background: var(--tc); border: var(--bw) solid var(--ink); border-radius: 999px; padding: 0.4rem 1rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 1.4rem var(--tc);
}
.sand-chip b { font-family: var(--num); font-weight: 400; }
.sand-chip.is-over { background: #B3121E; color: #FFF3E0; animation: lateShake .45s ease-in-out 4; }

/* ---------- Segnapunti dal vivo (TV) ---------- */
.live-box:empty { display: none; }
.live-scores { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ls-title { font-weight: 900; }
.live-scores ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.live-scores button {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; font: inherit; font-weight: 900; color: inherit;
  background: var(--paper); border: 0.15rem solid var(--ink); border-left: 0.45rem solid var(--pc); border-radius: 0.8rem; padding: 0.2rem 0.6rem 0.2rem 0.3rem;
}
.live-scores b { font-family: var(--num); font-weight: 400; font-size: 1.15rem; }
.live-scores li.is-lead button { background: var(--sun); color: #1F1A3D; box-shadow: 0 0 1rem rgba(255, 211, 77, 0.5); }
.rival-line { font-weight: 900; font-size: 1.05rem; color: var(--tomato); margin-top: 0.3rem; }
html.theme-show .rival-line { color: #FF8A3D; text-shadow: 0 0 0.6em rgba(255, 138, 61, 0.5); }

/* ---------- Quiz (TV) ---------- */
.quiz-show {
  position: fixed; inset: 0; z-index: 66; display: flex; padding: 2.4rem 3rem;
  background: var(--cream); background-image: var(--noise), radial-gradient(ellipse at 50% 0%, rgba(155, 123, 255, 0.35), transparent 60%);
  animation: fadeIn .3s both;
}
html.theme-show .quiz-show { background-color: #120A28; }
.qz-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qz-intro { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 1.3rem; text-align: center; max-width: 60rem; }
.qz-kicker { font-weight: 900; font-size: 1.3rem; letter-spacing: 0.04em; color: var(--ink-soft); }
.qz-big { font-size: 5.5rem; line-height: 1; }
html.theme-show .qz-big, html.theme-show .qz-question { text-shadow: var(--x3d); }
.qz-sub { font-size: 1.4rem; font-weight: 800; }
.qz-actions { display: flex; gap: 1rem; align-items: center; }
.qz-q { flex: 1; display: flex; flex-direction: column; gap: 1.6rem; min-height: 0; }
.qz-top { display: flex; align-items: center; justify-content: space-between; }
.qz-timer { width: 7.5rem; height: 7.5rem; }
.qz-question { font-size: 3.6rem; line-height: 1.08; text-align: center; max-width: 70rem; margin: 0 auto; }
.qz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; flex: 1; min-height: 0; }
.qz-opt {
  position: relative; display: flex; align-items: center; gap: 1.2rem; padding: 1rem 1.6rem;
  background: var(--oc); color: #1F1A3D; border: 0.3rem solid var(--ink); border-radius: 1.4rem;
  box-shadow: 0.4rem 0.4rem 0 var(--ink); transition: opacity .3s, transform .4s var(--bounce), filter .3s;
}
.qz-opt b { font-family: var(--display); font-weight: 400; font-size: 2.4rem; line-height: 1.05; }
.qz-shape { font-size: 2.4rem; }
.qz-opt.is-wrong { opacity: 0.35; filter: grayscale(0.6); }
.qz-opt.is-right { transform: scale(1.04); box-shadow: 0.4rem 0.4rem 0 var(--ink), 0 0 0 0.35rem #FFF, 0 0 2.6rem 0.6rem var(--oc); }
.qz-who { position: absolute; right: 1rem; bottom: 0.6rem; display: flex; }
.qz-who .avatar + .avatar { margin-left: -0.6rem; }
.qz-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.qz-count { display: flex; align-items: center; gap: 0.4rem; font-weight: 900; font-size: 1.2rem; }
.qz-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; min-width: min(36rem, 90vw); }
.qz-rank li {
  display: flex; align-items: center; gap: 0.8rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem;
  padding: 0.4rem 1rem; font-weight: 900; font-size: 1.4rem; animation: riseIn .5s calc(var(--i, 0) * .12s) both;
}
.qz-rank li > span:not(.avatar) { flex: 1; text-align: left; }
.qz-rank li b { font-family: var(--num); font-weight: 400; font-size: 1.8rem; }
.qz-rank li.is-top { background: var(--sun); color: #1F1A3D; box-shadow: 0 0 1.6rem rgba(255, 211, 77, 0.55); }

/* ---------- Allarme intrusi ---------- */
.knock-alarm {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; align-items: center; gap: 0.9rem; max-width: min(46rem, 92vw);
  background: #B3121E; color: #FFF3E0; border: var(--bw) solid var(--ink); border-radius: 1.1rem; padding: 0.7rem 1rem;
  box-shadow: 0.35rem 0.35rem 0 var(--ink), 0 0 2rem rgba(224, 38, 58, 0.6); font-weight: 800;
}
.knock-alarm.is-on { animation: lateShake .45s ease-in-out 3; }
.knock-alarm .btn-sec { color: #1F1A3D; background: #FFF3E0; }
.ka-ico { font-size: 2rem; }
.tool-sub { font-size: 1.05rem; margin-top: 0.6rem; }

/* ---------- Stagione ---------- */
.season-box { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.4rem; flex: 1; min-height: 0; }
.season-main, .season-side { padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; min-height: 0; overflow: auto; }
.season-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.season-row {
  display: flex; align-items: center; gap: 0.8rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem;
  padding: 0.4rem 0.9rem; animation: riseIn .45s calc(var(--i, 0) * .07s) both;
}
.season-row .brank { font-size: 1.9rem; min-width: 2.2rem; }
.season-row.is-lead { background: var(--sun); color: #1F1A3D; box-shadow: 0 0 1.5rem rgba(255, 211, 77, 0.45); }
.season-row.is-lead small { color: #4A4468; }
.sr-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sr-name b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.05; }
.sr-name small { font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }
.sr-pts { font-family: var(--num); font-size: 2rem; line-height: 1; }
.sr-pts small { font-family: var(--body); font-size: 0.9rem; margin-left: 0.15rem; }
.sr-gain { font-weight: 900; font-size: 0.95rem; background: var(--teal); color: #1F1A3D; border: 0.15rem solid var(--ink); border-radius: 999px; padding: 0.05rem 0.55rem; }
.sr-move { font-weight: 900; font-size: 0.95rem; }
.sr-move.is-up { color: #2FBF71; }
.sr-move.is-down { color: var(--tomato); }
.sr-move.is-new { color: var(--violet); }
.hall { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.hall li { display: flex; flex-direction: column; border-left: 0.4rem solid var(--sun); padding-left: 0.7rem; }
.hall-season { font-weight: 900; font-size: 0.9rem; color: var(--ink-soft); }
.hall b { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }
.awards .season-wrap { display: none; }
.awards.stage-season .season-wrap { display: block; flex: 1; min-height: 0; overflow: auto; max-width: 56rem; width: 100%; margin: 0 auto; }
.awards.stage-season .podium, .awards.stage-season .prizes, .awards.stage-season .champions, .awards.stage-season .champ-rule { display: none; }
.season-list--stage .season-row { padding: 0.55rem 1rem; }

/* ---------- Rivalità ---------- */
.rivals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; overflow: auto; min-height: 0; padding: 0.2rem; }
.rival {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 9rem; align-items: center; gap: 0.8rem; padding: 0.9rem 1rem;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--ca) 30%, transparent), transparent 35%, transparent 65%, color-mix(in srgb, var(--cb) 30%, transparent));
  animation: riseIn .45s calc(var(--i, 0) * .08s) both;
}
.rv-side { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.rv-side b { font-family: var(--display); font-weight: 400; font-size: 1.35rem; overflow-wrap: anywhere; }
.rv-mid { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; }
.rv-score { font-family: var(--num); font-size: 3rem; line-height: 1; }
.rv-score i { font-style: normal; margin: 0 0.25rem; color: var(--ink-soft); }
html.theme-show .rv-score { text-shadow: 0 0 0.5em rgba(255, 61, 203, 0.5); }
.rv-bar { width: 100%; height: 0.7rem; border-radius: 1rem; background: var(--cb); border: 0.15rem solid var(--ink); overflow: hidden; }
.rv-bar i { display: block; height: 100%; background: var(--ca); }
.rv-mid small { font-weight: 800; color: var(--ink-soft); }

/* ---------- Figurine ---------- */
.cards-lead { margin-bottom: 0.4rem; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.2rem; overflow: auto; min-height: 0; padding: 0.6rem 0.4rem 1rem; perspective: 1200px; }
.gcard {
  --a: #5B6CFF; --b: #7FD8FF; --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative; border-radius: 1.2rem; padding: 0.45rem; aspect-ratio: 5 / 7;
  background: linear-gradient(135deg, #FF3DCB, #FFD34D, #3DF5E0, #9B7BFF, #FF8A3D);
  box-shadow: 0.35rem 0.35rem 0 var(--ink); transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .15s ease-out;
  transform-style: preserve-3d; outline-offset: 4px;
}
.gcard--rara { --a: #2EC4B6; --b: #B5FFEF; }
.gcard--epica { --a: #9B5CFF; --b: #FF8FE0; }
.gcard--leggendaria { --a: #FFB000; --b: #FFF2A8; box-shadow: 0.35rem 0.35rem 0 var(--ink), 0 0 2rem rgba(255, 211, 77, 0.6); }
.gcard-in {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center;
  background: linear-gradient(180deg, var(--a), var(--b)); color: #1F1A3D; border: 0.22rem solid var(--ink); border-radius: 0.9rem; padding: 0.5rem 0.6rem 0.4rem; overflow: hidden;
}
.gcard-in::before {
  content: ''; position: absolute; inset: -40%; pointer-events: none; opacity: 0.18;
  background: repeating-conic-gradient(from 0deg, #FFF 0 8deg, transparent 8deg 22deg);
}
.gcard-top { position: relative; align-self: stretch; display: flex; justify-content: space-between; font-family: var(--num); font-size: 0.85rem; }
.gcard-art { position: relative; margin: 0.15rem 0; }
.gcard-art .avatar { border-width: 0.25rem; box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.6); }
.gcard-name { position: relative; font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.05; overflow-wrap: anywhere; }
.gcard-title { position: relative; font-weight: 900; font-size: 0.8rem; }
.gcard-stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.25rem; margin: 0.2rem 0 0; align-self: stretch; }
.gcard-stats div { background: rgba(255, 255, 255, 0.7); border: 0.12rem solid var(--ink); border-radius: 0.5rem; padding: 0.15rem 0; }
.gcard-stats dt { font-size: 0.55rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.gcard-stats dd { margin: 0; font-family: var(--num); font-size: 0.95rem; }
.gcard-fav, .gcard-crown { position: relative; font-size: 0.78rem; font-weight: 900; }
.gcard-foot { position: relative; margin-top: auto; align-self: stretch; display: flex; justify-content: space-between; font-weight: 900; font-size: 0.8rem; }
.gcard-stars { color: #1F1A3D; letter-spacing: 0.06em; }
.gcard-foil {
  position: absolute; inset: 0.45rem; border-radius: 0.9rem; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.55;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.85), transparent 40%),
    linear-gradient(115deg, transparent 30%, rgba(255, 61, 203, 0.35) 42%, rgba(61, 245, 224, 0.35) 50%, rgba(255, 211, 77, 0.35) 58%, transparent 70%);
  background-size: 100% 100%, 250% 250%; background-position: 0 0, var(--mx) var(--my);
}
.gcard--comune .gcard-foil { opacity: 0.25; }
.gcard--big { width: min(19rem, 80vw); margin: 0 auto; }
.gcard--big .gcard-name { font-size: 2rem; }
.gcard--big .gcard-stats dt { font-size: 0.62rem; }
.gcard--big .gcard-stats dd { font-size: 1.15rem; }
.gcard--missing { background: repeating-linear-gradient(45deg, rgba(128, 120, 160, 0.4) 0 0.5rem, transparent 0.5rem 1rem); box-shadow: none; }
.gcard--missing .gcard-in { background: var(--paper); color: var(--ink-soft); justify-content: center; border-style: dashed; }
.gcard-q { font-family: var(--num); font-size: 3rem; }
.gcards--mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; overflow: visible; }
.gcards--mini .gcard-name { font-size: 1.15rem; }
.my-card { perspective: 1000px; padding: 0.6rem 0 1rem; }
.card-album summary { cursor: pointer; font-weight: 900; padding: 0.6rem 0; }

/* ---------- Video ---------- */
.vd-bar { height: 1rem; border-radius: 1rem; border: var(--bw) solid var(--ink); background: var(--paper); overflow: hidden; margin: 0.6rem 0; }
.vd-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FF3DCB, #FFD34D); transition: width .2s linear; }
.vd-preview { display: block; max-height: 55vh; margin: 0.4rem auto 0.8rem; border: var(--bw) solid var(--ink); border-radius: 1rem; background: #000; }

/* ---------- Telefono: tavolo, segnapunti, quiz, rivalità ---------- */
.table-card { display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.table-card:not(:has(.tb-line)):has(.fuse--sand[hidden]) { display: none; }
.tb-line { font-size: 1.1rem; font-weight: 800; }
.tb-line--team { border-left: 0.5rem solid var(--tc); padding-left: 0.6rem; }
.fuse--sand { position: static; margin: 0; padding: 0.4rem 0; background: transparent; border: none; }
.score-card { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.sc-me { display: flex; align-items: center; gap: 0.4rem; }
.sc-btn {
  min-width: 3.2rem; min-height: 3.4rem; cursor: pointer; font-family: var(--display); font-size: 1.5rem; color: #1F1A3D;
  background: var(--sun); border: 0.22rem solid var(--ink); border-radius: 0.9rem; box-shadow: 0.25rem 0.25rem 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.sc-btn[data-sc^="-"] { background: #FFB3AC; }
.sc-btn:active { transform: translate(0.22rem, 0.22rem); box-shadow: 0 0 0 var(--ink); }
.sc-num { min-width: 5.5rem; text-align: center; font-family: var(--num); font-size: 2.6rem; line-height: 1; }
.sc-num.is-bump { animation: bump .25s var(--pop); }
.sc-list { list-style: none; margin: 0; padding: 0; align-self: stretch; display: flex; flex-direction: column; gap: 0.35rem; }
.sc-list li { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; }
.sc-list li > span:not(.avatar) { flex: 1; }
.sc-list li b { font-family: var(--num); font-weight: 400; }
.quiz-sheet {
  position: fixed; inset: 0; z-index: 70; overflow: auto; padding: max(1rem, env(safe-area-inset-top)) 1rem 1.5rem;
  background: var(--cream); background-image: var(--noise); animation: fadeIn .25s both;
}
.qs-in { max-width: 30rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.qs-kicker { font-weight: 900; color: var(--ink-soft); }
.qs-q { font-size: 1.7rem; line-height: 1.12; }
.qs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.qs-opt {
  min-height: 6.5rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; padding: 0.6rem;
  font: inherit; font-weight: 900; font-size: 1.05rem; color: #1F1A3D; text-align: center; overflow-wrap: anywhere;
  background: var(--oc); border: 0.25rem solid var(--ink); border-radius: 1.1rem; box-shadow: 0.3rem 0.3rem 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s;
}
.qs-opt .qz-shape { font-size: 1.6rem; }
.qs-opt:active:not(:disabled) { transform: translate(0.25rem, 0.25rem); box-shadow: 0 0 0 var(--ink); }
.qs-opt:disabled { cursor: default; }
.qs-opt:disabled:not(.is-mine):not(.is-right) { opacity: 0.45; }
.qs-opt.is-mine { outline: 0.3rem solid var(--ink); outline-offset: 0.15rem; }
.qs-opt.is-right { opacity: 1; box-shadow: 0 0 0 0.3rem #FFF, 0 0 1.4rem 0.3rem var(--oc); }
.qs-opt.is-wrong { opacity: 0.35; }
.qs-state { font-weight: 900; font-size: 1.2rem; text-align: center; }
.qz-rank--phone { min-width: 0; }
.qz-rank--phone li { font-size: 1.1rem; }
.rv-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.rv-list li { display: flex; align-items: baseline; gap: 0.6rem; font-weight: 800; }
.rv-n { flex: 1; }
.rv-s { font-family: var(--num); font-weight: 400; font-size: 1.15rem; }
.rv-s.is-up { color: #2FBF71; }
.rv-s.is-down { color: var(--tomato); }
.rv-list small { color: var(--ink-soft); }

/* ---------- Modalità leggera ---------- */
html.lite *, html.lite *::before, html.lite *::after { backdrop-filter: none !important; }
html.lite body { background-attachment: scroll; }
html.lite.theme-show body::after { display: none; }
html.lite .voter-av, html.lite .voter-think i, html.lite .vt-spark, html.lite .wheel-pin, html.lite .fuse-spark, html.lite .fuse-spark i { animation: none !important; }
html.lite .gcard-foil, html.lite .gcard-in::before { display: none; }
html.lite.theme-show .game-title, html.lite.theme-show .voting-title, html.lite.theme-show .awards-head h1, html.lite.theme-show .reveal-head h2, html.lite.theme-show .board-head h1 { text-shadow: 0 0.07em 0 #861B55; }
html.lite .vtimer svg { filter: none; }
html.safe-mode .quiz-show, html.safe-mode .quiz-sheet { animation: none; }

@media (max-width: 760px) {
  .tb-wheel, .tb-sand, .season-box, .rivals { grid-template-columns: 1fr; }
  .rival { grid-template-columns: 6rem minmax(0, 1fr) 6rem; }
}

/* ==========================================================================
   pre-partita (giochi sul tavolo, desideri, arrivi, scaletta, regole)
   ========================================================================== */

/* TV: lobby */
.prep { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.6rem 1rem; }
.prep:empty, .prep[hidden] { display: none; }
.prep-block {
  display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; max-width: 100%;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.45rem 0.8rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink); font-weight: 800;
}
.prep-block > b { font-size: 0.95rem; }
.prep-table { flex: 1 1 26rem; }
.prep-arrivals { border-color: var(--tomato); }
.prep-warn { color: var(--tomato); font-weight: 900; }
.prep-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.prep-chip { display: inline-flex; flex-direction: column; background: var(--cream); border: 0.15rem solid var(--ink); border-radius: 0.7rem; padding: 0.1rem 0.55rem; font-weight: 900; line-height: 1.15; }
.prep-chip em { font-style: normal; color: #C98500; }
.prep-chip small { font-weight: 800; font-size: 0.72rem; color: var(--ink-soft); }
.prep-plan { align-self: center; }
html.theme-show .prep-chip em { color: #FFD34D; }

/* TV: prossimo in scaletta, stelline */
.plan-next {
  display: flex; align-items: center; gap: 0.4rem; width: 100%; cursor: pointer; font: inherit; font-weight: 800; color: inherit; text-align: left;
  background: var(--cream); border: 0.15rem dashed var(--ink); border-radius: 0.8rem; padding: 0.35rem 0.7rem; margin-bottom: 0.4rem;
}
.plan-next b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.wish-n { font-style: normal; font-size: 0.85em; color: #C98500; }
html.theme-show .wish-n { color: #FFD34D; }

/* TV: scaletta */
.plan-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; max-height: 55vh; overflow: auto; }
.plan-item {
  display: grid; grid-template-columns: 4.2rem 3.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.8rem;
  background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.4rem 0.7rem;
  animation: riseIn .4s calc(var(--i, 0) * .06s) both;
}
.plan-item .game-img--thumb { width: 3.4rem; }
.plan-item.is-done { opacity: 0.5; }
.plan-time { font-family: var(--num); font-size: 1.15rem; }
.plan-name { display: flex; flex-direction: column; min-width: 0; }
.plan-name b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; line-height: 1.05; }
.plan-name small { font-weight: 800; color: var(--ink-soft); }
.plan-tools { display: flex; align-items: center; gap: 0.3rem; }
.plan-tools .icon-btn { width: 2.3rem; height: 2.3rem; font-size: 0.9rem; }
.plan-total { font-weight: 800; padding: 0.3rem 0.2rem; }

/* TV: regole */
.rules-grid { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1.6rem; }
.rules-main { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; max-height: 58vh; overflow: auto; }
.game-img--rules { width: 9rem; }
.rules-meta { font-weight: 900; color: var(--ink-soft); }
.rules-main h3 { font-size: 1.4rem; }
.rules-text { font-size: 1.25rem; font-weight: 700; white-space: pre-line; }
.rules-setup { margin: 0; padding-left: 1.3rem; font-size: 1.15rem; font-weight: 700; }
.rules-side { display: flex; flex-direction: column; gap: 0.7rem; }
.rules-clock { display: flex; flex-direction: column; align-items: center; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.5rem; }
.rules-clock span { font-weight: 900; color: var(--ink-soft); }
.rules-clock b { font-family: var(--num); font-size: 2.6rem; line-height: 1; }
.rules-teacher { font-size: 1.2rem; font-weight: 800; }
.rules-k { font-weight: 900; }
.rules-avs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rules-avs span { display: flex; flex-direction: column; align-items: center; font-weight: 800; font-size: 0.8rem; }
.rules-video { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.gs-f--full { grid-column: 1 / -1; }
.gs-grid textarea.input { resize: vertical; min-height: 4.5rem; font-weight: 700; }

/* Telefono: i giochi di stasera */
.tn-box { background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.6rem 0.9rem; box-shadow: 0.2rem 0.2rem 0 var(--ink); }
.tn-sum { font-weight: 800; }
.ag-new { padding: 0.7rem 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.ag-new > summary { cursor: pointer; font-family: var(--display); font-size: 1.25rem; }
.ag-new[open] > summary { margin-bottom: 0.6rem; }
.tn-row { padding: 0.25rem 0; border-bottom: 0.12rem dashed rgba(128, 120, 160, 0.35); }
.tn-row .lib-mini-text { flex: 1; }
.tn-row.is-on .lib-mini-text > span { color: var(--tomato); }
.tn-btn, .wish-btn {
  flex-shrink: 0; cursor: pointer; font: inherit; font-weight: 900; color: inherit;
  background: var(--paper); border: 0.18rem solid var(--ink); border-radius: 0.8rem; box-shadow: 0.18rem 0.18rem 0 var(--ink);
  min-height: 2.75rem; transition: transform .08s ease, box-shadow .08s ease;
}
.tn-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0 0.6rem; font-size: 0.9rem; }
.tn-btn[aria-pressed="true"] { background: var(--teal); color: #1F1A3D; }
.wish-btn { width: 2.75rem; font-size: 1.4rem; line-height: 1; }
.wish-btn[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
.tn-btn:active, .wish-btn:active { transform: translate(0.18rem, 0.18rem); box-shadow: none; }
.scan-sheet { display: flex; flex-direction: column; gap: 0.8rem; }
.scan-view { position: relative; overflow: hidden; border: var(--bw) solid var(--ink); border-radius: 1rem; background: #000; aspect-ratio: 4 / 3; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 0.2rem; background: #FF3B3B; box-shadow: 0 0 0.8rem #FF3B3B; animation: scanMove 1.6s ease-in-out infinite alternate; }
@keyframes scanMove { from { top: 25%; } to { top: 75%; } }
.scan-list { max-height: 40vh; overflow: auto; }
.scan-pick { display: flex; align-items: center; gap: 0.6rem; width: 100%; cursor: pointer; font: inherit; font-weight: 900; color: inherit; background: var(--paper); border: 0.15rem solid var(--ink); border-radius: 0.8rem; padding: 0.3rem 0.5rem; text-align: left; }
.rules-card { display: flex; flex-direction: column; gap: 0.6rem; text-align: left; }
.vlabel-sm { font-weight: 900; }
.rules-know { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.rules-know .btn-sec[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
.rules-card .rules-text { font-size: 1rem; }
.plan-card { text-align: left; }
.plan-card ol { margin: 0.4rem 0 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.25rem; font-weight: 800; }
.plan-card li.is-done { opacity: 0.5; text-decoration: line-through; }
.bring { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bring summary { cursor: pointer; font-weight: 900; }
.bring[open] { gap: 0.6rem; }
.bring-games { display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 12rem; overflow: auto; }

@media (max-width: 760px) {
  .rules-grid { grid-template-columns: 1fr; }
  .plan-item { grid-template-columns: 3.4rem minmax(0, 1fr) auto; }
  .plan-item .game-img--thumb { display: none; }
}

/* App Android: lettore di QR e piccoli ritocchi */
.qr-scan-btn { margin-top: 0.6rem; }
.home-card .qr-scan-btn { width: 100%; }
.scan-view--qr { aspect-ratio: 1 / 1; max-height: 60vh; margin: 0 auto; width: 100%; }
.scan-frame { position: absolute; inset: 16%; border: 0.25rem solid #FFFFFF; border-radius: 1.2rem; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); pointer-events: none; }
.home-apk { margin-top: 1rem; }
.home-apk a { font-weight: 800; }
.in-app .install-card { display: none; }

/* Pagina iniziale: palco con riflettori e marchio al neon (lo stesso dell'icona dell'app) */
.home-stage {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: clamp(0.6rem, 3vw, 1.6rem);
  padding: clamp(1rem, 4vw, 1.8rem) clamp(1rem, 4vw, 2.2rem);
  border: var(--bw, 3px) solid #1F1A3D; border-radius: 1.6rem;
  background: radial-gradient(ellipse at 30% 40%, #4A1D96 0%, #2A0F63 50%, #120830 100%);
  box-shadow: 0.35rem 0.35rem 0 #1F1A3D;
  color: #FFF4DE;
}
.home-stage::after {
  content: ""; position: absolute; inset: auto 8% -30% 8%; height: 60%; z-index: -1;
  background: radial-gradient(ellipse, rgba(255, 61, 203, 0.45), rgba(255, 61, 203, 0) 70%);
}
.stage-beam {
  position: absolute; top: -20%; width: 22%; height: 140%; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(255, 246, 200, 0.42), rgba(255, 246, 200, 0));
  filter: blur(6px); transform-origin: top center;
}
.stage-beam--l { left: 4%; transform: skewX(24deg); }
.stage-beam--r { right: 10%; transform: skewX(-24deg); }
.home-mark { width: clamp(5.5rem, 26vw, 10rem); height: auto; flex-shrink: 0; filter: drop-shadow(0 0.4rem 0.8rem rgba(10, 4, 32, 0.6)); animation: markFloat 4.5s ease-in-out infinite; }
.home-stage .logo--home { color: #FFF4DE; text-shadow: 0 0.06em 0 #1F1A3D, 0 0 0.35em rgba(255, 61, 203, 0.75); white-space: normal; }
.home-stage .logo-tag { color: #1F1A3D; background: #FFD34D; box-shadow: 0.08em 0.08em 0 #1F1A3D, 0 0 0.6em rgba(255, 211, 77, 0.6); }
@keyframes markFloat { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-0.45rem) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .home-mark { animation: none; } }
html.a11y-motion .home-mark, html.lite .home-mark { animation: none; }
@media (max-width: 420px) { .home-stage { flex-direction: column; text-align: center; gap: 0.2rem; padding-top: 0.6rem; } .home-mark { width: 9.5rem; margin-bottom: -0.4rem; } .home-stage .logo--home { font-size: 2.6rem; } }

/* ==========================================================================
   Armadio dei giochi
   ========================================================================== */

.arm-open { flex-direction: column; gap: 0.1rem; margin-top: 0.4rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.arm-open small { font-family: var(--body); font-weight: 800; font-size: 0.85rem; opacity: 0.75; }
.armadio-page { min-height: 100vh; min-height: 100dvh; padding: 1.2rem clamp(1rem, 3vw, 2.4rem) 2.4rem; display: flex; flex-direction: column; gap: 1.2rem; position: relative; z-index: 1; }
.armadio-page .armadio { width: min(80rem, 100%); margin: 0 auto; max-height: none; }
.armadio-inline { display: contents; }
.page-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; width: min(80rem, 100%); margin: 0 auto; }
.back-btn { gap: 0.35rem; font-weight: 900; }
.arm-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.lib-add-url { grid-column: 1 / -1; display: flex; gap: 0.6rem; align-items: center; }
.lib-add-url .input { flex: 1; min-width: 0; }
.input--sm { min-height: 2.6rem; padding-top: 0.35rem; padding-bottom: 0.35rem; font-size: 1rem; }
.lib-add.is-over { outline: 0.25rem dashed var(--teal); outline-offset: 0.4rem; border-radius: 1rem; }
.lib-add-img { width: 4.8rem; aspect-ratio: 4 / 3; height: auto; }
.lib-add-img img { object-fit: cover; }
.arm-sel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  padding: 0.6rem 0.9rem; border: var(--bw) dashed var(--ink); border-radius: 1rem;
  background: rgba(255, 201, 60, 0.14);
}
.arm-sel:empty { display: none; }
.arm-sel-n { font-weight: 900; }
.arm-sel .muted { flex: 1 1 18rem; }
.lib-sel {
  position: absolute; top: 0.85rem; right: 0.85rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer;
  padding: 0.15rem 0.55rem; border-radius: 1rem;
  background: rgba(31, 26, 61, 0.78); color: #FFF4DE; border: 0.14rem solid rgba(255, 255, 255, 0.35);
  font-weight: 900; font-size: 0.8rem;
}
.lib-sel[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; border-color: var(--ink); box-shadow: 0.15rem 0.15rem 0 var(--ink); }
.lib-tile.is-sel { border-color: var(--ink); box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 0 0.25rem var(--sun); }
.lib-tile .lib-edit, .lib-tile .lib-del { opacity: 0.9; }
@media (hover: hover) { .lib-tile .lib-edit, .lib-tile .lib-del { opacity: 0; } .lib-tile:hover .lib-edit, .lib-tile:hover .lib-del, .lib-tile .lib-edit:focus-visible, .lib-tile .lib-del:focus-visible { opacity: 1; } }

/* Scelta del prossimo gioco */
.pick-modes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; }
.pick-mode {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; cursor: pointer;
  padding: 0.5rem 0.3rem; min-height: 4.4rem; font-size: 1.5rem; line-height: 1;
  background: var(--paper); color: var(--ink); border: var(--bw) solid var(--ink); border-radius: 1rem;
  box-shadow: 0.22rem 0.22rem 0 var(--ink); transition: transform .12s;
}
.pick-mode b { font-family: var(--body); font-weight: 900; font-size: 0.9rem; }
.pick-mode:hover:not(:disabled) { transform: translateY(-2px); }
.pick-mode:active:not(:disabled) { transform: translate(0.12rem, 0.12rem); box-shadow: 0.08rem 0.08rem 0 var(--ink); }
.pick-mode:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
html.theme-show .pick-mode { background: rgba(37, 26, 82, 0.92); color: var(--fg); }
.pool-switch { display: inline-flex; border: var(--bw) solid var(--ink); border-radius: 1rem; overflow: hidden; flex-shrink: 0; }
.pool-opt { cursor: pointer; padding: 0.3rem 0.7rem; background: var(--paper); color: var(--ink); border: 0; font-weight: 900; font-size: 0.85rem; }
.pool-opt + .pool-opt { border-left: var(--bw) solid var(--ink); }
.pool-opt[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
.lib-pick-head { flex-wrap: wrap; }
.lib-chip.is-rolling { background: var(--sun); color: #1F1A3D; transform: translateY(-3px) scale(1.06); box-shadow: 0 0 0 0.25rem #FF3DCB, 0.2rem 0.2rem 0 var(--ink); }
.lib-played summary { cursor: pointer; font-weight: 900; font-size: 0.85rem; color: var(--ink-soft); }
.lib-played .lib-chips { padding-top: 0.4rem; }
@media (max-width: 900px) { .pick-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* QR "dal telefono" per la foto del gioco: il riquadro si allunga, il QR resta intero */
.photo-row .dropzone.is-phone, .next-card.has-lib .photo-row .dropzone.is-phone, .next-card.has-url .dropzone.is-phone { height: auto; min-height: 7rem; }
.dropzone.is-phone .phone-drop { padding: 0.7rem 1rem; }
.dropzone.is-phone .qr--sm { width: 8.5rem; }

/* Armadio sul telefono: aggiungere giochi con la foto */
.lb-add summary { cursor: pointer; list-style: none; }
.lb-add summary::-webkit-details-marker { display: none; }
.lb-add summary h2 { display: inline; }
.lb-add form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.8rem; }
.lb-photo { display: block; cursor: pointer; }
.lb-photo-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; overflow: hidden;
  width: 100%; aspect-ratio: 4 / 3; border: var(--bw) dashed var(--ink); border-radius: 1rem; background: var(--cream); text-align: center; padding: 0.6rem;
}
.lb-photo-box > span { font-size: 2.4rem; }
.lb-photo-box small { font-weight: 800; color: var(--ink-soft); }
.lb-photo-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 0.7rem; }
.lb-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.lb-row .select { flex: 1 1 6rem; }
.lb-item { position: relative; }
.lb-sel { top: 0.6rem; right: 0.6rem; }
.lb-tonight { position: absolute; top: 0.6rem; right: 0.6rem; font-weight: 900; font-size: 0.8rem; }
html[data-theme="night"] .lb-photo-box { background: rgba(255, 255, 255, 0.06); }
.lb-item:has(.lb-sel) .lb-head { padding-right: 6.6rem; }

/* Pulsanti "Indietro" */
.hdr-back { font-weight: 900; }
.create { position: relative; }
.create-back { position: absolute; top: 1.2rem; left: 1.2rem; z-index: 2; }
.ph-back { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.7rem; font-weight: 900; font-size: 0.95rem; text-decoration: none; }
.ph-back { flex-shrink: 0; min-width: 2.6rem; justify-content: center; font-size: 1.2rem; }

/* Nomi dei giocatori: carattere pieno e leggibile anche da lontano (non il titolo "cartoon") */
.slot-name, .panel-name, .vcard-who > span:last-child, .voter-name, .mvp-name, .champ-name, .at-name, .hof-who b, .win-av > span {
  font-family: var(--body); font-weight: 900; letter-spacing: -0.005em;
}
.panel-name { font-size: 1.35rem; }
.win-av { width: 5.2rem; color: var(--fg, var(--ink)); }
.win-av > span { font-size: 1rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-av .win-state { font-size: 0.74rem; font-weight: 800; color: inherit; opacity: 0.78; }
.win-av--winner .win-state { opacity: 1; }
html.theme-show .slot-name, html.theme-show .panel-name, html.theme-show .vcard-who > span:last-child, html.theme-show .win-av > span { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }

/* Donazioni (pagina iniziale) */
.home-donate { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.4rem 1.4rem; padding: 1.1rem 1.4rem; }
.home-donate h2 { grid-column: 1 / -1; font-size: 1.5rem; }
.home-donate p { font-weight: 700; margin: 0; }
/* Rosso del marchio Ko-fi con inchiostro scuro: 5,9:1 (in bianco era 3:1, sotto la soglia WCAG AA) */
.kofi-btn { background: #FF5E5B; color: #1A1236; white-space: nowrap; }
html.theme-show .kofi-btn, html[data-theme="night"] .kofi-btn { background: #FF5E5B; color: #1A1236; }
.kofi-btn:hover { background: #FF7572; }
@media (max-width: 560px) { .home-donate { grid-template-columns: 1fr; } .kofi-btn { justify-self: start; } }

/* Slider del voto: il colore finisce esattamente al centro del cursore, i numeri sotto ogni scatto */
.range--giant { --f: 0; max-width: 100%; }
.range--giant::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--vc) calc(1.85rem + (100% - 3.7rem) * var(--f)), var(--paper) calc(1.85rem + (100% - 3.7rem) * var(--f)));
}
.range--giant.is-untouched::-webkit-slider-runnable-track { background: var(--paper); }
.giant-wrap { overflow: visible; padding-right: 0.3rem; }
.ticks--giant { position: relative; display: block; height: 1.5rem; padding: 0; }
.ticks--giant span { position: absolute; top: 0; left: calc(1.85rem + (100% - 3.7rem) * var(--i) / 9); width: 2ch; margin-left: -1ch; text-align: center; }

/* ==========================================================================
   Telefono: barra di icone in basso e pannelli
   ========================================================================== */

body.has-dock .phone { padding-bottom: calc(6.2rem + env(safe-area-inset-bottom)); }
body.has-dock .buzz-fab { display: none; }
.ph-dock {
  position: fixed; z-index: 85; left: 50%; transform: translateX(-50%);
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  width: min(32rem, calc(100% - 1rem));
  display: flex; justify-content: space-around; gap: 0.2rem;
  padding: 0.35rem 0.4rem;
  background: rgba(31, 26, 61, 0.92); color: #FFF4DE;
  border: var(--bw) solid var(--ink); border-radius: 1.4rem;
  box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}
.dock-btn {
  position: relative; flex: 1 1 0; min-width: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  padding: 0.35rem 0.1rem 0.3rem; border: 0; border-radius: 1rem;
  background: transparent; color: inherit; font: inherit;
}
.dock-btn:active { transform: scale(0.94); }
.dock-btn[aria-pressed="true"] { background: rgba(255, 211, 77, 0.22); }
.dock-ico { font-size: 1.45rem; line-height: 1.1; }
.dock-btn small { font-size: 0.68rem; font-weight: 900; letter-spacing: 0.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-badge {
  position: absolute; top: 0.05rem; right: 18%;
  min-width: 1.1rem; height: 1.1rem; padding: 0 0.2rem; border-radius: 1rem;
  display: grid; place-items: center; font-style: normal; font-size: 0.7rem; font-weight: 900;
  background: #FF3DCB; color: #FFFFFF; border: 0.12rem solid #1F1A3D;
}
.dock-sheet .sheet { position: relative; padding-top: 1.1rem; max-height: min(78vh, 40rem); overflow-y: auto; }
.dock-sheet .sheet h2 { padding-right: 2.6rem; }
.sheet-x { position: absolute; top: 0.7rem; right: 0.7rem; }
.dock-body { display: flex; flex-direction: column; gap: 0.8rem; }
body.has-dock .dock-sheet { padding-bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
.sfx-grid--big { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sfx-grid--big .sfx-btn { min-height: 4.6rem; font-size: 1.6rem; }
.bet-clock { font-weight: 900; margin: 0; padding: 0.45rem 0.7rem; border-radius: 0.8rem; background: rgba(46, 196, 182, 0.18); }
.bet-clock.is-closed { background: rgba(255, 90, 78, 0.16); }
.bet-opt:disabled { opacity: 0.55; cursor: not-allowed; }
.bet-opt[aria-pressed="true"]:disabled { opacity: 1; }
.bet-banner {
  width: 100%; cursor: pointer; display: flex; align-items: center; gap: 0.6rem; text-align: left;
  padding: 0.8rem 1rem; border-radius: 1.1rem; border: var(--bw) solid var(--ink);
  background: linear-gradient(135deg, #9B7BFF, #FF3DCB); color: #FFFFFF; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0.25rem 0.25rem 0 var(--ink); animation: betPulse 2.2s ease-in-out infinite;
}
.bet-banner span { flex: 1; }
.bet-banner small { font-family: var(--num, var(--display)); font-size: 1.1rem; background: rgba(0, 0, 0, 0.25); padding: 0.1rem 0.5rem; border-radius: 0.6rem; }
.bet-banner.is-done { background: linear-gradient(135deg, #2EC4B6, #4D96FF); animation: none; }
@keyframes betPulse { 50% { box-shadow: 0.25rem 0.25rem 0 var(--ink), 0 0 1.4rem rgba(255, 61, 203, 0.7); } }
@media (prefers-reduced-motion: reduce) { .bet-banner { animation: none; } }
html.a11y-motion .bet-banner, html.lite .bet-banner { animation: none; }
.dock-btn small { font-size: 0.64rem; letter-spacing: -0.01em; }
/* Con la barra in basso, i pannelli che salgono dal fondo restano sopra la barra */
body.has-dock .overlay { padding-bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
body.has-dock .toast { bottom: calc(6.2rem + env(safe-area-inset-bottom)); }
body.has-dock .upd-banner, body.has-dock .undo-toast { bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
body.has-dock .regia-fab { bottom: calc(6rem + env(safe-area-inset-bottom)); }
.win-pick, .win-avs { flex-shrink: 0; }
html.theme-show .btn-sec[aria-pressed="true"], html.theme-show .btn-sec[aria-expanded="true"] { background: var(--sun); color: #1F1A3D; }
.home-arm a { color: inherit; text-underline-offset: 0.2em; }

/* Schermata iniziale della TV: tutto in una schermata (e l'armadio si scorre se ha tanti giochi) */
html.tv .create, html.tv .armadio-page { height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; }
.create { align-items: safe center; padding: 2rem 3rem; gap: 2rem 4rem; }
.create-hero { gap: 1.1rem; width: min(34rem, 100%); }
.create-hero .logo--xl { font-size: 4.4rem; }
.create-lead { font-size: 1.3rem; }
.create-card { gap: 0.8rem; padding: 1.5rem 1.8rem; width: min(30rem, 100%); }
.create-card h2 { font-size: 1.9rem; }
.count-row { width: 100%; display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; text-align: left; }
.count-row .field-label { margin: 0; }
.count-row .stepper output { font-size: 2.2rem; min-width: 3.4rem; }
/* 2.4: posti scrivibili (fino a 100) */
.step-num { font-family: var(--display); font-size: 2rem; width: 5.2rem; text-align: center; background: transparent; color: inherit; border: 2px solid rgba(255,255,255,.18); border-radius: 0.7rem; padding: 0.15rem 0.3rem; -moz-appearance: textfield; }
.step-num::-webkit-inner-spin-button, .step-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step-num:focus-visible { outline: 3px solid var(--sun, #FFD23F); outline-offset: 2px; }
.count-row .muted { flex: 1 1 8rem; }
.create-card .group-field { gap: 0.35rem; }
.create-card .btn-big { padding-top: 0.55em; padding-bottom: 0.6em; }
.create-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1.4rem; }
.arm-field { width: 100%; }
.arm-card { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.1rem 1.3rem; text-align: left; }
.arm-card h2 { font-size: 1.6rem; }
.arm-card p { margin: 0; }
.arm-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.arm-open-btn {
  display: inline-flex; align-items: baseline; gap: 0.4rem; cursor: pointer;
  padding: 0.45rem 0.85rem; border-radius: 0.9rem; border: var(--bw) solid var(--ink);
  background: var(--sun); color: #1F1A3D; font-weight: 900; font-size: 1rem; box-shadow: 0.18rem 0.18rem 0 var(--ink);
}
.arm-open-btn small { font-family: var(--num, var(--display)); font-size: 0.75rem; opacity: 0.7; }
.arm-open-btn:active { transform: translate(0.12rem, 0.12rem); box-shadow: none; }
.arm-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.arm-inline { display: flex; gap: 0.5rem; }
.arm-inline[hidden] { display: none; }
.arm-inline .input { flex: 1; min-width: 0; }
.arm-key { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.55rem 0.8rem; border: var(--bw) dashed var(--ink); border-radius: 1rem; font-weight: 700; }
.arm-key[hidden] { display: none; }

/* Avviso "pagina caricata a metà" (js/stale.js) */
.stale-banner {
  position: fixed; z-index: 200; left: 50%; top: 1rem; transform: translateX(-50%);
  width: min(36rem, calc(100% - 2rem)); display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start;
  padding: 1rem 1.2rem; border-radius: 1rem; border: 3px solid #1F1A3D;
  background: #FFF3C4; color: #1F1A3D; font: 700 1rem/1.4 'GNR UI', Nunito, system-ui, sans-serif; box-shadow: 0.3rem 0.3rem 0 #1F1A3D;
}
.stale-banner button { font: inherit; font-weight: 900; padding: 0.4rem 1rem; border-radius: 0.8rem; border: 3px solid #1F1A3D; background: #FFC93C; cursor: pointer; }
.stale-banner small { font-weight: 700; opacity: 0.8; }

/* ==========================================================================
   Regia (pagina TV) aperta sul telefono o nell'app: tutto in colonna,
   niente scorrimento laterale, barra in alto compatta
   ========================================================================== */

:root { --sat: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px)); --sab: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px)); }

@media (max-width: 760px) {
  html.tv { font-size: 14px; overflow-x: clip; }
  html.tv body { overflow-x: clip; overflow-y: auto; }
  html.tv .tv-shell { padding: 0 0.85rem 1.4rem; gap: 0.9rem; max-width: 100vw; }
  html.tv .screen, html.tv .screen > section { min-width: 0; max-width: 100%; }
  html.tv .screen > section > *, html.tv .screen > div > * { min-width: 0; }

  /* Barra in alto: logo e Indietro, poi i comandi in una striscia che scorre da sola */
  html.tv .topbar {
    position: sticky; top: 0; z-index: 30; flex-wrap: wrap; gap: 0.45rem;
    margin: 0 -0.85rem; padding: calc(var(--sat) + 0.5rem) 0.85rem 0.5rem;
    background: color-mix(in srgb, var(--bg-deep, #1C0B45) 88%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
  html:not(.theme-show) .tv-shell .topbar { background: color-mix(in srgb, var(--cream) 92%, transparent); }
  html.tv .brand-wrap { flex: 1 1 100%; align-items: center; gap: 0.5rem; }
  html.tv .brand-wrap .brand { font-size: 1.25rem; }
  html.tv .topbar-group { max-width: 40vw; font-size: 0.9rem; }
  html.tv #fsBtn, html.tv .chip--clock { display: none; }

  /* Pannelli e finestre: a tutta larghezza, dentro lo schermo */
  html.tv .overlay { padding: calc(var(--sat) + 0.6rem) 0.6rem calc(var(--sab) + 0.6rem); place-items: center; }
  html.tv .panel, html.tv .panel--wide, html.tv .panel--album, html.tv .panel--claim, html.tv .panel--proxy { width: 100%; max-width: 100%; padding: 1rem; max-height: calc(100dvh - var(--sat) - var(--sab) - 1.2rem); }
  html.tv .panel-head h2 { font-size: 1.6rem; }
  html.tv .panel-join { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  html.tv .panel-row { grid-template-columns: auto minmax(0, 1fr); }
  html.tv .panel-row > :nth-child(n+3) { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 760px) {
  html.tv .btn, html.tv .btn-big, html.tv .btn-sec { max-width: 100%; white-space: normal; }
  html.tv .stepper { flex-shrink: 0; }
  html.tv .tools-grid { grid-template-columns: minmax(0, 1fr); }
  html.tv .tool, html.tv .tool > * { min-width: 0; max-width: 100%; }
  html.tv .seg, html.tv .theme-switch, html.tv .segmented { flex-wrap: wrap; }
  html.tv .lib-add { grid-template-columns: auto minmax(0, 1fr); }
  html.tv .lib-add #lpSubmit, html.tv .lib-add [type="submit"] { grid-column: 1 / -1; }
  html.tv .arm-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
  html.tv .lib-add-url { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  /* Prossimo gioco */
  html.tv .idle { gap: 1.2rem; }
  html.tv .next-card { padding: 1rem; }
  html.tv .next-card h1, html.tv .next-card.has-lib h1 { font-size: 2rem; }
  html.tv .screen--idle .idle { height: auto; }
  html.tv .screen--idle .next-card { max-height: none; overflow: visible; }
  html.tv .ov-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
  html.tv .ov-row .btn-sec { white-space: normal; justify-content: center; }
  html.tv .ov-row .btn-big { grid-column: 1 / -1; }
  html.tv .screen--idle .next-card .ov-row { position: static; }
  html.tv .side-actions { gap: 0.5rem; }
  html.tv .side-actions .btn-sec { flex: 1 1 calc(50% - 0.5rem); justify-content: center; }
  html.tv .pick-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Votazione e reveal */
  html.tv .voting, html.tv .reveal { gap: 1.2rem; }
  html.tv .voting-title, html.tv .reveal-head h2, html.tv .board-head h1, html.tv .awards-head h1 { font-size: 2.1rem; }
  html.tv .voting-actions, html.tv .reveal-actions, html.tv .board-actions, html.tv .awards-actions { flex-wrap: wrap; justify-content: stretch; gap: 0.5rem; }
  html.tv .voting-actions > *, html.tv .reveal-actions > *, html.tv .board-actions > *, html.tv .awards-actions > * { flex: 1 1 auto; justify-content: center; white-space: normal; }
  html.tv .reveal-photo { margin-bottom: 1rem; }
  html.tv .avg-badge { right: 0.4rem; bottom: -0.8rem; width: 7.5rem; height: 7.5rem; }
  html.tv .avg-badge b { font-size: 3rem; }
  html.tv .avg-badge span { font-size: 0.85rem; }
  html.tv .vcards { --cols: 3 !important; gap: 0.6rem; }
  html.tv .vcard, html.tv .vcards--dense .vcard { height: 7.6rem; }
  html.tv .vcard-num, html.tv .vcards--dense .vcard-num { font-size: 2.8rem; }
  html.tv .crit-row, html.tv .crit-row--quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  html.tv .crit-tile { padding: 0.5rem 0.6rem; }
  html.tv .crit-tile b { font-size: 1.8rem; }
  html.tv .mvp-tile { grid-column: 1 / -1; }

  /* Classifica */
  html.tv .board-head { flex-wrap: wrap; gap: 0.3rem 1rem; }
  html.tv .board-list, html.tv .board-list--two { display: flex; flex-direction: column; padding-right: 0.2rem; }
  html.tv .brow, html.tv .board-list--two .brow, html.tv .brow--at { grid-template-columns: 2.2rem 3rem minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.45rem 0.7rem; }
  html.tv .brow .bcrit { display: none; }
  html.tv .brow .game-img--thumb { width: 3rem; }
  html.tv .brank { font-size: 1.7rem; }
  html.tv .bname b { font-size: 1.3rem; }
  html.tv .bavg { font-size: 1.9rem; }

  /* Premiazione */
  html.tv .awards-head { flex-wrap: wrap; }
  html.tv .podium, html.tv .awards.stage-podium .podium { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0; }
  html.tv .game-img--pod, html.tv .pod--1 .game-img--pod, html.tv .stage-podium .game-img--pod, html.tv .stage-podium .pod--1 .game-img--pod { width: 100%; }
  html.tv .pod-name, html.tv .stage-podium .pod-name { font-size: 1.1rem; }
  html.tv .pod-avg, html.tv .stage-podium .pod-avg { font-size: 1.2rem; }
  html.tv .pod-base, html.tv .stage-podium .pod-base { font-size: 2.2rem; }
  html.tv .stage-podium .pod--1 .pod-base { height: 6rem; }
  html.tv .stage-podium .pod--2 .pod-base { height: 4.5rem; }
  html.tv .stage-podium .pod--3 .pod-base { height: 3.2rem; }
  html.tv .award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  html.tv .award { height: 11rem; }
  html.tv .prize-title { font-size: 1.3rem; }

  /* Strumenti da tavolo: la ruota sta nello schermo */
  html.tv .wheel { width: min(100%, 62vh); }
  html.tv .tb-wheel > *, html.tv .tb-sand > * { min-width: 0; }
}
@media (max-width: 760px) {
  /* Schermata iniziale e armadio: Indietro sopra il logo, logo che sta nello schermo */
  html.tv .create, html.tv .armadio-page { padding: calc(var(--sat) + 0.7rem) 0.85rem 1.5rem; gap: 1.2rem; align-items: stretch; }
  html.tv .create-back { position: static; align-self: flex-start; }
  html.tv .create-hero .logo--xl, html.tv .armadio-page .logo--xl, html.tv .logo--xl { font-size: clamp(2.2rem, 11vw, 3rem); white-space: normal; }
  html.tv .create-hero { width: 100%; }
  html.tv .create-lead { font-size: 1.05rem; }
  html.tv .create-card, html.tv .arm-card { width: 100%; padding: 1rem; }

  /* Sondaggio */
  html.tv .poll-head { flex-wrap: wrap; align-items: flex-start; gap: 0.6rem; }
  html.tv .poll-head h1 { font-size: 2rem; }
  html.tv .poll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.6rem; }
  html.tv .poll-name { font-size: 1.15rem; overflow-wrap: normal; word-break: normal; hyphens: auto; }
  html.tv .poll-actions { flex-wrap: wrap; }
  html.tv .poll-actions > * { flex: 1 1 auto; }
  html.tv .poll-win { grid-template-columns: 1fr; gap: 1.2rem; padding: 0; }
  html.tv .win-title { font-size: 2.6rem; }
}

/* ==========================================================================
   Home personale (index.html): profilo, ingresso, armadi, gruppi
   ========================================================================== */

.hub { justify-content: flex-start; gap: 1rem; max-width: 34rem; padding: calc(var(--sat) + 0.9rem) 1rem calc(var(--sab) + 1.6rem); }
.hub .card { border-width: var(--bw); border-radius: 1.2rem; box-shadow: 0.3rem 0.3rem 0 var(--ink); }
.hub h2 { font-family: var(--body); font-weight: 900; font-size: 1.2rem; letter-spacing: 0; line-height: 1.2; }
.hub h3 { font-family: var(--body); font-weight: 900; font-size: 1rem; margin: 0.4rem 0 0.1rem; }
.hub p { line-height: 1.4; }

.hub-stage {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.8rem;
  padding: 0.85rem 0.9rem; border: var(--bw) solid #1F1A3D; border-radius: 1.3rem;
  background: radial-gradient(ellipse at 30% 40%, #4A1D96 0%, #2A0F63 55%, #120830 100%);
  box-shadow: 0.3rem 0.3rem 0 #1F1A3D; color: #FFF4DE;
}
.hub-stage::after { content: ""; position: absolute; inset: auto 8% -40% 8%; height: 70%; z-index: -1; background: radial-gradient(ellipse, rgba(255, 61, 203, 0.4), rgba(255, 61, 203, 0) 70%); }
.hub-mark { width: 4.4rem; height: auto; filter: drop-shadow(0 0.3rem 0.5rem rgba(10, 4, 32, 0.6)); animation: markFloat 4.5s ease-in-out infinite; }
.hub-title { min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.logo--hub { font-size: clamp(1.55rem, 7vw, 2.1rem); color: #FFF4DE; white-space: normal; text-shadow: 0 0.06em 0 #1F1A3D, 0 0 0.35em rgba(255, 61, 203, 0.7); }
.logo--hub .logo-tag { color: #1F1A3D; background: #FFD34D; font-size: 0.62em; vertical-align: 0.15em; }
.hub-lead { font-size: 0.86rem; font-weight: 700; color: #E9DDFF; line-height: 1.3; }
.hub-gear {
  align-self: start; width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer; font-size: 1.15rem; line-height: 1;
  background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.35); color: inherit;
}
.hub-gear:active { transform: scale(0.94); }
html.a11y-motion .hub-mark, html.lite .hub-mark { animation: none; }
@media (prefers-reduced-motion: reduce) { .hub-mark { animation: none; } }

.hub-me, .hub-join, .hub-sec { padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.hub-me-new { display: flex; gap: 0.8rem; align-items: center; }
.hub-me-new > div { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.hub-ico { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; flex-shrink: 0; font-size: 1.35rem; border-radius: 0.8rem; background: var(--cream); border: 2px solid var(--ink); }
.hub-ico--lg { width: 3.4rem; height: 3.4rem; font-size: 1.8rem; border-radius: 1rem; }
.hub-me-row { display: flex; gap: 0.9rem; align-items: center; }
.hub-av { position: relative; padding: 0; border: 0; background: none; cursor: pointer; flex-shrink: 0; }
.hub-av i { position: absolute; right: -0.2rem; bottom: -0.1rem; font-style: normal; font-size: 0.8rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); }
.hub-me-text { display: flex; flex-direction: column; min-width: 0; }
.hub-hello { font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }
.hub-name { font-family: var(--body); font-weight: 900; font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; }
.hub-meta { font-weight: 700; font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }
.hub-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.hub-row > .btn, .hub-row > .btn-sec { flex: 1 1 auto; }
.hub-row--3 { flex-wrap: nowrap; }
.hub-row--3 > * { flex: 1 1 0; min-width: 0; padding-left: 0.4em; padding-right: 0.4em; font-size: 0.88rem; }
.hub-row--end { justify-content: flex-end; }
.hub .btn { font-family: var(--body); font-weight: 900; font-size: 1.05rem; min-height: 2.9rem; padding: 0.6em 1.1em; box-shadow: 0.22rem 0.22rem 0 var(--tomato); }

.hub-scan { font-size: 1.15rem !important; min-height: 3.4rem !important; }
.hub-or { display: block; text-align: center; font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }
.hub-code { display: flex; flex-direction: column; gap: 0.35rem; }
.hub-code-row { display: flex; gap: 0.5rem; }
.hub-code-row .input { flex: 1; min-width: 0; }
.hub .code-input { font-size: 1.7rem; letter-spacing: 0.22em; min-height: 3.1rem; padding: 0.3rem 0.5rem; }
.hub .code-input--6 { font-size: 1.3rem; letter-spacing: 0.14em; }
.code-input--link { font-family: var(--body); font-weight: 900; font-size: 1.15rem !important; letter-spacing: 0.06em !important; }
.hub .form-error:empty { display: none; }

.hub-back[hidden] { display: none; }
.hub-back-link, .hub-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: 0.9rem;
  border: 2px solid var(--ink); background: var(--cream); color: inherit; text-decoration: none; min-height: 3.4rem;
}
.hub-back-link { background: var(--sun); color: #1F1A3D; box-shadow: 0.2rem 0.2rem 0 var(--ink); }
.hub-back-link > span:nth-child(2), .hub-item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-back-link b, .hub-item b { font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-back-link small, .hub-item small { font-weight: 700; font-size: 0.8rem; opacity: 0.8; }
.hub-go { font-size: 1.6rem; font-weight: 900; line-height: 1; opacity: 0.7; }
.hub-item--live { background: #FFE9E6; }
a.hub-item:active, .hub-back-link:active { transform: translate(1px, 1px); }

.hub-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.hub-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; padding: 0.9rem; text-align: left;
  color: inherit; text-decoration: none; font: inherit; cursor: pointer;
}
.hub-tile b { font-weight: 900; font-size: 1.05rem; }
.hub-tile small { font-weight: 700; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.3; }
.hub-tile:active { transform: translate(0.15rem, 0.15rem); box-shadow: 0.1rem 0.1rem 0 var(--ink) !important; }

.hub-sec[hidden] { display: none; }
.hub-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.hub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.hub-details summary { cursor: pointer; font-weight: 900; font-size: 0.9rem; color: var(--ink-soft); padding: 0.2rem 0; }
.hub-details[open] { display: flex; flex-direction: column; gap: 0.5rem; }
.hub-foot { text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: 0.3rem; }
.hub-foot a { color: inherit; }
.hub .home-donate { padding: 1rem; }
.hub .home-donate h2 { font-size: 1.2rem; }

.hub-overlay .sheet { gap: 0.7rem; }
.hub-overlay .panel-head h2, .hub-overlay h2 { font-family: var(--body); font-weight: 900; font-size: 1.3rem; }
.hub-overlay h3 { font-family: var(--body); font-weight: 900; font-size: 1rem; margin-top: 0.3rem; }
.hub-ed-top { display: flex; align-items: center; gap: 0.9rem; }
.av-grid--sm { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.hub-overlay .swatches { grid-template-columns: repeat(6, minmax(0, 2.5rem)); }
.hub-overlay .swatch { width: 2.5rem; height: 2.5rem; }
.hub-qr { width: min(15rem, 70vw); margin: 0 auto; background: #FFFFFF; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.5rem; }
.hub-qr svg { display: block; width: 100%; height: auto; }
.hub-link-code { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.hub-link-code .code-chip { font-size: 1.15rem; letter-spacing: 0.08em; }
.tr-groups { display: flex; flex-direction: column; gap: 0.5rem; }
.tr-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.6rem; align-items: center; padding: 0.6rem 0.75rem; border: 2px solid var(--ink); border-radius: 0.9rem; background: var(--cream); }
.tr-group > span.muted { grid-column: 1 / -1; }
.tr-bar { grid-column: 1 / -1; display: block; height: 0.45rem; border-radius: 1rem; background: rgba(31, 26, 61, 0.15); overflow: hidden; }
.tr-bar i { display: block; height: 100%; background: var(--violet); border-radius: inherit; }
.tr-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
.tr-item { display: flex; gap: 0.6rem; align-items: center; padding: 0.45rem 0.6rem; border-radius: 0.8rem; border: 2px solid var(--ink); background: var(--paper); }
.tr-item > span { font-size: 1.5rem; width: 2rem; text-align: center; }
.tr-item div { display: flex; flex-direction: column; min-width: 0; }
.tr-item small { font-weight: 700; font-size: 0.78rem; color: var(--ink-soft); }
.tr-item.is-off { opacity: 0.5; filter: grayscale(1); }
.intro-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; padding: 0.6rem 0.2rem; }
.intro-ico { font-size: 3.2rem; line-height: 1; }
.intro-step h2 { font-size: 1.45rem !important; }
.intro-step p { max-width: 30ch; font-weight: 700; }
.intro-dots { display: flex; justify-content: center; gap: 0.4rem; }
.intro-dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: rgba(31, 26, 61, 0.25); }
.intro-dots i.on { background: var(--violet); width: 1.4rem; border-radius: 1rem; }

html[data-theme="night"] .hub-ico, html[data-theme="night"] .hub-item, html[data-theme="night"] .tr-group { background: rgba(255, 255, 255, 0.06); }
html[data-theme="night"] .hub-item--live { background: rgba(255, 90, 78, 0.18); }
html[data-theme="night"] .tr-bar, html[data-theme="night"] .intro-dots i:not(.on) { background: rgba(255, 255, 255, 0.18); }

@media (min-width: 761px) {
  .hub { max-width: 46rem; }
  .hub-stage { padding: 1.2rem 1.4rem; }
  .hub-mark { width: 6rem; }
  .logo--hub { font-size: 2.6rem; }
  .hub-lead { font-size: 1rem; }
}

/* ==========================================================================
   Telefono: caratteri più leggibili (titoli "cartoon" solo dove sono grandi)
   ========================================================================== */
body.is-phone h2, .sheet h2, .sheet h3, .phone .ph-card h2, .dock-sheet h2 { font-family: var(--body); font-weight: 900; letter-spacing: 0; }
body.is-phone .phone h2 { font-size: 1.2rem; }
body.is-phone .ph-title { font-size: 2rem; line-height: 1.05; }
body.is-phone .btn { font-family: var(--body); font-weight: 900; font-size: 1.1rem; }
body.is-phone .input--xl { font-family: var(--body); font-weight: 900; font-size: 1.4rem; }
body.is-phone .home-name { font-family: var(--body); font-weight: 900; font-size: 1.3rem; }
body.is-phone .brand--sm { font-size: 1.15rem; }
body.is-phone { font-weight: 600; }
@media (max-width: 760px) {
  html.tv body { font-weight: 600; }
  html.tv .panel h2, html.tv .panel h3, html.tv .tool h3, html.tv .sheet h2 { font-family: var(--body); font-weight: 900; letter-spacing: 0; }
  html.tv .btn { font-family: var(--body); font-weight: 900; font-size: 1.1rem; }
  html.tv .input--xl, html.tv .next-card .input { font-family: var(--body); font-weight: 900; font-size: 1.3rem; }
  html.tv .logo, html.tv .ph-title, html.tv h1 { text-shadow: 0 0.05em 0 rgba(0, 0, 0, 0.35); }
}
.hdr-home { display: none; text-decoration: none; color: inherit; }
html.in-app .hdr-home { display: inline-flex; }
@media (max-width: 760px) { html.tv .hdr-home { display: inline-flex; } }
.ph-home {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; flex-shrink: 0; cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 0; color: inherit; background: var(--paper);
  border: 0.15rem solid var(--ink); border-radius: 50%; box-shadow: 0.12rem 0.12rem 0 var(--ink);
}
.ph-home:active { transform: translate(1px, 1px); box-shadow: none; }
a.ph-home { text-decoration: none; }

/* Barra di stato di Android (app a tutto schermo) e notch: niente sotto l'orologio */
.phone { padding-top: calc(var(--sat) + 0.9rem); padding-bottom: calc(var(--sab) + 1.4rem); }
.overlay--sheet { padding-top: calc(var(--sat) + 0.8rem); }
.stale-banner { top: calc(var(--sat) + 1rem); }
html.in-app .toast { bottom: calc(var(--sab) + 1.5rem); }
@media (max-width: 760px) {
  html.tv .create { flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; }
  html.tv .create-back { align-self: flex-start; }
}
.upd-x { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: inherit; font-weight: 900; cursor: pointer; line-height: 1; padding: 0; }
/* Sul telefono l'avviso sta in alto, sotto la barra di stato: non copre i pulsanti in fondo */
@media (max-width: 760px) {
  .upd-banner, body.has-dock .upd-banner { top: calc(var(--sat) + 0.5rem); bottom: auto; }
}
body.is-phone .vlabel { font-family: var(--body); font-weight: 900; font-size: 1.25rem; letter-spacing: 0; }
body.is-phone .vlabel .muted, body.is-phone .vlabel small { font-weight: 800; }

/* Finestra "Controlla la foto" (rotazione prima di salvare) */
.photo-edit { z-index: 120; }
.photo-edit .sheet { gap: 0.7rem; }
.photo-edit h2 { font-family: var(--body); font-weight: 900; font-size: 1.25rem; }
.pe-stage { display: grid; place-items: center; background: #1F1A3D; border: var(--bw) solid var(--ink); border-radius: 1rem; padding: 0.5rem; min-height: 12rem; }
.pe-stage img { display: block; max-width: 100%; max-height: min(52vh, 26rem); object-fit: contain; border-radius: 0.6rem; }
.pe-stage--game img { aspect-ratio: 4 / 3; width: 100%; }
.pe-stage--square img { width: min(14rem, 60vw); aspect-ratio: 1; border-radius: 50%; border: 0.25rem solid #FFF4DE; }
.pe-rot { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pe-rot .btn-sec { font-size: 1rem; }
html.tv .photo-edit .sheet { width: min(36rem, 100%); }

/* Armadio nella stanza: cambio armadio, prova in sola lettura */
.armadio .panel-head { flex-wrap: wrap; }
.armadio .panel-head h2 { flex: 1 1 auto; }
.arm-switch { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem 0.9rem; border: var(--bw) dashed var(--ink); border-radius: 1rem; }
.arm-switch[hidden], .arm-ro[hidden] { display: none; }
.arm-ro { padding: 0.55rem 0.8rem; border-radius: 0.9rem; background: #FFF3C4; color: #1F1A3D; border: 2px solid var(--ink); font-weight: 700; }
.armadio--ro #lpForm, .armadio--ro .lib-edit, .armadio--ro .lib-del, .armadio--ro #lpPhone, .armadio--ro #lpCsv, .armadio--ro #lpKey { display: none !important; }

/* Resoconto della serata */
.rs { max-width: 40rem; }
.rs-hero { display: flex; flex-direction: column; gap: 0.3rem; }
.rs-kicker { font-weight: 900; font-size: 0.85rem; color: var(--ink-soft); }
.rs-status { font-weight: 800; padding: 0.5rem 0.75rem; border-radius: 0.8rem; background: var(--cream); border: 2px solid var(--ink); }
.rs-sec { font-family: var(--body); font-weight: 900; font-size: 1.2rem; margin-top: 0.4rem; }
.rs-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.rs-board li { display: grid; grid-template-columns: 2.2rem 3rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border: 2px solid var(--ink); border-radius: 0.9rem; background: var(--paper); }
.rs-board li:first-child { background: var(--sun); color: #1F1A3D; }
.rs-rank { font-family: var(--display); font-size: 1.5rem; text-align: center; display: flex; flex-direction: column; line-height: 1; }
.rs-rank small { font-family: var(--body); font-size: 0.6rem; font-weight: 900; }
.rs-name { display: flex; flex-direction: column; min-width: 0; }
/* 1.11: sul telefono il nome del gioco va su due righe invece di troncarsi dopo poche lettere */
.rs-name b { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; line-height: 1.2; }
.rs-game summary { min-height: 2.75rem; display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.rs-votes li > span { overflow-wrap: anywhere; min-width: 0; }
.rs-name small { font-weight: 700; font-size: 0.78rem; opacity: 0.8; }
.rs-avg { font-family: var(--display); font-size: 1.6rem; }
.rs-game { gap: 0.45rem; }
.rs-game-head { display: flex; gap: 0.7rem; align-items: center; }
.rs-game-head h3 { font-family: var(--body); font-weight: 900; font-size: 1.15rem; }
.rs-game .game-img--thumb, .rs-board .game-img--thumb { width: 3rem; flex-shrink: 0; }
.rs-warn { padding: 0.45rem 0.65rem; border-radius: 0.8rem; background: #FFF3C4; color: #1F1A3D; border: 2px solid var(--ink); font-weight: 800; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rs-chip { background: var(--cc); color: #1F1A3D; border: 2px solid var(--ink); border-radius: 999px; padding: 0.1rem 0.55rem; font-weight: 900; font-size: 0.85rem; }
.rs-votes, .rs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.rs-votes li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.6rem; padding: 0.3rem 0.5rem; border-bottom: 1px dashed rgba(31, 26, 61, 0.25); }
.rs-votes em { grid-column: 1 / -1; font-size: 0.85rem; color: var(--ink-soft); }
.rs-people { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.rs-person { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 800; }
@media print {
  .rs-top .ph-right, .rs .btn-sec, .stale-banner, #toast { display: none !important; }
  body { background: #fff !important; }
  .rs { max-width: none; }
  .rs .card { box-shadow: none; break-inside: avoid; }
}
.hub-create .btn { text-decoration: none; }
.hub-create p { margin: 0; }
.poll-opt[aria-pressed="true"] { background: var(--sun); transform: translate(-2px, -2px); box-shadow: 0.35rem 0.35rem 0 var(--ink); }
.poll-opt-check { font-weight: 900; }
.poll-max { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.4rem; }
.poll-max:empty { display: none; }
.poll-max .field-label { margin: 0; }
.audio-hint {
  position: fixed; z-index: 97; left: 50%; top: calc(var(--sat) + 4.2rem); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 0.5rem; max-width: calc(100% - 1.6rem); cursor: pointer;
  padding: 0.55rem 1rem; border-radius: 999px; border: var(--bw) solid #1F1A3D; background: #FFF3C4; color: #1F1A3D;
  font: 900 1rem/1.25 var(--body); box-shadow: 0.25rem 0.25rem 0 #1F1A3D; animation: panelIn .3s var(--pop) both;
}

/* Tavolo di verifica */
.st-back { align-self: flex-start; text-decoration: none; }
.st-area { display: block; font-weight: 900; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.check.is-skip .check-ico { background: #FFF3C4; color: #1F1A3D; }
.st-own summary { cursor: pointer; }
.st-own[open] { display: flex; flex-direction: column; gap: 0.5rem; }
.st-table-wrap { overflow-x: auto; }
.st-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.st-table th, .st-table td { text-align: left; vertical-align: top; padding: 0.45rem 0.5rem; border-bottom: 1px solid rgba(31, 26, 61, 0.2); }
.st-table th { font-weight: 900; }
.st-table td:nth-child(2) { white-space: nowrap; font-weight: 900; }
.st-fail td { background: rgba(255, 90, 78, 0.12); }
.st-skip td { background: rgba(255, 201, 60, 0.12); }
@media (max-width: 560px) {
  .st-table thead { display: none; }
  .st-table tr { display: block; border-bottom: 2px solid var(--ink); padding: 0.4rem 0; }
  .st-table td { display: block; border: 0; padding: 0.15rem 0.3rem; }
}

/* ==========================================================================
   Home: griglia vera (telefono una colonna, tablet due, desktop più colonne)
   e testi più grandi e leggibili
   ========================================================================== */

/* Testi secondari: mai minuscoli */
.small { font-size: 0.92rem; }
html[data-theme="night"] .input::placeholder { color: rgba(244, 236, 220, 0.6); }
.hub { gap: 1.1rem; }
.hub p { line-height: 1.5; }
.hub-lead { font-size: 0.98rem; line-height: 1.4; }
.hub-meta, .hub-back-link small, .hub-item small { font-size: 0.9rem; }
.hub-tile small { font-size: 0.92rem; line-height: 1.4; }
.hub-or { font-size: 0.95rem; }
.hub .muted.small, .hub-create p { font-size: 0.95rem; line-height: 1.45; }
.hub-details summary { font-size: 0.95rem; }
.hub-foot { font-size: 0.9rem; }
.hub .credits { font-size: 0.85rem; }
.hub-more, .hub-extra { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.hub-more:not(:has(> :not([hidden]))) { display: none; }
.hub-extra .home-donate { margin: 0; }
.hub-tile b { font-size: 1.1rem; }
.hub-ico { width: 2.6rem; height: 2.6rem; font-size: 1.45rem; }

/* Tablet e finestre medie: due colonne dove le schede restano leggibili */
@media (min-width: 760px) {
  .hub {
    max-width: 62rem; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start; gap: 1.2rem; padding: calc(var(--sat) + 1.4rem) 1.6rem 2rem;
  }
  .hub > * { grid-column: 1 / -1; min-width: 0; }
  .hub > .hub-join { grid-column: span 6; align-self: stretch; }
  .hub-join, .hub-me, .hub-sec { padding: 1.25rem 1.35rem; }
  .hub-create { justify-content: space-between; }
  .hub h2 { font-size: 1.3rem; }
  .hub-more, .hub-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
  .hub-more:not(:has(> :not([hidden]))) { display: none; }
  .hub-extra > * { align-self: stretch; }
  .hub-tile { padding: 1.1rem 1.2rem; flex-direction: row; align-items: center; gap: 0.9rem; }
  .hub-tile > b, .hub-tile > small { display: block; }
  .hub-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.9rem; row-gap: 0.15rem; }
  .hub-tile .hub-ico { grid-row: 1 / span 2; width: 3.2rem; height: 3.2rem; font-size: 1.7rem; }
  .home-donate { grid-template-columns: minmax(0, 1fr); }
  .kofi-btn { justify-self: start; }
}

/* Desktop: contenitore ampio, intestazione a tutta larghezza, azioni affiancate, profilo accanto alle tue cose */
@media (min-width: 1100px) {
  html:not(.tv) { font-size: 17px; }
  .hub { max-width: 84rem; gap: 1.4rem; padding: 1.8rem 2.4rem 2.4rem; }
  .hub-stage { padding: 1.6rem 2rem; gap: 1.6rem; }
  .hub-mark { width: 6.6rem; }
  .logo--hub { font-size: 3.1rem; }
  .hub-lead { font-size: 1.15rem; max-width: 52ch; }
  .hub > .hub-join { grid-column: span 6; }
  .hub > .hub-me { grid-column: span 5; align-self: stretch; }
  .hub > .hub-tiles { grid-column: span 7; align-self: stretch; grid-auto-rows: 1fr; }
  .hub-tile { height: 100%; }
  .hub h2 { font-size: 1.4rem; }
  .hub-scan { max-width: none; }
  .hub .code-input { font-size: 2rem; }
  .hub-more { grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)); }
  .hub-extra { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .hub-extra:not(:has(> .hub-app:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
  .hub-extra:not(:has(> .hub-app:not([hidden]))) .home-donate { grid-template-columns: minmax(0, 1fr) auto; }
  .hub-extra:not(:has(> .hub-app:not([hidden]))) .kofi-btn { justify-self: end; }
}
@media (min-width: 1600px) {
  html:not(.tv) { font-size: 18px; }
  .hub { max-width: 92rem; }
}
@media (min-width: 760px) {
  .hub-tile { align-content: center; }
  .hub-tile > b { align-self: end; }
  .hub-tile > small { align-self: start; }
}

/* ==========================================================================
   Tavolo di verifica: gruppi per area, colonne su schermi larghi
   ========================================================================== */
.st-page { gap: 1.1rem; }
.st-head { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.st-head .ph-lead { max-width: 62ch; font-size: 1.02rem; line-height: 1.5; }
.st-side { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.st-summary h2 { font-size: 1.25rem; }
.st-live { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.2rem 0 0; }
.st-live span { padding: 0.25rem 0.7rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font-weight: 900; font-size: 1rem; }
.st-groups { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.st-group { padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; break-inside: avoid; min-width: 0; }
.st-group.has-fail { box-shadow: 0.3rem 0.3rem 0 var(--tomato); }
.st-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-family: var(--body); font-weight: 900; font-size: 1.15rem; letter-spacing: 0; }
.st-count { font-size: 0.9rem; font-weight: 800; color: var(--ink-soft); }
.st-group .check { padding: 0.65rem 0.8rem; }
.st-group .check b { font-size: 1.02rem; line-height: 1.3; }
.st-group .check p { font-size: 0.95rem; line-height: 1.45; }
.st-table { font-size: 0.95rem; }
.st-foot { align-self: center; }

@media (min-width: 900px) {
  body.is-phone .st-page {
    max-width: 84rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
    grid-template-areas: "head side" "groups groups" "matrix matrix" "foot foot";
    align-items: start; gap: 1.4rem 2rem; padding-left: 2rem; padding-right: 2rem;
  }
  .st-head { grid-area: head; }
  .st-side { grid-area: side; }
  .st-groups { grid-area: groups; display: block; columns: 2 26rem; column-gap: 1.4rem; }
  .st-groups > .st-group { margin: 0 0 1.4rem; display: flex; }
  .st-matrix { grid-area: matrix; }
  .st-foot { grid-area: foot; }
  .st-page .ph-title { font-size: 2.4rem; }
}
@media (min-width: 1500px) {
  .st-groups { columns: 3 24rem; }
}
.st-live span { color: inherit; }
.summary-ok .st-live span, .summary-fail .st-live span { background: #FFFFFF; color: #1F1A3D; border-color: #1F1A3D; }
.summary-ok .link-btn, .summary-fail .link-btn { color: #1F1A3D; }

/* Resoconto e armadio sul telefono: su schermi larghi non più una colonna stretta */
.rs-games { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (min-width: 900px) {
  body.is-phone .phone.rs {
    max-width: 80rem; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-auto-flow: row dense;
    align-items: start; gap: 1.2rem 1.6rem; padding-left: 2rem; padding-right: 2rem;
  }
  .phone.rs > * { grid-column: 1 / -1; min-width: 0; }
  .phone.rs > .rs-board-card { grid-column: 1; grid-row: span 3; align-self: start; }
  .phone.rs > .rs-players, .phone.rs > .rs-awards, .phone.rs > .rs-trash { grid-column: 2; }
  .rs-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); align-items: start; }
  .phone.rs > .rs-home { justify-self: center; width: auto; min-width: 18rem; }
  body.is-phone .phone.lb { max-width: 72rem; padding-left: 2rem; padding-right: 2rem; }
  .phone.lb .lb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.9rem; align-items: start; }
  .phone.lb .lb-add { max-width: 46rem; }
}
@media (max-width: 760px) {
  html.tv .quiz-show { padding: calc(var(--sat) + 1rem) 1rem calc(var(--sab) + 1rem); overflow-y: auto; }
  html.tv .qz-big { font-size: clamp(2.4rem, 13vw, 3.6rem); overflow-wrap: anywhere; }
  html.tv .qz-sub { font-size: 1.1rem; }
  html.tv .qz-question { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  html.tv .qz-opts { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  html.tv .qz-opt { padding: 0.7rem 1rem; }
  html.tv .qz-timer { width: 4.5rem; height: 4.5rem; }
  html.tv .qz-actions { flex-wrap: wrap; justify-content: center; }
}

/* ==========================================================================
   Armadio organizzato (1.2): pagina armadio.html
   ========================================================================== */
main.phone.am { max-width: 78rem; gap: 0.9rem; padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
body.am-selecting main.phone.am { padding-bottom: calc(var(--sab) + 11rem); }
.am-hero { padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 0.75rem; }
.am-title { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.am-emoji { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.am-title-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.am-title-text h1 { font-size: clamp(1.6rem, 5.5vw, 2.4rem); overflow-wrap: anywhere; }
.am-desc { font-weight: 700; color: var(--ink-soft); }
.am-meta { font-size: 0.92rem; color: var(--ink-soft); }
.am-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.am-stats > span { padding: 0.2rem 0.7rem; border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); font-size: 0.95rem; }
.am-stats > span.is-warn { background: #FFE3DF; color: #1F1A3D; border-color: var(--tomato); }
.am-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.am-actions > .btn, .am-actions > .btn-sec { flex: 1 1 auto; font-size: 1.05rem; min-height: 2.9rem; text-decoration: none; }
.am-actions > .btn { font-size: 1.15rem; }
.am-migr { font-size: 0.92rem; }

.am-tabs { display: flex; gap: 0.45rem; overflow-x: auto; padding: 0.15rem 0.1rem 0.45rem; scrollbar-width: thin; }
.am-tabs[hidden] { display: none; }
.am-tab { flex-shrink: 0; border: var(--bw) solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); padding: 0.45rem 0.95rem; font: inherit; font-weight: 900; cursor: pointer; min-height: 2.7rem; }
.am-tab[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; box-shadow: 0.15rem 0.15rem 0 var(--ink); }
.am-tab small { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border-radius: 999px; background: var(--tomato); color: #FFFFFF; font-size: 0.8rem; text-align: center; }

.am-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.am-side { display: none; }
.am-main { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.am-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.am-toolbar .am-search { flex: 1 1 100%; min-width: 0; }
.am-toolbar > .btn-sec { min-height: 2.7rem; font-size: 0.98rem; padding: 0.35em 0.8em; }
.am-toolbar .am-sort { width: auto; flex: 1 1 9rem; min-height: 2.7rem; font-size: 0.98rem; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.am-views button { font-size: 0.92rem; padding: 0.35rem 0.7rem; min-height: 2.5rem; }
.am-toolbar > .btn-sec[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
.am-filter-btn b { color: var(--tomato); }
.am-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.am-chips:empty { display: none; }
.am-chip { border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); color: #1F1A3D; font: inherit; font-weight: 900; font-size: 0.88rem; padding: 0.2rem 0.65rem; cursor: pointer; }
.am-count { color: var(--ink-soft); font-size: 0.95rem; }
.am-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 0.6rem; }
.am-f { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.am-f .field-label { margin: 0; font-size: 0.9rem; }
.am-f .select--sm, .am-f .input--sm { width: 100%; }
.am-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; }
.am-checks { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; }
.am-checks .quick-toggle, .am-form .quick-toggle, .am-overlay .quick-toggle { white-space: normal; }
.am-filters-sheet .am-fgrid { grid-template-columns: 1fr 1fr; }

/* Griglia di schede */
.am-list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.4rem), 1fr)); gap: 0.8rem; }
.am-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; cursor: pointer; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; box-shadow: 0.25rem 0.25rem 0 var(--ink); }
.am-card:hover { transform: translate(-1px, -1px); box-shadow: 0.32rem 0.32rem 0 var(--ink); }
.am-card.is-sel { outline: 0.25rem solid var(--tomato); outline-offset: 0.12rem; }
.am-card > .am-img { width: 100%; border: none; border-bottom: var(--bw) solid var(--ink); border-radius: 0; box-shadow: none; }
.am-card-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.5rem 0.6rem 0.65rem; min-width: 0; }
.am-name { font-size: 1.02rem; line-height: 1.2; overflow-wrap: anywhere; }
.am-card-body small { font-size: 0.8rem; overflow-wrap: anywhere; }
.am-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.82rem; }
.am-badges:empty, .am-tags:empty { display: none; }
.am-badges > span { padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--cream); border: 1.5px solid var(--ink); white-space: nowrap; }
.am-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.am-tag { display: inline-block; padding: 0.08rem 0.5rem; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.78rem; font-weight: 900; background: var(--paper); color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.am-tag--ok { background: #D4F5EF; color: #1F1A3D; }
.am-tag--off { background: #ECE8F7; color: #1F1A3D; }
.am-tag--late { background: #FFD3CD; color: #8A1A12; border-color: #B3261E; }
.am-tag--new { background: #E7DEFF; color: #3B2394; }
.am-loc { color: var(--ink-soft); }
.am-warn { color: var(--error); font-weight: 900; }
.am-check { position: absolute; top: 0.4rem; left: 0.4rem; z-index: 2; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 0.6rem; background: var(--paper); border: 2px solid var(--ink); cursor: pointer; }
.am-check input { width: 1.25rem; height: 1.25rem; accent-color: var(--tomato); margin: 0; }
.am-check--inline { position: static; width: 2rem; height: 2rem; flex-shrink: 0; }

/* Immagini dell'armadio: miniature ritagliate, foto grande intera */
.am-img .gi-fg { object-fit: cover; }
.am-img .gi-bg { display: none; }
.am-img--big .gi-fg { object-fit: contain; }
.am-img--big .gi-bg { display: block; }
.am-img--big { width: 100%; border: var(--bw) solid var(--ink); border-radius: 1rem; }
.am-img--xs, .am-img--spine { width: 3.3rem; flex-shrink: 0; border: 2px solid var(--ink); border-radius: 0.55rem; }
.am-img.game-img--empty span { font-size: 1.6rem; }
.am-img--xs.game-img--empty span, .am-img--spine.game-img--empty span { font-size: 0.8rem; border-width: 1.5px; border-radius: 0.35rem; padding: 0.1em 0.3em; }

/* Lista a tabella */
.am-table { background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; overflow: hidden; }
.am-tr { display: grid; grid-template-columns: 4rem minmax(0, 2.4fr) 5.5rem 4.5rem minmax(0, 1.8fr) minmax(0, 9.5rem); gap: 0.6rem; align-items: center; padding: 0.45rem 0.7rem; border-top: 2px dashed rgba(31, 26, 61, 0.22); cursor: pointer; }
.am-tr:first-child { border-top: none; }
.am-th { cursor: default; font-size: 0.85rem; color: var(--ink-soft); background: var(--cream); }
.am-tr:not(.am-th):hover { background: var(--cream); }
.am-tr.is-sel { background: #FFF3C4; color: #1F1A3D; }
.am-td-img { display: flex; align-items: center; gap: 0.35rem; }
.am-td-name { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; overflow-wrap: anywhere; }
.am-td-name small { font-size: 0.8rem; color: var(--ink-soft); }
.am-td-loc { font-size: 0.92rem; overflow-wrap: anywhere; }

/* Vista per scaffali */
.am-list--shelves { display: flex; flex-direction: column; gap: 0.9rem; }
.am-shelf { background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; overflow: hidden; }
.am-shelf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; padding: 0.6rem 0.8rem; background: var(--cream); border-bottom: var(--bw) solid var(--ink); }
.am-shelf-head h3 { font-size: 1.2rem; flex: 1 1 auto; overflow-wrap: anywhere; }
.am-shelf-items { display: flex; flex-direction: column; }
.am-shelf-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; padding: 0.45rem 0.8rem; background: none; border: none; border-top: 2px dashed rgba(31, 26, 61, 0.2); font: inherit; color: inherit; cursor: pointer; }
.am-shelf-item:first-child { border-top: none; }
.am-shelf-item:hover { background: var(--cream); }
.am-shelf-item.is-sel { background: #FFF3C4; color: #1F1A3D; }
.am-shelf-item > span:not(.am-tag):not(.am-tick) { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.am-shelf-item small { font-size: 0.8rem; color: var(--ink-soft); }
.am-tick { font-size: 1.2rem; flex-shrink: 0; }

/* Barra della selezione multipla */
.am-selbar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 0.7rem); width: min(60rem, calc(100% - 1.4rem)); display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.65rem 0.8rem; background: #1F1A3D; color: #FFF4DE; border: var(--bw) solid #05040C; border-radius: 1.2rem; box-shadow: 0.3rem 0.3rem 0 var(--tomato); }
.am-selbar[hidden] { display: none; }
.am-selbar .btn-sec { background: #FFFFFF; color: #1F1A3D; }
.am-selbar .btn { background: var(--sun); color: #1F1A3D; border-color: #05040C; }
.am-selbar .link-btn { color: #FFF4DE; }
.am-selbar button[disabled] { opacity: 0.45; }
.am-sel-n { flex: 1 0 100%; font-size: 0.95rem; }
.am-danger { color: var(--error); }
.am-selbar .am-danger { color: #B3261E; }

/* Finestre */
.am-overlay .sheet { gap: 0.8rem; }
.am-overlay .sheet .panel-head h2 { font-size: 1.5rem; overflow-wrap: anywhere; }
.sheet.am-sheet--wide { width: min(50rem, 100%); }
.am-sheet-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
.am-sheet-img { max-width: 24rem; width: 100%; justify-self: center; }
.am-sheet-info { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.am-kvs { display: flex; flex-direction: column; }
.am-kv { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.3rem 0; border-bottom: 2px dashed rgba(31, 26, 61, 0.18); }
.am-kv span { color: var(--ink-soft); }
.am-kv b { text-align: right; overflow-wrap: anywhere; }
.am-sec { display: flex; flex-direction: column; gap: 0.45rem; padding-top: 0.7rem; border-top: var(--bw) dashed rgba(31, 26, 61, 0.3); }
.am-sec h3, .am-sec > summary { font-size: 1.15rem; }
.am-where { align-self: flex-start; font-size: 1.15rem; font-weight: 900; padding: 0.35rem 0.8rem; border-radius: 0.8rem; background: #FFF3C4; color: #1F1A3D; border: 2px solid var(--ink); overflow-wrap: anywhere; }
.am-minis { display: flex; flex-direction: column; gap: 0.4rem; }
.am-mini { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.6rem; align-items: center; width: 100%; text-align: left; padding: 0.4rem 0.6rem; background: var(--cream); color: inherit; border: 2px solid var(--ink); border-radius: 0.8rem; font: inherit; cursor: pointer; }
.am-mini > .am-img { grid-row: span 2; }
.am-mini small { font-size: 0.82rem; color: var(--ink-soft); }
.am-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 700; }
.am-mini-list { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.95rem; }
.am-sheet-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.am-sheet-actions:empty { display: none; }
.am-sheet-actions > * { flex: 1 1 auto; }

.am-form { display: flex; flex-direction: column; gap: 0.75rem; }
.am-form label:not(.quick-toggle), .am-overlay .sheet > label:not(.quick-toggle) { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.am-form .field-label, .am-overlay .field-label { margin: 0; font-size: 0.95rem; }
.am-form textarea.input { resize: vertical; min-height: 4.5rem; font-size: 1.05rem; }
.am-form-top { display: flex; gap: 0.8rem; align-items: flex-start; }
.am-ed-img { width: 6.5rem; flex-shrink: 0; }
.am-form-name { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.am-url-row { display: flex; gap: 0.4rem; }
.am-url-row .input { flex: 1 1 auto; min-width: 0; }
.am-fs { margin: 0; border: 2px dashed var(--ink); border-radius: 1rem; padding: 0.55rem 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.am-fs legend { font-weight: 900; padding: 0 0.35rem; }
.am-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); gap: 0.6rem; }
.am-grid2 .input { min-height: 2.8rem; font-size: 1.05rem; }
.am-form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; position: sticky; bottom: -1.1rem; z-index: 2; background: var(--paper); padding: 0.6rem 0 0.4rem; border-top: 2px solid rgba(31, 26, 61, 0.15); }
.am-form-actions > .btn, .am-form-actions > .btn-sec { flex: 1 1 auto; }
.am-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.am-choices .btn-sec { white-space: normal; text-align: left; justify-content: flex-start; }
.am-preview { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.7rem 0.8rem; border: 2px dashed var(--ink); border-radius: 0.9rem; background: var(--cream); }
.am-preview[hidden] { display: none; }
.am-emojis { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.am-emoji-btn { width: 2.9rem; height: 2.9rem; font-size: 1.5rem; border: 2px solid var(--ink); border-radius: 0.7rem; background: var(--paper); cursor: pointer; padding: 0; }
.am-emoji-btn[aria-pressed="true"] { background: var(--sun); box-shadow: 0.15rem 0.15rem 0 var(--ink); }
.am-found-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.am-found-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.65rem; align-items: start; width: 100%; text-align: left; padding: 0.55rem 0.65rem; background: var(--cream); color: inherit; border: 2px solid var(--ink); border-radius: 0.9rem; font: inherit; cursor: pointer; }
.am-found-main > span { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; overflow-wrap: anywhere; }
.am-found-main small { font-size: 0.88rem; }
.am-overlay .seg { flex-wrap: wrap; border-radius: 1rem; }
.am-overlay .seg button { flex: 1 1 auto; }
.am-im-sum { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.am-wz-progress { height: 0.55rem; border-radius: 999px; background: var(--cream); border: 2px solid var(--ink); overflow: hidden; }
.am-wz-progress i { display: block; height: 100%; background: var(--teal); }
.am-wz-head { display: flex; align-items: center; gap: 0.7rem; }
.am-wz-head > div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.am-dups { display: flex; flex-direction: column; gap: 0.8rem; }
.am-dup { padding: 0.8rem; display: flex; flex-direction: column; gap: 0.55rem; box-shadow: 0.25rem 0.25rem 0 var(--ink); border-width: var(--bw); }
.am-dup-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.5rem; }
.am-dup-card { display: flex; gap: 0.55rem; align-items: center; padding: 0.4rem; border: 2px dashed var(--ink); border-radius: 0.8rem; min-width: 0; }
.am-dup-card > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.am-dup-card small { font-size: 0.82rem; color: var(--ink-soft); }
.am-dup .btn-sec { white-space: normal; }
.am-views-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.am-views-list li { display: flex; gap: 0.35rem; align-items: center; }
.am-view-go { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; text-align: left; gap: 0.1rem; padding: 0.5rem 0.7rem; background: var(--cream); color: inherit; border: 2px solid var(--ink); border-radius: 0.8rem; font: inherit; cursor: pointer; }
.am-view-go small { font-size: 0.82rem; color: var(--ink-soft); overflow-wrap: anywhere; }

/* Schede: prestiti, cronologia, cestino, strumenti */
.am-pane { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.am-pane > h2, .am-pane .hub-sec-head h2 { font-size: 1.45rem; }
.am-pane .hub-sec-head { flex-wrap: wrap; }
.am-loans { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.am-loan { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; padding: 0.6rem 0.75rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1rem; }
.am-loan.is-late { border-color: var(--tomato); background: #FFE9E6; color: #1F1A3D; }
.am-loan-main { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; text-align: left; background: none; border: none; padding: 0; font: inherit; color: inherit; overflow-wrap: anywhere; }
button.am-loan-main { cursor: pointer; }
.am-loan-main small { font-size: 0.88rem; }
.am-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.am-log li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: 0.2rem 0.8rem; align-items: baseline; padding: 0.45rem 0.2rem; border-top: 2px dashed rgba(31, 26, 61, 0.18); overflow-wrap: anywhere; }
.am-log-op { font-size: 0.85rem; font-weight: 900; }
.am-log small { font-size: 0.82rem; text-align: right; }
.am-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.am-tool { padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; box-shadow: 0.3rem 0.3rem 0 var(--ink); }
.am-tool h2 { font-size: 1.3rem; }
.am-tool--wide { grid-column: 1 / -1; }
.am-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.am-people li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.8rem; padding: 0.45rem 0; border-top: 2px dashed rgba(31, 26, 61, 0.18); }
.am-people li > span { flex: 1 1 14rem; color: var(--ink-soft); font-size: 0.92rem; }
.am-empty { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; padding: 2rem 1rem; border: var(--bw) dashed var(--ink); border-radius: 1.2rem; background: var(--paper); }

html[data-theme="night"] .am-tr, html[data-theme="night"] .am-shelf-item, html[data-theme="night"] .am-kv, html[data-theme="night"] .am-log li, html[data-theme="night"] .am-people li { border-color: rgba(244, 236, 220, 0.16); }
html[data-theme="night"] .am-sec { border-color: rgba(244, 236, 220, 0.25); }
html[data-theme="night"] .am-tab, html[data-theme="night"] .am-mini, html[data-theme="night"] .am-found-main, html[data-theme="night"] .am-view-go { color: var(--fg); }
html[data-theme="night"] .am-tag:not(.am-tag--ok):not(.am-tag--off):not(.am-tag--late):not(.am-tag--new) { color: var(--fg); }
html[data-theme="night"] .am-shelf-item.is-sel, html[data-theme="night"] .am-tr.is-sel { color: #1F1A3D; }
html[data-theme="night"] .am-shelf-item.is-sel small, html[data-theme="night"] .am-tr.is-sel small { color: #4A4468; }

@media (max-width: 699px) {
  .am-desk-only { display: none !important; }
  .am-th { display: none; }
  .am-tr { grid-template-columns: 3.4rem minmax(0, 1fr) auto; row-gap: 0.15rem; padding: 0.5rem 0.6rem; }
  .am-tr > :nth-child(3), .am-tr > :nth-child(4) { display: none; }
  .am-td-img { grid-row: 1 / span 2; }
  .am-td-name { grid-column: 2; grid-row: 1; }
  .am-tr > :nth-child(6) { grid-column: 3; grid-row: 1; }
  .am-td-loc { grid-column: 2 / 4; grid-row: 2; font-size: 0.82rem; color: var(--ink-soft); }
  .am-log li { grid-template-columns: minmax(0, 1fr); }
  .am-log small { text-align: left; }
  .am-actions > .btn, .am-actions > .btn-sec { flex: 1 1 calc(50% - 0.5rem); font-size: 0.98rem; padding-left: 0.5em; padding-right: 0.5em; }
  .am-actions > .btn { flex-basis: 100%; }
  .am-overlay .sheet .panel-head h2 { font-size: 1.3rem; }
}
@media (max-width: 639px) {
  .am-toolbar > .btn-sec { flex: 1 1 auto; }
  .am-toolbar .am-sort { flex: 1 1 10rem; }
  .am-views { flex: 1 1 100%; }
  .am-views button { flex: 1 1 0; padding: 0.35rem 0.4rem; }
}
@media (max-width: 380px) {
  .am-views button { font-size: 0.86rem; }
}
@media (min-width: 640px) {
  .am-sheet-grid { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: start; }
  .am-sel-n { flex: 0 0 auto; margin-right: 0.4rem; }
  .am-overlay.overlay--sheet { place-items: center; }
}
@media (min-width: 1100px) {
  .am-layout { grid-template-columns: 17.5rem minmax(0, 1fr); }
  .am-side { display: flex; flex-direction: column; gap: 0.8rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; padding: 0.9rem 1rem; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 1.1rem; box-shadow: 0.3rem 0.3rem 0 var(--ink); }
  .am-side .am-fgrid { grid-template-columns: 1fr; }
  .am-side .am-checks { flex-direction: column; gap: 0.45rem; }
  .am-side-title { font-size: 1.3rem; }
  .am-filter-btn { display: none; }
  .am-list--grid { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); }
}
@media print { .am-selbar, .am-tabs, .am-toolbar, .am-side { display: none !important; } }
html.in-app .am-desk-only { display: none !important; }
.am-overlay .qr-url { text-align: center; overflow-wrap: anywhere; }
.am-list--grid > .am-more { grid-column: 1 / -1; }
.am-more { margin-top: 0.6rem; }

/* ==========================================================================
   Versioni, aggiornamenti e installazione dell'app (1.3)
   ========================================================================== */
.upd-banner--app .upd-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.upd-banner--app .upd-text small { font-weight: 700; font-size: 0.85rem; overflow-wrap: anywhere; }
.ver-panel { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.ver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem 0.6rem; }
.ver-kv--wide { grid-column: 1 / -1; }
@media (min-width: 900px) { .ver-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); } .ver-kv--wide { grid-column: auto; } }
.ver-kv { display: flex; flex-direction: column; gap: 0.05rem; padding: 0.4rem 0.6rem; border: 2px solid var(--ink); border-radius: 0.8rem; background: var(--cream); min-width: 0; }
.ver-kv span { font-size: 0.85rem; color: var(--ink-soft); }
.ver-kv b { font-size: 1.05rem; overflow-wrap: anywhere; }
.ver-kv small { font-weight: 700; color: var(--ink-soft); }
.ver-status { margin: 0; }
/* 2.3 · Stato della versione = avviso del sistema di design: fondo chiaro tenue, inchiostro scuro, barra a
   sinistra del colore del significato. Uguale nella finestra "Scarica", nella scheda "App Android", nella
   pagina di download e nella TV (prima: testo arancione su lavanda, contrasto 1,4:1). */
.ver-state {
  --al-bg: var(--al-info-bg); --al-ink: var(--al-info-ink); --al-line: var(--al-info-line);
  display: inline-block; max-width: 100%; padding: 0.55rem 0.85rem; border-radius: 0.75rem;
  border: 1px solid var(--al-line); border-left: 0.3rem solid var(--al-line);
  background: var(--al-bg); color: var(--al-ink); font-weight: 800; line-height: 1.4; overflow-wrap: anywhere;
}
.ver-state--new { --al-bg: var(--al-new-bg); --al-ink: var(--al-new-ink); --al-line: var(--al-new-line); }
.ver-state--ok { --al-bg: var(--al-ok-bg); --al-ink: var(--al-ok-ink); --al-line: var(--al-ok-line); }
.ver-state--busy, .ver-state--wait { --al-bg: var(--al-warn-bg); --al-ink: var(--al-warn-ink); --al-line: var(--al-warn-line); }
.ver-state--err { --al-bg: var(--al-err-bg); --al-ink: var(--al-err-ink); --al-line: var(--al-err-line); }
.ver-bar { height: 0.8rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--cream); overflow: hidden; }
.ver-bar i { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.ver-notes ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.ver-actions > .btn, .ver-actions > .btn-sec { flex: 1 1 12rem; text-decoration: none; }
.ver-qr { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; padding-top: 0.6rem; border-top: 2px dashed rgba(31, 26, 61, 0.25); }
.ver-qr h3 { font-size: 1.15rem; }
.ver-url, .ver-sha { overflow-wrap: anywhere; word-break: break-all; }
.ver-sha { display: block; font-size: 0.8rem; padding: 0.4rem; background: var(--cream); border-radius: 0.5rem; }
html[data-theme="night"] .ver-kv, html[data-theme="night"] .ver-sha { color: var(--fg); }
html[data-theme="night"] .ver-qr { border-color: rgba(244, 236, 220, 0.25); }

/* Pagina scarica.html */
main.phone.dl { max-width: 44rem; }
.dl-hero { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; text-align: center; align-items: center; }
.dl-hero h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
.dl-ico { font-size: 2.8rem; line-height: 1; }
.dl-sec { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.dl-sec h2 { font-size: 1.4rem; }
.dl-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; }

/* TV: QR grande per installare l'app su un altro dispositivo (leggibile da lontano, si chiude con Esc) */
.install-qr { z-index: 95; padding: 1.5rem; }
.install-qr-card { width: min(70rem, 100%); max-height: calc(100vh - 3rem); overflow: auto; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 2rem; align-items: center; padding: 1.6rem 2rem; }
.install-qr-code { width: min(28rem, 62vh, 45vw); aspect-ratio: 1; background: #FFFFFF; border: var(--bw) solid var(--ink); border-radius: 1.2rem; padding: 0.4rem; }
.install-qr-code svg { display: block; width: 100%; height: 100%; }
.install-qr-text { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
.install-qr-text h2 { font-size: clamp(1.6rem, 2.6vw, 2.6rem); line-height: 1.1; }
.install-qr-lead { font-size: clamp(1.1rem, 1.6vw, 1.5rem); font-weight: 800; }
.install-qr-url { font-family: var(--display); font-size: clamp(1rem, 1.4vw, 1.35rem); overflow-wrap: anywhere; padding: 0.35rem 0.7rem; background: var(--cream); border-radius: 0.7rem; border: 2px solid var(--ink); }
.install-qr-text .btn { align-self: flex-start; }
.install-qr-text .btn:focus-visible, .install-qr-text .btn:focus { outline: 0.3rem solid var(--sky); outline-offset: 0.25rem; }
html[data-theme="night"] .install-qr-url { color: var(--fg); }
@media (max-width: 760px) {
  .install-qr-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 1rem; gap: 1rem; }
  .install-qr-code { width: min(18rem, 80vw); }
  .install-qr-text .btn { align-self: center; }
}

/* ==========================================================================
   1.6 · Timer condiviso (sharedtimer.js): chip su TV e telefoni, display, comandi
   ========================================================================== */
.sh-chip {
  --tc: #3DDC84;
  position: fixed; z-index: 56; cursor: pointer; display: inline-flex; align-items: center; gap: 0.55rem;
  font: inherit; font-weight: 900; color: #1F1A3D; background: var(--tc);
  border: var(--bw, 0.18rem) solid var(--ink, #1F1A3D); border-radius: 999px; padding: 0.35rem 1rem 0.35rem 0.8rem;
  box-shadow: 0.2rem 0.2rem 0 var(--ink, #1F1A3D), 0 0 1.2rem var(--tc);
  transition: background-color var(--ui-mid, .2s) ease;
}
.sh-chip b { font-family: var(--num, inherit); font-weight: 400; font-variant-numeric: tabular-nums; }
.sh-chip-k { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85em; }
.sh-chip--tv { right: 1.4rem; bottom: 1.4rem; font-size: 1.45rem; }
.sh-chip--phone { left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 0.5rem); font-size: 1rem; min-height: 2.75rem; max-width: calc(100vw - 1.5rem); }
.sh-chip.is-paused { color: #F6F3FF; background: #4A4470; }
.sh-chip.is-hot { animation: shPulse 1s ease-in-out infinite; }
.sh-chip.is-over { background: #B3121E; color: #FFF3E0; animation: lateShake .45s ease-in-out 4; }
.sh-chip:focus-visible { outline: 0.25rem solid var(--sun, #FFD34D); outline-offset: 0.2rem; }
body.has-dock .sh-chip--tv { bottom: 6rem; }
@keyframes shPulse { 50% { box-shadow: 0.2rem 0.2rem 0 var(--ink, #1F1A3D), 0 0 2.4rem var(--tc); } }

.sh-display { --tc: #3DDC84; display: grid; gap: 0.4rem; justify-items: center; text-align: center; padding: 1rem; border-radius: 1.2rem; background: color-mix(in srgb, var(--tc) 12%, transparent); border: 0.15rem solid color-mix(in srgb, var(--tc) 55%, transparent); }
.sh-display.is-none { opacity: 0.6; }
.sh-kind { font-weight: 900; font-size: 1.1rem; min-height: 1.3em; }
.sh-num { font-family: var(--num, inherit); font-weight: 400; font-size: clamp(3rem, 9vw, 7rem); line-height: 1; font-variant-numeric: tabular-nums; color: var(--tc); text-shadow: 0 0 0.25em color-mix(in srgb, var(--tc) 45%, transparent); }
.sh-display.is-paused .sh-num { color: inherit; opacity: 0.7; }
.sh-display.is-hot .sh-num { animation: shBeat 1s ease-in-out infinite; }
.sh-display.is-over .sh-num { color: #FF5A4E; animation: lateShake .45s ease-in-out 3; }
.sh-bar { width: min(100%, 26rem); height: 0.7rem; border-radius: 999px; background: rgba(127, 127, 160, 0.25); overflow: hidden; }
.sh-bar i { display: block; height: 100%; width: 0; background: var(--tc); border-radius: inherit; transition: width .25s linear; }
.sh-status { font-weight: 700; opacity: 0.85; }
@keyframes shBeat { 50% { transform: scale(1.06); } }

.sh-ctrl { display: grid; gap: 0.8rem; }
.sh-kinds, .sh-presets, .sh-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sh-kinds .chip-btn { cursor: pointer; font: inherit; font-weight: 800; padding: 0.45rem 0.9rem; border-radius: 999px; min-height: 2.75rem; border: 0.15rem solid var(--ink, currentColor); background: transparent; color: inherit; }
.sh-kinds .chip-btn[aria-pressed="true"] { background: var(--sun, #FFD34D); color: #1F1A3D; }
.sh-custom { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem; }
.sh-custom label { display: grid; gap: 0.2rem; font-weight: 700; font-size: 0.9rem; }
.sh-custom input[type="number"] { width: 5.5rem; }
.sh-custom .sh-label { flex: 1 1 12rem; }
.sh-custom .sh-label input { width: 100%; }
.tb-timer { display: grid; grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr); gap: 2rem; align-items: start; }
.tb-timer .sh-num { font-size: clamp(4rem, 8vw, 8rem); }
.timer-sheet .sheet { display: grid; gap: 1rem; }
@media (max-width: 760px) { .tb-timer { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sh-chip.is-hot, .sh-display.is-hot .sh-num, .sh-chip.is-over, .sh-display.is-over .sh-num { animation: none; } }
html.a11y-motion .sh-chip, html.a11y-motion .sh-display .sh-num { animation: none !important; }

/* ==========================================================================
   1.6 · Schermata ambientale della TV (ambient.js)
   ========================================================================== */
body.ambient-on #app, body.ambient-on .pause-overlay, body.ambient-on .ticker, body.ambient-on .sand-chip { visibility: hidden; }
.ambient {
  position: fixed; inset: 0; z-index: 5; display: grid; color: #F6F3FF;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 26rem); grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(1rem, 3vw, 3rem); padding: clamp(1.2rem, 4vw, 4rem);
  font-size: clamp(1rem, 1.3vw, 1.6rem);
  animation: fadeIn .6s ease both;
}
.amb-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 30% 40%, rgba(14, 10, 38, 0.35), rgba(8, 5, 24, 0.82) 75%); }
.ambient > :not(.amb-vignette) { position: relative; }
.amb-main { display: flex; align-items: center; min-width: 0; }
.amb-main > div { min-width: 0; }
.amb-main { gap: clamp(1rem, 3vw, 3rem); }
.amb-cover { flex: 0 0 auto; width: clamp(12rem, 30vw, 34rem); aspect-ratio: 1; border-radius: 1.6rem; overflow: hidden; box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.55), 0 0 0 0.2rem rgba(255, 255, 255, 0.12); }
.amb-cover .game-img { width: 100%; height: 100%; border-radius: 0; }
.amb-cover .game-img--empty span { font-size: clamp(3rem, 8vw, 8rem); }
.amb-info { display: grid; gap: 0.6rem; min-width: 0; }
.amb-kicker { margin: 0; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #FFD23F; font-size: 1.05em; }
.amb-title { margin: 0; font-family: var(--num, inherit); font-weight: 400; font-size: clamp(2.6rem, 6vw, 6.5rem); line-height: 1; overflow-wrap: anywhere; text-shadow: 0 0.1em 0.5em rgba(0, 0, 0, 0.5); }
.amb-meta { margin: 0; font-size: 1.3em; color: #DCD5FF; }
.amb-play { margin: 0; font-size: 1.4em; } .amb-play b { font-family: var(--num, inherit); font-weight: 400; font-variant-numeric: tabular-nums; }
.amb-players { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.amb-players li { display: grid; justify-items: center; gap: 0.2rem; font-weight: 800; font-size: 0.9em; max-width: 6.5rem; text-align: center; }
.amb-players li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.amb-idle { display: grid; gap: 0.7rem; justify-items: start; }
.amb-emblem { font-size: clamp(4rem, 9vw, 9rem); line-height: 1; }
.amb-emblem .emblem--img { width: clamp(6rem, 12vw, 12rem); height: auto; border-radius: 1.2rem; }
.amb-board { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.5rem; font-size: 1.4em; }
.amb-board li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 0.8rem; align-items: center; padding: 0.5rem 1rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.08); }
.amb-board li:first-child { background: rgba(255, 210, 63, 0.22); }
.amb-pos { font-family: var(--num, inherit); color: #FFD23F; text-align: center; }
.amb-board b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amb-avg { font-family: var(--num, inherit); font-variant-numeric: tabular-nums; }
.amb-side { display: flex; flex-direction: column; gap: 1.2rem; align-self: center; }
.amb-clock { margin: 0; font-family: var(--num, inherit); font-size: clamp(2.4rem, 4vw, 4.4rem); text-align: right; opacity: 0.9; font-variant-numeric: tabular-nums; }
.amb-pause { display: grid; gap: 0.3rem; padding: 1rem 1.2rem; border-radius: 1.2rem; background: rgba(255, 210, 63, 0.92); color: #1A1236; font-size: 1.3em; text-align: center; }
.amb-timer .sh-display { background: rgba(10, 6, 30, 0.55); }
.amb-timer .sh-display.is-none { display: none; }
.amb-timer .sh-num { font-size: clamp(3.4rem, 6vw, 6.5rem); }
.amb-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 700; color: #C3BAEA; }
.amb-exit { display: inline-flex; align-items: center; gap: 0.5rem; font: inherit; font-weight: 800; color: inherit; background: rgba(255, 255, 255, 0.08); border: 0.12rem solid rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 0.5rem 1.1rem; cursor: pointer; opacity: 0.55; transition: opacity .2s; min-height: 2.75rem; }
.amb-exit:hover, .amb-exit:focus-visible { opacity: 1; outline: 0.2rem solid #FFD23F; outline-offset: 0.15rem; }
.amb-exit svg { width: 1.1em; height: 1.1em; }
.ambient.is-paused .amb-main { opacity: 0.55; filter: saturate(0.6); transition: opacity .4s, filter .4s; }
@media (max-aspect-ratio: 4/3) {
  .ambient { grid-template-columns: 1fr; grid-template-rows: auto auto auto; overflow: auto; }
  .amb-main { flex-direction: column; align-items: flex-start; }
  .amb-clock { text-align: left; }
}
html.a11y-motion .ambient, html.safe-mode .ambient { animation: none; }
html.a11y-contrast .amb-vignette { background: rgba(0, 0, 0, 0.88); }

/* ==========================================================================
   1.6 · Preferiti rapidi (favs.js): stella sulle schede, riga dei preferiti
   ========================================================================== */
.am-card { position: relative; }
.am-fav { cursor: pointer; font: inherit; line-height: 1; border: 0; background: transparent; color: #B9B2D9; min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; font-size: 1.45rem; border-radius: 999px; }
.am-fav.is-on { color: #FF4F7E; text-shadow: 0 0 0.6rem rgba(255, 79, 126, 0.55); }
.am-fav:hover { color: #FF8FB1; }
.am-fav:focus-visible { outline: 0.2rem solid var(--sun, #FFD34D); outline-offset: 0.1rem; }
.am-fav--card { position: absolute; top: 0.3rem; right: 0.3rem; z-index: 2; background: rgba(14, 10, 38, 0.62); backdrop-filter: blur(2px); }
.am-fav--inline { min-width: 2.2rem; min-height: 2.2rem; font-size: 1.15rem; vertical-align: middle; margin-right: 0.15rem; }
.am-fav--head { font-size: 1.35rem; vertical-align: middle; }
.am-favs { margin: 0.4rem 0 0.8rem; padding: 0.8rem; border-radius: 1rem; background: rgba(255, 79, 126, 0.08); border: 0.12rem solid rgba(255, 79, 126, 0.35); }
.am-favs-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.am-favs-head h2 { margin: 0; font-size: 1.1rem; }
.am-favs-row { display: flex; gap: 0.6rem; overflow-x: auto; padding: 0.5rem 0.1rem 0.3rem; scroll-snap-type: x proximity; }
.am-fav-item { flex: 0 0 auto; scroll-snap-align: start; display: flex; align-items: center; gap: 0.5rem; max-width: 15rem; cursor: pointer; font: inherit; color: inherit; text-align: left; padding: 0.35rem 0.7rem 0.35rem 0.35rem; border-radius: 0.8rem; border: 0.12rem solid var(--ui-line-strong, rgba(168, 148, 255, 0.34)); background: var(--ui-surface, rgba(255, 255, 255, 0.05)); min-height: 2.75rem; }
.am-fav-item span { display: grid; min-width: 0; }
.am-fav-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-fav-item small { color: var(--ui-warn, #FFB547); font-weight: 700; }
.am-fav-item.is-off { opacity: 0.7; }

/* 1.9 · Ritaglio delle foto (util.js › editPhoto) */
.pe-frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.pe-stage.is-cropping img { aspect-ratio: auto; width: auto; border-radius: 0.3rem; }
.pe-stage--square.is-cropping img { border-radius: 0.3rem; border: 0; width: auto; aspect-ratio: auto; }
.pe-crop { position: absolute; box-sizing: border-box; border: 0.18rem solid #FFD23F; box-shadow: 0 0 0 200vmax rgba(10, 6, 30, 0.55); cursor: move; touch-action: none; border-radius: 0.2rem; }
.pe-stage--square .pe-crop { border-radius: 50%; }
.pe-crop:focus-visible { outline: 0.2rem dashed #FFFFFF; outline-offset: 0.15rem; }
.pe-h { position: absolute; width: 1.5rem; height: 1.5rem; background: #FFD23F; border: 0.15rem solid #1A1236; border-radius: 50%; touch-action: none; }
.pe-h--tl { left: -0.8rem; top: -0.8rem; cursor: nwse-resize; }
.pe-h--br { right: -0.8rem; bottom: -0.8rem; cursor: nwse-resize; }
.pe-stage { overflow: hidden; }
.pe-rot { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.sh-prev { border: 0.12rem dashed var(--ui-line-strong, rgba(168, 148, 255, 0.34)); border-radius: 0.9rem; padding: 0.7rem; }
.sh-prev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.sh-prev-list li { display: flex; gap: 0.6rem; align-items: center; min-width: 0; }
.sh-prev-list span { display: grid; min-width: 0; }
.sh-prev-list small { opacity: 0.8; }

/* 1.8 · BoardGameGeek e manuali nell'armadio */
.am-bgg-btn { margin-top: 0.4rem; }
.am-bgg-form { display: flex; gap: 0.5rem; }
.am-bgg-form .input { flex: 1; }
.am-bgg-list { list-style: none; margin: 0.6rem 0; padding: 0; display: grid; gap: 0.45rem; }
.am-bgg-item { width: 100%; display: flex; gap: 0.7rem; align-items: center; text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 0.45rem; border-radius: 0.8rem; border: 0.12rem solid var(--ui-line-strong, rgba(168, 148, 255, 0.34)); background: var(--ui-surface, rgba(255, 255, 255, 0.04)); min-height: 3.2rem; }
.am-bgg-item:hover, .am-bgg-item:focus-visible { border-color: var(--sun, #FFD34D); }
.am-bgg-item img, .am-bgg-noimg { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: 0.5rem; flex: 0 0 auto; display: grid; place-items: center; background: rgba(127, 127, 160, 0.2); font-size: 1.6rem; }
.am-bgg-item > span { display: grid; gap: 0.15rem; min-width: 0; }
.am-bgg-table-wrap { overflow-x: auto; }
.am-bgg-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.am-bgg-table th, .am-bgg-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--ui-line, rgba(168, 148, 255, 0.16)); text-align: left; vertical-align: middle; }
.am-bgg-table tr.is-conflict td:nth-child(3) { color: var(--ui-warn, #B86E00); font-weight: 700; }
.am-bgg-table tr.is-fill td:nth-child(3) { color: var(--ui-ok, #12A36B); font-weight: 700; }
.am-bgg-credit { font-size: 0.95rem; }
.am-manual-local p { margin: 0.3rem 0; }
.wr-list { margin: 0.6rem auto; padding: 0; list-style: none; counter-reset: wr; display: grid; gap: 0.5rem; text-align: left; max-width: 34rem; font-weight: 900; font-size: 1.5rem; }
.wr-list li { counter-increment: wr; display: flex; gap: 0.7rem; align-items: baseline; }
.wr-list li::before { content: counter(wr); font-family: var(--num, inherit); color: var(--wc, #FFC93C); min-width: 1.2em; }

/* 1.10 · Soundboard personalizzata (TV) */
.cs-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.5rem; max-height: 55vh; overflow: auto; }
.cs-row { display: grid; grid-template-columns: 4.2rem minmax(8rem, 1fr) auto minmax(6rem, 9rem) auto; gap: 0.5rem; align-items: center; }
.cs-btns { display: inline-flex; gap: 0.3rem; }
.sfx-btn--custom { outline: 0.12rem dashed rgba(255, 210, 63, 0.6); outline-offset: -0.25rem; }
@media (max-width: 760px) { .cs-row { grid-template-columns: 4.2rem 1fr; } }

/* 1.10 · Telecomando e Android TV: fuoco ben visibile da lontano */
html.tv :focus-visible, html.tv-remote :focus-visible { outline: 0.3rem solid #FFD23F !important; outline-offset: 0.2rem; box-shadow: 0 0 0 0.55rem rgba(255, 210, 63, 0.28); }
html.tv-remote body { font-size: 1.12em; }
html.tv-remote .btn, html.tv-remote .btn-sec, html.tv-remote .ui-btn { min-height: 3rem; }

/* ==========================================================================
   1.11 · TV: modelli di serata, modalità pubblico, comandi rapidi (host.html usa solo questo foglio)
   ========================================================================== */
/* 1.11 · Modelli e serate precedenti (TV) */
.tp-body { display: grid; gap: 1rem; }
.tp-sec h3 { margin: 0 0 0.5rem; }
.tp-list { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.4rem; }
.tp-item { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem; border-radius: 0.8rem; background: rgba(255, 255, 255, 0.06); }
.tp-item > span:first-child { display: grid; min-width: 0; }
.tp-item b { overflow-wrap: anywhere; }
.tp-acts { display: flex; gap: 0.4rem; flex-shrink: 0; }
.tp-diff { margin: 0 0 0.6rem; padding-left: 1.2rem; display: grid; gap: 0.2rem; }
/* 1.11 · Modalità pubblico della TV (idea 13): solo ciò che serve al pubblico. La serata si guida dal telefono regia. */
.pub-exit { display: none; }
html.tv-public .pub-exit {
  display: inline-flex; align-items: center; gap: 0.35rem; position: fixed; right: 0.8rem; bottom: 0.8rem; z-index: 40;
  font: inherit; font-size: 0.85rem; font-weight: 800; color: inherit; cursor: pointer;
  background: rgba(20, 11, 46, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 0.35rem 0.8rem;
  opacity: 0.35; transition: opacity 0.2s;
}
html.tv-public .pub-exit:hover, html.tv-public .pub-exit:focus-visible { opacity: 1; }
html.tv-public .topbar :is(.hdr-back, .hdr-home, .chip--end, #hdrTools, #hdrLib, #fsBtn, #newNightBtn, #hdrPlayers) { display: none !important; }
html.tv-public #screen :is(button, .btn, .btn-sec, .text-btn, .link-btn, form, input, select, textarea, .claim-actions, .rg-row, .host-actions, .plan-next):not(.pub-keep) { display: none !important; }
html.tv-public .tour-pop, html.tv-public .regia-fab { display: none !important; }
/* 1.11 · Comandi rapidi della TV (idea 15) */
.quick-bar { display: inline-flex; gap: 0.3rem; }
.quick-bar:empty { display: none; }
.quick-btn { min-width: 2.4rem; justify-content: center; }
.quick-btn:disabled { opacity: 0.35; cursor: not-allowed; }
/* 2.4: comandi rapidi con stato (silenzioso): premuto = acceso, ben visibile */
.quick-btn[aria-pressed="true"] { background: var(--tomato); color: #1F1A3D; border-color: var(--tomato); }
.qc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.2rem 0.6rem; }
html.tv-public .quick-bar { display: none; }

.plan-late { display: grid; gap: 0.35rem; padding: 0.6rem 0.8rem; border-radius: 0.8rem; border: 1px solid rgba(255, 181, 71, 0.6); background: rgba(255, 181, 71, 0.1); }
.plan-late-acts { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* 1.12 · Accessori stagionali sugli avatar (idea 25): piccolo simbolo in basso a destra, solo decorativo */
.avatar-acc {
  position: absolute; right: 4%; bottom: 4%;
  font-size: calc(var(--s) * 0.32); line-height: 1;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

/* 1.12 · Analisi dello storico, tradizioni e premi del gruppo (tv-memory.js) */
.ins-subs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.2rem 0 0.9rem; }
.ins-subs button {
  cursor: pointer; min-height: 2.3rem; padding: 0.25rem 0.85rem;
  font: inherit; font-weight: 800; font-size: 0.92rem; color: inherit;
  background: transparent; border: 0.14rem solid currentColor; border-radius: 0.7rem; opacity: 0.8;
}
.ins-subs button[aria-pressed="true"] { background: var(--paper); opacity: 1; box-shadow: 0.14rem 0.14rem 0 var(--ink); border-color: var(--ink); }
.ins-body { display: flex; flex-direction: column; gap: 0.9rem; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-bottom: 0.6rem; }
.ins-lead { font-weight: 800; font-size: 1.1rem; margin: 0; }
.ins-warn { margin: 0; padding: 0.55rem 0.9rem; border-radius: 0.8rem; background: rgba(255, 201, 60, 0.16); border: 0.14rem solid var(--sun); font-weight: 700; }
.ins-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0.9rem; align-items: start; }
.ins-two--3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.ins-two--4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.ins-two h2 .select { font-size: 1rem; width: auto; min-width: 12rem; }
.ins-list .at-name { display: flex; flex-direction: column; gap: 0.1rem; }
.ins-list .at-name small, .at-name small { font-weight: 600; font-size: 0.8rem; }
.ins-arrow { font-size: 1.2rem; width: 1.6rem; text-align: center; }
.ins-arrow--up { color: #8AC926; }
.ins-arrow--down { color: var(--tomato); }
.ins-picks { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ins-picks .chip-btn[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; }
.ins-picks .chip-btn small { opacity: 0.7; font-weight: 700; }
.ins-table, .ins-heat { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ins-table th, .ins-table td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 0.08rem solid rgba(255, 255, 255, 0.14); }
.ins-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.ins-table tr.is-few td { opacity: 0.62; }
.ins-scroll { overflow-x: auto; }
.ins-heat th, .ins-heat td { padding: 0.3rem; text-align: center; font-size: 0.85rem; }
.ins-heat td { background: rgba(255, 201, 60, var(--a, 0)); border: 0.06rem solid rgba(255, 255, 255, 0.08); color: #1F1A3D; font-weight: 800; min-width: 2.2rem; }
.ins-heat td.ins-sum { background: transparent; color: inherit; }
.ins-period { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.ins-nav { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.15rem; }
.ins-nav b { min-width: 11rem; text-align: center; text-transform: capitalize; }
.ins-export { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.7rem 1rem; align-items: end; max-width: 60rem; }
.ins-export label { display: flex; flex-direction: column; gap: 0.25rem; }
.ins-export label.check { flex-direction: row; align-items: center; gap: 0.5rem; min-height: 2.6rem; font-weight: 700; }
.ins-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.trend--sm { width: 100%; max-width: 44rem; height: auto; align-self: flex-start; }
.trend-dot--few { opacity: 0.45; }

/* Affidabilità di un numero (idea 44) */
.conf { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.01em; vertical-align: middle; white-space: nowrap; }
.conf--few { background: rgba(255, 90, 78, 0.18); color: #FFB3AD; border: 0.08rem solid rgba(255, 90, 78, 0.6); }
.conf--ok { background: rgba(255, 201, 60, 0.15); color: #FFE08A; border: 0.08rem solid rgba(255, 201, 60, 0.55); }
.conf--solid { background: rgba(138, 201, 38, 0.16); color: #C8F08A; border: 0.08rem solid rgba(138, 201, 38, 0.55); }
.rec-def { display: block; font-size: 0.75rem; opacity: 0.7; font-weight: 600; }

/* Regole della casa, premi del gruppo, tradizioni */
.house-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.house-item { display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; padding: 0.5rem 0.7rem; border-radius: 0.8rem; background: rgba(255, 255, 255, 0.06); }
.house-item > span { display: flex; flex-direction: column; gap: 0.1rem; }
.house-item b { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.house-form { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr auto; gap: 0.5rem; align-items: center; }
.house-note { margin-top: 0.4rem; padding: 0.45rem 0.8rem; border-radius: 0.8rem; background: rgba(255, 201, 60, 0.13); border: 0.12rem dashed var(--sun); font-size: 0.95rem; }
.house-note ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.trad-chip { margin: -0.2rem 0 0.4rem; font-weight: 800; color: var(--sun); }
.tp-trad { flex-basis: 100%; margin-top: 0.4rem; }
.tp-trad summary { cursor: pointer; font-weight: 800; }
.tp-trad label { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.5rem; }
.ca-form { display: flex; flex-direction: column; gap: 0.6rem; }
.ca-form > label { display: flex; flex-direction: column; gap: 0.25rem; }
.ca-emoji { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ca-emoji button { font-size: 1.5rem; width: 3rem; height: 3rem; border-radius: 0.8rem; border: var(--bw) solid var(--ink); background: var(--paper); cursor: pointer; }
.ca-emoji button[aria-checked="true"] { background: var(--sun); box-shadow: 0.14rem 0.14rem 0 var(--ink); }
.ca-who { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ca-person { display: inline-flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.45rem 0.6rem; min-width: 5.5rem; border-radius: 1rem; border: var(--bw) solid var(--ink); background: var(--paper); color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.ca-person[aria-pressed="true"] { background: var(--sun); color: #1F1A3D; box-shadow: 0.16rem 0.16rem 0 var(--ink); }
.gs-sessions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin: 0.3rem 0 0.6rem; }
.gs-sess-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.gs-sess { display: inline-flex; flex-direction: column; align-items: center; padding: 0.2rem 0.55rem; border-radius: 0.6rem; background: rgba(255, 255, 255, 0.08); line-height: 1.15; }
.gs-sess small { font-size: 0.7rem; opacity: 0.75; }
.gs-sess.is-few { opacity: 0.55; }
.lb-sess { flex-basis: 100%; }
.ex-quotes { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.8rem; font-weight: 700; }
.rs-story p { line-height: 1.5; }
@media (max-width: 700px) {
  .house-form { grid-template-columns: 1fr; }
}

/* 2.0 · Voti aggiunti dopo: il reveal si ridisegna senza rifare le animazioni */
.reveal--static .vcard, .reveal--static .vcard-inner { animation-delay: 0s !important; animation-duration: 0.01s !important; }
.late-chip { border-style: dashed; }
.lv-list { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.lv-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.5rem; border-radius: 0.8rem; background: rgba(255, 255, 255, 0.05); }
.lv-name { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.lv-tag { display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 0.05rem 0.45rem; border-radius: 999px; background: rgba(255, 201, 60, 0.18); color: var(--sun); width: fit-content; }
.lv-acts { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.lv-log { margin-top: 0.6rem; }
.lv-log ul { margin: 0.3rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }
.late-banner { margin: 0 0 0.6rem; padding: 0.55rem 0.8rem; border-radius: 0.9rem; background: rgba(255, 201, 60, 0.16); border: 0.12rem dashed var(--sun); font-weight: 800; }
.join-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0.6rem; margin: 0.2rem 0 0.8rem; font-size: 0.95rem; }
.acc-card { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--ui-line, rgba(127, 127, 127, 0.25)); display: flex; flex-direction: column; gap: 0.5rem; }
.acc-card h3 { margin: 0; }
.acc-google .g-logo { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; background: #fff; color: #4285F4; font-weight: 900; font-family: Arial, sans-serif; }
.acc-form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.8rem; }

/* 2.0 · Scelta dei giochi sulla TV: ricerca, filtri, ordinamento, giocatori e durata, dettagli */
.lib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0.2rem 0 0.1rem; }
.lib-search { flex: 1 1 12rem; min-width: 10rem; max-width: 20rem; }
.lib-filters { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lib-filters .pool-opt { font-size: 0.85rem; }
.lib-count { margin: 0; }
.lib-chip-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.lib-chip-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; min-width: 0; }
.lib-meta { font-size: 0.72rem; font-weight: 700; opacity: 0.8; white-space: nowrap; }
.lib-check { position: absolute; left: -0.35rem; top: -0.35rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #06030F; font-weight: 900; font-size: 0.85rem; border: 0.12rem solid var(--ink); }
.lib-info {
  position: absolute; right: -0.35rem; top: -0.35rem; z-index: 2;
  width: 1.55rem; height: 1.55rem; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  font: 900 0.85rem/1 Georgia, serif; font-style: italic;
  background: var(--paper); color: inherit; border: 0.12rem solid var(--ink);
}
.lib-info:hover, .lib-info:focus-visible { background: var(--sun); color: #1F1A3D; }
.lib-chip { position: relative; }
#libPick .lib-chips { padding-top: 0.55rem; padding-left: 0.45rem; }
#libPick .game-img--chip { width: 2.9rem; }

/* 2.0 · Consigli meno invadenti */
.no-hints .vhint { display: none; }
.tip-box { position: relative; }
.tip-box .tip-body { padding-right: 1.8rem; }
.tip-x { position: absolute; top: 0.35rem; right: 0.35rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 0; background: rgba(127, 127, 160, 0.22); color: inherit; cursor: pointer; font-weight: 900; line-height: 1; }
.tips-set { display: flex; flex-direction: column; gap: 0.5rem; }
.tips-cats { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; }
.rc-more { margin-top: 0.4rem; }
.rc-more > summary { cursor: pointer; font-weight: 800; padding: 0.4rem 0; }

/* ==========================================================================
   2.2 · TV più ordinata: intestazione a gruppi, lobby con i giocatori protagonisti,
   "Lobby partita" con la copertina del gioco al centro, classifica compatta.
   ========================================================================== */

/* Intestazione: informazioni della stanza | azioni della regia */
.tb-group { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.tb-group > * { white-space: nowrap; flex-shrink: 0; }
.tb-info:empty { display: none; }
.hdr-play { border-color: var(--teal); }
html.tv .tb-group { gap: 0.35rem; }
html.tv-public .hdr-play { display: none !important; }

/* Logo "Show": niente alone rosa, accento giallo tenue */
html.theme-show .logo-tag { text-shadow: none; box-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.45), 0 0 0.9em rgba(255, 211, 77, 0.18); }
html.theme-show .logo--xl { text-shadow: 0 0.05em 0 rgba(0, 0, 0, 0.55), 0 0 0.35em rgba(255, 211, 77, 0.12); }

/* Pannelli sotto i giocatori: più aria, giochi come pillole */
.prep-block { padding: 0.6rem 0.95rem !important; line-height: 1.4; }
.prep-ready .ready-list { font-size: 1rem; line-height: 1.4; margin: 0; padding: 0; list-style: none; }
.prep-ready { flex: 0 1 auto; }
.prep-ready .ready-list li { display: flex; align-items: center; gap: 0.45rem; }
.prep-ready .ready-list small { opacity: 0.75; }
.prep-chips { gap: 0.45rem; }
.prep-chip {
  border-radius: 20px !important; padding: 0.3rem 0.85rem !important; max-width: 16rem;
  background: color-mix(in srgb, var(--paper) 70%, var(--fg, #fff) 8%) !important;
  border: 0.1rem solid color-mix(in srgb, var(--ink-soft) 28%, transparent) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.show-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }

/* ---------------------------------------------------------------- Lobby partita */
.screen .idle--v22 { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); gap: 1.4rem; }
.screen .idle--v22 .next-card { padding: 1.2rem 1.4rem; gap: 0.8rem; }
.screen .idle--v22 .ng-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
.screen .idle--v22 .ng-head h1 { font-size: 2.2rem; margin: 0; }
.screen .idle--v22 .ng-head .play-timer { margin: 0; }
.screen .idle--v22 .lib-pick { padding-bottom: 0.2rem; border-bottom: 0.1rem solid color-mix(in srgb, var(--ink-soft) 18%, transparent); }
.screen .idle--v22 .ng-body { display: grid; grid-template-columns: minmax(15rem, 0.95fr) minmax(0, 1.05fr); gap: 1.4rem; align-items: start; }
.screen .idle--v22 .ng-hero { display: flex; flex-direction: column; gap: 0.6rem; position: relative; min-width: 0; }
.screen .idle--v22 .ng-hero .dropzone {
  height: clamp(15rem, 52vh, 34rem); width: 100%;
  border-radius: 1.1rem; overflow: hidden;
  box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.45), 0 0 0 0.12rem color-mix(in srgb, var(--sun) 35%, transparent);
}
.screen .idle--v22 .ng-hero .dropzone .drop-fg { object-fit: contain; padding: 0.6rem; }
.screen .idle--v22 .ng-hero .img-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; }
.screen .idle--v22 .ng-hero .img-actions .btn-sec { font-size: 0.82rem; padding: 0.3em 0.75em; opacity: 0.88; }
.screen .idle--v22 .ng-hero .img-actions .btn-sec:hover, .screen .idle--v22 .ng-hero .img-actions .btn-sec:focus-visible, .screen .idle--v22 .ng-hero .img-actions .btn-sec[aria-pressed="true"] { opacity: 1; }
.screen .idle--v22 .ng-hero .url-panel { display: flex; gap: 0.5rem; }
.screen .idle--v22 .ng-hero .url-panel[hidden] { display: none; }
.screen .idle--v22 .ng-side { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.screen .idle--v22 .ng-side .input--xl { font-size: 1.7rem; }
.screen .idle--v22 .win-avs { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.8rem, 1fr)); gap: 0.5rem; overflow: visible; max-height: 15.5rem; overflow-y: auto; padding: 0.8rem 0.2rem 0.3rem; }
.screen .idle--v22 .win-av { width: auto; min-width: 0; }
.screen .idle--v22 .ng-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.4rem; position: static; background: none; padding: 0; }
.screen .idle--v22 .ng-cta .ng-primary { flex: 1 1 14rem; justify-content: center; font-size: 1.25rem; padding: 0.65em 1.2em; }
.screen .idle--v22 .ng-cta .ng-second { flex: 0 1 auto; }
.screen .idle--v22 .ng-cta #openRules { flex: 0 0 auto; }
.screen .idle--v22 .next-card.has-lib h1 { font-size: 2.2rem; }

/* Classifica: colonna stretta con la barra delle azioni in cima */
.screen .idle--v22 .side-board { gap: 0.8rem; max-height: 100%; min-height: 0; }
.side-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.6rem; border-radius: 1rem; background: color-mix(in srgb, var(--paper) 70%, transparent); border: 0.1rem solid color-mix(in srgb, var(--ink-soft) 20%, transparent); }
.side-toolbar .btn-sec { flex: 1 1 calc(50% - 0.4rem); justify-content: center; }
.side-toolbar .side-end { flex-basis: 100%; border-color: var(--tomato); color: var(--tomato); }
html:not(.theme-show) .side-toolbar .side-end { color: #B23A12; }
.side-toolbar .side-end:hover, .side-toolbar .side-end:focus-visible { background: var(--tomato); color: #fff; }
.screen .idle--v22 .side-head h2 { font-size: 1.8rem; }
.screen .idle--v22 .side-scroll { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.screen .idle--v22 .mini-row { font-size: 1.05rem; }
.screen .idle--v22 .empty-board { padding: 1rem; }
.screen .idle--v22 .side-actions { gap: 0.4rem; }

/* Rivelazione decisa dalla regia: tutti hanno votato, il pulsante lo dice */
#revealBtn.is-ready { animation: gn-ready 1.6s ease-in-out infinite; }
@keyframes gn-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 211, 77, 0.0); } 50% { box-shadow: 0 0 0 0.45rem rgba(255, 211, 77, 0.35); } }
@media (prefers-reduced-motion: reduce) { #revealBtn.is-ready { animation: none; outline: 0.25rem solid var(--sun); } }

/* Schermi medi: la classifica va sotto, la copertina resta grande */
@media (max-width: 1100px) {
  .screen .idle--v22 { grid-template-columns: minmax(0, 1fr); }
  .screen--idle .idle--v22 { height: auto; }
  .screen .idle--v22 .side-board { max-height: none; }
}
@media (max-width: 760px) {
  .screen .idle--v22 .ng-body { grid-template-columns: minmax(0, 1fr); }
  .screen .idle--v22 .ng-hero .dropzone { height: clamp(13rem, 55vw, 22rem); }
  .screen .idle--v22 .ng-cta .ng-primary { flex-basis: 100%; }
  .tb-info { border-right: 0; padding-right: 0; }
}

/* 2.2 · armadio: chi può vederlo */
.am-people-h { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
.am-viewers li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.am-viewer-ico { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgba(127, 127, 160, 0.18); }
.am-blocked { margin-top: 0.6rem; }
.am-blocked summary { cursor: pointer; font-weight: 800; }

/* 2.5: gestore della stanza (TV: scelta negli Strumenti; telefono: pannello «Gestisci») */
.mgr-pick { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 800; }
.mgr-pick select { font: inherit; font-weight: 700; padding: 0.45rem 0.6rem; border-radius: 0.6rem; border: var(--bw) solid var(--ink); background: var(--paper); color: var(--ink); max-width: 100%; }
.mg-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin: 0.6rem 0; }
.mg-seats b { font-family: var(--display); font-size: 1.6rem; min-width: 2.6rem; text-align: center; }
.mg-list { list-style: none; margin: 0.4rem 0 0.8rem; padding: 0; display: grid; gap: 0.4rem; }
.mg-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.mg-name { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.mg-end { width: 100%; justify-content: center; }
