/* Итог мастера «Твой персонаж готов» (create/final.js): большой заблюренный силуэт на месте будущего портрета, выбор
   строками с «Изменить», что получишь, строка цены; главная кнопка «Создать за 💎100» с бликом; мягкая шторка
   «Осталось пополнить» (create/topup.js). Подключается из create.css (@import). Бесконечные анимации — только
   transform/opacity (tests/render-churn.test.js). */

/* ---------- Итог ---------- */
.create-final { display: flex; flex-direction: column; align-items: center; padding-bottom: 8px; }

.create-final__portrait {
  position: relative;
  width: min(280px, 72vw);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 45, 120, 0.4);
  background:
    radial-gradient(90% 60% at 50% 28%, rgba(255, 45, 120, 0.38), transparent 70%),
    radial-gradient(80% 60% at 85% 100%, rgba(139, 92, 246, 0.5), transparent 70%),
    linear-gradient(170deg, #2b1838, #120f22);
  box-shadow: 0 24px 60px rgba(255, 45, 120, 0.28), var(--shadow);
  animation: create-pop 520ms var(--ease-spring, var(--ease)) both;
}
.create-final__portrait--anime {
  border-color: rgba(110, 231, 249, 0.4);
  background:
    radial-gradient(90% 60% at 50% 28%, rgba(110, 231, 249, 0.3), transparent 70%),
    radial-gradient(80% 60% at 15% 100%, rgba(255, 45, 120, 0.42), transparent 70%),
    linear-gradient(170deg, #1a2140, #110f22);
  box-shadow: 0 24px 60px rgba(110, 231, 249, 0.18), var(--shadow);
}
/* Силуэт: статичное размытие (не анимируется — перерисовки каждый кадр нет) */
.create-final__silhouette { position: absolute; inset: 10% 4% 0; display: block; color: rgba(255, 214, 236, 0.55); filter: blur(7px); }
.create-final__portrait--anime .create-final__silhouette { color: rgba(206, 246, 255, 0.45); }
.create-final__silhouette svg { display: block; width: 100%; height: 100%; fill: currentColor; }
/* Блик по портрету: лента едет сдвигом (как шиммер ожидания) */
.create-final__sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.create-final__sheen::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 500%;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%) 0 0 / 50% 100% repeat-x;
  animation: create-sheen 2.6s linear infinite;
  will-change: transform;
}
.create-final__portrait::after { content: ""; position: absolute; inset: 60% 0 0; z-index: 1; background: linear-gradient(180deg, transparent, rgba(11, 10, 20, 0.9)); pointer-events: none; }
.create-final__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  max-width: calc(100% - 80px);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(11, 10, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.create-final__hero-edit {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: rgba(11, 10, 20, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.create-final__hero-edit .icon { width: 18px; height: 18px; }
.create-final__foot { position: absolute; left: 16px; right: 14px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; gap: 6px; text-align: left; }
/* Имя и возраст строкой: длинное имя переносится, возраст — сразу за ним, а не у правого края */
.create-final__who { font-size: 26px; line-height: 1.1; overflow-wrap: anywhere; }
.create-final__name { font-weight: 900; letter-spacing: -0.02em; }
.create-final__name.is-later { color: var(--text-2); font-style: italic; font-weight: 800; }
.create-final__age { margin-left: 8px; font-weight: 700; white-space: nowrap; color: rgba(242, 240, 255, 0.75); }
.create-final__eta { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.3; color: rgba(242, 240, 255, 0.82); }
.create-final__eta .icon { flex: 0 0 auto; width: 14px; height: 14px; color: var(--amber); }

.create-final__title { margin-top: 20px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; text-align: center; }
.create-final__lead { max-width: 400px; margin: 6px 0 0; font-size: 14px; line-height: 1.45; text-align: center; color: var(--muted); }

/* Выбор: строки с «Изменить» */
.create-final__facts {
  align-self: stretch;
  margin-top: 18px;
  padding: 2px 16px;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 80% at 100% 0%, rgba(255, 45, 120, 0.12), transparent 60%), var(--card);
  border: 1px solid var(--line-2);
}
.create-final__row { padding: 12px 0; border-top: 1px solid var(--line); }
.create-final__row:first-child { border-top: 0; }
.create-final__row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; margin-bottom: 8px; }
.create-final__key { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
/* Тап-зона 44 px без лишней высоты строки: отрицательные поля */
.create-final__edit { min-height: 44px; margin: -11px -8px -11px 0; padding: 0 8px; border-radius: var(--r-xs); font-size: 13px; font-weight: 700; color: var(--pink); }
.create-final__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.create-final__chip { padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.create-final__empty { font-size: 13px; color: var(--muted-2); }
.create-final__quote { margin: 8px 0 0; font-size: 13px; font-style: italic; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.create-final__voice { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.create-final__voice .icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--violet); }

/* Что получишь */
.create-final__perks { align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.create-final__perk { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: var(--r); font-size: 13px; font-weight: 600; line-height: 1.3; background: var(--card); border: 1px solid var(--line); }
.create-final__perk .icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--pink); }

/* Цена и баланс — впервые за весь мастер */
.create-final__checkout {
  align-self: stretch;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: rgba(110, 231, 249, 0.06);
  border: 1px solid rgba(110, 231, 249, 0.24);
}
.create-final__checkout.is-free { background: rgba(45, 212, 160, 0.08); border-color: rgba(45, 212, 160, 0.3); }
.create-final__cost { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.create-final__cost .icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--gem); }
.create-final__checkout.is-free .create-final__cost .icon { color: var(--green); }
.create-final__balance { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Главная кнопка итога: блик раз в несколько секунд (своим слоем: ::after у .btn занят спиннером загрузки) */
.create__next--final { overflow: hidden; box-shadow: var(--glow-strong); }
.create__next-sheen { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.create__next-sheen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.3) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: create-cta-sheen 3.4s ease-in-out infinite;
  will-change: transform;
}
/* Пополнил — кнопка дважды «вздыхает»: осталось одно нажатие */
.create__next.is-ready { animation: create-ready 900ms var(--ease) 2; }
/* …и над ней строка «Гемов хватает — осталось нажать «Создать»» (в нижней панели: тост на этом месте закрывал кнопку
   и строку цены). Одна строка на 360 px */
.create__ready {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--green);
  text-align: center;
}
.create__ready .icon { flex: 0 0 auto; width: 16px; height: 16px; }

