/* Тёмно-голубая палитра в духе Telegram Desktop (night blue) */
:root {
  --bg: #0e1621;
  --bg-deep: #0a1118;
  --panel: #17212b;
  --panel-2: #1c2733;
  --panel-3: #232f3d;
  --border: #101921;
  --line: rgba(255, 255, 255, 0.06);
  --text: #f5f5f5;
  --muted: #708499;
  --accent: #3390ec;
  --accent-2: #62b0f7;
  --green: #45c85a;
  --red: #e64d44;
  --gold: #f5b643;
  --radius: 12px;
  /* Единая высота всех контролов в шапках панелей */
  --ctl-h: 38px;
  --topbar-h: 62px;   /* высота шапки: от неё считаются липкие блоки */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Интерфейс отдалён: при 100% в браузере он выглядит как 90%, и на экран
   помещается заметно больше. Именно zoom, а не масштабирование шрифта:
   размеры по всей вёрстке заданы в пикселях, и font-size их не тронул бы.
   transform: scale тоже не годится — он растянул бы страницу за пределы
   окна и увёл фиксированные элементы. zoom меняет и вычисленные размеры,
   поэтому медиазапросы срабатывают как на более широком экране. */
html { background: var(--bg-deep); }

/* Только на широких экранах: на телефоне вёрстка и так подогнана под узкий
   экран, и уменьшать её ещё на десятую — значит получить мелкий текст на
   самом маленьком устройстве. Порог совпадает с мобильным брейкпоинтом. */
@media (min-width: 701px) {
  html { zoom: 0.9; }
}

body {
  background: transparent;
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* dvh, где поддерживается: мобильная адресная строка не дёргает высоту */
  min-height: 100dvh;
}

/* ── Фон ──────────────────────────────────────
   Ровный тёмный фон в духе Telegram, без декоративных слоёв. Раньше здесь
   жили четыре наложения: подвижная волна, цветной свет, зерно и виньетка.
   Убраны намеренно — рябь спорила с карточками каталога, а блюр на слое
   в полтора экрана заставлял GPU перерисовывать фон постоянно. */

/* Цифры не «прыгают» при обновлении цен и счётчиков */
.price, .balance-btn b, .stat b, .pg-num, .cart-badge,
#betValue, #cartTotal, .chance { font-variant-numeric: tabular-nums; }

.hidden { display: none !important; }

/* Маршрут известен ещё до запуска app.js — нужный экран показывается сразу,
   без мелькания соседнего при перезагрузке */
html.route-account #mainView { display: none !important; }
html.route-main #accountView { display: none !important; }

/* Пока приложение не отрисовалось, интерфейс скрыт; появляется плавно */
html.booting body { opacity: 0; }
body { opacity: 1; transition: opacity 0.28s ease; }
#mainView, #accountView { animation: view-in 0.26s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body, #mainView, #accountView { transition: none; animation: none; }
}
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 12px; }

/* ── Иконки ────────────────────────────── */
.ico {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  flex-shrink: 0;
}
.ico-xl { width: 42px; height: 42px; }

.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}
.ph .ico { width: 34%; height: 34%; }

/* ── Шапка ─────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* ── Логотип и вордмарк ────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
}
a.logo:hover .wordmark { text-shadow: 0 0 26px rgba(51, 144, 236, 0.7); }
/* В исходном PNG ромб занимает 60% ширины и лишь 43% высоты, а его центр на
   2.4% выше центра картинки. Поэтому бокс берём с запасом, лишнюю высоту
   срезаем отрицательными полями, а сдвиг компенсируем переносом вниз. */
.logo-mark {
  display: block;
  width: 58px;
  height: 58px;
  margin: -14px -6px;
  object-fit: contain;
  transform: translateY(3.4px);
  filter: drop-shadow(0 0 12px rgba(51, 144, 236, 0.5));
}
/* Системный стек — без внешних запросов. Крупная разрядка и максимальный
   вес превращают обычный гротеск в вордмарк. */
.wordmark {
  font-family: 'Segoe UI Variable Display', 'Segoe UI Black', 'Segoe UI',
    'Inter', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #fff;
  text-shadow:
    0 0 24px rgba(51, 144, 236, 0.45),
    0 1px 0 rgba(0, 0, 0, 0.35);
}

