/* Таємний Санта — друкована новорічна листівка.
   Пласкі кольори офсетного друку, вузька антиква для заголовків, без скла, сяйва й градієнтів. */

:root {
  --green: #0b6a24;          /* сукно під листівкою */
  --green-2: #0a5a1f;
  --green-ink: #13702e;      /* кнопки на червоному */
  --green-ink-2: #0f5f26;
  --red: #b11e27;            /* сама листівка */
  --paper: #f7efe1;          /* зворот листівки, форми */
  --paper-2: #efe3cd;
  --ink: #2b1a16;            /* друкарська фарба на папері */
  --ink-2: #6b5248;
  --white: #fffaf3;
  --white-2: rgba(255, 250, 243, .8);
  --white-3: rgba(255, 250, 243, .58);
  --rule: rgba(255, 250, 243, .32);
  --mustard: #f2b632;
  --display: "Oranienbaum", "Didot", Georgia, serif;
  --sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --r: 8px;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --ease: cubic-bezier(.22, .9, .25, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--green); color: var(--white);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
::selection { background: var(--mustard); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 40; background: var(--mustard); color: var(--ink); padding: .6rem 1rem; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* Сніг — пласкі білі цятки, як на референсі */
.snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.grain { display: none; }

/* ---------- Листівка ---------- */
.desk { position: relative; z-index: 2; padding: clamp(1rem, 3vw, 2.5rem) clamp(.75rem, 3vw, 2.5rem) 0; }
.postcard {
  position: relative; max-width: 1280px; margin: 0 auto; min-height: calc(100dvh - 2 * clamp(1rem, 3vw, 2.5rem));
  background: var(--red); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12), 0 18px 40px -18px rgba(0, 0, 0, .45);
}
main:focus { outline: none; }

/* ---------- Шапка: знаки зліва, розділи по центру, вхід праворуч ---------- */
.nav-wrap { position: relative; z-index: 20; }
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.6rem var(--gutter) 0;
}
.brand { display: flex; align-items: center; gap: 1.1rem; text-decoration: none; color: var(--white); justify-self: start; }
.mark-rg { width: 132px; height: auto; color: var(--white); }
.mark-rg .rg-cut { fill: var(--red); }
.mark-divider { width: 1px; height: 34px; background: var(--white-3); }
.mark-pr { width: auto; height: 34px; display: block; }
/* розділи по центру листівки, вхід/вихід праворуч — як на референсі */
.nav-links { flex: 1; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2rem; }
.nav-main { display: flex; justify-content: center; gap: 2rem; }
.nav-account { display: flex; align-items: center; gap: 1.5rem; justify-content: flex-end; }
.nav-links a, .nav-links .link-button { color: var(--white); text-decoration: none; font-size: 1rem; letter-spacing: .01em; }
.nav-links a:hover, .nav-links .link-button:hover { text-decoration: underline; text-underline-offset: 6px; }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.nav-account .nav-cta { text-decoration: underline; text-underline-offset: 6px; }
.nav-form { margin: 0; }
.bell { position: relative; display: inline-flex; align-items: center; gap: .35rem; }
.bell svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.bell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.badge-count { min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 50%; background: var(--mustard); color: var(--ink); font-size: .75rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
.burger { display: none; position: relative; width: 2.75rem; height: 2.75rem; border: 1.5px solid var(--white-3); border-radius: var(--r); background: transparent; cursor: pointer; }
.burger span { position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 2px; background: var(--white); transition: transform .35s var(--ease); }
.burger span:first-of-type { transform: translate(-50%, -4px); }
.burger span:last-of-type { transform: translate(-50%, 4px); }
.burger[aria-expanded="true"] span:first-of-type { transform: translate(-50%, 0) rotate(45deg); }
.burger[aria-expanded="true"] span:last-of-type { transform: translate(-50%, 0) rotate(-45deg); }
.burger-dot { position: absolute; top: -4px; right: -4px; width: .7rem; height: .7rem; border-radius: 50%; background: var(--mustard); }
.burger[aria-expanded="true"] .burger-dot { display: none; }

/* ---------- Типографіка ---------- */
.display {
  margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(3.4rem, 9.5vw, 8.4rem); line-height: .92; letter-spacing: .01em;
}
.headline { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 5.4vw, 4.2rem); line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.headline--page { font-size: clamp(2.6rem, 7vw, 5rem); }
.display em, .headline em { font-style: normal; color: inherit; }
.eyebrow { margin: 0 0 .4rem; font-family: var(--hand); font-size: 1.7rem; line-height: 1.1; color: var(--white-2); }
.lede { margin: 1.1rem 0 0; max-width: 36rem; color: var(--white-2); font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.6; }
.note { margin: .8rem 0 0; color: var(--white-3); font-size: .9rem; }
.note--warn { color: var(--white); }
.muted { margin: 0; color: var(--ink-2); }

/* ---------- Кнопки: друкований ярлик ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3rem; padding: .7rem 1.6rem; border: 0; border-radius: var(--r); cursor: pointer;
  font: 500 1rem/1.2 var(--sans); letter-spacing: .02em; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-icon { display: inline-grid; place-items: center; }
.btn-icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--green-ink); color: var(--white); box-shadow: 0 3px 0 var(--green-2); }
.btn--primary:hover { background: var(--green-ink-2); }
.btn--light { background: var(--white); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .22); }
.btn--light:hover { background: var(--paper); }
.btn--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--white-2); }
.btn--ghost:hover { background: rgba(255, 250, 243, .1); }
.btn--danger { background: var(--ink); color: var(--white); }
.btn--danger:hover { background: #000; }
.btn--big { min-height: 3.5rem; padding: .85rem 2.2rem; font-size: 1.1rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.g-mark { width: 1.15rem; height: 1.15rem; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--white-2); text-decoration: underline; text-underline-offset: 4px; font-size: .95rem; }
.link-button:hover { color: var(--white); }
.chip { display: inline-block; border: 1.5px solid var(--white-3); background: transparent; cursor: pointer; padding: .4rem .85rem; border-radius: var(--r); font-size: .85rem; color: var(--white); text-decoration: none; }
.chip:hover { border-color: var(--white); }
.chip--on { background: var(--white); color: var(--red); border-color: var(--white); }

/* ---------- Папір: зворот листівки, форми, таблиці ---------- */
.bezel { color: var(--ink); }
.bezel { min-width: 0; }
.bezel-core { background: var(--paper); border-radius: var(--r); padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); height: 100%; min-width: 0; overflow-wrap: anywhere; }
.bezel .btn { white-space: normal; text-align: center; max-width: 100%; }
.bezel .note { color: var(--ink-2); }
.bezel .note--warn { color: var(--red); }
.bezel .link-button { color: var(--ink-2); }
.bezel .link-button:hover { color: var(--ink); }
.bezel .btn--ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.bezel .btn--ghost:hover { background: var(--paper-2); }
.bezel .chip { color: var(--ink); border-color: rgba(43, 26, 22, .35); }
.bezel .chip:hover { border-color: var(--ink); }
.bezel .chip--on { background: var(--red); color: var(--white); border-color: var(--red); }
.bezel .status-title { color: var(--red); }
.bezel .status-text, .bezel .status-kicker { color: var(--ink-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; text-transform: uppercase; color: var(--ink); }
.tag { padding: .2rem .6rem; border-radius: 4px; font-size: .78rem; font-weight: 500; color: var(--ink-2); border: 1px solid rgba(43, 26, 22, .3); }
.tag--new { color: var(--white); background: var(--red); border-color: var(--red); }
.tag--ok { color: var(--green-ink); border-color: var(--green-ink); }

/* ---------- Головна: лице листівки ---------- */
.hero { position: relative; padding: 0 var(--gutter); text-align: center; }
/* перший екран листівки: ялинки стоять по кутах на «землі» — лінії з фактами */
.hero-stage {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: clamp(560px, calc(100dvh - 150px), 900px); padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 3.5rem);
}
/* Ялинки займають лише вільні поля збоку від колонки тексту (38rem + запас на штемпель): ширина рахується від
   ширини сцени, тож на будь-якому екрані понад 1100px вони не заходять під текст. */
