/* Carnevale Civitonico - stile (v0.1.0). Grafica dalle schermate di riferimento grafica-gpt (img-7/8/9/10).
   Regole tablet vecchi: niente "gap" in flex/grid (si usano i margini), ogni env() con il valore di riserva. */
:root {
  /* palette ufficiale (GUIDA-CHATGPT): magenta azioni, oro accenti con testo viola, turchese dettagli, viola testi, arancio decori, crema sfondo */
  --bg: #fff7e8;
  --bg2: #fbeed6;
  --card: #ffffff;
  --card2: #f5eefa;
  --rosa: #fbe4ee;
  --testo: #432369;
  --muto: #6a5683;
  --viola: #432369;
  --viola2: #5a3488;
  --magenta: #c8246b;
  --magenta2: #a81b58;
  --oro: #f4bc38;
  --oro-chiaro: #f4bc38;
  --oro-testo: #432369;
  --turchese: #19b7b0;
  --arancio: #f37935;
  --verde: #1f8a4c;
  --rosso: #c62828;
  --bordo: #efe3f3;
  --ombra: 0 4px 14px rgba(67, 35, 105, .10);
  --tab: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1230; --bg2: #24173a; --card: #2b1c43; --card2: #35244f; --rosa: #4b1f3a; --testo: #fff7e8; --muto: #d2c3e2;
    --viola: #fff7e8; --viola2: #f4d27e; --magenta: #e0408a; --magenta2: #c8246b; --oro-chiaro: #f4bc38; --oro-testo: #432369; --bordo: #43305e;
    --ombra: 0 4px 14px rgba(0, 0, 0, .35); --tab: #251839;
  }
}
:root[data-theme="dark"] {
  --bg: #1d1230; --bg2: #24173a; --card: #2b1c43; --card2: #35244f; --rosa: #4b1f3a; --testo: #fff7e8; --muto: #d2c3e2;
    --viola: #fff7e8; --viola2: #f4d27e; --magenta: #e0408a; --magenta2: #c8246b; --oro-chiaro: #f4bc38; --oro-testo: #432369; --bordo: #43305e;
    --ombra: 0 4px 14px rgba(0, 0, 0, .35); --tab: #251839;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background-color: var(--bg); color: var(--testo);
  font-family: "Nunito Sans", "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; line-height: 1.4;
  overflow-x: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Crect x='14' y='20' width='9' height='5' rx='1' fill='%23e5468c' transform='rotate(30 18 22)'/%3E%3Crect x='170' y='40' width='8' height='5' rx='1' fill='%2317b3c4' transform='rotate(-25 174 42)'/%3E%3Ccircle cx='96' cy='70' r='3' fill='%23f2b31b'/%3E%3Crect x='40' y='150' width='9' height='5' rx='1' fill='%23f2b31b' transform='rotate(60 44 152)'/%3E%3Ccircle cx='190' cy='170' r='3' fill='%23e5468c'/%3E%3Crect x='120' y='190' width='8' height='5' rx='1' fill='%237b3fc4' transform='rotate(15 124 192)'/%3E%3Ccircle cx='20' cy='100' r='2.5' fill='%2317b3c4'/%3E%3C/svg%3E");
  background-attachment: fixed;
}
img { max-width: 100%; }
a { color: var(--magenta); }
button { font-family: inherit; }
.tit, h1, h2, h3 { font-family: "Baloo 2", "Arial Rounded MT Bold", "Nunito Sans", sans-serif; font-weight: 800; color: var(--viola); letter-spacing: .2px; }
h1 { font-size: 38px; line-height: 1.05; margin: 0; }
h2 { font-size: 26px; line-height: 1.1; margin: 0 0 8px; }
h3 { font-size: 20px; line-height: 1.15; margin: 0 0 6px; }
p { margin: 0 0 8px; }
.muted { color: var(--muto); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* icone */
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: 0 0 auto; }
.i.piena { fill: currentColor; stroke: none; }

/* struttura */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }
#main { padding: 10px 16px 96px; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.pagina { animation: entra .25s ease-out; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* testata con titolo grande e "esplosioni" di coriandoli come nelle bozze */
.testa { position: relative; text-align: center; padding: 14px 44px 6px; }
.testa h1 { font-size: 40px; }
.testa .sotto { font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; color: var(--viola2); font-size: 19px; margin-top: 2px; }
.testa .burst { position: absolute; top: 10px; width: 44px; height: 44px; }
.testa .burst.sx { left: 0; }
.testa .burst.dx { right: 0; transform: scaleX(-1); }
.indietro { display: inline-block; color: var(--viola); text-decoration: none; font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; font-size: 22px; padding: 6px 0 8px; }
.indietro .i { color: var(--magenta); width: 24px; height: 24px; margin-right: 4px; margin-top: -3px; }

