/* ===================================================================
   style.css — все стили сайта.
   Тема: чёрно-кислотная + «жидкое стекло» (Liquid Glass) как в iOS 26.
   Правило для плавности: анимируем только transform и opacity —
   их телефон обрабатывает видеокартой, без тормозов.
   =================================================================== */

/* ---------- 1. Переменные (дизайн-система в одном месте) ---------- */
:root {
  /* Цвета */
  --bg: #0a0a0a;          /* фон почти чёрный */
  --acid: #39ff14;        /* кислотно-зелёный — главный акцент */
  --acid-dark: #1f8f0b;
  --yellow: #d4ff00;      /* кислотно-жёлтый — второй акцент */
  --red: #ff3b3b;         /* проигрыш / ошибки */
  --risk: #ff2d55;        /* высокий риск на колесе */
  --text: #f0f0f0;
  --muted: #8b8b8b;       /* серый текст */
  --on-acid: #061200;     /* текст на кислотном фоне */
  --gold: #ffd54a;
  --silver: #d7dde6;
  --bronze: #e39a62;

  /* Отступы — шаг 4px */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --page-x: 16px;          /* боковой отступ страницы */

  /* Шрифты */
  --font-body: 'Montserrat', sans-serif;
  --font-display: 'Unbounded', sans-serif;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 24px;

  /* Скругления */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-full: 999px;

  /* Тени и свечения */
  --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-inset-strong: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --glow-acid: 0 0 16px rgba(57, 255, 20, 0.45);
  --glow-acid-soft: 0 0 20px -6px rgba(57, 255, 20, 0.5);
  --glow-risk: 0 0 18px rgba(255, 45, 85, 0.55);

  /* Поверхности */
  --card-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  --card-border: rgba(255, 255, 255, 0.09);
  --glass-bg: rgba(28, 28, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.15);
  --field-bg: rgba(255, 255, 255, 0.05);

  /* Размеры */
  --nav-h: 64px;                          /* высота нижнего меню */
  --safe-bottom: env(safe-area-inset-bottom); /* полоска внизу iPhone */

  /* Плавность */
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1); /* «пружинка» */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- 2. Базовые настройки ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* убираем синюю подсветку при тапе на телефоне */
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: var(--fs-md);
}

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

/* Всё приложение — колонка шириной до 480px (на компьютере по центру).
   position + z-index — чтобы быть поверх плавающих пятен фона. */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 30px);
}

/* ---------- 3. Плавающие пятна на фоне ---------- */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Размытие сделано радиальным градиентом (а не filter: blur) — так быстрее */
.blob {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  will-change: transform;
}

.blob-1 {
  top: -140px;
  left: -160px;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.22), transparent 65%);
  animation: blob-1 26s ease-in-out infinite alternate;
}

.blob-2 {
  bottom: -180px;
  right: -170px;
  background: radial-gradient(circle, rgba(212, 255, 0, 0.16), transparent 65%);
  animation: blob-2 31s ease-in-out infinite alternate;
}

.blob-3 {
  top: 35%;
  left: 20%;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.1), transparent 65%);
  animation: blob-3 37s ease-in-out infinite alternate;
}

@keyframes blob-1 { to { transform: translate(140px, 280px) scale(1.2); } }
@keyframes blob-2 { to { transform: translate(-160px, -260px) scale(1.15); } }
@keyframes blob-3 { to { transform: translate(90px, -200px) scale(0.85); } }

/* ---------- 4. «Жидкое стекло» ---------- */
/* Класс .glass можно повесить на любой блок: шапку, меню, окна */
.glass {
  position: relative;
  isolation: isolate; /* чтобы блик (z-index: -1) лёг под текст, но над фоном */
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset-strong), var(--shadow-float);
}

/* мягкий блик сверху */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

/* ---------- 5. Заставка (splash) ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-5);
  background:
    radial-gradient(circle at 50% 40%, rgba(57, 255, 20, 0.16), transparent 55%),
    var(--bg);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Исчезновение: плавно растворяется и чуть увеличивается */
.splash.hide {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  animation: splash-in 0.7s var(--ease-spring) both;
}

@keyframes splash-in {
  from { opacity: 0; transform: scale(0.8); }
}

.splash-mark {
  width: 84px;
  height: 84px;
  fill: #161616;
  stroke: var(--acid);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 14px rgba(57, 255, 20, 0.7));
  animation: spin 2.4s linear infinite;
}

.splash-sector {
  fill: var(--acid);
  stroke: none;
}

.splash-hole {
  fill: var(--bg);
  stroke: none;
}

.splash-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 2px;
  color: var(--text);
  text-shadow: 0 0 18px rgba(57, 255, 20, 0.45);
}

.splash-title span {
  color: var(--acid);
  text-shadow: 0 0 10px var(--acid), 0 0 30px rgba(57, 255, 20, 0.7);
}

/* Полоска загрузки: заполняется через transform: scaleX */
.splash-bar {
  width: 180px;
  height: 4px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.08);
}

.splash-bar-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acid), var(--yellow));
  box-shadow: var(--glow-acid);
  transform-origin: left;
  transform: scaleX(0);
  animation: splash-load 1.4s var(--ease-out) forwards;
}

@keyframes splash-load {
  to { transform: scaleX(0.85); }
}

/* Всё загрузилось — полоска добегает до конца */
.splash.done .splash-bar-fill {
  animation: none;
  transform: scaleX(1);
}

.splash-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* Пока идёт загрузка — вкладки скрыты (покажутся с анимацией после заставки) */
body.loading .tab {
  display: none !important;
}

/* ---------- 6. Шапка ---------- */
.header {
  position: sticky;
  top: var(--sp-2);
  z-index: 50;
  margin: var(--sp-2) var(--sp-3) 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-radius: 26px;
}

.profile {
  flex: 1;
  min-width: 0; /* чтобы длинное имя обрезалось, а не ломало шапку */
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: transform 0.15s;
}

.profile:active {
  transform: scale(0.97);
}

.avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--bg);
  background: linear-gradient(135deg, var(--acid), var(--yellow));
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}

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

/* Значок уровня в углу аватарки */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.level-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  border: 1.5px solid var(--acid);
  background: var(--bg);
  color: var(--acid);
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.6);
}

.profile-text {
  min-width: 0;
}

.user-name,
.user-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* «…» если не влезает */
}

.user-name {
  font-weight: 700;
  font-size: 15px;
}

.user-username {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Круглая стеклянная кнопка (звук, крестик) */
.icon-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-inset);
  transition: transform 0.15s;
}

.icon-btn:active {
  transform: scale(0.9);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* --- Иконка звука: волны «расходятся», когда звук включён --- */
.sound-btn .spk {
  fill: currentColor;
}

.sound-btn .wave,
.sound-btn .mute {
  transition: opacity 0.25s;
}

.sound-btn.on .wave {
  animation: sound-wave 1.6s ease-in-out infinite;
}

.sound-btn.on .w2 {
  animation-delay: 0.25s;
}

.sound-btn.on .mute,
.sound-btn.off .wave {
  opacity: 0;
}

.sound-btn.off {
  color: var(--muted);
}

@keyframes sound-wave {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

/* --- Баланс --- */
.balance {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 7px 7px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(57, 255, 20, 0.6);
  background: rgba(57, 255, 20, 0.1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--acid);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.25), var(--shadow-inset-strong);
  transition: transform 0.15s;
}

.balance:active {
  transform: scale(0.95);
}

/* цифры одинаковой ширины — чтобы при «накрутке» баланс не дёргался */
#balance-value {
  font-variant-numeric: tabular-nums;
}

/* Звезда: медленно мерцает, а иногда вспыхивает бликом */
.star-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.star-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
  filter: drop-shadow(0 0 4px rgba(255, 213, 74, 0.8));
  animation: star-twinkle 3s ease-in-out infinite;
}

/* блик — маленькая белая искра, которая вспыхивает раз в несколько секунд */
.star-icon::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0) 70%);
  transform: scale(0);
  animation: star-glint 5s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.12); opacity: 1; }
}

@keyframes star-glint {
  0%, 84%, 100% { transform: scale(0); opacity: 0; }
  90%           { transform: scale(1.6); opacity: 1; }
}

.balance-plus {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--acid);
}

.balance-plus svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--on-acid);
  stroke-width: 3;
  stroke-linecap: round;
}

/* «Подпрыгивание» баланса при изменении */
.balance.bump {
  animation: bump 0.4s ease;
}

@keyframes bump {
  50% { transform: scale(1.1); }
}

/* «Пружинка» иконки при нажатии (класс pressed ставит app.js) */
.pressed svg {
  animation: icon-press 0.45s var(--ease-spring);
}

@keyframes icon-press {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(0.85) rotate(-8deg); }
  65%  { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- 7. Вкладки и заголовки ---------- */
.content {
  padding: var(--page-x);
}

.tab {
  display: none;
}

/* Переход между вкладками: сдвиг + появление.
   --dir = 1 (вправо) или -1 (влево), задаётся из app.js */
.tab.active {
  display: block;
  animation: tab-in 0.4s var(--ease-out) backwards;
}

@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateX(calc(var(--dir, 1) * 28px));
  }
}

/* Карточки появляются по очереди: --i — номер карточки, задержка = номер × 45 мс */
.tab.entering .card,
.tab.entering .anim-in {
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

.tab-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: var(--fs-2xl);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--sp-4);
  color: var(--acid);
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.55);
}

.section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: var(--sp-5) 0 var(--sp-3);
}

/* ---------- 8. Скелетон (серые мерцающие блоки) ---------- */
.sk {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
}

/* бегущий блик по серому блоку */
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.sk-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: var(--sp-2);
  margin: var(--sp-5) 0 var(--sp-4);
}

.sk-podium .sk:nth-child(1) { height: 150px; }
.sk-podium .sk:nth-child(2) { height: 190px; }
.sk-podium .sk:nth-child(3) { height: 130px; }

.sk-row {
  height: 62px;
  margin-bottom: var(--sp-2);
}

/* ---------- 9. Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-md);
  font-weight: 700;
  text-align: center;
  transition: transform 0.15s, opacity 0.2s;
}

/* Нажатие */
.btn:active {
  transform: scale(0.96);
}

/* Главная кнопка: кислотная, с «стеклянным» бликом сверху */
.btn-primary {
  background: linear-gradient(180deg, #7dff5e 0%, var(--acid) 45%, #2bd60e 100%);
  color: var(--on-acid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), var(--glow-acid);
}

/* Второстепенная кнопка: стеклянная */
.btn-outline {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-inset);
  color: var(--text);
}

/* Прозрачная кнопка (например «Очистить») */
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

