/* Сертификат и сцена с конвертом. Общие стили для открытки и виджета.
   Шрифты и цвета — переменные; тема магазина задаёт их в /theme.css (config/shop.js → theme). */

:root {
  --gc-font: var(--font, 'Manrope Variable', Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif);
  --gc-display: var(--font-display, var(--gc-font));
  --gc-hand: var(--font-hand, 'Caveat Variable', Caveat, 'Bradley Hand', 'Segoe Print', cursive);
  /* письмо и панели открытки */
  --gc-paper: #fffdf8;
  --gc-paper-title: #1d1d1f;
  --gc-paper-ink: #2c2c33;
  --gc-paper-muted: #55555c;
  --gc-panel: #fff;
  --gc-panel-ink: #1d1d1f;
  --gc-panel-ink-2: #3a3a40;
  --gc-panel-muted: #75757d;
  --gc-panel-soft: #f5f5f7;
  --gc-panel-line: #ececf0;
  --gc-chip: #fff;
  --gc-ok: #1a7f4b;
  /* Тонкая отделка. По умолчанию нейтрально; тема магазина может задать золото и тёплый свет */
  --gc-gold: #b9a27a;
  --gc-aura: transparent;              /* тёплый свет за конвертом */
  --gc-shine: rgba(255, 255, 255, .5); /* блик, пробегающий по сертификату */
  --gc-hairline: transparent;          /* рамка на письме и панелях */
  --gc-display-weight: 800;
  --gc-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Лицевая сторона сертификата ===== */
.gift-card {
  --ink: var(--gc-card-light, #fff);
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1600 / 1131; /* как А5 (√2 : 1) — Екатерина, 08.10.2026 */
  border-radius: 5% / 7.07%;
  overflow: hidden;
  container-type: inline-size;
  background: #e9e9ee var(--cover) center / cover no-repeat;
  color: var(--ink);
  font-family: var(--gc-font);
  box-shadow: 0 1px 2px rgba(20, 20, 30, .08), 0 14px 30px -10px rgba(20, 20, 30, .35);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.gift-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 60%);
}
.gift-card.ink-dark { --ink: var(--gc-card-dark, #2A1E24); }
.gift-card.ink-dark .gift-card__shop { color: var(--gc-card-brand-dark, inherit); }
.gift-card.ink-dark::before { background: linear-gradient(100deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, 0) 60%); }
.gift-card.ink-light { text-shadow: 0 1px 3px rgba(0, 0, 0, .22); }

.gift-card::after { /* блик, пробегает по карте, когда она «приземлилась». Полоса едет сдвигом (transform), а не через
                       background-position: так сертификат не перерисовывается каждый кадр */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 75%;
  background: linear-gradient(110deg, transparent, var(--gc-shine, rgba(255, 255, 255, .5)) 50%, transparent);
  transform: translateX(-143%);
  pointer-events: none;
}
.gift-card.is-shining::after { animation: gc-shine 1.9s cubic-bezier(.45, .05, .25, 1) .15s both; }
@keyframes gc-shine { from { transform: translateX(-143%); } to { transform: translateX(177%); } }

.gift-card__shop {
  position: absolute;
  left: 7%;
  top: 8.5%;
  max-width: 62%;
  color: var(--gc-card-brand, inherit);
  font-family: var(--gc-card-brand-font, var(--gc-display));
  font-size: 4.3cqw;
  font-weight: var(--gc-card-brand-weight, 800);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gift-card__label {
  position: absolute;
  left: 7%;
  top: calc(8.5% + 5.6cqw);
  font-size: 2.7cqw;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .85;
}
.gift-card__title {
  position: absolute;
  left: 7%;
  top: 38%;
  max-width: 46%;
  font-family: var(--gc-display);
  font-size: 6.2cqw;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.01em;
}
.gift-card__amount {
  position: absolute;
  left: 7%;
  bottom: 9%;
  font-family: var(--gc-amount-font, var(--gc-font));
  font-size: 11cqw;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Обложка «как в печати» (ink: 'art-dark' | 'art-light'): логотип и «Подарочный сертификат» уже на картинке —
   поверх только номинал. Место и размер — как в сертификатах стиля «Воздух» (scripts/covers-v2/make.mjs, 20.10) */
.gift-card.ink-art-dark { --ink: var(--gc-art-dark, #605045); }
.gift-card.ink-art-light { --ink: var(--gc-art-light, #C7A08A); }
.gift-card.ink-art-white { --ink: #fff; }
.gift-card.ink-art-dark::before,
.gift-card.ink-art-light::before,
.gift-card.ink-art-white::before { display: none; }
:is(.ink-art-dark, .ink-art-light, .ink-art-white) :is(.gift-card__shop, .gift-card__label, .gift-card__title) { display: none; }
:is(.ink-art-dark, .ink-art-light, .ink-art-white) .gift-card__amount {
  left: 7.5%;
  bottom: 8.5%;
  font-family: var(--gc-font);
  font-size: 6.75cqw;
  font-weight: 700;
  letter-spacing: 0;
}

/* ===== Сцена ===== */
.gcs {
  --page-ink: var(--gc-page-ink, #1d1d1f);
  --stage-min: 100svh;
  position: relative;
  font-family: var(--gc-font);
  color: var(--page-ink);
}
.gcs.page-ink-light { --page-ink: #fff; }

/* ===== «Вечер при свечах» (design.stage): видео-фон, тёплый отсвет и блики на сертификате ===== */
.gcs-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--page-bg2);
  pointer-events: none;
}
.gcs-bg__video { display: block; width: 100%; height: 100%; object-fit: cover; }
.gcs-bg::after { /* края и низ темнее — надписи и карта читаются на любом кадре */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 85% at 50% 42%, transparent 45%, rgba(20, 14, 11, .5) 100%),
    linear-gradient(180deg, rgba(20, 14, 11, .3), transparent 26%, transparent 78%, rgba(20, 14, 11, .3));
  transition: background-color 1s ease;
}
.gcs.is-compact .gcs-bg::after { background-color: rgba(20, 14, 11, .28); } /* открыли — свечи уходят на второй план */
.gcs > .gcs-stage,
.gcs > .gcs-content { position: relative; z-index: 1; }
.gcs.page-ink-light .gcs-kicker { text-shadow: 0 2px 22px rgba(20, 14, 11, .6); }
.gcs.has-candles .gcs-hint { /* подсказка ложится на пламя — на дымчатой плашке. Без размытия фона (backdrop-filter):
                                  под ним идёт видео, и Firefox размывал его заново на каждом кадре */
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(26, 20, 17, .6);
  color: rgba(255, 243, 234, .9);
}

.gcs-candlelight,
.gcs-glint { position: absolute; pointer-events: none; }
.gcs-candlelight { /* свет свечей снизу: дышит неровно, как пламя */
  inset: 0;
  background: radial-gradient(130% 95% at 50% 125%, rgba(255, 190, 120, .8), transparent 62%);
  mix-blend-mode: soft-light;
  opacity: 0;
}
.gcs.is-revealed .gcs-candlelight { animation: gcs-candle 5.3s linear infinite; }
@keyframes gcs-candle {
  0% { opacity: .55; } 7% { opacity: .72; } 13% { opacity: .5; } 21% { opacity: .78; } 30% { opacity: .6; }
  44% { opacity: .82; } 52% { opacity: .56; } 63% { opacity: .74; } 75% { opacity: .5; } 88% { opacity: .7; } 100% { opacity: .55; }
}
.gcs-glint { /* блик-звёздочка: вспыхивает и гаснет, каждый в своё время */
  left: var(--x);
  top: var(--y);
  width: 16cqw;
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: 0;
  background:
    radial-gradient(circle, #fff 0 3.5%, rgba(255, 236, 214, .75) 7%, rgba(255, 220, 186, .25) 16%, transparent 30%),
    linear-gradient(90deg, transparent 49.2%, rgba(255, 246, 236, .95) 50%, transparent 50.8%),
    linear-gradient(0deg, transparent 49.2%, rgba(255, 246, 236, .95) 50%, transparent 50.8%);
  -webkit-mask: radial-gradient(circle, #000 0 8%, rgba(0, 0, 0, .55) 26%, transparent 62%);
  mask: radial-gradient(circle, #000 0 8%, rgba(0, 0, 0, .55) 26%, transparent 62%);
  mix-blend-mode: screen;
  mix-blend-mode: plus-lighter; /* на светлой карте «экран» почти не виден — свет складываем */
}
.gcs.is-revealed .gcs-glint { animation: gcs-twinkle 5.4s ease-in-out var(--d) infinite; }
@keyframes gcs-twinkle {
  0%, 74%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
  82% { opacity: 1; transform: scale(1) rotate(35deg); }
  90% { opacity: .35; transform: scale(.6) rotate(60deg); }
}
@media (prefers-reduced-motion: reduce) {
  .gcs.is-revealed .gcs-candlelight { animation: none; opacity: .6; }
  .gcs.is-revealed .gcs-glint { animation: none; }
}

.gcs-stage {
  position: relative;
  isolation: isolate;
  overflow-x: clip; /* свет за конвертом шире экрана — не даём странице ездить вбок */
  container-type: inline-size;
  box-sizing: border-box;
  min-height: var(--stage-min);
  display: grid;
  grid-template-rows: minmax(0, 1.3fr) auto minmax(0, .7fr);
  justify-items: center;
  padding: 24px 16px;
}
.gcs.is-compact .gcs-stage { min-height: 0; }
.gcs-motes {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity .5s ease;
}
.gcs-motes.is-asleep { opacity: 0; } /* на время открытия конверта пылинки гаснут и не рисуются */

.gcs-kicker {
  grid-row: 1;
  align-self: end;
  max-width: 22ch;
  margin: 0 0 clamp(18px, 5vh, 44px);
  font-family: var(--gc-kicker-font, var(--gc-display));
  font-size: clamp(28px, 8cqw, 42px);
  font-weight: var(--gc-display-weight);
  line-height: 1.12;
  letter-spacing: -.005em;
  text-align: center;
  text-wrap: balance;
  transition: opacity .6s ease, transform .8s cubic-bezier(.16, 1, .3, 1);
}
.gcs-hint {
  grid-row: 3;
  align-self: start;
  margin: clamp(30px, 6vh, 52px) 0 0;
  color: var(--gc-hint, var(--gc-gold));
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: opacity .5s;
}
.gcs.is-idle .gcs-hint { animation: gcs-pulse 4s ease-in-out infinite; }
.gcs.is-opening .gcs-kicker,
.gcs.is-opening .gcs-hint { opacity: 0; transform: translateY(-8px); animation: none; }
.gcs.is-compact .gcs-kicker,
.gcs.is-compact .gcs-hint { display: none; }
@keyframes gcs-pulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }

.gcs-holder {
  grid-row: 2;
  position: relative;
  /* по высоте — так, чтобы над конвертом хватило места вытянутому сертификату (он поднимается на 104% своей высоты):
     на низком экране ноутбука (1366×768, 1280×720) иначе верх сертификата на миг уходит за край окна */
  width: min(88cqw, 440px, calc(var(--stage-min) * .63 - 20px));
  aspect-ratio: 100 / 68;
  container-type: inline-size;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.gcs-holder:focus-visible::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 16px;
  outline: 3px solid var(--accent);
}
.gcs.is-idle .gcs-holder { animation: gcs-float 6.5s ease-in-out infinite; }
.gcs.is-open .gcs-holder { cursor: default; }
@keyframes gcs-float {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-7px) rotate(.6deg); }
}

/* Тёплый свет за конвертом — дышит, как свеча; при открытии разгорается */
.gcs-aura {
  position: absolute;
  inset: -45% -35%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--gc-aura), transparent);
  opacity: .7;
  pointer-events: none;
  transition: opacity 1.6s ease, transform 2s cubic-bezier(.16, 1, .3, 1);
}
.gcs.is-idle .gcs-aura { animation: gcs-breathe 7s ease-in-out infinite; }
.gcs.is-opening .gcs-aura { opacity: 1; transform: scale(1.12); }
.gcs.is-open .gcs-aura { opacity: .55; }
@keyframes gcs-breathe {
  0%, 100% { opacity: .55; transform: scale(.96); }
  50% { opacity: .85; transform: scale(1.03); }
}

/* Наклон за курсором (--tx, --ty от -1 до 1 ставит scene.js) */
.gcs-tilt {
  position: absolute;
  inset: 0;
  transform: perspective(1400px) rotateY(calc(var(--tx, 0) * 7deg)) rotateX(calc(var(--ty, 0) * -5deg));
}

.gcs-shadow {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -11%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));
  translate: calc(var(--tx, 0) * -10px) 0;
  transition: opacity .6s;
}
.gcs.is-idle .gcs-shadow { animation: gcs-shadow 6.5s ease-in-out infinite; }
.gcs.is-opening .gcs-shadow,
.gcs.is-open .gcs-shadow { opacity: 0; }
@keyframes gcs-shadow {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(7px) scale(.9); opacity: .7; }
}

/* Конверт (shared/envelope.js). Слои: подкладка (1) → сертификат (2) → карман (3) → клапан (4).
   Каждый слой — SVG в координатах 100 × 68, поэтому свет, тени и узор на слоях совпадают. */
.gcs-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.gcs-env { position: absolute; inset: 0; pointer-events: none; }
.gcs-env--back { z-index: 1; }
.gcs-env--front { z-index: 3; }
.gcs-env--flap { z-index: 4; }
.gcs-env svg:not(.gcs-defs) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gcs-back,
.gcs-front { position: absolute; inset: 0; }
.gcs-back { /* подкладка; её тень — тень всего конверта на столе */
  border-radius: 1.2% / 1.76%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 8px 16px -8px rgba(0, 0, 0, .5), 0 30px 54px -26px rgba(0, 0, 0, .7);
}
/* Свет изнутри конверта: зажигается, когда поднимается клапан */
.gcs-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 70% at 50% 30%, rgba(255, 236, 200, .6), rgba(255, 214, 160, 0) 70%);
  mix-blend-mode: screen;
  opacity: 0;
}
.gcs-address {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 7.5%;
  display: grid;
  gap: .05em;
  color: var(--env-ink);
  font-family: var(--gc-hand);
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.gcs-to,
.gcs-from {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gcs-to { font-size: 7.2cqw; font-weight: 700; }
.gcs-from { font-size: 5.4cqw; font-weight: 500; opacity: .85; }

.gcs-flap {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(0deg);
}
.gcs-flap-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.gcs-flap-in { transform: rotateX(180deg); }
.gcs-flap-out .gcs-shade { opacity: var(--shade-out, 0); }
.gcs-flap-in .gcs-shade { opacity: var(--shade-in, .6); }
/* Тень клапана на кармане (1,6 единицы из 68 вниз). Она и затемнение клапана — отдельные слои: при открытии меняются
   только их прозрачность и сдвиг, бумага с фактурой не перерисовывается */
.gcs-flap-shadow { opacity: .6; transform: translateY(2.35%); }
.gcs-shade,
.gcs-flap-shadow { will-change: opacity, transform; }
/* На время открытия всё, что движется, — отдельными слоями: сертификат при подъёме и увеличении не перерисовывается заново */
.gcs.is-opening .gcs-card,
.gcs.is-opening .gcs-env,
.gcs.is-opening .gcs-seal,
.gcs.is-opening .gcs-ring,
.gcs.is-opening .gcs-flare,
.gcs.is-opening .gcs-glow { will-change: transform, opacity; }

/* Восковая печать с оттиском названия магазина — на кончике клапана, уезжает вместе с ним */
.gcs-seal {
  position: absolute;
  left: 50%;
  top: 58.5%;
  width: 21%;
  aspect-ratio: 1;
  translate: -50% -50%;
  isolation: isolate;
  transition: scale .6s cubic-bezier(.16, 1, .3, 1);
}
/* Тень печати — градиентом, а не фильтром drop-shadow: печать поворачивается вместе с клапаном,
   и фильтр пересчитывался каждый кадр (в Firefox открытие подтормаживало) */
.gcs-seal::before {
  content: '';
  position: absolute;
  inset: 5% 3% -4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .46) 62%, rgba(0, 0, 0, .2) 82%, rgba(0, 0, 0, 0));
}
.gcs-seal svg { display: block; width: 100%; height: 100%; }
.gcs-seal::after { /* золотой блик пробегает по оттиску раз в несколько секунд */
  content: '';
  position: absolute;
  inset: 16.5%;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 250, 232, .55) 50%, transparent 62%) no-repeat;
  background-size: 300% 100%;
  background-position: 120% 0;
}
.gcs.is-idle .gcs-seal::after { animation: gcs-glint 7s ease-in-out 1.2s infinite; }
@keyframes gcs-glint {
  0% { background-position: 120% 0; }
  22%, 100% { background-position: -20% 0; }
}
.gcs.is-idle .gcs-holder:hover .gcs-seal { scale: 1.04; }

