/* Один экран: выбрать товар, заполнить, оплатить. */
.store {
  display: grid;
  justify-items: center;
  gap: clamp(1rem, 0.6rem + 2vw, 1.75rem);
  min-height: calc(100dvh - var(--header-height) - 5rem);
  padding: clamp(0.5rem, 3vh, 2.5rem) var(--space-gutter) 2rem;
  align-content: start;
}

/* ── Шапка: аватар и разлетающиеся значки, как в мини-приложении звёзд ── */
.hero {
  --hero-color: var(--color-gold);
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 30rem;
  height: clamp(8rem, 6.5rem + 6vw, 10rem);
  /* заголовок и карточка покупки подтянуты ближе: значки залетают и за них */
  margin-bottom: -0.5rem;
}

/* Квадрат анимации с центром в аватаре — как в мини-приложении, где он во всю ширину экрана.
   Лежит под заголовком и карточкой покупки: значки вылетают из-за них. */
.hero__sparks {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(100vw, 32rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero__avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: clamp(5.5rem, 4.6rem + 4vw, 6.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0c0c0e;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1),
    0 0 44px -4px color-mix(in srgb, var(--hero-color) 60%, transparent);
  transition: box-shadow var(--duration-slow);
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* у картинки широкие тёмные поля — приближаем персонажа */
  transform: scale(1.3) translateY(4%);
}

/* Аватар получателя из Telegram уже квадратный и по центру — приближение не нужно */
.hero__avatar--user .hero__photo {
  transform: none;
}

.store__title {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  text-align: center;
}

/* Фирменный перелив заголовка: золото → оранжевый → розовый → фиолетовый */
.shine {
  background: linear-gradient(100deg, #ffcf70 0%, #ff9a00 30%, #ff477e 65%, #7b61ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.checkout {
  display: grid;
  gap: 1rem;
  width: 100%;
  max-width: 30rem;
  /* без подложки: форма лежит прямо на фоне страницы, значки шапки пролетают за ней */
}

/* ── Выбор товара ──────────────────────────────────── */
/* Разделы — одна строка маленьких капсул, листается влево-вправо.
   Строка выходит к краям карточки, справа и слева капсулы плавно гаснут. */
.products {
  --products-bleed: var(--space-gutter);
  display: flex;
  gap: 0.5rem;
  /* без этого строка капсул растянула бы карточку вместо прокрутки */
  min-width: 0;
  margin-inline: calc(var(--products-bleed) * -1);
  /* строка крутится по кругу (capsule-wheel.js): соседи видны с обеих сторон */
  padding: 0.25rem var(--products-bleed) 0.75rem;
  margin-bottom: -0.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 var(--products-bleed),
    #000 calc(100% - var(--products-bleed) * 1.5),
    transparent
  );
}

.products::-webkit-scrollbar {
  display: none;
}

/* Капсула раздела: у каждого товара свой цвет — он подсвечивает иконку
   и заливает капсулу, когда раздел выбран. */
.product {
  --product-color: #b46cff;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.875rem 0.5rem 0.6875rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
  color: var(--color-text-soft);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  /* барабан: капсула встаёт по центру, соседи тише и мельче — значения ставит capsule-wheel.js */
  scroll-snap-align: center;
  opacity: var(--wheel-opacity, 1);
  scale: var(--wheel-scale, 1);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background-color var(--duration-normal),
    box-shadow var(--duration-normal),
    transform var(--duration-normal) var(--ease-out-expo);
}

/* Все иконки — в одной сетке 24×24, плоский глиф, свой цвет у каждого товара */
.product__icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--product-color);
  filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--product-color) 45%, transparent));
}

.product--stars {
  --product-color: #ffb224;
}

.product--gram {
  --product-color: #4db8ff;
}

/* «Подарки» — цвета значка «Отправить подарок» в Telegram: от зелёного к голубому */
.product--gifts {
  --product-color: #4fb8e0;
}

.product--steam {
  --product-color: #dfe6ee;
}

/* GTA VI — цвета игры: закат Vice City, персик → неоново-розовый → фиолетовый.
   Выбранная капсула — с отливом этих цветов, розовой обводкой, свечением и надписью-переливом. */
.product--gta {
  --product-color: #ff4f9a;
  --gta-sunset: linear-gradient(100deg, #ffc06b 0%, #ff4f9a 52%, #9b5cff 100%);
}

.product.product--gta[aria-checked="true"] {
  background:
    linear-gradient(120deg, rgb(255 192 107 / 0.16), rgb(255 79 154 / 0.24) 55%, rgb(155 92 255 / 0.2)),
    var(--color-surface-2);
  box-shadow:
    inset 0 0 0 1.5px rgb(255 79 154 / 0.75),
    0 8px 18px -10px #ff4f9a,
    0 6px 22px -14px #9b5cff;
}

.product.product--gta[aria-checked="true"] > span {
  background: var(--gta-sunset);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.product:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.product:hover {
  color: var(--color-text);
}

.product:active {
  transform: scale(0.96);
}

.product[aria-checked="true"] {
  background: color-mix(in srgb, var(--product-color) 22%, var(--color-surface-2));
  color: var(--color-text);
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--product-color) 80%, transparent),
    0 8px 16px -10px var(--product-color);
}

/* Выбор раздела: иконка подпрыгивает с лёгким разворотом, а от неё расходится
   кольцо в цвете раздела. Анимация запускается заново при каждом выборе. */
.product {
  position: relative;
}

.product[aria-checked="true"] .product__icon {
  animation: product-pop 1100ms cubic-bezier(0.37, 0, 0.63, 1);
}

.product::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 1.3125rem; /* центр иконки: левый отступ капсулы + половина иконки */
  width: 1.25rem;
  height: 1.25rem;
  margin: -0.625rem 0 0 -0.625rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--product-color);
  opacity: 0;
  pointer-events: none;
}

