:root {
  --fondo: #2a0f17;
  --fondo-2: #3d1522;
  --testo: #fbefe6;
  --testo-soft: #e6cfc4;
  --oro: #e8c27a;
  --oro-scuro: #b88a3e;
  --crema: #fbf3e8;
  --inchiostro: #3a1a22;
  --rosa: #e7a1a8;
  --vino: #8e2a3b;
  --bosco: #2f5a46;
  --prugna: #5b2a4a;
  --rosa-scuro: #b8545f;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --raggio: 16px;
  --raggio-casella: 12px;
  --ombra: 0 10px 30px rgba(0,0,0,.35);
  --curva: cubic-bezier(.2,.8,.2,1);
  --sicuro-basso: env(safe-area-inset-bottom, 0px);
  --sicuro-alto: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 80% at 50% 0%, var(--fondo-2) 0%, var(--fondo) 60%) fixed, var(--fondo);
  color: var(--testo);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }

/* lucine sfocate sullo sfondo */
.luci {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(160px 160px at 100% 0%, rgba(232,194,122,.10), transparent 70%),
    radial-gradient(220px 220px at 0% 100%, rgba(142,42,59,.35), transparent 70%);
}

.app {
  position: relative; z-index: 1;
  width: min(92%, 520px);
  margin: 0 auto;
  padding: calc(var(--space-6) + var(--sicuro-alto)) 0 calc(var(--space-7) + var(--sicuro-basso));
}

/* testata */
.testa { text-align: center; }
.mese {
  margin: 0 0 var(--space-1);
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  color: var(--oro);
}
h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 380;
  font-size: 28px; line-height: 1.15;
}
h1 em { font-style: italic; font-weight: 400; color: var(--rosa); }

/* frase segreta */
.frase { margin-top: var(--space-5); text-align: center; }
.frase-lettere {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--space-2) var(--space-4);
}
.parola { display: flex; gap: 3px; }
.slot {
  width: 17px; height: 26px;
  display: grid; place-items: center;
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px; font-weight: 400; line-height: 1;
  color: var(--oro);
  border-bottom: 1.5px solid rgba(232,194,122,.35);
}
.slot.vuoto::after {
  content: "♥"; font-family: "Nunito", sans-serif; font-size: 10px; line-height: 1;
  color: rgba(231,161,168,.55);
}
.slot.nuova { animation: accendi 1.2s var(--curva) both; }
.frase.completa .slot { border-bottom-color: transparent; text-shadow: 0 0 12px rgba(232,194,122,.7); }
.frase-nota { margin: var(--space-2) 0 0; font-size: 14px; color: var(--testo-soft); }

@keyframes accendi {
  0% { opacity: 0; transform: translateY(6px) scale(.6); text-shadow: 0 0 0 transparent; }
  60% { opacity: 1; transform: none; text-shadow: 0 0 18px rgba(232,194,122,1); }
  100% { text-shadow: 0 0 6px rgba(232,194,122,.4); }
}

/* blocco di oggi */
.oggi {
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border-radius: var(--raggio);
  background: linear-gradient(160deg, rgba(232,194,122,.14), rgba(142,42,59,.22));
  border: 1px solid rgba(232,194,122,.25);
  display: flex; align-items: center; gap: var(--space-3);
}
.oggi .mono { width: 56px; height: 56px; flex: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--oro); }
.oggi-riga { flex: 1; min-width: 0; }
.oggi .pulsante { flex: 1; margin-top: 0; }
.attesa .mono.grande { display: block; width: 140px; height: 140px; margin: 0 auto var(--space-4); border-radius: 50%; object-fit: cover; box-shadow: 0 8px 24px rgba(58,26,34,.18); }
.oggi:empty { display: none; }
.oggi-titolo {
  margin: 0;
  font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--testo-soft);
}
.oggi > .oggi-titolo { font-family: "Fraunces", Georgia, serif; font-weight: 380; font-size: 20px; color: var(--testo); }
.oggi-testo { margin: var(--space-2) 0 0; color: var(--testo-soft); }
.conto {
  margin: 2px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px; line-height: 1.1; letter-spacing: .02em; color: var(--oro);
  font-variant-numeric: tabular-nums;
}
.conto small { font-family: "Nunito", sans-serif; font-size: 14px; color: var(--testo-soft); letter-spacing: 0; }