/* Стеклянная кнопка с кислотным акцентом и иконкой («Вывести подарки») */
.btn-glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(57, 255, 20, 0.06);
  border: 1px solid rgba(57, 255, 20, 0.45);
  color: var(--acid);
  box-shadow: var(--shadow-inset-strong), var(--glow-acid-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-glass svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Размеры */
.btn-small {
  width: 100%;
  padding: 9px 6px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.btn-tiny {
  padding: 7px var(--sp-3);
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.btn-medium {
  padding: 14px var(--sp-5);
  font-size: var(--fs-md);
}

.btn-wide {
  width: 100%;
  padding: 15px;
  margin-top: var(--sp-4);
  font-size: 15px;
}

.btn-big {
  width: 100%;
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  font-family: var(--font-display);
  font-size: 17px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Неактивная */
.btn:disabled {
  opacity: 0.35;
  box-shadow: none;
  cursor: not-allowed;
}

.btn:disabled:active {
  transform: none;
}

/* «Как будто неактивная»: выглядит выключенной, но нажатие показывает, чего не хватает */
.btn.is-disabled {
  opacity: 0.35;
  box-shadow: none;
}

.btn.is-disabled:active {
  transform: none;
}

/* Опасное действие (сброс прогресса) */
.btn-danger {
  background: rgba(255, 59, 59, 0.12);
  border: 1px solid rgba(255, 59, 59, 0.5);
  color: #ff6b6b;
  box-shadow: var(--shadow-inset);
}

/* Загрузка: текст прячется, по центру крутится колечко */
.btn.loading {
  color: transparent !important;
  text-shadow: none;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(6, 18, 0, 0.3);
  border-top-color: var(--on-acid);
  animation: spin 0.7s linear infinite;
}

.btn-outline.loading::after,
.btn-ghost.loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
}

/* «Продать всё» после первого нажатия — красная, ждёт подтверждения */
.btn.armed {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 59, 59, 0.1);
}

/* ---------- 10. Пустые состояния ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  animation: card-in 0.45s var(--ease-out) backwards;
}

.empty-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--sp-1);
  animation: float 3s ease-in-out infinite;
}

.empty-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.empty-hint {
  max-width: 260px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.empty-state .btn {
  margin-top: var(--sp-2);
}

/* ---------- 11. Картинка подарка и карточки ---------- */
/* Картинка заполняет «коробочку»-родителя и вписывается целиком (contain) */
.gift-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Запасной эмодзи — по центру той же коробочки */
.gift-emoji {
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Маленькие иконки внутри текста (история, бегущая строка) */
.icon-sm,
.icon-xs {
  display: inline-block;
  vertical-align: middle;
}

.icon-sm { width: 26px; height: 26px; font-size: 20px; }
.icon-xs { width: 20px; height: 20px; font-size: 15px; }

.gift-emoji.icon-sm,
.gift-emoji.icon-xs {
  display: inline-grid;
}

/* Сетка карточек */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 440px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --glow — цвет свечения, его подставляет JavaScript по редкости подарка */
.card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 10px 10px;
  border-radius: var(--r-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-inset);
  transition: transform 0.25s var(--ease-spring);
}

/* Светящаяся рамка — появляется при нажатии/наведении (анимируем только opacity) */
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid var(--glow);
  box-shadow: 0 0 20px -2px var(--glow);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

/* При нажатии карточка «приподнимается» и светится */
.card:active {
  transform: translateY(-4px) scale(1.02);
}

.card:active::before {
  opacity: 1;
}

/* Коробочка картинки в карточке. drop-shadow — неоновая тень цвета редкости,
   она повторяет контур картинки (фон у PNG прозрачный) */
.card-emoji {
  width: 72px;
  height: 72px;
  font-size: 44px;
  line-height: 1;
  margin: 2px 0;
  filter: drop-shadow(0 0 8px var(--glow));
  transition: transform 0.25s var(--ease-spring);
}

.card-name {
  max-width: 100%;
  font-weight: 700;
  font-size: var(--fs-md);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--yellow);
  margin-bottom: var(--sp-1);
}

.rarity-tag {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 7px;
  border-radius: 8px;
  border: 1px solid var(--glow);
  color: var(--glow);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

/* Кислотная ленточка «NFT» в углу карточки */
.nft-ribbon {
  position: absolute;
  top: 10px;
  right: -5px;
  z-index: 1;
  padding: 3px 9px 3px 8px;
  border-radius: 6px 2px 2px 6px;
  background: linear-gradient(180deg, #7dff5e, var(--acid));
  color: var(--on-acid);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

/* «загиб» ленточки за край карточки */
.nft-ribbon::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  border-top: 5px solid var(--acid-dark);
  border-right: 5px solid transparent;
}

.card-actions {
  display: flex;
  gap: 6px;
  width: 100%;
}

/* Эффекты наведения — только там, где есть мышка (на телефоне они «залипают») */
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
  }

  .card:hover::before {
    opacity: 0.8;
  }

  .card:hover .card-emoji {
    transform: scale(1.12) rotate(-6deg);
  }
}

/* NFT-карточки — особое пульсирующее свечение */
.card.rarity-nft {
  border-color: rgba(255, 43, 214, 0.4);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 43, 214, 0.16), transparent 65%),
    var(--card-bg);
}

.card.rarity-nft::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 22px -4px var(--glow);
  opacity: 0.3;
  animation: glow-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-pulse {
  50% { opacity: 1; }
}

/* Если не хватает звёзд — кнопка «Купить» бледнее */
.card.cant-afford .btn-primary {
  opacity: 0.45;
  box-shadow: none;
}

/* Предмет, который сейчас стоит в ставке */
.card.selected::before {
  opacity: 1;
  border-color: var(--acid);
}

.card.selected .btn-primary {
  background: rgba(57, 255, 20, 0.15);
  color: var(--acid);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 20, 0.5);
}

/* ---------- 12. Живая лента выигрышей ---------- */
.live-feed {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

/* Значок LIVE с мигающей точкой */
.live-label {
  flex-shrink: 0;
  width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-md);
  border: 1px solid rgba(57, 255, 20, 0.3);
  background: rgba(57, 255, 20, 0.06);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--acid);
}

.live-label small {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
  animation: live-blink 1.2s ease-in-out infinite;
}

@keyframes live-blink {
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* «Окно» ленты: правый край плавно растворяется */
.live-window {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
  mask-image: linear-gradient(90deg, #000 82%, transparent);
}

/* Лента едет справа налево: live.js двигает её через transform (плавно, без рывков) */
.live-track {
  position: relative;
  display: flex;
  gap: var(--sp-2);
  width: max-content;
  will-change: transform;
}

/* Вся полоса LIVE нажимается — открывает окно «Лайв» */
.live-feed {
  cursor: pointer;
  transition: transform 0.15s;
}

.live-feed:active {
  transform: scale(0.98);
}

/* Карточка выигрыша: картинка, цена, ник, иконка источника. Рамка — цвет редкости. */
.drop {
  position: relative;
  flex-shrink: 0;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px var(--sp-1) 5px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--card-border); /* запасной вариант для старых телефонов */
  border: 1px solid color-mix(in srgb, var(--glow) 45%, transparent);
  background: var(--card-bg);
}

/* цветная полоска сверху — цвет редкости */
.drop::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--glow);
  box-shadow: 0 0 10px var(--glow);
}

/* Новый дроп «влетает» в ленту и вспыхивает */
.drop.new {
  animation: drop-in 0.6s var(--ease-spring), drop-flash 1.4s ease-out;
}

@keyframes drop-in {
  from { opacity: 0; transform: translateX(40px) scale(0.6); }
}

@keyframes drop-flash {
  0%, 30% { box-shadow: 0 0 22px var(--glow), inset 0 0 18px -6px var(--glow); }
  100%    { box-shadow: none; }
}

/* Мой выигрыш — кислотная подсветка */
.drop.mine {
  border-color: rgba(57, 255, 20, 0.6);
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.18), rgba(57, 255, 20, 0.03));
}

/* Иконка источника в углу: 🎰 апгрейд или 📦 кейс */
.drop-src {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  line-height: 1;
}

.drop-img {
  width: 34px;
  height: 34px;
  font-size: 24px;
  filter: drop-shadow(0 0 6px var(--glow));
}

.drop-price {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}

.drop-user {
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  font-size: 9px;
  font-weight: 700;
}

.drop-user span:last-child {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drop.mine .drop-user {
  color: var(--acid);
}

/* Мини-аватарка игрока: буква на градиенте, фото поверх (если есть) */
.live-ava {
  position: relative;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 800;
  color: var(--bg);
  background: linear-gradient(135deg, var(--acid), var(--yellow));
}

.live-ava img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 13. Колесо апгрейда ---------- */
.wheel-wrap {
  position: relative;
  isolation: isolate; /* свечение (z-index: -1) остаётся внутри колеса */
  width: 260px;
  height: 260px;
  margin: 0 auto 20px;
  transition: transform 1.2s var(--ease-out);
}

/* «Замедление времени» перед остановкой — колесо чуть приближается */
.wheel-wrap.suspense {
  transform: scale(1.05);
}

#wheel {
  display: block;
  width: 260px;
  height: 260px;
}

/* Два слоя свечения за колесом: зелёный (::before) и красный (::after).
   Меняем только их прозрачность — это очень лёгкая анимация. */
.wheel-wrap::before,
.wheel-wrap::after {
  content: '';
  position: absolute;
  inset: -24px;
  z-index: -1;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
}

.wheel-wrap::before {
  background: radial-gradient(circle, rgba(57, 255, 20, 0.45) 40%, transparent 70%);
}

.wheel-wrap::after {
  background: radial-gradient(circle, rgba(255, 45, 85, 0.45) 40%, transparent 70%);
}

/* Колесо готово к прокрутке — свечение пульсирует, зовёт нажать.
   При высоком риске пульсирует красный слой вместо зелёного. */
.wheel-wrap.ready:not(.risky)::before,
.wheel-wrap.ready.risky::after {
  animation: wheel-pulse 1.8s ease-in-out infinite;
}

@keyframes wheel-pulse {
  0%, 100% { opacity: 0.15; transform: scale(0.94); }
  50%      { opacity: 0.6;  transform: scale(1.04); }
}

.wheel-wrap.win::before  { opacity: 1; }
.wheel-wrap.lose::after  { opacity: 1; }

/* Стрелка: блок размером с колесо, который вращается вокруг центра.
   Сама стрелка нарисована псевдоэлементами наверху блока. */
.needle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

/* палочка стрелки (лежит на кольце колеса) */
.needle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  width: 6px;
  height: 48px;
  margin-left: -3px;
  border-radius: 3px;
  background: linear-gradient(to bottom, #ffffff, var(--yellow));
  box-shadow: 0 0 10px var(--yellow), 0 0 20px var(--yellow);
}

/* наконечник-треугольник снаружи колеса */
.needle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -4px;
  margin-left: -9px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid var(--yellow);
  filter: drop-shadow(0 0 6px var(--yellow));
}

.wheel-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.wheel-chance {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  color: var(--acid);
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.7);
  transition: color 0.35s, text-shadow 0.35s; /* плавная смена цвета */
}

/* Шанс меньше 20% — процент красный */
.wheel-wrap.risky .wheel-chance {
  color: var(--risk);
  text-shadow: 0 0 12px rgba(255, 45, 85, 0.75);
}

.wheel-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Подсказка под колесом */
.wheel-hint {
  margin: -6px 0 var(--sp-3);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.35s, text-shadow 0.35s;
}

.wheel-hint.risky,
.wheel-hint.warn {
  color: var(--risk);
  text-shadow: 0 0 10px rgba(255, 45, 85, 0.6);
}

.wheel-hint.risky {
  animation: risk-blink 1.4s ease-in-out infinite;
}

@keyframes risk-blink {
  50% { opacity: 0.55; }
}

/* Кнопка «Апгрейд»: красный слой лежит под текстом и плавно проявляется при риске */
#spin-btn {
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.15s, opacity 0.2s, color 0.35s, box-shadow 0.35s;
}

#spin-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #ff6b88 0%, var(--risk) 45%, #d81b40 100%);
  opacity: 0;
  transition: opacity 0.35s;
}

#spin-btn.risky {
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--glow-risk);
}

#spin-btn.risky::before {
  opacity: 1;
}

#spin-btn.risky:disabled {
  box-shadow: none;
}

/* ---------- 14. Ставка и слоты ---------- */
.stake-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 32px;
  margin-bottom: var(--sp-2);
}

.stake-sum {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stake-sum b {
  font-family: var(--font-display);
  color: var(--yellow);
}

/* «(2 подарка + 250 ⭐)» переносится на новую строку целиком, а не по кусочкам */
.stake-detail {
  white-space: nowrap;
}

.slots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--sp-2);
}

.slot {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 160px;
  padding: 28px var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
  border: 1.5px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.15s, opacity 0.2s;
}

.slot:active {
  transform: scale(0.97);
}

.slot.filled {
  border-style: solid;
  border-color: var(--glow);
  background: var(--card-bg);
  box-shadow: 0 0 16px -4px var(--glow), inset 0 0 22px -12px var(--glow);
}

/* Цель дешевле ставки — красная пунктирная рамка */
.slot.invalid {
  border-style: dashed;
  border-color: var(--risk);
  box-shadow: none;
}