/* Блик по печати один раз — когда её только что поставили (окно покупки, «Оплачено») */
.gcs-seal.is-glinting::after {
  background-image: linear-gradient(115deg, transparent 34%, rgba(255, 246, 214, .9) 50%, transparent 66%);
  animation: gcs-glint-once 1.3s cubic-bezier(.4, 0, .2, 1) both;
}
@keyframes gcs-glint-once { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* Золотая вспышка от печати */
.gcs-flare {
  position: absolute;
  left: 50%;
  top: 58.5%;
  width: 34%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 200, .95), color-mix(in srgb, var(--seal) 70%, transparent) 38%, transparent);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

/* Кольцо света, которое расходится от печати при нажатии */
.gcs-ring {
  position: absolute;
  left: 50%;
  top: 58.5%;
  width: 21%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--seal), 0 0 18px 2px color-mix(in srgb, var(--seal) 55%, transparent);
  opacity: 0;
}

.gcs-card { /* сертификат А5 в конверте 100 × 68: 86% ширины — с полями со всех сторон */
  position: absolute;
  left: 7%;
  top: 6%;
  width: 86%;
  z-index: 2;
  transition: box-shadow 1.2s ease;
}
.gcs.is-open .gcs-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18), 0 34px 60px -26px rgba(0, 0, 0, .7),
    inset 0 0 0 1px color-mix(in srgb, var(--gc-gold) 22%, transparent);
}
/* Отсвет на сертификате: следует за курсором, на телефоне медленно плывёт сам */
.gcs-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--gc-shine) 45%, transparent) 50%, transparent 70%) no-repeat;
  background-size: 260% 100%;
  background-position: calc(50% - var(--tx, 0) * 60%) 0;
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease;
}
.gcs.is-open .gcs-sheen { opacity: 1; }
@media (hover: none) {
  .gcs.is-open .gcs-sheen { animation: gcs-sheen 11s ease-in-out infinite; }
}
@keyframes gcs-sheen {
  0%, 100% { background-position: 85% 0; }
  50% { background-position: 15% 0; }
}