.hero-art { position: absolute; bottom: 0; z-index: 0; width: clamp(140px, calc((100% - 41rem) / 2 + var(--gutter) - 12px), 430px); height: auto; pointer-events: none; }
.hero-art--left { left: calc(-1 * var(--gutter)); }
.hero-art--right { right: calc(-1 * var(--gutter)); transform: scaleX(-1); }
.hero-inner { position: relative; z-index: 1; max-width: 38rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.hero-copy .eyebrow { margin-bottom: .6rem; }
.hero .lede { margin-left: auto; margin-right: auto; }
.status-bezel { position: relative; width: 100%; margin-top: 2.2rem; scroll-margin-top: 2rem; color: var(--white); }
/* на головній статус лежить просто на полі листівки, без паперу */
.status-bezel .bezel-core { background: transparent; box-shadow: none; padding: 0; }
.status-bezel .status-title { color: var(--white); }
.status-bezel .status-text, .status-bezel .status-kicker { color: var(--white-2); }
.status-bezel .note { color: var(--white-3); }
.status-bezel .link-button { color: var(--white-2); }
.status-bezel .link-button:hover { color: var(--white); }
.status-bezel .btn--ghost { color: var(--white); box-shadow: inset 0 0 0 1.5px var(--white-2); }
.status-bezel .btn--ghost:hover { background: rgba(255, 250, 243, .1); }
.status-bezel:focus { outline: none; }
.status { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.status-kicker { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: .95rem; letter-spacing: .04em; color: var(--white-2); }
.status-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.05; text-transform: uppercase; }
.status-text { margin: .7rem auto 1.4rem; max-width: 34rem; color: var(--white-2); }
.status-art { width: 9rem; margin: 0 auto 1rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
.dot--idle { background: var(--white-3); }
.dot--warn, .dot--gold, .dot--live { background: var(--mustard); }
.signin { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.signin form { margin: 0; }
.next { display: flex; flex-direction: column; align-items: center; gap: .7rem; }
.next-label { margin: 0; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--white-3); }
.next-secondary { color: var(--white-2); }
.leave { margin: 1.2rem 0 0; }
.incoming { margin-top: 1.4rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.incoming form { margin: 0; }
.incoming-state { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--white-2); }

/* Поштовий штемпель «Ви в грі» */
/* Штемпель стоїть окремим рядком над статусом: ні він, ні лінії гашення ліворуч не лягають на текст */
.postmark {
  position: relative; margin: 0 auto 1.2rem; width: 7.4rem; height: 7.4rem; border-radius: 50%;
  border: 2px solid var(--white); color: var(--white); display: grid; place-items: center; text-align: center;
  transform: rotate(-14deg); font: 500 .62rem/1.25 var(--sans); letter-spacing: .14em; text-transform: uppercase;
}
.postmark::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--white-2); }
.postmark strong { display: block; font: 400 1.35rem/1 var(--display); letter-spacing: .02em; margin: .25rem 0; }
/* лінії гашення марки */
.postmark::after {
  content: ""; position: absolute; left: -2.6rem; top: calc(50% - 7px); width: 2.4rem; height: 2px;
  background: var(--white); box-shadow: 0 6px 0 var(--white), 0 12px 0 var(--white);
}