.slot-label {
  position: absolute;
  top: var(--sp-2);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Счётчик «3/6» в углу слота ставки */
.slot-count {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--acid);
  color: var(--on-acid);
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.slot-emoji {
  width: 68px;
  height: 68px;
  font-size: 48px;
  line-height: 1.1;
  filter: drop-shadow(0 0 10px var(--glow));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  50% { transform: translateY(-4px); }
}

.slot-plus {
  font-size: 34px;
  line-height: 1;
  color: #444;
}

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

.slot-sub {
  font-size: 10px;
  color: #5c5c5c;
}

.slot-name {
  max-width: 100%;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-price {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--yellow);
}

/* Несколько подарков в ставке — сетка маленьких карточек */
.stake-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  max-width: 132px;
}

.stake-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 96px;
}

.mini {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 22px;
}

.mini .gift-icon {
  filter: drop-shadow(0 0 5px var(--glow));
}

/* Только что добавленный подарок «выскакивает» */
.mini.new {
  animation: pop 0.45s var(--ease-spring);
}

.slots-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
}

.slots-arrow {
  font-size: 20px;
  color: var(--acid);
  text-shadow: 0 0 10px var(--acid);
}

.slots-ratio {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--yellow);
}

/* ---------- 15. Кнопки множителей ---------- */
.multipliers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.mult-btn {
  padding: 11px 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--field-bg);
  box-shadow: var(--shadow-inset);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--yellow);
  transition: transform 0.15s, opacity 0.2s;
}

.mult-btn:active {
  transform: scale(0.94);
}

/* ---------- 16. История ---------- */
.history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--acid);
}

.history-item.lose {
  border-left-color: var(--red);
}

.h-icons {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
  font-size: var(--fs-md);
  color: var(--muted);
}

/* иконка ставки + значок «+2», если подарков было несколько */
.h-stack {
  position: relative;
}

.more-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--yellow);
  color: var(--on-acid);
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
}

.h-info {
  flex: 1;
  min-width: 0;
  padding-left: var(--sp-1);
}

.h-names {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-chance {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.h-result {
  font-size: var(--fs-xl);
}

/* ---------- 17. Магазин ---------- */
/* Переключатель-«таблетка» (магазин, топ). --count — сколько кнопок,
   --idx — номер активной (ставит app.js), «капелька» переезжает под неё. */
.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--count, 2), minmax(0, 1fr));
  margin: var(--sp-4) 0 14px;
  padding: var(--sp-1);
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--field-bg);
}

.segmented-pill {
  position: absolute;
  top: var(--sp-1);
  bottom: var(--sp-1);
  left: var(--sp-1);
  width: calc((100% - 8px) / var(--count, 2));
  border-radius: 14px;
  border: 1px solid rgba(57, 255, 20, 0.4);
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.24), rgba(57, 255, 20, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 14px rgba(57, 255, 20, 0.2);
  transform: translateX(calc(var(--idx, 0) * 100%));
  transition: transform 0.45s var(--ease-spring);
}

.segment {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 10px var(--sp-1);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s;
}

.segmented-3 .segment {
  font-size: var(--fs-sm);
}

.segment.active {
  color: var(--acid);
}

/* ---------- 18. Инвентарь ---------- */
.inv-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: 14px;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.35);
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.12), rgba(212, 255, 0, 0.04));
  box-shadow: var(--glow-acid-soft), var(--shadow-inset);
}

.inv-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--sp-1);
}

.inv-total {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--acid);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

.inv-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
}

.inv-count {
  font-size: 13px;
  color: var(--muted);
}

/* Чипсы сортировки */
.chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  margin-bottom: 14px;
  scrollbar-width: none;
}

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

.chip {
  flex-shrink: 0;
  padding: var(--sp-2) 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--card-border);
  background: var(--field-bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: transform 0.15s;
}

.chip:active {
  transform: scale(0.94);
}

.chip.active {
  color: var(--on-acid);
  background: var(--acid);
  border-color: var(--acid);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

/* Когда инвентарь пуст — прячем сортировку и «Продать всё» */
.inv-is-empty .chips,
.inv-is-empty #sell-all {
  display: none;
}

/* ---------- 19. Друзья, поддержка, пункты меню ---------- */
.hero-card {
  padding: var(--sp-5) 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.3);
  background:
    radial-gradient(circle at 50% 0%, rgba(57, 255, 20, 0.18), transparent 70%),
    var(--card-bg);
  text-align: center;
}

.hero-icon {
  font-size: 52px;
}

.hero-title {
  margin: var(--sp-2) 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.hero-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.hero-text b {
  color: var(--acid);
}

.ref-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: var(--sp-3);
}

.link-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: 10px;
  padding: var(--sp-3) 14px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(57, 255, 20, 0.35);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--muted);
}

.link-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: var(--fs-sm);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-row .btn {
  padding-left: var(--sp-2);
  padding-right: var(--sp-2);
}

.note,
.demo-note {
  margin-top: 14px;
  padding: var(--sp-3) 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}

.demo-note {
  margin: 0 0 var(--sp-2);
  border: 1px dashed rgba(212, 255, 0, 0.3);
  color: var(--yellow);
  opacity: 0.85;
}

/* Строка-пункт меню («Поддержка ›») */
.menu-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  margin-top: var(--sp-3);
  padding: 14px var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  text-align: left;
  transition: transform 0.15s;
}

.menu-row:active {
  transform: scale(0.98);
}

.menu-icon {
  font-size: 20px;
}

.menu-text {
  flex: 1;
  font-weight: 600;
}

.menu-arrow {
  font-size: 22px;
  color: var(--muted);
}

/* FAQ — раскрывающиеся вопросы */
.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px var(--sp-4);
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-md);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--acid);
  transition: transform 0.25s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 var(--sp-4) 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  animation: fade-in 0.3s;
}

/* ---------- 20. Профиль и карточки статистики ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  min-width: 0;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-inset);
}

/* В окнах карточки появляются по очереди при каждом открытии */
.stats-grid .stat-card {
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 60ms + 120ms);
}

.stat-card.wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 36px;
  height: 36px;
  margin-bottom: var(--sp-2);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: var(--fs-xl);
  border: 1px solid rgba(57, 255, 20, 0.25);
  background: rgba(57, 255, 20, 0.1);
}

.stat-card.wide .stat-icon {
  margin-bottom: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--acid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.best-emoji {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  font-size: 40px;
  filter: drop-shadow(0 0 10px var(--glow));
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: 18px;
  text-align: center;
}

.avatar-big {
  width: 84px;
  height: 84px;
  margin-bottom: 6px;
  font-size: 36px;
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.5);
}

.profile-big-name {
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-badge {
  margin-top: 6px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid rgba(57, 255, 20, 0.45);
  background: rgba(57, 255, 20, 0.1);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--acid);
}

.me-tag {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--acid);
}

/* ---------- 21. Топ игроков ---------- */
/* Аватарка игрока: инициалы на цветном градиенте (+ фото поверх, если есть) */
.p-avatar {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1, #444), var(--c2, #222));
  color: #0a0a0a;
  font-family: var(--font-display);
  font-weight: 700;
}

.p-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.av-sm { width: 40px; height: 40px; font-size: 13px; }
.av-lg { width: 58px; height: 58px; font-size: 18px; }
.av-xl { width: 76px; height: 76px; font-size: 24px; }

/* Пьедестал: 2 — 1 — 3 */
.podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: var(--sp-2);
  margin: var(--sp-6) 0 var(--sp-4);
}

.podium-place {
  --medal: var(--silver);
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: card-in 0.5s var(--ease-out) backwards;
  transition: transform 0.15s;
}

.podium-place:active {
  transform: scale(0.96);
}

.place-1 { --medal: var(--gold);   animation-delay: 0.05s; }
.place-2 { animation-delay: 0.15s; }
.place-3 { --medal: var(--bronze); animation-delay: 0.25s; }

/* Светящаяся рамка цвета медали вокруг аватарки */
.podium-place .p-avatar {
  border: 3px solid var(--medal);
  box-shadow: 0 0 18px -2px var(--medal);
}

.podium-place.me .p-avatar {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

/* Корона у первого места (покачивается) */
.crown {
  position: absolute;
  top: -26px;
  z-index: 1;
  width: 34px;
  height: 34px;
  animation: crown-bob 2.4s ease-in-out infinite;
}

.crown svg {
  width: 100%;
  height: 100%;
  fill: var(--gold);
  filter: drop-shadow(0 0 8px rgba(255, 213, 74, 0.8));
}

@keyframes crown-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-4px) rotate(6deg); }
}

.podium-name {
  max-width: 100%;
  font-size: var(--fs-sm);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.podium-place.me .podium-name {
  color: var(--acid);
}

.podium-value {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--yellow);
  white-space: nowrap;
}

/* Ступенька пьедестала */
.podium-base {
  width: 100%;
  display: grid;
  place-items: start center;
  padding-top: 10px;
  border-radius: var(--r-md) var(--r-md) 6px 6px;
  border: 1px solid var(--medal);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 24px -10px var(--medal), 0 0 18px -8px var(--medal);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--medal);
  text-shadow: 0 0 10px var(--medal);
}

.place-1 .podium-base { height: 92px; }
.place-2 .podium-base { height: 68px; }
.place-3 .podium-base { height: 54px; }

/* Список остальных мест */
.top-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.top-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  text-align: left;
  animation: card-in 0.4s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 25ms);
  transition: transform 0.15s;
}

.top-row:active {
  transform: scale(0.98);
}

/* Это я — кислотная подсветка */
.top-row.me {
  border-color: rgba(57, 255, 20, 0.6);
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.18), rgba(57, 255, 20, 0.04));
  box-shadow: var(--glow-acid-soft);
}

.top-place {
  flex-shrink: 0;
  width: 26px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--muted);
}

.top-row.me .top-place {
  color: var(--acid);
}

.top-info {
  flex: 1;
  min-width: 0;
}

.top-name,
.top-username {
  display: block; /* имя и ник — на разных строках */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-name {
  font-weight: 700;
  font-size: var(--fs-md);
}

.top-username {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.top-value {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--yellow);
  white-space: nowrap;
}

/* Чтобы плашка «Ваше место» не закрывала последний ряд */
#tab-top {
  padding-bottom: 64px;
}

/* Плашка «Ваше место: #N» над нижним меню */
.me-bar {
  position: fixed;
  z-index: 55;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: calc(var(--nav-h) + 18px + var(--safe-bottom));
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  border-radius: var(--r-lg);
  border-color: rgba(57, 255, 20, 0.55);
  font-weight: 600;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease-spring);
}

.me-bar.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.me-bar-label {
  color: var(--muted);
}

.me-bar-place {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--acid);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.me-bar-value {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--yellow);
  white-space: nowrap;
}

/* ---------- 22. Нижняя навигация: парящая стеклянная капсула ---------- */
.bottom-nav {
  position: fixed;
  z-index: 60;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: calc(10px + var(--safe-bottom));
  max-width: 456px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(var(--tabs), minmax(0, 1fr));
  --tabs: 6;  /* сколько вкладок в меню (Апгрейд, Кейсы, Магазин, Топ, Инвентарь, Друзья) */
  border-radius: var(--r-xl);
  transition: opacity 0.2s;
}

/* «Капелька» под активной вкладкой. --active — номер вкладки (0–5),
   его выставляет app.js, и капелька плавно «перетекает» с пружинкой. */
.nav-drop {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: calc((100% - 12px) / var(--tabs));
  transform: translateX(calc(var(--active, 0) * 100%));
  transition: transform 0.5s var(--ease-spring);
}

.nav-drop-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.4);
  background: linear-gradient(180deg, rgba(57, 255, 20, 0.24), rgba(57, 255, 20, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 18px rgba(57, 255, 20, 0.25);
}

/* Во время перехода капелька растягивается, как жидкость */
.nav-drop-inner.squish {
  animation: squish 0.5s ease;
}

@keyframes squish {
  40% { transform: scaleX(1.3) scaleY(0.85); }
}

.nav-btn {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s;
}

.nav-btn > span:not(.nav-badge) {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--ease-spring);
}