.product[aria-checked="true"]::after {
  animation: product-ring 1200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Мягкое «дыхание»: иконка плавно увеличивается с лёгким наклоном и так же плавно возвращается */
@keyframes product-pop {
  0% {
    transform: none;
  }

  35% {
    transform: scale(1.24) rotate(-7deg);
  }

  65% {
    transform: scale(1.1) rotate(4deg);
  }

  100% {
    transform: none;
  }
}

@keyframes product-ring {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  25% {
    opacity: 0.45;
  }

  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .product[aria-checked="true"] .product__icon,
  .product[aria-checked="true"]::after {
    animation: none;
  }
}

/* ── Форма заказа ──────────────────────────────────── */
.order,
.order__fields {
  display: grid;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.3125rem;
}

/* Подписи «Оплата» на экране нет — она остаётся для экранных дикторов */
.pay legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field__control {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: 0.375rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
  transition: box-shadow var(--duration-fast);
}

.field__control:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
}

.field__control:has(.field--invalid) {
  box-shadow: inset 0 0 0 1.5px var(--color-red);
}

/* Колонка формы не шире экрана: без этого поле ввода своей «естественной» шириной
   распирало бы форму и страница ехала бы вбок. */
.checkout,
.order,
.order__fields,
.field {
  grid-template-columns: minmax(0, 1fr);
}

/* Большая строка ввода: получатель слева, количество и его значок справа */
.field--combo .field__control {
  min-height: 3.75rem;
  padding-inline: 0.5rem 1.125rem;
}

.field__cell {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.field__cell--amount {
  flex: none;
}

/* единственная ячейка (только количество или только получатель) занимает всю строку */
.field__cell--amount:only-child {
  flex: 1;
}

.field__cell.field--invalid .field__input {
  color: var(--color-red);
}

.field--combo .field__input {
  font-size: 1.0625rem;
}

.field--combo .field__input--amount {
  flex: none;
  width: 7.5ch;
  padding-inline: 0.25rem 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.field__cell--amount:only-child .field__input--amount {
  flex: 1;
  text-align: left;
  padding-left: 0.875rem;
}

.field--combo .field__input--amount::placeholder {
  font-size: 1.0625rem;
  font-weight: 500;
}

.field__unit {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
}

.field--combo .field__suffix {
  padding: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.field__prefix,
.field__suffix {
  padding-inline: 0.875rem 0;
  color: var(--color-text-muted);
  font-weight: 500;
}

.field__suffix {
  padding-inline: 0 0.875rem;
}

.field__input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.875rem;
  border: 0;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 1rem; /* не меньше 16px — iOS не увеличивает страницу при фокусе */
  outline: none;
}

.field__prefix + .field__input {
  padding-left: 0.125rem;
}

.field__input::placeholder {
  color: var(--color-text-muted);
}

select.field__input {
  appearance: none;
  cursor: pointer;
}

.field__hint {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.field--invalid .field__hint {
  color: var(--color-red);
}

/* Быстрый выбор: количество, срок, номинал, способ оплаты */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.choices > .field__control,
.choices > .field__hint {
  flex: 1 1 100%;
}

/* Кнопка быстрого выбора: иконка из мини-приложения и число в одну строку */
.choice.choice--preset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding-inline: 0.5rem;
}

.preset-icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

/* двойной класс — чтобы перебить display: grid у базовой .choice, объявленной ниже */
.choice.choice--region {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex: none;
  padding: 0.5rem 0.875rem 0.5rem 0.625rem;
  border-radius: var(--radius-pill);
  text-align: left;
  scroll-snap-align: start;
}

.choice.choice--region > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.14);
}

.code-card__region {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.choice {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.125rem;
  flex: 1 1 auto;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
  color: var(--color-text-soft);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    color var(--duration-fast),
    box-shadow var(--duration-fast);
}

.choice:hover {
  color: var(--color-text);
}

.choice[aria-checked="true"],
.choice[aria-pressed="true"] {
  background: rgb(0 122 255 / 0.16);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1.5px var(--color-accent);
}

.choice:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Подарки и регионы: один ряд, листается влево-вправо, как строка разделов. */
.choices--media,
.choices--region,
.choices--nominal,
.choices--edition {
  flex-wrap: nowrap;
  margin-inline: calc(var(--space-gutter) * -1);
  /* обводка выбранного — внутренняя тень, запас по вертикали не нужен */
  padding: 0 var(--space-gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--space-gutter);
  scrollbar-width: none;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 var(--space-gutter),
    #000 calc(100% - var(--space-gutter) * 1.5),
    transparent
  );
}

.choices--media::-webkit-scrollbar,
.choices--region::-webkit-scrollbar,
.choices--nominal::-webkit-scrollbar,
.choices--edition::-webkit-scrollbar {
  display: none;
}

/* Номиналы — как шаблоны количества у звёзд: равные капсулы, только номинал.
   На экране ровно четыре, остальные листаются вбок; длинный номинал растягивает свою капсулу. */
.choice--nominal {
  flex: none;
  min-width: calc((100% - 3 * 0.5rem) / 4);
  padding-inline: 0.25rem;
  /* кегль как у регионов, разделов и шаблонов звёзд — у всех капсул выбора один */
  font-size: 0.875rem;
  white-space: nowrap;
}

.choice--media {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1.625rem;
  line-height: 1;
  scroll-snap-align: start;
}

/* Логотип сервиса водяным знаком — на карте с кодом */
.brand-mark {
  position: absolute;
  right: -18%;
  bottom: -30%;
  width: 78%;
  color: rgb(255 255 255 / 0.13);
  pointer-events: none;
}

.pay {
  display: grid;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.pay__options {
  /* сколько способов оплаты — столько равных колонок на всю ширину: два не жмутся к краю */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.5rem;
}

.pay__options .choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  padding: 0.375rem 0.5rem;
}

