/* ==================================================================
   Nel frattempo — il mondo di carta (v2, mondo continuo)
   Palette provvisoria presa dallo storyboard (da chiudere con il
   lavoro su palette e tipografia).
   ================================================================== */
/* font self-hosted (assets/fonts, licenza SIL OFL) — tipografia «artigianale» 30/09 */
@font-face { font-family: "Shantell Sans"; font-weight: 800; font-display: swap; src: url(../fonts/shantell-sans-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Shantell Sans"; font-weight: 600; font-display: swap; src: url(../fonts/shantell-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Special Elite"; font-weight: 400; font-display: swap; src: url(../fonts/special-elite-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 600; font-display: swap; src: url(../fonts/caveat-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url(../fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url(../fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/instrument-sans-latin-400-italic.woff2) format("woff2"); }

:root {
  --mare: #2456a6;
  --mare-scuro: #1c3f7d;
  --onda: #86b2ea;
  --carta: #fbfcfe;
  --carta-ombra: #c9d3e3;
  --inchiostro: #1c2a44;
  --blu: #2456a6;
  --blu-scuro: #1c3f7d;
  --rosa: #c2416b;
  --giallo: #ffd666;
  --sabbia: #e9dcb5;
  --display: "Shantell Sans", "Avenir Next", system-ui, sans-serif;
  --mano: "Caveat", "Bradley Hand", cursive;
  --testo: "Instrument Sans", "Helvetica Neue", system-ui, sans-serif;
  --u: 1.56px;   /* impostata da mondo.js */
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--mare); overflow: hidden; }
body { font: 18px/1.42 var(--testo); color: #fff; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; }

#palco { position: fixed; inset: 0; overflow: hidden; touch-action: manipulation; background: var(--mare);
  user-select: none; -webkit-user-select: none; cursor: pointer; }
#palco.fermo { cursor: default; }

/* ---------- il mondo: una sola mappa, la telecamera la sposta ---------- */
.mondo { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.mondo.in-moto { will-change: transform; }
.mondo * { pointer-events: none; }
.mondo .toccabile, .mondo .toccabile * { pointer-events: auto; }

.segni { position: absolute; pointer-events: none; overflow: visible; transition: opacity 2.4s ease; }
.mare-vuoto .segni { opacity: 0; }
.segni path { fill: none; stroke: var(--onda); stroke-width: 1.3; stroke-linecap: round; opacity: .38; }
.segni .gruppo { animation: deriva 7s ease-in-out infinite; }
.segni .g1 { animation-duration: 9s; animation-delay: -3s; }
.segni .g2 { animation-duration: 11s; animation-delay: -6s; opacity: .7; }
@keyframes deriva { 50% { transform: translate(6px, 1.5px); } }
.calma .segni .gruppo { animation-duration: 24s; }

.tracce { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 1; }
.tracce path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  transition: opacity 1.2s ease; }
.tracce .linea { stroke: rgba(255,255,255,.9); stroke-width: 2px; stroke-dasharray: 2 7; }
.tracce .linea.sbiadita { opacity: .28; }
.tracce .linea.nascosto { opacity: 0; }
.tracce .rotta { stroke: var(--carta); stroke-width: 2.5px; stroke-dasharray: 9 6; }
.tracce .scia { opacity: .7; }

/* ---------- oggetti della mappa ---------- */
.ogg { position: absolute; transition: opacity .9s ease, filter 1.2s ease, left 1.6s ease, top 1.6s ease, translate 2.4s cubic-bezier(.2,.7,.3,1); }
.ogg .figura > img, .ogg .figura > .ph { display: block; width: 100%; }
.ogg.specchia .figura { transform: scaleX(-1); }
.ogg.nascosto { opacity: 0; pointer-events: none; }
.ogg.sorge { animation: sorge .9s cubic-bezier(.2,1.3,.4,1) both; transform-origin: 50% 100%; }
@keyframes sorge { from { transform: scaleY(.05) scaleX(.85); opacity: 0; } 30% { opacity: 1; } }

.ogg.t-bottiglia .figura { animation: galleggia 3.2s ease-in-out infinite; transform-origin: 50% 70%; }
.ogg.t-bottiglia:nth-of-type(2n) .figura { animation-duration: 3.8s; animation-delay: -1.2s; }
@keyframes galleggia { 0%,100% { transform: rotate(-58deg); } 50% { transform: translateY(1px) rotate(-66deg); } }
.ogg.t-bottiglia.aperta { opacity: .45; }
.ogg.t-barchetta .figura { animation: dondola 3.4s ease-in-out infinite; transform-origin: 50% 80%; }
.ogg.t-barchetta.specchia .figura { animation-name: dondola-s; }
@keyframes dondola { 0%,100% { transform: rotate(-3deg); } 50% { transform: translateY(-.8px) rotate(3deg); } }
@keyframes dondola-s { 0%,100% { transform: scaleX(-1) rotate(-3deg); } 50% { transform: scaleX(-1) translateY(-.8px) rotate(3deg); } }

.toccabile { pointer-events: auto; cursor: pointer; }
.toccabile::after { content: ""; position: absolute; inset: -10px; } /* area di tocco più grande */
.ogg.toccabile .figura, .ogg.t-forziere.toccabile .tela { filter: drop-shadow(0 0 3px var(--giallo)); animation-name: galleggia, invito; animation-duration: 3.2s, 1.6s; animation-iteration-count: infinite; }
.ogg.t-forziere.toccabile .tela { animation: invito 1.6s ease-in-out infinite; }
@keyframes invito { 50% { filter: drop-shadow(0 0 6px var(--giallo)); } }

.ogg.lampeggia .figura { animation: pulsa 1.3s ease-in-out infinite; transform-origin: 50% 96%; }
@keyframes pulsa { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--giallo)); }
  50% { transform: scale(1.35); filter: drop-shadow(0 0 10px var(--giallo)) drop-shadow(0 0 4px #fff); } }
@keyframes lampeggia { 50% { filter: drop-shadow(0 0 7px var(--giallo)); } }

/* nebbia: sull'oggetto e a banchi */
.ogg .nube { position: absolute; left: -35%; right: -35%; top: -45%; bottom: -25%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(219,231,247,.95), rgba(219,231,247,.6) 55%, rgba(219,231,247,0));
  filter: blur(4px); opacity: 0; transition: opacity 1.6s ease; pointer-events: none; }
.ogg.in-nebbia .nube { opacity: 1; animation: respira 7s ease-in-out infinite; }
.ogg.in-nebbia .figura { filter: blur(1.5px); opacity: .55; }
.ogg .figura { transition: filter 1.4s ease, opacity 1.4s ease; }
.ogg.t-nebbia { border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(219,231,247,.8), rgba(219,231,247,.35) 60%, rgba(219,231,247,0));
  filter: blur(6px); animation: respira 8s ease-in-out infinite; }
@keyframes respira { 50% { opacity: .7; transform: translateX(3%); } }
.ogg.t-nebbia.nascosto { opacity: 0; animation: none; }

/* lanterna */
.ogg .alone { position: absolute; left: 50%; top: 55%; width: 250%; aspect-ratio: 1; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,214,102,.8), rgba(255,214,102,.3) 40%, rgba(255,214,102,0));
  opacity: 0; transition: opacity 1.4s ease; }
.ogg.accesa .alone { opacity: 1; animation: lampeggia 2.4s ease-in-out infinite; }

/* etichette A e B: come una bandierina di carta sopra l'oggetto */
.lettera { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -3px);
  background: var(--carta); color: var(--blu); font: 800 11px/1 var(--display);
  padding: 2px 4px 1px; border-radius: 2px; box-shadow: 1px 1px 0 rgba(0,0,0,.2); }
.t-faro .lettera { left: 105%; bottom: 55%; transform: none; }

/* cartello del bivio (fatto in codice) */
.ogg.t-cartello { display: grid; justify-items: center; transform: translate(-50%, -100%); }
.ogg.t-cartello.sorge { animation-name: sorge-cartello; }
@keyframes sorge-cartello { from { transform: translate(-50%, -100%) scaleY(.05); opacity: 0; } to { transform: translate(-50%, -100%); } }
.t-cartello .tabella { background: var(--carta); color: var(--blu); font: 800 8px/1 var(--display);
  padding: 3px 5px; white-space: nowrap; box-shadow: 1px 1px 0 rgba(0,0,0,.2); }
.t-cartello .palo { width: 2px; height: 16px; background: var(--carta); }

/* forziere: chiuso e aperto sulla stessa tela, stessa base */
.t-forziere .tela { position: relative; width: 100%; aspect-ratio: var(--r-inv); }
.t-forziere .tela > * { position: absolute; left: 0; bottom: 0; width: 100%; transition: opacity .25s ease; }
.t-forziere .tela > .aperto { opacity: 0; }
.t-forziere.aperto .tela > .aperto { opacity: 1; }
.t-forziere.aperto .tela > .chiuso { opacity: 0; }
.t-forziere.aperto .tela { animation: sobbalza .5s ease; }
@keyframes sobbalza { 40% { transform: translateY(-2px) scale(1.04); } }
.x-tesoro { position: absolute; left: 60%; top: 40%; font: 800 13px/1 var(--display); color: var(--rosa); }

/* polaroid del forziere */
.polaroid { position: absolute; width: 30px; background: var(--carta); padding: 2px 2px 7px;
  box-shadow: 1.5px 1.5px 0 rgba(0,0,0,.2); transform: translate(-50%, -50%) scale(.2); opacity: 0;
  transition: left .8s cubic-bezier(.2,1.3,.4,1), top .8s cubic-bezier(.2,1.3,.4,1), transform .8s cubic-bezier(.2,1.3,.4,1), opacity .3s ease; }