/* Части иконок вращаются вокруг своего центра */
.nav-btn svg g {
  transform-box: fill-box;
  transform-origin: center;
}

.nav-btn.active {
  color: var(--acid);
}

.nav-btn.active svg {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.7));
}

/* --- Анимации активной вкладки: движение в начале, потом пауза, и снова --- */
.nav-btn.active .i-wheel { animation: i-wheel 4s var(--ease-out) infinite; }
.nav-btn.active .i-bag   { animation: i-bag 3.5s ease infinite; }
.nav-btn.active .i-cup   { animation: i-cup 3.5s ease-in-out infinite; transform-origin: 50% 100%; }
.nav-btn.active .i-lid   { animation: i-lid 3.5s ease infinite; transform-origin: 0% 100%; }
.nav-btn.active .i-head  { animation: i-head 3.5s ease-in-out infinite; }
.nav-btn.active .i-case  { animation: i-case 3.2s ease-in-out infinite; transform-origin: 50% 100%; }

/* кейс подрагивает, будто вот-вот откроется */
@keyframes i-case {
  0%, 45%, 100% { transform: rotate(0) scale(1); }
  8%            { transform: rotate(-9deg) scale(1.06); }
  16%           { transform: rotate(8deg) scale(1.06); }
  24%           { transform: rotate(-5deg) scale(1.03); }
  32%           { transform: rotate(3deg) scale(1); }
}

/* колесо апгрейда проворачивается */
@keyframes i-wheel {
  0%        { transform: rotate(0); }
  35%, 100% { transform: rotate(360deg); }
}

/* магазин подпрыгивает */
@keyframes i-bag {
  0%, 30%, 100% { transform: translateY(0) scaleY(1); }
  8%            { transform: translateY(-4px) scaleY(1.06); }
  16%           { transform: translateY(0) scaleY(0.92); }
  22%           { transform: translateY(-1.5px) scaleY(1); }
}

/* кубок качается */
@keyframes i-cup {
  0%, 40%, 100% { transform: rotate(0); }
  10%           { transform: rotate(-14deg); }
  20%           { transform: rotate(10deg); }
  30%           { transform: rotate(-5deg); }
}

/* у сундука открывается крышка */
@keyframes i-lid {
  0%, 40%, 100% { transform: rotate(0) translateY(0); }
  12%, 26%      { transform: rotate(-24deg) translateY(-1px); }
}

/* голова кивает */
@keyframes i-head {
  0%, 36%, 100% { transform: translateY(0); }
  9%, 27%       { transform: translateY(1.6px); }
  18%           { transform: translateY(-0.6px); }
}

/* Счётчик предметов на иконке инвентаря */
.nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 4px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--acid);
  color: var(--on-acid);
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
}

/* «Выскакивание» значка с отскоком (bounce) */
.pop {
  animation: pop 0.5s var(--ease-spring);
}

@keyframes pop {
  0%   { transform: scale(0.4); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ---------- 23. Нижние окна (bottom sheet) и диалоги ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.sheet.open {
  display: flex;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: fade-in 0.25s both;
}

.sheet-panel {
  width: calc(100% - 16px);
  max-width: 464px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-bottom: calc(var(--sp-2) + var(--safe-bottom));
  padding: 10px var(--sp-4) 20px;
  border-radius: 30px;
  background: rgba(22, 22, 22, 0.82); /* темнее обычного стекла — чтобы текст хорошо читался */
  animation: sheet-up 0.45s var(--ease-spring) both;
}

/* Закрытие — окно уезжает вниз */
.sheet.closing .sheet-panel {
  animation: sheet-down 0.25s ease-in both;
}

.sheet.closing .sheet-backdrop {
  animation: fade-out 0.25s both;
}

@keyframes sheet-up   { from { transform: translateY(110%); } }
@keyframes sheet-down { to   { transform: translateY(110%); } }
@keyframes fade-in    { from { opacity: 0; } }
@keyframes fade-out   { to   { opacity: 0; } }

.sheet-handle {
  width: 40px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-head h3 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.sheet-panel .btn-glass {
  margin-top: var(--sp-4);
}

/* Диалог по центру экрана (окно «Скоро») */
.sheet-center {
  z-index: 120;
  align-items: center;
  padding: var(--sp-4);
}

.sheet-center .sheet-panel {
  width: 100%;
  max-width: 340px;
  margin: 0;
  padding: var(--sp-5) var(--sp-5) 20px;
  text-align: center;
  animation: dialog-in 0.45s var(--ease-spring) both;
}

.sheet-center.closing .sheet-panel {
  animation: dialog-out 0.2s ease-in both;
}

@keyframes dialog-in  { from { opacity: 0; transform: scale(0.85) translateY(10px); } }
@keyframes dialog-out { to   { opacity: 0; transform: scale(0.9); } }

.dialog-icon {
  font-size: 56px;
  animation: rocket 1.8s ease-in-out infinite;
}

@keyframes rocket {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-8px) rotate(4deg); }
}

.dialog-title {
  margin-top: var(--sp-3);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.35;
}

.dialog-text {
  margin-top: var(--sp-2);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* --- Окно выбора предмета --- */
.picker-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

[data-pick] {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.picker-grid .card {
  padding-top: 14px;
  gap: var(--sp-1);
}

.picker-grid .rarity-tag {
  display: none;
}

.picker-grid .card-emoji {
  width: 54px;
  height: 54px;
  font-size: 36px;
}

.picker-grid .card-name {
  font-size: var(--fs-sm);
}

.pick-chance {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--acid);
}

/* Галочка у выбранного подарка (мульти-ставка) */
.pick-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--acid);
  color: var(--on-acid);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.7);
  transform: scale(0);
  transition: transform 0.3s var(--ease-spring);
}

[data-pick].picked .pick-check {
  transform: scale(1);
}

[data-pick].picked .card::before {
  opacity: 1;
  border-color: var(--acid);
}

/* Низ окна выбора — прилипает к краю при прокрутке */
.picker-footer {
  position: sticky;
  bottom: -20px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) calc(var(--sp-4) * -1) -20px;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--card-border);
  background: rgba(22, 22, 22, 0.96);
}

.picker-summary {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.picker-summary b {
  color: var(--yellow);
}

/* --- Окно пополнения --- */
.packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) 6px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-inset);
  transition: transform 0.15s, opacity 0.2s;
}

.pack:active {
  transform: scale(0.94);
}

.pack.popular {
  border-color: rgba(57, 255, 20, 0.55);
  box-shadow: 0 0 16px -4px var(--acid), var(--shadow-inset);
}

/* Пакет, который сейчас «оплачивается» */
.pack.loading {
  pointer-events: none;
  opacity: 0.6;
}

.pack.loading .pack-amount {
  animation: risk-blink 0.8s ease-in-out infinite;
}

.pack-badge {
  position: absolute;
  top: -8px;
  padding: 2px var(--sp-2);
  border-radius: 8px;
  background: var(--acid);
  color: var(--on-acid);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.pack-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--yellow);
}

.pack-label {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.custom-row {
  display: flex;
  gap: var(--sp-2);
  margin-top: 14px;
}

.custom-row .btn {
  flex-shrink: 0;
  padding: 0 18px;
}

.input {
  flex: 1;
  min-width: 0;
  padding: 14px var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 600 16px var(--font-body); /* 16px — иначе iPhone приближает экран */
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--acid);
}

.test-note {
  margin-top: 14px;
  padding: 10px var(--sp-3);
  border-radius: 14px;
  border: 1px dashed rgba(212, 255, 0, 0.35);
  background: rgba(212, 255, 0, 0.07);
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--yellow);
}

/* ---------- 24. Окно выигрыша ---------- */
.win-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + var(--safe-bottom));
  text-align: center;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.win-overlay.open {
  display: flex;
  animation: fade-in 0.3s both;
}

.win-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  color: var(--acid);
  text-shadow: 0 0 10px var(--acid), 0 0 30px rgba(57, 255, 20, 0.7), 0 0 60px rgba(57, 255, 20, 0.4);
  animation: title-in 0.6s var(--ease-spring) both, neon-flicker 3s 0.8s infinite;
}

@keyframes title-in {
  from { opacity: 0; transform: scale(0.6) translateY(-20px); }
}

/* Неоновая вывеска иногда «моргает» */
@keyframes neon-flicker {
  0%, 46%, 50%, 54%, 100% { opacity: 1; }
  48%, 52%                { opacity: 0.6; }
}

.win-stage {
  position: relative;
  width: 240px;
  height: 240px;
  margin: var(--sp-4) 0;
  display: grid;
  place-items: center;
}

/* Лучи света цвета редкости — два слоя крутятся в разные стороны */
.win-rays {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--glow) 0deg 6deg, transparent 6deg 24deg);
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 70%);
  mask-image: radial-gradient(circle, #000 15%, transparent 70%);
  animation: spin 14s linear infinite;
}

.win-rays-2 {
  inset: -20px;
  background: repeating-conic-gradient(#ffffff 0deg 3deg, transparent 3deg 30deg);
  opacity: 0.1;
  animation: spin 22s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Пульсирующий ореол */
.win-halo {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  opacity: 0.45;
  animation: halo 2.4s ease-in-out infinite;
}

@keyframes halo {
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* Частицы: разлетаются из центра. --a угол, --d расстояние, --s размер */
.win-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
  background: var(--glow);
  box-shadow: 0 0 8px var(--glow);
  opacity: 0;
  animation: particle 2.4s ease-out var(--delay) infinite;
}

.particle:nth-child(3n) {
  background: #ffffff;
}

@keyframes particle {
  0%   { opacity: 0; transform: rotate(var(--a)) translateY(-20px) scale(0.3); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(1); }
}

/* Подарок вылетает снизу с вращением, потом покачивается */
.win-gift {
  position: relative;
  font-size: 120px;
  line-height: 1;
  animation: gift-fly 1s var(--ease-spring) 0.15s both;
}

.win-gift-inner {
  display: block;
  width: 170px;
  height: 170px;
  animation: gift-sway 3s ease-in-out 1.2s infinite;
}

/* Свечение цветом редкости вокруг большой картинки */
.win-gift .gift-icon {
  filter: drop-shadow(0 0 18px var(--glow));
}

@keyframes gift-fly {
  from { opacity: 0; transform: translateY(160px) scale(0.2) rotate(-220deg); }
}

@keyframes gift-sway {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50%      { transform: rotate(8deg) translateY(-10px); }
}

.win-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  animation: card-in 0.5s var(--ease-out) 0.6s backwards;
}

.win-price {
  margin-top: var(--sp-1);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--yellow);
  animation: card-in 0.5s var(--ease-out) 0.7s backwards;
}

.win-buttons {
  width: 100%;
  max-width: 340px;
  margin-top: var(--sp-3);
  animation: card-in 0.5s var(--ease-out) 0.85s backwards;
}

.win-buttons .btn-big {
  margin-top: 10px;
  font-size: var(--fs-md);
  padding: var(--sp-4);
}

/* ---------- 25. Всплывающие уведомления (стекло) ---------- */
.toasts {
  position: fixed;
  top: var(--sp-3);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  width: calc(100% - 32px);
  max-width: 448px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-3) 14px;
  border-radius: 20px;
  background: rgba(28, 28, 28, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-inset-strong), var(--shadow-float);
  font-size: var(--fs-md);
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px) scale(0.96);
  transition: transform 0.35s var(--ease-spring), opacity 0.3s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-success { border-color: rgba(57, 255, 20, 0.55); }
.toast-error   { border-color: rgba(255, 59, 59, 0.6); }
.toast-info    { border-color: rgba(212, 255, 0, 0.5); }

.toast-icon {
  font-size: var(--fs-xl);
}

/* ---------- 26. Эффекты победы / проигрыша ---------- */
.flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
}

