/* BASTIONE — sito. Stessi colori del gioco (src/style.css): blu notte, oro.
   Font (30/9/2026): «Tiny5» per titoli, bottoni e nomi — pixel come il gioco
   ma nitido anche in piccolo, con gli accenti di tutte le lingue del sito; ha
   un solo spessore, quindi niente grassetti (sarebbero finti e sbavati) — e
   «Nunito» per il testo lungo. Scartato «Pixelify Sans»: G e C, 5 e S si
   confondevano («Bioca ora», «3S ondate»). Prima c'era «Press Start 2P»: bello ma
   larghissimo, costringeva a caratteri minuscoli (8–11px) e in tedesco o
   francese le parole lunghe non ci stavano.
   Ogni sezione ha il suo colore (--aura): un bagliore dietro al contenuto,
   l'occhiello e le merlature sopra di esso. Le carte/schede hanno --colore,
   il colore dell'elemento (fuoco, gelo, legno…).
   Le animazioni legate allo scorrimento partono da sito.js (classe .js su
   <html>): senza JS, o con «riduci movimento», la pagina resta visibile e ferma. */
@property --aura { syntax: '<color>'; inherits: true; initial-value: #ff8a3d; }

:root {
  --notte: #0a1a3a;
  --notte-scura: #060d1f;
  --pannello: rgba(10, 18, 42, 0.8);
  --pannello-bordo: rgba(244, 208, 63, 0.22);
  --oro: #f4d03f;
  --oro-chiaro: #ffe690;
  --oro-ombra: #3d2a00;
  --brace: #ff8a3d;
  --testo: #efe6cf;
  --testo-tenue: #aeb3c2;
  --pixel: 'Tiny5', 'Press Start 2P', monospace;
  --corpo: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --larghezza: 1120px;
  --px: 0; --py: 0;              /* parallasse dell'apertura (da sito.js) */
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--notte-scura);
  color: var(--testo);
  font: 18px/1.65 var(--corpo);
}
img { max-width: 100%; height: auto; display: block; }
.griglia-boss img, .disegno img, .carta img, .tessere-volanti img, .sprite { image-rendering: pixelated; }
h2, h3, .btn, .occhiello, .numeri b, .griglia-torri b, .griglia-orda b, .griglia-boss b,
.barra-nome, .tagline, .carta b, .nastro, .lingue summary { font-family: var(--pixel); font-weight: 400; }
p { margin: 0 0 12px; }
a { color: var(--oro); }
.nota-lingua:empty, .nota-video:empty { display: none; }

/* ── Barra di avanzamento della lettura ── */
.progresso { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.progresso span {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(var(--letto, 0));
  background: linear-gradient(90deg, #ff5a2a, var(--oro) 40%, #7fe7ff 75%, #b57bff);
  box-shadow: 0 0 8px rgba(244, 208, 63, .7);
}

/* ── Barra in alto: compare quando l'apertura esce dallo schermo ── */
.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 56px;
  display: flex; align-items: center; gap: 20px; padding: 0 max(16px, calc((100vw - var(--larghezza)) / 2));
  background: rgba(6, 13, 31, 0.86); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pannello-bordo);
  transform: translateY(-100%); transition: transform .3s ease;
}
body.scorso .barra { transform: none; }
.barra-nome { color: var(--oro); text-decoration: none; font-size: 20px; letter-spacing: 3px; }
.barra-link { display: flex; gap: 22px; margin-left: auto; }
.barra-link a { color: var(--testo-tenue); text-decoration: none; font-size: 15px; transition: color .2s; }
.barra-link a:hover { color: var(--oro-chiaro); }

/* ── Menu delle lingue (in alto a destra sull'apertura) ── */
.lingue { position: absolute; top: 14px; right: 16px; z-index: 40; }
.lingue summary {
  list-style: none; cursor: pointer; font-size: 15px; color: var(--testo);
  padding: 9px 12px; border-radius: 999px; background: rgba(6, 13, 31, .65);
  border: 1px solid rgba(239, 230, 207, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lingue summary::-webkit-details-marker { display: none; }
.lingue summary:hover, .lingue[open] summary { border-color: var(--oro); }
.lingue ul {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; min-width: 160px;
  background: rgba(8, 14, 34, .96); border: 1px solid var(--pannello-bordo); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
}
.lingue a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--testo); text-decoration: none; font-size: 15px; }
.lingue a:hover { background: rgba(244, 208, 63, .12); }
.lingue a[aria-current] { color: var(--oro); }
.lingue a[aria-current]::after { content: ' ✓'; }

/* ── Bottoni ── */
.btn {
  position: relative; overflow: hidden;
  display: inline-block; text-decoration: none; font-size: 21px; letter-spacing: 1px; line-height: 1.2;
  padding: 16px 26px; border-radius: 8px; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.btn-gioca {
  color: #2a1800; background: linear-gradient(180deg, var(--oro-chiaro), var(--oro) 45%, #d9a520);
  border: 2px solid #6b4a00; box-shadow: 0 4px 0 #6b4a00, 0 8px 24px rgba(244,208,63,.35);
}
.btn-gioca:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #6b4a00, 0 12px 30px rgba(244,208,63,.55); }
.btn-gioca:active { transform: translateY(2px); box-shadow: 0 2px 0 #6b4a00; }
/* riflesso che attraversa il bottone ogni pochi secondi */
.btn-luccica::after {
  content: ''; position: absolute; top: -50%; bottom: -50%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg); animation: luccica 3.6s ease-in-out infinite 2s;
}
@keyframes luccica { 0% { left: -60%; } 30%, 100% { left: 130%; } }
.btn-secondario { color: var(--testo); background: rgba(8,14,34,.6); border: 2px solid rgba(239,230,207,.35); }
.btn-secondario:hover { border-color: var(--oro); }
.btn-piccolo { font-size: 16px; padding: 8px 14px; box-shadow: 0 3px 0 #6b4a00; }
.btn-grande { font-size: clamp(20px, 2.6vw, 28px); padding: 18px 36px; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible, li:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ── Apertura: sfondo che si avvicina, parallasse, tile che fluttuano, braci ── */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center; overflow: hidden; padding: 72px 16px 110px; }
.hero-sfondo {
  position: absolute; inset: -4%;
  background: url('/img/titolo.webp') center 30% / cover no-repeat;
  translate: calc(var(--px) * -14px) calc(var(--py) * -10px);
  animation: avvicina 28s ease-out both;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(6,13,31,.55) 100%),
    linear-gradient(180deg, rgba(6,13,31,.2) 0%, rgba(6,13,31,.4) 60%, var(--notte-scura) 100%);
}
@keyframes avvicina { from { transform: scale(1.14); } to { transform: scale(1); } }

.tessere-volanti { position: absolute; inset: 0; z-index: 2; pointer-events: none; translate: calc(var(--px) * 26px) calc(var(--py) * 18px); }
.tessere-volanti img {
  position: absolute; width: 44px; opacity: .85;
  filter: drop-shadow(0 0 10px var(--bagliore, rgba(255,160,60,.8)));
  animation: fluttua 9s ease-in-out infinite;
}
.tessere-volanti img:nth-child(1) { left: 7%;  top: 62%; --bagliore: rgba(255,120,40,.9); animation-delay: -1s; }
.tessere-volanti img:nth-child(2) { left: 88%; top: 58%; --bagliore: rgba(110,200,255,.9); width: 52px; animation-delay: -4s; }
.tessere-volanti img:nth-child(3) { left: 15%; top: 30%; --bagliore: rgba(140,220,90,.9); width: 34px; animation-delay: -2.5s; animation-duration: 11s; }
.tessere-volanti img:nth-child(4) { left: 80%; top: 26%; --bagliore: rgba(190,120,255,.9); width: 38px; animation-delay: -6s; }
.tessere-volanti img:nth-child(5) { left: 4%;  top: 84%; --bagliore: rgba(200,220,240,.7); width: 30px; animation-delay: -3s; animation-duration: 12s; }
.tessere-volanti img:nth-child(6) { left: 93%; top: 82%; --bagliore: rgba(220,200,160,.7); width: 34px; animation-delay: -7s; }
.tessere-volanti img:nth-child(7) { left: 24%; top: 76%; --bagliore: rgba(255,120,40,.9); width: 28px; animation-delay: -5s; animation-duration: 10s; }
.tessere-volanti img:nth-child(8) { left: 72%; top: 72%; --bagliore: rgba(190,120,255,.9); width: 30px; animation-delay: -8s; animation-duration: 13s; }
@keyframes fluttua {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-26px) rotate(8deg); }
}

