:root {
  --ink: #2f3d66;
  --ink-soft: #6a789f;
  --blu: #6f8cc8;
  --blu-scuro: #5671b0;
  --blu-chiaro: #a9bce3;
  --vetro: rgba(255, 255, 255, .55);
  --bordo: #a9bbe0;
  --rosa: #f3bfd0;
  --paper: #fdfdff;
  --ombra: 0 10px 30px rgba(86, 113, 176, .14), 0 2px 6px rgba(86, 113, 176, .08);
  --hand: "Caveat", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Nunito", -apple-system, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; min-height: 100dvh;
  font-family: var(--sans); color: var(--ink);
  background: linear-gradient(165deg, #eef2fb 0%, #e6ecf8 45%, #dbe4f5 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}
body.bloccato { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; display: block; }

/* ───────── tratti disegnati a mano ───────── */
.traccia {
  fill: none; stroke: var(--blu); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: disegna 2.6s cubic-bezier(.45,.1,.3,1) forwards; animation-delay: var(--dd, .2s);
}
@keyframes disegna { to { stroke-dashoffset: 0; } }
.petalo-ib { fill: rgba(243, 191, 208, .0); animation: disegna 2.6s cubic-bezier(.45,.1,.3,1) forwards var(--dd,.2s), riempiRosa 1.4s ease forwards calc(var(--dd,.2s) + 1.6s); }
.petalo-gi { fill: rgba(255, 255, 255, 0); animation: disegna 2.6s cubic-bezier(.45,.1,.3,1) forwards var(--dd,.2s), riempiBianco 1.4s ease forwards calc(var(--dd,.2s) + 1.6s); }
@keyframes riempiRosa { to { fill: rgba(243, 191, 208, .38); } }
@keyframes riempiBianco { to { fill: rgba(255, 255, 255, .7); } }
.vena { stroke-width: 1; opacity: .55; }
.punto { fill: var(--blu); opacity: 0; animation: appariPunto .6s ease forwards calc(var(--dd,.2s) + 2s); }
@keyframes appariPunto { to { opacity: .85; } }
.linea-fiore, .linea-foglia, .doodle-cuore, .stellina { display: block; width: 100%; height: auto; overflow: visible; }
.stellina path { fill: #8ea5d6; }

/* ───────── sfondo animato ───────── */
#cielo { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.fluttua { position: absolute; opacity: .55; animation: fluttua var(--d) ease-in-out var(--del) infinite alternate; }
.fluttua .traccia { stroke-width: 2.2; animation-duration: 3s; }
@keyframes fluttua { from { transform: translateY(-10px) rotate(calc(var(--rot) - 6deg)); } to { transform: translateY(12px) rotate(calc(var(--rot) + 6deg)); } }
.brilla { position: absolute; animation: brilla var(--d) ease-in-out var(--del) infinite; }
@keyframes brilla { 0%,100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: .9; transform: scale(1) rotate(45deg); } }
.deriva { position: absolute; top: 105%; opacity: .5; animation: deriva var(--d) linear var(--del) infinite; }
.deriva .traccia { animation: none; stroke-dashoffset: 0; }
.deriva .petalo-ib { fill: rgba(243,191,208,.35); animation: none; }
.deriva .petalo-gi { fill: rgba(255,255,255,.6); animation: none; }
.deriva .punto { animation: none; opacity: .8; }
@keyframes deriva { from { transform: translate(0, 0) rotate(0); } to { transform: translate(40px, -125vh) rotate(260deg); } }

main {
  position: relative; z-index: 1; max-width: 760px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 20px 0;
}
section, .azioni, footer { position: relative; z-index: 2; }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes suGiu { from { opacity: 0; transform: translateY(6px); } }
@keyframes batti { 0%,100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.14); } }

/* ───────── hero ───────── */
.hero { position: relative; text-align: center; padding-top: 52px; }
/* i fiori stanno negli angoli dello schermo, non della colonna */
.angoli { position: absolute; top: calc(6px + var(--safe-t)); left: 0; right: 0; height: 0; z-index: 1; pointer-events: none; }
.angolo { position: absolute; top: 0; width: clamp(100px, 15vw, 240px); aspect-ratio: 1; }
.angolo.sx { left: 0; } .angolo.dx { right: 0; }
.fa { position: absolute; animation: ondeggia 6s ease-in-out infinite alternate; }
.fa.a1 { left: 4%; top: 2%; width: 70%; --dd: .1s; }
.fa.a2 { left: 66%; top: 30%; width: 32%; --dd: .9s; animation-delay: -2s; }
.fa.a3 { left: 16%; top: 70%; width: 30%; --dd: 1.3s; animation-delay: -4s; }
.fa.b1 { right: 4%; top: 2%; width: 68%; --dd: .4s; animation-delay: -1s; }
.fa.b2 { right: 64%; top: 34%; width: 30%; --dd: 1.1s; animation-delay: -3s; }
.fa.b3 { right: 14%; top: 72%; width: 28%; --dd: 1.5s; animation-delay: -5s; }
.fa .traccia, .fa .punto { animation-delay: var(--dd); }
.fa .petalo-ib, .fa .petalo-gi { animation-delay: var(--dd), calc(var(--dd) + 1.6s); }
.fa .punto { animation-delay: calc(var(--dd) + 2s); }
@keyframes ondeggia { from { transform: rotate(-4deg); } to { transform: rotate(5deg) translateY(3px); } }