/* ===== Текст и данные после открытия ===== */
.gcs-content {
  box-sizing: border-box;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* колонка не шире экрана, даже если внутри длинный код */
  gap: 14px;
}
.gcs:not(.is-revealed) .gcs-content {
  visibility: hidden;
  height: 0;
  padding: 0 16px;
  overflow: hidden;
}
.gcs-content > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s ease, transform 1s cubic-bezier(.16, 1, .3, 1);
  transition-delay: calc(var(--i, 0) * 160ms);
}
.gcs.is-revealed .gcs-content > * { opacity: 1; transform: none; }

/* Письмо раскрывается сверху вниз, как развёрнутый лист */
.gcs-content > .gcs-letter {
  clip-path: inset(0 0 100% 0 round 20px);
  transition: opacity .5s ease, transform 1s cubic-bezier(.16, 1, .3, 1), clip-path 1.2s cubic-bezier(.65, 0, .35, 1);
}
.gcs.is-revealed .gcs-content > .gcs-letter { clip-path: inset(0 0 0 0 round 20px); }
/* …а поздравление проявляется слово за словом */
.gcs-letter-msg .w {
  opacity: 0;
  filter: blur(4px);
  transition: opacity 1s ease, filter 1.1s ease;
}
.gcs.is-revealed .gcs-letter-msg .w {
  opacity: 1;
  filter: blur(0);
  transition-delay: calc(var(--d, 0ms) + 700ms);
}
.gcs-letter-from { opacity: 0; transition: opacity 1.2s ease; }
.gcs.is-revealed .gcs-letter-from { opacity: 1; transition-delay: calc(var(--ink-end, 0ms) + 1000ms); }

