/* =====================================================================================
 * Поток продажи: что происходит после кнопки «Получить деньги».
 *
 * Отдельный файл, а не дополнение к sell-page.css: там четыре с лишним тысячи строк
 * про инвентарь и способы выплаты, и экраны сделки с ними ничем не связаны.
 *
 * Выбранная модель — бот присылает предложение обмена, мы показываем экран ожидания.
 * Поэтому ключевой экран здесь не «успех», а «ждём подтверждения»: именно на нём человек
 * проводит минуты и именно там он сверяет бота перед тем, как отдать предметы.
 * ===================================================================================== */

.stx-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 6, 8, .74);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .18s ease;
}
.stx-overlay.is-open { opacity: 1; }

.stx-window {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid #23232b;
  border-radius: 18px;
  background: #0e0e12;
  box-shadow: 0 34px 90px -32px rgba(0, 0, 0, .95);
  transform: translateY(14px) scale(.975);
  transition: transform .24s cubic-bezier(.2, .8, .3, 1);
}
.stx-overlay.is-open .stx-window { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .stx-window { transform: none; transition: none; }
}

.stx-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .6);
  font-family: inherit;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.stx-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ---- шаги ---------------------------------------------------------------------------
 * Три шага показаны всегда, даже на первом: человек должен видеть, что деньги не сразу
 * за кнопкой, а после обмена. Это снимает половину вопросов в поддержку.
 */