.pulsante {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 100%; min-height: 52px; margin-top: var(--space-4);
  padding: 12px 24px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #f0cf8e, var(--oro-scuro));
  color: #2a0f17; font-size: 17px; font-weight: 800;
  box-shadow: 0 6px 20px rgba(232,194,122,.3);
  cursor: pointer;
  transition: transform .15s var(--curva);
}
.pulsante:active { transform: scale(.97); }
.pulsante.secondario {
  background: transparent; color: var(--inchiostro);
  border: 1.5px solid rgba(58,26,34,.25); box-shadow: none; font-weight: 700;
}

/* griglia */
.griglia {
  margin-top: var(--space-5);
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}
.casella {
  position: relative;
  aspect-ratio: 1;
  border: 0; padding: 0;
  border-radius: var(--raggio-casella);
  display: grid; place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s var(--curva);
}
.casella:active { transform: scale(.94); }
.casella .num {
  position: relative; z-index: 2;
  font-family: "Fraunces", Georgia, serif; font-size: 20px; font-weight: 400;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* incartata: nastro dorato a croce */
.casella.incartata { background: var(--c, var(--vino)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.casella.incartata::before, .casella.incartata::after {
  content: ""; position: absolute; background: rgba(232,194,122,.85); z-index: 1;
}
.casella.incartata::before { left: 50%; top: 0; bottom: 0; width: 6px; transform: translateX(-50%); }
.casella.incartata::after { top: 50%; left: 0; right: 0; height: 6px; transform: translateY(-50%); }
.casella.incartata .num {
  background: var(--c, var(--vino)); border-radius: 50%;
  width: 30px; height: 30px; display: grid; place-items: center;
}

/* oggi: brilla */
.casella.di-oggi { outline: 2px solid var(--oro); outline-offset: 2px; animation: respira 2.4s ease-in-out infinite; }
@keyframes respira {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,194,122,.0), inset 0 -3px 0 rgba(0,0,0,.18); }
  50% { box-shadow: 0 0 22px 4px rgba(232,194,122,.45), inset 0 -3px 0 rgba(0,0,0,.18); }
}

/* aperta: mostra la lettera */
.casella.aperta {
  background: rgba(251,243,232,.08);
  border: 1px solid rgba(232,194,122,.3);
  align-content: center; gap: 0;
}
.casella.aperta .lettera {
  font-family: "Fraunces", Georgia, serif; font-size: 26px; line-height: 1; color: var(--oro);
}
.casella.aperta .num {
  font-family: "Nunito", sans-serif; font-size: 11px; font-weight: 700;
  color: var(--testo-soft); text-shadow: none; margin-top: 2px;
}

/* futura: chiusa */
.casella.chiusa { filter: saturate(.55) brightness(.55); cursor: default; }
.casella.chiusa:active { transform: none; }
.casella:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }

/* animazione dello scarto */
.scarto {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(80,20,35,.85), rgba(15,4,8,.94));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow: hidden; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.scarto[hidden] { display: none; }
.raggi {
  position: absolute; left: 50%; top: 45%; width: 900px; height: 900px; margin: -450px 0 0 -450px;
  background: repeating-conic-gradient(from 0deg, rgba(232,194,122,.22) 0deg 8deg, transparent 8deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%);
  opacity: 0; transform: scale(.3);
}
.scarto.apri .raggi { animation: raggi 2.2s ease-out forwards; }
@keyframes raggi { 0% { opacity: 0; transform: scale(.3) rotate(0); } 25% { opacity: 1; } 100% { opacity: .8; transform: scale(1.1) rotate(60deg); } }

