/* =========================================================================
   Secret Santa – stile "carta da regalo"
   Colori, font e misure sono tutti qui in alto: cambiali per personalizzare.
   ========================================================================= */

@font-face {
  font-family: "Bagel Fat One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/bagel-fat-one-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bagel Fat One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/bagel-fat-one-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../assets/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../assets/fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Palette */
  --ink: #2b1e6b;          /* inchiostro: testi, bordi, ombre */
  --ink-soft: #574b8f;
  --paper: #fff3f8;        /* sfondo carta da regalo */
  --white: #ffffff;
  --berry: #ff3d6e;
  --berry-strong: #e01e5a; /* bottoni principali (contrasto AA col bianco) */
  --mint: #17c3a0;
  --sun: #ffc93c;
  --sky: #5aa9ff;
  --grape: #b48cff;
  --orange: #ff8a3d;

  /* Forme */
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --r-pill: 999px;
  --r-card: 22px;
  --r-input: 14px;
  --r-modal: 26px;

  /* Tipografia */
  --font-display: "Bagel Fat One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito Variable", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --tag: var(--berry);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  /* coriandoli della carta da regalo */
  background-image:
    radial-gradient(circle at 22px 30px, rgba(255, 61, 110, .22) 0 3px, transparent 3.6px),
    radial-gradient(circle at 74px 86px, rgba(23, 195, 160, .24) 0 3px, transparent 3.6px),
    radial-gradient(circle at 118px 22px, rgba(255, 201, 60, .45) 0 3.5px, transparent 4px),
    radial-gradient(circle at 142px 118px, rgba(90, 169, 255, .26) 0 3px, transparent 3.6px),
    radial-gradient(circle at 40px 136px, rgba(180, 140, 255, .3) 0 3px, transparent 3.6px);
  background-size: 160px 160px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.no-scroll { overflow: hidden; }

img, svg { max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; line-height: 1.1; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

[hidden] { display: none !important; }
body.is-busy { cursor: progress; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.ribbon-top {
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--berry) 0 14px, #fff 14px 28px);
  border-bottom: var(--line);
}
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px 20px 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-size: 26px; line-height: 1;
}
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center; flex: none;
  background: var(--sun); border: var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm); transform: rotate(-6deg); font-size: 24px;
}
.lang-btn {
  font: 900 15px/1 var(--font-body); color: var(--ink);
  background: #fff; border: var(--line); border-radius: var(--r-pill);
  padding: 9px 14px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); text-decoration: none;
}
.lang-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- Layout + spazi pubblicitari ---------- */
.layout {
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; flex: 1;
}
.rail { display: none; }
@media (min-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .rail { display: block; padding-top: 20px; }
}
main { min-width: 0; padding: 8px 0 48px; }
main:focus { outline: none; }

.ad-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.ad-slot { margin: 12px auto; text-align: center; }
.ad-slot:empty { display: none; }
.rail .ad-slot { position: sticky; top: 20px; margin-top: 0; }
.ad-label { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 2px dashed rgba(43, 30, 107, .35); border-radius: 14px;
  background: rgba(255, 255, 255, .65); color: var(--ink-soft);
  font-size: 14px; font-weight: 800; height: 100px;
}
.ad-placeholder small { font-weight: 600; opacity: .8; }
.rail .ad-placeholder { height: 600px; }
.ad-bottom .ad-placeholder { height: 120px; }
@media (min-width: 760px) { .ad-top .ad-placeholder { height: 90px; } }

/* ---------- Tipografia ---------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.005em; }
h1, .h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 5.4vw, 52px); line-height: 1.04; }
h2, .h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3.6vw, 34px); }
h3, .h3 { font-weight: 900; font-size: 20px; }
.lead { font-size: 19px; max-width: 36em; }
.muted, .hint { color: var(--ink-soft); }
.hint { font-size: 15px; margin: 0; }
.center { text-align: center; }

/* ---------- Bottoni ---------- */
.btn {
  --bg: var(--white); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  font: 800 17px/1.1 var(--font-body); color: var(--fg); background: var(--bg);
  border: var(--line); border-radius: var(--r-pill); box-shadow: 0 4px 0 var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, box-shadow .08s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }
.btn-primary { --bg: var(--berry-strong); --fg: #fff; }
.btn-mint { --bg: var(--mint); }
.btn-sun { --bg: var(--sun); }
.btn-ghost { --bg: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }
.btn-ghost:hover, .btn-ghost:active { box-shadow: none; transform: none; }
.btn-lg { min-height: 60px; padding: 14px 30px; font-size: 20px; }
.btn-lg svg { width: 24px; height: 24px; }
.btn-sm { min-height: 40px; padding: 7px 14px; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
.btn-sm svg { width: 18px; height: 18px; }
.btn-sm:hover { box-shadow: 0 4px 0 var(--ink); }
.btn-sm:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }
.btn-icon { width: 40px; padding: 0; }
.link-btn {
  font: 800 16px/1.3 var(--font-body); color: var(--ink); background: none; border: 0; padding: 4px 0;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer;
}

/* ---------- Card ---------- */
.card {
  background: #fff; border: var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow); padding: 26px;
}
@media (max-width: 560px) { .card { padding: 20px 18px; } }
.section { margin-top: 56px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.count {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px;
  background: var(--ink); color: #fff; border-radius: var(--r-pill); font-weight: 900;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: center; gap: 28px; padding: 28px 0 8px;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 68px); line-height: 1; margin-bottom: 18px;
  text-shadow: 4px 4px 0 var(--sun);
  text-wrap: balance;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 26px; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: 100%; max-width: 340px; height: auto; overflow: visible; }
.hero-compact { padding-top: 12px; }
.hero-compact h1 { font-size: clamp(34px, 4.6vw, 50px); }
.hero-compact .hero-art svg { max-width: 240px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 220px; }
  .hero-compact .hero-art { display: none; }
}

/* ---------- Cartellini regalo (lista eventi) ---------- */
.tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px 22px; }
.tag {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: var(--line); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.tag:nth-child(3n+1) { transform: rotate(-1.2deg); }
.tag:nth-child(3n+2) { transform: rotate(.8deg); }
.tag:nth-child(3n) { transform: rotate(-.4deg); }
.tag-link { display: block; text-decoration: none; color: inherit; border-radius: 19px 19px 0 0; flex: 1; }
.tag-head {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 86px; padding: 16px 16px 14px 62px;
  background: var(--tag); border-bottom: var(--line); border-radius: 19px 19px 0 0;
}
.tag-hole {
  position: absolute; left: 20px; top: 50%; width: 24px; height: 24px; margin-top: -12px;
  border-radius: 50%; background: var(--paper); border: var(--line);
}
.tag-string {
  position: absolute; left: -26px; top: 50%; width: 60px; height: 40px; margin-top: -32px;
  pointer-events: none;
}
.tag-emoji { font-size: 42px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(43, 30, 107, .35)); }
.tag-body { padding: 16px 18px 6px; }
.tag-title { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.12; margin-bottom: 8px; overflow-wrap: anywhere; }
.tag-meta { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.tag-foot { display: flex; gap: 8px; align-items: center; padding: 10px 18px 18px; }
.tag-foot .btn:first-child { margin-right: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  background: #fff; border: 2px solid var(--ink); border-radius: var(--r-pill);
  font-weight: 900; font-size: 14px; line-height: 1.2; white-space: nowrap;
}
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
  border-radius: var(--r-pill); border: 2px solid var(--ink); background: var(--sun);
  font-size: 13px; font-weight: 900; color: var(--ink); line-height: 1.4;
}
.pill-done { background: var(--mint); }