/* Иконка слева, под подписью — само значение */
.stat { display: flex; align-items: center; gap: 9px; line-height: 1.2; }
.stat-text { display: flex; flex-direction: column; }
.stat-ico { display: block; color: var(--accent); flex-shrink: 0; }
.stat-ico .ico { width: 22px; height: 22px; }
/* у логотипа прозрачные поля, поэтому бокс крупнее и с отрицательными полями */
.stat-logo {
  width: 38px;
  height: 38px;
  margin: -8px -6px;
  object-fit: contain;
  transform: translateY(0.9px);
}
.stat-label {
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.stat b { font-size: 15px; font-weight: 800; }

/* Квадратная кнопка в шапке (уведомления) */
.icon-sq {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-sq:hover { color: var(--text); background: var(--panel-3); border-color: rgba(255, 255, 255, 0.12); }
.icon-sq .ico { width: 18px; height: 18px; }

.conn {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.conn.on { background: var(--green); }

/* Баланс + пополнение */
.wallet-box {
  position: relative;   /* якорь для плашки о нехватке средств */
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 4px;
}
.balance-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 6px 5px 9px;
  border-radius: 9px;
}
.balance-btn:hover { background: var(--panel-3); }
.balance-btn .cur-ico { line-height: 0; }
.balance-btn .cur-ico .ico { width: 18px; height: 18px; }
.balance-btn .caret { line-height: 0; color: var(--muted); }
.balance-btn .caret .ico { width: 11px; height: 11px; }

.btn.topup {
  background: linear-gradient(135deg, #2b9df4, var(--accent));
  border: none;
  color: #fff;
  padding: 8px 13px;
}

/* ── Кнопки ────────────────────────────── */
.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.15s, filter 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.1); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[data-ico] { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn .ico { width: 15px; height: 15px; }

.btn.primary {
  background: linear-gradient(135deg, #2b9df4, var(--accent));
  border: none;
  color: #fff;
  box-shadow: 0 2px 10px rgba(51, 144, 236, 0.28);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn.primary:disabled { box-shadow: none; }
.btn.tiny { padding: 0 12px; font-size: 12px; border-radius: 10px; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.login {
  background: linear-gradient(135deg, #2b9df4, var(--accent));
  border: none;
  color: #fff;
}

.icon-ctl {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-ctl:hover { color: var(--text); background: var(--panel-3); border-color: rgba(255, 255, 255, 0.1); }
.icon-ctl .ico { width: 15px; height: 15px; }
/* Кнопка сортировки. Поворот на 180° тут ничего не давал: иконка центрально
   симметрична и после поворота выглядит ровно так же. Поэтому направление
   показываем цветом — горит та стрелка, куда идёт порядок: правая (вверх) от
   дешёвого к дорогому, левая (вниз) от дорогого к дешёвому.
   Красим stroke напрямую, а не через color/currentColor: на этих путях
   переопределение color не срабатывает даже с !important, а stroke — да.
   Сам цвет проставляет paintSortDir() инлайном — здесь только плавность. */
.icon-ctl .ar-left, .icon-ctl .ar-right { transition: stroke 0.15s; }

/* ── Каркас ────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
}

/* Лента приколочена к экрану: sticky отпускал её у конца .shell, поэтому fixed.
   Колонка в 200px в гриде остаётся и держит место под неё. */
.sidebar {
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  bottom: 0;
  width: 200px;
  z-index: 20;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 3px; }

/* Сетка с жёстко заданными строками: высота карточек не зависит от их числа,
   поэтому при появлении нового дропа ничего не «желеит». Десять строк делят
   высоту ленты без остатка. */
.side-feed {
  display: grid;
  grid-template-rows: 1.14fr repeat(9, 1fr);
  min-height: 100%;
}
.side-empty { color: var(--muted); font-size: 11px; padding: 10px 12px; }

/* Карточка ленты: сплошной прямоугольник во всю ширину, подарок справа до самых углов */
.side-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 72px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--red);
  padding: 10px 12px;
  overflow: hidden;
}
.side-card.win { border-left-color: var(--green); }

/* Топ-дроп часа: закреплён сверху, золотая рамка, свечение и ярлык.
   z-index выше бегущих карточек и непрозрачная база — новый дроп всплывает
   из-под него, а не накрывает его на первых кадрах анимации. */
.side-card.top {
  z-index: 2;
  min-height: 82px;
  border-left-color: var(--gold);   /* сплошная полоска, как зелёная у обычных карточек */
  border-bottom-color: transparent;
  background:
    radial-gradient(120% 140% at 92% 10%, rgba(245, 182, 67, 0.26), transparent 62%),
    linear-gradient(100deg, rgba(245, 182, 67, 0.16), rgba(23, 33, 43, 0) 68%),
    var(--panel);
  box-shadow:
    inset 0 0 34px rgba(245, 182, 67, 0.16),
    inset 0 -18px 26px -18px rgba(245, 182, 67, 0.55),
    0 4px 20px rgba(6, 12, 18, 0.5);
}
/* Низ — мягкий градиент, гаснущий к правому краю */
.side-card.top::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  z-index: 3;
  background: linear-gradient(90deg, rgba(245, 182, 67, 0.85), rgba(245, 182, 67, 0.06) 85%, transparent);
}
.side-card.top .s-name { font-size: 12.5px; }
.side-card .s-top-tag {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(10, 17, 24, 0.75);
  border: 1px solid rgba(245, 182, 67, 0.55);
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.side-card .s-top-tag .ico { width: 10px; height: 10px; }

/* Появление нового дропа. Раскладка не меняется (строки сетки фиксированы):
   новая карточка выезжает из-под топа, остальные сдвигаются на одну строку. */
@keyframes feed-in {
  from { transform: translateY(-100%); opacity: 0; }
  55%  { opacity: 1; }
  to   { transform: none; opacity: 1; }
}
@keyframes feed-shift {
  from { transform: translateY(-100%); }
  to   { transform: none; }
}
.side-card.feed-in { animation: feed-in 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.side-card.feed-shift { animation: feed-shift 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .side-card.feed-in, .side-card.feed-shift { animation: none; }
}
/* Шанс — мини-бокс в левом верхнем углу, как у лучшего дропа в кабинете */
.side-card .s-chance {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(10, 17, 24, 0.72);
  border: 1px solid rgba(51, 144, 236, 0.4);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
}
.side-card.win .s-chance { border-color: rgba(69, 200, 90, 0.45); color: var(--green); }
.side-card.top .s-chance { border-color: rgba(245, 182, 67, 0.55); color: var(--gold); }

/* Название и модель — левый нижний угол */
.side-card .s-info {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  flex: 1;
  min-width: 0;
  padding-right: 40px;
}
.side-card .s-name {
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(6, 12, 18, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-card .s-model {
  font-size: 10px;
  color: var(--muted);
  text-shadow: 0 1px 3px rgba(6, 12, 18, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Подарок с собственным фоном занимает правый край карточки целиком
   и уходит влево плавным фейдом в фон карточки */
.side-card .s-thumb {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 46%;          /* бокс близок к квадрату, поэтому cover почти не режет */
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 52%, rgba(0, 0, 0, 0.6) 80%, transparent 100%);
  mask-image: linear-gradient(to left, #000 52%, rgba(0, 0, 0, 0.6) 80%, transparent 100%);
}
/* cover — картинка заполняет край и тянется, но бокс подобран так,
   чтобы обрезка по вертикали была небольшой */
.side-card .s-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
}
.side-card .s-thumb .ph {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding-right: 10px;
  color: var(--muted);
}
.side-card .s-thumb .ph .ico { width: 26px; height: 26px; }

.content {
  /* лента вынута из потока (fixed), поэтому колонку задаём явно —
     иначе контент занял бы её 200px и страница схлопывалась */
  grid-column: 2;
  padding: 18px 22px 0;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.page-title { gap: 4px; }
.page-title .logo-mark { width: 88px; height: 88px; margin: -22px -10px; transform: translateY(4.5px); }
.page-title .wordmark { font-size: 30px; letter-spacing: 0.15em; }

/* ── Ряд апгрейда ──────────────────────── */
.upgrade-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, 420px) minmax(230px, 1fr);
  gap: 18px;
  align-items: stretch;
}

/* Колонка слота: инструменты вынесены НАД боксом */
.slot-col { display: flex; flex-direction: column; }
.slot-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 6px 6px;
}

.slot-card {
  background: linear-gradient(180deg, var(--panel), rgba(23, 33, 43, 0.6));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1;
}
.slot-title { text-align: center; font-weight: 700; font-size: 14px; }

/* Выбранный предмет заполняет бокс целиком */
.slot-card.filled { padding: 0; overflow: hidden; }
.slot-card.filled .slot-body { padding: 0; min-height: 0; flex: 1; }
.slot-card.filled .slot-pick {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  border: none;
  border-radius: 16px;
}
/* Несколько слотов: рамка бокса остаётся, сетка занимает всю его площадь */
.slot-card.stacked { padding: 10px; }
.slot-card.stacked .slot-body { padding: 0; min-height: 0; flex: 1; }

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  line-height: 0;
}
.icon-btn .ico { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); }
.icon-btn.active { color: var(--accent-2); }

.slot-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 4px 4px;
  min-height: 240px;
}
.slot-body .chev { width: 110px; height: 110px; opacity: 0.22; }
.slot-body .chev.up { transform: rotate(180deg); }

/* Раскладка бокса ставки: 1..6 слотов, добавленный баланс — такой же слот.
   1 — во весь бокс; 2 — две колонки; 3 — две сверху, широкий снизу;
   4 — по углам; 5 — два крупных сверху и три мелких снизу; 6 — сетка 3×2. */
.pick-grid {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  flex: 1;
  align-self: stretch;
  grid-template-columns: 1fr;
}
.pick-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.pick-grid[data-count="3"],
.pick-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pick-grid[data-count="3"] > :nth-child(3) { grid-column: span 2; }
.pick-grid[data-count="5"] { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; }
.pick-grid[data-count="5"] > :nth-child(-n + 2) { grid-column: span 3; }
.pick-grid[data-count="5"] > :nth-child(n + 3) { grid-column: span 2; }
.pick-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }

/* Карточка предмета в слоте у барабана */
.slot-pick {
  width: 100%;
  max-width: 232px;
  aspect-ratio: 1 / 1.04;
  cursor: default;
}
/* В сетке карточка тянется по ячейке, а не держит свою пропорцию */
.pick-grid .slot-pick {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
}
.slot-pick .pick-name {
  position: absolute;
  top: 9px;
  left: 30px;
  right: 30px;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
}
.pick-grid:not([data-count="1"]) .slot-pick .pick-name { font-size: 10px; left: 22px; right: 22px; }
.pick-grid[data-count="5"] .slot-pick .pick-name,
.pick-grid[data-count="6"] .slot-pick .pick-name { font-size: 9px; left: 18px; right: 18px; }
.slot-pick .pick-foot {
  position: absolute;
  bottom: 9px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
}
.slot-pick .price { font-size: 14px; }
.pick-grid:not([data-count="1"]) .slot-pick .price { font-size: 11px; }
.pick-grid[data-count="5"] .slot-pick .price,
.pick-grid[data-count="6"] .slot-pick .price { font-size: 10px; }
.pick-grid[data-count="5"] .pick-close,
.pick-grid[data-count="6"] .pick-close { width: 18px; height: 18px; }

/* Баланс в ставке: иконка валюты по центру, сумма под ней */
.slot-pick.pick-ton { background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); }
.pick-ton-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 26px;
}
.pick-ton-art .ico { width: 42%; height: auto; max-width: 92px; aspect-ratio: 1; }
.pick-grid[data-count="1"] .pick-ton-art .ico { width: 34%; }

.pick-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 17, 24, 0.6);
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  z-index: 4;
}
.pick-close:hover { color: #fff; background: var(--red); }
.pick-close .ico { width: 13px; height: 13px; }

/* ── Ряд под слотами: баланс и пресеты ─── */
/* Все три блока ряда — одной высоты и выровнены по краям */
.controls-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, 420px) minmax(230px, 1fr);
  gap: 18px;
  margin-top: 12px;
  align-items: stretch;
}
/* Кнопка апгрейда — строго по центру под барабаном */
.ctl-mid { display: flex; align-items: stretch; justify-content: center; }
.ctl-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Пресеты — по центру блока, кнопки тянутся на всю ширину.
   Без сдвига по горизонтали: блок должен совпадать по краям со слотом цели
   над ним, иначе левый край заметно не сходится. */