/* logo home */
.logo { display: block; margin: 0 auto; width: 100%; max-width: 380px; height: auto; }
.solo-scuro { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .solo-scuro { display: block; } :root:not([data-theme="light"]) .solo-chiaro { display: none; } }
:root[data-theme="dark"] .solo-scuro { display: block; }
:root[data-theme="dark"] .solo-chiaro { display: none; }
.hero { display: block; width: 100%; height: auto; border-radius: 22px; box-shadow: var(--ombra); margin: 4px 0 12px; }

/* card */
.card { background: var(--card); border-radius: 20px; box-shadow: var(--ombra); padding: 14px; margin: 0 0 12px; border: 1px solid var(--bordo); }
.card.viola { background: var(--card2); }
.riga { display: flex; align-items: center; }
.riga > * + * { margin-left: 12px; }
.cresci { flex: 1 1 auto; min-width: 0; }
.tondo { width: 46px; height: 46px; border-radius: 50%; background: var(--rosa); color: var(--magenta); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tondo .i { width: 24px; height: 24px; }
.freccia { color: var(--viola); }

/* conto alla rovescia */
.festa { text-align: center; font-size: 34px; margin: 6px 0 10px; }
.conto { display: table; margin: 0 auto 14px; background: var(--rosa); border-radius: 22px; padding: 10px 22px 8px; text-align: center; }
.conto .num { font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; color: var(--magenta); font-size: 54px; line-height: 1; vertical-align: middle; }
.conto .gg { font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; color: var(--viola); font-size: 28px; vertical-align: middle; margin-left: 6px; }
.conto .i { width: 40px; height: 40px; color: var(--magenta); vertical-align: middle; margin-right: 8px; }
.conto .nota { display: block; font-size: 12px; color: var(--muto); margin-top: 2px; }

/* pillole */
.pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; background: var(--oro-chiaro); color: var(--oro-testo); white-space: nowrap; }
.pill.rosa { background: var(--rosa); color: var(--magenta); }
.pill.verde { background: #dff5e7; color: #1d7a43; }
.pill.rosso { background: #fde2e2; color: #b42323; }
.pill.blu { background: #dcf4f7; color: #0f7783; }
.pill.grande { font-size: 15px; padding: 8px 16px; }
.pill .i { width: 18px; height: 18px; margin: -3px 6px 0 0; }
.esempio { position: absolute; top: 10px; right: 10px; background: #fff; color: var(--magenta2); font-size: 11px; font-weight: 800; border-radius: 999px; padding: 4px 10px; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0,0,0,.15); }

/* bottoni */
.btn { display: block; width: 100%; border: 0; border-radius: 16px; background: var(--magenta); color: #fff; font-weight: 800; font-size: 16px; padding: 13px 16px; text-align: center; text-decoration: none; cursor: pointer; box-shadow: 0 3px 10px rgba(200, 36, 107, .28); }
.btn:active { background: var(--magenta2); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn .i { width: 22px; height: 22px; margin: -3px 8px 0 0; }
.btn.grande { font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; font-size: 22px; padding: 12px 16px; border-radius: 18px; }
.btn.chiaro { background: var(--card2); color: var(--viola); box-shadow: none; }
.btn.bordo { background: transparent; color: var(--magenta); border: 2px solid var(--magenta); box-shadow: none; }
.btn.piccolo { display: inline-block; width: auto; font-size: 14px; padding: 8px 14px; border-radius: 12px; }
.due { overflow: hidden; margin: 0 0 12px; }
.due .btn { float: left; width: 48.5%; padding: 13px 8px; font-size: 15px; }
.due .btn + .btn { margin-left: 3%; }
.link { background: none; border: 0; color: var(--magenta); text-decoration: underline; font-size: 14px; padding: 6px 0; cursor: pointer; }

/* prossimo evento */
.evento .t { font-weight: 800; font-size: 17px; line-height: 1.25; color: var(--testo); }

/* programma */
.giorno { display: flex; padding: 10px; }
.giorno .foto { width: 40%; flex: 0 0 40%; display: block; border-radius: 14px; object-fit: cover; min-height: 150px; background: var(--card2); }
.giorno .dx { flex: 1 1 auto; min-width: 0; margin-left: 10px; display: flex; flex-direction: column; }
.giorno .top { display: flex; align-items: flex-start; }
.data { background: var(--rosa); border-radius: 14px; text-align: center; padding: 4px 8px; min-width: 54px; flex: 0 0 auto; margin-right: 10px; }
.data b { display: block; font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; color: var(--magenta); line-height: 1; }
.data .dg { font-size: 13px; }
.data .nn { font-size: 30px; }
.data .mm { font-size: 13px; }
.giorno h3 { font-size: 22px; margin: 2px 0 4px; }
.info-ora { background: var(--card2); border-radius: 12px; padding: 6px 10px; font-size: 13px; margin: 8px 0; color: var(--testo); }
.info-ora .i { width: 18px; height: 18px; color: var(--viola); margin: -2px 6px 0 0; }
.giorno .btn { margin-top: auto; padding: 10px 12px; font-size: 15px; }
.giorno .desc { font-size: 14px; color: var(--muto); }
/* stato dell'evento ben visibile */
.stato { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; margin: 0 0 4px; }
.stato.provvisorio { background: var(--oro); color: #432369; }
.stato.confermato { background: #1f8a4c; color: #fff; }
.stato.rinviato { background: #f37935; color: #2b1640; }
.stato.annullato { background: #c62828; color: #fff; }
.giorno.annullato h3 { text-decoration: line-through; }
/* etichetta "elaborazione creativa" sulle immagini generate */
.fig { position: relative; display: block; }
.fig .ec { position: absolute; left: 8px; bottom: 8px; background: rgba(43, 22, 64, .78); color: #fff7e8; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 2px 7px; pointer-events: none; }
.giorno .fig { width: 40%; flex: 0 0 40%; }
.giorno .fig .foto { width: 100%; height: 100%; }
.carro .fig { width: 48%; flex: 0 0 48%; }
.carro .fig .foto { width: 100%; }

/* carri */
.filtro { display: flex; background: var(--card2); border-radius: 14px; padding: 4px; margin: 4px 0 12px; }
.filtro button { flex: 1 1 50%; border: 0; background: transparent; padding: 9px; border-radius: 11px; font-weight: 800; color: var(--viola); font-size: 15px; cursor: pointer; }
.filtro button.on { background: var(--magenta); color: #fff; }
.carro { display: flex; align-items: center; padding: 8px; cursor: pointer; text-decoration: none; color: inherit; border: 2px solid transparent; }
.carro .foto { width: 48%; flex: 0 0 48%; display: block; height: 104px; border-radius: 14px; object-fit: cover; background: var(--card2); }
.carro .dx { flex: 1 1 auto; margin-left: 12px; min-width: 0; }
.carro h3 { font-size: 22px; margin: 0 0 4px; }
.carro.sel { border-color: var(--magenta); }
.spunta { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #e8a8c4; flex: 0 0 auto; margin-left: 6px; display: flex; align-items: center; justify-content: center; color: #fff; }
.carro.sel .spunta { background: var(--magenta); border-color: var(--magenta); }
.spunta .i { width: 18px; height: 18px; stroke-width: 3; }

/* scheda carro */
.copertina { position: relative; margin: 0 -16px 8px; }
.copertina img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; }
.nome-carro { position: relative; text-align: center; padding: 4px 46px 2px; }
.nome-carro h1 { font-size: 36px; }
.nome-carro .burst { position: absolute; top: 4px; width: 40px; height: 40px; }
.nome-carro .burst.sx { left: 0; }
.nome-carro .burst.dx { right: 0; transform: scaleX(-1); }
.quinte { overflow: hidden; }
.quinte img { float: left; width: 32%; height: 86px; object-fit: cover; border-radius: 12px; cursor: pointer; margin: 0 0 6px 2%; }
.quinte img:nth-child(3n+1) { margin-left: 0; }
.nota-voto { background: var(--rosa); color: var(--testo); border-radius: 14px; padding: 9px 12px; font-size: 13px; text-align: center; margin: 10px 0 12px; }
.nota-voto .i { width: 18px; height: 18px; color: var(--magenta); margin: -2px 6px 0 0; }

/* classifica */
.pos { font-family: "Baloo 2", "Arial Rounded MT Bold", sans-serif; font-weight: 800; font-size: 24px; color: var(--magenta); width: 34px; text-align: center; flex: 0 0 auto; }
.barra { height: 8px; background: var(--card2); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.barra span { display: block; height: 8px; background: var(--magenta); border-radius: 6px; }

/* avvisi */
.avviso-c { border-left: 6px solid var(--turchese); }
.avviso-c.importante.top { background: #fde8e8; }
:root[data-theme="dark"] .avviso-c.importante.top { background: #4a1f2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avviso-c.importante.top { background: #4a1f2a; } }
.avviso-c.ritardo { border-left-color: var(--arancio); }
.avviso-c.meteo { border-left-color: #5b8def; }
.avviso-c.importante { border-left-color: var(--rosso); }
.avviso-c .quando { font-size: 12px; color: var(--muto); }

/* mappa */
.mappa-box { padding: 6px; overflow: hidden; }
.mappa-box svg { display: block; width: 100%; height: auto; }
.legenda { overflow: hidden; }
.legenda div { float: left; width: 50%; padding: 4px 0; font-size: 14px; }
.punto { display: inline-block; width: 24px; height: 24px; border-radius: 50%; color: #fff; text-align: center; line-height: 24px; font-size: 11px; font-weight: 800; margin-right: 6px; vertical-align: middle; }
.p-park { background: #2f6fd6; } .p-wc { background: #17a3b3; } .p-food { background: #e88a12; } .p-sos { background: #d93838; } .p-info { background: #7b3fc4; }
.dove { display: flex; align-items: center; }
.dove.vecchia { border: 2px solid var(--arancio); }
.pulsa { width: 18px; height: 18px; border-radius: 50%; background: var(--magenta); flex: 0 0 auto; margin-right: 10px; box-shadow: 0 0 0 0 rgba(200, 36, 107, .6); animation: pulsa 1.6s infinite; }
.pulsa.ferma { background: #b8a9c9; animation: none; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(200, 36, 107, .6); } 70% { box-shadow: 0 0 0 12px rgba(200, 36, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 36, 107, 0); } }
.sfilata-dot { animation: battito 1.4s infinite; transform-origin: center; }
@keyframes battito { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

/* menu Altro */
.menu a, .menu button { display: flex; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--bordo); padding: 13px 4px; color: var(--testo); font-size: 16px; font-weight: 700; text-decoration: none; text-align: left; cursor: pointer; }
.menu a:last-child, .menu button:last-child { border-bottom: 0; }
.menu .i { color: var(--magenta); margin-right: 12px; }
.menu .cresci { flex: 1 1 auto; }
.scelte { display: flex; flex-wrap: wrap; }
.scelte button { border: 2px solid var(--bordo); background: var(--card); color: var(--testo); border-radius: 12px; padding: 7px 12px; font-weight: 700; margin: 0 6px 6px 0; cursor: pointer; }
.scelte button.on { border-color: var(--magenta); color: var(--magenta); }
[data-falco-promo] { margin: 6px 0 0; }

/* barra in basso */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--tab); box-shadow: 0 -3px 14px rgba(67, 35, 105, .12); padding-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar .in { max-width: 560px; margin: 0 auto; display: flex; }
.tabbar a { flex: 1 1 20%; text-align: center; color: var(--viola); text-decoration: none; font-size: 12px; font-weight: 700; padding: 8px 2px 7px; position: relative; }
.tabbar a .i { display: block; margin: 0 auto 2px; width: 25px; height: 25px; }
.tabbar a.on { color: var(--magenta); }
.tabbar a.on:after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 2px; height: 3px; border-radius: 3px; background: var(--magenta); }

/* moduli */
.campo { display: block; margin: 0 0 10px; }
.campo > span { display: block; font-size: 13px; font-weight: 700; color: var(--muto); margin: 0 0 4px; }
.in { width: 100%; border: 2px solid var(--bordo); border-radius: 12px; padding: 11px 12px; font-size: 16px; background: var(--card); color: var(--testo); font-family: inherit; }
.in:focus { outline: none; border-color: var(--magenta); }
textarea.in { min-height: 90px; resize: vertical; }
.pw { position: relative; }
.pw .in { padding-right: 46px; }
.pw button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 40px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.chk { display: flex; align-items: flex-start; font-size: 14px; margin: 8px 0; }
.chk input { margin: 3px 8px 0 0; flex: 0 0 auto; }
.err { color: var(--rosso); font-size: 14px; margin: 8px 0 0; min-height: 1px; }
.err.ok { color: var(--verde); }
.codice-grande { font-size: 28px; letter-spacing: 8px; text-align: center; }
.tabs2 { display: flex; background: var(--card2); border-radius: 12px; padding: 4px; margin: 0 0 12px; }
.tabs2 button { flex: 1 1 50%; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 800; color: var(--viola); cursor: pointer; }
.tabs2 button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* avviso a comparsa e finestra */
#toast { position: fixed; left: 16px; right: 16px; bottom: 84px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 40; max-width: 520px; margin: 0 auto; background: var(--viola); color: var(--bg); padding: 12px 14px; border-radius: 14px; text-align: center; font-weight: 700; box-shadow: var(--ombra); }
#modale { position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 50; background: rgba(20, 8, 35, .6); padding: 16px; overflow-y: auto; }
#modale .box { background: var(--card); border-radius: 20px; padding: 18px; max-width: 520px; margin: 30px auto; position: relative; }
#modale .chiudi { position: absolute; right: 8px; top: 8px; border: 0; background: var(--card2); color: var(--viola); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
#modale .box img.grande { width: 100%; border-radius: 14px; display: block; }
.offline { background: var(--oro-chiaro); color: var(--oro-testo); text-align: center; font-size: 13px; padding: 6px 10px; border-radius: 12px; margin: 0 0 10px; }

/* storia / testi */
.testo p { margin: 0 0 10px; }
.testo h3 { margin-top: 6px; }

/* admin */
.adm-tabs { display: flex; flex-wrap: wrap; margin: 0 0 12px; }
.adm-tabs button { border: 0; background: var(--card2); color: var(--viola); border-radius: 12px; padding: 9px 12px; font-weight: 800; margin: 0 6px 6px 0; cursor: pointer; }
.adm-tabs button.on { background: var(--magenta); color: #fff; }
.adm-riga { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--bordo); }
.adm-riga:last-child { border-bottom: 0; }
.adm-riga img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; margin-right: 10px; flex: 0 0 auto; }
.adm-riga .btn.piccolo { margin-left: 6px; }
.anteprima { overflow: hidden; margin: 6px 0; }
.anteprima span { float: left; position: relative; margin: 0 6px 6px 0; }
.anteprima img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.anteprima button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--rosso); color: #fff; font-weight: 800; cursor: pointer; line-height: 24px; padding: 0; }
input[type=range] { width: 100%; }

@media (max-width: 380px) {
  h1, .testa h1 { font-size: 32px; }
  .nome-carro h1 { font-size: 30px; }
  .festa { font-size: 28px; }
  .conto .num { font-size: 46px; }
  .giorno h3, .carro h3 { font-size: 19px; }
  .giorno .foto { min-height: 130px; }
  .due .btn { font-size: 14px; }
  .tabbar a { font-size: 11px; }
}


/* ---------- animazioni (solo con html.anim: l'interruttore in Altro e prefers-reduced-motion la tolgono) ---------- */
#coriandoli { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#esplosione { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
#app { z-index: 1; }
.filanti { position: absolute; top: -6px; left: -10px; right: -10px; height: 70px; pointer-events: none; overflow: hidden; z-index: 0; }
.filanti svg { position: absolute; top: 0; width: 90px; height: 70px; }
.filanti .f1 { left: 0; transform-origin: 10% 0; }
.filanti .f2 { right: 0; transform-origin: 90% 0; }
.testa > *, .home-top > * { position: relative; z-index: 1; }
.testa > .filanti, .home-top > .filanti { position: absolute; z-index: 0; }
.home-top { position: relative; }
.anim .filanti .f1 { animation: ondeggia 4.5s ease-in-out infinite; }
.anim .filanti .f2 { animation: ondeggia 5.2s ease-in-out infinite reverse; }
@keyframes ondeggia { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }
.anim .pagina .card, .anim .pagina .btn, .anim .pagina .hero { animation: compari .45s ease-out both; }
.anim .pagina .card:nth-of-type(2) { animation-delay: .05s; }
.anim .pagina .card:nth-of-type(3) { animation-delay: .1s; }
.anim .pagina .card:nth-of-type(4) { animation-delay: .15s; }
.anim .pagina .card:nth-of-type(n+5) { animation-delay: .2s; }
@keyframes compari { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.anim .btn, .anim .card.carro, .anim .tabbar a, .anim .menu a, .anim .menu button { transition: transform .18s cubic-bezier(.34, 1.56, .64, 1); }
.anim .btn:active, .anim .card.carro:active, .anim .tabbar a:active { transform: scale(.95); }
.anim .rimbalzo { animation: rimbalzo .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes rimbalzo { 0% { transform: scale(1); } 35% { transform: scale(.93); } 70% { transform: scale(1.05); } 100% { transform: scale(1); } }
.anim .conto .num.batti { animation: batti .5s ease-out; }
@keyframes batti { 0% { transform: scale(1); } 30% { transform: scale(1.12); } 100% { transform: scale(1); } }
.conto .num { display: inline-block; }
.conto .sec { display: block; font-weight: 800; color: var(--viola); font-size: 15px; margin-top: 2px; }
html:not(.anim) .pagina, html:not(.anim) .pulsa, html:not(.anim) .sfilata-dot { animation: none; }
html:not(.anim) #coriandoli { display: none; }
.interruttore { display: flex; align-items: center; width: 100%; background: none; border: 0; padding: 8px 0; color: var(--testo); font-size: 16px; font-weight: 700; cursor: pointer; text-align: left; }
.interruttore .lev { width: 50px; height: 28px; border-radius: 14px; background: #cbbcd9; position: relative; flex: 0 0 auto; margin-left: 10px; transition: background .2s; }
.interruttore .lev:after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; }
.interruttore.on .lev { background: var(--magenta); }
.interruttore.on .lev:after { left: 25px; }

/* ---------- v0.3.0 (26/10/2026, ovh4): foto del pubblico, mappa con filtri, ricerca, gioco, sponsor, archivio. Niente gap. ---------- */
.griglia-fp { overflow: hidden; margin: 0 0 12px; }
.griglia-fp .fp { float: left; width: 49%; margin: 0 0 2% 2%; padding: 0; border: 0; background: var(--card2); border-radius: 16px; overflow: hidden; position: relative; cursor: pointer; box-shadow: var(--ombra); }
.griglia-fp .fp:nth-child(2n+1) { margin-left: 0; clear: left; }
.griglia-fp .fp img { display: block; width: 100%; height: 150px; object-fit: cover; }
.griglia-fp .fp .ec { position: absolute; left: 6px; bottom: 6px; background: rgba(43, 22, 64, .78); color: #fff7e8; font-size: 9px; font-weight: 700; border-radius: 8px; padding: 2px 6px; }
@media (min-width: 560px) { .griglia-fp .fp img { height: 190px; } }
.anteprima-fp { background: var(--card2); border-radius: 14px; min-height: 140px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: var(--muto); margin: 0 0 8px; overflow: hidden; }
.anteprima-fp .i { width: 40px; height: 40px; margin-bottom: 4px; }
.anteprima-fp img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.link .i { width: 16px; height: 16px; vertical-align: -3px; }

.chip-mappa { margin: 0 0 8px; }
.chip-mappa button { font-size: 14px; padding: 6px 11px; }
.pallino { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.punto-mappa { cursor: pointer; }
.punto-mappa .alone { -webkit-transition: opacity .2s; transition: opacity .2s; }
.punto-mappa.sel .alone { opacity: .35; }
.scheda-punto { border-left: 5px solid var(--magenta); }
.scheda-punto .punto { flex: 0 0 auto; width: 32px; height: 32px; line-height: 32px; font-size: 13px; margin-right: 0; }
.chiudi-p { border: 0; background: var(--card2); color: var(--viola); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; padding: 0; }
.chiudi-p .i { width: 18px; height: 18px; margin-top: 2px; }

.cerca-box { position: relative; margin: 0 0 12px; }
.cerca-box .i { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; color: var(--muto); }
.cerca-box .in { padding-left: 40px; border-radius: 14px; }

.gioco-box { padding: 10px; }
.gioco-barra { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; margin: 0 4px 8px; color: var(--viola); }
.gioco-barra b { font-family: "Baloo 2", Arial, sans-serif; font-size: 20px; color: var(--magenta); margin-left: 4px; }
.gioco-campo { border-radius: 16px; overflow: hidden; border: 2px solid var(--bordo); }
canvas.gioco { display: block; width: 100%; height: auto; -ms-touch-action: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.card.gioca { background: #fff3d1; border-color: #f4dc9a; }
.card.gioca .tondo { background: var(--oro); color: var(--viola); }
:root[data-theme="dark"] .card.gioca { background: #3a2a14; border-color: #5a4320; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.gioca { background: #3a2a14; border-color: #5a4320; } }

.sponsor-lista { overflow: hidden; }
.sponsor-lista .sp { float: left; width: 49%; margin: 0 0 2% 2%; display: block; background: var(--card2); border-radius: 14px; padding: 10px; text-decoration: none; color: var(--testo); min-height: 74px; }
.sponsor-lista .sp:nth-child(2n+1) { margin-left: 0; clear: left; }
.sponsor-lista .sp b { display: block; color: var(--viola); }
.sponsor-lista .sp span { display: block; }
.sponsor-lista .sp .pill { display: inline-block; }
.sponsor-lista .sp img { display: block; width: 100%; height: 86px; object-fit: cover; border-radius: 10px; margin-bottom: 6px; background: #fff; }

.anno { font-family: "Baloo 2", Arial, sans-serif; font-weight: 800; font-size: 20px; background: var(--oro); color: var(--oro-testo); border-radius: 12px; padding: 2px 10px; flex: 0 0 auto; }

/* 0.4.2 (6/11/2026 ovh4, regola 8i): colori della finestra Segnalazioni dal tema (20 temi) */
:root { --fsg-bg: var(--vt-barra-piena, var(--card)); --fsg-fg: var(--testo); --fsg-muted: var(--muto); --fsg-line: var(--vt-linea2, var(--bordo)); --fsg-accent: var(--magenta); --fsg-accent-fg: #ffffff; --fsg-tile: rgba(127, 127, 127, .12); }
.menu .voce--piccola { font-size: 14px; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .pagina { animation: none; } }
/* 10/11/2026 ovh4: logo vero della Fondazione (trasparente): le stelle filanti dietro lo coprivano, nella Home niente filanti */
.home-top > .filanti { display: none; }
/* 10/11/2026 ovh4 (Antonio): logo della Home un po' piu' piccolo */
.home-top .logo { max-width: 290px; }
/* 11/11/2026 ovh4 v0.6.0: mappa vera di Civita (OpenStreetMap) con zoom */
.mappa-box { position: relative; }
.mappa-vera { border-radius: 14px; }
.zoom-mappa { position: absolute; right: 14px; top: 14px; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column; }
.zoom-mappa button { width: 38px; height: 38px; margin-bottom: 6px; border-radius: 12px; border: 1px solid var(--bordo, rgba(0,0,0,.15)); background: var(--card, #fff); color: var(--viola, #432369); font-size: 22px; font-weight: 800; line-height: 1; box-shadow: 0 4px 12px -6px rgba(0,0,0,.4); cursor: pointer; }
:root[data-theme="dark"] .mappa-sfondo { filter: invert(.88) hue-rotate(180deg) brightness(.85); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mappa-sfondo { filter: invert(.88) hue-rotate(180deg) brightness(.85); } }
/* 11/11/2026 v0.6.0: squadra del carro */
.squadra-home > img, .squadra-home > .fig { width: 64px; height: 64px; -webkit-flex: 0 0 auto; flex: 0 0 auto; margin-right: 12px; border-radius: 14px; overflow: hidden; }
.squadra-home > img, .squadra-home > .fig img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; }
.squadra-home > .fig .ec { display: none; }
.squadra-home.da-fare { border: 2px solid var(--magenta); }
.card.squadra .btn { margin-top: 8px; }
/* 11/11/2026 v0.6.0: concorso maschere, premio, podio */
.card.maschera { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; padding: 10px; }
.card.maschera .foto-m { -webkit-flex: 0 0 auto; flex: 0 0 auto; width: 104px; height: 128px; border-radius: 14px; overflow: hidden; margin-right: 12px; background: var(--card2); }
.card.maschera .foto-m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.maschera .dx { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; flex: 1 1 auto; min-width: 0; }
.card.maschera .dx h3 { margin: 0 0 2px; }
.card.maschera .dx .btn, .card.maschera .dx .pill { margin-top: 8px; }
.card.maschera.sel { border: 2px solid var(--magenta); }
.maschera-giorno > img { width: 76px; height: 76px; object-fit: cover; border-radius: 16px; -webkit-flex: 0 0 auto; flex: 0 0 auto; margin-right: 12px; }
.card.premio .fig, .card.premio > img { margin-bottom: 10px; }
.card.podio .pos { margin-right: 10px; }
.copertina img.grande { width: 100%; max-height: 70vh; object-fit: contain; display: block; border-radius: 18px; }

/* 15/11/2026 Antonio: slide della Home con dissolvenze, zoom lento e scritte che entrano */
.slide-home { position: relative; display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 22px; overflow: hidden; box-shadow: var(--ombra); margin: 4px 0 12px; background: #2b1640; color: #fff; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.slide-home .sl-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.slide-home .sl-foto.on { opacity: 1; }
.slide-home .sl-foto.zoom.on { animation: sl-zoom 7.5s ease-out both; }
.slide-home .sl-foto.zoom2.on { animation-name: sl-zoom2; }
@keyframes sl-zoom { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -1.5%); } }
@keyframes sl-zoom2 { from { transform: scale(1.14) translate(2%, 1%); } to { transform: scale(1.03) translate(0, 0); } }
.slide-home .sl-ombra { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(20,6,40,.82) 100%); pointer-events: none; }
.slide-home .sl-testo { position: absolute; left: 16px; right: 16px; bottom: 30px; pointer-events: none; }
.slide-home .sl-tit { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 26px; line-height: 1.05; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.slide-home .sl-sot { font-weight: 700; font-size: 14px; margin-top: 4px; opacity: .95; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.slide-home .sl-testo.entra .sl-tit { animation: sl-entra .8s cubic-bezier(.2,.9,.3,1.2) both; }
.slide-home .sl-testo.entra .sl-sot { animation: sl-entra .8s .25s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes sl-entra { from { opacity: 0; transform: translateY(18px) scale(.96); letter-spacing: 2px; } to { opacity: 1; transform: none; letter-spacing: 0; } }
.slide-home .sl-punti { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.slide-home .sl-punti span { width: 7px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.5); transition: width .4s ease, background .4s ease; }
.slide-home .sl-punti span.on { width: 20px; background: #fff; }
.slide-home .sl-cred { position: absolute; top: 8px; right: 10px; font-size: 9px; font-weight: 700; background: rgba(43,22,64,.6); border-radius: 8px; padding: 2px 7px; }
@media (min-width: 600px) { .slide-home .sl-tit { font-size: 34px; } .slide-home .sl-sot { font-size: 16px; } }
/* 15/11/2026 Antonio "le foto si tagliano": sul telefono la foto del giorno va sopra, larga quanto la scheda, e il testo sotto */
@media (max-width: 600px) {
  .giorno { flex-direction: column; }
  .giorno .foto, .giorno .fig { width: 100%; flex: 0 0 auto; min-height: 0; height: auto; aspect-ratio: 16 / 10; }
  .giorno .fig .foto { width: 100%; height: 100%; aspect-ratio: auto; }
  .giorno .foto { object-position: center 30%; }
  .giorno .dx { margin-left: 0; margin-top: 10px; }
}

/* 15/11/2026 Antonio: mappa vera (Leaflet, come Sciame) e carri dal vivo */
.mappa-vera { height: 340px; border-radius: 14px; overflow: hidden; z-index: 0; }
.segno-carro-w { background: none; border: 0; }
.segno-carro { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--magenta, #c2185b); color: #fff; font: 800 12px/1.2 'Nunito Sans', sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); border: 2px solid #fff; position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.segno-carro span { font-size: 16px; }
.segno-carro.fermo { background: #8a8a8a; }

/* 15/11/2026 Antonio: Visita Civita, riquadri grandi e chiari */
.riquadri-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.riquadro-info { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 18px; background: var(--vt-card, var(--card)); color: inherit; text-decoration: none; box-shadow: var(--ombra); border: 1px solid var(--vt-linea2, var(--bordo)); }
.riquadro-info b { font-size: 15px; line-height: 1.2; }
.riquadro-info .ri-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(194,24,91,.12); color: var(--magenta, #c2185b); }
.riquadro-info .ri-ic .i { width: 22px; height: 22px; }
.luogo-foto { margin: 0; }
.luogo-foto figcaption { text-align: right; margin: 2px 6px 0; }
.card.locale .scelte .btn { margin: 0; }

/* 15/11/2026 Antonio: chat del gruppo */
.chat-lista { max-height: 55vh; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.chat-lista .msg { position: relative; max-width: 85%; align-self: flex-start; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: rgba(127,127,127,.14); }
.chat-lista .msg.mio { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(194,24,91,.16); }
.chat-lista .msg-x { position: absolute; top: 2px; right: 4px; border: 0; background: none; color: inherit; opacity: .5; font-size: 16px; cursor: pointer; }
.chat-scrivi { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.chat-scrivi textarea { flex: 1; resize: vertical; }
.chat-scrivi .btn { width: auto; margin: 0; }

/* 15/11/2026 Antonio "bottone da staccare": i bottoni grandi non stanno attaccati ai riquadri sotto */
.pagina > .btn, .pagina > a.btn, .pagina > button.btn { margin-bottom: 14px; }
.pagina > .btn + .card, .pagina > .btn + div > .card:first-child { margin-top: 0; }
.btn.grande { margin-bottom: 14px; }
.btn + .card, .btn + .scelte { margin-top: 12px; }
.chat-lista .msg { padding-right: 26px; }

/* 15/11/2026: Quiz, Memory e Puzzle del carro */
.giochi-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gioco-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--bordo); text-decoration: none; color: inherit; }
.gioco-mini .tondo { width: 42px; height: 42px; }
.quiz-risp { display: block; width: 100%; margin: 8px 0 0; text-align: left; white-space: normal; }
.quiz-risp.giusta { background: #1f9d55 !important; color: #fff !important; border-color: #1f9d55 !important; }
.quiz-risp.sbagliata { background: #d64545 !important; color: #fff !important; border-color: #d64545 !important; }
.memory, .puzzle { display: grid; gap: 6px; }
.memory-carta { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: transparent; }
.memory-carta img, .memory-carta .dorso { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.memory-carta .dorso { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--magenta), var(--viola)); color: #fff; z-index: 1; }
.memory-carta .dorso .i { width: 34px; height: 34px; }
.memory-carta.aperta .dorso { opacity: 0; pointer-events: none; }
.memory-carta.presa { outline: 3px solid #1f9d55; }
.puzzle { gap: 2px; }
.puzzle-pezzo { aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background-repeat: no-repeat; cursor: pointer; }
.puzzle-pezzo.scelto { outline: 4px solid var(--magenta); outline-offset: -4px; }

/* 15/11/2026: punti e percorso sulla mappa vera */
.segno-punto-w { background: none; border: 0; }
.segno-punto-w .punto { width: 28px; height: 28px; line-height: 24px; margin: 0; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.etichetta-percorso { font: 800 12px/1.2 'Nunito Sans', sans-serif; color: #3e0b6e; }
.leaflet-popup-content .btn { display: inline-block; }
.adm-mappa-vera { height: 340px; border-radius: 14px; overflow: hidden; margin: 8px 0; z-index: 0; }
.adm-segno { background: none; border: 0; }
.adm-segno span { display: block; width: 26px; height: 26px; border-radius: 50%; color: #fff; text-align: center; line-height: 22px; font: 800 11px/22px Arial, sans-serif; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }

/* 15/11/2026: logo del Carnevale un po' piu' piccolo e a destra lo stemma del Comune di Civita Castellana */
.home-top { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.home-top .logo { max-width: 240px; width: 68%; margin: 0; }
.stemma-comune { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.stemma-comune img { width: 54px; height: auto; display: block; margin-bottom: 6px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.stemma-comune span { font-size: 9px; line-height: 1.1; font-weight: 700; max-width: 74px; opacity: .85; }

/* 15/11/2026: cuore del mi piace nell'angolo delle foto */
.fp { position: relative; }
.piace-mini { position: absolute; top: 8px; right: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.piace-mini b { font-size: 13px; }
.piace-mini.on { color: #ff4d7d; }
