/* ===== Astra — палитра split.tg ===== */
:root {
  --bg: #131726;          /* фон страницы split.tg */
  --surface: #23283a;     /* блоки bg-block-bg */
  --surface-2: #2a3046;
  --field: #131726;       /* поля bg-input-bg */
  --line: rgba(52, 59, 84, 0.6);   /* border-input-border */
  --line-2: #343b54;
  --blue: #0098EA;        /* их primary */
  --blue-2: #007DBB;
  --link: #07a7fe;
  --hint: #7a93ae;        /* их вторичный текст */
  --grad: linear-gradient(180deg, #ffffff 0%, #e6eef6 50%, #a9bfd3 100%);
  --grad-soft: linear-gradient(180deg, #a3b4c4 0%, #6c8193 100%);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg); /* однотонный фон как у split.tg */
  color: #f5f5f5;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 10px; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Градиентный текст */
.t-grad, .t-soft {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.t-grad { background-image: var(--grad); }
.t-soft { background-image: var(--grad-soft); transition: filter 0.25s; }
a.t-soft:hover { filter: brightness(1.45); }

/* Чёрно-серебряный переливающийся градиент — как у «Collectable» в Grand Piece Online.
   Волна «белый ↔ тёмно-серый» бежит по тексту бесконечно. */
.t-collectable {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-image: linear-gradient(to right, #ffffff, #2c2c2c, #ffffff, #2c2c2c, #ffffff);
  background-size: 200% auto;
  animation: collectable-shimmer 6s linear infinite;
}
@keyframes collectable-shimmer {
  to { background-position: 100% center; }
}

.ico { width: 18px; height: 18px; flex: none; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: rgba(19, 23, 38, 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.header.is-scrolled { border-bottom-color: var(--line-2); }
.header__inner { display: flex; align-items: center; justify-content: flex-start; gap: 40px; height: 64px; }
.header__actions { margin-left: auto; } /* язык и Connect Wallet — у правого края, как у split.tg */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { width: 40px; height: 40px; transition: transform 0.8s var(--ease); }
.logo:hover .logo__mark { transform: rotate(90deg); }
.logo__text { font-weight: 700; font-size: 24px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 32px; font-size: 15px; font-weight: 500; margin-left: 0; }
/* Подвижные элементы хедера для Shift-конструктора */
.logo, .nav a, .lang, .header__actions .btn { position: relative; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 22px; border-radius: 40px;
  font-weight: 600; font-size: 15px;
  transition: transform 0.25s var(--ease), background 0.25s, box-shadow 0.3s;
}
.btn:active { transform: scale(0.97); }
/* скругление пилюль как на split.tg (40px при высоте 44) */
.btn--sm { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 40px; }
#connectWallet .ico { width: 22px; height: 22px; }
.btn--block { width: 100%; justify-content: space-between; }
.btn--blue { background: #0098EA; color: #fff; }
.btn--blue:hover { box-shadow: 0 8px 28px -8px rgba(0, 152, 234, 0.7); }
.btn--blue b { font-weight: 600; font-variant-numeric: tabular-nums; }
/* Кнопка оплаты — точная копия split.tg: h-11 (44px), rounded-40,
   их bg-primary #0098EA, font-medium 16px */
.paybtn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; padding: 10px 20px;
  border-radius: 40px; border: none; cursor: pointer;
  background: #0098EA; color: #fff;
  font-size: 16px; font-weight: 500;
  transition: filter 0.3s;
}
.paybtn:hover { filter: brightness(1.1); }
.paybtn:disabled { opacity: 0.5; pointer-events: none; }
.paybtn__inner { display: flex; align-items: center; justify-content: center; width: 100%; }
.paybtn__dash { margin: 0 4px; } /* пробелы вокруг тире для читаемости */

.card {
  background: rgba(35, 40, 58, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}

/* ===== Hero ===== */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 540px; gap: 48px;
  align-items: start; min-height: calc(100vh - 64px); padding: 56px 0 96px;
}
/* Ноутбучные экраны (13–14" MacBook, ~1180–1440px ширины): правая колонка
   чуть уже, чтобы левый текст не теснился — раскладка остаётся ровной
   на любом экране, без ручных сдвигов */
@media (max-width: 1280px) and (min-width: 961px) {
  .hero { grid-template-columns: minmax(0, 1fr) 480px; gap: 32px; }
}
/* Правая колонка: ТУМБЛЕРЫ — ОТДЕЛЬНЫЙ независимый блок переключения,
   НЕ часть карточки покупки. Карточка выравнивается по границам
   текстового блока самостоятельно (верх карточки = верх текстового блока,
   низ карточки = низ текстового блока). Пилюли просто стоят над карточкой. */
.buy-stack { align-self: start; }
/* Левый блок — карточка в том же цвете, что блок покупки (без градиентов) */
.hero__copy {
  position: relative; min-height: 440px; display: flex; flex-direction: column; justify-content: center;
  padding: 48px 44px;
  background: rgba(35, 40, 58, 1);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.65),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  align-self: start;
  /* высота подгоняется под блок покупки из JS — мгновенно, без анимации,
     иначе placeLootbag фиксирует промежуточную позицию слова */
  transition: none;
}
.hero__title {
  position: relative; z-index: 2;
  /* масштаб шрифта задаётся вручную через Shift+Ctrl+колесо (--hero-fs из JS) */
  font-size: clamp(40px, 5.2vw, calc(58px * var(--hero-fs, 1)));
  line-height: 1.04; letter-spacing: -0.03em; font-weight: 700;
  margin-bottom: 12px;
  /* текст занимает почти всю ширину карточки */
  max-width: 98%;
}
.hero__title .t-grad { letter-spacing: -0.045em; }
.hero__lead { position: relative; z-index: 2; font-size: calc(18px * var(--hero-fs, 1)); max-width: 92%; }
/* Текст прижат к верху карточки */
.hero__copy { justify-content: flex-start; }
.hero__text-top { display: flex; flex-direction: column; }
/* Нижняя зона: телефон выходит из нижней черты + описание и кнопка справа */
.hero__phone-row {
  position: absolute; left: 28px; right: 28px; bottom: 0;
  display: flex; align-items: flex-end; gap: 18px;
  pointer-events: none;
}
.hero__phone-row .hero__app-info { pointer-events: auto; }
.hero__phone-row .hero__phone { pointer-events: auto; }
/* Телефон — те же пропорции, что в блоке Mini App (240×310 = 1.29:1),
   масштаб 0.75: 180×232. Выходит из нижней черты, белая градиентная подсветка */
.hero__copy .hero__phone {
  flex: 0 0 auto;
  width: 180px; height: 232px;      /* пропорция 1.29:1 — как макет в секции Mini App */
  background: var(--bg);
  border: 5px solid #343b54; border-bottom: 0;
  border-radius: 24px 24px 0 0;
  transform: none;
  /* белая подсветка сверху убрана — телефон больше не «светится» в блоке текста */
  box-shadow: none;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
/* экран внутри рамки */
.hero__copy .phone__screen {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
/* Dynamic Island как у iPhone */
.hero__copy .phone__island {
  width: 56px; height: 15px; border-radius: 99px;
  background: #000; margin: 7px auto 0;
  position: relative; z-index: 5;
}
.hero__copy .hero__phone .phone__bar {
  padding: 10px 12px; font-size: 10px;
  background: var(--surface);
}
.hero__copy .hero__phone .phone__body { padding: 13px 11px; gap: 6px; }
.hero__copy .hero__phone .phone__mark { width: 38px; height: 38px; margin-bottom: 3px; }
.hero__copy .hero__phone .phone__row { padding: 8px 10px; border-radius: 10px; font-size: 10px; }
.hero__copy .hero__phone .phone__row .ico { width: 13px; height: 13px; }
.hero__copy .hero__phone .phone__btn { padding: 9px; border-radius: 10px; font-size: 10px; }
.hero__copy .hero__phone {
  animation: phoneRise 0.9s var(--ease) 0.25s both;
}
/* Описание + кнопка справа от телефона */
.hero__app-info {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 250px; margin-bottom: 26px;
}
.hero__app-note { font-size: 13px; line-height: 1.45; }
.hero__btn { font-size: calc(15px * var(--hero-fs, 1)); white-space: nowrap; align-self: flex-start; }
@keyframes phoneRise {
  from { transform: translateY(72%) rotate(3deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: translateY(0) rotate(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__copy .hero__phone { animation: none; }
}
/* Фирменная белая кнопка */
.btn--white {
  background: #fff; color: #0e1621;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px -14px rgba(255, 255, 255, 0.35);
}
.btn--white .ico { width: 20px; height: 20px; }
.btn--white:hover { background: #eef7fc; box-shadow: 0 18px 50px -16px rgba(255, 255, 255, 0.5); }

/* NFT-модель Loot Bag (Lottie, прозрачный, bag only): отдельный абсолютный блок
   поверх hero — позиция и размер подбираются вручную (Shift). */
.hero { position: relative; }
.hero__last { white-space: nowrap; }
/* NFT-подарок: стоит В ПОТОКЕ справа от слова «Моментально.» / «Instantly.»
   внутри span#heroLast. Это inline-block — он автоматически едет вместе с
   текстом при смене языка, размера шрифта и ширины экрана, без JS-координат.
   vertical-align выравнивает подарок по нижней строке текста. */
.lootbag {
  display: inline-block;
  vertical-align: baseline;
  width: 0.92em; height: 0.92em;      /* масштабируется вместе с шрифтом hero */
  margin-left: 0.14em;                 /* небольшой зазор справа от слова */
  margin-bottom: -0.16em;              /* опускаем к оптической базовой линии */
  line-height: 1;
  pointer-events: auto;
  cursor: grab;
}
.lootbag #lootbagModel { display: block; width: 100%; height: 100%; }
.lootbag svg { display: block; width: 100%; height: 100%; }
/* мягкое покачивание поверх Lottie — бесконечное */
@media (prefers-reduced-motion: no-preference) {
  .lootbag #lootbagModel { animation: bagFloat 7s ease-in-out infinite; }
  @keyframes bagFloat {
    0%   { transform: translateY(0) rotate(-3deg); }
    50%  { transform: translateY(-0.08em) rotate(2deg); }
    100% { transform: translateY(0) rotate(-3deg); }
  }
}

/* ===== Режим подбора раскладки (Shift + drag / колесо) ===== */
/* Подвижные блоки: подарок, текст, покупка, Mini App, рефералы, FAQ */
.movable--grab { cursor: grab; }
.lootbag-hint {
  position: fixed; z-index: 100;
  padding: 8px 12px; font-size: 13px; line-height: 1.4;
  color: #dfe9f2; background: rgba(15, 23, 34, 0.96);
  border: 1px solid var(--line); border-radius: 10px;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7);
}
.lootbag-panel {
  position: fixed; z-index: 101; width: 300px;
  padding: 14px; display: grid; gap: 10px;
  color: #dfe9f2; background: rgba(15, 23, 34, 0.97);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.8);
  font-size: 13px;
}
.lootbag-panel b { font-size: 14px; }
.lootbag-panel pre {
  margin: 0; padding: 10px; overflow: auto;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px; line-height: 1.5; color: #9fd0ff;
  background: rgba(9, 14, 21, 0.9); border: 1px solid var(--line); border-radius: 8px;
  white-space: pre;
}
.lootbag-panel__note { color: #9fb3c6; line-height: 1.45; }
.lootbag-panel__note code, .lootbag-panel__btns { font-size: 12px; }
.lootbag-panel__btns { display: flex; gap: 8px; }
.lootbag-panel__btns button {
  flex: 1; padding: 7px 0; font-size: 12px; font-weight: 600;
  color: #dfe9f2; background: rgba(55, 187, 254, 0.14);
  border: 1px solid rgba(55, 187, 254, 0.35); border-radius: 8px;
  cursor: pointer; transition: background 0.15s;
}
.lootbag-panel__btns button:hover { background: rgba(55, 187, 254, 0.28); }

/* ===== Buy widget ===== */
/* Пилюли — отдельный самостоятельный блок переключения. Карточка покупки
   не тянет их за собой: она выравнивается по текстовому блоку hero. */
.buy-stack { z-index: 2; display: flex; flex-direction: column; gap: 14px; }
/* форма-обёртка растягивается на остаток стека, карточка — на всю форму */
#buyForm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Карточка — параметры split.tg: гэп 12, радиус 24, их bg-block-bg.
   Цвет заменён на наш тёмный (единственное отступление). */
.buy {
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
  background: #23283a;
  border: none;
  border-radius: 24px;
  flex: 1;
  min-height: 0;
  /* Лёгкое синее свечение — карточка покупки как целевая зона (CTA):
     глаз пользователя сразу цепляется за неё. Сила свечения умеренная,
     чтобы не спорить с основным синим цветом кнопки внутри. */
  box-shadow: 0 0 0 1px rgba(0, 152, 234, 0.18),
              0 0 60px -18px rgba(0, 152, 234, 0.32),
              0 24px 60px -24px rgba(0, 0, 0, 0.55);
}
/* Средняя зона: колонка с гэпом 24 как у split (flex flex-col gap-6) */
.buy__scroll {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 24px;
  overflow: visible; /* без прокрутки — карточка растёт под контент */
}
.buy__body { display: flex; flex-direction: column; gap: 24px; flex: 1; min-height: 0; }
.amount { display: flex; flex-direction: column; gap: 24px; flex: 1; }
/* Всплытие карточки поверх подмены контента при переключении Stars/Premium */
.buy.is-popping { animation: buyPop 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes buyPop { from { opacity: 0; } to { opacity: 1; } }
.buy__head { display: flex; flex-direction: column; gap: 0; }
.buy__title { font-size: 30px; line-height: 36px; letter-spacing: 0; font-weight: 700; }
.buy__sub { font-size: 18px; line-height: 24px; margin-bottom: 12px; }
/* Согласие — точная копия нового split.tg: ПЛИТКА-кнопка (bg-input-bg,
   border tile, r24, h-48, py-8 px-17) с круглым чекбоксом и текстом 16px */
.buy__note-wrap {
  display: flex; align-items: center; gap: 7px;
  min-height: 48px; padding: 8px 17px;
  border-radius: 24px;
  background: #131726;
  border: 1px solid #373c4f;
  cursor: pointer; user-select: none;
  letter-spacing: -0.45px;
  transition: border-color 0.2s;
}
.buy__note-wrap:hover { border-color: #4a5468; }
/* скрытый чекбокс (sr-only как у них) */
.buy__note-input {
  width: 1px; height: 1px; opacity: 0; position: absolute;
  pointer-events: none; /* клики ловит вся плитка-label */
}
/* видимый квадрат-чекбокс: 20px круглый, рамка #B9B9BA, checked → primary */
.buy__note-check {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid #B9B9BA;
  transition: background 0.15s, border-color 0.15s;
}
.buy__note-input:checked ~ .buy__note-check {
  background: #0098EA; border-color: #0098EA;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.buy__note-text { font-size: 16px; line-height: 24px; color: #ACC1D5; font-weight: 400; }
.buy__note-text a { color: #07a7fe; text-decoration: underline; }
.buy__note-text a:hover { filter: brightness(1.15); }

/* ============================================================
   ОТДЕЛЬНЫЙ БЛОК: тумблеры Stars/Premium (.pills)
   Это НЕ часть карточки покупки (.buy) — самостоятельный блок
   переключения вкладок. В выравнивании hero он НЕ участвует:
   текстовый блок ровняется по КАРТОЧКЕ покупки, а тумблеры
   стоят НАД ней отдельным рядом.
   ============================================================ */
/* Тумблеры — параметры split.tg: высота кнопок 64, шрифт 18px/600, паддинг 18.
   Лента bg-block-bg (наш тёмный аналог), скругление 70 */
.pills {
  position: relative;
  display: flex; gap: 8px; padding: 8px;
  border-radius: 70px;
  background: #23283a;
  border: none;
  align-self: start; /* пилюли своей высоты, не растягиваются со стеком */
}
/* Ползунок — синий, едет между кнопками (transform transition) */
.pill-thumb {
  position: absolute; z-index: 1; top: 8px; bottom: 8px; left: 8px;
  width: calc((100% - 24px) / 2);
  border-radius: 999px;
  background: #0098EA;
  box-shadow: inset 0 0 24px rgba(42, 171, 238, 0.10), 0 4px 14px -4px rgba(42, 171, 238, 0.45);
  transition: transform 0.45s cubic-bezier(0.35, 0.9, 0.25, 1);
  will-change: transform;
}
.pills[data-active="premium"] .pill-thumb { transform: translateX(100%); }
.pill {
  position: relative; z-index: 2; flex: 1; height: 64px; padding: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 28px; font-weight: 600; color: var(--hint);
  background: none; border: none; cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pill__label { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pill .ico { width: 22px; height: 22px; }
.pill:hover { color: #dfe7ef; }
.pill.is-active { color: #fff; }
.pill.is-active .ico { color: #fff; }

/* Тело карточки — колонка как у split (panes внутри flex-col gap-6) */
.buy__body.is-hidden { display: none; }

/* Поле количества — параметры split: поле 50px их bg/border, input h-12 */
.amount { display: flex; flex-direction: column; gap: 6px; }
.amount__control { height: 56px; }
.amount__star { width: 23px; height: 23px; flex: 0 0 auto; }
.amount__control input {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0;
  font-size: 19px; font-weight: 400; color: #fff; caret-color: var(--blue);
  padding: 0 16px 0 12px;
}
.amount__control input::placeholder { color: #B9B9BA; font-weight: 400; }
.slider__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Сетка пресетов: 5 вытянутых плиток (приплюснутые — выше, чем шире) */
.chips {
  display: flex; gap: 5px; margin-top: 14px;
}
.chips button {
  flex: 1; min-width: 0; height: 54px;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px;
  border-radius: 27px;
  background: rgba(52, 60, 83, 0.5);
  border: 1px solid #373c4f;
  font-size: 16px; line-height: 16px; font-weight: 500; color: #fff;
  cursor: pointer; user-select: none; outline: none;
  transition: background 0.2s, border-color 0.2s;
}
.chips button .ico { width: 18px; height: 18px; }
.chips button:hover { background: rgba(52, 60, 83, 0.8); }
/* активный пресет: bg-input-bg + border primary */
.chips button.is-active {
  background: #131726;
  border-color: #0098EA;
}

/* Панель Premium: карточки периодов (min-h-192, гифка 100px, 3 строки) */
.plans { display: flex; gap: 6px; }
.plan {
  position: relative; flex: 1; min-width: 0; min-height: 192px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  border-radius: 24px; padding: 10px;
  background: #131726;
  border: 1px solid #151a2c;
  cursor: pointer; user-select: none; outline: none;
  transition: border-color 0.2s, background 0.2s;
  /* гифки на своём композитном слое: их repaint не тянет за собой карточку */
  contain: layout paint;
}
.plan:hover { background: rgba(52, 60, 83, 0.35); }
.plan.is-active { border-color: #0098EA; }
.plan__img {
  display: block; flex: none;
  width: 100px; height: 100px; object-fit: cover;
  border-radius: 14px;
  /* gif больше не качает layout: свой слой + запрет “промотки” по кадрам
     наружу (contain) — на MacBook анимация больше не лагает */
  transform: translateZ(0);
  will-change: transform;
  /* Lottie рисует 512×512 в слот 100×100 — лишнее аккуратно срезаем */
  overflow: hidden;
}
/* Lottie-контейнер вместо APNG: внутри живёт <svg>, растянутый на весь слот */
.plan__img > svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.plan__text {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.plan__term { font-size: 17px; line-height: 20px; font-weight: 700; color: #fff; }
.plan__name { font-size: 17px; line-height: 20px; font-weight: 500; color: #fff; }
.plan__price { font-size: 15px; line-height: 18px; min-height: 18px; font-weight: 500; color: #ACC1D5; }
/* бейдж скидки: absolute top-2.5 right-2.5, bg-primary/15 text-primary 12px */
.plan__badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(0, 152, 234, 0.15); color: #0098EA;
  font-size: 12px; line-height: 14px; font-weight: 500;
}

/* Способы оплаты: grid-cols-2, две половинки 48px (bg-input-bg).
   margin-top: плитки звёзд выросли — оплата опущена, воздух между зонами */
.paygrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 10px;
}
.paytile {
  display: flex; width: 100%; height: 48px;
  align-items: center; justify-content: space-between;
  border-radius: 24px; padding: 0 17px;
  background: #131726;
  border: 1px solid #2d3842;
  font-size: 17px; line-height: 17px; font-weight: 500; color: #fff;
  cursor: pointer; outline: none;
  transition: border-color 0.2s;
}
.paytile__label { display: flex; align-items: center; gap: 7px; min-width: 0; }
.paytile__label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paytile__sbp { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; }
.paytile__chev { flex: 0 0 auto; }
.paytile.is-active { border-color: #0098EA; }

.field { display: grid; gap: 6px; }
/* Поле юзернейм — увеличено в Stars-вкладке (56px, иконка 23px, текст 19px) */
.field__control {
  display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px 0 24px;
  border-radius: 28px; background: #131726; border: 1px solid #343b54;
  transition: border-color 0.25s;
}
.field__at { width: 23px; height: 23px; flex: 0 0 auto; margin-right: 4px; }
.field__control:focus-within { border-color: var(--blue); }
.field__control.is-invalid { border-color: #ec3942; }
.field__prefix { color: var(--hint); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 19px; font-weight: 400; color: #fff; caret-color: var(--blue); padding: 0 40px 0 16px; }
.field input::placeholder { color: #B9B9BA; }
.field__error { font-size: 13px; color: #ec3942; }
.field__error:empty { display: none; }

/* Способ оплаты — точные параметры split.tg: h-12 (48px), их bg/border, радиус 24 */
.select { position: relative; z-index: 5; }
.select__btn { width: 100%; gap: 10px; text-align: left; font-size: 17px; }
.select__btn:hover { border-color: var(--line-2); }
.select.is-open .select__btn,
.select__btn:focus-visible { border-color: var(--blue); outline: none; }
.select__ico { transition: transform 0.35s var(--ease); }
.select__ico.is-swap { animation: icoSwap 0.4s var(--ease); }
@keyframes icoSwap { from { transform: scale(0.4) rotate(-30deg); opacity: 0; } }
.select__value { flex: 1; color: #fff; display: flex; align-items: center; gap: 8px; }
.select__hint { font-size: 13px; color: var(--hint); }
.select__chev { color: var(--hint); transition: transform 0.35s var(--ease), color 0.25s; }
.select.is-open .select__chev { transform: rotate(180deg); color: var(--blue); }
.select__list {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 200px;
  list-style: none; padding: 0; border-radius: 20px;
  background: rgba(35, 40, 58, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  box-shadow: 0 32px 64px 0 rgba(0, 0, 0, 0.55);
  transform-origin: top center;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
}
/* дропдауну периода Premium — прежняя растяжка на всю ширину */
.select.is-open .select__list { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.select__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px; min-height: 46px;
  cursor: pointer; font-size: 17px; font-weight: 400; color: #dfe7ef;
  opacity: 0; transform: translateY(-4px);
  transition: background 0.2s, opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.select.is-open .select__list li { opacity: 1; transform: none; }
.select.is-open .select__list li:nth-child(2) { transition-delay: 0.04s; }
.select__list li span { flex: 1; }
.select__list li:hover, .select__list li.is-focus { background: rgba(255, 255, 255, 0.06); }
.select__list li svg { flex: 0 0 auto; }

/* Переключатель языка */
.header__actions { display: flex; align-items: center; gap: 10px; }
.lang {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  height: 38px; width: 100px; padding: 3px; border-radius: 99px; background: var(--surface);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600;
}
.lang__opt { position: relative; z-index: 1; color: var(--hint); transition: color 0.3s; }
.lang[data-lang="ru"] .lang__opt[data-v="ru"],
.lang[data-lang="en"] .lang__opt[data-v="en"] { color: #fff; }
.lang__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 99px; background: var(--surface-2); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.45s var(--ease);
}
.lang[data-lang="en"] .lang__thumb { transform: translateX(100%); }
/* Плавная смена текста при переключении языка */
[data-i18n] { transition: opacity 0.2s ease; }
.t-soft[data-i18n] { transition: opacity 0.2s ease, filter 0.25s; }
body.is-switching [data-i18n] { opacity: 0; }

.pane { display: none; }
.pane.is-active { display: grid; animation: paneIn 0.45s var(--ease); }
@keyframes paneIn { from { opacity: 0; transform: translateY(6px); } }

/* Переключение Stars ↔ Premium: раньше у карточки менялся height с
   transition (layout всего документа на каждом кадре — источник лагов).
   Теперь анимируется только transform/opacity, height меняется мгновенно
   в JS, а компенсирующая анимация карточки едет по translateY (GPU). */
.buy.is-popping { animation: buyPop 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.buy__title, .buy__sub, .buy__scroll, .buy__note-wrap, .paybtn {
  /* содержимое карточки на общем слое — без изолирования каждый кадр
     стека перерисовывал весь документ */
}

/* Дропдаун периода Premium */
.select__price { flex: 0 0 auto; color: var(--hint); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
.select__label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.select__prem { width: 18px; height: 18px; flex: 0 0 auto; }
.select__list li .select__check { margin-left: auto; }
.select__list li > span:first-child { flex: 1; }

/* ===== Sections ===== */
.section { padding: 110px 0 0; }
.section--narrow { width: min(592px, 100% - 40px); }
h2 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; }

/* ===== Базовый телефон (макет в hero-блоке) ===== */
.phone {
  width: 240px; height: 310px; border-radius: 32px 32px 0 0; overflow: hidden;
  background: var(--bg); border: 6px solid #22303e; border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgba(42, 171, 238, 0.35);
  transform: translateY(30px); transition: transform 0.8s var(--ease);
}
.phone__bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--surface); font-size: 12px; }
.phone__close { color: var(--link); }
.phone__title { font-weight: 600; }
.phone__dots { color: var(--hint); letter-spacing: 1px; }
.phone__body { display: grid; gap: 8px; padding: 18px 14px; justify-items: center; }
.phone__mark { width: 48px; height: 48px; margin-bottom: 6px; animation: float 6s var(--ease) infinite alternate; }
.phone__row { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: 12px; }
.phone__row .ico { width: 16px; height: 16px; }
.phone__row span { flex: 1; color: #dfe7ef; }
.phone__btn { width: 100%; margin-top: 4px; padding: 11px; border-radius: 12px; background: var(--blue-2); text-align: center; font-size: 13px; font-weight: 600; }

/* ===== Referral: широкая лента — выбранный вариант (цвет блоков + серебряный отлив) ===== */
.refband {
  position: relative;
  display: flex; align-items: center;
  height: 348px; /* фиксированная высота: блок не растёт от длинного русского текста */
  min-height: 348px;
  border-radius: 48px;
  padding: 64px 92px;
  overflow: hidden;
  /* фон блоков сайта слева → серебристый отлив справа */
  background: linear-gradient(105deg, #23283a 0%, #23283a 55%, #3a4356 78%, #5a6880 100%);
  color: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.8);
}
.refband__copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.refband__title {
  font-size: 48px; line-height: 1.25; letter-spacing: -0.03em; font-weight: 700;
  /* серебряный градиент по буквам, статичный; запас снизу — p/g не обрезаются */
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  background-image: linear-gradient(to right, #ffffff, #8fa1b5, #ffffff, #6a7a8c, #ffffff);
  padding-bottom: 0.12em;
}
.refband__text { font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, 0.8); }
.refband__btns { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.refband__copy-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 40px;
  background: #0098EA; color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: none; transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.refband__copy-btn:hover { background: #0077c4; transform: translateY(-1px); }
.refband__copy-btn .ico { width: 16px; height: 16px; }
/* Арт справа: орбиты со звёздами */
.refband__art {
  position: absolute; right: 80px; bottom: -16px;
  width: 350px; height: 350px;
  display: grid; place-items: center;
  pointer-events: none;
}
.ref__mark { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 50px rgba(220, 230, 240, 0.35); animation: float 6s var(--ease) infinite alternate; }
.orbit { position: absolute; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; }
.orbit--1 { width: 200px; height: 200px; }
.orbit--2 { width: 300px; height: 300px; border-style: dashed; opacity: 0.7; animation: spin 60s linear infinite; }
.sat { position: absolute; width: 24px; height: 24px; top: 50%; left: 50%; filter: drop-shadow(0 4px 10px rgba(0, 60, 90, 0.35)); }
.sat--1 { animation: orbit1 14s linear infinite; }
.sat--2 { width: 20px; height: 20px; animation: orbit2 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
@keyframes orbit1 { from { transform: translate(-50%, -50%) rotate(0) translateX(100px) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg) translateX(100px) rotate(-360deg); } }
@keyframes orbit2 { from { transform: translate(-50%, -50%) rotate(180deg) translateX(150px) rotate(-180deg); } to { transform: translate(-50%, -50%) rotate(-180deg) translateX(150px) rotate(180deg); } }

/* ===== FAQ ===== */
#faq h2 { margin-bottom: 32px; }
.faq { display: grid; gap: 8px; }
/* синяя кнопка Get Support под вопросами */
/* FAQ: карточка-блок в стиле остальных (bg-block-bg, радиус 24, паддинги) */
.faq-card {
  padding: 32px;
  background: #23283a;
  border: none;
  border-radius: 24px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}
.faq-card__title {
  font-size: 30px; line-height: 36px; font-weight: 700;
  margin-bottom: 20px;
}
.faq__support {
  margin-top: 24px; width: 100%; height: 44px;
  border-radius: 40px; background: #0098EA;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 500;
  transition: background 0.2s;
}
.faq__support:hover { background: #0077c4; }
.faq details { border-radius: 14px; background: #131726; border: 1px solid #373c4f; transition: background 0.3s; }
.faq details[open] { background: #1a2030; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--blue); transition: transform 0.4s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 20px 18px; animation: paneIn 0.4s var(--ease); }

/* ===== Footer ===== */
.footer { margin-top: 110px; border-top: 1px solid var(--line); padding: 26px 0; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.footer__nav { display: flex; gap: 24px; }

/* ===== Toast (в стиле системного уведомления Telegram) ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; padding: 12px 16px; border-radius: 12px;
  background: rgba(30, 44, 58, 0.96); font-size: 14px; color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease);
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
/* ================= МОБИЛЬНАЯ ВЕРСИЯ (и Telegram Mini App) ================= */
/* Главная причина прежнего переполнения: у грид-детей min-width по умолчанию
   auto, поэтому внутренняя ширина карточки (430px) распирала колонку 350px
   и страница скроллилась вбок. Ниже — min-width: 0 для всех ключевых узлов. */
@media (max-width: 960px) {
  .nav { display: none; }

  /* Телефон и описание Mini App — декоративная зона, на телефоне убираем:
     главное на мобильном — заголовок и карточка покупки */
  .hero__phone-row { display: none; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    /* запас снизу под залипающую кнопку оплаты */
    padding: 16px 0 calc(96px + env(safe-area-inset-bottom, 0px));
  }
  .hero__copy,
  .buy-stack,
  .buy,
  #buyForm { min-width: 0; width: 100%; }

  .hero__copy {
    min-height: 0;
    padding: 24px 20px;
    border-radius: 24px;
  }
  .hero__title {
    font-size: clamp(30px, 8.6vw, 44px);
    line-height: 1.06;
    max-width: 100%;
  }
  .hero__lead { max-width: 100%; font-size: 15px; }

  .buy-stack { gap: 12px; }
  .buy { padding: 18px; gap: 14px; border-radius: 22px; }
  .buy__title { font-size: 22px; line-height: 27px; }
  .buy__scroll { gap: 16px; }
  .buy__body { gap: 16px; }
  .amount { gap: 16px; }

  .pills { width: 100%; }
  .pill { flex: 1; height: 44px; font-size: 15px; padding: 0 10px; }
  .pill .ico { width: 18px; height: 18px; }

  /* поля ввода: не даём intrinsic-ширине распирать карточку */
  .field__control, .amount__control { min-width: 0; }
  .field input, .amount__control input { min-width: 0; }

  /* Вся цепочка вложенных контейнеров карточки обязана сжиматься.
     Без min-width:0 потомки упираются в свой min-content (текст пресетов,
     «RUB (СБП)» с nowrap, иконки) и распирают страницу уже на 320px. */
  .buy__scroll, .buy__body, .pane, .amount, .paygrid, .paytile,
  .chips, .chips button, .plans, .plan, .plan__text { min-width: 0; }

  /* 1fr = minmax(auto, 1fr) — сжимаем до нуля, иначе колонки не сжимаются */
  .paygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* пресеты количества: 5 плиток в ряд на 320px слишком узкие —
     раскладываем сеткой с переносом, высота крупнее для пальца */
  .chips {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }
  .chips button { height: 44px; padding: 0; font-size: 13px; gap: 4px; }
  .chips button .ico { width: 13px; height: 13px; }

  /* карточки периодов Premium: втрое уже, поэтому картинка и текст мельче */
  .plans { gap: 5px; }
  .plan { min-height: 156px; padding: 8px 6px; border-radius: 20px; }
  .plan__img { width: 72px; height: 72px; border-radius: 12px; }
  .plan__term, .plan__name { font-size: 14px; line-height: 17px; }
  .plan__price { font-size: 12px; line-height: 15px; }
  .plan__badge { top: 7px; right: 7px; padding: 2px 6px; font-size: 11px; }

  /* согласие и оплата — крупнее для тапа */
  .buy__note-text { font-size: 14px; line-height: 20px; }
  .paybtn {
    height: 50px;
    font-size: 16px;
    /* залипающая CTA: кнопка оплаты всегда под большим пальцем */
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.65),
                0 0 0 1px rgba(0, 152, 234, 0.25);
  }

  /* Реферальная лента: колонка, арт уходит вниз по центру, как на split.tg */
  .refband {
    flex-direction: column; justify-content: flex-start; align-items: center;
    min-height: 0; padding: 40px 20px 260px; text-align: center;
    border-radius: 28px;
    /* орбиты в арте шире самого блока — обязательно подрезаем, иначе они
       распирают документ и появляется горизонтальный скролл */
    overflow: hidden;
    height: auto;
  }
  .refband__copy { align-items: center; max-width: 100%; }
  .refband__title { font-size: 30px; }
  .refband__text { max-width: 100%; }
  .refband__btns { flex-direction: column; width: 100%; }
  .refband__copy-btn { width: 100%; justify-content: center; }
  .refband__art {
    position: absolute; right: 50%; bottom: -40px;
    width: 260px; height: 260px;
    transform: translateX(50%);
  }

  .header__inner { gap: 12px; height: 56px; }
  h2 { font-size: clamp(26px, 7vw, 34px); }

  /* В Mini App внешний сайт-хром не нужен: шапка компактнее, футер тише */
  .footer { padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
}

/* Узкие телефоны (iPhone SE / 8 / mini, 320–400px) */
@media (max-width: 400px) {
  .container { width: min(1120px, 100% - 24px); }
  .hero__copy { padding: 20px 16px; }
  .buy { padding: 14px; }
  .buy__title { font-size: 19px; line-height: 23px; }
  .hero__title { font-size: clamp(27px, 9.4vw, 36px); }
  .chips button { height: 40px; font-size: 12px; }
  .chips button .ico { width: 11px; height: 11px; }
  .plan { min-height: 140px; padding: 6px 4px; }
  .plan__img { width: 62px; height: 62px; }
  .plan__term, .plan__name { font-size: 12px; line-height: 15px; }
  .plan__price { font-size: 11px; line-height: 14px; }
  .plan__badge { font-size: 10px; padding: 2px 5px; top: 6px; right: 5px; }
  /* платёжные плитки на 320px: уже паддинги и мельче текст, иначе
     «RUB (СБП)» с иконкой не помещается в половину строки */
  .paytile { padding: 0 10px; font-size: 14px; gap: 6px; }
  .paytile__label { gap: 5px; }
  .paytile__sbp { width: 17px; height: 17px; }
  .chips { gap: 4px; }
  .chips button { padding: 0 2px; gap: 2px; }
}

@media (max-width: 480px) {
  .select__hint { display: none; }
  /* в шапке оставляем иконку кошелька, но убираем подпись — экономим ширину */
  .header__actions .btn span { display: none; }
  .header__actions .btn { padding: 0 11px; }
  .lang { width: 88px; }
}

/* ===== Telegram Mini App: безопасные зоны и высота окна ===== */
/* Telegram сообщает свои отступы через переменные ниже (ставит miniapp.js).
   Через них страница не заезжает под «шторку» и системные жесты. */
:root {
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;
  --tg-viewport-height: 100vh;
}
body.is-tg-app {
  overscroll-behavior-y: contain;   /* не тянем страницу за пределы окна */
  -webkit-tap-highlight-color: transparent;
}
body.is-tg-app .header {
  top: var(--tg-safe-top);
}
body.is-tg-app .footer {
  padding-bottom: calc(24px + var(--tg-safe-bottom));
}
/* Отключаем «выделение как в браузере» — ведёт себя как нативное приложение */
body.is-tg-app { user-select: none; -webkit-user-select: none; }
body.is-tg-app input, body.is-tg-app textarea { user-select: text; -webkit-user-select: text; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Раскладка hero и секций ===== */
/* Раньше здесь лежали «подобранные вручную» em-сдвиги и жёсткие px-размеры
   (#ref -34.5em, #faq -35.6em, hero__copy 569px, хедер scale(1.17)...),
   выверенные под один 2к-монитор. На любом другом экране (MacBook ~900px
   высоты) em-сдвиг не менялся, а hero становился короче — секции заезжали
   вверх и перекрывали текст и блок покупки. Раскладка возвращена в обычный
   поток: ширины задаёт грид hero, вертикали — естественный ритм секций. */
#buy .hero__copy {
  width: auto;   /* ширину даёт колонка грида */
  height: auto;  /* высоту синхронизирует JS с карточкой покупки */
}
#buy .buy-stack {
  width: auto;
  min-height: 0; /* карточка растёт под контент, без магии в пикселях */
}
/* (старое правило .lootbag { transform: scale(...) } удалено — размер теперь
   задаётся через em в основном блоке .lootbag выше, в потоке текста) */
/* Секции — обычный поток, отрицательных сдвигов больше нет.
   Верхняя строка хедера — стандартное центрирование flex. */
.nav a {
  position: relative;
}
