/* =================================================================
   Tema BIANCO (predefinito): linguaggio delle app Apple
   ================================================================= */
:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --ink: #1d1d1f;
  --on-ink: #ffffff;
  --muted: #6e6e73;
  --muted-2: #8e8e93;
  --line: #e5e5ea;
  --accent: #b5532f;
  --accent-2: #8c3a1f;
  --accent-soft: #f8e7df;
  --olive: #5f6f3a;
  --olive-soft: #e9eedd;
  --ok-ink: #33421a;
  --gold: #c99a2e;
  --gold-soft: #f2f2f7;
  --gold-ink: #6e6e73;
  --danger: #c0392b;
  --ko-soft: #fde4e1;
  --ko-ink: #7a1f17;
  --c-no: #a1a1a6;
  --glass: rgba(255, 255, 255, .78);
  --glass-nav: rgba(249, 249, 249, .82);
  --glass-border: rgba(0, 0, 0, .06);
  --glass-input: #f2f2f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --overlay: rgba(0, 0, 0, .3);
  --fill-accent: #b5532f;
  --fill-accent-2: #8c3a1f;
  --fill-olive: #5f6f3a;
  --fill-ink: #24506b;
  --fill-ink-text: #ffffff;
  --on-fill: #ffffff;
  --sq-1: #b5532f; --sq-2: #5f6f3a; --sq-3: #24506b;
  --chev: #c7c7cc;
  --radius: 14px;
}
/* =================================================================
   Tema NOTTE: blu notte e oro del campanile (dal pulsante in alto)
   ================================================================= */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1117;
  --surface: #141c24;
  --surface-2: #1b252f;
  --ink: #f2f4f6;
  --on-ink: #0b1117;
  --muted: #8a97a3;
  --muted-2: #6b7884;
  --line: #24303b;
  --accent: #f5b93f;
  --accent-2: #d99a22;
  --accent-soft: rgba(245, 185, 63, .14);
  --olive: #a3bd72;
  --olive-soft: rgba(163, 189, 114, .14);
  --ok-ink: #c9dca5;
  --gold: #f5b93f;
  --gold-soft: #1b252f;
  --gold-ink: #b4bec7;
  --danger: #ff7a6b;
  --ko-soft: rgba(255, 122, 107, .14);
  --ko-ink: #ffc2ba;
  --c-no: #5f6c78;
  --glass: rgba(20, 28, 36, .72);
  --glass-nav: rgba(30, 40, 50, .66);
  --glass-border: rgba(255, 255, 255, .09);
  --glass-input: #1b252f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --overlay: rgba(0, 0, 0, .6);
  --fill-accent: #f5b93f;
  --fill-accent-2: #d99a22;
  --fill-olive: #1b252f;
  --fill-ink: #1b252f;
  --fill-ink-text: #f2f4f6;
  --on-fill: #14232f;
  --sq-1: #f5b93f; --sq-2: #f5b93f; --sq-3: #f5b93f;
  --chev: #3d4a56;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.phone {
  position: relative;
  max-width: 430px;
  height: 100vh; height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
}