/* ---------- Come funziona + FAQ ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; counter-reset: step; }
.steps li { position: relative; padding: 26px 22px 22px; background: #fff; border: var(--line); border-radius: var(--r-card); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -20px; left: 18px; width: 42px; height: 42px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; border: var(--line); border-radius: 50%; background: var(--sun);
}
.steps li:nth-child(2)::before { background: var(--mint); }
.steps li:nth-child(3)::before { background: var(--grape); }
.steps h3 { margin: 8px 0 8px; }
.steps p { margin: 0; color: var(--ink-soft); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 30px; } }

.faq-list { display: grid; gap: 12px; max-width: 760px; }
.faq-list details { background: #fff; border: var(--line); border-radius: 18px; padding: 0 20px; }
.faq-list summary {
  cursor: pointer; list-style: none; font-weight: 900; font-size: 18px; padding: 16px 0;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%; font-size: 20px; line-height: 1; background: var(--paper);
}
.faq-list details[open] summary::after { content: "–"; background: var(--sun); }
.faq-list details p { color: var(--ink-soft); padding-bottom: 6px; }

/* ---------- Pagina evento ---------- */
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 18px;
  font-weight: 800; text-decoration: none; padding: 6px 12px 6px 6px; border-radius: var(--r-pill);
}
.back:hover { background: rgba(255, 255, 255, .8); }
.back svg { width: 20px; height: 20px; }

.event-head {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: start;
  background: #fff; border: var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 22px;
  overflow: hidden;
}
.event-head::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 112px;
  background: var(--tag); border-right: var(--line);
}
.event-emoji {
  position: relative; width: 70px; height: 70px; display: grid; place-items: center;
  font-size: 46px; line-height: 1; background: #fff; border: var(--line); border-radius: 50%;
  margin-left: 0; box-shadow: var(--shadow-sm);
}
.event-info { padding-left: 24px; }
.event-info h1 { font-size: clamp(30px, 4.4vw, 44px); overflow-wrap: anywhere; margin-bottom: 10px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 700; }
.facts li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.facts svg { width: 20px; height: 20px; flex: none; }
.event-msg {
  margin: 14px 0 0; padding: 12px 14px; background: var(--paper); border-radius: 14px;
  border: 2px dashed rgba(43, 30, 107, .4); white-space: pre-line; max-width: 60ch;
}
.event-actions { display: flex; gap: 8px; }
@media (max-width: 700px) {
  .event-head { grid-template-columns: auto minmax(0, 1fr); padding: 18px; gap: 14px; }
  .event-head::before { width: 100%; height: 66px; inset: 0 0 auto 0; border-right: 0; border-bottom: var(--line); }
  .event-emoji { width: 62px; height: 62px; font-size: 38px; }
  .event-info { padding-left: 0; padding-top: 2px; grid-column: 1 / -1; }
  .event-actions { position: absolute; right: 14px; top: 12px; }
  .event-actions .btn { --bg: #fff; }
}

.stepper { display: flex; gap: 10px; margin: 28px 0 20px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.step {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px;
  background: #fff; border: var(--line); border-radius: var(--r-pill);
  color: var(--ink); text-decoration: none; font-weight: 900; white-space: nowrap;
}
.step-num {
  width: 32px; height: 32px; display: grid; place-items: center; flex: none;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); font-weight: 900;
}
.step.done .step-num { background: var(--mint); }
.step[aria-current="page"] { background: var(--sun); box-shadow: 0 4px 0 var(--ink); }
.step-count {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: 13px;
}
@media (max-width: 560px) {
  .stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; padding: 2px 0 6px; }
  .step {
    position: relative; flex-direction: column; justify-content: center; gap: 4px;
    padding: 10px 4px 9px; border-radius: 18px; font-size: 14px; white-space: normal; text-align: center;
  }
  .step-count { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 12px; }
}

.panel-title { margin-bottom: 8px; }
.panel-lead { color: var(--ink-soft); max-width: 46em; }
.panel-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 26px; padding-top: 20px; border-top: 2px dashed rgba(43, 30, 107, .25);
}
.panel-foot .hint { flex: 1 1 240px; }

