/* AurumStars · NFT — вітрина купівлі та оренди подарунків (Telegram Mini App) */

:root {
  --bg: #0e0507;
  --bg-2: #170a0d;
  --surface: #1c0e11;
  --surface-2: #251317;
  --surface-3: #311a1f;
  --line: rgba(255, 225, 225, .075);
  --line-2: rgba(255, 225, 225, .13);

  --text: #f3f1ea;
  --text-2: #bfa9ab;
  --text-3: #846c70;

  --gold: #f2c14e;
  --gold-2: #ffdf8a;
  --gold-3: #c8932a;
  --gold-ink: #1c1405;
  --gold-soft: rgba(242, 193, 78, .12);

  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff6b7d;

  --r-mythic: #ff5c8a;
  --r-legend: #f2c14e;
  --r-epic: #b884ff;
  --r-rare: #5cc8ff;
  --r-common: #8b93a3;

  --amb-1: rgba(150, 14, 34, .55);
  --amb-2: #12070a;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-std: cubic-bezier(.4, 0, .2, 1);

  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-top-sys: var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));

  --f-ui: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-display: "Unbounded", "Manrope", sans-serif;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html, body { background: var(--bg); }
body {
  min-height: 100vh;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  color: var(--text);
  font: 500 15px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- фонове сяйво: колір підхоплює подарунок ---------- */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--amb-1) 0%, transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(242, 193, 78, .05), transparent 70%),
    var(--bg);
  transition: background .8s var(--e-std);
}
.ambient::after {
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.screen { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; }

/* ---------- банер-герой ---------- */
/* Висота сцени залежить і від ширини, і від висоти екрана: на низьких телефонах (SE)
   банер нижчий, щоб пошук, перемикач і перший ряд карток було видно одразу. */
.hero {
  --scene: clamp(210px, min(80vw, 38vh), 360px);
  --top-gap: calc(var(--safe-top) + 6px);
  position: relative; height: calc(var(--top-gap) + var(--scene)); overflow: hidden; isolation: isolate;
  /* розчиняється у фон сторінки без видимої межі */
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, .55) 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, rgba(0, 0, 0, .55) 78%, transparent 100%);
}
@media (min-width: 520px) { .hero { --scene: clamp(260px, 42vh, 400px); } }
.hero__media { position: absolute; left: 0; right: 0; bottom: 0; top: var(--top-gap); will-change: transform; }
.hero__video {
  width: 100%; height: 100%; object-fit: contain; display: block;
  background: transparent url("banner.jpg?v=4") 50% 50% / contain no-repeat;
  /* відео 1520×1280: запас роздільності дозволяє наблизити Pepe без втрати різкості */
  transform: scale(1.3); transform-origin: 50% 46%;
}
@media (min-width: 520px) { .hero__video { transform: scale(1.15); } }
.hero__fade { /* легка віньєтка по краях і знизу */
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(14, 5, 7, .7) 0%, rgba(14, 5, 7, 0) 45%),
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(14, 5, 7, .55) 100%);
}