.gcs-letter,
.gcs-panel {
  margin: 0;
  border-radius: 20px;
  background: var(--gc-panel);
  color: var(--gc-panel-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 18px 40px -22px rgba(0, 0, 0, .35),
    inset 0 0 0 1px var(--gc-panel-border, transparent);
}
.gcs-letter {
  position: relative;
  isolation: isolate;
  padding: 32px 28px 26px;
  background: var(--gc-paper);
  color: var(--gc-paper-title);
}
.gcs-letter::before { /* фактура бумаги и тонкая рамка, как на открытке из хорошего картона */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--gc-grain);
  mix-blend-mode: multiply;
  opacity: .07;
  pointer-events: none;
}
.gcs-letter::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--gc-hairline);
  border-radius: 13px;
  pointer-events: none;
}
.gcs-letter-title:focus { outline: none; } /* фокус сюда ставит сцена после открытия — это не кнопка */
.gcs-letter-title {
  margin: 0 0 12px;
  font-family: var(--gc-display);
  font-size: clamp(25px, 6.8vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.gcs-letter-msg {
  margin: 0;
  color: var(--gc-paper-ink);
  font-family: var(--gc-hand);
  font-size: clamp(25px, 6.8vw, 30px);
  font-weight: 500;
  line-height: 1.22;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gcs-letter-from {
  margin: 12px 0 0;
  color: var(--gc-paper-muted);
  font-family: var(--gc-hand);
  font-size: 26px;
  font-weight: 700;
  text-align: right;
}
.gcs-letter-from::before { content: '— '; }

.gcs-panel { padding: 20px; }
.gcs-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gc-panel-soft);
  color: var(--gc-panel-ink-2);
  font-size: 15px;
  font-weight: 700;
}
.gcs-label {
  color: var(--gc-panel-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gcs-sum {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.gcs-sum-value {
  margin-top: 2px;
  font-family: var(--gc-amount-font, var(--gc-font));
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.gcs-sum-of { color: var(--gc-panel-muted); font-size: 15px; font-weight: 600; padding-bottom: 4px; }
.gcs-progress {
  height: 8px;
  margin-top: 10px;
  border-radius: 4px;
  background: var(--gc-panel-line);
  overflow: hidden;
}
.gcs-progress span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.gcs-code-box {
  display: flex;
  flex-wrap: wrap; /* на узком экране кнопка уходит под код */
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-top: 16px;
  padding: 14px 14px 14px 16px;
  border-radius: 14px;
  background: var(--gc-panel-soft);
}
.gcs-code-text { min-width: 0; }
.gcs-code {
  margin-top: 2px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(18px, 5.4vw, 22px);
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}
.gcs-code--muted { color: var(--gc-panel-muted); font-family: inherit; font-size: 16px; letter-spacing: 0; user-select: none; }
.gcs-copy {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--gc-chip);
  color: var(--gc-panel-ink);
  font: 600 14px/1 var(--gc-font);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
  cursor: pointer;
}
.gcs-copy.is-done { color: var(--gc-ok); }

.gcs-qr-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.gcs-qr {
  flex: none;
  width: 112px;
  height: 112px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 12px;
  background: #fff; /* QR всегда тёмным по белому — так его читает любой сканер */
  box-shadow: inset 0 0 0 1px #e6e6ea;
}
.gcs-qr svg { display: block; width: 100%; height: 100%; }
.gcs-qr--placeholder {
  display: grid;
  place-items: center;
  color: #b0b0b8;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px #e6e6ea;
  background: repeating-linear-gradient(45deg, #fafafa 0 6px, #f2f2f4 6px 12px);
}
.gcs-qr-row p { margin: 0; color: var(--gc-panel-ink-2); font-size: 15px; line-height: 1.45; }
.nowrap { white-space: nowrap; }
.gcs-valid {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--gc-panel-line);
  color: var(--gc-panel-ink-2);
  font-size: 15px;
}
.gcs-valid b { color: var(--gc-panel-ink); }

.gcs-how h2 { margin: 0 0 12px; font-family: var(--gc-display); font-size: 21px; font-weight: 700; }
.gcs-how ol { margin: 0; padding-left: 20px; color: var(--gc-panel-ink-2); font-size: 15px; line-height: 1.5; }
.gcs-how li + li { margin-top: 6px; }
.gcs-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 18px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
/* Ссылка на правила — под кнопками, тихим текстом */
.gcs-rules { margin: 14px 0 0; text-align: center; font-size: 14px; }
.gcs-rules a { color: var(--gc-panel-ink-2); text-underline-offset: 3px; }

/* «Позвонить» — контурная, под основной кнопкой */
.gcs-btn--ghost {
  margin-top: 10px;
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.gcs-btn { transition: filter .2s, transform .2s; }
.gcs-btn:hover { filter: brightness(1.07); }
.gcs-btn:active { transform: scale(.985); }
.gcs-btn:focus-visible,
.gcs-copy:focus-visible,
.gcs-replay:focus-visible { outline: 2px solid var(--gc-gold); outline-offset: 3px; }

.gcs-foot {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding-top: 6px;
  color: var(--page-ink);
  text-align: center;
}
.gcs-foot p { margin: 0; font-size: 13px; opacity: .6; }
.gcs-replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: 600 15px/1 var(--gc-font);
  opacity: .8;
  cursor: pointer;
}
.gcs-replay svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}
.gcs-replay:hover { opacity: 1; }
.gcs-replay:hover svg { transform: rotate(-40deg); }
.gcs-copy { transition: color .2s, background-color .2s; }
.gcs ::selection { background: color-mix(in srgb, var(--gc-gold) 45%, transparent); }

@media (prefers-reduced-motion: reduce) {
  /* Без движения по экрану: остаются только мягкие появления */
  .gcs.is-idle .gcs-holder,
  .gcs.is-idle .gcs-shadow,
  .gcs.is-idle .gcs-aura,
  .gcs.is-idle .gcs-seal::after,
  .gcs.is-open .gcs-sheen,
  .gift-card.is-shining::after { animation: none; }
  .gcs-tilt { transform: none; }
  .gcs-content > *,
  .gcs-content > .gcs-letter { transform: none; clip-path: none; transition: opacity .5s ease; }
  .gcs-letter-msg .w { filter: none; transition: opacity .5s ease; }
  .gcs.is-revealed .gcs-letter-msg .w { transition-delay: 0s; }
  .gcs.is-revealed .gcs-letter-from { transition-delay: 0s; }
}