/* ---------- Form ---------- */
.field { display: grid; gap: 6px; margin: 0 0 18px; min-width: 0; border: 0; padding: 0; }
.field > label, .field > legend { font-weight: 900; padding: 0; margin-bottom: 2px; }
.input {
  font: inherit; font-weight: 600; color: var(--ink); background: #fff; width: 100%;
  border: var(--line); border-radius: var(--r-input); padding: 10px 14px; min-height: 50px;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: #8c84b5; font-weight: 600; }
.input:focus { outline: none; box-shadow: 0 0 0 4px var(--sun); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.45; }
select.input {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232b1e6b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input[aria-invalid="true"] { border-color: var(--berry-strong); box-shadow: 0 0 0 4px rgba(224, 30, 90, .2); }
.form-error { color: var(--berry-strong); font-weight: 800; margin: 10px 0 0; }
.form-error[hidden] { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.budget-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }

.inline-form { display: flex; gap: 10px; margin-top: 18px; }
.inline-form .input { flex: 1; }
@media (max-width: 420px) { .inline-form .btn span { display: none; } .inline-form .btn { width: 50px; padding: 0; } }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.emoji-opt input, .swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.emoji-opt span {
  display: grid; place-items: center; width: 48px; height: 48px; font-size: 26px; cursor: pointer;
  border: 2px solid rgba(43, 30, 107, .25); border-radius: 14px; background: #fff;
}
.emoji-opt input:checked + span { border: var(--line); background: var(--sun); box-shadow: 0 3px 0 var(--ink); }
.emoji-opt input:focus-visible + span, .swatch input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch span[aria-hidden] {
  display: block; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: var(--c); border: var(--line);
}
.swatch input:checked + span { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ink); }

.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--berry-strong); }