.braci { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.braci i {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 1px;
  background: var(--c, var(--brace)); box-shadow: 0 0 6px 2px var(--c, var(--brace));
  animation: sali linear infinite;
}
@keyframes sali {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--deriva, 30px), -105vh); opacity: 0; }
}
.hero-contenuto { position: relative; z-index: 3; max-width: 860px; }
.logo {
  width: min(640px, 90vw); margin: 0 auto; image-rendering: pixelated;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,.75)) drop-shadow(0 0 18px rgba(244,208,63,.25));
  animation: cala 1s cubic-bezier(.2, 1.4, .4, 1) both, respira-logo 6s ease-in-out 1s infinite;
}
@keyframes cala { from { opacity: 0; transform: translateY(-60px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes respira-logo {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 8px 22px rgba(0,0,0,.75)) drop-shadow(0 0 18px rgba(244,208,63,.2)); }
  50% { transform: translateY(-8px); filter: drop-shadow(0 14px 26px rgba(0,0,0,.75)) drop-shadow(0 0 30px rgba(244,208,63,.45)); }
}
.tagline { font-size: clamp(20px, 3vw, 32px); line-height: 1.4; margin: 20px 0 30px; text-shadow: 0 2px 8px #000, 0 0 2px #000; }
.tagline .riga-1 { display: inline-block; animation: compari .8s ease .5s both; }
.tagline .riga-2 {
  display: inline-block; animation: compari .8s ease 1s both;
  background: linear-gradient(90deg, var(--oro) 0%, #ff9a4a 50%, var(--oro) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(0 2px 4px #000);
}
.js .tagline .riga-2 { animation: compari .8s ease 1s both, scorri-oro 5s linear 2s infinite; }
@keyframes scorri-oro { to { background-position: -200% 0; } }
@keyframes compari { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.azioni { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; animation: compari .8s ease 1.4s both; }
.nota-hero { margin-top: 20px; color: var(--testo-tenue); font-size: 15px; text-shadow: 0 1px 4px #000; animation: compari .8s ease 1.7s both; }
.nota-lingua { margin: 6px auto 0; max-width: 520px; font-size: 13px; color: #cfd6ea; background: rgba(6,13,31,.55); border-radius: 8px; padding: 6px 12px; animation: compari .8s ease 1.8s both; }
.scendi { position: absolute; z-index: 3; bottom: 34px; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid rgba(239,230,207,.5); border-radius: 14px; }
.scendi span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--oro); animation: rotella 1.8s ease-in-out infinite; }
@keyframes rotella { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ── Nastro con le parole chiave ── */
/* la fascia ritaglia il nastro inclinato (più largo dello schermo) senza scorrimento orizzontale */
.nastro-fascia { position: relative; z-index: 5; overflow: hidden; margin-top: -64px; padding: 30px 0; }
.nastro {
  width: 110%; margin-left: -5%; overflow: hidden;
  transform: rotate(-1.6deg);
  background: linear-gradient(90deg, #6d1020, #8a2a12 25%, #4a1a6e 60%, #6d1020);
  border-block: 3px solid var(--oro); box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.nastro-scorre { display: flex; width: max-content; animation: nastro 40s linear infinite; }
.nastro span { white-space: pre; padding: 12px 0; font-size: 20px; letter-spacing: 3px; color: var(--oro-chiaro); text-shadow: 0 2px 0 #000; }
@keyframes nastro { to { transform: translateX(-50%); } }

/* ── Sezioni: bagliore colorato, merlature, titolo dorato ── */
main { max-width: var(--larghezza); margin: 0 auto; padding: 0 16px; }
.sezione { position: relative; isolation: isolate; padding: 110px 0 0; }
.sezione::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: 40px; bottom: -60px; left: 50%; width: 100vw; translate: -50% 0;
  background: radial-gradient(ellipse 55% 50% at 50% 45%, color-mix(in srgb, var(--aura) 20%, transparent), transparent 72%);
}
.occhiello { text-align: center; font-size: 16px; letter-spacing: 4px; text-transform: uppercase; color: color-mix(in srgb, var(--aura) 65%, white); margin: 0 0 18px; }
.occhiello::before {
  content: ''; display: block; width: 136px; height: 12px; margin: 0 auto 16px;
  background: var(--aura);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12'%3E%3Cpath d='M0 0h8v6h8v6H0z'/%3E%3C/svg%3E") 0 0 / 16px 12px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12'%3E%3Cpath d='M0 0h8v6h8v6H0z'/%3E%3C/svg%3E") 0 0 / 16px 12px repeat-x;
  filter: drop-shadow(0 0 6px var(--aura));
}
h2 {
  font-size: clamp(30px, 4.6vw, 54px); text-align: center; line-height: 1.12; margin: 0 0 20px; font-weight: 400;
  background: linear-gradient(100deg, var(--oro) 42%, #fff7d0 50%, var(--oro) 58%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 var(--oro-ombra));
  animation: luce-titolo 7s ease-in-out infinite;
}
@keyframes luce-titolo { 0% { background-position: 100% 0; } 35%, 100% { background-position: -50% 0; } }
h3 { font-size: 22px; line-height: 1.25; margin: 18px 0 8px; color: var(--testo); }
.intro { text-align: center; color: var(--testo-tenue); max-width: 680px; margin: 0 auto 36px; }

/* Comparsa allo scorrimento (solo con JS e senza «riduci movimento») */
.js .rivela { opacity: 0; transition: opacity .7s ease, transform .7s ease; transition-delay: var(--ritardo, 0s); }
.js .rivela:not(.carta) { transform: translateY(28px) scale(.98); }
.js .rivela.visto { opacity: 1; }
.js .rivela.visto:not(.carta) { transform: none; }

/* ── Prologo ── */
.cornice-video { max-width: 960px; margin: 0 auto; padding: 8px; border-radius: 14px; background: linear-gradient(135deg, #b57bff, var(--oro) 50%, #ff7a2f); box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 60px rgba(122,60,255,.25); }
.cornice-video video { display: block; width: 100%; height: auto; border-radius: 8px; background: #000; }
.nota-video { text-align: center; color: var(--testo-tenue); font-size: 14px; margin-top: 12px; }

/* ── Come si gioca ── */
.passi { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.passi li {
  background: var(--pannello); border: 1px solid color-mix(in srgb, var(--colore) 35%, transparent); border-top: 3px solid var(--colore);
  border-radius: 14px; padding: 22px 22px 18px; transition: transform .25s, box-shadow .25s;
}
.passi li:hover { box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 24px color-mix(in srgb, var(--colore) 25%, transparent); }
.passi p { color: var(--testo-tenue); font-size: 16px; margin: 0; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 6px; background: var(--colore); color: #1a1000; font-size: 17px; vertical-align: 2px; }
.disegno {
  height: 128px; display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 10px; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--colore) 30%, #0b1a44), rgba(6,13,31,.7) 75%);
  border: 1px solid rgba(255,255,255,.06); overflow: hidden; position: relative;
}
.disegno img { width: 56px; height: 56px; }
/* i tile disegnati come nella griglia del gioco: gemma su un tassello colorato */
.disegno .tessera { padding: 6px; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.25)); border: 2px solid rgba(255,255,255,.18); box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.tessera.fuoco { background-color: rgba(214, 84, 30, .45); border-color: rgba(255, 150, 80, .55); }
.tessera.ghiaccio { background-color: rgba(60, 140, 220, .45); border-color: rgba(140, 200, 255, .55); }
.freccia { font-family: var(--pixel); color: var(--oro); font-size: 26px; }
.tris { display: flex; gap: 2px; }
.disegno .tris img { width: 40px; height: 40px; padding: 4px; border-radius: 7px; }
.disegno .torre-grande { width: 84px; height: 84px; }
.disegno-notte { justify-content: space-around; }
.disegno .torre-piccola { width: 72px; height: 72px; }
.disegno .nemico { width: auto; height: 76px; }
.colpo { position: absolute; left: 34%; top: 46%; width: 12px; height: 4px; border-radius: 2px; background: var(--oro-chiaro); box-shadow: 0 0 8px var(--oro); opacity: 0; }
/* --passo = tile + spazio + freccia + spazio: i due tile si scambiano esattamente di posto */
.disegno-scambio { --passo: 92px; }
.js .visto .disegno-scambio img:first-child { animation: scambiaA 3s ease-in-out infinite; }
.js .visto .disegno-scambio img:last-child { animation: scambiaB 3s ease-in-out infinite; }
@keyframes scambiaA { 0%, 30% { transform: none; } 45%, 80% { transform: translateX(var(--passo)); } 95%, 100% { transform: none; } }
@keyframes scambiaB { 0%, 30% { transform: none; } 45%, 80% { transform: translateX(calc(-1 * var(--passo))); } 95%, 100% { transform: none; } }
.js .visto .disegno-torre .tris { animation: fondi 3.2s ease-in-out infinite; }
.js .visto .disegno-torre .torre-grande { animation: sorgi 3.2s ease-in-out infinite; }
@keyframes fondi { 0%, 35% { transform: none; opacity: 1; filter: none; } 50% { transform: scale(.7); opacity: .2; filter: brightness(2.5); } 60%, 85% { transform: scale(.7); opacity: .2; } 100% { transform: none; opacity: 1; } }
@keyframes sorgi { 0%, 45% { transform: translateY(10px) scale(.8); filter: brightness(.6); } 55% { transform: translateY(-6px) scale(1.08); filter: brightness(1.8) drop-shadow(0 0 12px var(--oro)); } 65%, 100% { transform: none; filter: none; } }
.js .visto .disegno-notte .colpo { animation: freccia 1.4s linear infinite; }
.js .visto .disegno-notte .nemico { animation: colpito 1.4s ease-out infinite; }
@keyframes freccia { 0% { left: 34%; opacity: 0; } 10% { opacity: 1; } 55% { left: 62%; opacity: 1; } 60%, 100% { left: 62%; opacity: 0; } }
@keyframes colpito { 0%, 55% { filter: none; transform: none; } 60% { filter: brightness(3) saturate(0); transform: translateX(4px); } 75%, 100% { filter: none; transform: none; } }

/* ── Giorno / notte: il bagliore della sezione passa dal sole alla luna ── */
.ciclo { --aura: #ffb347; transition: --aura 1.2s ease; display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: 44px; align-items: center; }
.ciclo[data-fase-attiva="notte"] { --aura: #7a4dff; }
/* stelle che compaiono di notte */
.ciclo::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none; inset: 60px 0 -40px; opacity: 0; transition: opacity 1.2s;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 20%, #fff, transparent), radial-gradient(1px 1px at 22% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 35% 12%, #cfe0ff, transparent), radial-gradient(1px 1px at 48% 88%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 63% 8%, #fff, transparent), radial-gradient(1px 1px at 77% 60%, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 90% 28%, #fff, transparent), radial-gradient(1px 1px at 96% 85%, #fff, transparent),
    radial-gradient(1px 1px at 4% 92%, #cfe0ff, transparent), radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent);
  animation: scintilla 3s ease-in-out infinite alternate;
}
.ciclo[data-fase-attiva="notte"]::after { opacity: 1; }
@keyframes scintilla { from { filter: brightness(.6); } to { filter: brightness(1.4); } }
.ciclo .occhiello, .ciclo h2 { text-align: left; }
.ciclo .occhiello::before { margin-left: 0; }
.ciclo-testo p:not(.occhiello) { color: var(--testo-tenue); min-height: 5.4em; }
.interruttore { display: inline-flex; padding: 4px; margin: 6px 0 20px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid color-mix(in srgb, var(--aura) 50%, transparent); }
.interruttore button {
  font: 16px var(--pixel); color: var(--testo-tenue); background: none; border: 0; cursor: pointer;
  padding: 11px 16px; border-radius: 999px; transition: background .3s, color .3s;
}
.interruttore button[aria-pressed="true"] { background: var(--aura); color: #1a1000; }
.ciclo[data-fase-attiva="notte"] .interruttore button[aria-pressed="true"] { color: #fff; }
.ciclo-immagine {
  position: relative; margin: 0; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--aura) 55%, transparent);
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 60px color-mix(in srgb, var(--aura) 30%, transparent);
}
.ciclo-immagine img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 1.1s ease; }
.ciclo-immagine .fase-notte { opacity: 0; }
.ciclo[data-fase-attiva="notte"] .fase-notte { opacity: 1; }

/* ── Sprite animati dai fogli del gioco: 4 fotogrammi × 2 righe (fermo / attacco) ── */
.sprite {
  display: block; width: 96px; height: 96px;
  background-image: var(--foglio); background-repeat: no-repeat; background-size: 400% 200%;
  background-position-x: 0%; background-position-y: 0%;
  animation: fotogrammi var(--durata, .6s) steps(4) infinite;
}
@keyframes fotogrammi { to { background-position-x: 133.333%; } }

/* ── Torri: in attacco al passaggio del mouse, la gittata si accende a onde ── */
.griglia-torri, .griglia-orda, .griglia-boss { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.griglia-torri { grid-template-columns: repeat(3, 1fr); }
.griglia-torri li {
  display: grid; grid-template-columns: 96px 1fr auto; grid-template-rows: auto auto 1fr; column-gap: 14px; align-items: start;
  background: radial-gradient(circle at 56px 56px, color-mix(in srgb, var(--colore) 22%, transparent), transparent 110px), var(--pannello);
  border: 1px solid color-mix(in srgb, var(--colore) 30%, transparent); border-radius: 14px; padding: 12px 16px 16px 8px;
  transition: border-color .2s, box-shadow .2s; cursor: default;
}
.griglia-torri li:hover, .griglia-torri li:focus { border-color: var(--colore); box-shadow: 0 0 28px color-mix(in srgb, var(--colore) 30%, transparent); outline: none; }
.griglia-torri .sprite { grid-row: 1 / 4; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.griglia-torri li:hover .sprite, .griglia-torri li:focus .sprite { background-position-y: 100%; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--colore) 70%, transparent)); }
.griglia-torri b { font-size: 22px; color: var(--colore); line-height: 1.2; margin-top: 4px; }
.griglia-torri .etichetta { grid-column: 2; font-size: 13px; color: var(--testo-tenue); line-height: 1.4; margin-top: 4px; }
.griglia-torri p { grid-column: 2 / 4; font-size: 15px; line-height: 1.45; color: var(--testo-tenue); margin: 8px 0 0; }
.gittata { grid-column: 3; grid-row: 1 / 3; display: grid; grid-template-columns: repeat(5, 8px); gap: 2px; margin-top: 6px; }
.gittata i { width: 8px; height: 8px; border-radius: 2px; background: rgba(255,255,255,.08); }
.gittata i.si { background: color-mix(in srgb, var(--colore) 70%, transparent); box-shadow: 0 0 4px color-mix(in srgb, var(--colore) 50%, transparent); }
.gittata i.blocco { background: #8d8d99; }
.gittata i.torre { background: var(--oro); box-shadow: 0 0 5px var(--oro); }
li:hover .gittata i.si, li:focus .gittata i.si { animation: onda-gittata 1s ease-out infinite; animation-delay: var(--d, 0s); }
@keyframes onda-gittata { 0% { background: #fff; box-shadow: 0 0 8px var(--colore); } 60%, 100% { background: color-mix(in srgb, var(--colore) 55%, transparent); } }

/* ── L'orda ── */
.griglia-orda { grid-template-columns: repeat(6, 1fr); gap: 14px; }
.griglia-orda li {
  text-align: center; padding: 14px 10px 16px; border-radius: 14px;
  background: linear-gradient(180deg, var(--pannello) 40%, color-mix(in srgb, var(--colore) 18%, var(--notte-scura)));
  border: 1px solid color-mix(in srgb, var(--colore) 28%, transparent);
  transition: transform .25s, box-shadow .25s;
}
.griglia-orda li:hover { box-shadow: 0 0 26px color-mix(in srgb, var(--colore) 30%, transparent); }
.griglia-orda .sprite { width: 112px; height: 112px; margin: 0 auto; position: relative; }
/* ombra sotto i piedi */
.griglia-orda .sprite::after { content: ''; position: absolute; left: 30%; right: 30%; bottom: 6px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.45); z-index: -1; }
.griglia-orda .vola { animation: fotogrammi var(--durata) steps(4) infinite, plana 2.4s ease-in-out infinite; }
.griglia-orda .vola::after { bottom: -8px; animation: ombra-plana 2.4s ease-in-out infinite; }
@keyframes plana { 50% { transform: translateY(-10px); } }
@keyframes ombra-plana { 50% { transform: scale(.7); opacity: .6; } }
.griglia-orda b { display: block; font-size: 18px; line-height: 1.15; color: var(--colore); margin: 8px 0 6px; min-height: 2.3em; }
.griglia-orda p { font-size: 14px; line-height: 1.45; color: var(--testo-tenue); margin: 0; }
.orda-altri { text-align: center; margin: 26px auto 0; color: color-mix(in srgb, var(--aura) 55%, white); font-style: italic; }

/* ── Carte: ventaglio che galleggia su un bagliore magico ── */
.carte { display: grid; grid-template-columns: 6fr 5fr; gap: 40px; align-items: center; }
.carte .occhiello, .carte h2 { text-align: left; }
.carte .occhiello::before { margin-left: 0; }
.carte-testo p:not(.occhiello) { color: var(--testo-tenue); }
.energia { color: #7fd3ff; font-weight: 600; }
.ventaglio { position: relative; height: 330px; }
.ventaglio::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 360px; height: 260px; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(127,211,255,.35), rgba(181,123,255,.18) 55%, transparent);
  animation: pulsa-magia 4s ease-in-out infinite;
}
@keyframes pulsa-magia { 50% { transform: scale(1.12); opacity: .7; } }
.carta {
  position: absolute; left: 50%; top: 20px; width: 160px; height: 212px; margin-left: -80px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 12px 36px;
  background: radial-gradient(ellipse at 50% 35%, #26315c, #0b1029 75%) center / 84% 88% no-repeat;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.6));
  transition: transform .35s ease, filter .35s ease, opacity .7s ease;
  animation: galleggia 4.5s ease-in-out infinite;
}
.carta:nth-child(2) { animation-delay: -1.5s; }
.carta:nth-child(3) { animation-delay: -3s; }
@keyframes galleggia { 50% { translate: 0 -10px; } }
/* la cornice sta sopra il fondo, il contenuto sopra la cornice */
.carta::after { content: ''; position: absolute; inset: 0; z-index: 1; background: var(--cornice) center / 100% 100% no-repeat; image-rendering: pixelated; pointer-events: none; }
.carta > * { z-index: 2; }
.carta[data-cat="fire"]  { --cornice: url('/img/cornice-fire.png'); }
.carta[data-cat="frost"] { --cornice: url('/img/cornice-frost.png'); }
.carta[data-cat="tower"] { --cornice: url('/img/cornice-tower.png'); }
.carta img { position: absolute; top: 24%; left: 50%; width: 58%; translate: -50% 0; }
.carta b { position: relative; font-size: 14px; color: #fff; text-shadow: 0 2px 0 #000; }
.carta b.rara { color: var(--oro-chiaro); }
.costo {
  position: absolute; top: 4px; left: 4px; width: 32px; height: 32px; display: grid; place-items: center;
  font: 18px var(--pixel); color: #fff; background: radial-gradient(circle at 35% 30%, #9fe3ff, #1f7fc4 60%, #0c3a66);
  border: 2px solid #cfefff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.6), 0 0 10px rgba(127,211,255,.6);
}
.carta:nth-child(1) { transform: translateX(-140px) translateY(24px) rotate(-12deg); }
.carta:nth-child(2) { transform: translateY(0) rotate(0); z-index: 2; }
.carta:nth-child(3) { transform: translateX(140px) translateY(24px) rotate(12deg); }
.js .carta.rivela:not(.visto) { opacity: 0; transform: translateY(60px) rotate(0); }
.ventaglio:hover .carta:nth-child(1) { transform: translateX(-162px) translateY(18px) rotate(-15deg); }
.ventaglio:hover .carta:nth-child(3) { transform: translateX(162px) translateY(18px) rotate(15deg); }
.ventaglio .carta:hover { filter: drop-shadow(0 16px 24px rgba(0,0,0,.6)) drop-shadow(0 0 14px rgba(127,211,255,.55)) brightness(1.12); z-index: 3; }

/* ── Boss: bagliore rosso che pulsa, ritratti che respirano, misteri che tremano ── */
.boss::before { animation: pulsa-rosso 3.5s ease-in-out infinite; }
@keyframes pulsa-rosso { 50% { opacity: .55; } }
.griglia-boss { grid-template-columns: repeat(7, 1fr); gap: 12px; }
.griglia-boss li {
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px 14px; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 30%, rgba(170,24,24,.5), var(--pannello) 72%);
  border: 1px solid rgba(255,110,90,.35);
}
.griglia-boss img { width: 100%; max-width: 128px; aspect-ratio: 1; animation: respira 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.griglia-boss li:nth-child(2) img { animation-delay: -1s; }
.griglia-boss li:nth-child(3) img { animation-delay: -2s; }
@keyframes respira { 50% { transform: scale(1.05); } }
.griglia-boss li:not(.nascosto):hover img { animation: trema .35s linear infinite; filter: drop-shadow(0 0 12px rgba(255,60,40,.8)); }
@keyframes trema { 25% { transform: translate(-2px, 1px) rotate(-1deg); } 75% { transform: translate(2px, -1px) rotate(1deg); } }
.griglia-boss b { font-size: 16px; color: #ffb3a6; line-height: 1.15; min-height: 2.4em; display: flex; align-items: center; }
.griglia-boss span { font-size: 13px; color: var(--testo-tenue); }
.ignoto {
  width: 100%; max-width: 128px; aspect-ratio: 1; display: grid; place-items: center;
  font: 64px var(--pixel); color: rgba(255,179,166,.3);
  background: radial-gradient(circle at 50% 55%, rgba(0,0,0,.65) 20%, transparent 62%);
  animation: tremolio 4s steps(1) infinite;
}
.griglia-boss .nascosto:nth-child(5) .ignoto { animation-delay: -1s; }
.griglia-boss .nascosto:nth-child(6) .ignoto { animation-delay: -2.3s; }
@keyframes tremolio {
  0%, 86%, 100% { transform: none; text-shadow: 0 0 14px rgba(255,90,70,.4); }
  88% { transform: translate(-3px, 1px); text-shadow: 3px 0 #0ff, -3px 0 #f0f; }
  90% { transform: translate(2px, -2px); text-shadow: -2px 0 #0ff, 2px 0 #f0f; }
  92% { transform: none; }
}
.griglia-boss .nascosto { background: radial-gradient(ellipse at 50% 30%, rgba(70,20,80,.55), rgba(6,10,24,.85) 72%); border-color: rgba(160,100,200,.25); }
.griglia-boss .nascosto b { color: rgba(255,179,166,.5); }
.griglia-boss .ultimo { border-color: rgba(255,80,60,.55); box-shadow: 0 0 30px rgba(200,30,30,.25) inset, 0 0 20px rgba(200,30,30,.2); }
.griglia-boss .ultimo .ignoto { color: rgba(255,90,70,.6); }

/* ── Numeri, ognuno col colore di un elemento ── */
.numeri {
  position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 110px;
  background: var(--pannello); border-radius: 16px; padding: 30px 16px; overflow: hidden;
  border: 1px solid var(--pannello-bordo);
}
.numeri::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #7fe7ff, #8fdc4f, #ff5a4a, #c28bff, #f4d03f, #ff9a4a); }
.numeri div { text-align: center; }
.numeri b { display: block; font-size: clamp(36px, 5.4vw, 60px); line-height: 1.1; color: var(--colore); text-shadow: 0 3px 0 rgba(0,0,0,.6), 0 0 18px color-mix(in srgb, var(--colore) 55%, transparent); font-variant-numeric: tabular-nums; }
.numeri span { color: var(--testo-tenue); font-size: 15px; }

/* ── Telefono ── */
.telefono { display: grid; grid-template-columns: 280px 1fr; gap: 56px; align-items: center; max-width: 880px; margin: 0 auto; }
.telefono img { border-radius: 26px; border: 4px solid #2b3658; box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 50px rgba(63,123,255,.3); }
.js .telefono img.visto { animation: galleggia 6s ease-in-out infinite; }
.telefono .occhiello, .telefono h2 { text-align: left; }
.telefono .occhiello::before { margin-left: 0; }
.telefono p:not(.occhiello) { color: var(--testo-tenue); }

/* ── Chiusura ── */
.finale { position: relative; margin-top: 120px; padding: 120px 16px 130px; text-align: center; overflow: hidden; }
.finale-sfondo { position: absolute; inset: 0; background: url('/img/02-notte-orda.webp') center / cover no-repeat; opacity: .35; filter: blur(2px) saturate(1.3); transform: scale(1.05); }
.finale::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 60%, rgba(255,106,31,.25), transparent 60%), linear-gradient(180deg, var(--notte-scura), rgba(6,13,31,.5) 30%, rgba(6,13,31,.5) 70%, var(--notte-scura)); }
.finale .braci { z-index: 1; }
.finale-contenuto { position: relative; z-index: 2; }
.finale h2 { font-size: clamp(36px, 6vw, 72px); background-image: linear-gradient(100deg, #ffb347 30%, #fff1c0 50%, #ff7a2f 70%); }
.finale p { font-family: var(--pixel); font-size: clamp(20px, 2.6vw, 28px); color: var(--testo); margin-bottom: 36px; }
.link-itch { display: block; margin-top: 26px; color: var(--testo-tenue); font-size: 15px; }
.link-itch[aria-disabled="true"] { text-decoration: none; cursor: default; }

footer { text-align: center; padding: 36px 16px 56px; border-top: 1px solid rgba(244,208,63,.12); color: var(--testo-tenue); font-size: 15px; }
footer b { color: var(--testo); }
.footer-lingue { margin-bottom: 18px; line-height: 2; }
.footer-lingue a { color: var(--testo-tenue); }
.footer-lingue a:hover { color: var(--oro); }
.piccolo { font-size: 13px; max-width: 640px; margin: 8px auto 0; }

/* ── Movimento (30/9/2026) — tutto guidato da sito.js, fermo con «riduci movimento» ── */

/* Nebbia che scorre lenta davanti al castello */
.nebbia {
  position: absolute; left: -30%; right: -30%; z-index: 1; pointer-events: none; opacity: .5;
  background: radial-gradient(ellipse 30% 60% at 20% 50%, rgba(150, 170, 230, .22), transparent 70%),
              radial-gradient(ellipse 25% 50% at 60% 55%, rgba(180, 140, 220, .18), transparent 70%),
              radial-gradient(ellipse 35% 55% at 90% 45%, rgba(150, 170, 230, .2), transparent 70%);
  filter: blur(8px);
}
.nebbia-1 { bottom: 4%; height: 38%; animation: nebbia 46s ease-in-out infinite alternate; }
.nebbia-2 { bottom: 18%; height: 30%; opacity: .35; animation: nebbia 64s ease-in-out -20s infinite alternate-reverse; }
@keyframes nebbia { from { transform: translateX(-12%); } to { transform: translateX(12%); } }

/* Braci che seguono il cursore sull'apertura */
.scia {
  position: absolute; z-index: 2; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 1px; pointer-events: none;
  background: var(--c, var(--brace)); box-shadow: 0 0 8px 2px var(--c, var(--brace));
  animation: scia .9s ease-out forwards;
}
@keyframes scia { to { transform: translate(var(--dx, 0), -60px) scale(.2); opacity: 0; } }

/* Titoli che salgono parola per parola (sito.js avvolge le parole in .parola) */
h2 .parola {
  display: inline-block; background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent;
}
.js h2.a-parole .parola { opacity: 0; transform: translateY(.55em) rotate(3deg); transition: opacity .5s ease, transform .6s cubic-bezier(.2, 1.4, .4, 1); transition-delay: calc(var(--i) * 70ms); }
.js h2.a-parole.visto .parola { opacity: 1; transform: none; }

/* Schede che si inclinano verso il mouse, con un riflesso di luce */
.inclina { position: relative; }
.inclina::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .16), transparent 55%);
}
.inclina.inclinato::after { opacity: 1; }
.js .inclina.visto.inclinato {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition: transform .12s ease-out, opacity .7s ease, box-shadow .2s, border-color .2s;
}

/* Bottoni «magnetici»: si spostano un poco verso il cursore */
.btn-gioca { transition: transform .12s, box-shadow .12s, translate .25s ease-out; }

/* ── Tablet ── */
/* ── Carte a carica (3/10/2026): niente energia, la barra si riempie coi match ── */
.carta img.elem { top: 7px; left: 9px; width: 26px; translate: none; image-rendering: pixelated; filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); }
.carica-barra {
  position: absolute; left: 18%; right: 18%; bottom: 18px; height: 8px; z-index: 2;
  background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; overflow: hidden;
}
.carica-barra i { position: absolute; inset: 0 auto 0 0; width: var(--fino); background: linear-gradient(90deg, #ff9a3d, #ffe066); animation: carica-sale 3.2s ease-in-out infinite; }
@keyframes carica-sale { 0% { width: 8%; } 70%, 100% { width: var(--fino); } }
.carta.pronta .carica-barra i { animation: none; width: 100%; background: linear-gradient(90deg, #ffe690, #fff7c8); box-shadow: 0 0 8px #ffe066; }
.carta.pronta { filter: drop-shadow(0 12px 18px rgba(0,0,0,.6)) drop-shadow(0 0 14px rgba(255,214,90,.65)); }
.pronta-scritta {
  position: absolute; top: -14px; left: 50%; translate: -50% 0; z-index: 3; white-space: nowrap;
  font: 12px var(--pixel); color: #3d2a00; background: var(--oro-chiaro); padding: 3px 8px; border-radius: 4px;
  box-shadow: 0 2px 0 var(--oro-ombra); animation: pronta-pulsa 1.1s ease-in-out infinite;
}
@keyframes pronta-pulsa { 50% { scale: 1.08; } }

/* ── Zix il contrabbandiere ── */
.zix { display: grid; grid-template-columns: 5fr 6fr; gap: 40px; align-items: center; }
.zix .occhiello, .zix h2 { text-align: left; }
.zix .occhiello::before { margin-left: 0; }
.zix-testo p:not(.occhiello) { color: var(--testo-tenue); }
.zix-ritratto { position: relative; margin: 0; display: flex; justify-content: center; }
.zix-ritratto img { height: 340px; width: auto; filter: drop-shadow(0 14px 22px rgba(0,0,0,.6)); animation: galleggia 5s ease-in-out infinite; }
.zix-nuvola {
  position: absolute; top: 4px; right: 4%; max-width: 210px; z-index: 2;
  background: #fffaf0; color: #1b1b24; font: 600 14px/1.35 var(--corpo); padding: 10px 14px; border-radius: 14px;
  border: 3px solid #1b1b24; box-shadow: 4px 4px 0 rgba(0,0,0,.45); rotate: 3deg;
}
.zix-nuvola::after { content: ''; position: absolute; left: 18px; bottom: -14px; border: 8px solid transparent; border-top-color: #1b1b24; border-right-color: #1b1b24; }
.zix-musica { font-style: italic; }
@media (max-width: 980px) {
  .zix { grid-template-columns: 1fr; gap: 20px; }
  .zix .occhiello, .zix h2 { text-align: center; }
  .zix .occhiello::before { margin-left: auto; }
  .zix-testo { text-align: center; max-width: 620px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .zix-ritratto img { height: 240px; }
  .zix-nuvola { font-size: 12px; max-width: 160px; right: 0; }
  .carta img.elem { width: 18px; top: 5px; left: 6px; }
  .carica-barra { bottom: 12px; height: 6px; }
  .pronta-scritta { font-size: 10px; top: -12px; }
}

@media (max-width: 980px) {
  .barra-link { display: none; }
  .barra .btn-piccolo { margin-left: auto; }
  .passi { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .ciclo, .carte { grid-template-columns: 1fr; gap: 28px; }
  .ciclo-testo, .carte-testo { text-align: center; }
  .ciclo .occhiello, .ciclo h2, .carte .occhiello, .carte h2 { text-align: center; }
  .ciclo .occhiello::before, .carte .occhiello::before { margin-left: auto; }
  .ciclo-testo p:not(.occhiello) { min-height: 0; max-width: 560px; margin-left: auto; margin-right: auto; }
  .carte-testo { order: -1; max-width: 620px; margin: 0 auto; }
  .griglia-torri { grid-template-columns: repeat(2, 1fr); }
  .griglia-orda { grid-template-columns: repeat(3, 1fr); }
  .griglia-boss { grid-template-columns: repeat(4, 1fr); }
  .numeri { grid-template-columns: repeat(3, 1fr); row-gap: 24px; }
}
/* ── Telefono ── */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .sezione { padding-top: 84px; }
  .tessere-volanti img:nth-child(n+5) { display: none; }
  .griglia-torri { grid-template-columns: 1fr; }
  .griglia-orda { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .griglia-orda .sprite { width: 96px; height: 96px; }
  .griglia-boss { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .griglia-boss li { padding: 10px 4px; }
  .griglia-boss b { font-size: 13px; }
  .griglia-boss span { font-size: 12px; }
  .ignoto { font-size: 44px; }
  .griglia-boss .ultimo { grid-column: 2; }
  .ventaglio { height: 220px; }
  .ventaglio::before { width: 280px; height: 200px; }
  .carta { width: 108px; height: 143px; margin-left: -54px; padding-bottom: 24px; }
  .carta:nth-child(1) { transform: translateX(-100px) translateY(14px) rotate(-8deg); }
  .carta:nth-child(3) { transform: translateX(100px) translateY(14px) rotate(8deg); }
  .ventaglio:hover .carta:nth-child(1) { transform: translateX(-104px) translateY(12px) rotate(-9deg); }
  .ventaglio:hover .carta:nth-child(3) { transform: translateX(104px) translateY(12px) rotate(9deg); }
  .carta b { font-size: 11px; }
  .costo { width: 24px; height: 24px; font-size: 14px; }
  .telefono { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .telefono img { max-width: 230px; margin: 0 auto; }
  .telefono .occhiello, .telefono h2 { text-align: center; }
  .telefono .occhiello::before { margin-left: auto; }
  .btn { font-size: 18px; padding: 13px 18px; }
  .btn-piccolo { font-size: 15px; padding: 7px 12px; }
  .btn-grande { font-size: 20px; padding: 16px 20px; }
  .nastro span { font-size: 16px; padding: 10px 0; }
  .finale { padding: 90px 16px 100px; }
}
@media (max-width: 380px) {
  .barra-nome { font-size: 17px; letter-spacing: 1px; }
  .disegno img { width: 46px; height: 46px; }
  .disegno-scambio { --passo: 82px; }
  .disegno .tris img { width: 32px; height: 32px; }
  .griglia-orda .sprite { width: 84px; height: 84px; }
}

/* ── Riduci movimento: tutto fermo e visibile ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .braci, .btn-luccica::after { display: none; }   /* sito.js segna subito tutto come .visto */
}

/* 4/10/2026: nemici visti di fronte (immagine singola, respirano) e 9 schede: 6 + 3 centrate */
.sprite.fronte { background-size: contain; background-position: center bottom; animation: respiroNemico 1.8s ease-in-out infinite; transform-origin: 50% 100%; }
.griglia-orda li:nth-child(3n+2) .sprite.fronte { animation-delay: -.6s; } .griglia-orda li:nth-child(3n) .sprite.fronte { animation-delay: -1.2s; }
@keyframes respiroNemico { 0%, 100% { scale: 1 1; } 50% { scale: 1.03 .97; translate: 0 1px; } }
.griglia-orda { display: flex !important; flex-wrap: wrap; justify-content: center; }
.griglia-orda li { flex: 0 1 calc((100% - 5 * 14px) / 6); }
@media (max-width: 900px) { .griglia-orda li { flex-basis: calc((100% - 2 * 14px) / 3); } }

/* ═══ NUOVO (road map fase 5, TEST sandbox): BETA, viaggio, isole, incanti, Caserma, bottino ═══ */
.logo-beta { position: relative; display: inline-block; }
.beta { position: absolute; right: -2%; top: 8%; transform: rotate(12deg); font-family: var(--pixel); font-size: clamp(14px, 2vw, 22px);
  padding: 4px 12px; color: #2a1200; background: linear-gradient(#ffe690, #f4b03f); border: 3px solid #6b4a00; border-radius: 6px;
  box-shadow: 0 4px 0 #6b4a00, 0 0 22px rgba(244,208,63,.6); animation: betaPulsa 2.4s ease-in-out infinite; }
@keyframes betaPulsa { 50% { transform: rotate(12deg) scale(1.08); box-shadow: 0 4px 0 #6b4a00, 0 0 34px rgba(244,208,63,.9); } }

/* il viaggio: mappa con la nave che salpa di isola in isola */
.arcipelago { position: relative; width: min(94vw, var(--larghezza)); aspect-ratio: 16 / 9; margin: 0 auto; border-radius: 14px; overflow: hidden;
  border: 3px solid rgba(244,208,63,.35); box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 0 80px rgba(0,10,30,.6); background: #0d3a5c; }
.ap-mare { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; image-rendering: pixelated; filter: brightness(.75) saturate(.9); }
.arcipelago::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(2,8,22,.6) 100%); }
.ap-rotte { position: absolute; inset: 0; width: 100%; height: 100%; }
.ap-rotte path { fill: none; stroke: #ffe08a; stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round; vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 3px rgba(255,224,138,.8)); animation: rottaScorre 1.4s linear infinite; }
@keyframes rottaScorre { to { stroke-dashoffset: -24; } }
.ap-isola { position: absolute; z-index: 1; width: clamp(58px, 11%, 128px); transform: translate(-50%, -50%); text-align: center; }
.ap-isola img { width: 100%; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); animation: galleggia 4s ease-in-out infinite; }
.ap-isola:nth-child(odd) img { animation-delay: -2s; }
.ap-isola span { display: block; font-family: var(--pixel); font-size: clamp(9px, 1.2vw, 14px); color: #fff3c4; text-shadow: 0 2px 0 #000, 0 0 6px #000; white-space: nowrap; }
@keyframes galleggia { 50% { transform: translateY(-5px); } }
.ap-nave { position: absolute; z-index: 2; width: clamp(44px, 8%, 96px); left: 17%; top: 77%; transform: translate(-50%, -50%);
  image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.js .arcipelago .ap-isola:not(:first-of-type) { filter: grayscale(.85) brightness(.55); }
.js .arcipelago.visto .ap-isola:not(:first-of-type) { animation: liberata .9s ease-out forwards; animation-delay: calc(var(--i) * 2.6s); }
@keyframes liberata { 0% { filter: grayscale(.85) brightness(.55); transform: translate(-50%, -50%); }
  45% { filter: brightness(1.6) drop-shadow(0 0 18px #ffe08a); transform: translate(-50%, -50%) scale(1.15); }
  100% { filter: none; transform: translate(-50%, -50%); } }
.js .arcipelago.visto .ap-nave { animation: rotta 15.6s ease-in-out forwards, dondola 2.2s ease-in-out infinite; }
@keyframes rotta {
  0.00% { left: 17%; top: 77%; }
  4.17% { left: 17%; top: 77%; }
  16.67% { left: 34%; top: 52%; }
  20.83% { left: 34%; top: 52%; }
  33.33% { left: 51%; top: 27%; }
  37.50% { left: 51%; top: 27%; }
  50.00% { left: 57%; top: 73%; }
  54.17% { left: 57%; top: 73%; }
  66.67% { left: 74%; top: 55%; }
  70.83% { left: 74%; top: 55%; }
  83.33% { left: 87%; top: 29%; }
  87.50% { left: 87%; top: 29%; }
  100.00% { left: 93%; top: 79%; }
}
@keyframes dondola { 50% { rotate: -5deg; } }
.nota-viaggio { text-align: center; color: var(--testo-tenue); font-size: 15px; margin-top: 16px; }

/* le isole e i loro signori */
.griglia-isole { list-style: none; padding: 0; margin: 0 auto; width: min(94vw, var(--larghezza)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.griglia-isole li { position: relative; padding: 16px 16px 18px; border-radius: 12px; background: var(--pannello); border: 2px solid color-mix(in srgb, var(--colore) 55%, transparent);
  box-shadow: inset 0 0 40px color-mix(in srgb, var(--colore) 14%, transparent); text-align: center; transition: transform .2s, box-shadow .2s; }
.griglia-isole li:hover { transform: translateY(-4px); box-shadow: inset 0 0 40px color-mix(in srgb, var(--colore) 22%, transparent), 0 10px 30px color-mix(in srgb, var(--colore) 30%, transparent); }
.ci-arte { position: relative; height: 150px; display: grid; place-items: center; }
.ci-isola { width: 120px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); }
.ci-boss { position: absolute; right: 2%; bottom: -6px; width: 104px; image-rendering: pixelated; filter: drop-shadow(0 0 10px var(--colore)); animation: galleggia 3s ease-in-out infinite; }
.griglia-isole li:hover .ci-boss { animation: trema .35s linear infinite; }
.ci-cap { display: block; font-family: var(--pixel); font-size: 13px; letter-spacing: 3px; color: var(--testo-tenue); margin-top: 8px; }
.griglia-isole b { display: block; font-family: var(--pixel); font-weight: 400; font-size: 22px; color: color-mix(in srgb, var(--colore) 70%, white); margin: 2px 0 6px; }
.griglia-isole p { font-size: 16px; color: var(--testo); margin: 0 0 10px; }
.ci-signore { font-family: var(--pixel); font-size: 14px; color: #ffb3a6; }

/* gli incanti: l'anello animato (3 fotogrammi PixelLab) attorno al soldato */
.griglia-incanti { list-style: none; padding: 0; margin: 0 auto; width: min(94vw, var(--larghezza)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.griglia-incanti li { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; align-items: center; padding: 14px;
  border-radius: 12px; background: var(--pannello); border: 2px solid color-mix(in srgb, var(--colore) 45%, transparent); }
.anello { grid-row: span 2; width: 112px; height: 112px; display: grid; place-items: center; background: var(--foglio) 0 0 / 300% 100% no-repeat;
  image-rendering: pixelated; animation: anelloFotogrammi .6s steps(3) infinite; }
.anello img { width: 72%; image-rendering: pixelated; filter: drop-shadow(0 3px 0 rgba(0,0,0,.45)); animation: respira 3.2s ease-in-out infinite; }
@keyframes anelloFotogrammi { to { background-position: 150% 0; } }
.griglia-incanti b { font-family: var(--pixel); font-weight: 400; font-size: 20px; color: color-mix(in srgb, var(--colore) 70%, white); align-self: end; }
.griglia-incanti p { margin: 0; font-size: 16px; align-self: start; }

/* Zix: le bancarelle */
.bancarelle { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.bancarelle img { width: 76px; image-rendering: pixelated; filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); transition: transform .15s; }
.bancarelle img:hover { transform: translateY(-4px) scale(1.06); }

/* la Caserma e il bottino */
.caserma { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px 40px; align-items: center; width: min(94vw, var(--larghezza)); margin: 0 auto; }
.caserma .occhiello, .caserma h2 { text-align: left; }
.caserma .occhiello::before { margin-left: 0; }
.cs-veterani { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.cs-veterani img { width: 110px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.4)); animation: respira 3.2s ease-in-out infinite; }
.cs-veterani img.vet { width: 150px; filter: drop-shadow(0 0 16px #ffd76a) drop-shadow(0 6px 0 rgba(0,0,0,.4)); animation-delay: -1.2s; }
.bottino { grid-column: 1 / -1; display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: center; padding: 22px; border-radius: 14px;
  background: var(--pannello); border: 2px solid var(--pannello-bordo); }
.forziere { display: grid; place-items: center; }
.forziere img { width: 150px; image-rendering: pixelated; filter: drop-shadow(0 0 20px rgba(244,208,63,.55)); animation: trema 1.6s ease-in-out infinite; }
.bottino h3 { font-size: 24px; margin: 0 0 6px; color: var(--oro-chiaro); }
.oggetti { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ogg { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: rgba(0,0,0,.45); border: 2px solid var(--r, #b8c2cc);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--r, #b8c2cc) 35%, transparent); transition: transform .15s; }
.ogg:hover { transform: translateY(-3px) rotate(-4deg); }
.ogg img { width: 44px; image-rendering: pixelated; }
.ogg.raro { --r: #5dade2; } .ogg.epico { --r: #bb8fce; } .ogg.leggendario { --r: #f4d03f; }

@media (max-width: 900px) {
  .griglia-isole, .griglia-incanti { grid-template-columns: repeat(2, 1fr); }
  .caserma { grid-template-columns: 1fr; }
  .caserma .occhiello, .caserma h2 { text-align: center; }
}
@media (max-width: 600px) {
  .griglia-isole, .griglia-incanti { grid-template-columns: 1fr; }
  .bottino { grid-template-columns: 1fr; text-align: center; }
  .oggetti { justify-content: center; }
  .ap-isola span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-nave, .ap-isola, .ap-isola img, .ap-rotte path, .anello, .beta, .forziere img { animation: none !important; }
  .js .arcipelago .ap-isola { filter: none !important; }
}