.ctl-box.presets { padding: 10px; }
.slider-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.slider-row .hint { font-weight: 500; }
.slider-row b {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.slider-row b .ico { width: 14px; height: 14px; }

input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-3);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff2;
}

.slot-total {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.slot-total b {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.slot-total b .ico { width: 14px; height: 14px; }

/* Пресеты — одной строкой, все одного размера */
.preset-group { display: flex; gap: 7px; width: 100%; }
.preset {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}
.preset .p-num { display: inline-flex; align-items: center; justify-content: center; }
.preset:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.preset:active { transform: translateY(1px); }

/* Оконтовка по риску: не сплошная рамка, а диагональный градиент — цвет
   разгорается к углам по линии 135° и притухает на серединах сторон.
   Рисуется двумя слоями фона: нижний градиент виден только в зазоре border. */
.preset.ok, .preset.mid, .preset.hot { border-color: transparent; }
.preset.ok {
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    linear-gradient(135deg, #22c55e, rgba(34, 197, 94, 0.16) 40%, rgba(34, 197, 94, 0.16) 60%, #22c55e) border-box;
}
.preset.mid {
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    linear-gradient(135deg, #eab308, rgba(234, 179, 8, 0.16) 40%, rgba(234, 179, 8, 0.16) 60%, #eab308) border-box;
}
.preset.hot {
  background: linear-gradient(var(--panel-2), var(--panel-2)) padding-box,
    linear-gradient(135deg, #ef4444, rgba(239, 68, 68, 0.18) 40%, rgba(239, 68, 68, 0.18) 60%, #ef4444) border-box;
}
.preset.ok:hover, .preset.mid:hover, .preset.hot:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Предмет вне коридора шанса при текущей ставке: виден, но не нажимается */
#marketGrid .card.off {
  opacity: 0.35;
  filter: saturate(0.35);
  cursor: default;
}
#marketGrid .card.off:hover { border-color: var(--line); }

/* Кнопка тайного апгрейда: та же текучая кислота, что заливает логотип в
   барабане, — косые зелёные полосы, переливающиеся туда-сюда (acid-flow) */
.preset-help {
  flex: 0 0 40px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(120deg,
    #0a5c38, #1fdc7f 26%, #0b6b41 50%, #2be98c 74%, #0a5c38);
  background-size: 320% 320%;
  animation: acid-flow 6s ease-in-out infinite alternate;
  box-shadow: 0 0 16px rgba(31, 220, 127, 0.42), inset 0 0 12px rgba(84, 255, 216, 0.22);
}
/* Наведение: кнопка не синеет общим правилом .preset:hover, а просто гаснет.
   Затемняем плёнкой поверх, а не filter: brightness — иначе яркость активного
   режима (.preset-help.active) перебивала бы этот эффект */
.preset-help::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(2, 14, 8, 0);
  transition: background 0.15s;
  pointer-events: none;
}
.preset-help:hover {
  background: linear-gradient(120deg,
    #0a5c38, #1fdc7f 26%, #0b6b41 50%, #2be98c 74%, #0a5c38);
  background-size: 320% 320%;
  box-shadow: 0 0 12px rgba(31, 220, 127, 0.3), inset 0 0 12px rgba(2, 14, 8, 0.4);
}
.preset-help:hover::after { background: rgba(2, 14, 8, 0.45); }
.preset-help .ico {
  position: relative;   /* поверх затемняющей плёнки */
  z-index: 1;
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 4px rgba(2, 14, 8, 0.75));
}
@media (prefers-reduced-motion: reduce) {
  .preset-help { animation: none; }
}

/* ── Барабан ───────────────────────────── */
.wheel-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  justify-self: center;
  align-self: center;
  background: radial-gradient(circle at 50% 50%, rgba(51, 144, 236, 0.08), transparent 65%);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Свечение по ободку барабана: светит внутрь кольца и наружу мягким ореолом.
   Отступ 26px — это внешний край трека (радиус кольца = половина стороны − 40,
   толщина 28), поэтому свечение садится ровно на обод при любом размере.
   Держится до следующей прокрутки, не гаснет само. */
.wheel-wrap::before {
  content: '';
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.wheel-wrap.win::before {
  box-shadow:
    inset 0 0 60px 10px rgba(69, 200, 90, 0.45),
    inset 0 0 18px 2px rgba(69, 200, 90, 0.6),
    0 0 32px 2px rgba(69, 200, 90, 0.3);
  opacity: 1;
}
.wheel-wrap.lose::before {
  box-shadow:
    inset 0 0 60px 10px rgba(230, 77, 68, 0.45),
    inset 0 0 18px 2px rgba(230, 77, 68, 0.6),
    0 0 32px 2px rgba(230, 77, 68, 0.3);
  opacity: 1;
}
.wheel-wrap canvas { display: block; width: 100%; height: 100%; }
/* Логотип фоном в центре барабана: крупный серый силуэт на грани видимости.
   Ромб занимает 60% ширины бокса, поэтому 72% дают видимые ~180px. */
.wheel-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  /* +10px: центр видимого ромба в PNG выше центра картинки */
  transform: translate(-50%, calc(-50% + 10px));
  opacity: 0.1;
  filter: grayscale(1) brightness(1.6);
  pointer-events: none;
  user-select: none;
}
.wheel-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.wheel-info .chance { font-size: 30px; font-weight: 800; }
.wheel-info .mult { color: var(--muted); font-size: 13px; font-weight: 600; }
.wheel-info.win .chance { color: var(--green); }
.wheel-info.lose .chance { color: var(--red); }

/* Итог прокрутки вместо процентов: держится до следующего апгрейда */
.wheel-info.result .chance {
  max-width: 74%;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}
.wheel-info.result.win .chance {
  font-size: 44px;
  text-transform: uppercase;
  text-shadow: 0 0 26px rgba(69, 200, 90, 0.55);
}
.wheel-info.result.lose .chance {
  font-size: 20px;
  text-shadow: 0 0 22px rgba(230, 77, 68, 0.45);
}
.wheel-info.result .mult { display: none; }

.upgrade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 320px;
  height: 100%;
  padding: 0 16px;
  font-family: 'Segoe UI Variable Display', 'Segoe UI Black', 'Segoe UI',
    'Inter', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  border-radius: 14px;
}
/* логотип белым силуэтом: обнуляем яркость и инвертируем */
.upgrade-btn .btn-logo {
  width: 46px;
  height: 46px;
  margin: -12px -6px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transform: translateY(1.1px);
}

/* ── Provably Fair ─────────────────────── */
.fair-pop {
  position: absolute;
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  width: 340px;
  margin-top: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.fair-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}
.fair-row code {
  color: var(--text);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 2px 6px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fair-row input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 8px;
  width: 180px;
  outline: none;
}
.fair-revealed { margin-top: 8px; word-break: break-all; }

/* ── Нижний ряд ────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

/* Шапка панели — одна строка: заголовок и фильтры рядом. Место под фильтры
   освобождает поиск, он единственный тянется и сжимается. */
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}
.panel-head > .toggle,
.panel-head > .panel-icon,
.panel-head > h2 { min-height: var(--ctl-h); display: flex; align-items: center; }
.panel-head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  min-height: var(--ctl-h);
}
/* Всё, кроме поиска, сохраняет свою ширину: ужимается только строка поиска */
.filters > * { height: var(--ctl-h); flex-shrink: 0; }
.filters .search-wrap { flex: 1 1 60px; min-width: 60px; }
.filters .btn.tiny { margin-left: auto; white-space: nowrap; }
.panel-icon { color: var(--accent-2); line-height: 0; }
.panel-icon .ico { width: 18px; height: 18px; }

/* Переключатель инвентарь / магазин */
.toggle {
  display: flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  height: var(--ctl-h);
}
/* Синяя подложка едет между половинами переключателя */
.toggle { position: relative; }
.toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: calc(100% - 6px);
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(51, 144, 236, 0.35);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle.shop::before { transform: translateX(calc(100% + 3px)); }  /* ширина кнопки + gap */
.tg-btn {
  position: relative;
  z-index: 1;
  width: 34px;
  border-radius: 7px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.tg-btn .ico { width: 16px; height: 16px; }
.tg-btn:hover { color: var(--text); }
.tg-btn.active { color: #fff; }   /* фон даёт бегущая подложка .toggle::before */

.ctl {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 0 10px;
  outline: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.ctl::placeholder { color: var(--muted); font-weight: 500; }
.ctl:focus { border-color: var(--accent); background: var(--panel-3); }

/* Поля диапазона цены с иконкой валюты */
.range-in {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  transition: border-color 0.15s, background 0.15s;
}
.range-in:focus-within { border-color: var(--accent); background: var(--panel-3); }
.range-in .ico { width: 14px; height: 14px; flex-shrink: 0; }
.range-in input {
  width: 46px;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.range-in input::placeholder { color: var(--muted); font-weight: 500; }
/* Диапазон цены вводят с клавиатуры: стрелки-степперы тут только съедают место */
.range-in input::-webkit-outer-spin-button,
.range-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.range-in input { -moz-appearance: textfield; appearance: textfield; }

.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap .ico {
  position: absolute;
  left: 11px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.ctl.search { width: 100%; height: 100%; min-width: 80px; padding-left: 32px; }
.search-wrap { flex: 1; min-width: 0; }

/* Корзина */
.cart-btn {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 38px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cart-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cart-btn .ico { width: 16px; height: 16px; }
.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
/* Счётчик предметов заметен на любом фоне кнопки, поэтому он жёлтый */
.cart-badge.on { background: var(--gold); color: #1a1200; }

/* Футер панели: корзина и покупка на одном уровне с пагинацией */
.panel-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.panel-foot .pager { grid-column: 2; }
.foot-side { display: flex; align-items: center; gap: 10px; min-width: 0; padding-top: 12px; }
.foot-side.end { justify-content: flex-end; }
/* Кнопка покупки: цена слева, корзина со счётчиком справа */
.buy-btn { display: inline-flex; align-items: center; gap: 10px; }
.buy-btn .price, .buy-btn span { display: inline-flex; align-items: center; gap: 5px; }
.buy-btn .ico { width: 15px; height: 15px; }
.buy-btn .buy-cart { position: relative; }
/* Счётчик выступает за кнопку, поэтому ей нужен запас справа и сверху */
.foot-side.end { padding-right: 6px; }
.buy-btn .buy-cart .cart-badge { top: -11px; right: -11px; }

/* Пагинация */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
}
.pg {
  width: 34px;
  height: 30px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pg:hover:not(:disabled) { color: var(--text); background: var(--panel-3); }
.pg:disabled { opacity: 0.35; cursor: not-allowed; }
.pg .ico { width: 14px; height: 14px; }
.pg-num { color: var(--muted); font-size: 12px; font-weight: 600; }

.src-status { margin-top: 10px; }

/* ── Карточка предмета ─────────────────── */
/* Пять карточек в ряд */
.grid {
  display: grid;
  /* auto-fill вместо жёстких пяти колонок: на десктопной ширине панели это
     те же пять, а на узких экранах сетка сама сжимается до 3–2 колонок,
     не превращая карточки в нечитаемые 66px */
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
}

.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1.04;
  transition: border-color 0.18s, box-shadow 0.18s;
}
/* Ховер: бокс неподвижен, только едва заметный блеск */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  background: linear-gradient(128deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 58%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: rgba(98, 176, 247, 0.45); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card.won { animation: pulse-win 1s ease 2; }

@keyframes pulse-win {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 14px var(--green); }
}

/* Подложка на весь бокс + сам подарок по центру */
.card .media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--panel-3);
  overflow: hidden;
}
/* Блюр-подложка больше не нужна: подарок сам заполняет бокс */
.card .media .bg { display: none; }
/* Подарок вместе со своим фоном растянут на весь бокс */
.card .media .fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 12px rgba(51, 144, 236, 0.25);
}

/* Только эти двое в потоке; pick-name / pick-foot / sell позиционируются сами */
.card-top { position: relative; z-index: 1; display: flex; justify-content: flex-end; }
.card-bottom { position: relative; z-index: 1; margin-top: auto; text-align: center; }

.price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}
.price .ico { width: 14px; height: 14px; }

.card .name {
  font-size: 11.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
}
.card .meta {
  color: #b6c6d6;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.95);
}

/* Логотип маркета слева сверху */
.card .src {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  overflow: hidden;
  z-index: 3;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6);
  line-height: 0;
}
.card .src img, .card .src svg { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Отметка выбранного предмета — круглый бейдж по центру карточки.
   По умолчанию галочка, при наводке — крестик «убрать». */
.card .check {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 38%;
  aspect-ratio: 1;
  max-width: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Белая подложка: у иконки check галочка «прорезана» насквозь */
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: background 0.16s, transform 0.16s;
  pointer-events: none;
}
.card .check .check-on,
.card .check .check-off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.16s;
}
/* Галочка: залитый круг цвета акцента, «дырка» галочки открывает белую подложку */
.card .check .check-on { color: var(--accent); }
.card .check .check-on .ico { width: 100%; height: 100%; }
.card .check .check-off { opacity: 0; color: #fff; }
.card .check .check-off .ico { width: 46%; height: 46%; }
/* Наводка на выбранную карточку — режим «убрать» */
.card.selected:hover .check {
  background: rgba(10, 17, 24, 0.9);
  transform: translate(-50%, -50%) scale(1.06);
}
.card.selected:hover .check .check-on { opacity: 0; }
.card.selected:hover .check .check-off { opacity: 1; }

/* Затемняем подарок под бейджем, чтобы отметка читалась */
.card.selected .media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 17, 24, 0.32);
}

/* Счётчик количества в магазине */
.card .qty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 17, 24, 0.82);
  border-radius: 11px;
  padding: 5px 8px;
  font-weight: 700;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-btn .ico { width: 14px; height: 14px; }