/* ---------- перемикач «Купівля / Оренда» під пошуком ---------- */
.finder__seg:empty { display: none; }
#list > .tabs { display: none; }   /* поки app.js не переніс його під пошук */
.tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  padding: 5px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 230, 220, .055), rgba(255, 230, 220, .02)), var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 240, 230, .06), 0 14px 30px -18px rgba(0, 0, 0, .8);
}
.tabs__pill {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 15px;
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 55%, var(--gold-3) 100%);
  box-shadow: 0 8px 22px -8px rgba(242, 193, 78, .65), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .5s var(--e-out);
}
.tabs[data-active="rent"] .tabs__pill { transform: translateX(100%); }
.tabs__btn {
  position: relative; z-index: 1; height: 46px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 15px; letter-spacing: .01em; color: var(--text-2); transition: color .3s var(--e-std);
}
.tabs__btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--e-out); }
.tabs__btn[aria-selected="true"] { color: var(--gold-ink); }
.tabs__btn[aria-selected="true"] svg { transform: scale(1.08); }
.tabs__btn:active svg { transform: scale(.9); }
/* =============================== списки =============================== */
.pane {
  position: relative; z-index: 1; margin-top: -36px;   /* пошук заходить на згасаючий низ банера */
  padding: 4px 16px calc(var(--safe-bottom) + 28px); animation: fade .4s var(--e-out);
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.intro { padding: 10px 2px 16px; }
.intro__title { font: 600 27px/1.08 var(--f-display); letter-spacing: -.025em; text-shadow: 0 2px 18px rgba(14, 5, 7, .8); }
.intro__text { margin-top: 8px; color: var(--text-2); font-size: 14px; max-width: 40ch; text-shadow: 0 1px 10px rgba(14, 5, 7, .9); }

/* ---------- пошук і фільтри (як у маркетах подарунків: Portals) ---------- */
.finder { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.finder__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.finder__div { flex: none; width: 1px; height: 24px; margin: 0 2px; background: var(--line-2); }

.qf {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 14px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s, background .2s;
}
.qf:focus-within { border-color: rgba(242, 193, 78, .45); background: var(--surface); }
.qf > svg { width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.qf input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: 600 16px var(--f-ui); }
.qf input::placeholder { color: var(--text-3); font-weight: 600; }
.qf input::-webkit-search-cancel-button { display: none; }
.qf__x { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); }
.qf__x svg { width: 14px; height: 14px; fill: none; stroke: var(--text-2); stroke-width: 2.6; stroke-linecap: round; }

.rbtn {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); transition: background .2s, transform .2s var(--e-out);
}
.rbtn:active { transform: scale(.92); }
.rbtn svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rbtn svg .fill { fill: var(--text); stroke: none; }
.rbtn--sm { width: 36px; height: 36px; background: var(--surface-3); }
.rbtn--sm svg { width: 18px; height: 18px; stroke-width: 2.4; }
.rbtn.is-on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .45); }
.rbtn.is-on svg { stroke: var(--gold-2); }
.rbtn.is-on svg .fill { fill: var(--gold-2); }
.rbtn__badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font: 800 11px/1 var(--f-ui); color: var(--gold-ink); background: var(--gold);
  box-shadow: 0 0 0 2px var(--bg);
}

.pills {
  flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin-right: -16px; padding-right: 16px; scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent);
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 16px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap; scroll-snap-align: start;
  max-width: 220px; transition: background .2s, color .2s, box-shadow .2s;
}
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.pill.is-on { background: var(--gold-soft); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .45); }
.pill.is-off { color: var(--text-3); }
.pill__dot { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .25); }

.suggest { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -2px -16px 0; padding: 0 16px; }
.suggest::-webkit-scrollbar { display: none; }
.suggest:empty { display: none; }
.sug {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--text);
}
.sug img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sug small { color: var(--text-3); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid.is-dense { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid.is-dense .card__body { padding: 8px 9px 10px; }
.grid.is-dense .card__name { font-size: 12.5px; }
.grid.is-dense .card__meta { display: none; }
.grid.is-dense .card__price { font-size: 13px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.is-dense { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- нижній лист ---------- */
.bs-wrap { position: fixed; inset: 0; z-index: 25; display: flex; align-items: flex-end; justify-content: center; }
.bs-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fadeIn .25s var(--e-std); }
.bs {
  position: relative; width: 100%; max-width: 620px; max-height: 88vh; max-height: calc(var(--tg-viewport-height, 100dvh) * .9);
  display: flex; flex-direction: column; border-radius: 28px 28px 0 0; background: var(--bg-2);
  border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  animation: up .42s var(--e-out);
}
.bs-wrap.is-closing .bs { animation: down .22s var(--e-std) forwards; }
.bs-wrap.is-closing .bs-dim { animation: fadeOut .22s var(--e-std) forwards; }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fadeOut { to { opacity: 0; } }
.bs__grab { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .22); margin: 8px auto 2px; flex: none; }
.bs__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 12px; flex: none; }
.bs__title { font: 600 22px/1.15 var(--f-display); letter-spacing: -.02em; }
.bs__search { flex: none; margin: 0 16px 6px; }
.bs__cols { display: flex; justify-content: space-between; padding: 8px 18px 6px; flex: none; }
.bs__cols button { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; font-weight: 700; }
.bs__cols svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bs__cols button.is-asc, .bs__cols button.is-desc { color: var(--gold-2); }
.bs__cols button.is-asc .dn, .bs__cols button.is-desc .up { opacity: .25; }
.bs__body { flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 8px; }
.bs__foot {
  flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg-2);
}
.bs__btn { height: 52px; border-radius: 999px; font-weight: 800; font-size: 16px; transition: transform .2s var(--e-out), opacity .2s; }
.bs__btn:active { transform: scale(.97); }
.bs__btn--ghost { background: var(--surface-3); color: var(--text); }
.bs__btn--ghost:disabled { opacity: .45; }
.bs__btn--main { color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 24px -10px rgba(242, 193, 78, .7); }