.flash.win {
  background: radial-gradient(circle, rgba(57, 255, 20, 0.45), transparent 70%);
  animation: flash 0.9s ease-out;
}

.flash.lose {
  background: radial-gradient(circle, rgba(255, 59, 59, 0.45), transparent 70%);
  animation: flash 0.9s ease-out;
}

@keyframes flash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Тряска (экран при проигрыше, карточка при ошибке) */
.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  10%, 90%      { transform: translateX(-2px); }
  20%, 80%      { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60%      { transform: translateX(6px); }
}

/* Конфетти — маленькие падающие прямоугольники (поверх окна выигрыша) */
.confetti {
  position: fixed;
  top: -16px;
  z-index: 350;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to { transform: translate(var(--drift), 110vh) rotate(var(--rot)); }
}

/* ---------- 27. Новые блоки апгрейдера ---------- */

/* Переключатель-тумблер (как в iOS) */
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s var(--ease-spring);
}

.switch:checked {
  border-color: var(--acid);
  background: var(--acid);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.switch:checked::after {
  transform: translateX(18px);
}

/* Ползунок (range). --fill — сколько закрашено (ставит app.js),
   --range-color — цвет (кислотный или красный при высоком риске) */
.range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 24px;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
  --range-color: var(--acid);
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--range-color) var(--fill), rgba(255, 255, 255, 0.12) var(--fill));
}

.range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--range-color) var(--fill), rgba(255, 255, 255, 0.12) var(--fill));
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  border: 3px solid var(--range-color);
  background: #ffffff;
  box-shadow: 0 0 10px var(--range-color);
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--range-color);
  background: #ffffff;
  box-shadow: 0 0 10px var(--range-color);
}

.range:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.range.risky {
  --range-color: var(--risk);
}

/* Сторона зоны + «Быстро» */
.wheel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.wheel-controls .segmented {
  flex: 1;
  max-width: 220px;
  margin: 0;
}

.segmented-sm .segment {
  padding: 7px var(--sp-1);
  font-size: var(--fs-sm);
}

.segmented-sm .segmented-pill {
  border-radius: var(--r-sm);
}

.switch-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* Звёзды в ставку */
.stars-stake {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  border: 1px solid rgba(212, 255, 0, 0.25);
  background: linear-gradient(160deg, rgba(212, 255, 0, 0.07), rgba(255, 255, 255, 0.02));
}

.ss-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: 13px;
}

.ss-title {
  font-weight: 700;
}

.ss-balance {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.ss-balance b {
  color: var(--yellow);
}

.ss-row {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.ss-input {
  padding: 10px 14px;
  font-family: var(--font-display);
  color: var(--yellow);
}

.ss-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-1);
}

.ss-quick .chip {
  padding: 6px 10px;
  font-size: var(--fs-sm);
  color: var(--yellow);
}

/* Звёзды в слоте ставки */
.mini-stars {
  gap: 0;
  border-color: rgba(212, 255, 0, 0.45);
  background: rgba(212, 255, 0, 0.08);
  color: var(--yellow);
  font-size: 14px;
  line-height: 1;
}

.mini-stars b {
  font-family: var(--font-display);
  font-size: 9px;
}

.slot-star {
  font-size: 52px;
  line-height: 1.1;
  filter: drop-shadow(0 0 12px rgba(212, 255, 0, 0.7));
  animation: float 3s ease-in-out infinite;
}

/* Подбор цели по шансу */
.chance-picker {
  margin-top: var(--sp-3);
  padding: 10px var(--sp-3) 6px;
  border-radius: var(--r-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.cp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.cp-head b {
  font-family: var(--font-display);
  color: var(--acid);
  transition: color 0.3s;
}

.chance-picker.risky .cp-head b {
  color: var(--risk);
}

/* Заголовок раздела + заметка справа (таймер, счётчик) */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.section-note {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Полоска прогресса (заполняется через transform: scaleX) */
.progress {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acid), var(--yellow));
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.6s var(--ease-out);
}

/* Ежедневные задания */
.quests {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.quest {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.quest.done {
  border-color: rgba(57, 255, 20, 0.5);
  box-shadow: var(--glow-acid-soft);
}

.quest.claimed {
  opacity: 0.55;
}

.quest-icon {
  flex-shrink: 0;
  font-size: 24px;
}

.quest-body {
  flex: 1;
  min-width: 0;
}

.quest-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.quest-meta {
  display: flex;
  justify-content: space-between;
  margin: var(--sp-1) 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.quest .btn {
  flex-shrink: 0;
  padding: var(--sp-2) 10px;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.quest-reward {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--yellow);
}

/* Уровень в профиле */
.level-box {
  width: 100%;
  max-width: 280px;
  margin-top: var(--sp-3);
}

.level-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
}

.level-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--acid);
}

.level-xp {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.level-box .progress {
  height: 8px;
  border-radius: 4px;
}

/* Достижения */
.achievements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.ach {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  opacity: 0.45;
  filter: grayscale(1);
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 40ms + 200ms);
}

.ach.got {
  opacity: 1;
  filter: none;
  border-color: rgba(255, 213, 74, 0.5);
  box-shadow: 0 0 14px -6px var(--gold);
}

.ach-icon {
  flex-shrink: 0;
  font-size: 24px;
}

.ach-title {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.ach-desc {
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}

/* Настройки */
.settings {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
}

.setting-icon {
  font-size: 20px;
}

.setting-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.setting-text small {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
}

/* Окно выбора цели */
.search-input {
  width: 100%;
  margin-bottom: var(--sp-3);
}

.chips-tight {
  margin-bottom: var(--sp-2);
}

.target-info {
  margin: var(--sp-1) 0 var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.target-info b {
  color: var(--yellow);
}

.pick-chance.low {
  color: var(--risk);
}

.pick-chance.muted {
  font-weight: 600;
  color: var(--muted);
}

[data-target] {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

[data-target].too-cheap {
  opacity: 0.4;
}

[data-target].picked .pick-check {
  transform: scale(1);
}

[data-target].picked .card::before {
  opacity: 1;
  border-color: var(--acid);
}

/* Кнопки внизу диалога */
.dialog-buttons {
  margin-top: var(--sp-4);
}

/* Кнопки окна выигрыша: «дальше» крупно, «оставить/продать» в ряд */
.win-buttons .btn-row {
  margin-top: 10px;
}

.win-buttons .btn-row .btn {
  padding: 14px var(--sp-2);
}

/* Невысокие экраны: окно выигрыша чуть компактнее */
@media (max-height: 720px) {
  .win-stage {
    width: 200px;
    height: 200px;
    margin: var(--sp-2) 0;
  }

  .win-gift-inner {
    width: 140px;
    height: 140px;
  }

  .win-title {
    font-size: 26px;
  }
}

/* Плашка достижения / нового уровня (выезжает сверху) */
.banner {
  position: fixed;
  z-index: 450;
  top: calc(var(--sp-3) + env(safe-area-inset-top));
  left: 50%;
  width: calc(100% - 32px);
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  border-color: rgba(255, 213, 74, 0.6);
  box-shadow: 0 0 24px -4px rgba(255, 213, 74, 0.6), var(--shadow-float);
  opacity: 0;
  transform: translate(-50%, -140%);
  pointer-events: none;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s;
}

.banner.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.banner-icon {
  font-size: 34px;
  animation: float 2s ease-in-out infinite;
}

.banner-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--gold);
}

.banner-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Экран «Открой приложение через Telegram» / «Сервер недоступен» */
.gate {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(57, 255, 20, 0.14), transparent 55%),
    var(--bg);
  animation: fade-in 0.4s both;
}

.gate-icon {
  font-size: 64px;
  animation: float 3s ease-in-out infinite;
}

.gate-title {
  max-width: 320px;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.3;
  color: var(--acid);
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.5);
}

.gate-text {
  max-width: 300px;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--muted);
}

.gate .btn {
  margin-top: var(--sp-2);
}

/* «+250 ⭐» вылетает из баланса после пополнения */
.float-plus {
  position: fixed;
  z-index: 460;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--acid);
  text-shadow: 0 0 12px var(--acid), 0 0 30px rgba(57, 255, 20, 0.6);
  pointer-events: none;
  animation: float-plus 1.6s var(--ease-out) forwards;
}

@keyframes float-plus {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, 60px) scale(1); }
}

/* Пустая живая лента */
.live-empty {
  padding: 18px var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Блокировка во время прокрутки колеса ---------- */
body.is-spinning .app button,
body.is-spinning .app input {
  pointer-events: none; /* ни одна кнопка и ползунок не нажимаются */
}

body.is-spinning .bottom-nav,
body.is-spinning .multipliers,
body.is-spinning .slot,
body.is-spinning .stake-bar,
body.is-spinning .stars-stake,
body.is-spinning .chance-picker,
body.is-spinning .wheel-controls {
  opacity: 0.45;
}

/* ---------- 27а. Плашка «Пополни баланс, чтобы начать» ---------- */
.start-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(212, 255, 0, 0.6);
  background:
    radial-gradient(circle at 0% 50%, rgba(212, 255, 0, 0.28), transparent 60%),
    linear-gradient(135deg, rgba(57, 255, 20, 0.2), rgba(57, 255, 20, 0.04));
  box-shadow: 0 0 24px -6px rgba(212, 255, 0, 0.6), var(--shadow-inset-strong);
  animation: card-in 0.45s var(--ease-out) backwards, start-pulse 2.4s ease-in-out infinite;
}

/* Блик, который пробегает по плашке */
.start-card::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.14), transparent 70%);
  animation: shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes start-pulse {
  50% { box-shadow: 0 0 34px -4px rgba(212, 255, 0, 0.85), var(--shadow-inset-strong); }
}

.start-icon {
  flex-shrink: 0;
  font-size: 34px;
  filter: drop-shadow(0 0 10px rgba(212, 255, 0, 0.8));
  animation: float 2s ease-in-out infinite;
}

.start-text {
  flex: 1;
  min-width: 0;
}

.start-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.3;
  color: var(--yellow);
}

.start-sub {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.start-card .btn {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 11px 14px;
  font-size: 13px;
}

/* ---------- 27б. Пакеты пополнения: появление по очереди и широкая последняя карточка ---------- */
.sheet.open .pack {
  animation: card-in 0.4s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 40ms + 80ms);
}

/* Последний пакет, если он остался один в ряду, — на всю ширину, цифра и подпись в строку */
.pack-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: 4px;
  border-color: rgba(212, 255, 0, 0.45);
  background:
    radial-gradient(circle at 50% 0%, rgba(212, 255, 0, 0.16), transparent 70%),
    var(--card-bg);
}

.pack-wide .pack-amount {
  font-size: var(--fs-2xl);
}

.pack-wide .pack-label {
  font-size: var(--fs-md);
}

.pack-wide .pack-badge {
  background: var(--yellow);
}

/* ---------- 27в. Окно «Вывод подарков» ---------- */
.wd-hero {
  text-align: center;
  margin-bottom: var(--sp-4);
}

.wd-hero-icon {
  font-size: 46px;
  filter: drop-shadow(0 0 12px rgba(57, 255, 20, 0.6));
  animation: float 3s ease-in-out infinite;
}

.wd-title {
  margin-top: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--acid);
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.5);
}

.wd-lead {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.wd-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wd-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 14px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-inset);
}

.sheet.open .wd-step {
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 90ms + 120ms);
}

/* Кружок с номером шага */
.wd-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--on-acid);
  background: linear-gradient(135deg, var(--acid), var(--yellow));
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6);
}

.wd-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid rgba(57, 255, 20, 0.25);
  background: rgba(57, 255, 20, 0.1);
}

.wd-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.wd-text b {
  color: var(--text);
}

/* «Ваш ID: 123456789» + «Скопировать» */
.wd-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 10px 10px 14px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(57, 255, 20, 0.35);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--muted);
}

.wd-id code {
  font-family: monospace;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--acid);
}

.wd-id .btn {
  flex-shrink: 0;
}