/* Кнопки продажи на карточках убраны: продажа живёт в личном кабинете,
   низ карточки (имя и цена) больше ничем не перекрывается */

.empty {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}

/* Во время прокрутки интерфейс только блокируется, без затенения */
body.locked #betCard,
body.locked #targetCard,
body.locked .controls-row,
body.locked .bottom-row { pointer-events: none; }

/* ── Модалка выбора валюты ─────────────── */
.modal-back {
  position: fixed;
  inset: 0;
  /* Сайт позади размывается, а не просто затемняется */
  background: rgba(5, 10, 15, 0.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
/* ── Корзина: выезжает из-за правого края ────────────────────────────────
   Движение то же, что у карточек лайв-ленты (выезд + проявление), только по
   горизонтали, поэтому и кривая, и длительность взяты оттуда же. */
@keyframes cart-in {
  from { transform: translateX(100%); opacity: 0; }
  55%  { opacity: 1; }
  to   { transform: none; opacity: 1; }
}
.cart-back {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
}
.cart-modal {
  max-width: 440px;
  height: 100%;
  border-radius: 18px 0 0 18px;
  border-right: none;
  display: flex;
  flex-direction: column;
  animation: cart-in 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@media (prefers-reduced-motion: reduce) { .cart-modal { animation: none; } }

.cart-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.muted-text { color: var(--muted); font-size: 13px; }
.cart-wipe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cart-wipe:hover { color: var(--text); }
.cart-wipe .ico { width: 14px; height: 14px; }

/* Список тянется на всю свободную высоту, итог и кнопки остаются на виду */
.cart-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.cart-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.cart-row .thumb {
  width: 56px;
  height: 56px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--panel-3);
}
.cart-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-row .rname { font-weight: 700; }
.cart-row .rsub { color: var(--muted); font-size: 12px; }
.cart-row .price { white-space: nowrap; }
.cart-row .rdel {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.cart-row .rdel:hover { color: var(--danger, #f87171); }
.cart-row .rdel .ico { width: 16px; height: 16px; }

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 16px;
  padding: 16px 2px 14px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.cart-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.cart-actions .btn { padding: 13px 0; font-size: 15px; justify-content: center; }
.cart-cancel { background: none; border: 1px solid var(--gold); color: var(--gold); }
.cart-cancel:hover { background: rgba(245, 182, 67, 0.1); }
.cart-empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* ── Нехватка средств: плашка под кнопкой пополнения ─────────────────── */
.fund-pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  width: 290px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
/* Уголок, указывающий на кнопку пополнения */
.fund-pop::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 46px;
  width: 12px;
  height: 12px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.fund-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.fund-warn { color: var(--gold); line-height: 0; }
.fund-warn .ico { width: 16px; height: 16px; }
.fund-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 14px; }
.fund-actions { display: flex; align-items: center; gap: 10px; }
.fund-cancel {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fund-cancel:hover { color: var(--text); }

.modal-head { display: flex; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  padding: 4px;
}
.modal-close .ico { width: 18px; height: 18px; }
.modal-close:hover { color: var(--text); }

.cur-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cur-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.cur-opt:hover { background: var(--panel-3); }
.cur-opt.active { border-color: var(--accent); }
.cur-opt .ico { width: 19px; height: 19px; }
.cur-name { margin-right: auto; }
.radio {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  flex-shrink: 0;
}
.cur-opt.active .radio {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--panel-2);
}

.modal-apply { width: 100%; margin-top: 16px; padding: 13px 0; font-size: 15px; }
.modal-note {
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  margin-top: 14px;
  line-height: 1.45;
}

/* ── Прочее ────────────────────────────── */
.footer {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  padding: 18px 0 14px;
}

/* ── Аватар в шапке ────────────────────── */
.avatar-btn {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid transparent;
  background: var(--panel-3);
  transition: border-color 0.15s, filter 0.15s;
}
.avatar-btn:hover { filter: brightness(1.1); border-color: rgba(51, 144, 236, 0.5); }
.avatar-btn.active { border-color: var(--accent); }
.avatar-btn .avatar { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Личный кабинет ────────────────────── */
.account { display: flex; flex-direction: column; gap: 16px; padding-top: 34px; }

/* Общий контейнер, внутри — колонки карточек (как в референсе) */
.acct-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.acct-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: stretch;
}
.acct-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acct-card-title { color: var(--muted); font-size: 13px; font-weight: 600; }

.acct-profile { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 14px; }
.acct-avatar { width: 64px; height: 64px; border-radius: 50%; }
.acct-ident { align-self: center; min-width: 0; }
.acct-name { font-size: 18px; font-weight: 800; }
.acct-id {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
}
.acct-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-3);
  border-radius: 10px;
  padding: 10px 12px;
}
.acct-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.acct-row-text b { font-size: 13px; }
.acct-row-ico { color: var(--accent); display: inline-flex; }
.acct-row-ico .ico { width: 18px; height: 18px; }
.acct-row-ico.win { color: var(--green); }
.acct-wide { grid-column: 1 / -1; width: 100%; justify-content: center; }

/* переключатель уведомлений — пока чисто визуальный */
.switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.switch.on { background: rgba(51, 144, 236, 0.35); }
.switch.on::after { transform: translateX(18px); background: var(--accent); }

/* Содержимое баланса прижато к низу карточки */
.acct-balance { justify-content: flex-end; }
.acct-balance .acct-card-title { margin-bottom: auto; }
.acct-balance-value { display: flex; align-items: center; gap: 8px; }
.acct-balance-value b { font-size: 32px; font-weight: 800; }
.acct-balance-value .ico { width: 22px; height: 22px; }
/* Строка промокода и «Пополнить баланс» — выше, чем обычные контролы */
.acct-coupon {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  background: var(--panel-3);
  border-radius: 12px;
  padding: 8px 12px;
}
.acct-coupon .btn.tiny { height: 36px; }

/* Пополнить + вывести. Обе кнопки по половине ширины: на узких экранах ряд
   не ломаем в столбик — две короткие подписи помещаются и на 320px. */
.acct-money-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.acct-money-row .btn {
  width: 100%;
  min-width: 0;
  height: 52px;
  border-radius: 12px;
  justify-content: center;
}
.acct-coupon input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  outline: none;
}

/* Правая колонка: лучший дроп сверху, два бокса статистики снизу */
.acct-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.acct-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.acct-stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.acct-stat-sub { color: var(--muted); font-size: 12px; }
.acct-stat-sub b { font-size: 12px; color: var(--text); }

/* Лучший дроп: предмет на подсвеченном фоне с водяным знаком логотипа */
.best-drop {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 168px;
  justify-content: flex-start;
  gap: 4px;
  background:
    radial-gradient(120% 130% at 88% 18%, rgba(51, 144, 236, 0.32), transparent 62%),
    linear-gradient(145deg, rgba(51, 144, 236, 0.14), rgba(28, 39, 51, 0.9) 58%);
  border-color: rgba(51, 144, 236, 0.28);
}
/* Логотип стоит в зоне растворения предмета, ближе к низу */
.best-drop::after {
  content: '';
  position: absolute;
  left: 22%;
  bottom: -26%;
  width: 54%;
  aspect-ratio: 1;
  z-index: 1;
  background: url('/img/logo.png') center/contain no-repeat;
  opacity: 0.08;
  filter: grayscale(1) brightness(1.7);
  pointer-events: none;
}
.best-chance {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(10, 17, 24, 0.72);
  border: 1px solid rgba(51, 144, 236, 0.4);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}
.best-name {
  position: relative;
  z-index: 2;
  max-width: 62%;
  margin-top: 6px;
  text-shadow: 0 1px 4px rgba(6, 12, 18, 0.8);
  font-size: 17px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.best-meta { position: relative; z-index: 2; color: var(--muted); font-size: 12px; }
.best-price { position: relative; z-index: 2; margin-top: auto; font-size: 17px; font-weight: 800; }
.best-price .price { font-size: 17px; font-weight: 800; }
/* Предмет занимает правый край до самых углов и уходит влево фейдом —
   так же, как подарок в карточке лайв-ленты */
.best-art {
  position: absolute;
  top: -30px;        /* арт выше карточки: подарок уезжает вверх, низ не режется */
  right: 0;
  bottom: 0;
  width: 58%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to left, #000 40%, rgba(0, 0, 0, 0.5) 72%, transparent 100%);
  mask-image: linear-gradient(to left, #000 40%, rgba(0, 0, 0, 0.5) 72%, transparent 100%);
}
.best-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom;   /* якорь по низу: обрезается верх, а не низ подарка */
  display: block;
}
.best-art .ph {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding-right: 14px;
  color: var(--muted);
}
.best-drop.empty-drop { background: var(--panel-2); border-color: var(--line); }
.best-drop.empty-drop::after { opacity: 0.06; }
.acct-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.acct-stat-ico { width: 26px; height: 26px; margin: -6px; object-fit: contain; }
.acct-stat b { font-size: 20px; font-weight: 800; }

.acct-tabs-card { background: var(--panel); border-radius: 18px; padding: 16px; }
.acct-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
/* Вкладки и «Продать всё» — одинаковые серые боксы. Активная вкладка синяя.
   Никаких сдвигов при нажатии: меняется только цвет. */
.acct-tabs { display: inline-flex; gap: 10px; }
.acct-tab,
.acct-tabs-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.acct-tab .ico,
.acct-tabs-row .btn .ico { width: 16px; height: 16px; }
.acct-tab:hover:not(.active),
.acct-tabs-row .btn:hover:not(:disabled) {
  background: var(--panel-3);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
}
.acct-tab.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(51, 144, 236, 0.3);
}
.acct-tab:active,
.acct-tabs-row .btn:active:not(:disabled) { transform: none; }
.acct-tabs-row .btn:hover:not(:disabled) { color: var(--green); border-color: rgba(69, 200, 90, 0.45); }

/* Предмет — та же карточка, что в каталоге, но чуть мельче, кнопки боксами снизу */
.acct-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.acct-grid .price { font-size: 15px; font-weight: 800; }
.acct-grid .price .ico { width: 14px; height: 14px; }
.acct-slot { display: flex; flex-direction: column; gap: 6px; }
.acct-item-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.acct-act {
  height: 32px;
  border-radius: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.acct-act .ico { width: 15px; height: 15px; }
.acct-act:hover:not(:disabled) { color: var(--text); border-color: rgba(255, 255, 255, 0.12); }
.acct-act.sell:hover:not(:disabled) { background: var(--green); color: #fff; border-color: transparent; }
.acct-act:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── История апгрейдов ─────────────────────
   Одна игра — карточка: слева бокс ставки (та же раскладка 1..6, что и у
   барабана), справа желаемый предмет с итогом, снизу сумма ставки и шанс. */
.hist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.hist-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hist-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
}
.hist-box {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(51, 144, 236, 0.55);
  background: var(--panel-3);
  overflow: hidden;
}
/* Итог читается по рамке и свечению внутрь: зелёное — зашёл, красное — нет */
.hist-card.win .hist-target { border-color: var(--green); }
.hist-card.lose .hist-target { border-color: var(--red); }
/* Затемнение сверху и снизу: подарок бывает любого цвета, а цена и ярлык
   итога должны читаться поверх него всегда */
.hist-target::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(to top, rgba(6, 12, 18, 0.88), rgba(6, 12, 18, 0) 46%),
    linear-gradient(to bottom, rgba(6, 12, 18, 0.62), rgba(6, 12, 18, 0) 28%);
}
/* Свечение — отдельным слоем поверх картинки: inset-тень самого бокса легла бы
   под неё и почти не читалась бы */
.hist-target::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}
.hist-card.win .hist-target::after {
  box-shadow:
    inset 0 0 12px rgba(69, 200, 90, 0.75),
    inset 0 0 34px rgba(69, 200, 90, 0.5);
}
.hist-card.lose .hist-target::after {
  box-shadow:
    inset 0 0 12px rgba(230, 77, 68, 0.75),
    inset 0 0 34px rgba(230, 77, 68, 0.5);
}
.hist-arrow { display: flex; align-items: center; justify-content: center; }
.hist-arrow .chev { width: 16px; height: 16px; opacity: 0.5; transform: rotate(180deg); }