/* --- Header --- */
/* Barra in alto "fluttuante", stesso stile vetro della barra in basso */
.top {
  position: absolute; z-index: 6;
  top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 12px 14px 10px;
  transition: transform .3s ease, opacity .3s ease;
}
.top.nascosta { transform: translateY(calc(-100% - 24px)); opacity: 0; }
.top .demo-banner { border-radius: 12px; }
.top .pickers select { background: var(--glass-input); border-color: var(--line); }
/* Pulsantino per far ricomparire la barra quando è nascosta */
.pill-top {
  position: absolute; z-index: 6; left: 50%; top: calc(8px + env(safe-area-inset-top));
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 6px 14px;
  font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow);
  transition: opacity .25s ease, transform .25s ease;
}
.top.nascosta + .pill-top { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.brand-row { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 18px; }
.muted { color: var(--muted); font-size: 12px; font-weight: 400; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); }
.pickers { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 10px; }
.pickers label { display: flex; flex-direction: column; min-width: 0; }
.pickers span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.pickers select { width: 100%; padding: 7px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.demo-banner { margin-top: 8px; font-size: 11px; color: var(--gold-ink); background: var(--surface-2); border-radius: 8px; padding: 4px 8px; text-align: center; }

/* --- Main --- */
main { flex: 1; overflow-y: auto; padding: calc(var(--h-top, 160px) + 24px + env(safe-area-inset-top)) 16px 24px; }
h2 { font-size: 22px; margin: 4px 0 2px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(.99); }
.hero { background: linear-gradient(135deg, var(--fill-accent), var(--fill-accent-2)); color: #fff; border: none; }
.hero .sub { color: rgba(255,255,255,.8); }
.chip { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 0 4px 4px 0; }
.hero .chip { background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chips button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .v { font-weight: 600; margin-top: 2px; }
.stat.missing { border-style: dashed; background: transparent; }
.stat.missing .v { color: var(--muted); font-weight: 400; font-size: 13px; }
.stat.wide { grid-column: 1 / -1; }

.row { display: flex; align-items: center; gap: 10px; }
.row .grow, .list-item .grow { flex: 1; min-width: 0; }
.list-item > span:last-child { color: var(--muted); font-size: 18px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.list-item .main-w { font-weight: 600; }
.list-item .sec { color: var(--muted); font-size: 13px; }

.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.b-validata { background: var(--olive-soft); color: var(--olive); }
.b-confermata { background: var(--gold-soft); color: var(--gold-ink); }
.b-proposta { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--olive); border-radius: 999px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: none; border-radius: 12px; padding: 11px 16px; background: var(--fill-accent); color: #fff; font-weight: 600; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.olive { background: var(--fill-olive); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btns { display: flex; gap: 8px; margin-top: 12px; }
.btns .btn { flex: 1; }

input[type=text], input[type=number], input[type=search], input[type=email], input[type=tel], input[type=password], textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
textarea { min-height: 64px; resize: vertical; }
.field { margin-bottom: 10px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; border: none; background: none; padding: 7px; border-radius: 9px; font-size: 13px; }
.seg button.on { background: var(--ink); color: var(--on-ink); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .big { font-size: 40px; }
.note { font-size: 12px; color: var(--muted); }
.todo { font-size: 12px; background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.locked { opacity: .5; }

/* --- Bottom nav --- */
/* Barra in basso "fluttuante", stile iOS: vetro sfocato, bordi arrotondati */
nav.bottom {
  position: absolute; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; justify-content: space-around; align-items: center; gap: 4px;
  padding: 6px;
  background: var(--glass-nav);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
nav.bottom button {
  flex: 1; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); padding: 7px 2px; border-radius: 22px;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
nav.bottom button:active { transform: scale(.94); }
nav.bottom button span { font-size: 22px; line-height: 1.1; filter: grayscale(1); opacity: .65; transition: filter .2s, opacity .2s; }
nav.bottom button.on { color: var(--accent); font-weight: 600; background: rgba(181, 83, 47, .12); }
nav.bottom button.on span { filter: none; opacity: 1; }
main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* --- Sheet (bottom modal) --- */
.sheet { position: absolute; inset: 0; background: var(--overlay); display: flex; align-items: flex-end; z-index: 10; }
.sheet.hidden { display: none; }
.sheet-body { background: var(--surface-2); width: 100%; max-height: 88%; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 18px 16px 28px; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.x { border: none; background: var(--surface); border-radius: 50%; width: 32px; height: 32px; }

/* --- Games --- */
.flash { min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 28px; font-weight: 700; cursor: pointer; }
.flash .hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 10px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match button { padding: 14px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.match button.sel { border-color: var(--accent); background: var(--accent-soft); }
.match button.ok { background: var(--olive-soft); border-color: var(--olive); color: var(--olive); opacity: .6; }
.match button.ko { background: var(--ko-soft); border-color: var(--danger); }
.opts { display: grid; gap: 8px; margin-top: 12px; }
.opts button { padding: 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 600; }
.opts button.ok { background: var(--olive-soft); border-color: var(--olive); }
.opts button.ko { background: var(--ko-soft); border-color: var(--danger); }
.tokens { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; padding: 8px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface); margin: 10px 0; }
.tokens button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.big-word { font-size: 30px; font-weight: 700; text-align: center; margin: 14px 0 4px; }
.backlink { border: none; background: none; color: var(--accent); padding: 0; margin-bottom: 8px; font-weight: 600; }

.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: left; }
.game-card .e { font-size: 28px; }
.game-card b { display: block; margin-top: 6px; }
.game-card small { color: var(--muted); }

.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 20; max-width: 90%; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* --- Mappa --- */
.mappa { padding: 8px; }
.mappa svg { width: 100%; height: auto; display: block; }
.mappa path { stroke: var(--surface); stroke-width: 1; cursor: pointer; transition: opacity .15s; }
.mappa path:hover { opacity: .8; }
.mappa path.sel { stroke: var(--ink); stroke-width: 2; }
.mappa .pin { fill: var(--ink); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.timeline { display: grid; gap: 6px; }
.tl { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.tl-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Comuni: nero = dizionario del paese, grigio = ancora da raccogliere */
select option.c-si { color: var(--accent); font-weight: 800; }
.pickers select.c-si { color: var(--accent); font-weight: 800; border-color: var(--accent); }
select option.c-no { color: var(--c-no); }
select.c-no { color: var(--c-no); }
.progresso .riga-p { display: flex; justify-content: space-between; font-size: 13px; margin: 10px 0 4px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; margin-right: 2px; }
.adotta { border: 1.5px dashed var(--gold); background: var(--gold-soft); }
.adotta.si { border-style: solid; }

/* Home corta */
.pdg-w { font-size: 28px; font-weight: 800; margin: 2px 0; }
.azioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 14px; }
.azione { border: none; background: var(--fill-accent); color: #fff; border-radius: var(--radius); padding: 14px 6px; font-size: 14px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.azione span { font-size: 26px; }
.azione:nth-child(2) { background: var(--fill-olive); }
.azione:nth-child(3) { background: var(--fill-ink); color: var(--fill-ink-text); }
.progresso-mini { margin-top: 14px; padding: 10px 4px; font-size: 13px; color: var(--muted); cursor: pointer; }
.progresso-mini .bar { margin-top: 6px; height: 6px; }
.seg-big button { padding: 10px; font-size: 15px; font-weight: 600; }
.testo p { margin: 0 0 10px; line-height: 1.55; }
.testo p:last-child { margin-bottom: 0; }
.nonso { align-items: flex-start; gap: 10px; background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; margin: 4px 0 10px; }
.nonso input { margin-top: 3px; }
.nonso-info { background: var(--gold-soft); border-color: transparent; }

/* Benvenuto e panoramica */
.benvenuto { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(180deg, rgba(208,104,61,.92), rgba(165,71,42,.95));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.benvenuto.hidden { display: none; }
.benv-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 28px; padding: 26px 22px 20px; text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3); animation: up .25s ease-out; }
.benv-card .field, .benv-card .backlink { text-align: left; }
.benv-card h2 { margin: 6px 0 6px; }
.benv-card .btn { margin-top: 10px; }
.benv-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.link-btn { display: block; margin: 14px auto 0; border: none; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer; }
.passi { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.passi span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.passi span.on { background: var(--accent); width: 22px; border-radius: 999px; }
.raccogli { border: 1.5px dashed var(--accent); background: var(--accent-soft); }

/* Padre fondatore */
.fondatore { border-left: 4px solid var(--gold); background: var(--gold-soft); }
.fondatore .f-nome { font-size: 20px; font-weight: 800; margin-top: 2px; }

/* Lezione */
.lezione { text-align: center; padding: 26px 16px; }
.lez-it { font-size: 22px; font-weight: 600; margin: 2px 0 6px; }
.lez-dia { font-size: 34px; font-weight: 800; color: var(--accent); margin: 4px 0 2px; }
.passi-bar { display: flex; gap: 4px; margin: 0 0 10px; }
.passi-bar span { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
.passi-bar span.on { background: var(--accent); }
.feedback { border-radius: 14px; padding: 10px 12px; margin-top: 12px; line-height: 1.45; }
.feedback.ok { background: var(--olive-soft); color: var(--ok-ink); }
.feedback.ko { background: var(--ko-soft); color: var(--ko-ink); }
.fondatore.comunita { border-left-color: var(--olive); background: var(--olive-soft); }
/* logo in pixel art: quadretti netti anche quando è rimpicciolito */
.brand .logo, .benv-logo { image-rendering: auto; }

/* Metti nella Home */
.inst-top { display: flex; gap: 12px; align-items: center; }
.inst-icona { width: 56px; height: 56px; border-radius: 14px; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.passi-inst { margin: 4px 0 0; padding-left: 22px; line-height: 1.55; }
.passi-inst li { margin-bottom: 10px; }
.ico-inst { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); color: #1a73e8; vertical-align: middle; font-weight: 700; }


/* =================================================================
   RESTYLE 12/2026 – componenti comuni ai due temi
   ================================================================= */
body { -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
svg.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.phone { box-shadow: none; }
:root[data-theme="dark"] .phone { background: radial-gradient(420px 360px at 15% -5%, rgba(245,185,63,.16), transparent 70%), var(--bg); }

/* barra in alto */
.top { border-radius: 22px; box-shadow: var(--shadow); padding: 10px 12px 10px; }
.brand { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.brand b { font-weight: 650; }
.avatar { width: 34px; height: 34px; border: none; background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.avatar svg.ic { width: 19px; height: 19px; }
.top .pickers select { border: none; background: var(--glass-input); border-radius: 9px; }
.pickers span { letter-spacing: .04em; color: var(--muted-2); }
.top .demo-banner { background: transparent; color: var(--muted-2); padding: 2px 0 0; margin-top: 6px; }
.pill-top { display: inline-flex; align-items: center; gap: 5px; }
.pill-top svg.ic { width: 15px; height: 15px; }

/* titoli */
h2 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
h3 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 24px 0 8px 4px; }
.sub { color: var(--muted); }
.note { color: var(--muted); }

/* "hero": niente più riquadro colorato, titolo grande come nelle app Apple */
.card.hero { background: none; border: none; color: var(--ink); padding: 6px 4px 10px; margin-bottom: 6px; }
.card.hero h2 { font-size: 34px; }
.card.hero .sub { color: var(--muted); }
.hero .chip { background: var(--accent-soft); color: var(--accent); border: none; font-weight: 600; }

/* riquadri */
.card { border: none; border-radius: var(--radius); padding: 16px; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .list-item, :root[data-theme="dark"] .stat, :root[data-theme="dark"] .game-card { border: 1px solid var(--glass-border); }
.pdg .note { text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.pdg-w { font-size: 38px; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 2px; }
.chip { border: none; background: var(--surface-2); }
.stat { border: none; border-radius: var(--radius); }
.badge-ic { color: var(--accent); margin-bottom: 4px; }
.stat.missing .badge-ic { color: var(--muted-2); }
.empty .big svg.ic { width: 54px; height: 54px; color: var(--accent); stroke-width: 1.4; }

/* elenchi raggruppati (stile Impostazioni) */
.list-item { border: none; border-radius: 0; margin: 0; padding: 13px 16px; position: relative; background: var(--surface); }
.list-item .main-w { font-weight: 500; }
.list-item + .list-item::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
:not(.list-item) + .list-item, .list-item:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); margin-top: 8px; }
.list-item:has(+ :not(.list-item)), .list-item:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); margin-bottom: 10px; }
:root[data-theme="dark"] .list-item { border-width: 0 1px; }
:root[data-theme="dark"] :not(.list-item) + .list-item, :root[data-theme="dark"] .list-item:first-child { border-top-width: 1px; }
:root[data-theme="dark"] .list-item:has(+ :not(.list-item)), :root[data-theme="dark"] .list-item:last-child { border-bottom-width: 1px; }
.chev { color: var(--chev); display: inline-flex; }
.chev svg.ic { width: 18px; height: 18px; stroke-width: 2.2; }
.list-item > span:last-child { font-size: inherit; }

/* azioni della home: riquadri con icona */
.azioni { gap: 10px; margin: 14px 0 6px; }
.azione { background: var(--surface); color: var(--ink); align-items: flex-start; text-align: left; padding: 14px 12px; gap: 0; font-weight: 400; }
.azione:nth-child(2), .azione:nth-child(3) { background: var(--surface); color: var(--ink); }
.azione .sq { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--sq-1); color: #fff; }
.azione:nth-child(2) .sq { background: var(--sq-2); }
.azione:nth-child(3) .sq { background: var(--sq-3); }
.azione .sq svg.ic { width: 18px; height: 18px; }
.azione b { font-size: 15px; font-weight: 600; margin-top: 12px; }
.azione small { font-size: 12px; color: var(--muted-2); margin-top: 1px; }
:root[data-theme="dark"] .azione { border: 1px solid var(--glass-border); }
:root[data-theme="dark"] .azione .sq { background: transparent; color: var(--accent); width: auto; justify-content: flex-start; }
:root[data-theme="dark"] .azione:first-child { background: var(--accent); color: var(--on-fill); border-color: transparent; }
:root[data-theme="dark"] .azione:first-child .sq { color: var(--on-fill); }
:root[data-theme="dark"] .azione:first-child small { color: rgba(20, 35, 47, .7); }

/* pulsanti */
.btn { border-radius: 12px; background: var(--fill-accent); color: var(--on-fill); font-weight: 600; padding: 12px 16px; }
.btn.ghost { background: var(--surface); border: none; color: var(--accent); }
:root[data-theme="dark"] .btn.ghost { border: 1px solid var(--glass-border); color: var(--ink); }
.btn.olive { color: #fff; }
.seg { background: var(--line); border: none; border-radius: 9px; padding: 2px; }
.seg button { border-radius: 7px; font-weight: 500; color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .seg { background: var(--surface-2); }
:root[data-theme="dark"] .seg button.on { background: #2c3a47; }
.chips button { border: none; background: var(--surface); }
.chips button.on { background: var(--ink); color: var(--on-ink); }
input[type=text], input[type=number], input[type=search], input[type=email], input[type=tel], input[type=password], textarea, .field select { border: 1px solid var(--line); border-radius: 10px; }
.game-card { border: none; }
.game-card .e { color: var(--accent); }
.game-card .e svg.ic { width: 26px; height: 26px; }
.bar { background: var(--line); }
.bar > div { background: var(--accent); }
.progresso-mini .bar > div { background: var(--accent) !important; }

/* schede che salgono dal basso */
.sheet-body { background: var(--bg); }
.x { background: var(--surface-2); color: var(--muted); }

/* barra in basso: Bianco = barra classica a tutta larghezza con etichette */
nav.bottom { left: 0; right: 0; bottom: 0; border-radius: 0; padding: 7px 6px calc(6px + env(safe-area-inset-bottom)); gap: 0;
  background: var(--glass-nav); border: none; border-top: .5px solid rgba(0, 0, 0, .16); box-shadow: none; }
nav.bottom button { gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--muted-2); padding: 3px 2px; border-radius: 10px; }
nav.bottom button svg.ic { width: 25px; height: 25px; }
nav.bottom button.on { background: none; color: var(--accent); font-weight: 600; }
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
/* Notte = pillola fluttuante con sole icone */
:root[data-theme="dark"] nav.bottom { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom));
  width: auto; padding: 6px; gap: 6px; border-radius: 30px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
:root[data-theme="dark"] nav.bottom button { width: 60px; height: 46px; border-radius: 23px; flex: none; padding: 0; }
:root[data-theme="dark"] nav.bottom button span { display: none; }
:root[data-theme="dark"] nav.bottom button.on { background: rgba(255, 255, 255, .12); color: #fff; }
.toast { border-radius: 14px; }

/* ---------------------------------------------------------------
   Tablet: un po' più largo
   --------------------------------------------------------------- */
@media (min-width: 640px) and (max-width: 979px) {
  .phone { max-width: 680px; }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .sheet { align-items: center; justify-content: center; }
  .sheet-body { width: 560px; max-width: 92%; border-radius: 22px; }
}

/* ---------------------------------------------------------------
   Computer: barra in alto fissa, menu a sinistra, contenuto al centro
   --------------------------------------------------------------- */
@media (min-width: 980px) {
  body { font-size: 16px; }
  .phone { max-width: none; box-shadow: none; background: var(--bg); }

  .top { left: 24px; right: 24px; top: 14px; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 28px; padding: 12px 18px; }
  .top.nascosta { transform: none; opacity: 1; }
  .pill-top { display: none; }
  .brand-row { gap: 18px; justify-content: flex-start; }
  .brand { font-size: 21px; }
  .brand .logo { width: 34px; height: 34px; }
  .pickers { margin-top: 0; max-width: 680px; justify-self: end; width: 100%; }
  .pickers select { font-size: 14px; padding: 8px; }
  .top .demo-banner { grid-column: 1 / -1; justify-self: center; margin-top: 8px; padding: 3px 14px; }

  nav.bottom {
    left: 24px; right: auto; bottom: auto; top: calc(var(--h-top, 100px) + 32px); width: 220px;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; border-radius: 22px;
  }
  nav.bottom button { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 12px 14px; border-radius: 14px; }
  nav.bottom button:hover { background: rgba(181, 83, 47, .07); }
  nav.bottom button span { font-size: 20px; }

  main { padding: calc(var(--h-top, 100px) + 32px) 40px 48px 280px; }
  main > * { max-width: 860px; margin-left: auto; margin-right: auto; }
  main::-webkit-scrollbar { width: 10px; }
  main::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }

  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .azione { padding: 20px 8px; font-size: 15px; }
  .list-item:hover, .game-card:hover { border-color: var(--accent); }
  .flash { min-height: 260px; }

  .sheet { align-items: center; justify-content: center; }
  .sheet-body { width: 600px; max-width: 92%; max-height: 84%; border-radius: 22px; padding: 22px 24px 26px; }
  .toast { bottom: 36px; }
}
@media (min-width: 1300px) {
  main { padding-right: 280px; }
}

/* Scelta del tema nel Profilo */
.aspetto { display: flex; gap: 6px; }

/* Computer: menu laterale anche dopo il restyle (entrambi i temi) */
@media (min-width: 980px) {
  nav.bottom, :root[data-theme="dark"] nav.bottom { left: 24px; right: auto; transform: none; bottom: auto; top: calc(var(--h-top, 100px) + 32px); width: 220px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; border-radius: 18px; border: 1px solid var(--glass-border); box-shadow: var(--shadow); background: var(--surface); }
  nav.bottom button, :root[data-theme="dark"] nav.bottom button { width: auto; height: auto; flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 11px 12px; border-radius: 11px; }
  :root[data-theme="dark"] nav.bottom button span { display: inline; }
  nav.bottom button.on { background: var(--accent-soft); }
  :root[data-theme="dark"] nav.bottom button.on { background: var(--accent-soft); color: var(--accent); }
  nav.bottom button svg.ic { width: 21px; height: 21px; }
  .card.hero h2 { font-size: 40px; }
}
/* ritocchi restyle */
nav.bottom button span { font-size: inherit; line-height: 1.1; filter: none; opacity: 1; }
:root[data-theme="dark"] .card.hero { border: none; }
.stat.missing { border: 1.5px dashed var(--line); background: transparent; }
:root[data-theme="dark"] .stat.missing { border: 1.5px dashed var(--line); }
/* benvenuto: pulito, sul colore di fondo del tema */
.benvenuto { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-theme="dark"] .benvenuto { background: radial-gradient(420px 360px at 50% 0%, rgba(245,185,63,.16), transparent 70%), var(--bg); }
.benv-card { box-shadow: var(--shadow); border-radius: 24px; }
:root[data-theme="dark"] .benv-card { border: 1px solid var(--glass-border); }