.wd-items-note {
  margin-top: 6px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Блок «Куда писать» */
.wd-where {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.3);
  background:
    radial-gradient(circle at 50% 0%, rgba(57, 255, 20, 0.16), transparent 70%),
    var(--card-bg);
  text-align: center;
}

.wd-where-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.wd-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: 6px;
  font-size: var(--fs-xl);
}

.wd-contact b {
  color: var(--acid);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.wd-where .btn-big {
  margin-top: var(--sp-3);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
}

/* ---------- 27г. Админ-панель (красный акцент — сразу видно, что это админка) ---------- */
.admin-btn {
  color: var(--red);
  border-color: rgba(255, 59, 59, 0.55);
  background: rgba(255, 59, 59, 0.12);
  box-shadow: 0 0 12px rgba(255, 59, 59, 0.35), var(--shadow-inset);
}

.admin-sheet .sheet-panel {
  max-height: 92vh;
  border: 1px solid rgba(255, 59, 59, 0.4);
  box-shadow: 0 0 40px -8px rgba(255, 59, 59, 0.45), var(--shadow-inset-strong);
}

.admin-sheet .sheet-head h3 {
  color: #ff6b6b;
  text-shadow: 0 0 12px rgba(255, 59, 59, 0.6);
}

.admin-sheet .section-title {
  color: #ff8a8a;
}

.admin-sheet .stat-icon {
  border-color: rgba(255, 59, 59, 0.3);
  background: rgba(255, 59, 59, 0.1);
}

.admin-sheet .stat-value {
  color: var(--text);
}

.admin-sheet .input:focus {
  border-color: var(--red);
}

.admin-warning {
  padding: 10px var(--sp-3);
  border-radius: 14px;
  border: 1px dashed rgba(255, 59, 59, 0.45);
  background: rgba(255, 59, 59, 0.08);
  font-size: var(--fs-sm);
  color: #ff8a8a;
}

/* Красная главная кнопка админки */
.btn-admin {
  padding: 12px var(--sp-4);
  background: linear-gradient(180deg, #ff8080 0%, var(--red) 45%, #d61f1f 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 16px rgba(255, 59, 59, 0.45);
}

.btn-admin.loading::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

.admin-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.admin-chip {
  padding: 12px 4px;
  border: 1px solid rgba(255, 59, 59, 0.45);
  background: rgba(255, 59, 59, 0.1);
  color: #ff8a8a;
  font-family: var(--font-display);
  font-size: 13px;
}

.admin-chip.loading::after {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}

.admin-row {
  display: flex;
  gap: var(--sp-2);
  margin-top: 10px;
}

.admin-row .btn {
  flex-shrink: 0;
}

.admin-full {
  width: 100%;
}

/* Выпадающий список подарков */
.admin-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  font-size: 14px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px,
    rgba(255, 255, 255, 0.06);
}

.admin-select option {
  background: #161616;
  color: var(--text);
}

.admin-muted {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Карточка найденного игрока */
.admin-user {
  margin-top: var(--sp-3);
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 59, 59, 0.3);
  background: var(--card-bg);
  animation: card-in 0.4s var(--ease-out) backwards;
}

.admin-user-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-balance {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--yellow);
}

.admin-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-3);
}

.admin-facts span {
  padding: 5px 9px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.05);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.admin-facts b {
  color: var(--text);
}

.admin-sub {
  margin: 14px 0 var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
}

.admin-inv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.admin-inv-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-full);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.admin-inv-img {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.admin-actions {
  margin-top: var(--sp-2);
}

/* Журнал действий */
.admin-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--sp-3);
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.admin-log-icon {
  font-size: 18px;
}

.admin-log-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.admin-log-text small,
.admin-log-meta small {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-log-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Админка: комиссия апгрейда */
.admin-fee {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 59, 59, 0.3);
  background: var(--card-bg);
}

.admin-fee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: 13px;
  color: var(--muted);
}

.admin-fee-head b {
  color: var(--text);
}

.admin-fee-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #ff8a8a;
}

.admin-fee-input {
  flex: none;
  width: 72px;
  padding: 8px 10px;
  text-align: center;
}

/* Ползунок комиссии — красный, как вся админка */
.admin-range {
  --range-color: var(--red);
}

.admin-fee-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.admin-fee-example {
  margin-top: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--muted);
}

.admin-fee-example b {
  color: var(--yellow);
}

.admin-fee-example small {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
}

.admin-fee .btn-wide {
  margin-top: var(--sp-3);
}

/* Админка: таблица заработка (сутки / неделя / всё время) */
.admin-profit {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.ap-row {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ap-row > span:not(.ap-label) {
  text-align: right;
  white-space: nowrap;
}

.ap-label {
  color: var(--muted);
}

.ap-head {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #ff8a8a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ap-total {
  font-size: 13px;
}

.ap-total .pos { color: var(--acid); }
.ap-total .neg { color: var(--red); }

.ap-note {
  margin-top: var(--sp-2);
  line-height: 1.45;
}

/* Админка: кейсы */
.admin-case {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 59, 59, 0.3);
  background: var(--card-bg);
}

.admin-case + .admin-case {
  margin-top: var(--sp-3);
}

.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: 15px;
}

.ac-price-row {
  align-items: center;
}

.ac-price {
  flex: none;
  width: 96px;
  padding: 8px 10px;
  margin-left: auto;
  text-align: center;
}

.ac-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.ac-item-img {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--muted);
}

.ac-item-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item-name small {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.ac-chance {
  flex: none;
  width: 76px;
  padding: 7px 8px;
  font-size: 14px;
  text-align: right;
}

.ac-pct {
  font-size: 12px;
  color: var(--muted);
}

.ac-remove {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.ac-summary,
.ac-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--muted);
}

.ac-stats {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.ac-summary b,
.ac-stats b {
  color: var(--text);
}

.ac-summary .ok b { color: var(--acid); }
.ac-summary .bad,
.ac-summary .bad b { color: var(--red); }
.ac-summary .pos,
.ac-stats .pos { color: var(--acid); }
.ac-summary .neg,
.ac-stats .neg { color: var(--red); }

/* ---------- Админка: цены подарков и рынок ---------- */
.amk-status {
  margin-bottom: var(--sp-2);
  line-height: 1.45;
}

.amk-pending {
  margin: var(--sp-2) 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 43, 214, 0.5);
  background: rgba(255, 43, 214, 0.06);
}

.amk-pending .admin-sub { margin-top: 0; }

.amk-pending-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.amk-pending-row > span { flex: 1; min-width: 0; }

.amk-settings {
  margin: var(--sp-2) 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.amk-settings summary {
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-sm);
}

.amk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: 10px 0;
}

.amk-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.apr-search { margin-top: var(--sp-2); }

.apr-head,
.apr-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 86px 42px 34px;
  align-items: center;
  gap: 6px;
}

.apr-head {
  margin: 10px 0 4px;
  font-size: 11px;
  color: var(--muted);
}

.apr-list .neg,
.amk-pending .neg { color: var(--red); }

.apr-list .pos,
.amk-pending .pos { color: var(--acid); }

.apr-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.apr-img {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.apr-img .gift-icon { width: 30px; height: 30px; font-size: 22px; }

.apr-name {
  min-width: 0;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apr-name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.apr-price {
  padding: 8px 6px;
  font-size: 13px;
  text-align: right;
}

.apr-fixed {
  text-align: center;
  color: var(--muted);
}

.apr-open {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.apr-detail {
  margin-top: var(--sp-2);
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  font-size: var(--fs-sm);
}

.apr-chart {
  display: block;
  width: 100%;
  height: 150px;
}

.apr-hist {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}

.apr-hist span:first-child { color: var(--muted); }
.apr-hist small { margin-left: auto; color: var(--muted); }

/* ---------- 27д. Экран «Подпишись на канал» ---------- */
.sub-gate {
  position: fixed;
  inset: 0;
  z-index: 380; /* поверх всего приложения и окон, но под уведомлениями */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background:
    radial-gradient(circle at 50% 28%, rgba(57, 255, 20, 0.22), transparent 55%),
    rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fade-in 0.35s both;
}

/* Уходит плавно: фон гаснет, карточка уменьшается */
.sub-gate.leaving {
  animation: fade-out 0.6s ease both;
}

.sub-gate.leaving .sub-card {
  animation: dialog-out 0.5s ease-in both;
}

.sub-card {
  width: 100%;
  max-width: 380px;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border-radius: 32px;
  border: 1px solid rgba(57, 255, 20, 0.35);
  box-shadow: 0 0 50px -10px rgba(57, 255, 20, 0.5), var(--shadow-inset-strong);
  text-align: center;
  animation: dialog-in 0.6s var(--ease-spring) both;
}

/* Мегафон с расходящимися кольцами */
.sub-icon {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto var(--sp-4);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.25), rgba(57, 255, 20, 0.04) 70%);
  border: 1px solid rgba(57, 255, 20, 0.4);
}

.sub-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(57, 255, 20, 0.6);
  animation: sub-ring 2.4s ease-out infinite;
}

.sub-ring-2 {
  animation-delay: 1.2s;
}

@keyframes sub-ring {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(1.7); opacity: 0; }
}

.sub-megaphone {
  width: 64px;
  height: 64px;
  overflow: visible;
  fill: none;
  stroke: var(--acid);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.8));
  transform-origin: 30% 60%;
  animation: megaphone 2.4s ease-in-out infinite;
}

.sub-mp-body {
  fill: rgba(57, 255, 20, 0.18);
}

/* «Звуковые» волны мигают по очереди */
.sub-wave {
  stroke: var(--yellow);
  animation: sound-wave 1.2s ease-in-out infinite;
}

.sub-w2 {
  animation-delay: 0.3s;
}

@keyframes megaphone {
  0%, 60%, 100% { transform: rotate(0); }
  10%           { transform: rotate(-10deg); }
  20%           { transform: rotate(8deg); }
  30%           { transform: rotate(-6deg); }
  40%           { transform: rotate(3deg); }
}

.sub-title {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.3;
  color: var(--acid);
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.55);
}

.sub-text {
  margin-top: var(--sp-3);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.sub-card .btn-big {
  margin-top: var(--sp-5);
  text-transform: none;
  letter-spacing: 0;
}

.sub-card .btn-wide {
  margin-top: var(--sp-3);
}

/* ---------- 27е. Нарисованный кейс (сцена: свечение, искры, сундук) и превью «Скоро» ---------- */
.case-stage {
  position: relative;
  width: 240px;
  height: 220px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

/* Кислотное свечение за кейсом — «дышит» */
.case-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(57, 255, 20, 0.45), rgba(212, 255, 0, 0.12) 45%, transparent 70%);
  filter: blur(6px);
  animation: case-glow 3s ease-in-out infinite;
}

@keyframes case-glow {
  50% { transform: scale(1.15); opacity: 0.7; }
}

/* Искры: вылетают из центра в разные стороны (--x, --y) и гаснут */
.case-sparks span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px var(--acid), 0 0 4px #fff;
  opacity: 0;
  animation: case-spark 2.4s ease-out infinite;
  animation-delay: var(--d);
}

@keyframes case-spark {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1.1); opacity: 0; }
}

/* Сам кейс медленно покачивается */
.case-box {
  position: relative;
  width: 170px;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 0 14px rgba(57, 255, 20, 0.55));
  transform-origin: 50% 90%;
  animation: case-rock 4s ease-in-out infinite;
}

@keyframes case-rock {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-6px); }
}

.case-box .case-lid,
.case-box .case-body {
  fill: url(#case-fill);
  stroke: var(--acid);
  stroke-width: 3;
  stroke-linejoin: round;
}

.case-box .case-band {
  fill: none;
  stroke: rgba(57, 255, 20, 0.55);
  stroke-width: 2.5;
}

.case-box .case-plate {
  fill: var(--acid);
  stroke: var(--yellow);
  stroke-width: 2;
}


/* Превью будущих кейсов: размытые, с меткой «Скоро» */
.case-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-preview {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 6px 14px;
  border-radius: 20px;
  /* первая строка — запасной вариант для старых телефонов без color-mix */
  border: 1px solid var(--card-border);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: var(--card-bg);
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%),
    var(--card-bg);
  cursor: not-allowed;
}