.hist-art { position: absolute; inset: 0; z-index: 0; }
.hist-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-art .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
}
.hist-art .ph .ico { width: 34%; height: 34%; }

.hist-mark { position: absolute; top: 6px; left: 6px; z-index: 2; display: inline-flex; }
.hist-mark .ico { width: 18px; height: 18px; }
.hist-card.win .hist-mark { color: var(--green); }
.hist-card.lose .hist-mark { color: var(--red); }
.hist-price { position: absolute; top: 6px; right: 8px; z-index: 2; }
.hist-price .price { font-size: 11.5px; }
.hist-res {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 800;
}
/* Плашка итога лежит на своей тёмной подложке — иначе на подарке того же
   цвета она сливалась бы с фоном */
.hist-card.win .hist-res {
  background: rgba(8, 14, 20, 0.86);
  border: 1px solid rgba(69, 200, 90, 0.75);
  color: #6ee07f;
  box-shadow: 0 2px 12px rgba(6, 12, 18, 0.7), 0 0 10px rgba(69, 200, 90, 0.25);
}
.hist-card.lose .hist-res {
  background: rgba(8, 14, 20, 0.86);
  border: 1px solid rgba(230, 77, 68, 0.75);
  color: #ff958d;
  box-shadow: 0 2px 12px rgba(6, 12, 18, 0.7), 0 0 10px rgba(230, 77, 68, 0.25);
}

