@font-face { font-family: "Fraunces"; src: url(../font/fraunces.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url(../font/fraunces-corsivo.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(../font/nunito.woff2) format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Great Vibes"; src: url(../font/greatvibes.woff2) format("woff2"); font-display: swap; }

:root {
  --notte: #070b1f; --neve: #f4f7ff; --fioco: #b9c6ec; --oro: #f2cf7a; --oro-scuro: #c8932c;
  --rosso: #d11f45; --verde: #4ade9c;
  --vetro: linear-gradient(160deg, rgba(34, 46, 96, .78), rgba(13, 19, 48, .84));
  --bordo: rgba(190, 210, 255, .17);
  --raggio: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--notte); -webkit-text-size-adjust: 100%; }
body { font: 500 1rem/1.55 "Nunito", system-ui, sans-serif; color: var(--neve); min-height: 100svh; overflow-x: hidden; }
body.fermo { overflow: hidden; }

/* ---------- scena ---------- */
.scena { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 70% at 50% 100%, #35498f 0%, transparent 60%), linear-gradient(#04071a 0%, #0b1440 45%, #1d2a66 100%); }
.scena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#aurora { filter: blur(10px); opacity: .95; }
.luna { position: absolute; top: 11vh; right: 9vw; width: clamp(58px, 9vw, 108px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #fffdf2, #f6e7b8 55%, #d9c48a);
  box-shadow: 0 0 30px 6px rgba(255, 236, 180, .35), 0 0 120px 50px rgba(190, 200, 255, .16); }
.luna::before, .luna::after { content: ""; position: absolute; border-radius: 50%; background: rgba(170, 145, 90, .22); }
.luna::before { width: 24%; height: 24%; left: 55%; top: 22%; }
.luna::after { width: 15%; height: 15%; left: 28%; top: 62%; box-shadow: 2.2em .1em 0 -.1em rgba(170, 145, 90, .18); }
#slitta { position: absolute; left: 0; top: 0; width: clamp(240px, 36vw, 480px); opacity: 0; will-change: transform; }
#slitta svg { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 0 2px rgba(255, 226, 160, .95)) drop-shadow(0 0 14px rgba(255, 215, 130, .5)); }
.naso { filter: drop-shadow(0 0 6px #ff3b52); animation: pulsa 1.2s ease-in-out infinite; }
#paese { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(170px, 31vh, 300px); }
.finestra { animation: fiamma 6s ease-in-out infinite; }
.fumo { opacity: 0; animation: fumo 6.3s linear infinite; }
#luci { position: absolute; top: 0; left: 0; width: 100%; height: 70px; z-index: 3; pointer-events: none; }
.lampadina { animation: lampeggia 2.8s ease-in-out infinite; }
#neve { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* ---------- struttura ---------- */
.testata { position: relative; z-index: 4; display: flex; align-items: center; justify-content: space-between; max-width: 780px; margin: 0 auto; padding: max(52px, calc(env(safe-area-inset-top) + 44px)) 18px 0; }
.marchio { font: 400 1.9rem/1 "Great Vibes", cursive; color: var(--oro); text-decoration: none; text-shadow: 0 0 18px rgba(242, 207, 122, .5); }
main { position: relative; z-index: 2; max-width: 780px; margin: 0 auto; padding: 10px 16px clamp(230px, 36vh, 330px); display: flex; flex-direction: column; gap: 18px; }
main.entra > * { animation: sali .7s cubic-bezier(.2, .8, .2, 1) backwards; }
main.entra > :nth-child(2) { animation-delay: .09s; }
main.entra > :nth-child(3) { animation-delay: .18s; }
main.entra > :nth-child(n+4) { animation-delay: .26s; }
.attesa { text-align: center; padding-top: 28vh; font: italic 400 1.3rem "Fraunces", serif; color: var(--fioco); }

#nav { position: sticky; top: 8px; z-index: 20; display: flex; justify-content: center; gap: 4px; width: max-content; max-width: calc(100% - 20px); margin: 14px auto 0; padding: 6px; border-radius: 99px; background: rgba(10, 15, 40, .82); border: 1px solid var(--bordo); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); }
#nav a { position: relative; display: flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 99px; color: var(--fioco); text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap; transition: background .25s, color .25s; }
#nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
#nav a[aria-current] { background: linear-gradient(#ffe7a8, var(--oro) 55%, #dfa94a); color: #33210a; }
.bollo { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--rosso); color: #fff; font: 800 .7rem/1 "Nunito", sans-serif; font-style: normal; margin-left: 4px; }
#nav .bollo { position: absolute; top: -3px; right: -1px; }

/* ---------- testi ---------- */
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; text-wrap: balance; }
h2 { font-size: clamp(1.4rem, 4.4vw, 1.85rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p, dd, strong, li span, summary { overflow-wrap: anywhere; }
.firma { font-family: "Great Vibes", cursive; font-weight: 400; color: var(--oro); line-height: 1.15; }
.sopra { text-transform: uppercase; letter-spacing: .24em; font-size: .74rem; font-weight: 800; color: var(--fioco); }
.nota { font-size: .88rem; color: var(--fioco); }
.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--verde); font-weight: 800; }
hr { border: 0; border-top: 1px solid var(--bordo); margin: 6px 0; }
blockquote { white-space: pre-line; font: italic 400 1.08rem/1.5 "Fraunces", serif; color: #e5ecff; max-width: 34em; padding: 14px 20px; border-radius: 16px; background: rgba(12, 18, 48, .6); border: 1px solid var(--bordo); }
a { color: var(--oro); }
.nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icona { width: 1.2em; height: 1.2em; flex: none; }

.eroe, .saluto { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.eroe { padding: 4vh 0 8px; }
.eroe h1 { font-size: clamp(4.2rem, 19vw, 8.6rem); line-height: 1; padding: .24em .1em .1em; margin: -.2em 0 -.04em; background: linear-gradient(100deg, #c8932c 10%, #fff4cf 32%, #f2cf7a 48%, #fff9e6 62%, #c8932c 88%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(242, 190, 90, .4)); animation: brilla 7s linear infinite; }
.eroe h2 { font-size: clamp(1.5rem, 5.5vw, 2.4rem); text-shadow: 0 3px 16px #000a; }
.eroe .sotto { font-size: 1.1rem; max-width: 28em; text-shadow: 0 2px 10px #000; }
.saluto { gap: 2px; padding: 12px 0 0; }
.saluto h1 { font-size: clamp(2.7rem, 11vw, 4.6rem); text-shadow: 0 0 26px rgba(242, 190, 90, .45); padding: 0 .15em; }

.carta { display: flex; flex-direction: column; gap: 15px; padding: clamp(18px, 4.5vw, 30px); border-radius: var(--raggio); background: var(--vetro); border: 1px solid var(--bordo); box-shadow: 0 22px 50px rgba(0, 0, 8, .42), inset 0 1px 0 rgba(255, 255, 255, .09); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.carta.stretta { width: 100%; max-width: 500px; margin: 0 auto; }
.centro { align-items: center; text-align: center; }
.festa { border-color: rgba(242, 207, 122, .5); box-shadow: 0 0 50px rgba(242, 190, 90, .16), 0 22px 50px rgba(0, 0, 8, .42); }
.allarme { border-color: var(--rosso); }
details.carta { display: block; }
details.carta > * + * { margin-top: 15px; }
summary { cursor: pointer; font: 600 1.1rem "Fraunces", serif; }
summary::marker { color: var(--oro); }

/* ---------- moduli ---------- */
form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .88rem; color: #d6e0ff; text-align: left; min-width: 0; }
input, textarea, select { width: 100%; min-width: 0; font: 500 1rem "Nunito", sans-serif; color: #fff; background: rgba(4, 8, 28, .66); border: 1px solid rgba(180, 200, 255, .24); border-radius: 13px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #7886b5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(242, 207, 122, .22); }
:focus-visible { outline: 2px solid var(--oro); outline-offset: 2px; }
.due { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.riga { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.riga.centrata { justify-content: center; }
.riga.fine { justify-content: flex-end; }
.spazio { flex: 1; }
.spunta { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.spunta input { width: 21px; height: 21px; accent-color: var(--oro-scuro); flex: none; }

.bottone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 99px; padding: 11px 22px; font: 800 .97rem "Nunito", sans-serif; cursor: pointer; text-decoration: none; transition: transform .18s, box-shadow .25s, filter .2s, background .2s; }
.bottone:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.bottone:active:not(:disabled) { transform: translateY(0) scale(.97); }
.bottone:disabled { opacity: .45; cursor: default; }
.oro { position: relative; overflow: hidden; background: linear-gradient(#ffedb8, var(--oro) 45%, #d99f3c); color: #38240a; box-shadow: 0 6px 22px rgba(232, 178, 74, .34), inset 0 1px 0 #fff9; }
.oro:not(:disabled)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -70%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent); transform: skewX(-18deg); animation: riflesso 4.5s ease-in-out infinite; }
.vuoto { background: rgba(255, 255, 255, .06); color: var(--neve); border-color: rgba(190, 210, 255, .32); }
.pericolo { background: var(--rosso); color: #fff; align-self: flex-start; }
.bottone.grande { font-size: 1.12rem; padding: 15px 32px; }
.piccolo { padding: 6px 14px; font-size: .82rem; }
.tondo { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--bordo); background: rgba(10, 16, 44, .7); color: var(--neve); cursor: pointer; font-size: 1rem; transition: background .2s, transform .2s; }
.tondo:hover { background: rgba(60, 80, 150, .75); transform: scale(1.07); }
#musica[aria-pressed="true"] { color: var(--oro); border-color: var(--oro); box-shadow: 0 0 18px rgba(242, 207, 122, .5); }

.linguette { display: flex; gap: 4px; padding: 5px; border-radius: 99px; background: rgba(4, 8, 28, .6); }
.linguette button { flex: 1; min-width: 0; padding: 10px 8px; border: 0; border-radius: 99px; background: none; color: var(--fioco); font: 800 .9rem "Nunito", sans-serif; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linguette button[aria-selected="true"] { background: linear-gradient(#e0345a, #a91537); color: #fff; box-shadow: 0 4px 14px rgba(209, 31, 69, .4); }
.linguette button:disabled { opacity: .4; cursor: default; }

.avatar { width: 46px; height: 46px; flex: none; display: block; }
.avatar.grande { width: 118px; height: 118px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .45)); }
.scelta { border: 0; }
.scelta legend { font-weight: 700; font-size: .88rem; color: #d6e0ff; margin-bottom: 8px; }
.scelta > div { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.scelta label { position: relative; cursor: pointer; align-items: center; }
.scelta input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scelta span { display: block; width: 100%; max-width: 60px; padding: 3px; border-radius: 50%; border: 2px solid transparent; transition: transform .2s, border-color .2s; }
.scelta span .avatar { width: 100%; height: auto; }
.scelta label:hover span { transform: translateY(-3px) rotate(-5deg); }
.scelta input:checked + span { border-color: var(--oro); transform: scale(1.12); box-shadow: 0 0 18px rgba(242, 207, 122, .6); }
.scelta input:focus-visible + span { outline: 2px solid #fff; }

/* ---------- ingresso ---------- */
.conto { display: flex; justify-content: center; gap: clamp(7px, 2.4vw, 14px); }
.conto div { display: flex; flex-direction: column; align-items: center; width: clamp(66px, 19vw, 92px); padding: 11px 0 8px; border-radius: 16px; background: linear-gradient(rgba(255, 255, 255, .13), rgba(255, 255, 255, .04)); border: 1px solid var(--bordo); border-top: 4px solid #fff; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); }
.conto b { font: 650 clamp(1.7rem, 7vw, 2.5rem)/1 "Fraunces", serif; font-variant-numeric: tabular-nums; }
.conto span { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fioco); font-weight: 800; }
.oggi { font: 600 1.5rem "Fraunces", serif; color: var(--oro); }
.pillole { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; }
.pillole li { display: flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 99px; background: rgba(12, 18, 48, .72); border: 1px solid var(--bordo); font-weight: 700; font-size: .9rem; text-align: left; }
.pillole .icona { color: var(--oro); }
.folla { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
.folla figure { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; font-size: .76rem; font-weight: 800; animation: galleggia 4s ease-in-out infinite; }
.folla figure:nth-child(2n) { animation-delay: -1.4s; }
.folla figure:nth-child(3n) { animation-delay: -2.7s; }
.folla figcaption { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 6px #000; }
.passi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 14px; }
.passi .carta { align-items: center; text-align: center; gap: 8px; }
.passi b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(#e0345a, #971030); border: 2px solid var(--oro); font: 650 1.25rem "Fraunces", serif; }

/* ---------- regalo ---------- */
.pacco { display: block; width: 100%; height: auto; overflow: visible; }
.dondola { width: min(210px, 55vw); animation: dondola 3.4s ease-in-out infinite; transform-origin: 50% 95%; }
.pacco-grande { width: min(300px, 74vw); background: none; border: 0; cursor: pointer; animation: dondola 2.4s ease-in-out infinite; transform-origin: 50% 95%; filter: drop-shadow(0 0 34px rgba(242, 190, 90, .45)); transition: filter .3s; }
.pacco-grande:hover { filter: drop-shadow(0 0 54px rgba(242, 190, 90, .8)); }
.destinatario { position: relative; align-items: center; text-align: center; padding-top: 62px; }
.destinatario h2.firma { font-size: clamp(3.2rem, 14vw, 5.4rem); }
.copri { position: absolute; top: 14px; right: 14px; width: auto; display: flex; align-items: center; gap: 7px; padding: 0 15px; border-radius: 99px; font: 800 .82rem "Nunito", sans-serif; }
.segreto { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; transition: filter .35s; }
.coperto .segreto { filter: blur(16px); pointer-events: none; user-select: none; }
dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; width: 100%; text-align: left; }
dl div { padding: 12px 15px; border-radius: 15px; background: rgba(4, 8, 28, .45); }
dt { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--oro); }
dd { white-space: pre-line; }
.desideri { display: flex; flex-direction: column; gap: 10px; width: 100%; list-style: none; text-align: left; }
.desideri li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 15px; background: rgba(255, 255, 255, .06); border: 1px solid var(--bordo); }
.desideri li > div { min-width: 0; }
.desideri li.tanto { border-color: rgba(242, 207, 122, .6); background: rgba(242, 207, 122, .09); }
.etichetta { display: inline-flex; align-items: center; gap: 4px; margin-left: 9px; font-size: .72rem; font-weight: 800; color: #ff9db0; white-space: nowrap; }
.desideri p { font-size: .9rem; color: var(--fioco); }
.percorso { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; }
.percorso li { position: relative; }
.percorso li + li::before { content: ""; position: absolute; top: 20px; right: 50%; width: 100%; height: 4px; background: rgba(190, 210, 255, .18); }
.percorso li.fatto + li.fatto::before { background: var(--oro); }
.percorso button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; border: 0; background: none; color: var(--fioco); font: 800 .76rem/1.2 "Nunito", sans-serif; cursor: pointer; }
.percorso b { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #172154; border: 2px solid rgba(190, 210, 255, .28); font-size: 1rem; transition: transform .25s, background .25s; }
.percorso button:hover b { transform: scale(1.12); }
.percorso .fatto button { color: var(--neve); }
.percorso .fatto b { background: linear-gradient(#ffedb8, #d99f3c); color: #38240a; border-color: #fff3cd; }
.percorso [aria-current="step"] b { box-shadow: 0 0 0 6px rgba(242, 207, 122, .22); }
.barra { height: 10px; border-radius: 9px; background: rgba(4, 8, 28, .6); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 9px; background: repeating-linear-gradient(-45deg, #d11f45 0 9px, #fff 9px 18px); transition: width .8s; }
.coppie { list-style: none; width: 100%; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.coppie li { text-align: left; padding: 10px 12px; border-radius: 15px; background: rgba(4, 8, 28, .45); }
.coppie summary { display: flex; align-items: center; gap: 10px; font: 700 .95rem "Nunito", sans-serif; list-style: none; }
.coppie summary span { margin-left: auto; font-size: .72rem; color: var(--oro); }
.coppie details[open] summary span { visibility: hidden; }
.coppie p { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; padding-left: 20px; }
.coppie p::before { content: "ha regalato a"; flex-basis: 100%; font-size: .75rem; color: var(--fioco); }
.coppie em { flex-basis: 100%; font-size: .78rem; color: var(--verde); }

/* ---------- lista e posta ---------- */
.editor { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.editor li { display: flex; flex-direction: column; gap: 11px; padding: 15px; border-radius: 17px; background: rgba(4, 8, 28, .4); border: 1px solid var(--bordo); }
.posta .nota { text-align: center; }
.fili { list-style: none; display: flex; flex-direction: column; gap: 9px; height: min(46vh, 440px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; border-radius: 17px; background: rgba(3, 6, 22, .55); }
.fili li { align-self: flex-start; max-width: 82%; }
.fili li:first-child { margin-top: auto; }
.fili p { white-space: pre-line; padding: 10px 15px; border-radius: 19px 19px 19px 5px; background: #26356f; }
.fili .mio { align-self: flex-end; text-align: right; }
.fili .mio p { text-align: left; background: linear-gradient(#d92a50, #a31434); border-radius: 19px 19px 5px 19px; }
.fili time { font-size: .68rem; color: #8695c4; padding: 0 8px; }
.fili .vuoto { align-self: center; margin: auto; color: var(--fioco); }
.rapide { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px; }
.rapide button { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px dashed rgba(242, 207, 122, .55); background: none; color: var(--oro); font: 700 .8rem "Nunito", sans-serif; cursor: pointer; }
.scrivi { flex-direction: row; }
.scrivi .bottone { padding: 11px 18px; flex: none; }

/* ---------- villaggio ---------- */
.albero { width: 100%; max-width: 440px; height: auto; overflow: visible; filter: drop-shadow(0 0 28px rgba(74, 222, 156, .2)); }
.albero text { font: 800 11px "Nunito", sans-serif; fill: #fff; paint-order: stroke; stroke: #07261f; stroke-width: 3.5px; stroke-linejoin: round; }
.palla { animation: pendi 3.6s ease-in-out infinite; }
.puntale { filter: drop-shadow(0 0 10px #ffd35a); animation: pulsa 2.4s ease-in-out infinite; }
.festone { animation: lampeggia 2.2s ease-in-out infinite; color: #ffd978; }
.indovina { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; width: 100%; }
.indovina button { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--bordo); background: rgba(4, 8, 28, .4); color: var(--neve); font: 800 .8rem "Nunito", sans-serif; cursor: pointer; transition: transform .2s, border-color .2s; }
.indovina span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.indovina button:hover { transform: translateY(-3px); }
.indovina button[aria-pressed="true"] { border-color: var(--oro); background: rgba(242, 207, 122, .16); box-shadow: 0 0 20px rgba(242, 207, 122, .35); }

/* ---------- regia ---------- */
.elenco, .vietate { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.elenco li, .vietate li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 15px; background: rgba(4, 8, 28, .42); }
.elenco li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.elenco small { color: var(--fioco); }
.vietate li span { flex: 1; font-weight: 700; }
.vietate:empty { display: none; }
form.riga { flex-direction: row; }
form.riga select { flex: 1; min-width: 130px; width: auto; }
.link { font-size: .85rem; color: var(--oro); }
.qr { align-self: center; width: min(260px, 100%); padding: 8px; border-radius: 18px; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }

/* ---------- finestre e avvisi ---------- */
dialog { margin: auto; width: min(430px, calc(100% - 32px)); padding: 26px; color: var(--neve); background: linear-gradient(160deg, #222f66, #0e1535); border: 1px solid rgba(242, 207, 122, .45); border-radius: var(--raggio); box-shadow: 0 30px 80px #000b; }
dialog[open] { animation: sbuca .35s cubic-bezier(.2, 1.4, .4, 1); }
dialog::backdrop { background: rgba(3, 5, 18, .72); backdrop-filter: blur(4px); }
#avvisi { position: fixed; z-index: 60; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.avviso { padding: 12px 22px; border-radius: 99px; background: #f4f7ff; color: #101a46; font-weight: 800; text-align: center; box-shadow: 0 14px 36px #0008; animation: sbuca .4s cubic-bezier(.2, 1.5, .4, 1); transition: opacity .4s, transform .4s; }
.avviso.male { background: var(--rosso); color: #fff; }
.avviso.via { opacity: 0; transform: translateY(12px); }

/* ---------- scene a tutto schermo ---------- */
.palco { position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 18px; padding: 70px 18px 30px; overflow: hidden auto; text-align: center; background: radial-gradient(circle at 50% 46%, rgba(52, 40, 110, .94), rgba(4, 6, 22, .97) 68%); animation: appare .45s; }
.palco.via { opacity: 0; transition: opacity .4s; }
.palco .chiudi { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; padding: 9px 18px; border-radius: 99px; border: 1px solid var(--bordo); background: #0008; color: #fff; font: 800 .85rem "Nunito", sans-serif; cursor: pointer; }
.palco-sopra { font: italic 500 clamp(1.3rem, 5vw, 2rem) "Fraunces", serif; }
.palco-sotto { min-height: 2em; color: var(--fioco); font-weight: 800; font-size: 1.05rem; }
.palco-sotto .bottone { margin-top: 14px; }
.coriandoli { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.raggi { position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; margin: -85vmax; border-radius: 50%; z-index: -1; opacity: 0; transition: opacity 1.2s;
  background: repeating-conic-gradient(rgba(255, 214, 120, .2) 0 7deg, transparent 7deg 18deg); -webkit-mask: radial-gradient(closest-side, #000 5%, transparent 72%); mask: radial-gradient(closest-side, #000 5%, transparent 72%); animation: ruota 40s linear infinite; }
.apertura { isolation: isolate; }
.aperto .raggi { opacity: 1; }
.bagliore { opacity: 0; transition: opacity .8s .2s; }
.aperto .bagliore { opacity: 1; }
.tocca { width: min(320px, 76vw, 46vh); background: none; border: 0; cursor: pointer; filter: drop-shadow(0 0 40px rgba(242, 190, 90, .5)); transition: width .7s, transform .7s; }
.tocca.scuoti-1 { animation: scuoti .6s; }
.tocca.scuoti-2 { animation: scuoti .5s 2; }
.tocca.trema { animation: trema .12s linear infinite; }
.tocca .coperchio { transition: transform 1s cubic-bezier(.2, .8, .3, 1), opacity 1s .2s; transform-origin: 120px 90px; }
.aperto .tocca { animation: none; width: min(190px, 40vw, 24vh); cursor: default; }
.aperto .tocca .coperchio { transform: translate(90px, -230px) rotate(48deg); opacity: 0; }
.esito { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.esito > * { animation: sali .8s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.esito h2 { font-size: clamp(3.6rem, 17vw, 7rem); animation-delay: .25s; text-shadow: 0 0 30px rgba(242, 190, 90, .8); }
.esito p { animation-delay: .5s; }
.esito button { animation-delay: .7s; }
.rivelato .tocca { margin-top: -20px; }

.vortice { position: relative; width: min(92vw, 62vh, 520px); aspect-ratio: 1; flex: none; }
.vortice > span { position: absolute; left: 50%; top: 50%; width: 70px; margin: -35px; display: flex; flex-direction: column; align-items: center; font-size: .75rem; --a: calc(var(--i) * 360deg / var(--n)); animation: orbita 3.6s cubic-bezier(.55, .05, .35, 1) forwards; }
.vortice small { font-weight: 800; white-space: nowrap; }
.sacco { position: absolute; width: 34%; left: 33%; top: 32%; animation: trema .16s linear infinite; }
.fatto .sacco { animation: dondola 2s ease-in-out infinite; }

.coppia { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 340px; justify-content: center; }
.coppia figure { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: sbuca .6s cubic-bezier(.2, 1.5, .4, 1); }
.coppia figcaption { display: flex; flex-direction: column; }
.coppia small { text-transform: uppercase; letter-spacing: .16em; font-size: .68rem; font-weight: 800; color: var(--fioco); }
.coppia strong { font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: 1.2; padding: 0 .2em; }
.mistero { display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; border: 3px dashed var(--oro); font: 600 3.6rem "Fraunces", serif; color: var(--oro); animation: pulsa 1.3s ease-in-out infinite; }
.suspense .mistero { animation: trema .1s linear infinite; }
.filo { width: 4px; height: 34px; border-radius: 4px; background: repeating-linear-gradient(var(--rosso) 0 6px, #fff 6px 12px); }
.bravi { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.bravi div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.enorme { font-size: 5rem; }

/* ---------- animazioni ---------- */
@keyframes sali { from { opacity: 0; transform: translateY(26px) scale(.97); } }
@keyframes appare { from { opacity: 0; } }
@keyframes sbuca { from { opacity: 0; transform: scale(.6); } }
@keyframes brilla { to { background-position: -220% 0; } }
@keyframes pulsa { 50% { opacity: .62; } }
@keyframes fiamma { 0%, 100% { opacity: 1; } 42% { opacity: .82; } 46% { opacity: 1; } 71% { opacity: .9; } }
@keyframes fumo { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 20% { opacity: .35; } 100% { opacity: 0; transform: translate(26px, -66px) scale(2.2); } }
@keyframes lampeggia { 0%, 100% { opacity: 1; filter: drop-shadow(0 0 7px currentColor); } 50% { opacity: .45; filter: none; } }
@keyframes riflesso { 0%, 62% { left: -70%; } 88%, 100% { left: 140%; } }
@keyframes galleggia { 50% { transform: translateY(-7px); } }
@keyframes dondola { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg) translateY(-6px); } }
@keyframes pendi { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
@keyframes scuoti { 20% { transform: rotate(-11deg) scale(1.04); } 40% { transform: rotate(9deg) translateY(-14px); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@keyframes trema { 25% { transform: translate(-3px, 1px) rotate(-1.5deg); } 75% { transform: translate(3px, -1px) rotate(1.5deg); } }
@keyframes ruota { to { transform: rotate(360deg); } }
@keyframes orbita {
  0% { transform: rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))) scale(.2); opacity: 0; }
  15% { opacity: 1; }
  35% { transform: rotate(calc(var(--a) + 140deg)) translateY(calc(min(92vw, 62vh, 520px) * -.42)) rotate(calc(-1 * var(--a) - 140deg)) scale(1); }
  75% { transform: rotate(calc(var(--a) + 720deg)) translateY(calc(min(92vw, 62vh, 520px) * -.38)) rotate(calc(-1 * var(--a) - 720deg)) scale(1); opacity: 1; }
  100% { transform: rotate(calc(var(--a) + 1000deg)) translateY(0) rotate(calc(-1 * var(--a) - 1000deg)) scale(.1); opacity: 0; }
}

/* ---------- telefono ---------- */
@media (max-width: 640px) {
  #nav { position: fixed; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; right: 8px; width: auto; max-width: none; margin: 0; justify-content: space-around; border-radius: 24px; z-index: 22; }
  #nav a { flex: 1; flex-direction: column; gap: 2px; padding: 7px 2px; font-size: .66rem; border-radius: 17px; }
  #nav a .icona { width: 22px; height: 22px; }
  #nav .bollo { right: 12%; }
  #nav:not([hidden]) ~ #avvisi { bottom: 92px; }
  .luna { top: 105px; right: 5vw; opacity: .8; }
  .scelta > div { grid-template-columns: repeat(4, 1fr); }
  .desideri li { flex-direction: column; align-items: stretch; }
  .percorso span { font-size: .68rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .vortice > span { display: none; }
  .fumo, #slitta { display: none; }
}