/* Справа оставлено место под крестик: иначе последний шаг уезжает под него. */
.stx-steps { display: flex; gap: 10px; padding: 20px 56px 0 22px; }
.stx-step { flex: 1; min-width: 0; }
.stx-step i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}
.stx-step span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, .35);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stx-step.done i { background: #22d17e; }
.stx-step.done span { color: rgba(34, 209, 126, .75); }
.stx-step.now i { background: linear-gradient(90deg, #22d17e, rgba(34, 209, 126, .15)); }
.stx-step.now span { color: #fff; }
.stx-step.fail i { background: #ef4444; }
.stx-step.fail span { color: #fca5a5; }

.stx-body { padding: 20px 22px 22px; }

.stx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.stx-title { margin: 0; color: #fff; font-size: 18px; font-weight: 800; line-height: 1.25; }
.stx-sub { margin: 6px 0 0; color: rgba(255, 255, 255, .45); font-size: 13px; line-height: 1.5; }

/* Часы крупные: это единственное, что меняется само, и человек на них смотрит. */
.stx-clock {
  flex: none;
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(34, 209, 126, .1);
  color: #22d17e;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.stx-clock.warn { background: rgba(245, 158, 11, .12); color: #fbbf24; }

/* ---- карточка бота -------------------------------------------------------------------
 * Главный защитный элемент: подменный обмен приходит ровно в эту минуту, и сверять его
 * человеку больше не с чем. Поэтому имя, уровень, steam id и номер обмена — рядом и
 * копируются одним нажатием.
 */
.stx-bot {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #1e1e24;
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
}
.stx-bot img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.stx-bot-name { color: #fff; font-size: 14px; font-weight: 700; }
/* Аватар и ник — ссылки на Steam-профиль бота. */
.stx-bot-avatar { display: block; width: 52px; height: 52px; border-radius: 10px; }
a.stx-bot-avatar img { transition: opacity .15s, box-shadow .15s; }
a.stx-bot-avatar:hover img { opacity: .85; box-shadow: 0 0 0 2px rgba(34, 209, 126, .6); }
a.stx-bot-name { display: inline-block; text-decoration: none; transition: color .15s; }
a.stx-bot-name:hover { color: #22d17e; text-decoration: underline; text-underline-offset: 3px; }
.stx-bot-rows { margin-top: 8px; display: grid; gap: 5px; }
.stx-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stx-row > span { color: rgba(255, 255, 255, .38); font-size: 11.5px; }
.stx-row > b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e8e8ec;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stx-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #2a2a33;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .45);
  cursor: pointer;
}
.stx-copy { position: relative; }
.stx-copy:hover { border-color: rgba(34, 209, 126, .45); color: #22d17e; }
.stx-copy svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Значок и галочка лежат друг на друге и меняются местами: так кнопка не дёргается в
   разметке, а смена читается как одно движение. */
.stx-copy-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity .22s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}
.stx-copy-glyph.done { opacity: 0; transform: scale(.4) rotate(-20deg); color: #22d17e; }
.stx-copy.is-copied .stx-copy-glyph.copy { opacity: 0; transform: scale(.4); }
.stx-copy.is-copied .stx-copy-glyph.done { opacity: 1; transform: none; }
.stx-copy.is-copied { border-color: rgba(34, 209, 126, .45); }

.stx-copy-tip {
  position: absolute;
  right: -4px;
  bottom: calc(100% + 7px);
  z-index: 5;
  padding: 4px 8px;
  border: 1px solid rgba(34, 209, 126, .3);
  border-radius: 6px;
  background: #0f1d16;
  color: #22d17e;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .8);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .2s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
}
.stx-copy-tip::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 100%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1px solid rgba(34, 209, 126, .3);
  border-bottom: 1px solid rgba(34, 209, 126, .3);
  background: #0f1d16;
  transform: rotate(45deg);
}
.stx-copy.is-copied .stx-copy-tip { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .stx-copy-glyph, .stx-copy-tip { transition: opacity .16s ease; }
  .stx-copy-glyph.done, .stx-copy.is-copied .stx-copy-glyph.copy { transform: none; }
}

/* ---- предметы ------------------------------------------------------------------------ */
.stx-items { margin-top: 16px; }
.stx-items-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stx-items-head b { color: #fff; font-size: 13px; font-weight: 700; }
.stx-items-head span { color: #22d17e; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stx-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.stx-thumb {
  position: relative;
  width: 56px;
  height: 46px;
  border: 1px solid #1e1e24;
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  outline: none;
  cursor: default;
  transition: border-color .15s;
}
.stx-thumb img { width: 100%; height: 100%; border-radius: 8px; object-fit: contain; }
.stx-thumb:hover, .stx-thumb:focus-visible { border-color: #3a3a44; }
/* Остаток числом вместо ещё двадцати картинок: список не должен расти без предела. */
.stx-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 46px;
  border: 1px dashed #2a2a33;
  border-radius: 9px;
  color: rgba(255, 255, 255, .45);
  font-size: 12px;
  font-weight: 700;
}

/* ---- заметки -------------------------------------------------------------------------- */
.stx-note {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 12px;
  background: rgba(245, 158, 11, .07);
  color: #e8d9b8;
  font-size: 12.5px;
  line-height: 1.55;
}
.stx-note svg { flex: none; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; }
.stx-note.bad { border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .08); color: #fca5a5; }
.stx-note b { color: #fff; }
.stx-note.bad b { color: #fff; }
.stx-note a { color: inherit; text-decoration: underline; }

/* ---- шаги восстановления после отмены -------------------------------------------------
 * Отмена обмена — возможный признак того, что ключом API распоряжается не владелец.
 * Поэтому здесь не «попробуйте снова», а список действий со ссылками прямо на них.
 */
.stx-recover { margin: 14px 0 0; padding: 0 0 0 18px; color: rgba(255, 255, 255, .55); font-size: 12.5px; line-height: 1.6; }
.stx-recover li { margin-bottom: 5px; }
.stx-recover a { color: #22d17e; }

/* ---- кнопки --------------------------------------------------------------------------- */
.stx-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.stx-btn {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: filter .16s ease, border-color .16s ease, background .16s ease;
}
.stx-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
/* Фирменные значки нарисованы заливкой, а не обводкой: общее правило кнопок сделало бы
   их пустыми контурами. Размер чуть больше — сплошная фигура читается мельче. */
.stx-btn svg.stx-fill { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.stx-btn.primary { background: linear-gradient(180deg, #22d17e, #17b86a); color: #06130c; }
.stx-btn.primary:hover { filter: brightness(1.08); }
.stx-btn.ghost { border-color: #2a2a33; background: rgba(255, 255, 255, .03); color: #e8e8ec; }
.stx-btn.ghost:hover { border-color: rgba(34, 209, 126, .45); color: #22d17e; }
.stx-btn:disabled { opacity: .55; cursor: default; }

.stx-msg { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; }
.stx-msg.ok { color: #22d17e; }
.stx-msg.error { color: #fca5a5; }

/* ---- итог ------------------------------------------------------------------------------ */
.stx-done-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 4px auto 14px;
  border-radius: 50%;
  background: rgba(34, 209, 126, .12);
  color: #22d17e;
}
.stx-done-mark.bad { background: rgba(239, 68, 68, .12); color: #ef4444; }
.stx-done-mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.stx-center { text-align: center; }
.stx-amount { color: #22d17e; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Сумма в ожидании — янтарная, а не зелёная: зелёный на этом сайте значит «деньги
   на балансе», и здесь он обещал бы то, чего ещё нет. */
.stx-amount.hold { color: #fbbf24; }
.stx-pending-label { margin: 14px 0 0; color: rgba(255, 255, 255, .4); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stx-pending-label + .stx-amount { margin-top: 2px; }

/* ---- телефон --------------------------------------------------------------------------
 * На узком экране содержимое экрана ожидания (часы, карточка бота, предметы и две
 * заметки) выше окна браузера, и кнопки «Открыть Steam» уезжали за нижний край: чтобы
 * принять обмен, человеку приходилось сначала догадаться прокрутить окно.
 *
 * Поэтому на телефоне прокручивается не окно целиком, а только его середина, а ряд
 * кнопок прилипает к низу окна и виден всегда. Заодно всё ужато по высоте, так что
 * у обычной сделки прокрутки не остаётся вовсе.
 */
@media (max-width: 560px) {
  .stx-overlay { padding: 10px; }
  .stx-window {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    /* dvh — чтобы адресная строка мобильного браузера не срезала низ окна. */
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow: hidden;
  }
  /* Экран лежит в обёртке перехода, поэтому колонкой становится и она: иначе середине
     не от чего считать свою высоту и прокрутка вернулась бы к окну целиком. */
  .stx-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  .stx-steps { flex: none; padding: 12px 50px 0 16px; gap: 6px; }
  .stx-step span { font-size: 9px; letter-spacing: .04em; }
  .stx-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px 16px 0; }
  .stx-title { font-size: 17px; }
  .stx-sub { margin-top: 4px; font-size: 12.5px; line-height: 1.45; }
  .stx-head { flex-direction: column; gap: 8px; }
  .stx-clock { width: 100%; padding: 5px 12px; font-size: 21px; }

  /* Ужимаем по высоте всё, что между заголовком и кнопками. */
  .stx-bot { gap: 12px; margin-top: 12px; padding: 12px; grid-template-columns: 44px minmax(0, 1fr); }
  .stx-bot img, .stx-bot-avatar { width: 44px; height: 44px; }
  .stx-items { margin-top: 12px; }
  .stx-thumbs { gap: 6px; margin-top: 8px; }
  .stx-thumb, .stx-more { width: 48px; height: 40px; }
  .stx-note { margin-top: 8px; padding: 9px 11px; font-size: 12px; line-height: 1.4; }
  .stx-recover { margin-top: 12px; font-size: 12px; line-height: 1.5; }
  .stx-done-mark { width: 54px; height: 54px; margin-bottom: 10px; }

  /* Кнопки прижаты к низу окна: содержимое уходит под них, а не прячет их за краем.
     Отрицательные поля возвращают полосе всю ширину окна — иначе середина просвечивала
     бы в отступах .stx-body. */
  .stx-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 16px -16px 0;
    padding: 12px 16px 16px;
    background: #0e0e12;
    box-shadow: 0 -10px 14px -10px rgba(0, 0, 0, .9);
  }
  .stx-btn { flex: 1 1 100%; height: 42px; }
  /* Сообщение об ошибке живёт под кнопками, поэтому полоса остаётся непрозрачной. */
  .stx-msg { margin: 0 0 14px; }
}

/* Кружок на кнопке «Получить деньги», пока бот отправляет обмен. Цвет берётся от текста
   кнопки: кнопку рисует другой файл, и свой цвет здесь однажды разошёлся бы с её темой. */
.stx-busy {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: stx-spin .7s linear infinite;
}
@keyframes stx-spin { to { transform: rotate(360deg); } }
/* Уважаем отключённую анимацию: вместо вращения кружок просто притухает. */
@media (prefers-reduced-motion: reduce) {
  .stx-busy { animation: none; opacity: .5; }
}

/* =====================================================================================
 * Свёрнутая плашка сделки.
 *
 * Левый нижний угол выбран не случайно: правый занят итогом выплаты и кнопкой, а нижняя
 * полоса страницы тянется во всю ширину, и слева от неё остаётся самое спокойное место.
 * ===================================================================================== */
.stx-dock {
  position: fixed;
  /* По левому краю нижней полосы страницы, а не экрана: полоса отцентрована по ширине
     содержимого, и плашка у самого края стояла бы сама по себе. */
  left: max(16px, calc(50% - var(--content-width, 112rem) / 2));
  /* Над полосой «Выберите предметы выше»: она прижата к низу с отступом 16 и высотой 56. */
  bottom: 84px;
  z-index: 1150;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px 10px 10px;
  border: 1px solid #23232a;
  border-radius: 14px;
  background: #121216;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease;
}
.stx-dock.is-open { opacity: 1; transform: none; }
.stx-dock:hover { border-color: #2f2f38; }
.stx-dock-clock {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(34, 209, 126, .12);
  color: #22d17e;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.stx-dock-text { display: grid; gap: 2px; min-width: 0; }
.stx-dock-text b { color: #fff; font-size: 12.5px; font-weight: 700; }
.stx-dock-text span {
  overflow: hidden;
  color: rgba(255, 255, 255, .4);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* На узком экране нижняя полоса страницы занимает весь низ, поэтому плашка встаёт над
   ней и тянется во всю ширину: иначе она налезала бы на кнопку продажи. */
@media (max-width: 560px) {
  .stx-dock { left: 12px; right: 12px; max-width: none; }
}

/* Подсказка над предметом: название, качество его цветом и цена. У «+N» — список остальных. */
.stx-tip {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid #2a2a31;
  border-radius: 9px;
  background: #16161a;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .8);
  color: #e8e8ee;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .15s, transform .15s;
}
.stx-tip b { color: #fff; font-size: 12px; font-weight: 700; line-height: 1.35; white-space: normal; }
.stx-tip i { font-size: 11px; font-style: normal; font-weight: 600; }
.stx-tip em { color: #22d17e; font-size: 11.5px; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.stx-tip.list { gap: 6px; max-width: 280px; }
.stx-tip-line { display: flex; flex-direction: column; gap: 1px; }
.stx-tip-line b { font-size: 11.5px; font-weight: 600; }
.stx-tip.list em { color: #6b6b75; }
.stx-thumb:hover .stx-tip, .stx-thumb:focus-visible .stx-tip,
.stx-more:hover .stx-tip, .stx-more:focus-visible .stx-tip { opacity: 1; transform: translate(-50%, 0); }
/* Крайние карточки: подсказка прижимается к своему краю, а не вылезает за окно. */
.stx-thumbs > :first-child .stx-tip { left: 0; transform: translate(0, 4px); }
.stx-thumbs > :first-child:hover .stx-tip, .stx-thumbs > :first-child:focus-visible .stx-tip { transform: translate(0, 0); }
.stx-thumbs > :last-child .stx-tip { left: auto; right: 0; transform: translate(0, 4px); }
.stx-thumbs > :last-child:hover .stx-tip, .stx-thumbs > :last-child:focus-visible .stx-tip { transform: translate(0, 0); }
.stx-more { position: relative; cursor: default; outline: none; }

/* =====================================================================================
 * Переход между экранами окна.
 *
 * Экраны разной высоты сменяют друг друга в одной рамке: уходящий гаснет вверх, окно
 * доезжает до новой высоты, новый приходит снизу. Высоту на время перехода задаёт
 * рантайм в пикселях — в CSS её неоткуда взять.
 * ===================================================================================== */
.stx-view {
  transition: opacity .24s ease, transform .3s cubic-bezier(.2, .8, .3, 1);
}
.stx-view.is-out { opacity: 0; transform: translateY(-8px); transition-duration: .15s; }
.stx-view.is-in { opacity: 0; transform: translateY(10px); transition: none; }
.stx-window.is-morphing { overflow: hidden; transition: height .3s cubic-bezier(.3, .8, .3, 1); }

/* =====================================================================================
 * Итог продажи: десять вариантов праздника.
 *
 * Вариант выбирается на странице (`?saleAnim`) и запоминается в localStorage, поэтому
 * здесь они все живут рядом и разделены только номером в data-anim. Общее у всех одно:
 * сначала появляется знак, потом текст и сумма — порядок чтения не меняется от варианта
 * к варианту, меняется только характер движения.
 * ===================================================================================== */
.stx-done-art { position: relative; }
.stx-done-art .stx-done-mark { position: relative; }

/* Текст по умолчанию выходит лесенкой; отдельные варианты это переопределяют. */
.stx-done-art .stx-title { animation: stx-rise .42s ease-out .16s both; }
.stx-done-art .stx-sub { animation: stx-rise .42s ease-out .22s both; }
.stx-done-art .stx-pending-label { animation: stx-rise .42s ease-out .3s both; }
.stx-done-art .stx-amount { animation: stx-rise .46s cubic-bezier(.2, 1.1, .3, 1) .36s both; }

@keyframes stx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes stx-soft { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }
@keyframes stx-draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }

/* 1 · Пружина: знак выскакивает с перелётом, галочка дорисовывается. */
@keyframes stx-pop {
  0% { opacity: 0; transform: scale(.3); }
  60% { opacity: 1; transform: scale(1.14); }
  100% { transform: scale(1); }
}
.stx-done-art[data-anim="1"] .stx-done-mark { animation: stx-pop .5s cubic-bezier(.2, 1.2, .3, 1) both; }
.stx-done-art[data-anim="1"] .stx-done-mark svg path {
  stroke-dasharray: 30;
  animation: stx-draw .45s ease-out .2s both;
}

/* 2 · Волны: от знака расходятся два кольца. */
@keyframes stx-ring { from { opacity: .6; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }
.stx-done-art[data-anim="2"] .stx-done-mark { animation: stx-soft .5s ease-out both; }
.stx-done-art[data-anim="2"] .stx-done-mark::before,
.stx-done-art[data-anim="2"] .stx-done-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(34, 209, 126, .55);
  border-radius: 50%;
  animation: stx-ring 1.15s ease-out .1s both;
}
.stx-done-art[data-anim="2"] .stx-done-mark::after { animation-delay: .42s; }

/* 3 · Штамп: знак прилетает сверху и впечатывается, по кругу идёт вспышка. */
@keyframes stx-stamp {
  0% { opacity: 0; transform: scale(1.9) rotate(-14deg); filter: blur(7px); }
  65% { opacity: 1; transform: scale(.94) rotate(3deg); filter: blur(0); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes stx-flash { from { opacity: .75; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
.stx-done-art[data-anim="3"] .stx-done-mark { animation: stx-stamp .52s cubic-bezier(.3, .9, .3, 1) both; }
.stx-done-art[data-anim="3"] .stx-done-mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 209, 126, .45), transparent 70%);
  animation: stx-flash .45s ease-out .3s both;
}
.stx-done-art[data-anim="3"] .stx-title { animation: stx-rise .4s ease-out .34s both; }
/* Тем же штампом приходят «Сделка отменена» и «Не удалось создать сделку» — только
   вспышка по цвету знака, зелёная там выглядела бы как успех. */
.stx-done-art[data-anim="3"] .stx-done-mark.bad::after {
  background: radial-gradient(circle, rgba(239, 68, 68, .45), transparent 70%);
}

/* 4 · Конфетти: частицы разлетаются и опадают (их сыплет рантайм). */
.stx-done-art[data-anim="4"] .stx-done-mark { animation: stx-pop .46s cubic-bezier(.2, 1.2, .3, 1) both; }

.stx-burst { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.stx-burst i {
  position: absolute;
  top: 34px;
  left: 50%;
  display: block;
}
.stx-burst.confetti i {
  width: 7px;
  height: 10px;
  border-radius: 2px;
  animation: stx-confetti var(--t) cubic-bezier(.2, .7, .4, 1) var(--delay) both;
}
@keyframes stx-confetti {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  14% { opacity: 1; }
  55% { opacity: 1; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(240deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y) + 92px)) rotate(430deg); }
}

/* 5 · Сумма: знак отходит на второй план, крупно выходит сама сумма. */
@keyframes stx-amount-in {
  0% { opacity: 0; transform: scale(.55); filter: blur(9px); }
  60% { opacity: 1; transform: scale(1.16); filter: blur(0); }
  100% { transform: scale(1); }
}
@keyframes stx-amount-glow {
  0%, 100% { text-shadow: none; }
  40% { text-shadow: 0 0 26px rgba(34, 209, 126, .55); }
}
.stx-done-art[data-anim="5"] .stx-done-mark { animation: stx-soft .4s ease-out both; }
.stx-done-art[data-anim="5"] .stx-amount {
  animation: stx-amount-in .62s cubic-bezier(.2, 1.2, .3, 1) .24s both,
    stx-amount-glow 1.1s ease-out .5s both;
}

/* 6 · Блик: по карточке проходит световая полоса. */
@keyframes stx-shine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
.stx-done-art[data-anim="6"] { overflow: hidden; }
.stx-done-art[data-anim="6"] .stx-done-mark { animation: stx-soft .55s ease-out both; }
.stx-done-art[data-anim="6"]::after {
  content: "";
  position: absolute;
  inset: -20px -40px;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .13) 50%, transparent 62%);
  animation: stx-shine 1.05s ease-out .22s both;
  pointer-events: none;
}

/* 7 · Отскок: знак падает сверху и упруго приземляется. */
@keyframes stx-drop {
  0% { opacity: 0; transform: translateY(-52px) scale(.82); }
  50% { opacity: 1; transform: translateY(0) scale(1.08, .92); }
  70% { transform: translateY(-12px) scale(.97, 1.04); }
  85% { transform: translateY(0) scale(1.04, .97); }
  100% { transform: translateY(0) scale(1); }
}
.stx-done-art[data-anim="7"] .stx-done-mark { animation: stx-drop .72s cubic-bezier(.3, .7, .3, 1) both; }
.stx-done-art[data-anim="7"] .stx-title { animation: stx-rise .42s ease-out .3s both; }
.stx-done-art[data-anim="7"] .stx-sub { animation: stx-rise .42s ease-out .36s both; }

/* 8 · Переворот: знак разворачивается лицом. */
@keyframes stx-flip {
  from { opacity: 0; transform: perspective(520px) rotateY(-180deg) scale(.72); }
  to { opacity: 1; transform: perspective(520px) rotateY(0) scale(1); }
}
.stx-done-art[data-anim="8"] .stx-done-mark { animation: stx-flip .62s cubic-bezier(.2, .9, .25, 1) both; }
.stx-done-art[data-anim="8"] .stx-title { animation: stx-rise .42s ease-out .32s both; }

/* 9 · Искры: короткие лучи разлетаются от знака (их рисует рантайм). */
.stx-done-art[data-anim="9"] .stx-done-mark { animation: stx-pop .46s cubic-bezier(.2, 1.2, .3, 1) both; }
.stx-burst.spark i {
  width: 2px;
  height: 11px;
  border-radius: 1px;
  background: linear-gradient(180deg, #7ef0b4, rgba(34, 209, 126, 0));
  transform-origin: 50% 0;
  animation: stx-spark var(--t) cubic-bezier(.15, .7, .3, 1) var(--delay) both;
}
@keyframes stx-spark {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(8px) scaleY(.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--a)) translateY(var(--d)) scaleY(1); }
}

/* 10 · Свечение: вокруг знака дважды проходит мягкий ореол. */
@keyframes stx-halo {
  0% { box-shadow: 0 0 0 0 rgba(34, 209, 126, .35); }
  45% { box-shadow: 0 0 0 16px rgba(34, 209, 126, .14); }
  70% { box-shadow: 0 0 0 26px rgba(34, 209, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 209, 126, 0); }
}
.stx-done-art[data-anim="10"] .stx-done-mark { animation: stx-soft .6s ease-out both, stx-halo 1.9s ease-out .25s both; }
.stx-done-art[data-anim="10"] .stx-title { animation: stx-rise .55s ease-out .26s both; }
.stx-done-art[data-anim="10"] .stx-sub { animation: stx-rise .55s ease-out .34s both; }

/* Выключенная анимация — выключена целиком: ни переходов, ни частиц (их рантайм и не
   создаёт), только готовый экран. */
@media (prefers-reduced-motion: reduce) {
  .stx-view, .stx-window.is-morphing { transition: none; }
  .stx-done-art *, .stx-done-art::after,
  .stx-done-art .stx-done-mark::before, .stx-done-art .stx-done-mark::after { animation: none; }
}