.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
  flex: none; position: relative; width: 56px; height: 32px; margin-top: 2px;
  border: var(--line); border-radius: var(--r-pill); background: #e6e2f5; transition: background .15s;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: transform .15s;
}
.switch input:checked + .switch-ui { background: var(--mint); }
.switch input:checked + .switch-ui::after { transform: translateX(24px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- Partecipanti ---------- */
.people { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.person {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px;
  background: #fff; border: 2px solid var(--ink); border-radius: 18px;
}
.person-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.person-name { font-weight: 900; font-size: 18px; overflow-wrap: anywhere; }
.person-sub { font-size: 14px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-actions { display: flex; gap: 8px; flex: none; }
.person-actions.wrap { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .person-link { flex-wrap: wrap; }
  .person-link .person-actions { width: 100%; justify-content: flex-start; }
}

.bauble {
  --c: var(--berry);
  position: relative; flex: none; width: 48px; height: 48px; margin-top: 8px;
  display: grid; place-items: center; border-radius: 50%; background: var(--c); border: var(--line);
  font-weight: 900; font-size: 16px; color: var(--ink); letter-spacing: .02em;
}
.bauble::before {
  content: ""; position: absolute; top: -11px; left: 50%; width: 16px; height: 10px; transform: translateX(-50%);
  background: var(--sun); border: 3px solid var(--ink); border-radius: 4px 4px 2px 2px;
}
.bauble::after {
  content: ""; position: absolute; top: 7px; left: 9px; width: 10px; height: 6px;
  border-radius: 50%; background: rgba(255, 255, 255, .75); transform: rotate(-30deg);
}

.empty { text-align: center; padding: 26px 10px 8px; color: var(--ink-soft); }
.empty-art { font-size: 54px; line-height: 1; margin-bottom: 8px; }

.status { font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.status.ok { color: #0a7d66; }

/* ---------- Vincoli ---------- */
.rule-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0 12px; align-items: end;
  margin-top: 20px; padding: 18px; background: var(--paper); border: 2px dashed rgba(43, 30, 107, .35); border-radius: 18px;
}
.rule-form .field { margin-bottom: 14px; }
.rule-mid { font-size: 26px; padding-bottom: 22px; }
.rule-form .check, .rule-form .btn { grid-column: 1 / -1; justify-self: start; }
.rule-form .btn { margin-top: 12px; }
@media (max-width: 560px) {
  .rule-form { grid-template-columns: 1fr; }
  .rule-mid { display: none; }
}
.rules { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.rule {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; background: #fff; border: 2px solid var(--ink); border-radius: 16px;
}
.rule::before { content: "🚫"; margin-right: -2px; }
.rule span { flex: 1; }
.option-box { margin-top: 24px; padding: 18px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; }

/* ---------- Estrazione ---------- */
.draw-card { text-align: center; }
.hat { width: 220px; margin: 0 auto 8px; }
.hat svg { width: 100%; height: auto; overflow: visible; }
.hat.shuffling svg { animation: hat-shake .45s ease-in-out infinite; transform-origin: 50% 80%; }
.hat.shuffling .slip { animation: slip-jump .45s ease-in-out infinite alternate; }
.hat.shuffling .slip:nth-of-type(2) { animation-delay: .15s; }
.hat.shuffling .slip:nth-of-type(3) { animation-delay: .3s; }
@keyframes hat-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes slip-jump { from { transform: translateY(0); } to { transform: translateY(-14px); } }
.checklist { list-style: none; margin: 14px auto 24px; padding: 0; display: inline-grid; gap: 6px; text-align: left; font-weight: 800; }
.checklist li { color: var(--ink-soft); }
.checklist li.ok { color: var(--ink); }

.success-card { background: var(--mint); }
.success-card .panel-lead { color: var(--ink); margin-bottom: 0; }
.drawn-grid { display: grid; gap: 22px; margin-top: 22px; }
.mode h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mode h3 svg { width: 24px; height: 24px; }
.mode-play { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--sun); }
.mode-play > div { flex: 1 1 280px; }
.mode-play .hint { color: var(--ink); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Passa il telefono ---------- */
.progress { height: 16px; border: var(--line); border-radius: var(--r-pill); background: var(--paper); overflow: hidden; margin: 18px 0 8px; }
.progress span { display: block; height: 100%; background: var(--mint); border-right: var(--line); transition: width .4s; }
.progress span[style="width:0%"] { border-right: 0; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 22px; }
@media (max-width: 420px) { .name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.name-tag {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 12px 16px; background: #fff; border: var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--ink);
  font: 900 18px/1.2 var(--font-body); color: var(--ink); cursor: pointer; overflow-wrap: anywhere;
}
.name-tag:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.name-tag .bauble { width: 58px; height: 58px; font-size: 19px; }
.name-tag.seen { background: #eef9f5; box-shadow: 0 3px 0 var(--ink); }
.name-tag.seen .bauble { filter: saturate(.4); opacity: .7; }
.seen-mark {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); font-size: 15px;
}

/* ---------- Rivelazione (pacco regalo) ---------- */
.reveal-page { text-align: center; padding: 18px 0 8px; }
.reveal-event {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px;
  background: var(--tag); border: var(--line); border-radius: var(--r-pill); font-weight: 900; box-shadow: var(--shadow-sm);
  margin-bottom: 22px; overflow-wrap: anywhere;
}
.reveal-hello { font-size: clamp(40px, 8vw, 66px); text-shadow: 4px 4px 0 var(--sun); margin-bottom: 10px; overflow-wrap: anywhere; }
.reveal-sub { font-size: 19px; color: var(--ink-soft); }
.reveal-stage { margin: 18px auto 0; max-width: 560px; }
.gift {
  display: block; margin: 0 auto; padding: 0; width: min(250px, 66vw);
  background: none; border: 0; border-radius: 24px; cursor: pointer;
  transition: width .5s cubic-bezier(.2, 1.2, .4, 1);
  -webkit-tap-highlight-color: transparent;
}
.gift svg { display: block; width: 100%; height: auto; overflow: visible; }
.gift .gift-lid { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .75s cubic-bezier(.2, 1.3, .4, 1), opacity .45s .35s; }
.gift:not(.open) { animation: gift-hop 2.6s ease-in-out infinite; }
.gift:not(.open):hover .gift-lid { transform: translateY(-6px) rotate(-3deg); }
.gift.shake { animation: gift-shake .5s ease-in-out; }
.gift.open { width: min(130px, 36vw); cursor: default; }
.gift.open .gift-lid { transform: translate(40px, -120px) rotate(32deg); opacity: 0; }
.gift-hint { margin-top: 14px; font-weight: 900; }
@keyframes gift-hop {
  0%, 70%, 100% { transform: translateY(0) rotate(0); }
  76% { transform: translateY(-14px) rotate(-3deg); }
  82% { transform: translateY(0) rotate(0); }
  88% { transform: translateY(-6px) rotate(2deg); }
  94% { transform: translateY(0); }
}
@keyframes gift-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }

.reveal-result[hidden] { display: none; }
.reveal-result { animation: rise .7s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(.85); } to { opacity: 1; transform: none; } }
.reveal-kicker { font-weight: 900; font-size: 19px; margin: 10px 0 4px; }
.reveal-name {
  display: inline-block; font-family: var(--font-display); font-size: clamp(46px, 11vw, 88px); line-height: 1;
  padding: 14px 30px 18px; margin: 4px 0 22px; background: #fff; border: var(--line); border-radius: 26px;
  box-shadow: 7px 7px 0 var(--tag), 7px 7px 0 3px var(--ink); transform: rotate(-2deg); overflow-wrap: anywhere; max-width: 100%;
}
.reveal-details { display: grid; gap: 14px; text-align: left; margin-top: 4px; }
.reveal-box { background: #fff; border: var(--line); border-radius: 18px; padding: 16px 18px; }
.reveal-box h3 { font-size: 16px; margin-bottom: 6px; color: var(--ink-soft); }
.reveal-box p { margin: 0; white-space: pre-line; font-weight: 700; }
.reveal-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .reveal-facts { grid-template-columns: 1fr; } }
.reveal-privacy { margin: 26px auto 0; max-width: 34em; font-size: 15px; color: var(--ink-soft); }
.promo {
  margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--grape);
}
.promo > div { flex: 1 1 280px; }
.promo h2 { font-size: 26px; margin-bottom: 6px; }
.promo p { margin: 0; font-weight: 700; }

.overlay {
  position: fixed; inset: 0; z-index: 150; overflow-y: auto;
  background-color: var(--paper);
  background-image: inherit; background-size: 160px 160px;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 18px;
}
.overlay-inner { width: 100%; max-width: 620px; text-align: center; margin: auto 0; }
.overlay-actions { margin-top: 26px; }
.overlay-actions[hidden] { display: none; }

/* ---------- Modale + toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px;
  background: rgba(43, 30, 107, .55); animation: fade-in .15s ease-out;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto;
  background: #fff; border: var(--line); border-radius: var(--r-modal); box-shadow: 8px 8px 0 var(--ink);
  padding: 26px; animation: pop-in .22s cubic-bezier(.2, 1.4, .4, 1);
}
.modal h2 { font-size: 28px; margin-bottom: 14px; padding-right: 10px; overflow-wrap: anywhere; }
.modal-text { color: var(--ink-soft); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .danger { --bg: var(--berry-strong); --fg: #fff; }
.pairs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pairs li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 14px; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 14px; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.9) translateY(10px); } }

#toast-root { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 400; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  background: var(--ink); color: #fff; font-weight: 800; padding: 12px 20px; border-radius: var(--r-pill);
  box-shadow: 0 4px 0 rgba(43, 30, 107, .35); text-align: center; animation: toast-in .25s cubic-bezier(.2, 1.4, .4, 1);
  transition: opacity .3s, transform .3s;
}
.toast.error { background: var(--berry-strong); }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 500; }

/* =========================================================================
   Versione online: invito unico, scelta del nome, pacco del partecipante
   ========================================================================= */
.demo-banner {
  display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 18px; padding: 12px 16px;
  background: #fff; border: 2px dashed var(--ink); border-radius: 16px; font-size: 15px; font-weight: 700;
}
.loading-line { margin-top: 28px; font-weight: 800; color: var(--ink-soft); }
.loading-card { padding: 44px 20px; }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  border: 5px solid rgba(43, 30, 107, .15); border-top-color: var(--berry); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.event-head + .card, .event-head + .manage, .card + .card, .card + .manage, .manage + .card { margin-top: 26px; }

/* Invito */
.invite { background: var(--sun); }
.invite .hint { color: var(--ink); }
.invite-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.invite-top h2 { margin-bottom: 6px; }
.joined {
  flex: none; display: grid; justify-items: center; padding: 8px 14px; background: #fff; border: var(--line);
  border-radius: 18px; box-shadow: var(--shadow-sm); line-height: 1.1;
}
.joined strong { font-family: var(--font-display); font-weight: 400; font-size: 30px; }
.joined small { font-size: 18px; color: var(--ink-soft); }
.joined span { font-size: 13px; font-weight: 800; }
.invite .copy-field { display: flex; gap: 10px; }
.invite .copy-field .input { flex: 1; font-size: 15px; background: #fff; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.invite-note { margin-top: 14px !important; font-weight: 800; }
@media (max-width: 560px) {
  .invite .copy-field { flex-direction: column; }
  .invite .copy-field .btn { width: 100%; }
}

/* La tua parte */
.you-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.you-head .bauble { width: 62px; height: 62px; font-size: 20px; }
.kicker { margin: 0; font-weight: 800; color: var(--ink-soft); }
.you-foot { margin: 16px 0 0; }
.wish-edit { margin-top: 22px; padding-top: 20px; border-top: 2px dashed rgba(43, 30, 107, .25); }
.wish-edit .h3, .wish-edit label.h3 { display: block; font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.wish-edit textarea { margin-top: 10px; }
.wish-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.reveal-card .reveal-page { padding-top: 6px; }
.wish-after { max-width: 560px; margin: 0 auto; }

.name-tag:disabled, .name-tag.taken { cursor: not-allowed; background: #f3f1f8; box-shadow: 0 2px 0 rgba(43, 30, 107, .4); color: var(--ink-soft); }
.name-tag.taken .bauble { filter: grayscale(.8); opacity: .55; }
.name-tag.taken:active { transform: none; }
.taken-label { font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: var(--r-pill); background: #fff; border: 2px solid rgba(43, 30, 107, .35); }

.who h2 { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 12px; }
.who h2 .muted { font-family: var(--font-body); font-size: 15px; font-weight: 700; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border: 2px solid rgba(43, 30, 107, .35); border-radius: var(--r-pill); font-weight: 800; font-size: 15px; background: #fff; }
.chip.on { border-color: var(--ink); background: #e5f8f2; }
.chip em { font-style: normal; color: var(--ink-soft); }

.manage { margin-top: 40px; }
.manage-title { font-size: clamp(24px, 3vw, 30px); margin-bottom: 2px; }
.manage .stepper { margin-top: 14px; }

.pill-host { background: var(--grape); }
.pill-soft { background: #fff; }
.pill-hot { background: var(--berry); color: #fff; }
.tag-gone { background: #f7f5fb; box-shadow: var(--shadow-sm); }
.tag-gone .tag-body { padding-top: 20px; }

.gift.static, .reveal-result.static { animation: none; }
.gift.open.static { width: min(130px, 36vw); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; background: var(--ink); color: #fff; }
.site-footer .ribbon-top { border-bottom: 0; border-top: var(--line); }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 28px 20px 34px;
  display: flex; flex-wrap: wrap; gap: 22px 40px; align-items: flex-start; justify-content: space-between;
}
.footer-brand { font-family: var(--font-display); font-size: 24px; margin-bottom: 6px; }
.footer-inner p { margin: 0; opacity: .85; font-size: 15px; }
.footer-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.footer-tools .btn { --bg: transparent; --fg: #fff; border-color: #fff; box-shadow: 0 3px 0 #fff; }
.footer-tools .btn:active { box-shadow: 0 1px 0 #fff; }
.footer-links { display: flex; gap: 18px; font-weight: 800; margin-top: 10px; }
.footer-links a { color: #fff; }
.site-footer :focus-visible { outline-color: var(--sun); }

/* ---------- Pagine statiche (privacy, 404) ---------- */
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 18px; }
.prose h2 { font-size: 26px; margin: 34px 0 10px; }
.prose p, .prose li { color: var(--ink); }
.prose a { font-weight: 800; }

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .gift:not(.open) { animation: none; }
}

@media print {
  .ad-wrap, .rail, .site-header, .site-footer, .ribbon-top { display: none !important; }
}