/* Итог — во всю ширину колонки: превью сбоку на десктопе его повторяло бы */
@media (min-width: 1024px) {
  .create__layout.is-final { grid-template-columns: minmax(0, 1fr); max-width: 600px; }
  .create__layout.is-final .create__aside { display: none; }
  .create__layout.is-final + .create__footer .create__footer-inner { max-width: 600px; margin-inline: auto; padding-right: 0; }
  .create__layout.is-final + .create__footer .create__ready { max-width: 600px; margin-inline: auto; }
}

/* ---------- Шторка «Осталось пополнить» ---------- */
.create-topup__sub { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.create-topup__closed { margin: 0 0 4px; padding: 10px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.4; background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.35); }
.create-topup__packs { display: flex; flex-direction: column; gap: 8px; }
.create-topup__pack {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--r);
  text-align: left;
  color: var(--text);
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--inner-hi);
  transition: transform var(--t-fast) var(--ease), opacity var(--t);
}
.create-topup__pack:active { transform: scale(0.98); }
.create-topup__pack:disabled, .create-topup__pack.is-loading { opacity: 0.6; }
.create-topup__pack.is-best {
  border-color: transparent;
  background: linear-gradient(180deg, var(--card-2), var(--card)) padding-box, var(--grad) border-box;
  box-shadow: 0 8px 24px rgba(255, 45, 120, 0.28), var(--inner-hi);
}
.create-topup__pack--sk { border: 0; box-shadow: none; }
.create-topup__pack-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.create-topup__pack-badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: var(--grad); }
.create-topup__pack-total { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.create-topup__pack-bonus { font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--green); }
.create-topup__pack-price { flex: 0 0 auto; min-width: 76px; padding: 9px 12px; border-radius: 999px; text-align: center; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); }
.create-topup__pack.is-best .create-topup__pack-price { color: #fff; background: var(--grad); border-color: transparent; }
.create-topup__after { margin: 10px 0 0; font-size: 13px; line-height: 1.4; text-align: center; color: var(--muted); }
.create-topup__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.create-topup__foot { margin: 12px 0 0; font-size: 12px; line-height: 1.4; text-align: center; color: var(--muted-2); }

@keyframes create-cta-sheen { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes create-ready { 0%, 100% { transform: none; } 50% { transform: scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  .create-final__sheen::before, .create__next-sheen::before, .create__next.is-ready { animation: none; }
}