.opt {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 10px; border-radius: 16px; text-align: left;
  transition: background .15s;
}
.opt:active { background: rgba(255, 255, 255, .04); }
.chk {
  flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.chk svg { width: 14px; height: 14px; fill: none; stroke: var(--gold-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .25s var(--e-out); }
.opt.is-on .chk { background: var(--gold); border-color: var(--gold); }
.opt.is-on .chk svg { opacity: 1; transform: none; }
.chk--radio { border-radius: 50%; }
.opt__ic {
  position: relative; flex: none; width: 48px; height: 48px; border-radius: 14px; overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
}
.opt__ic img { width: 100%; height: 100%; object-fit: cover; }
.opt__ic img.is-model { width: 86%; height: 86%; object-fit: contain; }
.opt__ic--round { border-radius: 50%; }
.opt__mask { width: 64%; height: 64%; background: var(--text-2); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.opt__tag {
  position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); padding: 1px 5px; border-radius: 6px;
  font: 800 9.5px/1.3 var(--f-ui); color: var(--text-2); background: rgba(20, 8, 10, .85); white-space: nowrap;
}
.opt__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.opt__main b { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt__main small { color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.opt__side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.opt__side b { font: 600 15px/1.2 var(--f-display); letter-spacing: -.01em; }
.opt__side b.rc { color: var(--rc); }
.opt__side small { color: var(--text-3); font-size: 12px; font-weight: 600; }
.opt__go { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--text-3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.opt--nav .opt__main b { font-size: 16px; }
.opt--nav .opt__main small { color: var(--gold-2); }
.opt--nav .opt__main small.is-none { color: var(--text-3); }
.bs__empty { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.bs__hint { margin: 2px 10px 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--text-3); font-size: 12.5px; }

.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 8px 4px; }
.range label { display: flex; flex-direction: column; gap: 6px; color: var(--text-3); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.range input {
  height: 52px; padding: 0 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; outline: 0;
  color: var(--text); font: 600 18px var(--f-display);
}
.range input:focus { border-color: var(--gold); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 8px; }
.preset { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--text-2); }
.preset.is-on { background: var(--gold-soft); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .45); }

.empty .reset { margin-top: 14px; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-2); font-weight: 800; }

.card {
  display: flex; flex-direction: column; text-align: left; min-width: 0;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .25s var(--e-out), border-color .25s;
  animation: rise .5s var(--e-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.card:active { transform: scale(.97); }
@media (hover: hover) { .card:hover { border-color: var(--line-2); } .card:hover .card__img img { transform: scale(1.05); } }
.card__img { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.card__img::before { /* шиммер, поки вантажиться */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.card__img img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s, transform .6s var(--e-out); }
.card__img img.is-in { opacity: 1; }
@keyframes shimmer { to { background-position: -200% 0; } }
.card__body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.card__name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__name small { color: var(--text-3); font-weight: 600; margin-left: 4px; }
.card__meta { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__meta:empty { display: none; }
.card__price { margin-top: 4px; font: 600 15px/1.1 var(--f-display); color: var(--gold); letter-spacing: -.01em; }
.card__price small { font: 600 11px var(--f-ui); color: var(--text-3); margin-left: 2px; }

.card--skel { pointer-events: none; }
.card--skel .card__body span { display: block; height: 10px; border-radius: 5px; background: var(--surface-3); }
.card--skel .card__body span + span { width: 50%; margin-top: 8px; height: 14px; }

.empty {
  padding: 48px 16px; text-align: center; color: var(--text-2); font-size: 14px;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
}
.empty b { display: block; color: var(--text); font: 600 17px/1.3 var(--f-display); margin-bottom: 6px; }
.empty small { display: block; margin-top: 10px; color: var(--text-3); font-size: 12px; }

.loader { display: flex; justify-content: center; gap: 6px; padding: 22px 0; }
.loader span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: dot 1s var(--e-std) infinite; }
.loader span:nth-child(2) { animation-delay: .15s; }
.loader span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

/* =============================== картка =============================== */
.screen--detail { min-height: 100vh; animation: slide .45s var(--e-out); }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.screen--detail.is-leaving { animation: slideOut .25s var(--e-std) forwards; }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }

.back {
  position: absolute; z-index: 6; top: calc(var(--safe-top) + 12px); left: 12px;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(14, 5, 7, .45); border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.back svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tg .back { display: none; } /* у Telegram — системна кнопка «Назад» */

.stage {
  position: relative; aspect-ratio: 1 / .92; max-height: 62vh; width: 100%;
  overflow: hidden; isolation: isolate;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: var(--surface-2);
}
@media (min-width: 620px) { .stage { border-radius: var(--r-xl); margin-top: 12px; } }
.stage__poster, .stage__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage__poster { transform: scale(1.02); transition: opacity .6s var(--e-std); }
.stage__bg { opacity: 0; transition: opacity .6s var(--e-std); }
.stage.is-live .stage__bg { opacity: 1; }
.stage.is-live .stage__poster { opacity: 0; }
.stage__model {
  position: absolute; left: 50%; top: 45%; width: 56%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(.9); opacity: 0;
  transition: opacity .5s var(--e-std), transform .8s var(--e-out);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .28));
}
.stage.is-live .stage__model { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.stage__model svg { width: 100% !important; height: 100% !important; }
.stage__label {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  font: 700 12px/1 var(--f-ui); letter-spacing: .02em;
  color: var(--lbl, #fff); background: var(--lbl-bg, rgba(0, 0, 0, .25));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.stage__label:empty { display: none; }
.stage__replay { position: absolute; inset: 0; z-index: 2; }
.stage::after { /* мʼякий перехід у фон сторінки */
  content: ""; position: absolute; inset: auto 0 0; height: 30%; pointer-events: none;
  background: linear-gradient(to top, rgba(14, 5, 7, .35), transparent);
}

.sheet { padding: 18px 16px 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head__title { font: 600 24px/1.12 var(--f-display); letter-spacing: -.025em; overflow-wrap: anywhere; }
.head__sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.head__sub b { color: var(--gold); font-weight: 700; }
.head__link {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
}
.head__link svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.block { margin-top: 24px; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.block__title { font: 600 15px/1.2 var(--f-display); letter-spacing: -.01em; }
.block__hint { color: var(--text-3); font-size: 12px; }

.ghost {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px;
  color: var(--gold-2); font-size: 13px; font-weight: 700; background: var(--gold-soft);
}
.ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ghost.is-spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ghost--center { display: flex; margin: 10px auto 0; background: none; color: var(--text-2); }

.samples { margin-top: 22px; }
.samples__row {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 0 -16px; padding: 5px 16px 6px; scroll-padding-inline: 16px;
}
.samples__row::-webkit-scrollbar { display: none; }
.sample {
  position: relative; flex: none; width: 76px; aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  scroll-snap-align: start; background: var(--surface-2);
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s, transform .2s var(--e-out);
  animation: rise .45s var(--e-out) backwards; animation-delay: calc(var(--i, 0) * 45ms);
}
.sample img { width: 100%; height: 100%; object-fit: cover; }
.sample.is-on { outline-color: var(--gold); }
.sample:active { transform: scale(.94); }
.sample--skel { animation: none; }
.sample--skel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.traits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.trait {
  position: relative; padding: 12px 10px 11px; border-radius: var(--r-md); min-width: 0;
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
}
.trait__k { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.trait__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08); }
.trait__v { margin-top: 6px; font-weight: 700; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.trait__r {
  display: inline-block; margin-top: 8px; padding: 3px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 800; color: var(--rc); background: color-mix(in srgb, var(--rc) 14%, transparent);
}
.trait--skel .trait__v, .trait--skel .trait__r { color: transparent; background: var(--surface-3); border-radius: 5px; }
.trait--skel .trait__v { height: 14px; width: 80%; }
.rc-mythic { --rc: var(--r-mythic); }
.rc-legend { --rc: var(--r-legend); }
.rc-epic { --rc: var(--r-epic); }
.rc-rare { --rc: var(--r-rare); }
.rc-common { --rc: var(--r-common); }

.note {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-size: 13px;
}
.note:empty { display: none; }
.note b { color: var(--text); }
.note--warn { border-color: rgba(255, 181, 71, .3); background: rgba(255, 181, 71, .07); }

.days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.day {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px;
  border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line);
  text-align: left; transition: border-color .2s, background .2s, transform .2s var(--e-out);
}
.day:active { transform: scale(.97); }
.day__d { font-weight: 700; font-size: 13px; color: var(--text-2); }
.day__p { font: 600 clamp(12px, 3.9vw, 16px)/1.1 var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
.day__p small { font: 600 11px var(--f-ui); color: var(--text-3); }
.day.is-on { border-color: var(--gold); background: var(--gold-soft); }
.day.is-on .day__d { color: var(--gold-2); }

.facts { list-style: none; margin-top: 14px; display: grid; gap: 8px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 13px; }
.facts li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--gold); }
.facts li.warn { color: var(--warn); }
.facts li.warn::before { background: var(--warn); }

.steps { list-style: none; counter-reset: s; margin-top: 18px; display: grid; gap: 2px; padding: 4px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; padding: 10px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px/1 var(--f-display); color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.steps b { font-size: 14px; }
.steps span { color: var(--text-3); font-size: 12.5px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.seg__btn { height: 40px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--text-2); transition: background .25s, color .25s; }
.seg__btn.is-on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.seg__hint { margin-top: 10px; color: var(--text-3); font-size: 13px; }
.seg__hint b { color: var(--text); }
.seg__hint.is-bad { color: var(--warn); }
.field {
  display: flex; align-items: center; height: 50px; margin-top: 10px; padding: 0 14px;
  border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line); transition: border-color .2s;
}
.field:focus-within { border-color: var(--gold); }
.field.is-bad { border-color: var(--bad); }
.field__at { color: var(--text-3); font-weight: 700; font-size: 16px; }
.field input { flex: 1; min-width: 0; height: 100%; padding-left: 2px; background: none; border: 0; outline: 0; color: var(--text); font: 600 16px var(--f-ui); }
.field input::placeholder { color: var(--text-3); font-weight: 500; }

.pays { display: grid; gap: 8px; }
.pay {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--line); text-align: left; transition: border-color .2s, background .2s;
}
.pay__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--surface-3); flex: none; }
.pay__name { flex: 1; font-weight: 700; }
.pay__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; transition: border-color .2s, box-shadow .2s; }
.pay.is-on { border-color: var(--gold); background: var(--gold-soft); }
.pay.is-on .pay__radio { border-color: var(--gold); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 10px var(--gold); }

.spacer { height: calc(110px + var(--safe-bottom)); }

/* =============================== CTA =============================== */
.cta {
  position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 620px;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(14, 5, 7, .98) 55%, rgba(14, 5, 7, .0));
}
.cta__sum { display: flex; flex-direction: column; min-width: 0; }
.cta__label { color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cta__price { font: 600 22px/1.15 var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
.cta__price.is-wait { opacity: .45; }
.cta__btn {
  position: relative; flex: 1; height: 54px; border-radius: 16px; overflow: hidden;
  font: 700 16px var(--f-ui); color: var(--gold-ink);
  background: linear-gradient(180deg, var(--gold-2) 0%, var(--gold) 55%, var(--gold-3) 100%);
  box-shadow: 0 10px 30px -10px rgba(242, 193, 78, .7), inset 0 1px 0 rgba(255, 255, 255, .55);
  transition: transform .2s var(--e-out), filter .2s, opacity .2s;
}
.cta__btn::after { /* відблиск */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg); animation: gleam 3.6s var(--e-std) infinite 1.2s;
}
@keyframes gleam { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.cta__btn:active { transform: scale(.98); }
.cta__btn:disabled { filter: grayscale(.7) brightness(.6); cursor: default; }
.cta__btn:disabled::after { display: none; }
.cta__btn.is-busy { color: transparent; }
.cta__btn.is-busy::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px;
  border-radius: 50%; border: 2.5px solid rgba(28, 20, 5, .25); border-top-color: var(--gold-ink); animation: spin .7s linear infinite;
}
.cta__btn--wide { width: 100%; flex: none; margin-top: 22px; }

/* =============================== успіх / тост =============================== */
.done {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: end center;
  background: rgba(8, 2, 3, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .3s var(--e-std);
}
@keyframes fadeIn { from { opacity: 0; } }
.done__card {
  width: 100%; max-width: 620px; padding: 30px 22px calc(22px + var(--safe-bottom));
  border-radius: 28px 28px 0 0; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0;
  text-align: center; animation: up .5s var(--e-out);
}
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.done__icon { width: 76px; height: 76px; margin: 0 auto 16px; }
.done__icon svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.done__icon circle { stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s var(--e-out) forwards .1s; fill: var(--gold-soft); }
.done__icon path { stroke: var(--gold-2); stroke-width: 3.5; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s var(--e-out) forwards .55s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done__title { font: 600 22px/1.2 var(--f-display); letter-spacing: -.02em; }
.done__text { margin-top: 10px; color: var(--text-2); font-size: 14.5px; }
.done__text b { color: var(--text); }

.toast {
  position: fixed; z-index: 30; left: 50%; top: calc(var(--safe-top) + 14px); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: #2a1820; border: 1px solid rgba(255, 107, 125, .35); color: #ffd9de; font-size: 14px; font-weight: 600;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6); animation: drop .35s var(--e-out);
}
.toast.is-ok { background: #13261f; border-color: rgba(61, 220, 151, .35); color: #c9f7e2; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