.pay__icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.pay__price {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.order__error {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  background: rgb(255 69 58 / 0.12);
  color: #ff8a80;
  font-size: var(--text-sm);
}

.order__submit {
  width: 100%;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.order__submit:disabled {
  opacity: 0.5;
  cursor: progress;
  transform: none;
}

/* ── Статус заказа ─────────────────────────────────── */
.status {
  display: grid;
  justify-items: center;
  gap: 0.875rem;
  padding: 1.5rem 0 0.5rem;
  text-align: center;
}

.status__title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status__text {
  max-width: 28ch;
  color: var(--color-text-soft);
}

.status__spinner {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 3px solid var(--color-line-strong);
  border-top-color: var(--color-gold);
  animation: status-spin 0.9s linear infinite;
}

/* ── Карта с кодом гифт-карты ──────────────────────── */
.status:has(.code-card) {
  justify-items: stretch;
  padding-top: 0;
}

.code-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0.5rem;
  padding: clamp(1.125rem, 0.8rem + 1.6vw, 1.5rem);
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 95% at 100% 0%, color-mix(in srgb, var(--brand-to) 60%, transparent), transparent 62%),
    linear-gradient(165deg, #16171d 20%, color-mix(in srgb, var(--brand-from) 45%, #0e0f14));
  box-shadow: inset 0 0 0 1px var(--color-line);
  text-align: left;
}

.code-card .brand-mark {
  right: -8%;
  bottom: -22%;
  width: 62%;
  color: rgb(255 255 255 / 0.07);
}

.code-card > :not(.brand-mark) {
  position: relative;
}

.code-card__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.625rem;
}

/* логотип и название — одна связка, название по центру логотипа */
.code-card__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.code-card__logo {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--logo-color, #fff);
  filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.35));
}

.code-card__name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.code-card__value {
  display: grid;
  justify-items: end;
  gap: 0.125rem;
  color: var(--color-text-soft);
  font-size: var(--text-sm);
  font-weight: 600;
}