.tab.active .case-preview {
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 80ms + 150ms);
}

/* Содержимое карточки размыто — «ещё не открыто» */
.case-mini,
.case-name {
  filter: blur(2.5px);
  opacity: 0.75;
}

.case-mini {
  font-size: 34px;
}

.case-name {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--c);
}

.case-soon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--c);
  color: var(--on-acid);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 14px color-mix(in srgb, var(--c) 70%, transparent);
}

/* ---------- 27ж. Вкладка «Апгрейд»: кнопка видна сразу под колесом ----------
   Порядок: колесо → слоты «Ставка / Цель» → кнопка «Апгрейд».
   Звёзды, множители, ползунок шанса, «Слева/Справа» и история — ниже кнопки. */
#tab-upgrade .live-feed {
  margin-bottom: var(--sp-3);
}

#tab-upgrade .tab-title {
  margin-bottom: var(--sp-2);
}

#tab-upgrade .wheel-wrap {
  margin-bottom: 14px;
}

#tab-upgrade .wheel-hint {
  margin: -4px 0 var(--sp-2);
}

#tab-upgrade #spin-btn {
  margin-top: var(--sp-3);
}

#tab-upgrade .stake-bar {
  margin-top: var(--sp-4);
}

#tab-upgrade .wheel-controls {
  margin: var(--sp-4) 0 0;
}

/* Невысокий экран телефона (~700px): колесо и слоты компактнее.
   zoom уменьшает колесо целиком — вместе со стрелкой и процентом в центре. */
@media (max-height: 820px) {
  #tab-upgrade .wheel-wrap {
    zoom: 0.8;
  }

  #tab-upgrade .slot {
    min-height: 124px;
    padding-top: 24px;
    padding-bottom: var(--sp-2);
  }

  #tab-upgrade .slot-emoji {
    width: 54px;
    height: 54px;
    font-size: 38px;
  }
}

/* Совсем низкий экран: колесо ещё меньше */
@media (max-height: 660px) {
  #tab-upgrade .wheel-wrap {
    zoom: 0.66;
  }

  #tab-upgrade .tab-title {
    font-size: var(--fs-xl);
  }

  #tab-upgrade .slot {
    min-height: 112px;
  }

  #tab-upgrade .live-feed {
    margin-bottom: var(--sp-2);
  }
}

/* ---------- 27з. Окно «Лайв» ---------- */
.live-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.live-counters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.live-counter {
  padding: 10px var(--sp-2);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  text-align: center;
}

.live-counter b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--acid);
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.live-counter span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
  color: var(--muted);
}

/* Фильтры «Все / Апгрейды / Кейсы / Только NFT» — компактные, чтобы влезли в одну строку */
#live-filter {
  gap: 6px;
}

#live-filter .chip {
  flex-shrink: 0;
  padding: 7px 9px;
  font-size: 12px;
  white-space: nowrap;
}

/* Лента в окне «Лайв» — карточки крупнее */
.live-window-big {
  margin-top: var(--sp-3);
}

.live-window-big .drop {
  width: 96px;
  padding: 8px 6px 7px;
}

.live-window-big .drop-img {
  width: 46px;
  height: 46px;
}

.live-window-big .drop-price {
  font-size: 12px;
}

/* Список «Последние дропы» */
.live-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--glow);
  background: var(--card-bg);
}

.live-row.mine {
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.14), rgba(57, 255, 20, 0.02));
}

.live-row.new {
  animation: live-row-in 0.6s var(--ease-spring), drop-flash 1.4s ease-out;
}

@keyframes live-row-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

.lr-img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-size: 28px;
  filter: drop-shadow(0 0 6px var(--glow));
}

.lr-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lr-user {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
}

.lr-user b {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-row.mine .lr-user b {
  color: var(--acid);
}

.lr-info small {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lr-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.lr-right b {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--yellow);
}

.lr-right small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 27и. Вкладка «Кейсы»: список и экран кейса ---------- */
.case-previews-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#cases-home .btn-wide {
  margin-top: var(--sp-4);
}

/* Карточка кейса в списке */
.case-card {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-2);
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.45);
  background:
    radial-gradient(circle at 20% 50%, rgba(57, 255, 20, 0.2), transparent 60%),
    var(--card-bg);
  box-shadow: 0 0 26px -8px rgba(57, 255, 20, 0.6), var(--shadow-inset-strong);
  text-align: left;
  transition: transform 0.15s;
}

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

.tab.active .case-card {
  animation: card-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 80ms + 100ms);
}

.case-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-lg);
  color: var(--acid);
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}

.case-card-sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

.case-card-price {
  align-self: flex-start;
  margin-top: 4px;
  padding: 7px 12px;
  border-radius: var(--r-full);
  background: linear-gradient(180deg, #7dff5e 0%, var(--acid) 45%, #2bd60e 100%);
  color: var(--on-acid);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}

/* Маленькие сцены с кейсом (в карточке и на экране кейса) */
.case-stage-sm {
  flex-shrink: 0;
  width: 112px;
  height: 104px;
  margin: 0;
}

.case-stage-sm .case-box {
  width: 92px;
}

.case-stage-sm .case-glow {
  width: 110px;
  height: 110px;
}

.case-stage-xs {
  width: 84px;
  height: 78px;
  margin: 0;
}

.case-stage-xs .case-box {
  width: 70px;
}

.case-stage-xs .case-glow {
  width: 90px;
  height: 90px;
}

/* Искры у маленьких кейсов летят ближе (половина расстояния) */
.case-stage-sm .case-sparks span,
.case-stage-xs .case-sparks span {
  animation-name: case-spark-sm;
}

@keyframes case-spark-sm {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(calc(var(--x) / 2), calc(var(--y) / 2)) scale(1); opacity: 0; }
}

/* Экран кейса */
.case-back {
  margin-bottom: var(--sp-3);
}

.cv-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.cv-name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--acid);
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.55);
}

.cv-price {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* Лента-рулетка: по центру кислотная линия-указатель */
.reel {
  position: relative;
  overflow: hidden;
  height: 132px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(57, 255, 20, 0.3);
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.95), transparent 22%, transparent 78%, rgba(10, 10, 10, 0.95)),
    rgba(255, 255, 255, 0.03);
}

.reel-track {
  position: absolute;
  top: 14px;
  left: 0;
  display: flex;
  gap: 8px;
  will-change: transform;
}

.reel-pointer {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid), 0 0 24px rgba(57, 255, 20, 0.6);
}

/* треугольники сверху и снизу указателя */
.reel-pointer::before,
.reel-pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.reel-pointer::before {
  top: 0;
  border-top: 10px solid var(--acid);
}

.reel-pointer::after {
  bottom: 0;
  border-bottom: 10px solid var(--acid);
}

/* Карточка в ленте */
.rc {
  flex-shrink: 0;
  width: 92px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  border: 1px solid color-mix(in srgb, var(--glow) 50%, transparent);
  border-bottom: 3px solid var(--glow);
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--glow) 18%, transparent), transparent 70%),
    var(--card-bg);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.rc-img {
  width: 56px;
  height: 56px;
  font-size: 40px;
  filter: drop-shadow(0 0 6px var(--glow));
}

.rc-price {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
}

/* «Пусто» — серая карточка с крестиком */
.rc-empty {
  --glow: #5c5c5c;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.rc-x {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: #6b6b6b;
}

.rc-empty .rc-price {
  color: var(--muted);
}

/* Выпавшая карточка подсвечивается */
.rc.rc-win {
  transform: scale(1.06);
  box-shadow: 0 0 26px var(--glow), inset 0 0 20px -6px var(--glow);
}

#case-open-btn {
  margin-top: var(--sp-4);
  text-transform: none;
  letter-spacing: 0;
}

.cv-controls {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-3);
}

/* «Что может выпасть»: картинка, название, цена и ШАНС */
.case-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}

.ci {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 22px 6px 10px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  border: 1px solid color-mix(in srgb, var(--glow) 45%, transparent);
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--glow) 16%, transparent), transparent 70%),
    var(--card-bg);
}

.tab.active .ci {
  animation: card-in 0.4s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 35ms + 80ms);
}

.ci-chance {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, 0.45);
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
}

.ci-img {
  width: 48px;
  height: 48px;
  font-size: 34px;
  filter: drop-shadow(0 0 6px var(--glow));
}

.ci-name {
  max-width: 100%;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ci-price {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--yellow);
}

.ci-empty {
  --glow: #5c5c5c;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.ci-x {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
  color: #6b6b6b;
}

.ci-empty .ci-price {
  color: var(--muted);
}

/* Окно «Пусто» — спокойное, без ракеты */
.case-empty-icon {
  animation: float 3s ease-in-out infinite;
}

/* ---------- 28. Узкие экраны (360px и меньше) ---------- */
@media (max-width: 370px) {
  :root {
    --page-x: 12px;
  }

  .header {
    gap: 6px;
    margin-left: var(--sp-2);
    margin-right: var(--sp-2);
  }

  .header .avatar {
    width: 38px;
    height: 38px;
  }

  .user-name {
    font-size: 13px;
  }

  .balance {
    font-size: 13px;
    padding-left: var(--sp-2);
  }

  .tab-title {
    font-size: 21px;
  }

  .slot {
    min-height: 150px;
  }

  .mult-btn {
    font-size: var(--fs-sm);
  }

  /* «По выигрышам» должно влезать целиком */
  .segmented-3 .segment {
    padding-left: 2px;
    padding-right: 2px;
    font-size: var(--fs-xs);
  }

  .bottom-nav {
    left: var(--sp-2);
    right: var(--sp-2);
    padding: 5px;
  }

  /* 6 вкладок на узком экране: подписи и иконки чуть меньше, чтобы всё влезло */
  .nav-drop {
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 10px) / var(--tabs));
  }

  .nav-btn {
    font-size: 9px;
    letter-spacing: -0.1px;
  }

  .nav-btn svg {
    width: 22px;
    height: 22px;
  }
}