.facts {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 calc(-1 * var(--gutter)); padding: 1.2rem var(--gutter) 1.4rem;
  border-top: 2px solid var(--white); text-align: center;
}
.facts > div { padding: 0 .5rem; }
.facts > div + div { border-left: 1px solid var(--rule); }
.facts dt { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--white-3); }
.facts dd { margin: .25rem 0 0; font-family: var(--display); font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.1; }

/* ---------- Зворот листівки: як це працює ---------- */
.section { position: relative; padding: clamp(3rem, 7vw, 5.5rem) var(--gutter); }
.section--page { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(4rem, 8vw, 6rem); min-height: 70dvh; }
.section--narrow { max-width: 46rem; margin: 0 auto; }
.section-head { margin-bottom: 2rem; }
.page-head { margin-bottom: 2rem; }

.card-back {
  display: grid; grid-template-columns: minmax(0, 1.35fr) 1px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 64rem; margin: 0 auto; padding: clamp(1.6rem, 4vw, 3rem);
  background: var(--paper); color: var(--ink); border-radius: var(--r); box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.card-back-rule { background: rgba(43, 26, 22, .25); }
.card-back .headline { color: var(--red); font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.card-back .eyebrow { color: var(--ink-2); }
.steps { list-style: none; margin: 1.6rem 0 0; padding: 0; }
.step { position: relative; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; gap: 0 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(43, 26, 22, .18); }
.step:last-child { border-bottom: 0; }
.step-num { font: 400 1.9rem/1 var(--display); color: var(--red); }
.step h3 { margin: 0; font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.step p { margin: .25rem 0 0; color: var(--ink-2); font-size: .97rem; }
.step-state { align-self: start; font-family: var(--hand); font-size: 1.35rem; line-height: 1; color: var(--ink-2); white-space: nowrap; }
.step--done .step-state, .step--done .step-num { color: var(--green-ink); }
.step--current .step-state { color: var(--red); }
.step--current h3 { text-decoration: underline; text-decoration-color: var(--mustard); text-decoration-thickness: 3px; text-underline-offset: 4px; }

.card-back-side { display: flex; flex-direction: column; gap: 1.6rem; }
/* марка: білий папір з перфорацією (крапковий край кольору звороту) */
.stamp {
  align-self: flex-end; position: relative; width: 8.6rem; padding: .55rem;
  background: var(--white); border: 5px dotted var(--paper); outline: 1px solid rgba(43, 26, 22, .12); outline-offset: -5px;
  transform: rotate(3deg); box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.stamp-inner { position: relative; background: var(--red); padding: .5rem .5rem 0; }
.stamp-inner img { width: 100%; }
.stamp-value { position: absolute; right: .4rem; top: .3rem; font: 400 1rem/1 var(--display); color: var(--white); }
.address { display: grid; gap: 1.15rem; margin: 0; }
.address div { border-bottom: 1px solid rgba(43, 26, 22, .35); padding-bottom: .2rem; }
.address dt { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.address dd { margin: 0; font-family: var(--hand); font-size: 1.6rem; line-height: 1.15; color: var(--ink); }

/* ---------- Питання ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; max-width: 64rem; margin: 0 auto; }
.faq-art { width: min(15rem, 70%); margin-top: 2rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.15rem 0; font-size: 1.12rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 1.7rem/1 var(--display); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: -.3rem 0 1.2rem; color: var(--white-2); max-width: 36rem; }

/* ---------- Інші сторінки ---------- */
.split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; max-width: 70rem; margin: 0 auto; }
.split-art { width: min(15rem, 70%); margin-top: 1.5rem; }
.empty { display: flex; flex-direction: column; align-items: flex-start; max-width: 40rem; margin: 0 auto; }
.empty img { width: min(13rem, 55%); margin-bottom: 1.5rem; }
.empty .btn { margin-top: 2rem; }
.bezel .privacy { margin: 0; padding-top: 1rem; border-top: 1px solid rgba(43, 26, 22, .18); color: var(--ink-2); }

/* Форми на папері */
.form { display: flex; flex-direction: column; gap: 1.3rem; }
.field label { display: block; margin-bottom: .45rem; font-weight: 600; font-size: .95rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; padding: .85rem 1rem; border-radius: 6px; border: 1.5px solid rgba(43, 26, 22, .3); resize: vertical;
  background: #fffdf8; color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.55;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(107, 82, 72, .65); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(177, 30, 39, .18); }
.field-help { margin: .4rem 0 0; color: var(--ink-2); font-size: .88rem; }
.field-error { margin: .4rem 0 0; color: var(--red); font-size: .92rem; font-weight: 500; }
.field--error textarea, .field--error input { border-color: var(--red); }
.form-foot { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.form-foot .note { margin: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

/* Отримувач */
.recipient { max-width: 70rem; margin: 0 auto; }
.recipient-name { font-size: clamp(3rem, 9vw, 7rem); overflow-wrap: anywhere; }
.recipient-name:focus { outline: none; }
.recipient-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.side-stack { display: grid; gap: 1rem; }
.wish-text { color: var(--ink); font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.wish-text p { margin: 0 0 .7rem; }
.wish-text p:last-child { margin: 0; }
.bezel--fresh .bezel-core { box-shadow: 0 0 0 3px var(--mustard), 0 2px 0 rgba(0, 0, 0, .18); }
.gift-status form { margin-top: 1rem; }

/* Закритий подарунок */
.sealed-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; max-width: 70rem; margin: 0 auto; }
.sealed-copy .btn { margin-top: 2rem; }
.sealed-gift { padding: 0; border: 0; background: none; cursor: pointer; justify-self: center; }
.sealed-gift img { width: min(24rem, 100%); transition: transform .4s var(--ease); }
.sealed-gift:hover img { transform: rotate(-3deg); }
.sealed-glow { display: none; }

/* Відкриття подарунка */
.unwrap {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem; text-align: center; background: var(--red);
  animation: unwrap-out .5s var(--ease) 4.4s forwards;
}
.unwrap[hidden] { display: none; }
.unwrap-stage { position: relative; width: min(16rem, 55vw); height: min(28rem, 45vh); }
.unwrap-stage img { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; max-height: 100%; object-fit: contain; object-position: bottom; margin: auto; }
.unwrap-glow { display: none; }
.unwrap-closed { animation: shake .9s var(--ease) .15s both, vanish .25s linear 1.05s forwards; }
.unwrap-open { opacity: 0; transform: translateY(10px); animation: appear .45s var(--ease) 1.05s forwards; }
.unwrap-kicker { margin: 1.4rem 0 .3rem; font-family: var(--hand); font-size: 1.8rem; color: var(--white-2); opacity: 0; animation: rise-in .6s var(--ease) 1.5s forwards; }
.unwrap-name { margin: 0; font-family: var(--display); text-transform: uppercase; font-size: clamp(2.8rem, 9vw, 6rem); line-height: .95; color: var(--white); overflow-wrap: anywhere; opacity: 0; transform: translateY(1rem); animation: name-in .7s var(--ease) 1.65s forwards; }
.unwrap-skip { position: absolute; bottom: max(1.5rem, env(safe-area-inset-bottom)); }
@keyframes shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
@keyframes vanish { to { opacity: 0; } }
@keyframes appear { to { opacity: 1; transform: none; } }
@keyframes rise-in { to { opacity: 1; } }
@keyframes name-in { to { opacity: 1; transform: none; } }
@keyframes unwrap-out { to { opacity: 0; visibility: hidden; } }

/* Святкове вікно після «Беру участь» */
.celebrate { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; padding: 1rem; background: rgba(11, 106, 36, .85); animation: fade-in .3s var(--ease) both; }
.celebrate[hidden] { display: none; }
.celebrate-card { width: min(26rem, 100%); text-align: center; animation: rise .45s var(--ease) both .05s; }
.celebrate-card .bezel-core { display: flex; flex-direction: column; align-items: center; }
.celebrate-card img { width: 8rem; margin: -.5rem auto .5rem; }
.celebrate-card .status-kicker { color: var(--green-ink); justify-content: center; }
.celebrate-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 26; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } }

/* Сповіщення */
.read-all { margin: 0 0 1rem; display: flex; justify-content: flex-end; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.notes form { margin: 0; }
.note-item { position: relative; width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: start; text-align: left; padding: 1rem 1.1rem; border: 0; border-radius: var(--r); cursor: pointer; background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.note-item:hover { background: #fff8ec; }
.note-dot { width: .6rem; height: .6rem; margin-top: .5rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.note-item--unread .note-dot { background: var(--red); box-shadow: none; }
.note-item--unread .note-title { color: var(--red); }
.note-body { display: grid; gap: .2rem; }
.note-title { font-weight: 600; }
.note-text { color: var(--ink-2); font-size: .95rem; }
.note-time { color: var(--ink-2); font-size: .82rem; }
.note-go svg { width: 1rem; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Кабінет */
.org-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1rem; align-items: start; max-width: 76rem; margin: 0 auto; }
.org-grid--drawn { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); }
.org-grid > .bezel:only-child { grid-column: 1 / -1; max-width: 46rem; }
.org-side { display: grid; gap: 1rem; }
.org-action form { margin-top: 1.4rem; }
.org-action .status-text { color: var(--ink-2); margin: .6rem 0 0; text-align: left; max-width: none; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.4rem 0; }
.mini-stats dt { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.mini-stats dd { margin: .3rem 0 0; font-family: var(--display); font-size: 2.4rem; line-height: 1; color: var(--red); }
.mini-stats small { font-family: var(--sans); font-size: .95rem; color: var(--ink-2); margin-left: .3rem; }
.export-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.export-actions form { margin: 0; }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; color: var(--ink); }
.table th { text-align: left; color: var(--ink-2); font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 0 .55rem .7rem .2rem; border-bottom: 1.5px solid rgba(43, 26, 22, .35); white-space: nowrap; }
.table td { padding: .8rem .55rem .8rem .2rem; border-bottom: 1px solid rgba(43, 26, 22, .15); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.cell-sub { display: block; color: var(--ink-2); font-size: .8rem; }
.yes { color: var(--green-ink); font-weight: 500; }
.no { color: var(--ink-2); }
.status-toggle { margin: 0; }
.toggle { position: relative; min-width: 3.4rem; padding: .3rem .55rem; border: 1.5px solid rgba(43, 26, 22, .35); border-radius: 4px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-2); background: transparent; }
.toggle:hover { border-color: var(--ink); color: var(--ink); }
.toggle--on { background: var(--green-ink); border-color: var(--green-ink); color: var(--white); }
.toggle--on:hover { background: var(--green-ink-2); color: var(--white); }

/* Тости */
.toasts { position: fixed; z-index: 30; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: grid; gap: .5rem; width: min(30rem, calc(100% - 2rem)); }
.toast { padding: .85rem 1.1rem; border-radius: var(--r); font-size: .97rem; background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); border-left: 5px solid var(--green-ink); animation: toast-in .35s var(--ease) both, toast-out .4s var(--ease) 6s forwards; }
.toast--error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(.8rem); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }

/* ---------- Під листівкою ---------- */
.footer { position: relative; z-index: 2; padding: 1.6rem clamp(.75rem, 3vw, 2.5rem) 7rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; justify-content: space-between; color: var(--white-2); font-size: .9rem; }
.footer-orgs { margin: 0; font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .02em; color: var(--white); }
.footer-controls { display: flex; gap: .5rem; }
.credits { width: 100%; font-size: .85rem; color: var(--white-2); }
.credits summary { cursor: pointer; width: max-content; max-width: 100%; }
.credits ul { margin: .7rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.credits a { color: var(--white); text-underline-offset: 2px; }
.credits-note { margin: .6rem 0 0; }

/* ---------- Програвач: ярлик платівки ---------- */
.player {
  position: fixed; right: max(1.25rem, env(safe-area-inset-right)); bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 15;
  display: flex; align-items: center; gap: .75rem; max-width: min(30rem, calc(100vw - 2rem));
  padding: .45rem .9rem .45rem .45rem; border-radius: var(--r);
  background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .28);
}
.player[hidden] { display: none; }
.player-play { position: relative; flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; cursor: pointer; background: var(--ink); color: var(--paper); }
/* червоний ярлик платівки з'являється, коли грає */
.player-play::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--red); transform: scale(0); transition: transform .3s var(--ease); }
.player.is-playing .player-play::before { transform: scale(1); }
/* біла мітка на етикетці: обертається, поки грає, — платівка крутиться */
.player-play::after { content: ""; position: absolute; top: 12px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--paper); opacity: 0; transform-origin: 2px 10px; }
.player.is-playing .player-play::after { opacity: 1; animation: record-spin 1.6s linear infinite; }
@keyframes record-spin { to { transform: rotate(360deg); } }
.player-play svg { position: relative; width: 1rem; height: 1rem; fill: currentColor; }
.player .i-pause, .player.is-playing .i-play { display: none; }
.player.is-playing .i-pause { display: block; }
.player-meta { display: grid; min-width: 0; line-height: 1.25; }
.player-label { color: var(--red); font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.player-track { color: var(--ink); font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { color: var(--ink-2); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-next, .player-vol-btn { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 1.5px solid rgba(43, 26, 22, .3); border-radius: 50%; cursor: pointer; color: var(--ink); background: transparent; }
.player-next:hover, .player-vol-btn:hover { border-color: var(--ink); }
.player-next svg, .player-vol-btn svg { width: .95rem; height: .95rem; fill: currentColor; }
.player-vol { display: flex; align-items: center; }
.player-vol input { width: 5rem; accent-color: var(--red); cursor: pointer; }
.player-vol-btn { display: none; }
.player-vol-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.eq { display: none; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.player.is-playing .eq { display: flex; }
.eq i { display: block; width: 3px; height: 100%; background: var(--red); transform-origin: bottom; animation: eq 1s var(--ease) infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.player-hint { position: absolute; right: .4rem; bottom: calc(100% + .5rem); margin: 0; padding: .55rem .85rem; border-radius: var(--r); max-width: calc(100vw - 2.8rem); font-size: .85rem; color: var(--ink); background: var(--paper); box-shadow: 0 3px 0 rgba(0, 0, 0, .28); }
.player-hint[hidden] { display: none; }

/* ---------- Поява при скролі: коротко і без розмиття ---------- */
.js .reveal { opacity: 0; transform: translateY(1.2rem); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Планшет ---------- */
@media (max-width: 899px) {
  .faq-grid, .split, .sealed-form, .recipient-grid, .card-back { grid-template-columns: minmax(0, 1fr); }
  .card-back-rule { display: none; }
  .stamp { align-self: flex-start; }
  .sealed-gift { order: -1; }
  .sealed-gift img { width: min(15rem, 70%); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1rem; }
  .facts > div:nth-child(3) { border-left: 0; }
}

@media (max-width: 1100px) {
  .hero-stage { min-height: 0; padding-bottom: calc(clamp(170px, 26vw, 280px) + 1.5rem); }
  .hero-art { width: auto; height: clamp(170px, 26vw, 280px); }
}

/* Кабінет до 1100px — одна колонка: у двох колонках ліві блоки (кнопки експорту, підсумки)
   не вміщались у вузьку смугу й залазили під «Учасники». */
@media (max-width: 1100px) {
  .org-grid, .org-grid--drawn { grid-template-columns: minmax(0, 1fr); }
  .org-grid--drawn .org-side { display: contents; }
  .org-grid--drawn .org-side > :nth-child(1) { order: 1; }
  .org-grid--drawn .org-people { order: 2; }
  .org-grid--drawn .org-side > :nth-child(2) { order: 3; }
  .org-grid--drawn .org-side > :nth-child(3) { order: 4; }
}

/* ---------- Меню-бургер: до 1100px усі пункти (організатор має 4 розділи + сповіщення + вихід)
   у шапку не вміщаються, тож ховаємо їх у повноекранне меню. Синхронно з santa.js (NAV_DESKTOP). ---------- */
@media (max-width: 1100px) {
  .nav { justify-content: space-between; }
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: 0; z-index: -1; height: 100dvh; overflow-y: auto;
    display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.1rem;
    padding: 6rem 1.5rem 2rem; background: var(--red);
    opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility 0s .25s;
  }
  .nav-main, .nav-account { flex-direction: column; align-items: flex-start; gap: 1.1rem; }
  .nav-links a, .nav-links .link-button { font: 400 2.3rem/1.1 var(--display); text-transform: uppercase; color: var(--white); text-decoration: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .desk { z-index: 30; }
  body.nav-open .nav-links { opacity: 1; visibility: visible; transition: opacity .25s var(--ease); }
  .bell-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .bell svg { display: none; }
  .nav-links .bell .badge-count { font-family: var(--sans); font-size: 1rem; min-width: 2rem; height: 2rem; line-height: 2rem; }
}

/* ---------- Телефон: листівка на весь екран ---------- */
@media (max-width: 767px) {
  :root { --gutter: 1.1rem; }
  .desk { padding: 0; }
  .postcard { border-radius: 0; min-height: 100dvh; box-shadow: none; }
  .nav { padding-top: 1rem; }
  .mark-rg { width: 104px; }
  .mark-pr { height: 30px; }
  .hero-stage { padding-top: 1.5rem; }
  .postmark { width: 6.6rem; height: 6.6rem; }
  .btn { white-space: normal; }
  .faq-art, .split-art { display: none; }
  .footer { padding-bottom: 6.5rem; }
}
@media (max-width: 599px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .player { left: .75rem; right: .75rem; bottom: max(.75rem, env(safe-area-inset-bottom)); max-width: none; }
  .player-hint { left: .4rem; right: .4rem; }
  .player-meta { flex: 1; }
  .player-vol-btn { display: grid; }
  .player-vol { display: none; position: absolute; right: .4rem; bottom: calc(100% + .5rem); padding: .8rem 1rem; border-radius: var(--r); background: var(--paper); box-shadow: 0 3px 0 rgba(0, 0, 0, .28); }
  .player.vol-open .player-vol { display: flex; }
  .player-vol input { width: min(14rem, 60vw); height: 2rem; }
  .player.vol-open .player-hint { display: none; }
  .toasts { bottom: 5.5rem; }
  .table-wrap { overflow: visible; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; padding: 1rem 0; border-bottom: 1px solid rgba(43, 26, 22, .18); }
  .table tr:last-child { border-bottom: 0; }
  .table td { padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: .2rem; color: var(--ink-2); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
  .table .cell-name { grid-column: 1 / -1; font-weight: 600; }
  .table .cell-actions, .table td[data-label="Компанія"] { grid-column: 1 / -1; }
}

/* ---------- Менше руху ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .snow, .confetti { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .unwrap { display: none !important; }
  .eq i { animation: none; transform: scaleY(.7); }
  .player.is-playing .player-play::after { animation: none; }
}

/* ---------- Вітальна листівка після входу ----------
   Закрита листівка виїжджає знизу, обкладинка повертається навколо лівого краю (3D),
   книжка зсувається вправо, щоб розворот став по центру. */
.greeting {
  position: fixed; inset: 0; z-index: 27; display: grid; place-items: center; padding: 1.5rem;
  background: rgba(11, 106, 36, .92); perspective: 2200px; overflow-y: auto;
}
.greeting[hidden] { display: none; }
.greeting-book {
  position: relative; width: min(27rem, 82vw); min-height: min(37rem, 78vh);
  transform-style: preserve-3d; opacity: 0; transform: translateY(2.5rem) rotate(-2deg);
  transition: transform 1s var(--ease), opacity .5s var(--ease);
}
.greeting.is-in .greeting-book { opacity: 1; transform: none; }
.greeting.is-open .greeting-book { transform: translateX(50%); }
.greeting-inside {
  position: relative; min-height: inherit; display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  padding: clamp(1.6rem, 4vw, 2.4rem); background: var(--paper); color: var(--ink);
  border-radius: 0 var(--r) var(--r) 0; box-shadow: 0 3px 0 rgba(0, 0, 0, .2);
}
.greeting-hello { margin: 0; font-family: var(--hand); font-size: clamp(2.2rem, 5vw, 2.9rem); line-height: 1.05; color: var(--red); }
.greeting-text { margin: 0; color: var(--ink); font-size: 1.05rem; line-height: 1.6; }
.greeting-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.greeting-actions form { margin: 0; }
.greeting-actions .btn--ghost { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.greeting-actions .btn--ghost:hover { background: var(--paper-2); }
.greeting-sign { margin: .4rem 0 0; font-family: var(--hand); font-size: 1.6rem; color: var(--ink-2); text-align: right; }
.greeting-inside > * { opacity: 0; transition: opacity .5s var(--ease) .9s; }
.greeting.is-open .greeting-inside > * { opacity: 1; }
.greeting-cover {
  position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.15s var(--ease) .15s;
}
.greeting.is-open .greeting-cover { transform: rotateY(-180deg); }
.cover-front, .cover-back {
  position: absolute; inset: 0; border-radius: var(--r); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; text-align: center;
}
.cover-front { background: var(--red); color: var(--white); box-shadow: 0 3px 0 rgba(0, 0, 0, .25); outline: 2px solid var(--white); outline-offset: -12px; }
.cover-front img { width: 42%; }
.cover-title { margin: 0; font-family: var(--display); text-transform: uppercase; font-size: clamp(2.6rem, 7vw, 3.6rem); line-height: .92; }
.cover-year { margin: 0; font-family: var(--hand); font-size: 1.8rem; color: var(--white-2); }
.cover-back { transform: rotateY(180deg); background: var(--paper-2); color: var(--ink); border-radius: var(--r) 0 0 var(--r); }
.cover-back img { width: 62%; }
.cover-note { margin: 0; font-family: var(--hand); font-size: 1.5rem; line-height: 1.15; color: var(--ink-2); }
.greeting-skip { position: fixed; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); z-index: 1; color: var(--white); }

/* Вузький екран: розвороту немає місця — обкладинка відкривається і зникає, лишається внутрішня сторінка */
@media (max-width: 899px) {
  .greeting.is-open .greeting-book { transform: none; }
  .greeting-cover { transition: transform 1.15s var(--ease) .15s, opacity .3s linear 1s; }
  .greeting.is-open .greeting-cover { opacity: 0; visibility: hidden; transition: transform 1.15s var(--ease) .15s, opacity .3s linear 1s, visibility 0s 1.3s; }
  .greeting-inside { border-radius: var(--r); }
}
@media (prefers-reduced-motion: reduce) {
  .greeting .greeting-cover { display: none; }
  .greeting .greeting-book { opacity: 1; transform: none !important; }
  .greeting .greeting-inside { border-radius: var(--r); }
  .greeting .greeting-inside > * { opacity: 1; }
}

/* Сторінка конфіденційності */
.legal h2 { margin: 1.6rem 0 .4rem; font-family: var(--display); font-weight: 400; font-size: 1.6rem; text-transform: uppercase; color: var(--red); }
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0; color: var(--ink); }
.legal a { color: var(--red); }