.code-card__value strong {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.code-card__label {
  margin-top: clamp(1.75rem, 1rem + 4vw, 3rem);
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.code-card__code {
  justify-self: start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.125rem, 0.8rem + 1.8vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: copy;
  user-select: all;
}

.code-card__hint {
  justify-self: end;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.status .code-card__copy {
  background: linear-gradient(90deg, var(--brand-to), color-mix(in srgb, var(--brand-to) 65%, #fff));
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
  /* мягкое свечение снизу — заметно, но не кричит */
  box-shadow: 0 8px 22px -14px var(--brand-to);
}

.status__check {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--color-gold-soft), var(--color-gold));
  color: #1d1300;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 12px 32px -8px rgb(255 178 36 / 0.6);
  animation: status-pop var(--duration-slow) var(--ease-out-expo);
}

@keyframes status-pop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes status-spin {
  to {
    transform: rotate(1turn);
  }
}

.status__code {
  width: 100%;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.0625rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  user-select: all;
}

.status .btn {
  width: 100%;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-footer {
  justify-content: center;
  border-top: 0;
  padding-top: 0.5rem;
}

/* Вне Telegram магазина нет: пока main.js не показал «Откройте в Telegram», форма не видна (tg-boot.js) */
.is-outside-telegram .store__title,
.is-outside-telegram [data-products],
.is-outside-telegram [data-order] {
  visibility: hidden;
}

/* ── Внутри Telegram ───────────────────────────────────
   Форма стоит на месте и при открытой клавиатуре: шапка не прячется, ничего не сдвигается.
   Чтобы кнопка оплаты при этом оставалась над клавиатурой, отступы здесь плотнее. */
.is-telegram .store {
  /* отступ под вырез экрана и кнопки Telegram — внутри прокручиваемой середины, чтобы значки
     шапки долетали до верхнего края экрана, а не обрезались по её границе */
  padding-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  /* нижний отступ меньше, чем на сайте: лишняя высота заставила бы середину прокручиваться */
  padding-bottom: 0.5rem;
  gap: 0.75rem;
  /* середина экрана: занимает всё место над подвалом и прокручивается сама, только если
     содержимое не помещается (маленький экран, длинный экран статуса) */
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.is-telegram .store::-webkit-scrollbar {
  display: none;
}

.is-telegram .site-footer {
  flex: none;
  width: 100%;
  /* отступ под «домашнюю» полоску iPhone уже даёт body (--tg-safe-area-inset-bottom): свой подвал
     не добавляет, иначе на телефонах поменьше ради него прокручивалась бы середина */
  padding-block: 0.75rem 1rem;
}

.is-telegram .hero {
  height: 6.25rem;
}

.is-telegram .checkout,
.is-telegram .order,
.is-telegram .order__fields {
  gap: 0.625rem;
}

/* Заглушки невидимы: они только держат место под ряд, чтобы кнопки ниже не прыгали,
   пока варианты грузятся или ждут выбора выше (номиналы — пока не выбрана страна). */
.choice--skeleton {
  visibility: hidden;
  pointer-events: none;
}

/* у регионов ширина по тексту — заглушке задаём её явно */
.choice--region.choice--skeleton {
  min-width: 5.5rem;
}

/* сообщение вместо вариантов («нет в наличии», ошибка) занимает ту же высоту, что и ряд */
.choices > .field__hint {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
}

/* Выбранный подарок в правой части строки ввода */
/* размер — как у подарка в ячейке ряда ниже, чтобы выбранный просто «переехал» в строку */
.gift-preview {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  margin-right: 0.125rem;
}

.gift-preview:empty {
  display: none;
}

.gift-preview__stage,
.gift-preview__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gift-preview__emoji {
  font-size: 1.375rem;
  line-height: 1;
}

/* ── Ровное переключение разделов ───────────────────────
   У каждого раздела форма одной высоты: строка ввода (или первый ряд) и один ряд вариантов
   под ней, все ряды по 2.75rem. Поэтому при переключении способы оплаты и кнопка «Оплатить»
   не сдвигаются ни на пиксель. У гифт-карт два ряда вариантов (страны и номиналы) — они
   помещаются в ту же высоту. */
.order__fields,
.is-telegram .order__fields {
  --row: 2.75rem;
  --input-row: 3.75rem;
  --rows-gap: 0.3125rem;
  gap: var(--rows-gap);
  min-height: calc(var(--input-row) + var(--rows-gap) + var(--row));
  align-content: start;
}

.choice--media {
  width: var(--row, 2.75rem);
  height: var(--row, 2.75rem);
  font-size: 1.375rem;
}

.choices > .choice {
  height: var(--row, 2.75rem);
  min-height: 0;
}

/* У гифт-карт страны стоят на месте строки ввода и той же высоты, номиналы — на месте шаблонов.
   При переходе со Steam на PlayStation и обратно ряды совпадают по высоте и положению. */
/* текст — как у капсул сервисов (PlayStation, App Store): высокая только сама капсула */
.choices--region > .choice {
  height: var(--input-row, 3.75rem);
  padding-inline: 0.75rem 1.125rem;
  gap: 0.5rem;
  font-size: var(--text-sm);
}

.choices--region .flag {
  width: 1.375rem;
  height: 1.375rem;
}

.choices--region > .choice--skeleton {
  min-width: 7.5rem;
}

/* ── Итог заказа: прорисовка галочки, искры, отказ ─────────── */
.status__mark {
  --mark-color: var(--color-gold);
  position: relative;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
}

.status__mark--fail {
  --mark-color: var(--color-red);
  animation: mark-shake 520ms 380ms ease-in-out both;
}

.status__mark-icon {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 22px color-mix(in srgb, var(--mark-color) 45%, transparent));
}

.status__mark-ring {
  fill: color-mix(in srgb, var(--mark-color) 14%, transparent);
  stroke: var(--mark-color);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: mark-draw 700ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.status__mark-check {
  fill: none;
  stroke: var(--mark-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: mark-draw 420ms 560ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.status__mark--done .status__mark-icon,
.status__mark--gift .status__gift {
  animation: mark-pop 900ms 520ms var(--ease-out-expo) both;
}

.status__gift {
  display: grid;
  width: 6.5rem;
  height: 6.5rem;
}

.status__gift .gift-preview__stage,
.status__gift .gift-preview__image {
  width: 100%;
  height: 100%;
}

.status__gift .gift-preview__emoji {
  font-size: 4rem;
}

/* искры разлетаются от значка, когда галочка дорисована */
.status__sparks {
  position: absolute;
  inset: 50% auto auto 50%;
  pointer-events: none;
}

.status__sparks i {
  position: absolute;
  width: 0.4375rem;
  height: 0.4375rem;
  margin: -0.21875rem;
  border-radius: 50%;
  background: var(--mark-color);
  opacity: 0;
  transform: rotate(var(--angle)) translateY(0);
  animation: mark-spark 900ms 760ms ease-out forwards;
}

.status__sparks i:nth-child(even) {
  width: 0.3125rem;
  height: 0.3125rem;
  background: #fff;
  animation-delay: 840ms;
}

@keyframes mark-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes mark-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes mark-spark {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translateY(-2.5rem) scale(1);
  }

  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(-4.75rem) scale(0.3);
  }
}

@keyframes mark-shake {
  20%,
  60% {
    transform: translateX(-0.375rem);
  }

  40%,
  80% {
    transform: translateX(0.375rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status__mark-ring,
  .status__mark-check {
    stroke-dashoffset: 0;
    animation: none;
  }

  .status__mark--fail,
  .status__sparks {
    display: grid;
    animation: none;
  }

  .status__sparks {
    display: none;
  }
}

/* ── Тестовый режим: баланс и окно тестовой оплаты ─────────── */
.test-balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 auto;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.test-balance strong {
  color: var(--color-text-soft);
  font-variant-numeric: tabular-nums;
}

.test-balance__reset {
  margin-left: 0.25rem;
  opacity: 0.6;
}

.test-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
}

.test-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.55);
  animation: sheet-fade 240ms ease-out;
}

.test-sheet__panel {
  position: relative;
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  padding: 1.25rem var(--space-gutter) calc(1rem + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  border-radius: 1.75rem 1.75rem 0 0;
  background: var(--color-surface);
  box-shadow: inset 0 1px 0 var(--color-line), 0 -20px 60px rgb(0 0 0 / 0.6);
  text-align: center;
  animation: sheet-up 360ms var(--ease-out-expo);
}

.test-sheet--closing .test-sheet__panel {
  animation: sheet-down 220ms ease-in forwards;
}

.test-sheet--closing .test-sheet__backdrop {
  animation: sheet-fade 220ms ease-in reverse forwards;
}

.test-sheet__badge {
  justify-self: center;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-pill);
  background: rgb(255 178 36 / 0.14);
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.test-sheet__title {
  color: var(--color-text-soft);
  font-size: var(--text-sm);
}

.test-sheet__price {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.test-sheet__balance {
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.test-sheet__balance--short {
  color: var(--color-red);
}

.test-sheet__option {
  display: grid;
  gap: 0.0625rem;
  width: 100%;
  min-height: 3.25rem;
  padding-block: 0.5rem;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.test-sheet__option small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.65;
}

.test-sheet__option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.test-sheet__cancel {
  padding: 0.625rem;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes sheet-down {
  to {
    transform: translateY(100%);
  }
}

@keyframes sheet-fade {
  from {
    opacity: 0;
  }
}

/* ── Ошибки без сдвига формы ───────────────────────────────
   Подсказка под полем видна только экранным дикторам, на экране — красная рамка поля;
   вздрагивание при каждом нажатии «Оплатить» запускает скрипт (shake в main.js). Ошибки сервера — текстом на кнопке оплаты. */
.field > .field__hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.field__control:has(.field--invalid) {
  background: color-mix(in srgb, var(--color-red) 8%, var(--color-surface-2));
}

.order__submit.order__submit--error {
  background: color-mix(in srgb, var(--color-red) 22%, var(--color-surface-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-red) 70%, transparent);
  color: #ffb3ad;
  font-size: 0.9375rem;
}

/* ряд вариантов, который забыли выбрать, обводится красным */
.field--invalid > .choices > .choice:not(.choice--skeleton) {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--color-red) 60%, transparent);
}

/* Лёгкое появление вариантов при смене раздела: капсулы чуть всплывают и проявляются
   волной слева направо. Волна короткая — дальние капсулы не ждут дольше ~0.3 с. */
/* весь ряд проявляется разом и без сдвига: ряды листаются вбок, и сдвиг по вертикали
   обрезался краем ряда («срезались» страны), а волна выглядела как наезд капсул друг на друга */
.choice--appear {
  animation: choice-appear 280ms ease-out both;
}

@keyframes choice-appear {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .choice--appear {
    animation: none;
  }
}

/* надпись на кнопке — отдельный блок, чтобы новая сумма могла всплыть снизу (transform у строчного текста не работает) */
[data-submit-label] {
  display: inline-block;
}

/* ── Сумма на кнопке оплаты — счётчик ────────────────────────
   Каждая цифра — колонка 0–9 в окошке высотой в одну строку; колонка сдвигается к нужной цифре.
   Разряды трогаются чуть вразнобой справа налево, как у механического счётчика. */
[data-submit-label] {
  --odo-line: 1.25em;
  display: inline-flex;
  align-items: center;
  /* слово и окошки цифр — одной высоты строки, чтобы цифры не сидели выше слова */
  line-height: var(--odo-line);
  gap: 0.3em;
  white-space: nowrap;
}

.pay-amount {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
}

.pay-amount[hidden] {
  display: none;
}

.odo-digit {
  display: inline-block;
  height: var(--odo-line);
  overflow: hidden;
  line-height: var(--odo-line);
}

.odo-strip {
  display: block;
  transform: translateY(calc(var(--digit, 0) * var(--odo-line) * -1));
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--order, 0) * 35ms);
}

.odo-char {
  white-space: pre;
}

@media (prefers-reduced-motion: reduce) {
  .odo-strip {
    transition: none;
  }
}

/* сумма, пока количество набирают вручную и новой цены ещё нет */
.pay-amount--stale {
  opacity: 0.45;
  transition: opacity 200ms;
}

.pay-amount {
  transition: opacity 200ms;
}

/* ── Розыгрыш NFT ──────────────────────────────────────────
   Карточка под кнопкой оплаты: приз, таймер, билеты. Нажатие открывает окно с подробностями. */
.raffle-card {
  --raffle: #b46cff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.875rem 0.5rem 0.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background:
    radial-gradient(120% 160% at 0% 50%, color-mix(in srgb, var(--raffle) 22%, transparent), transparent 60%),
    var(--color-surface-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--raffle) 35%, transparent);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.raffle-card:active {
  transform: scale(0.98);
}

.raffle-card--in {
  --raffle: var(--color-gold);
}

.raffle-card__prize {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--raffle) 60%, transparent);
}

.raffle-card__text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.0625rem;
  font-size: var(--text-sm);
}

.raffle-card__meta {
  display: flex;
  gap: 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.raffle-card__arrow {
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
}

/* окно розыгрыша — на основе окна тестовой оплаты */
.raffle-sheet__panel {
  --raffle: var(--color-gold);
  gap: 0.625rem;
}

.raffle-sheet__badge {
  background: rgb(180 108 255 / 0.16);
  color: #c9a3ff;
}

.raffle-sheet__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 10rem;
}

.raffle-sheet__glow {
  position: absolute;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(180 108 255 / 0.45), transparent);
  animation: raffle-glow 2.6s ease-in-out infinite;
}