/* ---------- 28а. Оформление кейсов: Кислотный (зелёный), NFT (фиолетовый), Легендарный (золотой) ---------- */
/* Цвета задаются переменными: --c — основной, --c2 — второй, --rgb — основной для rgba() */
.case-theme-starter   { --c: var(--acid); --c2: var(--yellow); --rgb: 57, 255, 20; }
.case-theme-acid      { --c: #7dff00; --c2: #00ffa3; --rgb: 125, 255, 0; }
.case-theme-nft       { --c: #b26bff; --c2: #ff2bd6; --rgb: 178, 107, 255; }
.case-theme-legendary { --c: #ffd23f; --c2: #ff9f1c; --rgb: 255, 210, 63; }

.case-card.case-theme-acid,
.case-card.case-theme-nft,
.case-card.case-theme-legendary {
  border-color: rgba(var(--rgb), 0.5);
  background:
    radial-gradient(circle at 20% 50%, rgba(var(--rgb), 0.22), transparent 60%),
    var(--card-bg);
  box-shadow: 0 0 26px -8px rgba(var(--rgb), 0.65), var(--shadow-inset-strong);
}

.case-card.case-theme-acid .case-card-name,
.case-card.case-theme-nft .case-card-name,
.case-card.case-theme-legendary .case-card-name,
#case-view.case-theme-acid .cv-name,
#case-view.case-theme-nft .cv-name,
#case-view.case-theme-legendary .cv-name {
  color: var(--c);
  text-shadow: 0 0 12px rgba(var(--rgb), 0.55);
}

.case-card.case-theme-acid .case-card-price,
.case-card.case-theme-nft .case-card-price,
.case-card.case-theme-legendary .case-card-price {
  background: linear-gradient(180deg, #fff 0%, var(--c) 35%, var(--c2) 100%);
  color: #120a00;
  box-shadow: 0 0 12px rgba(var(--rgb), 0.55);
}

.case-card.case-theme-nft .case-card-price { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Сцена кейса: свечение, искры и сундук в цвете кейса */
.case-stage.case-theme-acid .case-glow,
.case-stage.case-theme-nft .case-glow,
.case-stage.case-theme-legendary .case-glow {
  background: radial-gradient(circle, rgba(var(--rgb), 0.5), rgba(var(--rgb), 0.12) 45%, transparent 70%);
}

.case-stage.case-theme-acid .case-sparks span,
.case-stage.case-theme-nft .case-sparks span,
.case-stage.case-theme-legendary .case-sparks span {
  background: var(--c2);
  box-shadow: 0 0 10px var(--c), 0 0 4px #fff;
}

.case-stage.case-theme-acid .case-box,
.case-stage.case-theme-nft .case-box,
.case-stage.case-theme-legendary .case-box {
  filter: drop-shadow(0 0 14px rgba(var(--rgb), 0.6));
}

.case-stage.case-theme-acid .case-lid,
.case-stage.case-theme-acid .case-body { fill: url(#case-fill-acid); }
.case-stage.case-theme-nft .case-lid,
.case-stage.case-theme-nft .case-body { fill: url(#case-fill-nft); }
.case-stage.case-theme-legendary .case-lid,
.case-stage.case-theme-legendary .case-body { fill: url(#case-fill-legendary); }

.case-stage.case-theme-acid .case-lid,
.case-stage.case-theme-acid .case-body,
.case-stage.case-theme-nft .case-lid,
.case-stage.case-theme-nft .case-body,
.case-stage.case-theme-legendary .case-lid,
.case-stage.case-theme-legendary .case-body { stroke: var(--c); }

.case-stage.case-theme-acid .case-band,
.case-stage.case-theme-nft .case-band,
.case-stage.case-theme-legendary .case-band { stroke: rgba(var(--rgb), 0.55); }

.case-stage.case-theme-acid .case-plate,
.case-stage.case-theme-nft .case-plate,
.case-stage.case-theme-legendary .case-plate { fill: var(--c); stroke: var(--c2); }

/* Кислотный: свечение «пульсирует» быстрее, как ядовитая жижа */
.case-stage.case-theme-acid .case-glow { animation-duration: 1.8s; }

/* NFT: свечение переливается фиолетовым и розовым */
.case-stage.case-theme-nft .case-glow { animation: case-glow 3s ease-in-out infinite, case-hue 6s linear infinite; }

@keyframes case-hue {
  50% { filter: blur(6px) hue-rotate(40deg); }
}

/* Легендарный: корона над крышкой */
.case-crown {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 50%;
  width: 64px;
  margin-left: -32px;
  fill: var(--c);
  stroke: #fff6c8;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 10px rgba(255, 210, 63, 0.9));
  animation: case-crown 3s ease-in-out infinite;
}

@keyframes case-crown {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}

.case-stage-sm .case-crown { top: 4px; width: 36px; margin-left: -18px; }
.case-stage-xs .case-crown { top: 0; width: 28px; margin-left: -14px; }

/* Легендарный: золотые частицы медленно поднимаются вверх */
.case-dust {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.case-dust span {
  position: absolute;
  left: var(--x);
  bottom: 8%;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #ffe68a;
  box-shadow: 0 0 8px #ffd23f, 0 0 2px #fff;
  opacity: 0;
  animation: case-dust 4s ease-in infinite;
  animation-delay: var(--d);
}

@keyframes case-dust {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(-160px) scale(1.1); opacity: 0; }
}

.case-stage-sm .case-dust span,
.case-stage-xs .case-dust span { animation-name: case-dust-sm; }

@keyframes case-dust-sm {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(-80px) scale(1); opacity: 0; }
}

/* Указатель ленты — в цвет кейса */
#case-view.case-theme-acid .reel-pointer,
#case-view.case-theme-nft .reel-pointer,
#case-view.case-theme-legendary .reel-pointer {
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}

/* Кнопка «ℹ️ Шансы» внизу экрана кейса и окно со списком */
.case-odds-btn {
  display: block;
  margin: var(--sp-3) auto 0;
  opacity: 0.75;
}

.case-odds {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.co-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.co-img {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
}

.co-img .gift-icon { width: 32px; height: 32px; font-size: 22px; }

.co-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 13px;
}

.co-name small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}

.co-chance {
  font-family: var(--font-display);
  color: var(--acid);
}

.co-empty .co-chance { color: var(--muted); }

.case-odds-note {
  margin-top: var(--sp-3);
  text-align: center;
}

/* ---------- 28б. Вывод подарков: выбор предметов, портал, значок-пилюля, заявки ---------- */
.wd-pick-head { margin-top: 0; }

.wd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}

.wd-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.wd-item:active { transform: scale(0.96); }

.wd-item.selected {
  border-color: var(--glow);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px -4px var(--glow);
}

/* Галочка в углу карточки */
.wd-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.wd-item.selected .wd-check {
  border-color: var(--acid);
  background: var(--acid);
}

.wd-item.selected .wd-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--on-acid);
}

.wd-item-img {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
}

.wd-item-img .gift-icon { width: 50px; height: 50px; font-size: 34px; }

.wd-item-name {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wd-item-price {
  font-size: 11px;
  color: var(--muted);
}

.wd-grid .empty-state { grid-column: 1 / -1; }

.wd-summary {
  display: flex;
  justify-content: space-between;
  margin: var(--sp-3) 2px var(--sp-2);
  font-size: 13px;
  color: var(--muted);
}

.wd-summary b { color: var(--text); }

.wd-my {
  display: block;
  margin: var(--sp-2) auto var(--sp-4);
}

.wd-done-icon {
  animation: wd-spin 2.4s linear infinite;
  filter: drop-shadow(0 0 16px rgba(178, 107, 255, 0.9));
}

.wd-done-hint { margin-top: var(--sp-2); }

@keyframes wd-spin {
  to { transform: rotate(360deg); }
}

/* Портал: появляется в центре экрана, подарки улетают в него */
.wd-portal-layer {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: none;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(10, 0, 25, 0.55), rgba(0, 0, 0, 0.35) 60%);
}

.wd-portal-layer.active {
  display: grid;
  animation: wd-layer-in 0.3s ease-out;
}

.wd-portal-layer.closing { animation: wd-layer-out 0.4s ease-in forwards; }

@keyframes wd-layer-in  { from { opacity: 0; } }
@keyframes wd-layer-out { to { opacity: 0; } }

.wd-portal {
  position: relative;
  width: 150px;
  height: 150px;
  animation: wd-portal-in 0.5s var(--ease-out) backwards;
}

@keyframes wd-portal-in {
  from { transform: scale(0.2) rotate(-90deg); opacity: 0; }
}

/* Три кольца крутятся в разные стороны, в центре — яркое «окно» */
.wd-portal span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #b26bff;
  border-bottom-color: var(--acid);
  box-shadow: 0 0 30px rgba(178, 107, 255, 0.7), inset 0 0 30px rgba(57, 255, 20, 0.35);
  animation: wd-spin 1.1s linear infinite;
}

.wd-portal span:nth-child(2) {
  inset: 16px;
  border-top-color: var(--acid);
  border-bottom-color: #ff2bd6;
  animation-duration: 0.8s;
  animation-direction: reverse;
}

.wd-portal span:nth-child(3) {
  inset: 34px;
  border: none;
  background: radial-gradient(circle, #fff 0%, #d6b3ff 25%, #7a2bff 55%, transparent 72%);
  box-shadow: 0 0 50px 10px rgba(178, 107, 255, 0.8);
  animation: case-glow 1.2s ease-in-out infinite;
}

/* Летящий подарок (копия картинки из окна вывода) */
.wd-fly {
  position: fixed;
  z-index: 421;
  display: grid;
  place-items: center;
  will-change: transform, opacity;
  filter: drop-shadow(0 0 10px rgba(178, 107, 255, 0.9));
}

.wd-fly .gift-icon { width: 100%; height: 100%; font-size: 34px; }

/* Значок «📤 Вывод: в обработке» — справа внизу над нижним меню, не мешает играть */
.wd-pill {
  position: fixed;
  z-index: 58;
  right: max(var(--sp-3), calc(50% - 240px + var(--sp-3)));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 62vw;
  padding: 7px 12px 7px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(178, 107, 255, 0.55);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 0 18px -4px rgba(178, 107, 255, 0.7), var(--shadow-inset-strong);
  animation: wd-pill-in 0.45s var(--ease-out), wd-pill-pulse 2.4s ease-in-out 0.45s infinite;
  transition: opacity 0.6s, transform 0.6s;
}

/* Во вкладке «Топ» внизу есть плашка «Ваше место» — значок поднимается над ней */
body[data-tab="top"] .wd-pill { bottom: calc(var(--nav-h) + var(--safe-bottom) + 84px); }

.wd-pill.leaving {
  opacity: 0;
  transform: translateY(12px) scale(0.9);
}

.wd-pill[data-status="processing"] { border-color: rgba(212, 255, 0, 0.6); }
.wd-pill[data-status="sent"]       { border-color: rgba(57, 255, 20, 0.7); animation: wd-pill-in 0.45s var(--ease-out); }
.wd-pill[data-status="rejected"]   { border-color: rgba(255, 59, 59, 0.7); animation: wd-pill-in 0.45s var(--ease-out); }

.wd-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wd-pill-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: #b26bff;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

@keyframes wd-pill-in {
  from { opacity: 0; transform: translateY(16px) scale(0.85); }
}

@keyframes wd-pill-pulse {
  0%, 100% { box-shadow: 0 0 14px -6px rgba(178, 107, 255, 0.6), var(--shadow-inset-strong); }
  50%      { box-shadow: 0 0 22px -2px rgba(178, 107, 255, 0.85), var(--shadow-inset-strong); }
}

/* Список заявок (у игрока и в админке) */
.wd-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.wd-li,
.awd {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.wd-li-head,
.awd-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.awd-head small { margin-left: auto; color: var(--muted); }

.wd-badge {
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}

.wd-li .wd-badge { margin-left: auto; }

.wd-st-pending .wd-badge    { color: #ffd23f; background: rgba(255, 210, 63, 0.12); }
.wd-st-processing .wd-badge { color: var(--yellow); background: rgba(212, 255, 0, 0.12); }
.wd-st-sent .wd-badge       { color: var(--acid); background: rgba(57, 255, 20, 0.12); }
.wd-st-rejected .wd-badge   { color: var(--red); background: rgba(255, 59, 59, 0.12); }

.wd-li-gifts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.wd-li-gift {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
}

.wd-li-gift .gift-icon { width: 36px; height: 36px; font-size: 26px; }

.wd-li-gift small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 10px;
}

.wd-li-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.wd-li-comment,
.wd-li-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.wd-li-hint { color: var(--muted); }

/* Админка: заявки на вывод и предупреждение о невыгодном кейсе */
.admin-wd-filter { margin-bottom: var(--sp-2); }
.admin-wd-filter small { opacity: 0.6; }

#admin-withdrawals {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.awd-items { margin-top: var(--sp-2); }

.awd-total {
  margin-top: var(--sp-2);
  font-size: 13px;
}

.awd-actions {
  margin-top: var(--sp-2);
  gap: 6px;
}

.ac-alert {
  margin: var(--sp-2) 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 59, 59, 0.6);
  background: rgba(255, 59, 59, 0.1);
  color: #ff8a8a;
  font-size: 13px;
  line-height: 1.4;
}

.admin-case.ac-danger { border-color: rgba(255, 59, 59, 0.6); }

.ac-periods { margin-top: var(--sp-2); }

/* ---------- 29. «Уменьшить движение» ----------
   Если в настройках телефона включено «Уменьшить движение»,
   почти все анимации становятся мгновенными. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }

  .blob {
    animation: none !important;
  }

  .live-window {
    overflow-x: auto; /* ленту можно листать пальцем */
  }
}
