/* =====================================================================================
 * Поток продажи: что происходит после кнопки «Получить деньги».
 *
 * Отдельный файл, а не дополнение к 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; }
.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; }

@media (max-width: 560px) {
  .stx-window { max-width: 100%; }
  .stx-steps { padding: 16px 50px 0 16px; gap: 6px; }
  .stx-step span { font-size: 9px; letter-spacing: .04em; }
  .stx-body { padding: 16px; }
  .stx-head { flex-direction: column; }
  .stx-clock { width: 100%; }
  .stx-btn { flex: 1 1 100%; }
}

/* Кружок на кнопке «Получить деньги», пока бот отправляет обмен. Цвет берётся от текста
   кнопки: кнопку рисует другой файл, и свой цвет здесь однажды разошёлся бы с её темой. */
.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; }