.pacco {
  position: relative; width: 150px; height: 140px; margin-top: -40px;
  transform: scale(var(--grande, 1)); transition: transform .25s var(--curva);
  filter: drop-shadow(0 0 calc(var(--luce, 0) * 1px) rgba(232,194,122,.9));
}
.scarto.entra .pacco { animation: cade .7s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes cade { from { transform: translateY(-120vh) rotate(-20deg); } to { transform: none; } }
.pacco.scuoti { animation: scuoti .45s ease-in-out; }
@keyframes scuoti {
  0%, 100% { transform: scale(var(--grande)) rotate(0); }
  15% { transform: scale(calc(var(--grande) * 1.08), calc(var(--grande) * .92)) rotate(-9deg); }
  35% { transform: scale(calc(var(--grande) * .95), calc(var(--grande) * 1.06)) rotate(8deg) translateY(-12px); }
  55% { transform: scale(var(--grande)) rotate(-5deg); }
  75% { transform: scale(var(--grande)) rotate(3deg); }
}
.scatola {
  position: absolute; bottom: 0; left: 8px; right: 8px; height: 100px;
  background: var(--c, var(--vino)); border-radius: 10px;
  box-shadow: var(--ombra);
}
.scatola::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 14px; transform: translateX(-50%); background: var(--oro); }
.coperchio {
  position: absolute; top: 14px; left: 0; right: 0; height: 32px;
  background: var(--c, var(--vino)); filter: brightness(1.12);
  border-radius: 8px; z-index: 2;
  box-shadow: 0 4px 0 rgba(0,0,0,.15);
}
.coperchio::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 14px; transform: translateX(-50%); background: var(--oro); }
.fiocco { position: absolute; left: 50%; top: -22px; width: 56px; height: 28px; transform: translateX(-50%); }
.fiocco::before, .fiocco::after {
  content: ""; position: absolute; top: 0; width: 26px; height: 24px;
  border: 6px solid var(--oro); border-radius: 50% 50% 0 50%;
}
.fiocco::before { left: 0; transform: rotate(-20deg); }
.fiocco::after { right: 0; transform: rotate(20deg) scaleX(-1); }
.scarto.apri .pacco { animation: none; }
.scarto.apri .coperchio { animation: vola .8s cubic-bezier(.2,.9,.3,1) forwards; }
.scarto.apri .scatola { animation: svanisci .9s ease-out .35s forwards; }
@keyframes vola { to { transform: translate(40px, -60vh) rotate(-140deg); opacity: 0; } }
@keyframes svanisci {
  0% { box-shadow: 0 0 60px 20px rgba(232,194,122,.7); }
  100% { transform: scale(.6) translateY(40px); opacity: 0; box-shadow: 0 0 80px 40px rgba(232,194,122,0); }
}

.lettera-volante {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0);
  font-family: "Fraunces", Georgia, serif; font-size: 150px; line-height: 1; color: var(--oro);
  text-shadow: 0 0 30px rgba(232,194,122,.9), 0 0 80px rgba(232,194,122,.5);
  pointer-events: none;
}
.scarto.apri .lettera-volante { animation: lettera 1.6s cubic-bezier(.2,1.4,.4,1) .45s forwards; }
@keyframes lettera {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-30deg); }
  45% { transform: translate(-50%, -50%) scale(1.15) rotate(4deg); }
  65%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