.polaroid.fuori { opacity: 1; }
.polaroid img, .polaroid .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.polaroid .ph { border: 1px dashed #9fb3d4; color: var(--blu); background: #e8eef8; font: 700 3.6px/1.15 var(--testo);
  display: grid; place-items: center; text-align: center; letter-spacing: .04em; }

/* navi che risalgono la linea dritta */
.nave-sfila .cartello { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%);
  background: #fff; color: var(--blu); border: 1px solid var(--blu); white-space: nowrap;
  font: 800 7.5px/1.2 var(--display); padding: 1px 3px; }
.nave-sfila .cartello s { text-decoration-color: var(--rosa); text-decoration-thickness: 1.5px; }

/* gabbiano che vola via (V08) */
.volo { position: absolute; width: 18px; z-index: 3000; transition: left 3s ease-in, top 3s ease-in, opacity 3s ease-in; }
.volo img, .volo .ph { display: block; width: 100%; }
.volo.via { opacity: .15; }

/* segnaposto per gli asset che non esistono ancora */
.ph { aspect-ratio: var(--r-inv, 1); border: 1px dashed rgba(255,255,255,.85);
  background: rgba(255,255,255,.14); border-radius: 2px; display: grid; place-items: center;
  font: 700 5px/1.1 var(--testo); letter-spacing: .06em; text-transform: uppercase;
  color: #fff; text-align: center; padding: 1px; overflow: hidden; }

/* ---------- la barchetta ---------- */
.barca { position: absolute; left: 0; top: 0; }
.b-modo { transition: transform .9s ease; transform-origin: 50% 80%; }
.barca.vira .b-modo { transform: rotate(-9deg) translateY(-4px); }
.barca.salta .b-modo { animation: salto 2.6s ease-in-out infinite; }
@keyframes salto { 0%,55%,100% { transform: none; } 70% { transform: translateY(-7px) rotate(-7deg); } 85% { transform: translateY(0) rotate(4deg); } }
.b-dondolo { position: relative; animation: dondola 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.barca.calma .b-dondolo { animation-duration: 6s; }
.barca.naviga .b-dondolo { animation-duration: 1.3s; }
.b-verso { position: relative; transition: transform .45s ease; }
.b-verso > .scafo { display: block; width: 100%; }
.barca .foglio { display: none; }
.barca.foglio .foglio { display: block; position: absolute; left: -15%; width: 130%; bottom: -8%; }
.barca.foglio .scafo { visibility: hidden; }
.barca.foglio .b-dondolo { animation-duration: 5s; }
.barca.piega .scafo { animation: piega 900ms cubic-bezier(.3,1.3,.5,1) both; }
@keyframes piega { from { transform: scale(1.5, .3) rotate(-6deg); opacity: .2; } }
.b-sopra { position: absolute; inset: 0; pointer-events: none; }
.posato { position: absolute; width: 32%; transform: translate(-45%, -96%); }
.posato img, .posato .ph { display: block; width: 100%; }
.b-extra { position: absolute; inset: 0; pointer-events: none; }
.zzz { position: absolute; left: 20%; top: -62%; font: 600 7px var(--testo); animation: zzz 2.2s ease-in-out infinite; }
@keyframes zzz { 50% { transform: translateY(-3px); opacity: .6; } }
.ancora { position: absolute; left: 50%; top: 62%; width: 9px; height: 30px; transform: translateX(-50%); animation: cala 1.2s ease-out both; }
@keyframes cala { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.souvenir-foto { position: absolute; display: flex; gap: 1px; left: 58%; top: 16%; }
.souvenir-foto i { width: 5px; height: 6px; background: #8fb3e0; border: 1px solid var(--carta); border-bottom-width: 2px; }
.souvenir-foto i:nth-child(2) { transform: translateY(-1px) rotate(6deg); }
.souvenir-foto.cade i { animation: cade 900ms cubic-bezier(.4,0,.6,1.4) both; }
.souvenir-foto.cade i:nth-child(2) { animation-delay: .5s; }
.souvenir-foto.cade i:nth-child(3) { animation-delay: 1s; }
@keyframes cade { from { transform: translateY(-80px) rotate(40deg); opacity: 0; } }
.souvenir-rotolo { position: absolute; left: 22%; top: 30%; width: 9px; height: 4px; border-radius: 2px;
  background: var(--carta); box-shadow: inset -1.5px 0 0 var(--carta-ombra); animation: cade 900ms ease both; }

/* ---------- cielo: tinte sul posto ---------- */
.tinta { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.8s ease, background 1.8s ease; }
.tinta { mix-blend-mode: soft-light; }
[data-cielo="tramonto"] .tinta { opacity: 1; background: linear-gradient(to bottom, rgba(255,120,60,.95), rgba(255,140,90,.7) 50%, rgba(255,110,80,.45)); }
[data-cielo="alba"] .tinta { opacity: 1; background: linear-gradient(to bottom, rgba(255,200,120,.9), rgba(255,170,170,.55) 55%, rgba(255,200,140,.2)); }

/* ---------- rewind ---------- */
.rewind-segno { position: absolute; left: 16px; top: max(14px, env(safe-area-inset-top)); z-index: 12;
  font: 800 26px/1 var(--display); letter-spacing: -.1em; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.rewind .rewind-segno { opacity: .95; animation: rw .5s steps(2) infinite; }
@keyframes rw { 50% { opacity: .4; } }
.rewind .mondo { filter: saturate(.55) contrast(1.08); }
.rewind::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 11;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.05) 0 2px, transparent 2px 5px); }
.rewind .segni .gruppo { animation-direction: reverse; animation-duration: 1.2s; }

/* ---------- sopra il mondo (effetti a schermo) ---------- */
.sopra { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.striscione { position: absolute; left: 50%; width: min(78vw, 360px); transform: translateX(-50%);
  animation: striscione-entra 2.4s cubic-bezier(.3,.7,.3,1) both; }
@keyframes striscione-entra { from { transform: translate(60%, 20%); opacity: 0; } }
.striscione .telo { margin-top: 6px; background: var(--carta); color: var(--blu); text-align: center;
  font: 800 clamp(24px, 8vw, 34px)/1 var(--display); padding: 14px 0;
  clip-path: polygon(0 4%, 100% 0, 97% 100%, 2% 96%); animation: sventola 2.8s ease-in-out infinite; }
@keyframes sventola { 50% { transform: skewY(-1.5deg); } }
.striscione .gabbiani { display: flex; justify-content: space-between; }
.striscione .gabbiani img, .striscione .gabbiani .ph { width: 44px; font-size: 9px; }
.passa-sopra { position: absolute; width: 44px; animation: passa-sopra 6s linear infinite; }
.passa-sopra img, .passa-sopra .ph { display: block; width: 100%; font-size: 9px; }
@keyframes passa-sopra { from { left: -60px; } to { left: calc(100% + 60px); } }

/* ---------- testo: in basso, sopra un velo ---------- */
.velo { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; pointer-events: none;
  background: linear-gradient(to bottom, rgba(28,63,125,0), rgba(28,63,125,.72) 90px, rgba(28,63,125,.82));
  transition: top .5s ease; }
.ui { position: absolute; z-index: 10; left: 50%; transform: translateX(-50%); width: min(100%, 480px);
  top: 0; bottom: 0; display: flex; flex-direction: column; pointer-events: none;
  padding: max(10px, env(safe-area-inset-top)) 22px max(22px, calc(env(safe-area-inset-bottom) + 12px)); }
.testo { margin-top: auto; flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none;
  pointer-events: none; padding: 0 6px 6px; margin-left: -6px; margin-right: -6px; }
.testo::-webkit-scrollbar { display: none; }
.bottoni { flex: none; display: grid; gap: 10px; margin-top: 12px; }
.bottoni:empty { display: none; }

/* le quattro voci. Ognuna entra a modo suo. */
.riga { margin: 0 0 .5em; opacity: 0; text-wrap: pretty; animation: entra-normale 650ms ease forwards; }
.riga.v-normale { font: 400 19px/1.38 var(--testo); }
.riga.v-sussurro { font: italic 400 15px/1.4 var(--testo); color: rgba(255,255,255,.86); animation-name: entra-sussurro; animation-duration: 1100ms; }
.riga.v-grido { font: 800 clamp(36px, 11vw, 48px)/1 var(--display); letter-spacing: -.01em; margin: .15em 0 .3em;
  animation-name: entra-grido; animation-duration: 560ms; animation-timing-function: cubic-bezier(.2,1.5,.4,1); transform-origin: 0 80%; }
.riga.v-etichetta { font: 800 12px/1 var(--display); letter-spacing: .2em; margin-bottom: .9em; animation-name: entra-etichetta; animation-duration: 800ms; }
.riga b { font-weight: 600; }
.riga s { text-decoration-color: var(--giallo); text-decoration-thickness: 2px; }
@keyframes entra-normale { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes entra-sussurro { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
@keyframes entra-grido { from { opacity: 0; transform: scale(1.25) rotate(-3deg); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes entra-etichetta { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; letter-spacing: .2em; } }
.testo.tutto .riga, .testo.tutto .dopo { animation-delay: 0s !important; animation-duration: 1ms !important; }
.dopo { opacity: 0; animation: entra-normale 600ms ease forwards; pointer-events: auto; }

/* segnaposto testo: SEMPRE visibile */
.riga.segnaposto { color: var(--giallo); font-style: italic; font-size: 16px; border: 1.5px dashed var(--giallo);
  padding: 6px 8px; border-radius: 4px; }
.riga.segnaposto::before { content: "DA SCRIVERE"; display: block; font: 800 10px/1.4 var(--display);
  letter-spacing: .14em; font-style: normal; }
/* in bozza: evidenziazioni come nello storyboard */
.bozza .riga.rivedere { box-shadow: inset 0 -3px var(--giallo); }
.bozza .riga.proposta { outline: 1.5px dashed #ffb3c7; outline-offset: 3px; border-radius: 2px; }

/* ciclo Fai → Fermati → Racconta */
.ciclo { display: flex; gap: 8px; margin-top: 12px; }
.ciclo span { font: 800 11px/1 var(--display); letter-spacing: .12em; border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 999px; padding: 6px 10px; opacity: .5; }
.ciclo span.on { opacity: 1; background: #fff; color: var(--blu); border-color: #fff; }

/* ---------- bottoni ---------- */
.btn { display: block; width: 100%; border: 0; background: #fff; color: var(--blu-scuro);
  font: 600 16px/1.2 var(--testo); padding: 14px 16px; border-radius: 8px; cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,.25); pointer-events: auto; transition: transform 120ms ease; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.btn:focus-visible, .toccabile:focus-visible, a:focus-visible { outline: 3px solid var(--giallo); outline-offset: 3px; }
.btn.fantasma { background: transparent; box-shadow: none; color: inherit; text-decoration: underline; font-weight: 400; padding: 8px; }
.btn[disabled] { opacity: .6; }
.coppia { display: flex; gap: 10px; margin-top: 14px; }
.coppia .btn { flex: 1; }

.suggerimento { position: absolute; z-index: 10; left: 0; right: 0; bottom: max(8px, env(safe-area-inset-bottom));
  text-align: center; font-size: 13px; opacity: 0; transition: opacity .6s ease; pointer-events: none; color: rgba(255,255,255,.8); }
.suggerimento.on { opacity: 1; }

/* ---------- carte (bottiglie, missione) ---------- */
.carta { position: relative; background: var(--carta); color: var(--inchiostro); border-radius: 6px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.22); padding: 16px 18px; margin-top: 14px; font: 16px/1.4 var(--testo);
  animation: srotola 700ms cubic-bezier(.2,.9,.3,1.1) both; pointer-events: auto; }
@keyframes srotola { from { clip-path: inset(0 0 100% 0); transform: translateY(-10px); } to { clip-path: inset(-40px); } }
.carta .k { font: 800 11px/1.2 var(--display); letter-spacing: .14em; color: var(--blu); }
.carta .t { font: 800 21px/1.12 var(--display); margin: 4px 0 10px; }
.carta p { margin: 0 0 8px; }
.carta .n { font-size: 12px; color: #5a6680; }
.carta .scheda { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 14px;
  border-top: 1px dashed #b8c4da; padding-top: 8px; margin-top: 10px; }
.carta .scheda b { font-weight: 600; }
.timbro { position: absolute; right: 14px; bottom: -14px; transform: rotate(-12deg) scale(2); opacity: 0;
  border: 3px solid var(--rosa); color: var(--rosa); background: rgba(251,252,254,.92); border-radius: 4px;
  font: 800 14px/1 var(--display); letter-spacing: .12em; padding: 5px 9px; transition: transform 260ms cubic-bezier(.3,1.6,.5,1), opacity 160ms; }
.timbrata .timbro { opacity: 1; transform: rotate(-12deg) scale(1); }
.carta.arrotola { animation: arrotola 900ms ease-in forwards; }
@keyframes arrotola { to { transform: translateY(-30vh) scale(.08); opacity: 0; } }

/* ---------- form ---------- */
.foglio-form { background: var(--carta); color: var(--inchiostro); border-radius: 6px; padding: 18px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.22); display: grid; gap: 12px; pointer-events: auto; user-select: text; -webkit-user-select: text;
  animation: srotola 700ms ease both; cursor: auto; }
.foglio-form h2 { margin: 0; font: 800 23px/1.1 var(--display); color: var(--inchiostro); }
.foglio-form label.campo { display: grid; gap: 4px; font-size: 14px; color: #3d4a63; }
.foglio-form input[type=text], .foglio-form input[type=email] { font: 17px var(--testo); padding: 12px; border-radius: 6px;
  border: 1.5px solid #b8c4da; background: #fff; color: var(--inchiostro); width: 100%; }
.foglio-form input:focus { outline: 3px solid var(--giallo); border-color: var(--blu); }
.foglio-form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; }
.foglio-form .check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--blu); }
.foglio-form .check em { color: #7a869c; }
.foglio-form a { color: var(--blu); }
.foglio-form .errore { color: var(--rosa); font-size: 14px; min-height: 1.2em; margin: 0; }
.foglio-form .btn { background: var(--blu); color: #fff; }
.foglio-form .btn.fantasma { background: none; color: var(--blu-scuro); }
.foglio-form .no-posto { display: flex; justify-content: center; }
.foglio-form .no-posto .btn { width: auto; transition: transform .35s cubic-bezier(.2,1.6,.4,1); }
.foglio-form .nota-bottone { margin: 0; font-size: 14px; color: #3d4a63; opacity: 1; animation: none; }
.foglio-form .riga.segnaposto { color: #7a5413; border-color: #b7791f; background: #fff8e1; }
.miele { position: absolute; left: -9999px; }

.link-ig { display: inline-block; margin-top: 4px; color: #fff; font: 800 20px var(--display); pointer-events: auto; }

/* ---------- bozza ---------- */
.bozza-id { position: fixed; z-index: 20; right: 8px; top: max(8px, env(safe-area-inset-top)); font: 700 11px/1 var(--testo);
  background: rgba(0,0,0,.45); color: #fff; padding: 5px 7px; border-radius: 4px; display: none; pointer-events: none; }
.bozza .bozza-id { display: block; }
.mappa-bozza .ui, .mappa-bozza .velo, .mappa-bozza .suggerimento { opacity: 0; pointer-events: none; }
.etichette-luoghi span { position: absolute; transform: translate(-50%, 4px); z-index: 4000;
  font: 700 7px/1 var(--testo); color: var(--giallo); background: rgba(0,0,0,.45); padding: 1px 2px; border-radius: 2px; white-space: nowrap; }

noscript p { position: fixed; inset: auto 20px 40% 20px; z-index: 30; }

@media (prefers-reduced-motion: reduce) {
  .segni .gruppo, .b-dondolo, .ogg .figura, .ogg.t-nebbia, .zzz, .passa-sopra, .barca.salta .b-modo { animation: none !important; }
  .ogg.sorge { animation-duration: 1ms; }
  .rewind::after { display: none; }
}


/* ==================================================================
   v2.1 (29/09 sera) — feedback di Mat
   ================================================================== */

/* navi che si muovono piano lungo la linea */
.ogg.deriva { animation: deriva-ogg 11s ease-in-out infinite alternate; }
@keyframes deriva-ogg { from { transform: translate(calc(var(--ddx) * -1), calc(var(--ddy) * -1)); } to { transform: translate(var(--ddx), var(--ddy)); } }

/* anello d'acqua quando qualcosa spunta */
.anello { position: absolute; left: 50%; bottom: 4%; width: 120%; height: 26%; border: 1.5px solid rgba(255,255,255,.9);
  border-radius: 50%; transform: translate(-50%, 50%) scale(.2); opacity: 0; animation: anello 1.4s ease-out both; pointer-events: none; }
@keyframes anello { 0% { opacity: .9; transform: translate(-50%, 50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, 50%) scale(1.5); } }

/* struttura Marketers: bandierina con il logo vero */
.bandierina { position: absolute; left: 78%; bottom: 84%; width: 30%; }
.bandierina .asta { position: absolute; left: 0; bottom: 0; width: 1.5px; height: 150%; background: var(--carta); }
.telo-logo { position: relative; margin-left: 1.5px; width: 100%; aspect-ratio: 3 / 2; background: var(--carta);
  display: grid; place-items: center; padding: 2px; box-shadow: 1px 1px 0 rgba(0,0,0,.2); transform-origin: 0 50%;
  animation: sventola 2.8s ease-in-out infinite; }
.telo-logo img { max-width: 100%; max-height: 100%; }
.telo-logo.vuoto { font: 800 5px/1 var(--display); color: var(--blu); border: 1px dashed var(--blu); }

/* lo spazio tra A e B */
.tracce .zona { fill: rgba(255,214,102,0); stroke: none; transition: fill 2.2s ease; }
.tracce .zona.on { fill: rgba(255,244,214,.3); }
.tracce .stelle path { fill: var(--giallo); opacity: 0; animation: stella 2.6s ease-in-out infinite; }
@keyframes stella { 0%,100% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1); } }
.tracce .sentiero { stroke: var(--giallo); stroke-width: 3px; stroke-dasharray: 2 8; opacity: 0; filter: drop-shadow(0 0 3px var(--giallo)); }
.tracce .sentiero.on { animation: sentiero 2.6s ease forwards 700ms; }
@keyframes sentiero { from { opacity: 0; stroke-dashoffset: 60; } to { opacity: .95; stroke-dashoffset: 0; } }

/* iride da titoli di coda */
@property --ir { syntax: "<length>"; inherits: false; initial-value: 1400px; }
.iride { position: absolute; inset: 0; z-index: 7; pointer-events: none; --ir: 1400px;
  background: radial-gradient(circle at var(--ix, 50%) var(--iy, 40%), transparent var(--ir), #0b1a36 calc(var(--ir) + 1.5px));
  transition: --ir 1.6s cubic-bezier(.6,0,.3,1); }
.iride.chiusa { --ir: 88px; }

/* le tre boe di Fai → Fermati → Racconta */
.boe { position: absolute; z-index: 9; left: 50%; top: max(44px, calc(env(safe-area-inset-top) + 34px)); width: min(88vw, 400px);
  transform: translate(-50%, -12px); display: grid; grid-template-columns: repeat(3, 1fr); opacity: 0; pointer-events: none;
  transition: opacity .6s ease, transform .6s ease; --k: 0; }
.boe.on { opacity: 1; transform: translate(-50%, 0); }
.boe-filo { position: absolute; left: 16.6%; right: 16.6%; top: 17px; border-top: 2px dashed rgba(255,255,255,.6); }
.boa { position: relative; display: grid; justify-items: center; gap: 6px; }
.boa .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--mare-scuro);
  border: 2px solid rgba(255,255,255,.55); font: 800 13px/1 var(--display); color: rgba(255,255,255,.7);
  transition: all .5s cubic-bezier(.2,1.5,.4,1); }
.boa .nome { font: 800 11px/1 var(--display); letter-spacing: .14em; opacity: .55; transition: opacity .4s ease, transform .4s ease; }
.boa.fatta .num { background: #fff; color: var(--blu); border-color: #fff; }
.boa.attiva .num { transform: scale(1.35); background: var(--giallo); color: var(--inchiostro); border-color: var(--giallo);
  box-shadow: 0 0 0 6px rgba(255,214,102,.25); }
.boa.attiva .nome { opacity: 1; transform: translateY(4px) scale(1.15); }
.boe-barca { position: absolute; top: -26px; width: 34px; left: calc(16.6% + var(--k) * 33.3%);
  transform: translateX(-50%); transition: left 1.1s cubic-bezier(.5,0,.3,1); animation: dondola 2.4s ease-in-out infinite; }
.boe-barca img, .boe-barca .ph { display: block; width: 100%; }

/* polaroid a schermo */
.album { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.album .polaroid { position: absolute; width: 120px; background: var(--carta); padding: 6px 6px 20px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.22); transform: translate(-50%, -50%) scale(.15); opacity: 0;
  transition: left .85s cubic-bezier(.2,1.25,.4,1), top .85s cubic-bezier(.2,1.25,.4,1), transform .85s cubic-bezier(.2,1.25,.4,1), opacity .3s ease; }
.album .polaroid.fuori { opacity: 1; }
.album .polaroid img, .album .polaroid .ph { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.album .polaroid .ph { border: 1.5px dashed #9fb3d4; color: var(--blu); background: #e8eef8; font: 700 10px/1.2 var(--testo);
  display: grid; place-items: center; text-align: center; padding: 4px; }

/* ---------- tipografia: più movimento ---------- */
.riga.a-parole { opacity: 1; animation: none; }
.riga .w { display: inline-block; opacity: 0; animation: parola 480ms cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes parola { from { opacity: 0; transform: translateY(9px) rotate(2deg); } to { opacity: 1; transform: none; } }
.testo.tutto .riga .w, .testo.tutto .riga em, .testo.tutto .riga .l { animation-delay: 0s !important; animation-duration: 1ms !important; }
.riga em { font-style: normal; font-weight: 600; background: linear-gradient(transparent 58%, rgba(255,214,102,.7) 58%, rgba(255,214,102,.7) 92%, transparent 92%) no-repeat 0 0 / 0% 100%;
  animation: evidenzia .7s ease forwards; }
.riga em .w { animation-name: parola; }
@keyframes evidenzia { to { background-size: 100% 100%; } }
.riga strong.nome { font: 800 1.7em/1 var(--display); display: inline-block; letter-spacing: -.01em; }
.riga strong.nome .w { color: #fff; }

.riga.v-tappa { white-space: nowrap; font: 800 clamp(30px, 9.4vw, 44px)/.95 var(--display); letter-spacing: -.01em; margin: 0 0 .25em;
  animation-name: entra-tappa; animation-duration: 700ms; animation-timing-function: cubic-bezier(.2,1.2,.3,1); }
@keyframes entra-tappa { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

.riga.v-titoli { font: 800 clamp(40px, 13vw, 56px)/1 var(--display); letter-spacing: .28em; text-transform: uppercase; text-align: center;
  padding: .2em 0 .15em .28em; margin: .1em 0 0; border-top: 2px solid rgba(255,255,255,.85); border-bottom: 2px solid rgba(255,255,255,.85);
  animation: entra-titoli 1.6s steps(1) forwards, pellicola .12s steps(2) 1.6s 8; }
@keyframes entra-titoli { 0% { opacity: 0; } 20% { opacity: .6; } 30% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 1; } }
@keyframes pellicola { 50% { transform: translate(1px, -1px); opacity: .88; } }

.riga.v-sbadiglio { font: 800 clamp(36px, 11vw, 48px)/1 var(--display); opacity: 1; animation: none; }
.riga.v-sbadiglio .pl { display: inline-block; white-space: nowrap; }
.riga.v-sbadiglio .l { display: inline-block; white-space: pre; opacity: 0; animation: lettera .35s ease forwards, affloscia 1.6s ease-in-out forwards; }
@keyframes lettera { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; } }
@keyframes affloscia { to { opacity: 1; transform: translateY(var(--giu)) rotate(var(--rot)); } }

/* condizioni a tocchi (V24): cartelli di carta */
.riga.v-cartello { display: table; background: var(--carta); color: var(--blu-scuro); font: 600 16px/1.3 var(--testo);
  padding: 8px 12px; border-radius: 3px; box-shadow: 3px 3px 0 rgba(0,0,0,.2); margin: 0 0 8px; }
.riga.v-cartello:nth-of-type(odd) { transform: rotate(-1.2deg); }
.riga.v-cartello:nth-of-type(even) { transform: rotate(1deg); margin-left: 14px; }
.riga.attesa { opacity: 0 !important; animation: none !important; }
.riga.svela { animation: cartello-su .5s cubic-bezier(.2,1.4,.4,1) forwards !important; animation-delay: 0s !important; }
@keyframes cartello-su { from { opacity: 0; translate: -30px 0; } to { opacity: 1; translate: 0 0; } }

/* striscione: lettere a timbro */
.striscione .telo span { display: inline-block; opacity: 0; animation: timbro-l .32s cubic-bezier(.2,1.8,.4,1) forwards; }
@keyframes timbro-l { from { opacity: 0; transform: scale(2.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
.striscione { animation-duration: 1.4s; }


/* ==================================================================
   v3 (30/09) — giro 3 di Mat: tipografia artigianale e tre regole
   1. parole del mondo  2. momento wow  3. elenchi a strisce di carta
   ================================================================== */

/* avvio: niente transizioni al primo disegno (niente porto in trasparenza su V01) */
.avvio *, .avvio *::before, .avvio *::after { transition: none !important; }

/* V01: più impatto */
[data-id="V01"] .riga.v-grido { font-size: clamp(44px, 14vw, 60px); }
.btn { font: 800 18px/1.1 var(--display); border-radius: 4px; transform: rotate(-.6deg); }
.btn:active { transform: translate(2px, 2px) rotate(-.6deg); }
[data-id="V01"] .btn { font-size: 22px; padding: 17px 16px; animation-name: entra-normale, respiro; animation-duration: 600ms, 2.4s;
  animation-iteration-count: 1, infinite; animation-delay: inherit, 3s; }
@keyframes respiro { 50% { box-shadow: 3px 3px 0 rgba(0,0,0,.25), 0 0 0 7px rgba(255,255,255,.18); } }
.btn .ico { display: inline-block; margin-right: .45em; letter-spacing: -.12em; }
.foglio-form .btn { transform: none; }
.coppia .btn:nth-child(2) { transform: rotate(.7deg); }

/* suggerimento: sulle prime schermate è un mini tutorial che pulsa */
.suggerimento.tutorial { font: 800 16px/1 var(--display); color: #fff; bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px)); }
.suggerimento.tutorial.on { animation: pulsa-sugg 1.5s ease-in-out infinite; }
.suggerimento.tutorial span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #fff; margin-right: 8px; vertical-align: -1px; animation: tocco 1.5s ease-out infinite; }
@keyframes pulsa-sugg { 50% { opacity: .45; } }
@keyframes tocco { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }

/* 1 · PAROLE DEL MONDO: A, B, Nel frattempo, Village hanno l'aspetto delle etichette sulla mappa */
.luogo { display: inline-block; background: var(--carta); color: var(--blu); font: 800 1.05em/1 var(--display);
  padding: .14em .32em .1em; border-radius: 3px; box-shadow: 2px 2px 0 rgba(0,0,0,.22); transform: rotate(-2deg);
  margin: 0 .08em; opacity: 0; animation: timbro-luogo .45s cubic-bezier(.2,1.7,.4,1) forwards; }
.luogo .w { color: var(--blu); }
@keyframes timbro-luogo { from { opacity: 0; transform: scale(2) rotate(-10deg); } to { opacity: 1; transform: rotate(-2deg); } }
.v-grido .luogo, .v-colpo .luogo { padding: .08em .22em .04em; }
.testo.tutto .luogo, .testo.tutto s { animation-delay: 0s !important; animation-duration: 1ms !important; }
/* etichette sulla mappa: più grandi, e «chiamano» quando il testo le nomina */
.lettera { font-size: 14px; padding: 3px 5px 2px; transform: translate(-50%, -3px) rotate(-3deg); transition: transform .4s cubic-bezier(.2,1.6,.4,1); }
.t-faro .lettera { transform: rotate(3deg); }
.ogg.chiama .lettera { animation: chiama 1.3s ease-in-out infinite; box-shadow: 1px 1px 0 rgba(0,0,0,.2), 0 0 0 3px rgba(255,214,102,.8); }
@keyframes chiama { 50% { scale: 1.35; } }

/* 2 · MOMENTO WOW: il mondo si abbassa, il testo diventa grande, una riga per tocco */
#palco::before { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(120% 80% at 50% 38%, rgba(11,26,54,0) 30%, rgba(11,26,54,.6) 100%); }
#palco.wow::before { opacity: 1; }
.wow .velo { background: linear-gradient(to bottom, rgba(11,26,54,0), rgba(11,26,54,.82) 110px, rgba(11,26,54,.9)); }
.wow .riga.v-normale { font: 600 22px/1.25 var(--display); }
.riga.v-colpo { font: 800 clamp(30px, 9vw, 40px)/1.05 var(--display); letter-spacing: -.01em; margin: .1em 0 .2em;
  animation-name: entra-grido; animation-duration: 600ms; animation-timing-function: cubic-bezier(.2,1.5,.4,1); transform-origin: 0 80%; }
.riga.v-colpo.svela { animation: entra-grido .6s cubic-bezier(.2,1.5,.4,1) forwards !important; }
.riga.v-colpo em { font-weight: 800; }

/* 3 · ELENCHI: ogni voce è una striscia di carta che atterra */
.riga.v-striscia { display: table; background: var(--carta); color: var(--blu-scuro); font: 800 18px/1.2 var(--display);
  padding: 9px 13px 8px; border-radius: 3px; box-shadow: 3px 3px 0 rgba(0,0,0,.22); margin: 0 0 9px;
  transform: rotate(var(--storta, -1deg)); animation-name: atterra; animation-duration: .55s; animation-timing-function: cubic-bezier(.2,1.5,.4,1); }
.riga.v-striscia:nth-of-type(even) { margin-left: 12px; }
@keyframes atterra { from { opacity: 0; transform: translate(-26px, -10px) rotate(-8deg); } to { opacity: 1; transform: rotate(var(--storta, -1deg)); } }
.riga.v-striscia b { font-weight: 800; color: var(--rosa); }
.riga.v-cartello { font: 800 17px/1.25 var(--display); }
/* barrato disegnato a mano (funziona anche sopra le parole animate) */
.riga s { text-decoration: none; background: linear-gradient(var(--rosa), var(--rosa)) no-repeat 0 55% / 0% 3px;
  animation: barra .5s ease-out forwards; }
.v-normale s, .v-colpo s { background-image: linear-gradient(var(--giallo), var(--giallo)); }
@keyframes barra { to { background-size: 100% 3px; } }

/* V06: titoli di coda */
.iride.buio { --ir: -4px; transition-duration: 1.2s; }
.crediti { position: absolute; left: 0; right: 0; overflow: hidden; text-align: center;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.crediti .nastro { position: absolute; left: 0; right: 0; top: 100%; display: grid; gap: 18px; padding: 0 24px; }
.crediti.scorre .nastro { animation: crediti 7s linear forwards; }
@keyframes crediti { to { transform: translateY(calc(-100% - 100cqh)); } }
.crediti { container-type: size; }
.cr-riga { display: grid; gap: 3px; }
.cr-riga .ruolo { font: 400 12px/1 var(--testo); letter-spacing: .22em; text-transform: uppercase; opacity: .7; }
.cr-riga .chi { font: 800 22px/1.1 var(--display); }
.cr-titolo { font: 800 15px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; opacity: .8; margin-top: 10px; }

/* toccabili (bottiglie, forziere): anello che chiama */
.ogg.toccabile::before { content: ""; position: absolute; left: 50%; bottom: -6%; width: 170%; aspect-ratio: 2.6; border-radius: 50%;
  border: 1.5px solid var(--giallo); transform: translateX(-50%) scale(.4); opacity: 0; animation: chiamata 1.6s ease-out infinite; pointer-events: none; }
@keyframes chiamata { 0% { opacity: .95; transform: translateX(-50%) scale(.4); } 100% { opacity: 0; transform: translateX(-50%) scale(1.25); } }
.ogg.t-forziere.toccabile .tela { animation: invito 1.6s ease-in-out infinite, saltello 1.6s ease-in-out infinite; }
@keyframes saltello { 0%,60%,100% { transform: none; } 70% { transform: translateY(-3px) rotate(-3deg); } 80% { transform: translateY(0) rotate(2deg); } }

/* polaroid: didascalia scritta a mano */
.album .polaroid { padding-bottom: 6px; }
.polaroid .didascalia { font: 600 clamp(12px, 3.3vw, 15px)/.95 var(--mano); color: var(--inchiostro); text-align: center;
  padding: 6px 0 1px; min-height: 2.1em; display: grid; place-items: center; transform: rotate(-1.5deg); }

/* gabbiano che atterra sulla spalla della barca (V23b) */
.posato.atterra { animation: atterra-gabb 1.1s cubic-bezier(.2,.8,.3,1.2) both .5s; }
@keyframes atterra-gabb { from { opacity: 0; transform: translate(40%, -300%) rotate(20deg); } 60% { opacity: 1; } to { transform: translate(-45%, -96%); } }

/* struttura Marketers: si accende, lanterne che salgono */
.t-marketers .alone { position: absolute; left: 50%; top: 50%; width: 260%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255,214,102,.75), rgba(255,214,102,.25) 45%, rgba(255,214,102,0)); opacity: 0; transition: opacity 1.6s ease; }
.t-marketers.accesa .alone { opacity: 1; animation: lampeggia 2.6s ease-in-out infinite; }
.t-marketers.accesa .figura { filter: drop-shadow(0 0 4px rgba(255,214,102,.9)); }
.lanterne > div { position: absolute; width: 11%; left: 50%; bottom: 60%; opacity: 0; }
.lanterne img, .lanterne .ph { display: block; width: 100%; }
.t-marketers.accesa .lanterne > div { animation: sale 6s ease-in infinite; }
.lanterne .l0 { left: 20%; animation-delay: .8s !important; }
.lanterne .l1 { left: 44%; animation-delay: 2s !important; width: 9%; }
.lanterne .l2 { left: 66%; animation-delay: 3.1s !important; }
.lanterne .l3 { left: 32%; animation-delay: 4.3s !important; width: 8%; }
.lanterne .l4 { left: 78%; animation-delay: 5.2s !important; width: 9%; }
@keyframes sale { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -120px) rotate(6deg); } }

/* V28d: la stradina */
.tracce .deviazione { stroke: var(--giallo); stroke-width: 2.5px; stroke-dasharray: 3 6; opacity: 0; filter: drop-shadow(0 0 3px var(--giallo)); }
.tracce .deviazione.on { animation: sentiero 2.2s ease forwards 300ms; }
.souvenir-ricordo { position: absolute; left: 40%; top: 6%; width: 7px; height: 8px; background: var(--carta); border-bottom: 2px solid var(--carta);
  box-shadow: inset 0 -2px 0 var(--carta), inset 0 0 0 1px var(--carta); background-image: linear-gradient(#ffd666, #ffb36b); background-clip: content-box; padding: 1px 1px 2px; transform: rotate(-10deg); }
.souvenir-ricordo.cade { animation: cade 900ms cubic-bezier(.4,0,.6,1.4) both 2.3s; }

@media (prefers-reduced-motion: reduce) {
  .suggerimento.tutorial.on, .ogg.toccabile::before, .lanterne > div, .ogg.chiama .lettera { animation: none !important; }
}

.nb { white-space: nowrap; }
/* invito a toccare qualcosa nel mondo (bottiglie, forziere) */
.riga.v-invito { font: 800 22px/1.1 var(--display); color: var(--giallo); margin-top: .35em; animation: entra-normale 650ms ease forwards, pulsa-sugg 1.6s ease-in-out 1.4s infinite; }
.riga.v-invito::before { content: ""; display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--giallo);
  margin-right: 10px; vertical-align: 0; animation: tocco-g 1.5s ease-out infinite; }
@keyframes tocco-g { 0% { box-shadow: 0 0 0 0 rgba(255,214,102,.8); } 100% { box-shadow: 0 0 0 13px rgba(255,214,102,0); } }
[data-id="V12"] .riga.v-colpo:first-child { font-size: clamp(64px, 20vw, 88px); }
.posato.atterra { width: 42%; }


/* ==================================================================
   v4 (30/09 pomeriggio) — giro 4 di Mat
   ================================================================== */

/* font cartoon solo dove conta: il resto torna pulito */
.btn { font: 600 17px/1.2 var(--testo); }
[data-id="V01"] .btn { font: 800 21px/1.1 var(--display); }
.wow .riga.v-normale { font: 600 21px/1.3 var(--testo); }
.riga.v-striscia { font: 600 17px/1.25 var(--testo); }
.riga.v-striscia b { font-weight: 600; }
.riga.v-cartello { font: 600 16px/1.3 var(--testo); }
.coppia .btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; }

/* V01: la barchetta dentro il testo */
.barca-inline { height: 1.15em; width: auto; vertical-align: -.22em; margin: 0 .05em; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.2));
  animation: dondola 3s ease-in-out infinite; transform-origin: 50% 80%; }

/* V02–V05: il testo in alto a sinistra, grande */
.in-alto .testo { margin-top: 18px; margin-bottom: auto; }
.in-alto .velo { opacity: 0; }
.in-alto .riga { text-shadow: 0 2px 14px rgba(11,26,54,.55); }
.in-alto .riga.v-normale { font: 600 27px/1.2 var(--testo); }
.in-alto .riga.v-grido { font-size: clamp(44px, 13vw, 56px); }
.in-alto .riga .luogo { text-shadow: none; }
.manuale { font: 400 .92em/1.25 "Special Elite", "Courier New", monospace; background: var(--carta); color: var(--inchiostro);
  padding: 0 .25em; box-shadow: 2px 2px 0 rgba(0,0,0,.2); text-shadow: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.manuale .w { color: var(--inchiostro); }
.riga.v-timbrino { display: inline-block; font: 400 12px/1 "Special Elite", monospace; letter-spacing: .18em; text-transform: uppercase;
  color: var(--rosa); background: rgba(251,252,254,.92); border: 2px solid var(--rosa); border-radius: 3px; padding: 6px 8px 4px;
  text-shadow: none; animation: timbra .35s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes timbra { from { opacity: 0; transform: rotate(-8deg) scale(2.2); } to { opacity: 1; transform: rotate(-8deg); } }

/* V04: la freccia disegnata a mano */
.freccia { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.freccia path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 3px rgba(11,26,54,.5)); }
.freccia .asta { stroke-dasharray: 900; stroke-dashoffset: 900; animation: disegna 1.1s ease-out forwards; }
.freccia .punta { opacity: 0; animation: entra-sussurro .3s ease forwards 1s; }
@keyframes disegna { to { stroke-dashoffset: 0; } }

/* V07: «Che palle però» pesante */
.riga.v-sbadiglio .l { animation: lettera .35s ease forwards, cade-pesante 1.3s cubic-bezier(.5,0,.75,0) forwards; }
@keyframes cade-pesante { 60% { transform: translateY(calc(var(--giu) * 3)) rotate(var(--rot)); }
  75% { transform: translateY(calc(var(--giu) * 2.4)) rotate(calc(var(--rot) * 1.3)); }
  to { opacity: 1; transform: translateY(calc(var(--giu) * 3)) rotate(calc(var(--rot) * 1.5)); } }
#palco.tonfo .ui, #palco.tonfo .mondo { animation: tonfo .45s cubic-bezier(.3,.7,.4,1); }
@keyframes tonfo { 20% { translate: 0 6px; } 45% { translate: 0 -2px; } 70% { translate: 0 1px; } }

/* evidenziatore più forte: pennarello pieno, testo scuro */
.riga em { font-weight: 600; background: linear-gradient(var(--giallo), var(--giallo)) no-repeat 0 60% / 0% 88%;
  padding: 0 .12em; margin: 0 -.04em; border-radius: 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.riga em, .riga em .w { color: var(--inchiostro); text-shadow: none; }
@keyframes evidenzia { to { background-size: 100% 88%; } }
.riga.v-colpo.giallo, .riga.v-colpo.giallo .w { color: var(--giallo); }

/* nei momenti wow la riga al tocco entra parola per parola */
.riga.svela-parole { opacity: 1 !important; animation: none !important; }

/* V12: burrasca di carta */
.burrasca { position: absolute; inset: 0; pointer-events: none; animation: burrasca-va 5.5s ease forwards; }
@keyframes burrasca-va { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.burrasca .nuvola { position: absolute; background: #dfe6f1; border-radius: 60px; box-shadow: 4px 5px 0 rgba(0,0,0,.18); }
.burrasca .nuvola::before, .burrasca .nuvola::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.burrasca .n1 { width: 160px; height: 46px; top: 12%; left: -40px; animation: nuvola 5.5s ease-in-out forwards; }
.burrasca .n1::before { width: 80px; height: 80px; left: 26px; top: -40px; } .burrasca .n1::after { width: 60px; height: 60px; left: 86px; top: -26px; }
.burrasca .n2 { width: 120px; height: 36px; top: 20%; right: -30px; animation: nuvola 5.5s ease-in-out reverse forwards; }
.burrasca .n2::before { width: 58px; height: 58px; left: 18px; top: -30px; } .burrasca .n2::after { width: 44px; height: 44px; left: 62px; top: -20px; }
@keyframes nuvola { from { translate: -30px 0; } to { translate: 40px 0; } }
.burrasca .pioggia { position: absolute; inset: 0; opacity: .45;
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255,255,255,.55) 14px 15.5px, transparent 15.5px 38px);
  animation: pioggia .5s linear infinite; }
@keyframes pioggia { to { background-position: -40px 120px; } }
.burrasca .lampo { position: absolute; inset: 0; background: #fff; opacity: 0; animation: lampo 5.5s linear forwards; }
@keyframes lampo { 0%, 17% { opacity: 0; } 18% { opacity: .55; } 19% { opacity: 0; } 21% { opacity: .35; } 23%, 100% { opacity: 0; } }
.tempesta .barca .b-dondolo { animation: burrasca-barca 1.1s ease-in-out 3; }
@keyframes burrasca-barca { 0%,100% { transform: rotate(-12deg) translateY(1px); } 50% { transform: rotate(10deg) translateY(-3px); } }
.tempesta .segni .gruppo { animation-duration: 1.6s; }

/* V14: tre boe con la scritta */
.ogg.t-boa { transform: translate(-50%, -100%); }
.boa-m { display: grid; justify-items: center; animation: dondola 2.8s ease-in-out infinite; transform-origin: 50% 100%; }
.boa-scritta { background: var(--carta); color: var(--blu); font: 800 9px/1 var(--display); padding: 3px 5px 2px; border-radius: 2px;
  box-shadow: 1px 1px 0 rgba(0,0,0,.2); white-space: nowrap; transform: rotate(-3deg); }
.galleggiante { width: 12px; height: 12px; margin-top: 2px; border-radius: 50% 50% 45% 45%;
  background: linear-gradient(var(--rosa) 0 45%, var(--carta) 45% 70%, var(--rosa) 70%); box-shadow: 1px 1px 0 rgba(0,0,0,.2); }

/* V17: due etichette */
.riga.v-etichette { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .3em; }
.etichetta-carta { display: inline-block; background: var(--carta); color: var(--blu-scuro); font: 800 14px/1.1 var(--display);
  padding: 7px 9px 6px; white-space: nowrap; border-radius: 3px; box-shadow: 3px 3px 0 rgba(0,0,0,.22); transform: rotate(-2deg); }
.etichetta-carta.storta { transform: rotate(2.5deg); color: var(--rosa); }
.etichetta-carta .w { color: inherit; }

/* V23: «di più» cresce, poi viene barrato; le navi corrono */
.cresce { display: inline-block; animation: cresce 1.6s cubic-bezier(.3,1.3,.5,1) forwards .6s; transform-origin: 0 70%; }
@keyframes cresce { to { transform: scale(1.35); } }
.cresce s { animation-delay: 1.9s !important; }
.svolta .nave-sfila { opacity: .25 !important; }

/* V23b: la luce lontana */
.ogg.t-luce { border-radius: 50%; background: radial-gradient(closest-side, rgba(255,230,160,.95), rgba(255,214,102,.45) 40%, rgba(255,214,102,0));
  filter: blur(1px); animation: luce 2.4s ease-in-out infinite; }
@keyframes luce { 50% { opacity: .55; transform: scale(.85); } }

/* V25: le lanterne salgono una volta sola, ravvicinate (3/10: prima ~10 s in tutto, ora ~5 s) */
.t-marketers.accesa .lanterne > div { animation: sale 3.2s ease-in 1 forwards; }
.t-marketers.accesa .lanterne .l0 { animation-delay: .3s !important; }
.t-marketers.accesa .lanterne .l1 { animation-delay: .8s !important; }
.t-marketers.accesa .lanterne .l2 { animation-delay: 1.2s !important; }
.t-marketers.accesa .lanterne .l3 { animation-delay: 1.6s !important; }
.t-marketers.accesa .lanterne .l4 { animation-delay: 2s !important; }

/* V27: nota scritta a mano accanto all'album */
.nota-mano { position: absolute; display: flex; align-items: flex-start; gap: 2px; color: #fff; opacity: 0; animation: entra-sussurro .8s ease forwards;
  font: 600 22px/1 var(--mano); transform: rotate(-4deg); text-shadow: 0 2px 8px rgba(11,26,54,.6); }
.nota-mano svg { flex: none; margin-top: -26px; }
.nota-mano path { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* V28b–c: bottiglie con il mese */
.ogg.t-bottiglia .lettera { font-size: 7px; padding: 2px 3px 1px; bottom: 60%; }
.ogg.lontana { opacity: .5; }

/* V28d: la scia gialla della deviazione */
.tracce .scia.giallo { stroke: var(--giallo); opacity: .95; filter: drop-shadow(0 0 3px var(--giallo)); }
.tracce .scia.sfuma { opacity: 0; transition: opacity 1.6s ease; }
.souvenir-ricordo.cade { animation-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .burrasca, .cresce, .boa-m, .barca-inline, .ogg.t-luce { animation: none !important; }
}
.ogg.t-luce.nascosto { animation: none; opacity: 0; }

/* ==================================================================
   v5 (30/09 pomeriggio) — giro 5 di Mat
   ================================================================== */
.in-alto .testo { margin-top: 58px; }
.riga.v-grido.giallo, .riga.v-grido.giallo .w { color: var(--giallo); }

/* V01: la barchetta del testo vola sul foglio */
.barca-volante { position: absolute; z-index: 30; height: auto; pointer-events: none;
  transition: left .85s cubic-bezier(.5,0,.3,1), top .85s cubic-bezier(.3,-.6,.5,1), width .85s ease, opacity .25s ease .75s; }
.barca-volante.vola { opacity: 0; animation: gira-volo .85s ease-in-out; }
@keyframes gira-volo { 50% { rotate: -18deg; } }

/* V14: le boe aspettano il tocco, le parole anche */
.ogg.t-boa.attende { opacity: 0; }
.riga em.spenta { animation: none !important; background-size: 0% 88% !important; }
.riga em.spenta, .riga em.spenta .w { color: #fff; }

/* V28b–c: inquadratura stretta, il resto del mondo si abbassa */
#palco.stretto::before { opacity: 1; background: radial-gradient(70% 45% at 50% 36%, rgba(11,26,54,0) 35%, rgba(11,26,54,.7) 100%); }

/* V27: la nota dell'album come etichetta di carta, senza freccia */
.nota-mano { background: var(--carta); color: var(--inchiostro); padding: 6px 12px 4px; border-radius: 3px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.22); text-shadow: none; font-size: 24px; transform: rotate(-3deg); white-space: nowrap; }
.nota-mano svg { display: none; }

/* Missione #0: il timbro resta sulla carta */
.timbro { top: 12px; bottom: auto; right: 12px; }

/* V38: il gabbiano plana sulla scritta, le lettere volano e tornano */
.lv { display: inline-block; white-space: pre; }
.lv.vola { animation: lettera-vola 1.5s cubic-bezier(.3,.8,.4,1) both; }
@keyframes lettera-vola { 0% { transform: none; } 35% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
  70% { transform: translate(calc(var(--dx) * .3), 4px) rotate(calc(var(--r) * -.2)); } 100% { transform: none; } }
.gabbiano-ventata { position: absolute; left: -70px; width: 64px; z-index: 12; animation: ventata 1.5s cubic-bezier(.4,.2,.6,.8) forwards; }
.gabbiano-ventata img, .gabbiano-ventata .ph { display: block; width: 100%; }
@keyframes ventata { 0% { left: -70px; translate: 0 -60px; } 45% { translate: 0 10px; } 100% { left: calc(100% + 70px); translate: 0 -90px; } }
[data-id="V38"] .testo { overflow: visible; }

/* V14: boe da Nano Banana, la scritta sul cartello in codice */
.ogg.t-boa { transform: none; }
.ogg.t-boa .figura { position: relative; animation: dondola 2.8s ease-in-out infinite; transform-origin: 50% 90%; }
.ogg.t-boa .boa-scritta { position: absolute; left: 7%; right: 8%; top: 0; height: 30.5%; display: grid; place-items: center;
  background: none; box-shadow: none; padding: 0; transform: none; color: var(--blu); font: 800 4.5px/1 var(--display); letter-spacing: -.01em; }

/* ==================================================================
   v6 (30/09 pomeriggio) — giro 6 di Mat
   ================================================================== */
/* V01: zoom sulla barchetta, il resto se ne va */
#palco.uscita .ui, #palco.uscita .suggerimento, #palco.uscita .velo { opacity: 0; transition: opacity .45s ease; }

/* fumetti nel mondo */
.fumetto { position: absolute; z-index: 9; transform: translate(-50%, -100%); max-width: 250px; width: max-content;
  background: var(--carta); color: var(--inchiostro); font: 800 19px/1.2 var(--display); text-align: center;
  padding: 12px 16px 11px; border-radius: 18px; box-shadow: 3px 3px 0 rgba(0,0,0,.22);
  animation: fumetto-apre .45s cubic-bezier(.2,1.6,.4,1) both; transform-origin: calc(50% + var(--coda, 0px)) 100%; }
.fumetto::after { content: ""; position: absolute; top: calc(100% - 1px); left: calc(50% + var(--coda, 0px) - 9px);
  border: 9px solid transparent; border-top: 13px solid var(--carta); border-bottom: 0; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.12)); }
.fumetto em { font-style: normal; background: var(--giallo); padding: 0 .12em; border-radius: 2px; }
@keyframes fumetto-apre { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }
.fumetto.pensiero { font: 600 20px/1.2 var(--mano); font-size: 26px; border-radius: 40px; padding: 12px 20px 8px; }
.fumetto.pensiero::after { border: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--carta); top: calc(100% + 6px);
  left: calc(50% + var(--coda, 0px) - 10px); box-shadow: 8px 14px 0 -3px var(--carta); filter: none; }
.bozza .fumetto.proposta { outline: 1.5px dashed #ffb3c7; outline-offset: 3px; }

/* V29: la strada nuova si vede bene */
.tracce .sentiero.forte { stroke-width: 5px; stroke-dasharray: 3 9; filter: drop-shadow(0 0 5px var(--giallo)) drop-shadow(0 0 2px #fff); }
.tracce .sentiero.forte.on { animation: sentiero 2.2s ease forwards 500ms, marcia 1s linear infinite 2.7s; }
@keyframes marcia { from { stroke-dashoffset: 12; opacity: .95; } to { stroke-dashoffset: 0; opacity: .95; } }

/* dopo il form: un mare diverso */
#palco { transition: background-color 2.2s ease; }
#palco[data-mare="nuovo"] { background-color: #1d5f8e; }
#palco[data-mare="nuovo"] .segni path { stroke: #8fd0e8; }
.nome-giallo { color: var(--giallo); }
.riga.forte { font: 600 22px/1.25 var(--testo); }

/* V02: il copione come checklist che si spunta da sola */
.riga.v-check { display: flex; align-items: center; gap: 10px; margin: 0 0 .35em; font: 400 19px/1.2 "Special Elite", "Courier New", monospace;
  animation-name: entra-normale; animation-duration: .5s; }
.in-alto .riga.v-check { font-size: 20px; }
.casella { position: relative; flex: none; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 3px; }
.casella::after { content: ""; position: absolute; left: 4px; top: -5px; width: 8px; height: 16px; border: solid var(--giallo);
  border-width: 0 3.5px 3.5px 0; transform: rotate(40deg) scale(0); transform-origin: 50% 80%; opacity: 0;
  animation: spunta .35s cubic-bezier(.3,1.7,.5,1) forwards; animation-delay: calc(var(--t, 0ms) + 450ms); }
@keyframes spunta { to { opacity: 1; transform: rotate(40deg) scale(1); } }
.testo.tutto .casella::after { animation-delay: 0s; animation-duration: 1ms; }

/* ==================================================================
   v7 — giro 7
   ================================================================== */
/* V01 → V02: resta solo la barchetta, il mondo nasce in dissolvenza */
#palco.uscita .segni { opacity: 0 !important; }
#palco.nasce .ogg:not(.nascosto), #palco.nasce .tracce .linea { animation: nasce 2.2s ease both !important; }
@keyframes nasce { from { opacity: 0; } to { opacity: 1; } }
#palco.nasce .segni { transition-duration: 2.2s; }

/* V08: le isole restano nella nebbia ma «respirano» per farsi notare */
.ogg.richiamo .figura, .ogg.richiamo .nube { animation: richiamo 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.ogg.richiamo[data-id="isola-passione"] .figura, .ogg.richiamo[data-id="isola-passione"] .nube { animation-delay: .8s; }
.ogg.richiamo[data-id="isola-storia"] .figura, .ogg.richiamo[data-id="isola-storia"] .nube { animation-delay: 1.6s; }
@keyframes richiamo { 0%, 100% { scale: 1; } 50% { scale: 1.16; } }

/* V14: la parola arriva insieme alla sua boa */
.riga.v-parola { display: inline-block; margin: .15em .35em .4em 0; background: var(--giallo); color: var(--inchiostro);
  font: 800 20px/1 var(--display); padding: 6px 9px 5px; border-radius: 3px; box-shadow: 2px 2px 0 rgba(0,0,0,.2); transform: rotate(-1.5deg); }
.riga.v-parola:nth-of-type(odd) { transform: rotate(1.5deg); }
.riga.v-parola.svela { animation: timbro-luogo .45s cubic-bezier(.2,1.7,.4,1) forwards !important; }

/* ==================================================================
   v8 — giro 8
   ================================================================== */
/* V01 → V02: la barchetta del testo è la protagonista */
.barca-protagonista { position: absolute; z-index: 30; height: auto; pointer-events: none; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.2));
  transition: left 1.1s cubic-bezier(.6,0,.3,1), top 1.1s cubic-bezier(.6,0,.3,1), width 1.1s cubic-bezier(.6,0,.3,1), opacity .5s ease;
  animation: dondola 3s ease-in-out infinite; transform-origin: 50% 80%; }
.barca-protagonista.atterra { transition-duration: 1.2s, 1.2s, 1.2s, .5s; }
#palco.buio-mondo .mondo { opacity: 0; transition: opacity .6s ease; }
#palco.buio-mondo .ui, #palco.buio-mondo .suggerimento { opacity: 0; }
#palco.nasce .mondo { opacity: 1; transition: opacity 1.6s ease; }
#palco.nasce .ui { transition: opacity 1s ease .6s; }

/* V02–V05: la checklist che si compone */
.checklist { margin-top: 8px; display: grid; gap: 6px; font: 400 19px/1.2 "Special Elite", "Courier New", monospace; text-shadow: 0 2px 10px rgba(11,26,54,.6); }
.checklist.entra { opacity: 0; animation: entra-normale .6s ease forwards; }
.checklist .voce { display: flex; align-items: center; gap: 10px; opacity: .55; transition: opacity .4s ease; }
.checklist .voce.fatta, .checklist .voce.spunta { opacity: 1; }
.checklist .voce.fatta .casella::after { animation: none; opacity: 1; transform: rotate(40deg) scale(1); }
.checklist .voce:not(.fatta):not(.spunta) .casella::after { animation: none; }
.checklist .voce.spunta { animation: evidenzia-voce .9s ease both; animation-delay: var(--t, 0ms); }
@keyframes evidenzia-voce { 40% { transform: translateX(6px); } }
.in-alto .riga.v-grido { margin-bottom: .1em; }

/* V08: le isole «respirano» di più */
@keyframes richiamo { 0%, 100% { scale: 1; } 50% { scale: 1.24; } }
.ogg.richiamo.in-nebbia .nube { filter: blur(4px) drop-shadow(0 0 6px rgba(255,255,255,.7)); }

/* dopo il form: un altro mondo, non più blu */
#palco[data-mare="nuovo"] { background-color: #3b2468; }
#palco[data-mare="nuovo"] .segni path { stroke: #c7a6ff; opacity: .5; }
#palco[data-mare="nuovo"] .velo { background: linear-gradient(to bottom, rgba(44,24,84,0), rgba(44,24,84,.78) 90px, rgba(44,24,84,.88)); }
#palco[data-mare="nuovo"] .tinta { opacity: 1; mix-blend-mode: screen;
  background: radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 72% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 30%, #ffe9a8, transparent), radial-gradient(1px 1px at 88% 36%, #fff, transparent),
    radial-gradient(1px 1px at 22% 44%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 8%, #fff, transparent),
    radial-gradient(1px 1px at 8% 60%, #ffe9a8, transparent), radial-gradient(1px 1px at 94% 64%, #fff, transparent); }

/* v9: V01 in tre tempi (sparisce, zoom, mondo) */
.barca-protagonista { transition: left 1.1s cubic-bezier(.5,0,.2,1), top 1.1s cubic-bezier(.5,0,.2,1), width 1.1s cubic-bezier(.5,0,.2,1), opacity .5s ease; }

/* V05: la barchetta ha fretta */
.barca.fretta .b-dondolo { animation-duration: .45s; }
.sudore { position: absolute; left: 62%; top: -34%; width: 30%; height: 40%; }
.sudore i { position: absolute; width: 4px; height: 6px; background: #bfe6ff; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.12); opacity: 0; animation: goccia 1s ease-in infinite; }
.sudore i:nth-child(1) { left: 0; top: 20%; } .sudore i:nth-child(2) { left: 45%; top: 0; animation-delay: .33s; } .sudore i:nth-child(3) { left: 85%; top: 30%; animation-delay: .66s; }
@keyframes goccia { 0% { opacity: 0; transform: translate(0, 0) rotate(20deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, 14px) rotate(20deg); } }
.barca.fretta::before { content: ""; position: absolute; right: 88%; top: 40%; width: 40%; height: 26%; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.85) 0 1.5px, transparent 1.5px 6px); opacity: .8;
  -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); animation: vento-fretta .4s linear infinite; }
@keyframes vento-fretta { 50% { transform: translateX(-4px); opacity: .5; } }

/* v10 */
.barca-protagonista { transition: left .8s cubic-bezier(.5,0,.2,1), top .8s cubic-bezier(.5,0,.2,1), width .8s cubic-bezier(.5,0,.2,1); }
#palco.buio-mondo .mondo { transition: opacity .4s ease; }
#palco.nasce .mondo { transition: opacity 1.1s ease; }
/* V02: la A arriva solo in V03 */
.ogg .lettera { transition: opacity .4s ease, transform .4s cubic-bezier(.2,1.6,.4,1); }
.ogg.senza-lettera .lettera { opacity: 0; transform: translate(-50%, 6px) scale(.3); }
/* il velo non «scivola» più tra una schermata e l'altra */
.velo { transition: opacity .6s ease; }
/* titoli di coda un po' più veloci */
.crediti.scorre .nastro { animation-duration: 5.5s; }
/* V05: mare mosso, tutto si agita */
.agitato .segni .gruppo { animation-duration: .9s !important; }
@keyframes deriva-agitata { 50% { transform: translate(10px, 4px); } }
.agitato .segni .gruppo { animation-name: deriva-agitata; }
.agitato .ogg:not(.nascosto) .figura { animation: scossa .5s ease-in-out infinite; }
.agitato .ogg.t-faro .figura { animation-duration: .7s; }
@keyframes scossa { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-2px); } }
.agitato .barca .b-dondolo { animation: burrasca-barca .45s ease-in-out infinite; }
.agitato .tracce .linea { animation: vibra .3s linear infinite; }
@keyframes vibra { 50% { transform: translateX(1px); } }

/* 2/10: niente flicker sul «Tocca…» giallo quando si tocca bottiglia o forziere
   (il «mostra tutto» accorciava a 1 ms anche la pulsazione infinita) */
.testo.tutto .riga.v-invito { animation: none !important; opacity: 1; }

/* 2/10: modalità leggera per telefoni con poca memoria */
.leggero .segni .gruppo { animation: none !important; }
.leggero .ogg.t-nebbia, .leggero .ogg .nube { filter: none; }
.leggero .ogg.in-nebbia .figura { filter: none; opacity: .4; }
.leggero .tinta { mix-blend-mode: normal; }
.leggero [data-cielo="tramonto"] .tinta { opacity: .28; }
.leggero [data-cielo="alba"] .tinta { opacity: .22; }
.leggero .ogg.toccabile .figura, .leggero .ogg.t-forziere.toccabile .tela { filter: none; }

/* ==================================================================
   2/10 pomeriggio — fix Android (flicker e lag)
   ================================================================== */
/* il mondo resta sempre sul suo livello grafico */
.mondo { will-change: transform; backface-visibility: hidden; }
/* le immagini entrano in dissolvenza quando sono caricate */
img.carica { opacity: 0; transition: opacity .35s ease; }
img.carica.pronta { opacity: 1; }
/* V04: il faro che pulsa senza animare il filtro (era il lampeggio su Android) */
@keyframes pulsa { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.ogg.lampeggia .figura { filter: drop-shadow(0 0 5px var(--giallo)); }
/* la freccia senza filtro: l'ombra è un secondo tratto sotto */
.freccia path { filter: none; }
.freccia .ombra { stroke: rgba(11,26,54,.35); stroke-width: 6; }
/* modalità leggera (Android): niente filtri animati né ombre sfocate sul testo */
.leggero .in-alto .riga, .leggero .checklist, .leggero .nota-mano { text-shadow: 0 1px 2px rgba(11,26,54,.6); }
.leggero .tracce .sentiero, .leggero .tracce .sentiero.forte, .leggero .tracce .scia.giallo, .leggero .tracce .deviazione { filter: none; }
.leggero .ogg.lampeggia .figura, .leggero .t-marketers.accesa .figura { filter: none; }
.leggero .ogg.toccabile .figura, .leggero .ogg.t-forziere.toccabile .tela { animation-name: galleggia; }
.leggero .burrasca .pioggia { animation: none; }
.leggero .agitato .ogg:not(.nascosto) .figura { animation: none; }

/* ---- PROVA 3/10: meno lavoro grafico durante gli spostamenti ---- */
/* oggetti fuori inquadratura: non si disegnano */
.ogg.fuori-campo { visibility: hidden; }
.ogg.fuori-campo * { animation-play-state: paused !important; }
/* barca e tracce su strati propri: quando si muovono non si ridisegna tutto il mondo */
.barca { will-change: transform; }
.tracce { will-change: transform; }
/* forziere su Android: l'animazione «galleggia» è quella delle bottiglie (lo inclinava di 60°) */
.leggero .ogg.t-forziere.toccabile .tela { animation-name: saltello; }

/* ---- PixiJS: il mondo lo disegna la tela WebGL (assets/js/pixi-mondo.js) ----
   Il mondo DOM resta sotto, invisibile e fermo: serve solo per i tocchi. */
.pixi-tela { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.pixi .mondo .ogg, .pixi .mondo .segni, .pixi .mondo .tracce, .pixi .mondo .barca,
.pixi .mondo .volo, .pixi .mondo .nave-sfila { visibility: hidden; }
.pixi .mondo .ogg.toccabile { visibility: visible; opacity: 0 !important; }
.pixi .mondo *, .pixi .mondo *::before, .pixi .mondo *::after { animation: none !important; transition: none !important; filter: none !important; }
.pixi .mondo .barca, .pixi .mondo .tracce { will-change: auto; }
.pixi #palco.rewind .mondo, .pixi #palco.tonfo .mondo { filter: none; animation: none; }

/* 5/10 · /nelfrattempo e V05 */
#palco[data-mare="scuro"] { background-color: #142c58; transition: background-color .8s ease; }
#palco[data-mare="scuro"] .segni path { stroke: #4f74b0; }
.ogg.t-pinna .figura { position: relative; }
.pinna-scritta { position: absolute; left: 50%; bottom: 104%; transform: translateX(-50%) rotate(-4deg); white-space: nowrap;
  background: var(--carta); color: var(--inchiostro); font: 800 5.6px/1 var(--display); padding: 2px 3px 1.5px; border-radius: 1px;
  box-shadow: .8px .8px 0 rgba(0,0,0,.2); }
.posato.atterra.fermo { animation: none; transform: translate(-45%, -96%); opacity: 1; }
.ogg.sbiadito { opacity: .18; transition: opacity .9s ease; }
.bottoni .sotto-bottone { margin: 10px 2px 0; text-align: center; }
/* il «tocca lo schermo» delle prime schermate: cartellino di carta (tutte le landing) */
.suggerimento.tutorial span {
  display: inline-block; background: var(--carta); color: var(--blu); font-size: 16px; white-space: nowrap; padding: 10px 14px 9px; border-radius: 4px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.25); transform: rotate(-1deg); }
.suggerimento.tutorial span::before { border-color: var(--blu); }
.riga.v-grido.domanda { font-size: clamp(26px, 7.4vw, 34px); }

/* ---------- domande a tocco (/amici: la missione feedback) ---------- */
.foglio-form.domande .passo { margin: 0; font: 800 11px/1.2 var(--display); letter-spacing: .14em; color: var(--blu); text-transform: uppercase; }
.foglio-form.domande h2 { font-size: 21px; }
.foglio-form.domande .opzioni { display: grid; gap: 8px; }
.foglio-form.domande .coppia { margin-top: 0; }
.foglio-form.domande .btn.opzione { background: #fff; color: var(--blu-scuro); border: 1.5px solid #b8c4da; box-shadow: 2px 2px 0 rgba(0,0,0,.12); }
.foglio-form.domande .btn.opzione.scelta { background: var(--giallo); border-color: var(--giallo); color: var(--inchiostro); }
.foglio-form.domande .dettaglio { display: grid; gap: 10px; animation: srotola 500ms ease both; }
.foglio-form.domande label.campo em { color: #7a869c; font-style: normal; font-size: 13px; }
.foglio-form textarea { font: 16px/1.35 var(--testo); padding: 10px 12px; border-radius: 6px; border: 1.5px solid #b8c4da;
  background: #fff; color: var(--inchiostro); width: 100%; resize: vertical; min-height: 4.2em; }
.foglio-form textarea:focus { outline: 3px solid var(--giallo); border-color: var(--blu); }