/* NFT как карточка подарка в Telegram: квадрат со скруглением, фон и узор — из самой анимации */
.raffle-sheet__prize {
  position: relative;
  display: grid;
  width: 9rem;
  height: 9rem;
  overflow: hidden;
  border-radius: 1.75rem;
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.7), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.raffle-sheet__image,
.raffle-sheet__lottie {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.raffle-sheet__lottie {
  opacity: 0;
  transition: opacity 300ms;
}

.raffle-sheet__prize--playing .raffle-sheet__lottie {
  opacity: 1;
}

.raffle-sheet__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.raffle-sheet__number {
  color: var(--color-text-muted);
}

.raffle-sheet__when {
  color: var(--color-text-soft);
  font-size: var(--text-sm);
}

.raffle-sheet__clock {
  color: var(--color-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.raffle-sheet__tickets {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  border-radius: 1.25rem;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
  text-align: left;
}

.raffle-sheet__ticket-icon {
  font-size: 1.75rem;
}

.raffle-sheet__ticket-text {
  display: grid;
  flex: 1;
  gap: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.raffle-sheet__ticket-text strong {
  color: var(--color-text);
  font-size: 0.9375rem;
}

.raffle-sheet__progress {
  height: 0.3125rem;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 0.08);
}

.raffle-sheet__progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffcf70, #ff9a00);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 600ms var(--ease-out-expo);
}

.raffle-sheet__rules {
  display: grid;
  gap: 0.25rem;
  margin: 0.25rem 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  list-style: none;
}

.raffle-sheet__rules li::before {
  content: "· ";
}

.status__raffle {
  /* всегда одна строка — экран не растёт и не прыгает */
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-pill);
  background: rgb(255 178 36 / 0.12);
  color: var(--color-gold);
  /* второстепенная строка — чуть мельче, чтобы и на узких телефонах шла целиком */
  font-size: 0.8125rem;
  font-weight: 600;
  animation: choice-appear 500ms 900ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes raffle-glow {
  50% {
    opacity: 0.55;
    transform: scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  .raffle-sheet__glow,
  .status__raffle {
    animation: none;
  }
}

/* ── Иконки в шаблонах и оплате — одного видимого размера ─────────
   У файлов разные поля вокруг рисунка: стопки звёзд и Gram занимают ~60% кадра,
   коробки Premium ~85%, знаки СБП и USDT — весь кадр. Поэтому размер рамки у каждого свой,
   а сам рисунок везде выходит ~18px в высоту. */
.choices,
.pay__options {
  --icon-visible: 1.125rem;
}

/* стопки звёзд и Gram (рисунок ~0.65 кадра по высоте) */
.choice--preset .preset-icon {
  width: calc(var(--icon-visible) / 0.65);
  height: calc(var(--icon-visible) / 0.65);
}

/* коробки Premium (~0.83 кадра) */
.preset-icon[src*="premium/"] {
  width: calc(var(--icon-visible) / 0.83);
  height: calc(var(--icon-visible) / 0.83);
}

/* знаки СБП и USDT заполняют кадр целиком */
.pay__options .pay__icon {
  width: var(--icon-visible);
  height: var(--icon-visible);
}

/* кристалл Gram у оплаты TON (~0.8 кадра) */
.pay__options .pay__icon[src*="gram-1"] {
  width: calc(var(--icon-visible) / 0.8);
  height: calc(var(--icon-visible) / 0.8);
}

/* подарки — эмодзи того же видимого размера */
.choices > .choice--media {
  font-size: var(--icon-visible);
}

/* упрощённое окно розыгрыша: билеты — одной строкой */
p.raffle-sheet__tickets {
  justify-self: center;
  margin: 0.25rem 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  color: var(--color-text-soft);
  font-size: var(--text-sm);
  font-weight: 600;
}

p.raffle-sheet__tickets--in {
  background: rgb(255 178 36 / 0.12);
  color: var(--color-gold);
}

/* строки барабана, слово и знаки — одной фиксированной высоты, чтобы всё стояло на одной линии */
.odo-strip > span,
.pay-word,
.odo-char {
  display: block;
  height: var(--odo-line);
  line-height: var(--odo-line);
}

.odo-char {
  white-space: pre;
}

/* прежние варианты, пока грузятся новые: видны, но неактивны */
/* бледнеет, только если варианты грузятся дольше 0,7 с — обычное переключение не мигает;
   обратно — сразу (у .choice переход по opacity не задан) */
.choices--stale > .choice {
  opacity: 0.35;
  transition: opacity 200ms 700ms;
}

/* картинка тарифа видна, пока грузится анимация, затем анимация встаёт на её место */
.gift-preview {
  position: relative;
}

.gift-preview__stage--over {
  position: absolute;
  inset: 0;
}

/* ── Выбранный вариант — тихо, в цвет раздела ──────────────
   Только тонкая обводка цвета выбранного раздела (Xbox — зелёным, звёзды — золотым),
   без заливки: видно, что выбрано, но внимание не забирает. */
.choice[aria-checked="true"],
.choice[aria-pressed="true"] {
  /* только обводка: кнопка не перекрашивается */
  background: var(--color-surface-2);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--section-ring, rgb(255 255 255 / 0.45));
}

/* Экраны компьютеров (1 пиксель экрана на точку): капсула часто стоит на полпикселя,
   и линия в 1px расплывается в два бледных пикселя — обводка местами пропадает.
   Там она чуть толще и ярче; на телефонах (2–3 пикселя на точку) остаётся тонкой. */
@media (max-resolution: 1.99dppx) {
  .choice[aria-checked="true"],
  .choice[aria-pressed="true"] {
    box-shadow: inset 0 0 0 1.5px var(--section-ring-strong, rgb(255 255 255 / 0.6));
  }
}

/* способы оплаты — одни значки, чуть крупнее, раз подписей нет */
.pay__options {
  --icon-visible: 1.25rem;
}

/* «@» и ник — одним шрифтом и по одной базовой линии: раньше «@» был другого размера
   и выравнивался по центру рамки, а не по строке текста, поэтому ник казался выше */
.field__cell {
  align-items: baseline;
}

.field--combo .field__prefix {
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.5;
}

.field__cell--amount {
  align-self: center;
}

/* значок у количества (звезда, кристалл) — по центру строки, а не на базовой линии текста */
.field__cell .field__unit {
  align-self: center;
}

/* фирменная звезда и кристалл Gram внутри строки текста */
.inline-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin: 0 0.1em;
  vertical-align: -0.2em;
  object-fit: contain;
}

/* код, пока его выпускают: символы перебираются, чуть приглушённо и с лёгким мерцанием */
.code-card__code--waiting {
  color: rgb(255 255 255 / 0.55);
  cursor: default;
  user-select: none;
  animation: code-wait 1.6s ease-in-out infinite;
}

/* карта с готовым кодом слегка «вспыхивает», когда код встал на место */
.code-card--ready {
  animation: code-ready 700ms var(--ease-out-expo);
}

@keyframes code-wait {
  50% {
    opacity: 0.6;
  }
}

@keyframes code-ready {
  0% {
    transform: scale(0.98);
    box-shadow: inset 0 0 0 1px var(--color-line), 0 0 0 0 color-mix(in srgb, var(--brand-to) 60%, transparent);
  }

  60% {
    box-shadow: inset 0 0 0 1px var(--color-line), 0 0 0 10px transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .code-card__code--waiting,
  .code-card--ready {
    animation: none;
  }
}

/* заголовок и пояснение над картой гифт-карты — по центру, как на остальных экранах заказа */
.status:has(.code-card) > .status__title,
.status:has(.code-card) > .status__text {
  justify-self: center;
}

.status:has(.code-card) > .status__text {
  max-width: none;
  white-space: nowrap;
}

/* успех — зелёным, как привычная галочка «готово»; золото остаётся цветом бренда и кнопки оплаты */
.status__mark--done {
  --mark-color: #30d158;
}

/* Круг загрузки и значок итога — одного размера: при смене «Оплата получена» → «Готово»
   галочка встаёт ровно на место круга, без скачка размера. */
.status {
  --status-icon: 4.5rem;
}

.status__spinner {
  width: var(--status-icon);
  height: var(--status-icon);
}

.status__mark {
  width: var(--status-icon);
  height: var(--status-icon);
}

/* Пояснения на экранах заказа — в одну строку: при смене «Оплата получена» → «Готово»
   высота текста не меняется, и экран не дёргается */
.status__text {
  max-width: none;
  white-space: nowrap;
}

/* подарок на экране успеха — ровно в размер значка итога (как круг загрузки до него),
   чтобы не залезать на заголовок «Подарок отправлен» и не сдвигать экран */
.status__mark--gift .status__gift {
  width: 100%;
  height: 100%;
}

.status__mark--gift .gift-preview__emoji {
  font-size: 3rem;
}

/* Серая строка под кнопкой оплаты: что собрал покупатель гифт-карты
   («🇹🇷 PlayStation · Турция · 1 500 TL»). У других разделов пустая, но высоту держит. */
.order__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 1.25rem;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order__note .flag {
  width: 1rem;
  height: 1rem;
}

/* длинная надпись на узком телефоне: кегль чуть меньше, но строка одна */
.order__submit.order__submit--tight {
  font-size: 0.875rem;
}

/* GTA VI: издание — логотип платформы и «Standard» / «Ultimate». Капсула по ширине текста
   с обычными отступами; не влезают все — ряд листается вбок, как страны. */
.choice.choice--edition {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding-inline: 0.875rem 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.choice--edition.choice--skeleton {
  min-width: 7rem;
}

.choice__logo {
  flex: none;
  width: 1rem;
  height: 1rem;
  color: var(--color-text);
}

/* Ultimate — старшее издание: надпись золотым переливом, как у премиальных вещей */
.choice--accent > span {
  background: linear-gradient(100deg, #ffe08a 0%, #ffb224 45%, #ff8a3d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Строка о розыгрыше после покупки — нажимается и показывает приз в окне подарка Telegram */
.status__raffle--link {
  border: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.status__raffle--link:hover,
.status__raffle--link:focus-visible {
  background: rgb(255 178 36 / 0.2);
}


/* ── Кнопки после покупки ──────────────────────────────────────
   Не серые, а с лёгким оттенком цвета сервиса или раздела (--status-accent задаёт скрипт):
   у PlayStation — синие, у звёзд — тёплые. Появляются по очереди, мягко всплывая. */
.status {
  --status-accent: #ffb224;
}

/* оттенки считает скрипт (готовые цвета): смешивание цветов внутри box-shadow
   понимают не все браузеры — некоторые рисуют вместо него белую обводку */
.status .btn--ghost {
  background: var(--status-button, var(--color-line));
  box-shadow: inset 0 0 0 1px var(--status-ring, var(--color-line));
  color: var(--color-text);
}

.status .btn--ghost:hover,
.status .btn--ghost:focus-visible {
  background: var(--status-button-hover, var(--color-line-strong));
}

.status__rise {
  animation: status-rise 560ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(260ms + var(--rise-index, 0) * 90ms);
}

@keyframes status-rise {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
  }
}


@media (prefers-reduced-motion: reduce) {
  .status__rise {
    animation: none;
  }
}

/* ссылка в строке под кнопкой (канал для подписчиков) — как текст строки, с откликом */
.order__note-link {
  color: var(--color-text-soft);
  text-decoration: none;
}

.order__note-link:hover,
.order__note-link:focus-visible {
  color: var(--color-text);
}

/* ── Экран после покупки — легче ─────────────────────────────────
   Одно главное действие широкой кнопкой; «Подарить карту» — в цвете сервиса, у карты;
   «Пригласить друга» — золотая, под строкой розыгрыша; «Новая покупка» — тихая ссылка. */
.status__link {
  padding: 0.5rem 1rem;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.status__link:hover,
.status__link:focus-visible {
  color: var(--color-text);
}

.status .status__raffle {
  background: none;
  padding-block: 0.25rem;
}

.status .status__raffle--link:hover,
.status .status__raffle--link:focus-visible {
  background: none;
  color: #ffd06b;
}

/* Готовая карта целиком копирует код: курсор-рука, лёгкий отклик на нажатие,
   подсказка заметнее, после копирования — зелёная «✓ Код скопирован». */
.code-card--ready[role="button"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.code-card--ready[role="button"]:focus-visible {
  outline: 2px solid var(--brand-to);
  outline-offset: 3px;
}

.code-card--ready .code-card__hint {
  color: var(--color-text-soft);
  font-weight: 500;
  transition: color var(--duration-fast);
}

.code-card--ready .code-card__hint.code-card__hint--done {
  color: #4ade80;
}

/* ── Карточка розыгрыша после покупки ──────────────────────────────
   Два яруса в одной спокойной карточке. Верхний: подарок, статус, отсчёт. Нижний, за тонкой
   линией: «Пригласить друга · +1 🎟». Золото — только билеты и приглашение. Готовые цвета:
   color-mix в обводке старые браузеры рисуют белым. */
.draw-card {
  display: grid;
  width: 100%;
  overflow: hidden;
  border-radius: 1.125rem;
  background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line);
  text-align: left;
}

.draw-card__main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.draw-card__prize-button {
  flex: none;
  display: grid;
  padding: 0.5rem 0 0.5rem 0.5rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.draw-card__image {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  object-fit: cover;
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.draw-card__prize-button:active .draw-card__image {
  transform: scale(0.94);
}

.draw-card__info {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem 0.625rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.draw-card__text {
  flex: 1 1 auto;
  display: grid;
  gap: 0.125rem;
  min-width: 0;
}

.draw-card__title,
.draw-card__line {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.draw-card__line {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

/* «Вы участвуете» — зелёным, как галочка «готово» */
.draw-card__title.draw-card__title--in {
  color: #30d158;
}

.draw-card__title {
  line-height: 1.25;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.draw-card__clock {
  flex: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* маленький «?» — правила розыгрыша */
.draw-card__help {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-line);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  transition: color var(--duration-fast), box-shadow var(--duration-fast);
}

.draw-card__info:hover .draw-card__help,
.draw-card__info:focus-visible .draw-card__help {
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-text-muted);
}

.draw-card__invite {
  padding: 0.625rem 1rem;
  border: 0;
  border-top: 1px solid var(--color-line);
  background: none;
  color: #ffc24d;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--duration-fast);
}

.draw-card__invite:hover,
.draw-card__invite:focus-visible {
  background: #1d1709;
}

/* ── Окно «Как участвовать»: заголовок, три коротких абзаца, кнопка ── */
.draw-rules__panel {
  gap: 0.625rem;
  padding-top: 1.5rem;
  text-align: left;
}

.draw-rules__title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.draw-rules__steps {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding-left: 1.25rem;
  list-style: decimal;
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.draw-rules__steps li::marker {
  color: var(--color-text-muted);
}

.draw-rules__text {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.draw-rules__link {
  color: #ffc24d;
  font-weight: 600;
  text-decoration: none;
}

.draw-rules__link:hover,
.draw-rules__link:focus-visible {
  text-decoration: underline;
}

.draw-rules__ok {
  margin-top: 0.75rem;
}

/* тихие ссылки в одну строку: «🎁 Подарить карту · Новая покупка» */
.status__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
}

/* номер заказа — тихой строкой в самом низу: его называют поддержке */
.status__order {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
  user-select: text;
}


/* узкие телефоны: строка под заголовком («Скопируйте и активируйте в App Store») остаётся
   одной, но не шире экрана — иначе растягивает карточку и кнопки вправо */
@media (max-width: 360px) {
  .status__text {
    font-size: 0.875rem;
  }
}

/* ── Барабан разделов (capsule-wheel.js) ─────────────────────────────
   Строка — точка отсчёта для расчёта центра; соседи могут расступаться (--wheel-shift). */
.products {
  position: relative;
}

.products .product {
  translate: var(--wheel-shift, 0px) 0;
}

/* Вариант ?wheel=icons: по краям только иконки, по центру — линза с иконкой и названием */
.products--icons {
  /* браузерная доводка учитывала бы сдвиг соседей — до центра доводит capsule-wheel.js */
  scroll-snap-type: none;
}

.products--icons .product {
  gap: 0;
  padding-inline: 0.625rem;
}

.products--icons .product > span {
  display: none;
}

.checkout {
  position: relative;
}

.product.wheel-lens {
  position: absolute;
  top: var(--lens-top, 0.25rem);
  left: 50%;
  z-index: 2;
  opacity: 1;
  scale: 1;
  translate: -50% 0;
  pointer-events: none;
}

.products[hidden] + .wheel-lens {
  display: none;
}

/* недоступный раздел — не точка остановки барабана: строка проезжает его до соседнего */
.products .product:disabled {
  scroll-snap-align: none;
}

/* ── Эксперимент «Орбита» (?orbit=1, scripts/orbit.js). Без параметра ничего из этого не действует. ── */
.orbit-mode .store__title,
.orbit-mode .products,
.orbit-mode .wheel-lens {
  display: none !important;
}

.orbit-open,
.orbit-open body {
  overflow: hidden;
}

.orbit {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding:
    calc(1.25rem + var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px))
    var(--space-gutter)
    calc(1.5rem + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.orbit[hidden] {
  display: none;
}

.orbit__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 50% 52%, rgb(123 97 255 / 0.16), transparent 70%),
    radial-gradient(40% 30% at 20% 80%, rgb(255 71 126 / 0.1), transparent 70%),
    radial-gradient(45% 30% at 85% 18%, rgb(0 152 234 / 0.12), transparent 70%),
    var(--color-bg);
}

.orbit__sky {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sky-size, 100vmax);
  height: var(--sky-size, 100vmax);
  translate: -50% -50%;
  animation: orbit-sky 240s linear infinite;
}

@keyframes orbit-sky {
  to {
    rotate: 360deg;
  }
}

.orbit__title {
  margin-top: clamp(0.5rem, 3vh, 2rem);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  text-align: center;
}

.orbit__hint {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

.orbit__stage {
  position: relative;
  width: 100%;
  max-width: 30rem;
  height: 100%;
  min-height: 18rem;
  cursor: grab;
}

.orbit__ring {
  position: absolute;
  top: calc(50% - var(--ry, 50px));
  left: calc(50% - var(--rx, 100px));
  width: calc(var(--rx, 100px) * 2);
  height: calc(var(--ry, 50px) * 2);
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow:
    0 0 30px -6px rgb(123 97 255 / 0.35),
    inset 0 0 30px -10px rgb(255 178 36 / 0.25);
  rotate: var(--turn, 0deg);
  pointer-events: none;
}

.orbit__core {
  position: absolute;
  top: calc(50% - var(--core-size, 104px) / 2);
  left: calc(50% - var(--core-size, 104px) / 2);
  z-index: 2;
  width: var(--core-size, 104px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #0c0c0e;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.12),
    0 0 50px -2px rgb(255 178 36 / 0.55),
    0 0 120px 10px rgb(123 97 255 / 0.25);
  pointer-events: none;
}

.orbit__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orbit__planet {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--planet-color, var(--color-gold));
  cursor: pointer;
  will-change: transform, opacity;
}

.orbit__body {
  display: grid;
  place-items: center;
  width: clamp(3rem, 2.4rem + 3vw, 3.75rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #232327, #0a0a0c 70%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.1),
    0 0 22px -6px var(--planet-color, var(--color-gold)),
    0 8px 20px -8px rgb(0 0 0 / 0.8);
  transition: box-shadow var(--duration-normal);
}

.orbit__planet:focus-visible .orbit__body,
.orbit__planet:hover .orbit__body {
  box-shadow:
    0 0 0 2px var(--planet-color, var(--color-gold)),
    0 0 30px -2px var(--planet-color, var(--color-gold));
}

.orbit__planet:focus-visible {
  outline: none;
}

.orbit__icon {
  width: 55%;
  height: 55%;
}

.orbit__label {
  color: var(--color-text-soft);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--duration-normal);
}

.orbit__planet--back .orbit__label {
  opacity: 0;
}

.orbit__shock {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: var(--core-size, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--pick-color, var(--color-gold));
  box-shadow: 0 0 40px var(--pick-color, var(--color-gold));
  pointer-events: none;
}

/* Капсула выбранного сервиса над формой — назад на орбиту */
.orbit-back {
  display: none;
}

.orbit-mode .orbit-back:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1rem;
  box-shadow: 0 0 26px -10px var(--planet-color, var(--color-gold));
  cursor: pointer;
}

.orbit-back__body {
  display: grid;
  place-items: center;
  width: 2.25rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1a1a1d;
  color: var(--planet-color, var(--color-gold));
}

.orbit-back__body .orbit__icon {
  width: 62%;
  height: 62%;
}

.orbit-back__swap {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

.checkout:has(.status:not([hidden])) .orbit-back {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .orbit__sky {
    animation: none;
  }
}

/* Строка разделов появляется, когда колесо собрано и выбранный раздел стоит по центру: до этого
   статичная вёрстка стоит со сдвигом, и при открытии было бы видно, как строка едет на место.
   Прячет её класс products-pending на <html>: его ставит tg-boot.js и снимает main.js
   (revealProducts). tg-boot.js сам снимает класс по таймеру — если main.js не загрузился или
   пришёл из старого кэша, строка не останется невидимой. Без класса строка видна всегда. */
.products {
  transition: opacity 180ms ease-out;
}

.products-pending .products {
  opacity: 0;
}