.tocca { position: absolute; left: 0; right: 0; bottom: calc(18% + var(--sicuro-basso)); text-align: center; transition: opacity .3s; }
.tocca p { margin: 0 0 var(--space-3); font-size: 18px; font-weight: 800; color: var(--testo); animation: invita 1.4s ease-in-out infinite; }
@keyframes invita { 0%, 100% { opacity: .75; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
.scarto.apri .tocca { opacity: 0; }

.cuori { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.coriandolo {
  position: absolute; left: 50%; top: 45%;
  width: 9px; height: 14px; border-radius: 2px;
  animation: coriandolo var(--t, 2.4s) cubic-bezier(.15,.6,.4,1) forwards;
}
.coriandolo.cuore-c { width: auto; height: auto; background: none; font-size: 20px; line-height: 1; }
@keyframes coriandolo {
  0% { transform: translate(-50%,-50%) scale(.2) rotate(0); opacity: 1; }
  30% { transform: translate(calc(-50% + var(--dx) * .7), calc(-50% + var(--su))) scale(1) rotate(calc(var(--rot) * .4)); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--su) + 70vh)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* foglio del giorno */
.foglio {
  position: fixed; inset: 0; z-index: 30;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(232,194,122,.16), transparent 60%),
    radial-gradient(100% 50% at 50% 100%, rgba(142,42,59,.45), transparent 70%),
    var(--fondo);
  overscroll-behavior: contain;
}
.foglio[hidden] { display: none; }
.foglio-dentro {
  position: relative;
  width: min(100%, 560px); margin: 0 auto;
  padding: calc(var(--space-4) + var(--sicuro-alto)) var(--space-4) calc(var(--space-7) + var(--sicuro-basso));
  color: var(--testo);
  animation: sali .5s var(--curva) both;
}
@keyframes sali { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.foglio-testa { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.foglio-data {
  margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(232,194,122,.14); border: 1px solid rgba(232,194,122,.35);
  font-size: 14px; font-weight: 800; letter-spacing: .02em; color: var(--oro);
}
.chiudi {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(251,239,230,.1); color: var(--testo);
  cursor: pointer;
}

/* sigillo dorato con la lettera del giorno */
.lettera-del-giorno { margin: var(--space-4) 0 var(--space-6); text-align: center; }
.sigillo {
  position: relative; width: 104px; height: 104px; margin: 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbe7b5, #e8c27a 45%, #b88a3e 100%);
  box-shadow: 0 0 0 6px rgba(232,194,122,.18), 0 0 40px rgba(232,194,122,.45), inset 0 -4px 8px rgba(0,0,0,.18);
  animation: sigillo 1.2s cubic-bezier(.2,1.4,.4,1) .15s both;
}
.sigillo::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1.5px dashed rgba(58,26,34,.35); }
.sigillo span { font-family: "Fraunces", Georgia, serif; font-size: 56px; line-height: 1; color: #3a1a22; }
@keyframes sigillo { from { transform: scale(.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
.mini-frase { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; margin-top: var(--space-4); }
.mini-frase .parola { gap: 2px; }
.mini-frase .slot { width: 13px; height: 20px; font-size: 15px; border-bottom-width: 1px; }
.mini-frase .slot.adesso { color: #fff; text-shadow: 0 0 10px rgba(232,194,122,1); animation: accendi 1.4s var(--curva) .6s both; }
.lettera-del-giorno .spiega { display: block; margin-top: var(--space-2); font-size: 14px; color: var(--testo-soft); }

.contenuto { display: flex; flex-direction: column; gap: var(--space-6); }
.contenuto h2 {
  margin: 0; text-align: center;
  font-family: "Fraunces", Georgia, serif; font-weight: 380; font-size: 26px; line-height: 1.2; color: var(--testo);
}

/* foto come polaroid con lo scotch */
.foto.polaroid {
  position: relative; margin: 0 auto; width: 100%;
  padding: 10px 10px 0; background: #fffdf8; border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
  transform: rotate(var(--giro, -1.5deg));
  animation: posa .7s var(--curva) both;
}
.foto.polaroid:nth-child(even) { --giro: 1.8deg; }
.foto.polaroid::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 96px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(232,194,122,.75); box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.foto.polaroid img { display: block; width: 100%; height: auto; border-radius: 2px; }
.foto.polaroid figcaption {
  margin: 0; padding: 10px 6px 14px; min-height: 44px;
  font-family: "Caveat", cursive; font-size: 26px; line-height: 1.2; text-align: center; color: var(--inchiostro);
}
.foto.polaroid:not(:has(figcaption)) { padding-bottom: 36px; }
@keyframes posa { from { transform: translateY(30px) rotate(-8deg) scale(.96); opacity: 0; } to { opacity: 1; } }

/* biglietto scritto a mano */
.bigliettino {
  position: relative;
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--crema); border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
  transform: rotate(.8deg);
}
.bigliettino::before {
  content: ""; position: absolute; top: -12px; left: 24px; width: 80px; height: 24px;
  transform: rotate(-4deg); background: rgba(231,161,168,.8);
}
.biglietto {
  margin: 0;
  font-family: "Caveat", cursive; font-weight: 500;
  font-size: 28px; line-height: 1.35;
  white-space: pre-line;
  color: var(--inchiostro);
}
.bigliettino .firma { margin: var(--space-3) 0 0; text-align: right; font-family: "Caveat", cursive; font-size: 24px; color: var(--rosa-scuro); }

.video { padding: 8px; background: #fffdf8; border-radius: 16px; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.video video { display: block; width: 100%; max-height: 75vh; border-radius: 10px; background: #000; }

/* lettore audio */
.audio {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--raggio);
  background: var(--crema); color: var(--inchiostro); box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.audio-play {
  width: 60px; height: 60px; flex: none;
  border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--rosa-scuro), var(--vino)); color: #fff;
  cursor: pointer;
}
.audio-play svg { margin-left: 3px; }
.audio-play.suona svg { margin-left: 0; }
.audio-info { flex: 1; min-width: 0; }
.audio-etichetta { margin: 0 0 var(--space-2); font-weight: 700; font-size: 15px; }
.audio-barra { position: relative; height: 6px; border-radius: 3px; background: rgba(58,26,34,.12); cursor: pointer; }
.audio-barra span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--rosa-scuro); }
.audio-tempo { margin: var(--space-1) 0 0; font-size: 14px; color: #7a5560; font-variant-numeric: tabular-nums; }

.attesa { text-align: center; color: var(--testo-soft); }
.attesa p { margin: 0; }
.attesa .biglietto { text-align: center; color: var(--testo); }

.foglio .pulsante { margin-top: var(--space-7); }

/* invito a installare */
.installa {
  position: fixed; left: 50%; bottom: calc(var(--space-4) + var(--sicuro-basso)); z-index: 10;
  transform: translateX(-50%);
  width: min(92%, 480px);
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--raggio);
  background: var(--crema); color: var(--inchiostro);
  box-shadow: var(--ombra);
  font-size: 14px; line-height: 1.45;
}
.installa[hidden] { display: none; }
.installa p { margin: 0; }
.installa svg { vertical-align: -3px; }
.installa-ok {
  flex: none; min-width: 52px; min-height: 44px;
  border: 0; border-radius: 999px; padding: 0 var(--space-4);
  background: var(--vino); color: #fff; font-weight: 800; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.oggi > .pulsante:first-child { margin-top: 0; }

/* scherzo */
.sblocca {
  position: relative;
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 64px; margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  border: 0; border-radius: var(--raggio);
  background: linear-gradient(110deg, #f6d995 0%, #e8b864 45%, #fbe7b5 50%, #e8b864 55%, #c9923f 100%);
  background-size: 250% 100%;
  color: #2a0f17; text-align: left; cursor: pointer;
  box-shadow: 0 0 0 0 rgba(232,194,122,.6);
  animation: luccica 2.6s linear infinite, chiama 2s ease-in-out infinite, tenta 4s ease-in-out infinite;
}
.sblocca[hidden] { display: none; }
.sblocca img { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.sblocca-testi { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sblocca-testi strong { font-size: 16px; font-weight: 800; line-height: 1.25; }
.sblocca-testi small { font-size: 14px; font-weight: 600; line-height: 1.3; color: #5a2a33; }
.sblocca-freccia { flex: none; animation: spingi 1s ease-in-out infinite; }
.sblocca-badge {
  position: absolute; top: -10px; right: 14px;
  padding: 2px 10px; border-radius: 999px;
  background: #d9364f; color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  transform: rotate(3deg);
}
.sblocca:active { transform: scale(.97); }
@keyframes luccica { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes chiama { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,194,122,.55); } 50% { box-shadow: 0 0 22px 6px rgba(232,194,122,.45); } }
@keyframes tenta { 0%, 84%, 100% { transform: none; } 88% { transform: rotate(-1.5deg) scale(1.02); } 92% { transform: rotate(1.5deg) scale(1.02); } 96% { transform: rotate(-1deg); } }
@keyframes spingi { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
.scherzo {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(10,3,5,.9);
}
.scherzo[hidden] { display: none; }
.scherzo-dentro { width: min(92%, 520px); text-align: center; }
.scherzo video { display: block; width: 100%; border-radius: 14px; background: #000; }
.scherzo-testo { margin: var(--space-4) 0 0; font-size: 17px; line-height: 1.5; color: var(--testo); }
.scherzo-testo strong { color: var(--oro); }
.scherzo .chiudi {
  position: absolute; top: calc(var(--space-4) + var(--sicuro-alto)); right: var(--space-4);
  background: rgba(255,255,255,.15); color: #fff;
}

.sotto { margin: var(--space-1) 0 0; font-family: "Caveat", cursive; font-size: 26px; line-height: 1.2; color: var(--rosa); }
.cuoricino { color: #e0566a; }

/* coupon dentro il regalo */
.coupon {
  position: relative; text-align: center;
  padding: var(--space-5) var(--space-5) var(--space-5);
  border-radius: 14px;
  background: linear-gradient(160deg, #fbe7b5, #e8c27a 60%, #d4a556);
  color: #3a1a22;
  box-shadow: 0 14px 34px rgba(0,0,0,.45);
  -webkit-mask: radial-gradient(circle 14px at 0 58%, transparent 13px, #000 14px) left / 51% 100% no-repeat,
                radial-gradient(circle 14px at 100% 58%, transparent 13px, #000 14px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 14px at 0 58%, transparent 13px, #000 14px) left / 51% 100% no-repeat,
                radial-gradient(circle 14px at 100% 58%, transparent 13px, #000 14px) right / 51% 100% no-repeat;
  animation: coupon-entra .8s cubic-bezier(.2,1.4,.4,1) .3s both;
}
@keyframes coupon-entra { from { transform: scale(.6) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.coupon-sopra { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8e2a3b; }
.coupon-emoji { font-size: 54px; line-height: 1.1; margin-top: var(--space-2); }
.coupon-titolo { margin: var(--space-1) 0 0; font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.15; }
.coupon-testo { margin: var(--space-2) 0 0; font-size: 16px; line-height: 1.45; color: #5a2a33; }
.coupon-taglio { margin: var(--space-4) calc(-1 * var(--space-5)) var(--space-4); border-top: 2px dashed rgba(58,26,34,.35); }
.coupon-usa {
  min-height: 48px; width: 100%; padding: 12px 20px; border: 0; border-radius: 999px;
  background: #8e2a3b; color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
}
.coupon-usa:active { transform: scale(.97); }
.coupon-usato {
  display: inline-block; padding: 6px 16px; border: 3px solid #8e2a3b; border-radius: 8px;
  color: #8e2a3b; font-size: 18px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  transform: rotate(-6deg);
}
.coupon-nota { margin: var(--space-2) 0 0; font-size: 14px; color: #5a2a33; }

/* portafoglio in pagina principale */
.portafoglio { margin-top: var(--space-7); }
.portafoglio[hidden] { display: none; }
.portafoglio h2 { margin: 0 0 var(--space-4); font-family: "Fraunces", Georgia, serif; font-weight: 380; font-size: 22px; text-align: center; }
.portafoglio-lista { display: flex; flex-direction: column; gap: var(--space-3); }
.mini-coupon {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px;
  padding: var(--space-3) var(--space-4); border: 0; border-radius: 12px; text-align: left; cursor: pointer;
  background: linear-gradient(160deg, #fbe7b5, #e8c27a); color: #3a1a22;
}
.mini-coupon.usato { background: rgba(251,239,230,.08); color: var(--testo-soft); border: 1px dashed rgba(251,239,230,.25); }
.mini-coupon .e { font-size: 30px; line-height: 1; }
.mini-coupon .t { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; line-height: 1.3; }
.mini-coupon .s { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* i tre passi: fiocco, nastro, coperchio */
.tocca p { font-size: 20px; }
.tocca p.cambia { animation: cambia-testo .4s var(--curva), invita 1.4s ease-in-out .4s infinite; }
@keyframes cambia-testo { from { transform: translateY(10px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.pacco.sciolto .fiocco::before { animation: fiocco-sx .8s cubic-bezier(.4,0,.8,.6) forwards; }
.pacco.sciolto .fiocco::after { animation: fiocco-dx .8s cubic-bezier(.4,0,.8,.6) forwards; }
@keyframes fiocco-sx {
  30% { transform: rotate(-70deg) translate(-8px, -14px); }
  100% { transform: rotate(-160deg) translate(-40px, 220px); opacity: 0; }
}
@keyframes fiocco-dx {
  30% { transform: rotate(70deg) scaleX(-1) translate(-8px, -14px); }
  100% { transform: rotate(160deg) scaleX(-1) translate(-40px, 220px); opacity: 0; }
}
.pacco.senza-nastro .scatola::before { animation: nastro-giu .7s cubic-bezier(.5,0,.8,.5) forwards; }
.pacco.senza-nastro .coperchio::before { animation: nastro-su .6s cubic-bezier(.5,0,.8,.5) forwards; }
@keyframes nastro-giu { to { transform: translateX(-50%) translateY(160px) rotate(12deg); opacity: 0; } }
@keyframes nastro-su { to { transform: translateX(-50%) translateY(-120px) rotate(-20deg); opacity: 0; } }
.coperchio { transition: transform .35s var(--curva); }
.pacco.senza-nastro .coperchio { transform: translateY(-10px) rotate(-5deg); }

/* coupon: il tasto «utilizzato» sta solo nel portafoglio */
.mini-coupon { flex-wrap: wrap; cursor: default; }
.mini-coupon .riga { display: flex; align-items: center; gap: var(--space-3); width: 100%; }
.mini-usa {
  width: 100%; min-height: 44px; margin-top: var(--space-3); padding: 10px 16px;
  border: 0; border-radius: 999px; background: #8e2a3b; color: #fff;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.mini-usa:active { transform: scale(.97); }

/* lucine natalizie in cima e neve leggera */
.ghirlanda { position: absolute; top: var(--sicuro-alto); left: 0; right: 0; z-index: 2; pointer-events: none; }
.ghirlanda svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; overflow: visible; }
.lampadina ellipse { filter: drop-shadow(0 0 4px currentColor); animation: brilla-luce 2.2s ease-in-out var(--d) infinite; }
@keyframes brilla-luce { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.app { padding-top: calc(var(--space-7) + var(--sicuro-alto)); }

.neve { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fiocco-neve {
  position: absolute; top: -12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95), rgba(255,255,255,0) 70%);
  animation: cade-neve var(--t) linear var(--r) infinite;
}
@keyframes cade-neve {
  0% { transform: translate(0, 0); }
  50% { transform: translate(var(--oscilla), 55vh); }
  100% { transform: translate(0, 110vh); }
}
@media (prefers-reduced-motion: reduce) { .neve { display: none; } }

/* coupon usato: tasto per tornare indietro */
.mini-annulla {
  min-height: 44px; margin: var(--space-2) 0 0 auto; padding: 8px 14px;
  border: 1px solid rgba(251,239,230,.3); border-radius: 999px;
  background: transparent; color: var(--testo-soft); font-size: 14px; font-weight: 700; cursor: pointer;
}
