/* Nonna Maryland · 80 candeline sul mare — dal cielo (copertina) al mare (invito) alla sabbia (dediche, foto). */

@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes.woff2?v=14") format("woff2"); font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair.woff2?v=14") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-italic.woff2?v=14") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("/fonts/jost.woff2?v=14") format("woff2"); font-weight: 300 600; font-display: swap; }

:root {
  --ivory: #fbf7ef;
  --paper: #fffdf8;
  --sand: #f5ecda;
  --ink: #13234b;
  --ink-2: #33416a;
  --muted: #69718a;
  --gold: #c9921f;
  --gold-light: #ecc261;
  --gold-text: #946409;
  --sea-top: #4b97cc;
  --sea-mid: #2a72ac;
  --sea-deep: #18487a;
  --line: rgba(19, 35, 75, .14);
  --gold-foil: linear-gradient(100deg, #9a680b 0%, #d9a42e 22%, #fbe3a1 40%, #e0ab35 55%, #a87411 78%, #e6b648 100%);
  --script: "Great Vibes", "Snell Roundhand", cursive;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: max(18px, env(safe-area-inset-left));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; }

/* ---------- tenda a righe da stabilimento ---------- */
.awning { filter: drop-shadow(0 4px 3px rgba(19, 35, 75, .16)); position: relative; z-index: 2; }
.awning::before {
  content: "";
  display: block;
  height: 46px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 32px, var(--paper) 32px 64px);
  -webkit-mask: radial-gradient(16px at 50% 0, #000 calc(100% - .5px), #0000) 0 100% / 32px 16px repeat-x,
                linear-gradient(#000 0 0) 0 0 / 100% 30px no-repeat;
          mask: radial-gradient(16px at 50% 0, #000 calc(100% - .5px), #0000) 0 100% / 32px 16px repeat-x,
                linear-gradient(#000 0 0) 0 0 / 100% 30px no-repeat;
}

/* ---------- copertina ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 26px var(--gutter) 0;
  margin-top: -46px;
  padding-top: 72px;
  background:
    radial-gradient(110% 55% at 50% 0%, #fff3d2 0%, rgba(255, 243, 210, 0) 70%),
    linear-gradient(#fdf9f0, #f6efe2 78%, #eef1ec);
  overflow: hidden;
}
.eyebrow {
  margin: 0;
  font: 600 .8rem/1 var(--serif);
  letter-spacing: .44em;
  padding-left: .44em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 14px 0 0;
  font: 400 clamp(3.5rem, 16vw, 6.8rem)/1.05 var(--script);
  letter-spacing: .01em;
}
.arch {
  --aw: min(72vw, 360px);
  position: relative;
  width: var(--aw);
  margin: 26px auto 0;
}
.arch img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: calc(var(--aw) / 2) calc(var(--aw) / 2) 8px 8px;
  box-shadow: 0 22px 40px -18px rgba(19, 35, 75, .45);
  background: #e9e2d2;
}
.arch::before {                /* filo d'oro attorno all'arco */
  content: "";
  position: absolute;
  inset: -11px;
  border: 1.5px solid var(--gold);
  border-radius: calc(var(--aw) / 2 + 11px) calc(var(--aw) / 2 + 11px) 12px 12px;
  pointer-events: none;
}
.arch::after {                 /* passe-partout chiaro dentro la foto */
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: calc(var(--aw) / 2 - 9px) calc(var(--aw) / 2 - 9px) 4px 4px;
  pointer-events: none;
}
.seal {
  position: absolute;
  z-index: 1;
  right: calc(var(--aw) * -.12);
  bottom: calc(var(--aw) * .1);
  width: calc(var(--aw) * .36);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  background: radial-gradient(circle at 32% 28%, #2a4278, var(--ink) 68%);
  box-shadow: 0 14px 26px -8px rgba(19, 35, 75, .55), inset 0 0 0 5px var(--ink), inset 0 0 0 6.5px var(--gold);
  transform: rotate(-9deg);
}
.seal b {
  display: block;
  font: 800 calc(var(--aw) * .155)/.9 var(--serif);
  background: var(--gold-foil);
  background-size: 260% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: shine 7s ease-in-out infinite;
}
.seal small {
  display: block;
  margin-top: -.1em;
  font: 400 calc(var(--aw) * .075)/1 var(--script);
  color: var(--gold-light);
}
@keyframes shine { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.tagline { margin: 34px 0 0; }
.tagline strong {
  display: block;
  font: 800 clamp(2.7rem, 12.5vw, 4.8rem)/1 var(--serif);
  background: var(--gold-foil);
  background-size: 260% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: shine 7s ease-in-out infinite;
  padding-bottom: .06em;
}
.tagline em {
  display: block;
  font: italic 700 clamp(2.3rem, 10.5vw, 4rem)/1.05 var(--serif);
}
.when { margin: 26px 0 0; }
.when b { display: block; font: 600 clamp(1.35rem, 5.6vw, 1.75rem)/1.3 var(--serif); }
.when span { display: block; margin-top: 2px; font: 400 clamp(2.1rem, 9vw, 2.8rem)/1.2 var(--script); }
.when small { display: block; margin-top: 6px; font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

.countdown {
  display: flex;
  justify-content: center;
  margin: 30px auto 0;
  max-width: 360px;
}
.countdown div { flex: 1; padding: 2px 6px; }
.countdown div + div { border-left: 1px solid rgba(201, 146, 31, .55); }
.countdown b { display: block; font: 600 2.35rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown span { display: block; margin-top: 6px; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.countdown-note { margin: 22px 0 0; font: italic 500 1.3rem/1.4 var(--serif); }
.hero .btn-gold { margin-top: 24px; }

/* il mare in fondo alla copertina: tre onde che scorrono piano */
.waves { position: relative; height: 120px; margin-top: 44px; margin-inline: calc(var(--gutter) * -1); }
.waves svg { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; }
.waves .w1 { fill: #a9d0ea; animation: drift 26s linear infinite; bottom: 18px; opacity: .8; }
.waves .w2 { fill: #74b0dc; animation: drift 19s linear infinite reverse; bottom: 8px; }
.waves .w3 { fill: var(--sea-top); animation: drift 14s linear infinite; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- sezioni ---------- */
.section { padding: 64px var(--gutter) 72px; }
.section > * { max-width: 620px; margin-inline: auto; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; width: 54px; height: 1px; background: currentColor; opacity: .7; }
.ornament svg { width: 54px; height: 32px; }
.section h2 {
  margin: 12px auto 0;
  text-align: center;
  font: italic 600 clamp(2.2rem, 9vw, 3rem)/1.1 var(--serif);
}
.lead { text-align: center; margin: 14px auto 0; color: var(--ink-2); font-size: 1.12rem; }

/* il mare: invito */
.sea {
  position: relative;
  color: var(--paper);
  background: linear-gradient(var(--sea-top), var(--sea-mid) 45%, var(--sea-deep));
  padding-bottom: 120px;
  overflow: hidden;
}
.sea .lead { color: rgba(255, 253, 248, .88); }
.sea .ornament { color: var(--gold-light); }
.glitter i {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  animation: twinkle 5s ease-in-out infinite;
}
.glitter i:nth-child(1) { left: 8%; top: 5%; animation-delay: .2s; }
.glitter i:nth-child(2) { left: 86%; top: 9%; animation-delay: 1.9s; width: 10px; height: 10px; }
.glitter i:nth-child(3) { left: 22%; top: 30%; animation-delay: 3.1s; width: 9px; height: 9px; }
.glitter i:nth-child(4) { left: 93%; top: 38%; animation-delay: .9s; }
.glitter i:nth-child(5) { left: 4%; top: 58%; animation-delay: 2.6s; width: 11px; height: 11px; }
.glitter i:nth-child(6) { left: 90%; top: 70%; animation-delay: 4.1s; width: 9px; height: 9px; }
.glitter i:nth-child(7) { left: 12%; top: 84%; animation-delay: 1.4s; }
.glitter i:nth-child(8) { left: 74%; top: 90%; animation-delay: 3.6s; width: 10px; height: 10px; }
.glitter i:nth-child(9) { left: 48%; top: 3%; animation-delay: 2.2s; width: 8px; height: 8px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: .95; transform: scale(1) rotate(45deg); } }
.shore { position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; width: 100%; }
.shore .foam { fill: rgba(255, 255, 255, .55); }
.shore .beach { fill: var(--sand); }

/* il biglietto */
.ticket {
  position: relative;
  margin-top: 34px;
  padding: 30px 22px 26px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 30px 60px -24px rgba(6, 22, 48, .7);
  text-align: center;
}
.ticket::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 146, 31, .65);
  outline: 1px solid rgba(201, 146, 31, .3);
  outline-offset: 3px;
  border-radius: 3px;
  pointer-events: none;
}
.ticket > * { position: relative; }
.label {
  margin: 0;
  font: 600 .74rem/1 var(--sans);
  letter-spacing: .32em;
  padding-left: .32em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.big { margin: 10px 0 0; font: 600 clamp(1.45rem, 6.4vw, 1.8rem)/1.25 var(--serif); }
.big + .big { margin-top: 2px; }
.addr { margin: 8px 0 0; color: var(--ink-2); line-height: 1.45; }
.ticket hr {
  margin: 28px auto;
  width: 70%;
  border: 0;
  height: 12px;
  background: radial-gradient(circle, var(--gold) 2.5px, transparent 3px) center / 12px 12px no-repeat,
              linear-gradient(var(--gold), var(--gold)) left center / calc(50% - 14px) 1px no-repeat,
              linear-gradient(var(--gold), var(--gold)) right center / calc(50% - 14px) 1px no-repeat;
  opacity: .8;
}

.map {
  display: block;
  position: relative;
  margin: 22px -6px 0;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 6 / 5;
  box-shadow: inset 0 0 0 1px var(--line);
}
.map img { display: block; width: 100%; height: 100%; }
.map .pin {
  position: absolute;
  left: 37.22%;
  top: 52.67%;
  width: 34px;
  height: 46px;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 4px 4px rgba(19, 35, 75, .35));
}
.map .pin-label {
  position: absolute;
  left: calc(37.22% + 20px);
  top: calc(52.67% - 44px);
  padding: 5px 11px 6px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font: italic 600 .95rem/1 var(--serif);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(19, 35, 75, .25);
}
.map .sea-label {
  position: absolute;
  left: 4%;
  top: 76%;
  font: italic 500 1rem/1 var(--serif);
  letter-spacing: .18em;
  color: #4d7fa6;
  transform: rotate(-66deg);
  transform-origin: left top;
}
.map .town-label {
  position: absolute;
  left: 66%;
  top: 22%;
  font: italic 600 1.15rem/1 var(--serif);
  color: var(--ink);
  background: rgba(251, 247, 239, .85);
  padding: 2px 6px;
}
.nav-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin-top: 18px; }
.meteo {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f3f0e6;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.meteo b { color: var(--ink); font-weight: 500; }
.ticket .note { margin: 16px 0 0; font-size: .95rem; color: var(--muted); }

/* ---------- pulsanti ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  min-height: 50px;
  padding: 0 1.35em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 1rem/1.15 var(--sans);
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-small { min-height: 46px; padding: 0 .9em; font-size: .95rem; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-gold {
  border-color: #b48119;
  background: linear-gradient(180deg, #f0c766, #cf9a2a);
  color: #2a1d04;
  box-shadow: 0 10px 22px -10px rgba(170, 115, 15, .8);
}
.btn-light { border-color: rgba(255, 253, 248, .8); color: var(--paper); }
.btn-wide { width: 100%; }
.ticket .btn { margin-top: 18px; }
.ticket .nav-btns .btn { margin-top: 0; }

/* ---------- la sabbia: dediche e foto ---------- */
.sand { background: var(--sand); }
.sand + .sand { padding-top: 24px; }

.card {
  margin-top: 30px;
  padding: 24px 20px;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 18px 40px -26px rgba(84, 62, 20, .55), 0 0 0 1px rgba(201, 146, 31, .18);
}
.field { display: block; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field > span { display: block; margin-bottom: 6px; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.field > span small { letter-spacing: 0; text-transform: none; font-size: .9rem; color: var(--muted); }
.field input, .field textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(19, 35, 75, .22);
  border-radius: 10px;
  background: #fff;
  font-size: 1.06rem;
  line-height: 1.45;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 146, 31, .2); }
.form .btn { margin-top: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.msg { margin: 12px 0 0; min-height: 1.2em; font-size: 1rem; text-align: center; }
.msg.err { color: #a3302a; }
.msg.ok { color: #2f6b3a; }

/* le dediche: cartoline */
.dediche { margin-top: 34px; display: grid; gap: 22px; }
.dedica {
  position: relative;
  padding: 24px 22px 18px;
  background:
    repeating-linear-gradient(transparent 0 31px, rgba(19, 35, 75, .06) 31px 32px) 0 18px / 100% calc(100% - 46px) no-repeat,
    var(--paper);
  border-radius: 4px;
  box-shadow: 0 14px 28px -18px rgba(84, 62, 20, .6), 0 0 0 1px rgba(19, 35, 75, .05);
  transform: rotate(-.6deg);
}
.dedica:nth-child(even) { transform: rotate(.5deg); }
.dedica::after {               /* francobollo */
  content: "80";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 44px;
  display: grid;
  place-items: center;
  font: 800 .95rem/1 var(--serif);
  color: var(--gold-text);
  border: 1.5px dashed rgba(201, 146, 31, .7);
  border-radius: 3px;
  background: #fbf3df;
}
.dedica p { margin: 0; padding-right: 46px; white-space: pre-line; overflow-wrap: anywhere; font: italic 400 1.14rem/1.75 var(--serif); }
.dedica footer { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 10px; }
.dedica .firma { font: 400 2rem/1.1 var(--script); color: var(--ink); overflow-wrap: anywhere; }
.dedica time { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.mine { margin-top: 8px; display: flex; justify-content: flex-end; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--muted); font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.more { display: flex; justify-content: center; margin-top: 26px; }
.empty { text-align: center; color: var(--muted); font-style: italic; margin-top: 26px; }

/* scrivi / a voce */
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  border-radius: 999px;
  background: #f1eadb;
}
.mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 500 1rem/1 var(--sans);
  cursor: pointer;
}
.mode svg { width: 18px; height: 18px; }
.mode[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgba(19, 35, 75, .14); }
[data-pane] { margin-top: 16px; }
.rec { text-align: center; }
.rec-btn {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 10px auto 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #f0c766, #cf9a2a);
  color: #2a1d04;
  box-shadow: 0 14px 26px -12px rgba(170, 115, 15, .85), 0 0 0 7px rgba(201, 146, 31, .16);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rec-btn svg { width: 40px; height: 40px; }
.rec-btn.on { background: #b3261e; color: #fff; animation: rec-pulse 1.6s ease-out infinite; }
@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .45); } 100% { box-shadow: 0 0 0 24px rgba(179, 38, 30, 0); } }
.rec-status { margin: 14px 0 0; color: var(--ink-2); font-size: 1rem; }
.rec-status b { color: #b3261e; font-weight: 500; font-feature-settings: "tnum" 1; }
.rec-meter { display: flex; align-items: center; justify-content: center; gap: 3px; height: 36px; margin-top: 8px; }
.rec-meter i { width: 4px; height: 4px; border-radius: 2px; background: var(--gold); transition: height .08s linear; }
.rec-preview { margin-top: 12px; padding: 12px 12px 12px 10px; border-radius: 12px; background: #f6f1e5; text-align: left; }
.rec-preview .voice { padding-right: 0; }
#rec-redo { margin-top: 6px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* lettore dei vocali */
.voice { display: flex; align-items: center; gap: 12px; padding-right: 48px; }
.voice .play {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold-light);
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(19, 35, 75, .6);
}
.voice .play svg { width: 22px; height: 22px; }
.wave { position: relative; flex: 1; min-width: 0; height: 42px; cursor: pointer; }
.wave .bars { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.wave .bars i { flex: 1; min-width: 1px; border-radius: 2px; background: rgba(19, 35, 75, .22); }
.wave .fg { clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.wave .fg i { background: var(--gold); }
.vtime { flex: none; min-width: 2.7em; text-align: right; font-size: .92rem; color: var(--muted); font-feature-settings: "tnum" 1; }
.dedica .vlabel { margin: 0 0 8px; padding: 0; font: 500 .74rem/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-text); }

/* le foto */
.upload { text-align: center; }
.upload .field { text-align: left; }
.upload .btn { margin-top: 18px; min-height: 58px; font-size: 1.08rem; }
.upload .hint { margin: 12px 0 0; font-size: .92rem; color: var(--muted); }
.queue { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.queue li { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; background: #f6f1e5; font-size: .95rem; }
.queue img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: #e7dfcc; }
.queue .bar { height: 5px; margin-top: 6px; border-radius: 3px; background: rgba(19, 35, 75, .12); overflow: hidden; }
.queue .bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.queue .err { color: #a3302a; }
.queue .done { color: #2f6b3a; }
.count { margin: 30px 0 0; text-align: center; font: italic 500 1.15rem var(--serif); color: var(--ink-2); }
/* foto intere, a mosaico: colonne che seguono la forma di ogni foto (niente ritagli) */
.gallery {
  columns: 2;
  column-gap: 6px;
  margin-top: 16px;
  max-width: 900px;
}
.gallery button { display: block; width: 100%; margin: 0 0 6px; padding: 0; border: 0; background: #e9e0cc; border-radius: 4px; overflow: hidden; break-inside: avoid; cursor: zoom-in; }
.gallery img { display: block; width: 100%; height: auto; transition: transform .4s ease; }
.gallery button:hover img { transform: scale(1.03); }

/* la foto con la cornice */
.frame-card { display: grid; grid-template-columns: 116px 1fr; gap: 18px; align-items: center; }
.frame-sample { display: block; width: 116px; height: 145px; border-radius: 3px; background: #efe7d6; box-shadow: 0 12px 24px -14px rgba(84, 62, 20, .7); transform: rotate(-2deg); }
.frame-title { margin: 0; font: italic 600 1.35rem/1.2 var(--serif); }
.frame-text { margin: 6px 0 0; font-size: .98rem; line-height: 1.45; color: var(--ink-2); }
.frame-card .btn { margin-top: 14px; min-height: 48px; }
.booth-in { height: 100%; display: grid; grid-template-rows: 1fr auto auto; }
.booth-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 64px 14px 6px; }
.booth-stage canvas { display: block; max-width: min(100%, calc(100vw - 28px)); max-height: calc(100dvh - 230px); width: auto; height: auto; border-radius: 3px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.booth-stage video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.booth-stage.flash::after { content: ""; position: absolute; inset: 0; background: #fff; pointer-events: none; animation: flash .45s ease-out forwards; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.booth-msg { margin: 0; padding: 4px 20px 0; min-height: 1.6em; text-align: center; font-size: .98rem; color: rgba(255, 253, 248, .88); }
.booth-bar { display: flex; align-items: center; justify-content: space-around; padding: 12px 16px max(18px, env(safe-area-inset-bottom)); }
.booth-done { flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.shutter { width: 80px; height: 80px; border: 4px solid var(--paper); border-radius: 50%; background: linear-gradient(180deg, #f0c766, #cf9a2a); box-shadow: 0 0 0 5px rgba(236, 194, 97, .4); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shutter:active { transform: scale(.93); }
.booth-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 74px; padding: 6px; border: 0; background: none; color: var(--paper); font-size: .85rem; cursor: pointer; }
.booth-side svg { width: 28px; height: 28px; }
.link-btn.light { color: rgba(255, 253, 248, .8); }
.booth-name { flex-basis: 100%; max-width: 320px; min-height: 48px; padding: 0 18px; border: 1px solid rgba(255, 253, 248, .45); border-radius: 999px; background: rgba(255, 253, 248, .1); color: var(--paper); font-size: 1.05rem; text-align: center; }
.booth-name::placeholder { color: rgba(255, 253, 248, .6); }
.booth-name:focus { outline: none; border-color: var(--gold-light); }

/* galleria a schermo intero */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 15, 33, .96);
  color: var(--paper);
}
.lightbox::backdrop { background: rgba(8, 15, 33, .96); }
.lightbox figure { margin: 0; height: 100%; display: grid; grid-template-rows: 1fr auto; }
.lightbox .stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 60px 8px 8px; touch-action: pan-y pinch-zoom; }
/* la foto riempie lo spazio libero e si adatta intera (su desktop max-height:100% qui non si risolveva: usciva dalla finestra) */
.lightbox .stage img { position: absolute; left: 8px; top: 60px; width: calc(100% - 16px); height: calc(100% - 68px); object-fit: contain; user-select: none; -webkit-user-select: none; }
.lightbox figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); font-size: .98rem; text-align: center; }
.lightbox figcaption .who { flex-basis: 100%; color: rgba(255, 253, 248, .8); }
.lightbox figcaption a, .lightbox figcaption button { color: var(--paper); }
.lb-btn {
  position: absolute;
  z-index: 1;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 253, 248, .35);
  border-radius: 50%;
  background: rgba(8, 15, 33, .55);
  color: var(--paper);
  cursor: pointer;
}
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: max(10px, env(safe-area-inset-top)); right: 10px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- piede ---------- */
.foot {
  position: relative;
  padding: 70px var(--gutter) calc(52px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--paper);
  background: var(--ink);
}
.foot .script { margin: 0; font: 400 3.2rem/1.1 var(--script); color: var(--gold-light); }
.foot .date { margin: 8px 0 0; font-size: .9rem; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 253, 248, .75); }
.foot .btn { margin-top: 26px; }
.foot .tiny { margin: 30px 0 0; font-size: .78rem; color: rgba(255, 253, 248, .45); }
.foot .tiny a { color: inherit; }

/* ---------- schermi larghi ---------- */
@media (min-width: 760px) {
  .ticket { padding: 40px 44px 34px; }
  .gallery { columns: 3; column-gap: 8px; }
  .gallery button { margin-bottom: 8px; }
  .section > .gallery { max-width: 900px; }
  .dediche { grid-template-columns: 1fr 1fr; align-items: start; max-width: 900px; }
  .section > .dediche { max-width: 900px; }
}
@media (min-width: 1100px) {
  .gallery { columns: 4; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .waves svg, .glitter i, .seal b, .tagline strong { animation: none !important; }
  .glitter i { opacity: .7; }
}

/* ---------- gestione (admin) ---------- */
.admin { max-width: 980px; margin: 0 auto; padding: 32px var(--gutter) 80px; }
.admin h1 { margin: 0; font: 400 3rem/1.1 var(--script); }
.admin h2 { margin: 36px 0 12px; font: italic 600 1.6rem var(--serif); }
.admin .stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 10px 0 0; color: var(--ink-2); }
.admin .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.admin td { padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.admin td:last-child { white-space: nowrap; text-align: right; }
.admin .off { opacity: .45; }
.admin .msgcell { white-space: pre-line; overflow-wrap: anywhere; }
.admin .who { font-weight: 500; }
.admin .gallery { display: grid; columns: auto; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.admin .gallery figure { margin: 0; position: relative; }
.admin .gallery figure img { aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; width: 100%; }
.admin .gallery figcaption { display: flex; justify-content: space-between; gap: 4px; font-size: .8rem; padding-top: 4px; }
.admin .gallery figcaption button { font-size: .8rem; }
.print-only { display: none; }
@media print {
  body { background: #fff; }
  .admin > :not(.print-only) { display: none !important; }
  .print-only { display: block; }
  .print-only h1 { font: 400 2.6rem var(--script); text-align: center; margin: 0 0 4px; }
  .print-only .sub { text-align: center; margin: 0 0 24px; font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; }
  .print-only article { break-inside: avoid; padding: 14px 0; border-bottom: 1px solid #ddd; }
  .print-only article p { margin: 0; white-space: pre-line; font: italic 400 1.05rem/1.6 var(--serif); }
  .print-only article b { display: block; margin-top: 4px; font: 400 1.6rem var(--script); }
}