/* Слоты ставки в истории — те же 1..6 ячеек, но без названий и кнопок */
.hist-bet .pick-grid { gap: 4px; }
.hist-cell {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(51, 144, 236, 0.35);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hist-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-cell .ph .ico, .hist-cell > .ico { width: 34%; max-width: 34px; aspect-ratio: 1; color: var(--muted); }
.hist-cell.ton { flex-direction: column; gap: 3px; }
.hist-cell.ton .ico { width: 32%; max-width: 30px; height: auto; aspect-ratio: 1; }
.hist-cell.ton b { font-size: 10px; font-weight: 800; }

.hist-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hist-stat {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
}
.hist-stat span { display: block; color: var(--muted); font-size: 10px; font-weight: 600; }
.hist-stat b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.hist-stat b .ico { width: 13px; height: 13px; }
/* Шанс красится по итогу: зашёл — зелёный, не зашёл — красный */
.hist-card.win .hist-stat.chance b { color: #6ee07f; }
.hist-card.lose .hist-stat.chance b { color: #ff958d; }

/* Следующая порция истории — синяя кнопка по центру под сеткой */
.hist-more { display: flex; justify-content: center; padding-top: 16px; }
.hist-more-btn {
  height: 44px;
  padding: 0 26px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid rgba(51, 144, 236, 0.55);
  color: var(--accent-2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.hist-more-btn:hover {
  background: rgba(51, 144, 236, 0.14);
  border-color: var(--accent);
}

/* ── Настройки апгрейда ────────────────────
   Кнопка над боксом ставки: иконка с подписью, чтобы было понятно, что внутри */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.tool-btn:hover { color: var(--text); }
.tool-btn .ico { width: 17px; height: 17px; }

/* Динамик с выезжающим ползунком громкости. Ползунок вынут из потока и лежит
   поверх соседних кнопок: они гаснут под ним, а не разъезжаются в стороны. */
.sound-ctl { position: relative; display: flex; align-items: center; }
.sound-ctl.muted #soundBtn { color: var(--muted); }
.sound-ctl input[type="range"] {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 5;
  margin-left: 6px;
  width: 0;
  opacity: 0;
  padding: 0;
  /* Пока свёрнут — прозрачен для мыши. Иначе его бегунок, который рисуется
     шире самой дорожки, ловит курсор поверх молнии и открывает ползунок. */
  pointer-events: none;
  transform: translateY(-50%);
  transition: width 0.2s ease, opacity 0.2s ease;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 70%) 100% no-repeat,
    var(--panel-3);
}
/* Открыт ровно тогда, когда класс поставил JS. Через :focus-within или :focus
   ползунок залипал бы: после клика по мьюту или после перетаскивания фокус
   остаётся внутри и удерживает его открытым, хотя курсор уже ушёл. */
.sound-ctl.open input[type="range"] { width: 92px; opacity: 1; pointer-events: auto; }
.sound-ctl.muted input[type="range"] { background: var(--panel-3); }
/* Молния под ползунком: плавно исчезает, а не отодвигается */
.sound-ctl.open + .tool-btn {
  opacity: 0;
  pointer-events: none;
}
.slot-tools .tool-btn { transition: opacity 0.2s ease, color 0.15s ease; }

/* Как работает апгрейд */
.info-modal { max-width: 560px; }
.how-list { list-style: none; display: flex; flex-direction: column; gap: 14px; padding: 6px 0 2px; }
.how-list li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.45; font-size: 13px; }
.how-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.set-modal { max-width: 560px; }
.set-head-ico { color: var(--accent); line-height: 0; margin-right: 8px; }
.set-head-ico .ico { width: 17px; height: 17px; vertical-align: -3px; }
.modal-head h3 { display: inline-flex; align-items: center; }

.set-body { display: flex; flex-direction: column; gap: 20px; padding: 4px 0 2px; }
.set-section { display: flex; flex-direction: column; gap: 10px; }
.set-section h4 { font-size: 15px; font-weight: 800; }
.set-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.set-reset-all {
  background: none;
  border: none;
  color: var(--accent-2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.set-reset-all:hover { text-decoration: underline; }

.set-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.set-col .hint { line-height: 1.35; }
.set-inputs { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.set-in {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 40px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.set-in:focus-within { border-color: var(--accent); }
.set-in input {
  width: 100%;
  min-width: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.set-in input::-webkit-outer-spin-button,
.set-in input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-in-pre, .set-in-post { color: var(--muted); font-size: 12px; }
.set-reset {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 9px;
  background: none;
  border: none;
  color: var(--accent-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.set-reset:hover { background: rgba(51, 144, 236, 0.14); }

/* Радио-строка: точка, заголовок и пояснение под ним */
.set-opt { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
/* Своя отрисовка вместо системной: серая окружность, внутри которой при
   выборе появляется синяя точка — как у выбора валюты */
.set-opt input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.set-opt input::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.15s ease;
}
.set-opt input:checked { border-color: var(--accent); }
.set-opt input:checked::after { transform: scale(1); }
.set-opt:hover input:not(:checked) { border-color: var(--accent-2); }
.set-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-opt-text b { font-size: 13px; font-weight: 700; }
.set-opt-text .hint { line-height: 1.35; }
.set-opt:hover b { color: var(--accent-2); }
.set-save { width: 100%; height: 46px; margin-top: 18px; font-size: 14px; }

@media (max-width: 560px) {
  .set-cols { grid-template-columns: 1fr; }
}

/* ── Тайный апгрейд ────────────────────────
   Едкий сине-фиолетовый дым: в барабане — круг под логотипом, в боксе цели —
   вся площадь. Дым — два слоя радиальных пятен, дрейфующих в противофазе. */
/* Плашка — шапка бокса: единое целое с ним, во всю ширину, над туманом */
.mystery-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(115deg, rgba(31, 220, 127, 0.28), rgba(5, 24, 14, 0.9) 55%, rgba(84, 255, 216, 0.2));
  border-bottom: 1px solid rgba(80, 255, 180, 0.45);
  color: #d9ffe9;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 6px rgba(2, 14, 8, 0.9);
  position: relative;
  z-index: 3;
}
.mystery-note .ico { width: 15px; height: 15px; color: #54ffd8; flex-shrink: 0; }

/* Карточка приза под шапкой: верхние углы без скругления, чтобы между шапкой
   и картинкой не было просветов; верхний ряд показателей чуть ниже */
body.mystery #targetCard .slot-pick { border-radius: 0 0 16px 16px; }
body.mystery #targetCard .slot-pick .pick-name { top: 14px; }
body.mystery #targetCard .slot-pick .pick-close { top: 9px; right: 9px; }
body.mystery #targetCard .slot-pick .src { top: 9px; left: 9px; }

/* Режим включён: кислота в кнопке течёт быстрее и разгорается ярче */
.preset-help.active {
  animation: acid-flow 2.2s ease-in-out infinite alternate;
  box-shadow: 0 0 24px rgba(31, 220, 127, 0.85), inset 0 0 12px rgba(84, 255, 216, 0.35);
  filter: brightness(1.18) saturate(1.15);
}

/* Барабан: трек залит кислотным градиентом (рисует canvas), проценты и
   множитель спрятаны, а логотип загорается фиолетово-голубым туманом.
   ВАЖНО: логотип центрируется через transform, поэтому анимируем только
   filter и opacity — анимация transform смещала его в угол. */
body.mystery .wheel-info { display: none; }

/* Логотип, залитый текучей кислотой: div с маской по форме PNG, внутри —
   движущиеся косые полосы кислоты. Позиция задаётся тем же translate, что и
   у самого логотипа; анимируется только background и filter. */
.wheel-logo-acid {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  height: 72%;
  transform: translate(-50%, calc(-50% + 10px));
  -webkit-mask: url('/img/logo.png') center / contain no-repeat;
  mask: url('/img/logo.png') center / contain no-repeat;
  background: linear-gradient(120deg,
    #064027, #0f9e5c 26%, #075232 50%, #12b86b 74%, #064027);
  background-size: 320% 320%;
  filter: saturate(1.25) drop-shadow(0 0 22px rgba(15, 140, 80, 0.55));
  animation: acid-flow 6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 2;
}
body.mystery .wheel-logo-acid { display: block; }
/* Сам серый логотип остаётся подложкой-глубиной */
body.mystery .wheel-logo { opacity: 0.18; }
@keyframes acid-flow {
  from { background-position: 0% 40%; }
  to   { background-position: 100% 60%; }
}
/* «Химичится»: кислота в логотипе переливается быстрее и вспыхивает */
body.mystery .wheel-wrap.brewing .wheel-logo-acid {
  animation: acid-flow 1s ease-in-out infinite alternate, logo-brew 0.5s ease-in-out infinite alternate;
}
@keyframes logo-brew {
  from { filter: saturate(1.25) brightness(1) drop-shadow(0 0 18px rgba(13, 143, 85, 0.7)); }
  to   { filter: saturate(1.5) brightness(1.35) drop-shadow(0 0 40px rgba(31, 220, 127, 0.85)); }
}

/* Бокс цели в тайном режиме. Плашка сверху — отдельная шапка, поэтому кислота
   скругляется только снизу. Всю графику рисует канвас (acid.js). */
.myst {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 240px;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  background: #041309;   /* кадр канваса ещё не пришёл — не мигаем белым */
}
.acid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* Раскрытие: канвас-кислота лежит поверх карточки приза и тает */
.slot-card.filled .slot-body { position: relative; }
.myst.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  min-height: 0;
  pointer-events: none;
  /* Прозрачным должен становиться весь оверлей, а не только канвас: фон
     контейнера и кольцо-узор иначе закрывали бы карточку после раскрытия */
  background: transparent;
}
.myst.overlay .myst-halo,
.myst.overlay .myst-stage { display: none; }
/* Буря: витрина и кольцо гаснут, кипение рисует канвас */
.myst.storm .myst-stage { opacity: 0; }
.myst.storm .myst-halo { opacity: 0.2; }

/* Кольцо-узор позади подарка: полупрозрачный круг с вращающимися насечками —
   перекликается с барабаном слева */
.myst-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 62%;
  max-width: 230px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(140, 255, 190, 0.32);
  box-shadow:
    0 0 34px rgba(31, 220, 127, 0.38),
    inset 0 0 30px rgba(84, 255, 216, 0.2);
  transition: opacity 0.6s ease;
}
.myst-halo::before {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.4) 0deg 1.4deg, transparent 1.4deg 7.2deg);
  -webkit-mask: radial-gradient(closest-side, transparent 82%, #000 84% 97%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 82%, #000 84% 97%, transparent 100%);
  animation: halo-spin 28s linear infinite;
}
.myst-halo::after {
  content: '';
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
@keyframes halo-spin { to { transform: rotate(360deg); } }

/* Витрина: подарок проявляется и тает с одинаковой скоростью; пауза между
   предметами задаётся в JS (SHOWCASE_GAP_MS) */
.myst-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.myst-item {
  position: relative;
  width: 54%;
  max-width: 195px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 3.6s = SHOWCASE_VISIBLE_MS: вход 0.75s, показ 2.1s, уход 0.75s */
  animation: item-cycle 3.6s ease-in-out both;
}
/* Тёмный ореол-подложка: отделяет подарок от кислоты позади */
.myst-item::before {
  content: '';
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(2, 14, 8, 0.85), rgba(2, 14, 8, 0.4) 55%, transparent 78%);
  filter: blur(6px);
}
.myst-item img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.45))
    drop-shadow(0 0 40px rgba(60, 255, 170, 0.6))
    saturate(115%);
}
@keyframes item-cycle {
  0%    { opacity: 0; transform: scale(0.92); filter: blur(9px); }
  21%   { opacity: 1; transform: scale(1);    filter: blur(0); }
  79%   { opacity: 1; transform: scale(1);    filter: blur(0); }
  100%  { opacity: 0; transform: scale(0.94); filter: blur(9px); }
}

@media (prefers-reduced-motion: reduce) {
  .myst-item, .myst-stage, .myst-halo::before, .wheel-logo-acid { animation: none; }
}

/* ── Вход ──────────────────────────────────
   Гость видит витрину, но играть не может: панели заменяются приглашением,
   а активные контролы гаснут. */
.btn.login {
  height: var(--ctl-h);
  padding: 0 16px;
  background: linear-gradient(135deg, #2b9df4, var(--accent));
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(51, 144, 236, 0.3);
}
.btn.login:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, #2b9df4, var(--accent)); }

.auth-block {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 42px 16px;
  text-align: center;
}
.auth-block b { font-size: 17px; font-weight: 800; }
.auth-block .btn { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.auth-block .btn .ico { width: 16px; height: 16px; }

/* Кабинет гостя */
.auth-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 20px;
  text-align: center;
}
.auth-card h3 { font-size: 19px; font-weight: 800; }
.auth-ico { color: var(--accent); line-height: 0; }
.auth-ico .ico { width: 34px; height: 34px; }
.auth-card .btn { margin-top: 6px; }

/* Пока гость: слоты и кнопка апгрейда явно неактивны */
body.guest .slot-card { opacity: 0.75; }
body.guest #betCard { cursor: pointer; }
body.guest .upgrade-btn:disabled,
body.guest .preset:disabled { filter: grayscale(0.6); }

.auth-modal { max-width: 380px; }
.tg-login { display: flex; justify-content: center; min-height: 48px; padding: 6px 0 2px; }
.auth-note { text-align: center; padding: 6px 4px; }


.acct-logout { color: var(--muted); }
.acct-logout:hover { color: var(--red); border-color: rgba(230, 77, 68, 0.45); }

/* ── Нижний блок сайта ─────────────────── */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  margin-top: 28px;
  margin-left: 222px;   /* 200px ленты плюс зазор от её края */
}
.site-footer-in {
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px 22px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 26px;
}
.foot-brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.foot-brand .logo-mark { width: 52px; height: 52px; margin: -13px -8px; }
.foot-brand .wordmark { font-size: 19px; }
.foot-tagline { color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 250px; }
.foot-social {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.foot-social:hover { color: var(--accent); background: var(--panel-3); border-color: rgba(51, 144, 236, 0.4); }
.foot-social .ico { width: 20px; height: 20px; }

.foot-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.foot-col h4 { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.foot-col a { color: var(--text); font-size: 13px; text-decoration: none; transition: color 0.15s; }
.foot-col a:hover { color: var(--accent); }

/* Переключатель языка устроен как тумблер инвентарь/магазин: кнопки не
   вжимаются, подложка едет между половинами */
.lang-switch {
  position: relative;
  display: inline-flex;
  gap: 3px;
  margin-top: 2px;
  padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: fit-content;
}
.lang-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 42px;
  height: calc(100% - 6px);
  border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(51, 144, 236, 0.35);
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-switch.en::before { transform: translateX(calc(100% + 3px)); }
.lang-switch button {
  position: relative;
  z-index: 1;
  width: 42px;
  padding: 6px 0;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s;
}
.lang-switch button:hover:not(.active) { color: var(--text); }
.lang-switch button.active { color: #fff; }

.site-footer-bottom {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.foot-age {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-weight: 700;
}

/* Кнопка поддержки: всегда в правом нижнем углу */
.support-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b9df4, var(--accent));
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(51, 144, 236, 0.45);
  transition: filter 0.15s;
}
.support-fab:hover { filter: brightness(1.08); }
.support-fab .ico { width: 24px; height: 24px; }

/* ── Адаптив: лестница брейкпоинтов, строго от широких к узким ──────────────
   1100 → 900 → 800 → 700 → 600 → 480. Правило номер один: кнопка «Апгрейд»
   видна на ЛЮБОЙ ширине — прежний display:none у .ctl-mid на ≤900px прятал
   единственную кнопку игры, и на телефонах играть было невозможно. */

/* ≤1100: нижние панели и кабинет в одну колонку */
@media (max-width: 1100px) {
  .bottom-row { grid-template-columns: 1fr; }
  .acct-top { grid-template-columns: 1fr; }
  .site-footer-in { grid-template-columns: 1fr 1fr; }
  .hist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ≤900: компоновка как у мобильных апгрейдеров — иконки инструментов,
   под ними крупный барабан, под ним ДВА бокса рядом, сразу под боксами
   широкая кнопка «Апгрейд», дальше ползунок и пресеты */
@media (max-width: 900px) {
  .upgrade-row { grid-template-columns: 1fr 1fr; }
  /* Колонки распускаются в общую сетку: панель инструментов и слоты
     позиционируются независимо от своих обёрток */
  .slot-col { display: contents; }
  .slot-tools { grid-column: 1 / -1; order: -2; justify-content: center; }
  .slot-tools:empty { display: none; }
  .wheel-wrap { grid-column: 1 / -1; order: -1; margin: 0 auto; }
  /* Высота бокса ФИКСИРОВАНА: пустой и заполненный слот выглядят одинаково,
     ничего не прыгает при выборе предмета. На десктопе высоту держит
     грид-строка (колонки равняются на барабан), здесь её нет —
     без фиксации заполненный слот схлопывался в полоску. */
  .slot-card { height: 200px; min-height: 0; overflow: hidden; }
  .slot-body { min-height: 0; }
  /* Плашка-спойлер тайного режима на телефоне съедает половину бокса */
  .mystery-note { display: none; }

  .controls-row { grid-template-columns: 1fr; }
  /* Кнопка — первой, сразу под боксами, во всю ширину и заметная */
  .ctl-mid { order: -1; display: flex; justify-content: center; }
  .upgrade-btn { width: 100%; max-width: none; min-height: 50px; font-size: 16px; }
}

/* ≤800: лента из сайдбара превращается в горизонтальную полосу под шапкой;
   шапка ужимается — без иконок счётчиков и с меньшими зазорами она
   помещается и на 768 */
@media (max-width: 800px) {
  .topbar { gap: 12px; padding: 10px 12px; }
  .topbar .stat-ico { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .side-feed { display: flex; min-height: 0; }
  .side-card, .side-card.top { flex: 0 0 200px; min-height: 64px; border-bottom: 0; border-right: 1px solid var(--line); }
  .side-empty { white-space: nowrap; }
  /* Вертикальные анимации въезда карточек в горизонтальной полосе выглядят
     поломкой — новые дропы просто появляются */
  .side-feed .side-card { animation: none !important; }
  .site-footer { margin-left: 0; }
  /* Ровно 3 карточки в ряд: с PAGE_SIZE = 9 панель занимает 3 ряда */
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ≤700: фильтры панелей переносятся на вторую строку, футер в одну колонку */
@media (max-width: 700px) {
  .panel-head { flex-wrap: wrap; }
  .filters { flex-wrap: wrap; }
  .filters .search-wrap { flex: 1 1 140px; }
  .site-footer-in { grid-template-columns: 1fr; }
  .hist-grid { grid-template-columns: 1fr; }
}

/* Мобильные табы нижних панелей: на десктопе скрыты — панели стоят рядом */
.pane-tabs { display: none; }
@media (max-width: 800px) {
  .pane-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 5px;
  }
  .pane-tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    padding: 10px 6px;
    border-radius: 9px;
    cursor: pointer;
  }
  .pane-tab.active { background: var(--panel-3); color: var(--text); }
  .bottom-row { margin-top: 10px; }
  /* Видна одна панель — выбранная табом */
  .bottom-row.tab-market .panel:first-child { display: none; }
  .bottom-row:not(.tab-market) .panel:last-child { display: none; }
}

/* ≤600: компактная шапка — без wordmark и иконок счётчиков, кошелёк иконкой */
@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 8px 10px; }
  .topbar .logo .wordmark { display: none; }
  .topbar .stat { gap: 6px; }
  .topbar .stat-ico { display: none; }
  #topupBtn span { display: none; }
  .page-title .wordmark { font-size: 22px; letter-spacing: 0.1em; }
}

/* ≤480: у шапки остаётся только суть — баланс, вход, аккаунт.
   Боксы НАМЕРЕННО остаются парой (как в референсах мобильных апгрейдеров):
   в столбик они превращаются в две пустые простыни. */
@media (max-width: 480px) {
  .topbar .stat { display: none; }
  .slot-card { height: 172px; }
}