.giorni {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  padding: 8px 18px; border-radius: 999px;
  background: var(--vetro); border: 1.5px solid var(--bordo);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 14px; color: var(--ink-soft);
  animation: entra .8s ease-out .3s both;
}
.giorni[hidden] { display: none; }
.giorni b { color: var(--blu-scuro); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.giorni .pulsa { color: var(--blu); display: inline-block; animation: batti 1.4s ease-in-out infinite; }

h1 {
  font-family: var(--serif); font-weight: 600; font-style: italic;
  font-size: clamp(32px, 9vw, 50px); line-height: 1.04;
  margin: 0 0 10px; color: var(--ink); letter-spacing: -.01em;
}
h1 .parola { display: inline-block; animation: parola .9s cubic-bezier(.2,1.3,.4,1) both; animation-delay: calc(.4s + var(--i) * .09s); }
@keyframes parola { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
h1 .lui { background: linear-gradient(90deg, var(--blu-scuro), #9bb1e0, #d48fab, var(--blu-scuro)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: scorri 7s linear infinite; padding-right: .06em; }
h1 .parola.lui { animation: parola .9s cubic-bezier(.2,1.3,.4,1) both calc(.4s + var(--i) * .09s), scorri 7s linear infinite; }
@keyframes scorri { to { background-position: 300% 0; } }
.sub { margin: 0 auto; max-width: 28em; color: var(--ink-soft); font-size: 16px; line-height: 1.5; animation: entra .8s ease-out 1s both; }

/* ───────── barattolo ───────── */
.sez-vaso { margin-top: 12px; text-align: center; animation: entra 1s ease-out 1.1s both; }
.vaso-wrap { position: relative; width: clamp(140px, min(62vw, calc((100svh - 500px) / 1.2)), 250px); margin: 0 auto; }
.vaso { width: 100%; height: auto; overflow: visible; animation: galleggia 5s ease-in-out infinite; filter: drop-shadow(0 18px 22px rgba(86,113,176,.22)); }
.vaso.scuoti { animation: scuoti .6s ease-in-out; }
@keyframes galleggia { 0%,100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-8px) rotate(1.2deg); } }
@keyframes scuoti { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.vaso .nota { transition: opacity .35s; }
.vaso .nota.via { opacity: 0; }
.vaso-decori { position: absolute; inset: 0; pointer-events: none; }
.vd { position: absolute; }
.vd.c1 { right: -52px; top: 8%; width: 62px; animation: fluttua 6s ease-in-out infinite alternate; --rot: 12deg; --dd: 1.2s; }
.vd.c2 { right: -66px; top: 34%; width: 36px; animation: fluttua 5s ease-in-out -2s infinite alternate; --rot: -8deg; --dd: 1.8s; }
.vd.c1 .traccia, .vd.c2 .traccia { stroke-width: 2.4; animation-delay: var(--dd); }
.vd.s1 { left: -40px; top: 20%; width: 22px; animation: brilla 3.6s ease-in-out infinite; }
.vd.s2 { left: -18px; bottom: 14%; width: 15px; animation: brilla 4.4s ease-in-out -1.5s infinite; }
.restano { margin: 12px 0 0; color: var(--ink-soft); font-size: 15px; }
.restano b { color: var(--blu-scuro); font-size: 19px; font-weight: 800; display: inline-block; }
.restano b.cambia { animation: batti .8s ease-in-out; }

/* barattolo cliccabile + etichetta con i ricordi scoperti */
.vaso { cursor: pointer; outline: none; -webkit-user-select: none; user-select: none; }
.etichetta {
  position: absolute; z-index: 3; left: 50%; top: 66%; transform: translate(-50%, -50%) rotate(-3deg);
  padding: 5px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  background: rgba(255,255,255,.9); border: 1.5px solid var(--bordo); box-shadow: var(--ombra);
  font-family: var(--hand); font-size: 22px; color: var(--blu-scuro); line-height: 1;
}
.etichetta[hidden] { display: none; }
.etichetta b { font-family: var(--sans); font-size: 16px; }
.etichetta.pop { animation: etichettaPop .7s cubic-bezier(.2,1.6,.4,1); }
@keyframes etichettaPop { 0% { transform: translate(-50%, -50%) rotate(-3deg) scale(1); } 40% { transform: translate(-50%, -50%) rotate(4deg) scale(1.35); } 100% { transform: translate(-50%, -50%) rotate(-3deg) scale(1); } }
.restano .tocca { display: block; margin-top: 2px; font-size: 13px; color: var(--blu); font-weight: 700; animation: respira 2.4s ease-in-out infinite; }
@keyframes respira { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
@media (max-width: 899px) { .con-ricordi .vaso-wrap { width: clamp(125px, min(62vw, calc((100svh - 518px) / 1.2)), 250px); } }
.lista-ricordi .griglia { margin-top: 18px; padding-top: 6px; }
.torna-lista { border: 0; background: rgba(201,214,239,.75); color: var(--ink); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; margin: -6px 0 12px; }

/* ───────── barra di ricerca ───────── */
.cerca { margin: 20px 0 0; animation: entra .8s ease-out .8s both; }
.barra-ricerca {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 4px 0 16px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.62); border: 1.5px solid var(--bordo);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--ombra);
  transition: box-shadow .3s, border-color .3s, transform .3s;
}
.barra-ricerca:focus-within { border-color: var(--blu); box-shadow: var(--ombra), 0 0 0 5px rgba(111,140,200,.16); }
.barra-ricerca.no { animation: no .45s; }
@keyframes no { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.barra-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.barra-fx i { position: absolute; bottom: -16px; font-style: normal; color: var(--blu); opacity: 0; font-size: var(--s); animation: saleBarra var(--d) linear var(--del) infinite; }
@keyframes saleBarra { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 20% { opacity: .22; } 80% { opacity: .18; } 100% { transform: translate(var(--x), -86px) rotate(40deg); opacity: 0; } }
.lente { position: relative; width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.barra-ricerca input {
  position: relative; flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; /* ≥16px: niente zoom automatico su iPhone */
  font-style: italic; color: var(--ink); padding: 8px 0;
}
.barra-ricerca input::placeholder { color: #8f9cc0; }
.divisore { position: relative; width: 1.5px; height: 22px; background: var(--bordo); flex: 0 0 auto; }
.btn-cuore {
  position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: transparent; display: grid; place-items: center;
}
.btn-cuore svg { width: 23px; height: 23px; fill: rgba(111,140,200,0); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; transition: fill .3s, transform .3s; animation: batti 2.2s ease-in-out infinite; }
.btn-cuore:active svg, .btn-cuore[disabled] svg { fill: var(--blu); stroke: var(--blu-scuro); transform: scale(1.15); }
.msg { min-height: 1.4em; margin: 8px 4px 0; text-align: center; font-size: 15px; color: var(--ink-soft); line-height: 1.45; }
.msg.mostra { animation: suGiu .4s ease-out; }

/* ───────── bottoni ───────── */
.btn, .btn-sec {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 52px; padding: 12px 28px; border-radius: 999px;
  font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap;
  transition: transform .15s, box-shadow .2s;
}
.btn {
  border: 0; color: #fff;
  background: linear-gradient(180deg, #7f9bd4, #6884c2);
  box-shadow: 0 10px 24px rgba(86,113,176,.32), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-sec { color: var(--ink); background: rgba(255,255,255,.4); border: 1.5px solid var(--ink); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.btn:active, .btn-sec:active { transform: scale(.96); }
.btn[disabled] { opacity: .75; }
.btn .freccia, .btn-sec .freccia { font-size: 20px; line-height: 1; transition: transform .3s; }
.btn .freccia { padding-left: 14px; border-left: 1.5px solid rgba(255,255,255,.6); }
@media (hover: hover) { .btn:hover .freccia, .btn-sec:hover .freccia { transform: translateX(4px); } }
.btn-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit; }
.btn-fx i { position: absolute; bottom: -18px; font-style: normal; font-size: var(--s); line-height: 1; opacity: 0; animation: saleBtn var(--d) ease-in var(--del) infinite; }
.btn .btn-fx i { color: #fff; }
.btn-sec .btn-fx i { color: var(--blu); }
@keyframes saleBtn { 0% { transform: translate(0, 0) scale(.6) rotate(0); opacity: 0; } 25% { opacity: .5; } 100% { transform: translate(var(--x), -64px) scale(1.1) rotate(35deg); opacity: 0; } }
.btn-sec .btn-fx i { animation-name: saleBtnSec; }
@keyframes saleBtnSec { 0% { transform: translate(0, 0) scale(.6) rotate(0); opacity: 0; } 25% { opacity: .35; } 100% { transform: translate(var(--x), -64px) scale(1.1) rotate(90deg); opacity: 0; } }
.btn-tondo {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(201,214,239,.75); border: 0; color: var(--ink); font-size: 22px; text-decoration: none;
  transition: transform .15s;
}
.btn-tondo:active { transform: scale(.92); }

.azioni { text-align: center; margin-top: 36px; }

/* ───────── ricordi scoperti ───────── */
section h2 { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 32px; color: var(--ink); margin: 0 0 2px; text-align: center; }
section .h2sub { text-align: center; margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }
.scoperti { margin-top: 40px; }
.scoperti[hidden] { display: none; }
.scoperti.compare { animation: entra .8s ease-out both; }
.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 14px; }
@media (min-width: 560px) { .griglia { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.biglietto {
  position: relative; border: 1.5px solid var(--bordo); padding: 18px 8px 14px; min-height: 92px;
  border-radius: 14px; background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: var(--ombra);
  font-family: var(--hand); font-size: 22px; line-height: 1.05; color: var(--blu-scuro);
  transform: rotate(var(--r, 0deg)); transition: transform .25s;
  display: flex; align-items: center; justify-content: center; text-align: center;
  animation: appare .6s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.biglietto::before { content: ""; position: absolute; top: -8px; left: 50%; width: 44px; height: 14px; transform: translateX(-50%) rotate(-3deg); background: rgba(201,214,239,.85); border-radius: 2px; }
.biglietto:nth-child(3n)::before { background: rgba(243,191,208,.8); }
.biglietto:active { transform: rotate(0) scale(.96); }
@media (hover: hover) { .biglietto:hover { transform: rotate(0) translateY(-4px); } }
.biglietto .badge { position: absolute; right: -8px; top: -10px; font-size: 18px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.12)); }
.biglietto .badge.attesa { animation: batti 1.6s infinite; }
.biglietto.in-arrivo { visibility: hidden; animation: none; }
.biglietto.atterra { animation: atterra .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes appare { from { opacity: 0; transform: translateY(14px) rotate(var(--r)) scale(.9); } }
@keyframes atterra { 0% { transform: scale(1.15) rotate(var(--r)); } 100% { transform: scale(1) rotate(var(--r)); } }

/* bigliettino in volo */
.vola-fuori {
  position: fixed; z-index: 60; left: 0; top: 0; pointer-events: none;
  display: grid; place-items: center; text-align: center; overflow: hidden;
  border-radius: 10px; background: #fff; border: 1.5px solid var(--bordo);
  box-shadow: 0 12px 30px rgba(86,113,176,.3);
  font-family: var(--hand); color: var(--blu-scuro); line-height: 1; padding: 4px;
}

/* ───────── onde in fondo ───────── */
footer { text-align: center; margin-top: 34px; padding-bottom: calc(clamp(80px, 9vw, 130px) + var(--safe-b)); }
footer p { margin: 0; color: var(--ink-soft); font-family: var(--hand); font-size: 25px; }
.rivedi-intro { margin-top: 10px; border: 0; background: none; color: var(--blu); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
/* onde fisse in fondo allo schermo, a tutta larghezza */
.onde { position: fixed; left: 0; right: 0; bottom: 0; z-index: 0; height: calc(clamp(70px, 8vw, 120px) + var(--safe-b)); overflow: hidden; pointer-events: none; }
.onde::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--safe-b); background: #b4c6ea; }
.onda { position: absolute; left: 0; bottom: var(--safe-b); width: 200%; height: 100%; animation: onda var(--d) linear infinite; }
.onda path { fill: currentColor; }
.onda.o1 { color: rgba(169,188,227,.35); height: 100%; --d: 18s; }
.onda.o2 { color: rgba(140,163,214,.3); height: 78%; --d: 13s; animation-direction: reverse; }
.onda.o3 { color: rgba(180,198,234,.85); height: 50%; --d: 22s; }
@keyframes onda { to { transform: translateX(-50%); } }
.filo { position: absolute; right: 0; bottom: 28%; width: min(70%, 620px); height: 70%; }
.filo .traccia { stroke-width: 1.8; animation-delay: .4s; }
.cuore-onda { position: absolute; right: 6%; bottom: 52%; width: clamp(36px, 4vw, 60px); animation: fluttua 4s ease-in-out infinite alternate; --rot: 10deg; }
.cuore-onda .traccia { stroke-width: 2.4; animation-delay: 1.8s; }

/* ───────── pagina "Aprilo quando" ───────── */
.topbar { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; }
.topbar-label { font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.hero-quando { padding-top: 46px; }

.quando { margin-top: 30px; }
.buste { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
@media (min-width: 560px) { .buste { grid-template-columns: repeat(3, 1fr); } }
.busta { border: 0; background: none; padding: 0; text-align: center; animation: appare .7s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(.5s + var(--i,0) * 90ms); --r: 0deg; }
.env { position: relative; width: 100%; aspect-ratio: 3 / 2; perspective: 600px; margin-bottom: 12px; animation: fluttuaBusta 4s ease-in-out infinite alternate; animation-delay: calc(var(--i,0) * -.7s); }
@keyframes fluttuaBusta { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-6px) rotate(1.5deg); } }
.busta:active .env { transform: scale(.96); }
.env > * { position: absolute; }
.env-retro { inset: 0; border-radius: 12px; background: #d3def3; border: 1.5px solid var(--bordo); box-shadow: var(--ombra); }
.env-lettera {
  left: 9%; right: 9%; top: 8%; bottom: 8%; border-radius: 6px; background: #fff;
  background-image: repeating-linear-gradient(180deg, transparent 0 9px, rgba(111,140,200,.2) 9px 10px);
  transition: transform .6s cubic-bezier(.3,1.3,.5,1) .25s; z-index: 2;
}
.env-fronte { inset: 0; border-radius: 0 0 12px 12px; background: #e6ecf8; clip-path: polygon(0 32%, 50% 66%, 100% 32%, 100% 100%, 0 100%); z-index: 3; }
.env-flap { left: 0; right: 0; top: 0; height: 66%; background: #dbe4f5; z-index: 4; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; transition: transform .5s ease-in, z-index 0s .25s; border-radius: 12px 12px 0 0; }
.env-sigillo {
  left: 50%; top: 66%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: linear-gradient(180deg, #8ea7da, #6582c0); z-index: 5; color: #fff; font-size: 15px;
  display: grid; place-items: center; box-shadow: 0 4px 10px rgba(86,113,176,.35);
  transition: transform .4s, opacity .4s; animation: batti 2.4s ease-in-out infinite;
}
.busta.apre .env-flap, .busta.aperta .env-flap { transform: rotateX(180deg); z-index: 1; }
.busta.apre .env-lettera { transform: translateY(-38%); }
.busta.apre .env-sigillo, .busta.aperta .env-sigillo { transform: scale(0) rotate(90deg); opacity: 0; animation: none; }
.busta-label { font-size: 13px; color: var(--ink-soft); line-height: 1.2; }
.busta-label em { display: block; font-family: var(--hand); font-style: normal; font-size: 25px; color: var(--blu-scuro); line-height: 1.05; margin-top: 2px; }

/* ───────── scheda (modale) ───────── */
.modale { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modale[hidden] { display: none; }
@media (min-width: 640px) { .modale { align-items: center; } }
.sfondo { position: absolute; inset: 0; background: rgba(47, 61, 102, .32); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); animation: fade .35s both; }
.modale.chiude .sfondo { animation: fade .3s reverse both; }
@keyframes fade { from { opacity: 0; } }
.carta {
  position: relative; width: 100%; max-width: 620px;
  max-height: calc(100dvh - 24px - var(--safe-t));
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: rgba(250,251,255,.96); border-radius: 30px 30px 0 0;
  padding: 30px 22px calc(30px + var(--safe-b));
  box-shadow: 0 -10px 40px rgba(47,61,102,.2);
  transform-origin: 50% 100%;
  animation: apri .75s cubic-bezier(.2,1.2,.35,1) both;
  background-image: radial-gradient(circle at 10% 6%, rgba(201,214,239,.55), transparent 40%), radial-gradient(circle at 95% 96%, rgba(243,191,208,.35), transparent 42%);
}
@media (min-width: 640px) { .carta { border-radius: 28px; max-height: 88vh; padding: 36px 34px; } }
.modale.chiude .carta { animation: chiudi .3s ease-in both; }
@keyframes apri { 0% { opacity: 0; transform: translateY(90px) scale(.9); } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes chiudi { to { opacity: 0; transform: translateY(60px) scale(.94); } }
.maniglia { display: block; width: 44px; height: 5px; border-radius: 9px; background: rgba(86,113,176,.22); margin: -14px auto 14px; }
@media (min-width: 640px) { .maniglia { display: none; } }
.x { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(201,214,239,.75); font-size: 22px; line-height: 1; color: var(--ink); display: grid; place-items: center; z-index: 2; }
.carta .in { opacity: 0; animation: entra .6s ease-out forwards; animation-delay: calc(.25s + var(--i, 0) * .12s); }
.carta h3 { font-family: var(--hand); font-size: 44px; font-weight: 700; line-height: 1; color: var(--blu-scuro); margin: 4px 46px 6px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.testo p { font-size: 17px; line-height: 1.65; margin: 0 0 14px; }
.testo p:first-child::first-letter { font-family: var(--serif); font-size: 3.1em; float: left; line-height: .8; margin: 6px 8px 0 0; color: var(--blu); font-style: italic; }
.firma { font-family: var(--hand); font-size: 26px; color: var(--blu-scuro); text-align: right; margin: 6px 0 0; }

.polaroid-fila { display: flex; gap: 14px; overflow-x: auto; padding: 10px 22px 18px; margin: 6px -22px 4px; scroll-snap-type: x mandatory; }
.polaroid-fila.una { justify-content: center; }
.polaroid { flex: 0 0 auto; width: min(240px, 72vw); background: #fff; padding: 9px 9px 30px; border: 0; border-radius: 4px; box-shadow: var(--ombra); transform: rotate(var(--r)); scroll-snap-align: center; transition: transform .3s; }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #e6ecf8; }
.polaroid:active { transform: rotate(0) scale(.97); }

.player { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; padding: 8px 16px 8px 8px; border-radius: 999px; background: rgba(255,255,255,.7); border: 1.5px solid var(--bordo); }
.play { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #7f9bd4, #6884c2); color: #fff; font-size: 16px; display: grid; place-items: center; }
.onde-audio { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; }
.onde-audio i { flex: 1; max-width: 4px; height: 30%; border-radius: 3px; background: var(--blu); opacity: .5; }
.player.suona .onde-audio i { animation: barra .9s ease-in-out infinite alternate; opacity: .9; }
@keyframes barra { from { transform: scaleY(.4); } to { transform: scaleY(2.6); } }
.pl-label { font-family: var(--hand); font-size: 21px; color: var(--blu-scuro); white-space: nowrap; }
.spotify { width: 100%; height: 152px; border: 0; border-radius: 14px; margin: 4px 0 18px; }

/* domanda */
.domanda { margin-top: 10px; padding: 20px 18px; border-radius: 24px; background: rgba(255,255,255,.75); border: 1.5px solid var(--bordo); }
.dom-tag { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blu-scuro); border: 1.5px solid var(--blu); padding: 5px 12px; border-radius: 99px; margin-bottom: 12px; }
.dom-tag span { display: inline-block; animation: batti 2.2s infinite; }
.dom-q { font-family: var(--serif); font-size: 24px; font-weight: 600; font-style: italic; color: var(--ink); margin: 0 0 14px; line-height: 1.2; }
.dom-form { display: flex; flex-direction: column; gap: 10px; }
.dom-form input { width: 100%; font: inherit; font-size: 17px; font-style: italic; padding: 14px 20px; border-radius: 999px; border: 1.5px solid var(--bordo); background: #fff; outline: 0; color: var(--ink); }
.dom-form input:focus { border-color: var(--blu); box-shadow: 0 0 0 4px rgba(111,140,200,.16); }
.dom-form .btn { width: 100%; }
.dom-hint { font-size: 13px; color: var(--ink-soft); margin: 10px 4px 0; text-align: center; }
.dom-err { font-size: 14px; color: #b0506b; margin: 8px 2px 0; text-align: center; }
.tent { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 10px 16px; background: #fff; border: 1px solid #dfe6f5; border-radius: 999px; margin-bottom: 8px; }
.tent span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.tent q { flex: 1; font-style: italic; overflow-wrap: anywhere; }
.attesa { display: flex; align-items: center; gap: 12px; padding: 12px 4px 2px; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
.busta-vola { font-size: 32px; display: inline-block; animation: vola 2.2s ease-in-out infinite; }
@keyframes vola { 0%,100% { transform: translate(0,0) rotate(-8deg); } 50% { transform: translate(6px,-8px) rotate(8deg); } }
.puntini::after { content: ""; animation: puntini 1.5s steps(4) infinite; }
@keyframes puntini { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.esito { margin-top: 6px; padding: 16px; border-radius: 20px; font-size: 16px; line-height: 1.5; text-align: center; }
.esito.ok { background: linear-gradient(135deg, #eef2fb, #fbeef3); color: var(--ink); font-weight: 700; border: 1.5px solid var(--bordo); animation: premio .9s cubic-bezier(.2,1.6,.4,1) both; }
.esito.ok .regalo { display: block; font-size: 44px; margin-bottom: 4px; animation: dondola 1.6s ease-in-out infinite; }
.esito.no { background: #f3f6fc; color: var(--ink-soft); }
.esito.nuovo.no { animation: no .45s; }
@keyframes premio { 0% { transform: scale(.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes dondola { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg) scale(1.1); } }

/* lettera */
.lettera h3 { font-size: 40px; }
.lettera .pre { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.lettera .testo { background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(111,140,200,.18) 27px 28px); padding-top: 2px; }
.lettera .testo p { line-height: 28px; font-family: var(--hand); font-size: 23px; }
.lettera .testo p:first-child::first-letter { font: inherit; float: none; margin: 0; color: inherit; }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(30,40,70,.86); display: grid; place-items: center; padding: calc(20px + var(--safe-t)) 14px calc(20px + var(--safe-b)); animation: fade .25s both; }
.lightbox img { max-height: 100%; border-radius: 6px; animation: apri .5s cubic-bezier(.2,1.2,.35,1) both; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); z-index: 70;
  transform: translateX(-50%); width: calc(100% - 32px); max-width: 420px;
  background: rgba(86,113,176,.95); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 22px; font-size: 15px; text-align: left; line-height: 1.35;
  box-shadow: 0 12px 30px rgba(47,61,102,.3); animation: toastSu .5s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes toastSu { from { transform: translate(-50%, 140%); } }

#coriandoli { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

/* prima schermata: titolo, ricerca, barattolo e la freccia verso "Aprilo quando…" */
.primo-schermo { min-height: calc(100svh - 14px - var(--safe-t)); display: flex; flex-direction: column; }
.freccia-quando {
  position: relative; z-index: 3; margin: auto auto 0; padding: 8px 0 calc(8px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none;
  color: var(--blu-scuro); font-family: var(--hand); font-size: 24px; line-height: 1;
  transition: opacity .5s, transform .5s;
}
.freccia-quando > * { animation: entra .8s ease-out 2.2s both; }
.freccia-quando span { padding: 5px 16px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1.5px solid var(--bordo); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.freccia-quando svg { width: 22px; height: 32px; overflow: visible; animation: entra .8s ease-out 2.2s both, rimbalza 1.6s ease-in-out 3s infinite; }
.freccia-quando .traccia { stroke-width: 2.4; animation-delay: 2.4s; }
.freccia-quando.nascosta { opacity: 0; transform: translateY(30px) scale(.9); pointer-events: none; }
@keyframes rimbalza { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
/* il bottone compare (al posto della freccia) quando è tutto visibile */
.azioni .btn-sec { opacity: 0; transform: translateY(-26px) scale(.8); transition: opacity .5s, transform .7s cubic-bezier(.2,1.5,.4,1); }
.azioni.visibile .btn-sec { opacity: 1; transform: none; }
.azioni.visibile .btn-sec:active { transform: scale(.96); }

/* ───────── schermi grandi (desktop / tablet) ───────── */
@media (min-width: 900px) {
  main { padding-top: calc(18px + var(--safe-t)); }
  .hero { padding-top: 14px; }
  .giorni { font-size: 14px; padding: 8px 20px; margin-bottom: 14px; }
  .giorni b { font-size: 18px; }
  h1 { font-size: clamp(48px, 7vh, 62px); margin-bottom: 8px; }
  .sub { font-size: 17px; }
  .sez-vaso { margin-top: 6px; }
  .vaso-wrap { width: clamp(160px, calc((100vh - 480px) / 1.2), 300px); }
  .vd.c1 { right: -86px; width: 86px; } .vd.c2 { right: -104px; width: 48px; }
  .vd.s1 { left: -70px; width: 28px; } .vd.s2 { left: -36px; width: 20px; }
  .restano { font-size: 17px; } .restano b { font-size: 22px; }
  .cerca { margin-top: 20px; }
  /* fiori interi, dentro lo schermo */
  /* freccia verso "Aprilo quando…" */
  .primo-schermo { min-height: calc(100vh - 18px - var(--safe-t)); }
  .barra-ricerca { max-width: 560px; margin: 0 auto; height: 54px; padding-left: 20px; }
  .barra-ricerca input { font-size: 17px; }
  .btn, .btn-sec { min-height: 58px; font-size: 18px; padding: 14px 34px; }
  .griglia { grid-template-columns: repeat(4, 1fr); gap: 22px 18px; }
  .biglietto { min-height: 110px; font-size: 25px; }
  section h2 { font-size: 40px; }
  .buste { grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
  .busta-label em { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .deriva, .btn-fx, .barra-fx { display: none; }
}

/* ───────── "ti manco": letterine che formano un abbraccio ───────── */
.abbraccio { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(20px + var(--safe-t)) 16px calc(20px + var(--safe-b)); text-align: center; }
.abbraccio .velo { position: absolute; inset: 0; background: rgba(47, 61, 102, .38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade .5s both; }
.abbraccio.esce .velo { animation: fade .6s .4s reverse both; }
.abbraccio > *:not(.velo) { position: relative; }
.abbraccio-x { position: absolute !important; top: calc(16px + var(--safe-t)); right: 16px; }
.abbraccio-pre { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.85); animation: entra .6s ease-out .2s both; }
.abbraccio-tit { margin: 2px 0 6px; font-family: var(--hand); font-size: 46px; color: #fff; line-height: 1; text-shadow: 0 2px 12px rgba(47,61,102,.35); animation: entra .6s ease-out .3s both; }
.abbraccio-campo { height: min(62vh, 540px, 150vw); aspect-ratio: 8 / 15; }
.abbraccio-sagoma { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.disegno-abbraccio { opacity: 0; transition: opacity 1.2s ease; }
.abbraccio.fuse .disegno-abbraccio { opacity: 1; }
.disegno-abbraccio .parte { stroke: #3d4a75; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.disegno-abbraccio .dett { fill: none; stroke: #3d4a75; stroke-width: 1.1; stroke-linecap: round; }
.disegno-abbraccio .pelle { fill: #f7dccb; }
.disegno-abbraccio .capelli { fill: #7a5a43; }
.disegno-abbraccio .abito { fill: #f3bfd0; }
.disegno-abbraccio .corpo { fill: #c9d6ef; }
.disegno-abbraccio .scuro { fill: #4f5a7c; }
.cuore-abbraccio { fill: #f58fae; stroke: #fff; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.abbraccio.fuse .cuore-abbraccio { animation: cuoreAbbraccio 1s cubic-bezier(.2,1.6,.4,1) 1s forwards, batti 1.6s ease-in-out 2.4s infinite; }
@keyframes cuoreAbbraccio { from { opacity: 0; transform: scale(.2) translateY(14px); } to { opacity: 1; transform: none; } }
.abbraccio.esce .abbraccio-sagoma, .abbraccio.esce .abbraccio-tit, .abbraccio.esce .abbraccio-pre, .abbraccio.esce .abbraccio-hint, .abbraccio.esce .abbraccio-x { transition: opacity .4s; opacity: 0; }
.mini {
  position: absolute; width: 15px; height: 10px; margin: -5px 0 0 -7.5px; padding: 0;
  border-radius: 2px; background: #fff; border: 1px solid #8ea5d6;
  box-shadow: 0 2px 5px rgba(47,61,102,.25); transform: rotate(var(--r)); overflow: hidden;
}
.mini::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 62%; background: #dbe4f5; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.mini.ferma { animation: miniGalleggia 3s ease-in-out var(--d) infinite alternate; }
@keyframes miniGalleggia { from { transform: rotate(var(--r)) translateY(-2px); } to { transform: rotate(calc(var(--r) * -1)) translateY(2px); } }
.mini.speciale {
  width: 46px; height: 32px; margin: -16px 0 0 -23px; z-index: 2; cursor: pointer; overflow: visible;
  border: 1.6px solid #d4577d; box-shadow: 0 0 0 0 rgba(245,143,174,.7), 0 6px 14px rgba(47,61,102,.3);
}
.mini.speciale::after { border-radius: 3px 3px 0 0; background: #fbe4ea; }
.mini.speciale span { position: absolute; z-index: 2; left: 50%; top: 58%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: linear-gradient(180deg, #f7a3bb, #d4577d); color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
.mini.speciale.ferma { animation: miniGalleggia 3s ease-in-out var(--d) infinite alternate, brillaLettera 1.8s ease-out infinite; }
@keyframes brillaLettera { 0% { box-shadow: 0 0 0 0 rgba(245,143,174,.75), 0 6px 14px rgba(47,61,102,.3); } 100% { box-shadow: 0 0 0 16px rgba(245,143,174,0), 0 6px 14px rgba(47,61,102,.3); } }
.mini.speciale.letta { border-color: #8ea5d6; }
.mini.speciale.letta span { background: linear-gradient(180deg, #9fb3e2, #6f8cc8); }
.mini.speciale.letta.ferma { animation: miniGalleggia 3s ease-in-out var(--d) infinite alternate; }
.abbraccio-hint { margin: 14px 0 0; color: #fff; font-size: 14px; animation: entra .6s ease-out 2.2s both; }
.abbraccio-hint .contatore { font-weight: 800; }
.mini:not(.speciale) { transition: opacity .6s ease var(--fd, 0s); }
.abbraccio.fuse .mini:not(.speciale) { opacity: 0; }

/* ───────── "hai bisogno di ridere": la busta che scappa ───────── */
.busta { position: relative; translate: var(--sx, 0px) var(--sy, 0px); transition: translate .45s cubic-bezier(.2,1.5,.4,1); touch-action: manipulation; }
.busta.in-fuga { z-index: 20; }
.busta.finta .env-flap { transform: rotateX(55deg); transition-duration: .2s; }
.busta.finta .env { scale: 1.06; transition: scale .2s; }
.busta.arresa .env { animation: arresa .45s ease-in-out 3; }
@keyframes arresa { 0%,100% { rotate: 0deg; } 25% { rotate: -7deg; } 75% { rotate: 7deg; } }

/* ───────── "non riesci a dormire": luce spenta, luna e pecorelle ───────── */
.notte { position: fixed; inset: 0; z-index: 45; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.notte .buio {
  position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease;
  background: radial-gradient(circle at var(--lx) var(--ly), rgba(255,214,150,.35) 0, rgba(255,214,150,.12) 70px, rgba(12,18,42,.94) 170px);
}
.notte.spenta .buio { opacity: 1; }
.notte.cielo .buio { background: radial-gradient(circle at var(--lx) var(--ly), rgba(255,214,150,.08) 0, rgba(12,18,42,.97) 140px), linear-gradient(180deg, #0f1733, #1d2a55 70%, #24315f); transition: opacity .9s ease, background 1.6s ease; }
.notte.esce { animation: fade .8s ease reverse both; }
.scena-notte { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 560px); height: 100%; overflow: visible; opacity: 0; transition: opacity 1.2s ease; }
.notte.cielo .scena-notte { opacity: 1; }
.stella-notte { fill: #fff; opacity: 0; transform-box: fill-box; transform-origin: center; }
.notte.cielo .stella-notte { animation: brillaScena 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * .17s); }
.luna-notte { opacity: 0; }
.notte.cielo .luna-notte { animation: sorgeLunaN 3s cubic-bezier(.3,.6,.3,1) .3s forwards; }
@keyframes sorgeLunaN { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
.prato-notte { fill: #1a2449; stroke: #3d4f86; stroke-width: 1.5; }
.steccato path, .steccato rect { fill: #2c3a6b; stroke: #9fb3e2; stroke-width: 1.5; }
.pecora-corpo { transform-box: fill-box; transform-origin: 50% 100%; }
.pecora.cammina .pecora-corpo { animation: passoPecora .32s ease-in-out infinite alternate; }
@keyframes passoPecora { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-3px) rotate(2deg); } }
.pecora:not(.cammina):not(.dorme) .pecora-corpo { animation: aspettaPecora 1.4s ease-in-out infinite alternate; }
@keyframes aspettaPecora { from { transform: none; } to { transform: scaleY(.96); } }
.occhio-chiuso { display: none; }
.pecora.dorme .occhio-chiuso { display: inline; }
.pecora.dorme .occhio-aperto { display: none; }
.pecora.dorme .zampe { opacity: 0; transition: opacity .4s; }
.pecora.dorme .pecora-corpo { animation: respiraPecora 2.4s ease-in-out infinite; transform: translateY(13px); }
@keyframes respiraPecora { 0%,100% { transform: translateY(13px) scaleY(1); } 50% { transform: translateY(13px) scaleY(1.05); } }
.zzz { opacity: 0; }
.zzz text { fill: #c9d6ef; font-family: Caveat, cursive; font-size: 18px; font-weight: 700; }
.notte.dormono .zzz { opacity: 1; }
.notte.dormono .zzz text { animation: zzz 2.4s ease-in-out infinite; opacity: 0; }
.notte.dormono .zzz text:nth-child(2) { animation-delay: .5s; }
.notte.dormono .zzz text:nth-child(3) { animation-delay: 1s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(8px, -16px); } }
.lettera-luna { opacity: 0; pointer-events: none; cursor: pointer; transform: translate(252px, -160px); }
.notte.scende .lettera-luna { opacity: 1; pointer-events: auto; animation: scendeLettera 2.6s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes scendeLettera { from { transform: translate(252px, -160px); } to { transform: translate(252px, 322px); } }
.lettera-luna .dondola { transform-box: fill-box; transform-origin: 50% 0; }
.notte.scende .lettera-luna .dondola { animation: dondolaFilo 3s ease-in-out 2.4s infinite alternate; }
@keyframes dondolaFilo { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.conta-pecore { position: absolute; left: 0; right: 0; top: calc(64px + var(--safe-t)); margin: 0; text-align: center; font-family: var(--hand); font-size: 40px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); pointer-events: none; }
.conta-pecore.pop { animation: contaPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes contaPop { from { transform: scale(.6); opacity: .3; } to { transform: none; opacity: 1; } }
.hint-notte { position: absolute; left: 0; right: 0; bottom: calc(26px + var(--safe-b)); margin: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 14px; pointer-events: none; opacity: 0; transition: opacity .5s; }
.notte.cielo .hint-notte { opacity: 1; transition-delay: 1.8s; }
.notte .hint-notte.via { opacity: 0 !important; transition-delay: 0s; }
.notte-x { position: absolute !important; top: calc(16px + var(--safe-t)); right: 16px; z-index: 2; }

/* pannello dopo le pecorelle */
.pannello-notte {
  position: absolute; z-index: 2; left: 50%; top: calc(120px + var(--safe-t)); transform: translateX(-50%);
  width: min(88vw, 380px); padding: 20px 18px; border-radius: 24px; text-align: center;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(201,214,239,.35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff;
}
.pannello-notte[hidden] { display: none; }
.pannello-notte.compare { animation: entra .7s ease-out both; }
.pn-tit { margin: 0 0 12px; font-family: var(--hand); font-size: 30px; line-height: 1.1; }
.pn-grande { margin: 4px 0; font-family: var(--hand); font-size: 36px; line-height: 1.15; }
.pn-testo {
  width: 100%; min-height: 96px; resize: none; margin-bottom: 12px; padding: 12px 14px; border-radius: 16px;
  border: 1.5px solid rgba(201,214,239,.5); background: rgba(255,255,255,.92); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.4; outline: 0;
}
.pn-testo.no-vuoto { animation: no .45s; }
.pannello-notte .btn { width: 100%; }
.pn-motivo { margin: 0 0 16px; font-family: var(--hand); font-size: 24px; line-height: 1.2; color: #f7dccb; overflow-wrap: anywhere; }
.pn-scelte { display: flex; gap: 10px; }
.pn-scelte .btn, .pn-scelte .btn-sec { flex: 1; width: auto; }
.pannello-notte .btn-sec { color: #fff; border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }
.pannello-notte .btn-sec .btn-fx i { color: #fff; }
/* "spegni il telefono": la notte si fa ancora più buia */
.notte.buonanotte .scena-notte { opacity: .55; transition: opacity 3s ease 1.5s; }
.notte.buonanotte .conta-pecore { opacity: 0; transition: opacity 1s; }
.pn-sotto { margin: 10px 0 0; font-size: 16px; color: rgba(255,255,255,.85); }

/* riquadro dopo le pecorelle: ben leggibile anche su telefono */
.pannello-notte {
  top: calc(78px + var(--safe-t)); width: min(90vw, 400px); padding: 24px 20px 22px;
  background: rgba(14, 21, 48, .9); border: 1.5px solid rgba(201,214,239,.55);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.pn-tit { font-size: 34px; line-height: 1.1; color: #fff; }
.pn-grande { font-size: 38px; color: #fff; }
.pn-sotto { font-size: 17px; color: #e3eaf8; }
.pn-motivo { font-size: 26px; color: #ffe1c7; }
.notte.pannello-su .conta-pecore, .notte.pannello-su .hint-notte { opacity: 0 !important; transition: opacity .4s; }
.pannello-notte { left: 0; right: 0; margin: 0 auto; transform: none; }
.pn-ancora { margin-top: 14px; opacity: 0; animation: entra .8s ease-out 3s forwards; }
.pn-ancora .pn-sotto { margin: 0 0 12px; }

/* ───────── "sei triste": nuvola, barattolo dei sorrisi, arcobaleno ───────── */
.triste { position: fixed; inset: 0; z-index: 45; overflow: hidden; --p: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; opacity: 0; transition: opacity .7s ease; }
.triste.dentro { opacity: 1; }
.triste.esce { opacity: 0; }
.cielo-triste, .cielo-sereno { position: absolute; inset: 0; }
.cielo-sereno { background: linear-gradient(180deg, #bfe0fb 0%, #e6f2fd 45%, #fde9ef 100%); }
.cielo-triste { background: linear-gradient(180deg, #7d879e 0%, #a6aebf 50%, #c9ceda 100%); opacity: calc(1 - var(--p)); transition: opacity 1s ease; }
.triste.sereno .cielo-triste { opacity: 0; }
.scena-triste { position: absolute; inset: 0; width: 100%; height: 100%; }
.sole { opacity: calc(var(--p) * .8); transition: opacity 1s ease; }
.triste.sereno .sole { opacity: 1; }
.triste.sereno .sole circle:last-child { animation: batti 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.nuvola .pezzo { fill: #9aa3b8; stroke: #7d879e; stroke-width: 1.5; }
.triste.dentro .nuvola { animation: nuvolaDondola 4s ease-in-out infinite alternate; }
@keyframes nuvolaDondola { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
.pioggia { opacity: calc(1 - var(--p)); transition: opacity 1s ease; }
.goccia { stroke: #6f8cc8; stroke-width: 2; stroke-linecap: round; opacity: 0; animation: pioggia var(--d) linear infinite; animation-delay: calc(var(--i) * -.09s); }
@keyframes pioggia { 0% { opacity: 0; transform: translate(var(--x), 0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(calc(var(--x) - 10px), 230px); } }
.arco-cielo { fill: none; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 480; stroke-dashoffset: 480; }
.triste.sereno .arco-cielo { animation: arcobaleno 1.4s ease-out forwards; animation-delay: calc(.2s + var(--i) * .12s); }
@keyframes arcobaleno { to { stroke-dashoffset: 0; } }
.etichetta-sorrisi { font-family: Caveat, cursive; font-size: 18px; fill: #5671b0; }
.barattolino { transition: opacity .8s; }
.lettera-arco { opacity: 0; cursor: pointer; }
.triste.scivola .lettera-arco { opacity: 1; }
.triste.arrivata .la-corpo { animation: batti 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sorrisi-pila { position: absolute; left: 0; right: 0; top: 47%; display: flex; justify-content: center; pointer-events: none; }
.sorriso {
  position: absolute; width: min(82vw, 330px); padding: 22px 20px 20px; border-radius: 14px; text-align: center;
  background: #fffdf8; box-shadow: 0 14px 34px rgba(47,61,102,.28); rotate: var(--r);
  font-family: var(--hand); font-size: 27px; line-height: 1.2; color: var(--ink);
}
.sorriso::before { content: ""; position: absolute; top: -8px; left: 50%; width: 54px; height: 16px; translate: -50% 0; rotate: -3deg; background: rgba(243,191,208,.85); border-radius: 2px; }
.sorriso-n { display: block; margin-bottom: 6px; font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--ink-soft); }
.hint-triste { position: absolute; left: 0; right: 0; bottom: calc(22px + var(--safe-b)); margin: 0; text-align: center; font-size: 14px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.25); pointer-events: none; }
.triste.sereno .hint-triste { color: var(--ink-soft); text-shadow: none; }
.triste-x { position: absolute !important; top: calc(16px + var(--safe-t)); right: 16px; z-index: 2; }
.nuvola .pezzo { transform-box: fill-box; transform-origin: center; }
.triste.sereno .nuvola { opacity: 0; transition: opacity .8s ease .6s; }
.nuvola .pezzo { fill: #98a1b6; stroke: none; }
.nuvola { filter: drop-shadow(0 6px 10px rgba(60,70,100,.25)); }

/* ───────── password d'ingresso ───────── */
.cancello { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: linear-gradient(165deg, #eef2fb 0%, #e6ecf8 45%, #dbe4f5 100%); transition: opacity .7s ease; }
.cancello.apre { opacity: 0; }
.cancello-carta { width: min(100%, 420px); text-align: center; animation: entra .8s ease-out both; }
.cancello-cuore { width: 70px; margin: 0 auto 10px; display: block; overflow: visible; }
.cancello-cuore .traccia { stroke-width: 3; }
.cancello-pre { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.cancello-tit { margin: 4px 0 22px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(30px, 8vw, 42px); color: var(--ink); line-height: 1.05; }
.cancello-form .lente { fill: none; }
.cancello-form input { font-style: normal; letter-spacing: .1em; }
.cancello-msg { min-height: 1.4em; margin: 12px 0 0; color: #b0506b; font-size: 15px; }

/* ───────── "sei fiera di te": la prima pagina di giornale ───────── */
.fiera { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: calc(64px + var(--safe-t)) 14px calc(20px + var(--safe-b)); opacity: 0; transition: opacity .5s; }
.fiera.dentro { opacity: 1; }
.fiera.esce { opacity: 0; }
.velo-fiera { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255,236,190,.55), rgba(47,61,102,.55) 70%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.fiera-x { position: absolute !important; top: calc(16px + var(--safe-t)); right: 16px; z-index: 3; }
.fiera-domanda {
  position: relative; z-index: 2; width: min(92vw, 400px); padding: 24px 20px 22px; border-radius: 24px; text-align: center;
  background: rgba(14,21,48,.88); border: 1.5px solid rgba(201,214,239,.5); color: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.35);
  animation: entra .6s ease-out both; transition: opacity .4s, transform .4s;
}
.fiera-domanda .btn { width: 100%; }
.fiera-domanda.via { opacity: 0; transform: scale(.9); pointer-events: none; }
.fiera.stampato .fiera-domanda { display: none; }
.giornale {
  position: relative; z-index: 2; width: min(94vw, 560px); max-height: calc(100dvh - 90px - var(--safe-t) - var(--safe-b)); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 20px 24px; background: #f6f1e4; color: #1f1d1a; border-radius: 4px;
  box-shadow: 0 30px 70px rgba(0,0,0,.45); font-family: Georgia, "Times New Roman", serif;
  background-image: radial-gradient(circle at 20% 10%, rgba(0,0,0,.035), transparent 40%), radial-gradient(circle at 90% 80%, rgba(0,0,0,.04), transparent 45%);
  animation: giornaleGira 1.3s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes giornaleGira { 0% { opacity: 0; transform: scale(.05) rotate(-900deg); } 70% { opacity: 1; transform: scale(1.04) rotate(8deg); } 100% { transform: none; } }
.g-riga { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid #1f1d1a; padding-bottom: 6px; }
.g-nome { margin: 8px 0 6px; text-align: center; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: clamp(30px, 8.5vw, 46px); line-height: 1; letter-spacing: -.01em; }
.g-fascia { border-top: 3px double #1f1d1a; border-bottom: 3px double #1f1d1a; padding: 5px 0; text-align: center; font-weight: 700; font-size: 14px; letter-spacing: .3em; text-transform: uppercase; color: #b3243b; }
.g-titolo { margin: 16px 0 8px; font-size: clamp(26px, 7.4vw, 40px); line-height: 1.05; font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.g-sotto { margin: 0 0 14px; font-style: italic; font-size: 15px; color: #4a4640; border-bottom: 1px solid #c8c0ae; padding-bottom: 12px; }
.g-foto { margin: 0 0 14px; }
.g-foto img { width: 100%; max-height: 260px; object-fit: cover; filter: grayscale(.85) contrast(1.05); }
.g-foto figcaption { font-size: 12px; font-style: italic; color: #5d574e; margin-top: 4px; }
.g-articolo p { margin: 0 0 10px; font-size: 16px; line-height: 1.55; text-align: justify; hyphens: auto; }
.g-articolo p:first-child::first-letter { float: left; font-size: 3.2em; line-height: .85; margin: 4px 6px 0 0; font-weight: 700; }
@media (min-width: 640px) { .g-articolo { column-count: 2; column-gap: 22px; column-rule: 1px solid #c8c0ae; } }
.g-firma { margin: 10px 0 0; text-align: right; font-style: italic; }

/* buste: l'ultima riga incompleta resta centrata, senza buchi */
.buste { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 16px; }
.busta { flex: 0 0 calc((100% - 16px) / 2); }
@media (min-width: 560px) { .buste { gap: 40px 28px; } .busta { flex-basis: calc((100% - 56px) / 3); } }

/* ───────── fiori più vivaci ───────── */
.deriva { opacity: var(--o, .5); }
.deriva .oscilla { animation: oscillaFiore var(--s) ease-in-out infinite alternate; }
@keyframes oscillaFiore { from { transform: translateX(-20px) rotate(-28deg) scale(.9); } to { transform: translateX(20px) rotate(28deg) scale(1.08); } }
.fa { animation: ondeggiaForte 4.5s ease-in-out infinite alternate; }
@keyframes ondeggiaForte { from { transform: rotate(-8deg) scale(.96); } to { transform: rotate(9deg) scale(1.06) translateY(3px); } }
.fiore-lato { position: absolute; width: var(--w); translate: -50% -50%; animation: sbocciaLato var(--d) ease-in-out var(--del) infinite; }
.fiore-lato .traccia, .fiore-lato .punto, .fiore-lato .petalo-ib, .fiore-lato .petalo-gi { animation: none; stroke-dashoffset: 0; opacity: 1; }
.fiore-lato .petalo-ib { fill: rgba(243,191,208,.4); }
.fiore-lato .petalo-gi { fill: rgba(255,255,255,.65); }
@keyframes sbocciaLato { 0%,100% { transform: scale(.5) rotate(-25deg); opacity: .25; } 50% { transform: scale(1) rotate(18deg); opacity: .75; } }

/* ───────── gattini ───────── */
#gattini { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.gattino-svg { display: block; width: 100%; height: auto; overflow: visible; }
.g-chiusi { opacity: 0; }
.g-occhi { animation: apriOcchiGatto 4.5s infinite; }
.g-chiusi { animation: chiudiOcchiGatto 4.5s infinite; }
@keyframes apriOcchiGatto { 0%, 92%, 100% { opacity: 1; } 95% { opacity: 0; } }
@keyframes chiudiOcchiGatto { 0%, 92%, 100% { opacity: 0; } 95% { opacity: 1; } }
.g-coda { transform-box: fill-box; transform-origin: 0% 100%; animation: codaGatto 2.2s ease-in-out infinite alternate; }
@keyframes codaGatto { from { transform: rotate(-9deg); } to { transform: rotate(11deg); } }
.g-testa { transform-box: fill-box; transform-origin: 50% 100%; animation: testaGatto 6s ease-in-out infinite; }
@keyframes testaGatto { 0%, 60%, 100% { transform: none; } 70%, 85% { transform: rotate(-9deg); } }
/* quello che gioca col gomitolo */
.gatto-gioca { position: absolute; left: 12px; bottom: calc(clamp(70px, 8vw, 120px) * .42 + var(--safe-b)); width: clamp(56px, 7vw, 86px); }
.gatto-gioca .gomitolo { position: absolute; left: 96%; bottom: -2%; width: 34%; overflow: visible; animation: rotola 2.6s ease-in-out infinite; }
@keyframes rotola { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(26px); } 62% { transform: translateX(2px); } }
.gom-gira { transform-box: fill-box; transform-origin: center; animation: gomGira 2.6s ease-in-out infinite; }
@keyframes gomGira { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(220deg); } 62% { transform: rotate(30deg); } }
.gatto-gioca .g-zampa { transform-box: fill-box; transform-origin: 20% 50%; animation: colpetto 2.6s ease-in-out infinite; }
@keyframes colpetto { 0%, 52%, 100% { transform: none; } 60% { transform: translate(7px, -9px) rotate(-22deg); } 70% { transform: none; } }
/* quello che passeggia sulle onde */
.gatto-passeggia { position: absolute; left: 0; bottom: calc(clamp(70px, 8vw, 120px) * .5 + var(--safe-b)); width: clamp(62px, 7vw, 92px); animation: passeggia 46s linear infinite; }
@keyframes passeggia { 0% { transform: translateX(-130px); } 42% { transform: translateX(calc(100vw + 30px)); } 50% { transform: translateX(calc(100vw + 30px)); } 92% { transform: translateX(-130px); } 100% { transform: translateX(-130px); } }
.gp-gira { animation: giraGatto 46s steps(1) infinite, dondolaGatto .45s ease-in-out infinite alternate; }
@keyframes giraGatto { 0% { scale: 1 1; } 46% { scale: -1 1; } 96% { scale: 1 1; } }
@keyframes dondolaGatto { from { translate: 0 0; } to { translate: 0 -2px; } }
.zg-a, .zg-b { transform-box: fill-box; transform-origin: 50% 0; }
.zg-a { animation: zampaGatto .45s ease-in-out infinite alternate; }
.zg-b { animation: zampaGatto .45s ease-in-out infinite alternate-reverse; }
@keyframes zampaGatto { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
/* quello seduto accanto al barattolo */
.vd.gatto { left: -70px; bottom: 1%; width: 66px; }
@media (min-width: 900px) { .vd.gatto { left: -104px; width: 92px; } }
@media (prefers-reduced-motion: reduce) { .gatto-passeggia { display: none; } }

/* ───────── animazioni casuali (le decide il "regista" in giardino.js) ───────── */
/* niente più ripetizioni fisse: occhi, testa e gomitolo si muovono solo quando capita */
.g-occhi, .g-chiusi, .g-testa, .gatto-gioca .g-zampa, .gom-gira, .gatto-gioca .gomitolo { animation: none; }
.gatto-passeggia { animation: none; transform: translateX(-300px); }
.gp-gira { animation: none; }
.gatto-passeggia:not(.cammina) .zg-a, .gatto-passeggia:not(.cammina) .zg-b { animation: none; }
.gatto-passeggia.cammina .gp-gira { animation: dondolaGatto .45s ease-in-out infinite alternate; }
.gatto-passeggia.corre .zg-a, .gatto-passeggia.corre .zg-b { animation-duration: .18s; }
.gatto-passeggia.corre .gp-gira { animation-duration: .18s; }
.gattino-svg .g-testa { transition: transform .4s ease; }
.ammicca .g-occhi, .dorme .g-occhi { opacity: 0; }
.ammicca .g-chiusi, .dorme .g-chiusi { opacity: 1; }
.occhiolino .g-occhi ellipse:first-child, .occhiolino .g-occhi circle:nth-of-type(1) { opacity: 0; }
.testa-sx .g-testa { transform: rotate(-12deg); }
.testa-dx .g-testa { transform: rotate(12deg); }
.dorme .g-testa { transform: rotate(-6deg) translateY(2px); }
.vd.gatto, .gatto-gioca { transition: none; }
.stira .gattino-svg { animation: stiraGatto 1.6s ease-in-out; transform-origin: 50% 100%; }
@keyframes stiraGatto { 0%, 100% { transform: none; } 40% { transform: scale(1.12, .85); } 70% { transform: scale(.94, 1.1); } }
.salta .gattino-svg { animation: saltaGatto .7s cubic-bezier(.3,0,.4,1); }
@keyframes saltaGatto { 0%, 100% { transform: none; } 20% { transform: scale(1.08, .9); } 50% { transform: translateY(-22px) scale(.95, 1.06); } 80% { transform: scale(1.06, .94); } }
.coda .g-coda { animation-duration: .25s; }
.dorme .g-coda { animation-duration: 5s; }
.zampata .g-zampa { animation: colpetto .45s ease-in-out; }
@keyframes colpetto { 0%, 100% { transform: none; } 45% { transform: translate(8px, -10px) rotate(-24deg); } }
.guarda .gattino-svg .g-testa { transform: rotate(-14deg) translateY(-2px); }
.siede .gattino-svg { transform: scaleY(.9) translateY(4px); transition: transform .4s; }
.cuore-gatto { position: absolute; left: 50%; top: 6%; color: #f58fae; font-size: 18px; pointer-events: none; animation: cuoreGatto 1.8s ease-out forwards; }
@keyframes cuoreGatto { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), -60px) scale(1.2); } }
.vd.gatto { position: absolute; }
/* vento e sorprese dei fiori */
body.vento-sx .deriva, body.vento-sx .fa, body.vento-sx .fiore-lato { translate: -26px 0; rotate: -14deg; transition: translate 1.2s ease, rotate 1.2s ease; }
body.vento-dx .deriva, body.vento-dx .fa, body.vento-dx .fiore-lato { translate: 26px 0; rotate: 14deg; transition: translate 1.2s ease, rotate 1.2s ease; }
.deriva, .fa { transition: translate 1.6s ease, rotate 1.6s ease; }
.piroetta > svg, .oscilla.piroetta > svg { animation: piroetta 1.4s cubic-bezier(.3,0,.3,1); }
@keyframes piroetta { from { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(1.2); } to { transform: rotate(360deg) scale(1); } }
.fiorisce > svg { animation: fiorisce 1.4s cubic-bezier(.2,1.6,.4,1); }
@keyframes fiorisce { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.scintilla { position: fixed; font-style: normal; color: #f2cf7a; font-size: 14px; pointer-events: none; animation: scintilla 1.3s ease-out forwards; }
@keyframes scintilla { from { opacity: 1; transform: translate(-50%, -50%) scale(.5); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2) rotate(90deg); } }

/* ───────── buste: rosse se c'è qualcosa di nuovo, blu e aperte se già lette ───────── */
.busta.nuova .env-retro { background: #f4b9c4; border-color: #e58ea0; }
.busta.nuova .env-fronte { background: #fbdbe1; }
.busta.nuova .env-flap { background: #f7c9d2; }
.busta.nuova .env-sigillo { background: linear-gradient(180deg, #f07a8e, #c9334c); box-shadow: 0 4px 12px rgba(201,51,76,.45); animation: batti 1.6s ease-in-out infinite; }
.busta.nuova .busta-label em { color: #c9334c; }
.busta.nuova .busta-label::after { content: "nuova"; display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: #c9334c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.busta.letta .env-flap { transform: rotateX(180deg); z-index: 1; transition: transform .5s ease-in, z-index 0s .25s; }
.busta.letta .env-sigillo { transform: scale(0); opacity: 0; animation: none; }
.busta.letta .env-lettera { transform: translateY(-24%); }

/* fiori che si trasformano (bouquet, vaso, cuore, farfalla, regalo) */
.forma { display: block; width: 100%; height: auto; overflow: visible; }
.esce-forma > svg { animation: esceForma .46s cubic-bezier(.5,0,.8,.4) forwards; }
.entra-forma > svg { animation: entraForma .6s cubic-bezier(.2,1.5,.4,1); }
@keyframes esceForma { to { transform: scale(.05) rotate(200deg); opacity: .4; } }
@keyframes entraForma { from { transform: scale(.05) rotate(-160deg); opacity: .4; } to { transform: none; opacity: 1; } }
.fiore-lato .forma, .deriva .forma { opacity: .9; }
.ali-forma { transform-box: fill-box; transform-origin: 100% 50%; animation: aliForma .35s ease-in-out infinite alternate; }
.ali-forma.ali-dx { transform-origin: 0% 50%; }
@keyframes aliForma { from { transform: scaleX(1); } to { transform: scaleX(.55); } }

.cancello-sotto { margin: -12px 0 18px; color: var(--ink-soft); font-size: 15px; }
.cancello-form-doppio { display: grid; gap: 10px; }
.cancello-form-doppio.no { animation: no .45s; }
.cancello-form-doppio .lente { fill: none; }
.cancello-aiuto { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.cancello-link { margin-top: 14px; border: 0; background: none; color: var(--blu); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* ═════════════ ritocchi grafici ═════════════ */
/* passaggio morbido tra home e "Aprilo quando…" (dove il browser lo supporta) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtEsce .35s ease both; }
::view-transition-new(root) { animation: vtEntra .45s ease both; }
@keyframes vtEsce { to { opacity: 0; transform: translateY(-10px) scale(.99); } }
@keyframes vtEntra { from { opacity: 0; transform: translateY(12px) scale(.99); } }

/* titolo più leggibile: un alone chiaro dietro, e una sottolineatura disegnata a mano */
.hero::before { content: ""; position: absolute; z-index: 0; left: 50%; top: 30px; width: min(620px, 105%); height: 250px; translate: -50% 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(244,247,253,.92), rgba(244,247,253,.6) 55%, rgba(244,247,253,0)); }
.hero > * { position: relative; z-index: 1; }
h1 .parola.lui { position: relative; }
h1 .parola.lui::after {
  content: ""; position: absolute; left: 0; right: 2%; bottom: -.1em; height: .3em; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3,13 C40,5 80,17 120,9 C150,4 175,12 197,7' fill='none' stroke='%23f3a9bd' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  clip-path: inset(0 100% 0 0); animation: sottolinea 1s ease-out 1.7s forwards;
}
@keyframes sottolinea { to { clip-path: inset(0 0 0 0); } }
.carta h3 { padding-bottom: .18em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3,13 C40,5 80,17 120,9 C150,4 175,12 197,7' fill='none' stroke='%23f3bfd0' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left bottom / min(70%, 260px) .28em; }

/* barattolo: un riflesso di luce che passa sul vetro, si illumina quando trova un ricordo, fa "no" quando non lo trova */
.lucentezza { transform: skewX(-18deg); animation: lucentezza 7s ease-in-out 3s infinite; }
@keyframes lucentezza { 0%, 70% { translate: -60px 0; } 100% { translate: 260px 0; } }
.vaso.illumina { animation: illumina 1.6s ease-out; }
@keyframes illumina { 0% { filter: drop-shadow(0 18px 22px rgba(86,113,176,.22)); } 30% { filter: drop-shadow(0 0 22px rgba(245,143,174,.95)) drop-shadow(0 0 40px rgba(255,236,180,.8)); } 100% { filter: drop-shadow(0 18px 22px rgba(86,113,176,.22)); } }
.vaso.nega { animation: nega .5s ease-in-out; }
@keyframes nega { 0%, 100% { translate: 0 0; } 20%, 60% { translate: -7px 0; } 40%, 80% { translate: 7px 0; } }

/* buste: quelle nuove ogni tanto "chiamano", e su computer si sollevano al passaggio del mouse */
.busta.nuova .env { animation: fluttuaBusta 4s ease-in-out infinite alternate, invita 5.5s ease-in-out infinite; animation-delay: calc(var(--i,0) * -.7s), calc(var(--i,0) * -1.3s); }
@keyframes invita { 0%, 84%, 100% { rotate: 0deg; } 88% { rotate: -6deg; } 92% { rotate: 6deg; } 96% { rotate: -3deg; } }
@media (hover: hover) { .busta .env { transition: scale .3s ease, translate .3s ease; } .busta:hover .env { scale: 1.06; translate: 0 -6px; } }

/* cuoricini dove si tocca */
.tocco { position: fixed; z-index: 400; pointer-events: none; font-style: normal; line-height: 1; translate: -50% -50%; animation: tocco .8s ease-out forwards; }
@keyframes tocco { from { opacity: 1; transform: scale(.4); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(25deg); } }

/* tastiera: si vede sempre dove si è */
a:focus-visible, button:focus-visible, .vaso:focus-visible, input:focus-visible { outline: 3px solid rgba(111,140,200,.55); outline-offset: 3px; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) { .lucentezza { display: none; } h1 .parola.lui::after { clip-path: none; } }
.vaso.illumina.scuoti { animation: scuoti .6s ease-in-out, illumina 1.6s ease-out; }
