/*
 * Оболочка приложения (js/shell.js): вкладки и карточки.
 * Палитра — тёмно-серый фон, карточки, сине-фиолетовые градиенты.
 * Подключается после theme-neon.css и переводит в эту же палитру остальные панели.
 */
:root {
  --sh-bg: #1a212b;
  --sh-card: #252e3a;
  --sh-card-2: #2c3644;
  --sh-line: rgba(255, 255, 255, 0.06);
  --sh-text: #f4f6fa;
  --sh-muted: #8d99ab;
  --sh-blue: #5aa2ff;
  --sh-violet: #7b61ff;
  --sh-grad: linear-gradient(100deg, #5aa2ff 0%, #7b61ff 100%);
  --sh-green: #4ade80;
  --sh-font: "Inter", "Montserrat", system-ui, sans-serif;

  /* Переводим неоновую тему (магазин, лидерборд, экран проигрыша) в ту же палитру */
  --panel-bg: var(--sh-card);
  --tile-bg: var(--sh-card-2);
  --neon: #7b61ff;
  --neon-soft: rgba(123, 97, 255, 0.35);
  --neon-glow: rgba(90, 120, 255, 0.18);
  --cyan: #5aa2ff;
  --cyan-glow: rgba(90, 162, 255, 0.3);
  --ink: var(--sh-text);
  --ink-dim: var(--sh-muted);
  --ui-font: var(--sh-font);
}

.theme-neon body { background: var(--sh-bg); }
.theme-neon #overlay { background: var(--sh-bg); }
.theme-neon .panel { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); border-color: var(--sh-line); }

/* ── Режим оболочки: меню-двигатель скрыто, оболочка на весь экран ── */
#appShell[hidden] { display: none !important; }
.shell-on #overlay { padding: 0; align-items: stretch; }
.shell-on #overlay > .overlay-stack { display: none; }

#appShell {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--sh-bg);
  color: var(--sh-text);
  font-family: var(--sh-font);
}
.sh-screen {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, calc(var(--tg-inset-top, 0px) + 8px)) 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
/* Карточки не сжимаются по высоте — иначе flex сплющивает списки (обрезая их),
   вместо того чтобы дать экрану прокручиваться. */
.sh-screen > * { flex-shrink: 0; }
.sh-screen { touch-action: pan-y; }

/* :where() — нулевой вес, чтобы классы карточек ниже перекрывали сброс */
:where(#appShell) button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
:where(#appShell) button:active { transform: scale(0.98); }
.sh-ico { width: 22px; height: 22px; flex-shrink: 0; }
.sh-chev { width: 20px; height: 20px; opacity: 0.7; margin-left: auto; }
.sh-muted { color: var(--sh-muted); font-size: 0.86rem; line-height: 1.35; }

/* ── Шапка главной ── */
.sh-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.sh-head__text { flex: 1; min-width: 0; }
.sh-hello { color: var(--sh-muted); font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.sh-title { font-size: 1.85rem; line-height: 1.12; font-weight: 800; letter-spacing: -0.01em; }
.sh-page-title { font-size: 2rem; font-weight: 800; margin: 6px 0 4px; }
.sh-lead { margin-top: -6px; }

.sh-level {
  position: relative;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.sh-level svg { width: 64px; height: 72px; }
.sh-level__num {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 800;
}
.sh-level__lbl {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.62rem;
  color: var(--sh-muted);
}
.sh-level__sub { margin-top: 2px; font-size: 0.72rem; font-weight: 700; color: var(--sh-blue); white-space: nowrap; }

/* ── Широкие карточки ── */
.sh-wide {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line);
}
.sh-wide--quests { background: linear-gradient(100deg, #6d7dff, #8b5cf6); border: 0; }
.sh-wide__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}
.sh-wide--static .sh-wide__icon,
.sh-wide--level .sh-wide__icon { border-radius: 14px; }
.sh-wide__icon--violet { background: linear-gradient(135deg, #6d7dff, #8b5cf6); }
.sh-wide__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sh-wide__row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.95rem; }
.sh-wide__row span { font-weight: 700; opacity: 0.9; }
.sh-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.sh-wide--level .sh-bar { background: rgba(255, 255, 255, 0.08); }
.sh-bar i { display: block; height: 100%; border-radius: inherit; background: var(--sh-grad); }
.sh-wide--quests .sh-bar i { background: rgba(255, 255, 255, 0.85); }
.sh-badge {
  padding: 5px 10px;
  border-radius: 99px;
  background: #fff;
  color: #6d5cf6;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}
.sh-hexmini {
  background: var(--sh-card-2) !important;
  border: 2px solid var(--sh-violet);
  font-weight: 800;
  color: var(--sh-text);
}

/* ── Заголовок секции + «онлайн» ── */
.sh-section { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
.sh-section .sh-ico { width: 18px; height: 18px; vertical-align: -3px; }
.sh-online {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sh-green);
  background: rgba(74, 222, 128, 0.12);
}

/* ── Главная карточка «Играть» ── */
.sh-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 132px;
  padding: 20px;
  border-radius: 24px;
  background: var(--sh-grad);
  box-shadow: 0 10px 30px rgba(90, 120, 255, 0.28);
}
.sh-hero__art {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}
.sh-hero__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sh-hero__title { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.sh-hero__sub { font-size: 0.88rem; opacity: 0.92; line-height: 1.3; }

.sh-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-pill-btn {
  padding: 10px 6px;
  border-radius: 14px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line) !important;
  text-align: center !important;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--sh-muted) !important;
}
.sh-pill-btn.is-on { color: var(--sh-text) !important; border-color: var(--sh-blue) !important; background: rgba(90, 162, 255, 0.12); }

/* ── Сетка 2 карточки ── */
.sh-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sh-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 16px;
  border-radius: 22px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line) !important;
}
.sh-card b { font-size: 1.05rem; line-height: 1.2; margin-top: auto; }
.sh-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.sh-card__icon--violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.sh-card__icon--blue { background: linear-gradient(135deg, #60a5fa, #6366f1); }
.sh-green { color: var(--sh-green); font-weight: 700; font-size: 0.85rem; }
.sh-gold { color: #fbbf24; font-weight: 700; font-size: 0.85rem; }

.sh-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(100deg, #34d399, #3b82f6);
  line-height: 1.3;
}
.sh-banner span span { font-size: 0.85rem; opacity: 0.9; }
.sh-banner__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

/* ── Комнаты ── */
.sh-row { display: flex; gap: 10px; }
.sh-primary {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border-radius: 99px;
  background: var(--sh-grad) !important;
  font-weight: 700;
  text-align: center !important;
}
.sh-round {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid !important;
  place-items: center;
  background: var(--sh-card) !important;
}
.sh-list { display: flex; flex-direction: column; gap: 12px; }
.sh-room {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line) !important;
}
.sh-room__title { font-weight: 800; font-size: 1.1rem; }
.sh-room__sub { color: var(--sh-muted); font-size: 0.85rem; }
.sh-room__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--sh-muted); font-weight: 700; font-size: 0.85rem; }
.sh-avas { display: flex; }
.sh-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  border: 2px solid var(--sh-card);
  margin-left: -6px;
}
.sh-ava:first-child { margin-left: 0; }
.sh-ava--0 { background: #f472b6; }
.sh-ava--1 { background: #60a5fa; }
.sh-ava--2 { background: #a78bfa; }
.sh-ava--3 { background: #34d399; }
.sh-ava--4 { background: #fbbf24; }
.sh-empty {
  padding: 24px 16px;
  border-radius: 20px;
  background: var(--sh-card);
  text-align: center;
  color: var(--sh-muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

/* ── Режимы: большие цветные карточки ── */
.sh-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sh-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 230px;
  padding: 16px 14px 14px;
  border-radius: 24px;
  overflow: hidden;
  text-align: center !important;
  align-items: center;
}
.sh-mode--space { background: linear-gradient(160deg, #6366f1, #9333ea); }
.sh-mode--obst { background: linear-gradient(160deg, #fb923c, #ef4444); }
.sh-mode--def { background: linear-gradient(160deg, #38bdf8, #2563eb); }
.sh-mode.is-on { box-shadow: 0 0 0 3px #fff inset; }
.sh-mode__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #fff;
  color: #1f2937;
  font-size: 0.66rem;
  font-weight: 800;
}
.sh-mode__art { font-size: 3.4rem; margin: 18px 0 4px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25)); }
.sh-mode__title { font-size: 1.3rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.sh-mode__desc { font-size: 0.8rem; opacity: 0.92; line-height: 1.3; }
.sh-mode__foot {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  padding-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.sh-mode__best { width: 100%; opacity: 0.85; font-weight: 600; }
.sh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sh-green); box-shadow: 0 0 6px var(--sh-green); }

/* ── Профиль ── */
.sh-profile { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.sh-avatar {
  width: 96px;
  height: 96px;
  border-radius: 28px;
  object-fit: cover;
  margin-bottom: 6px;
}
.sh-avatar--gen {
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f87171, #ec4899);
}
.sh-profile__name { font-size: 1.5rem; font-weight: 800; }
.sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.sh-stats div {
  padding: 14px 6px;
  border-radius: 18px;
  background: var(--sh-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sh-stats b { font-size: 1.3rem; font-weight: 800; }
.sh-stats span { font-size: 0.78rem; color: var(--sh-muted); }
.sh-menu { display: flex; flex-direction: column; border-radius: 20px; background: var(--sh-card); overflow: hidden; }
.sh-menu__row,
.sh-set {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--sh-line) !important;
  font-weight: 600;
}
.sh-menu__row:last-child,
.sh-set:last-child { border-bottom: 0 !important; }
.sh-menu__row .sh-ico:first-child { color: var(--sh-blue); }
.sh-set b { margin-left: auto; color: var(--sh-blue); font-weight: 700; }

/* ── Нижняя панель вкладок ── */
.sh-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px max(8px, calc(var(--tg-inset-bottom, 0px) + 4px));
  background: #151b23;
  border-top: 1px solid var(--sh-line);
}
.sh-tab {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-radius: 12px;
  color: var(--sh-muted) !important;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center !important;
}
.sh-tab.is-on { color: var(--sh-blue) !important; }

@media (max-width: 360px) {
  .sh-title { font-size: 1.55rem; }
  .sh-hero__title { font-size: 1.45rem; }
  .sh-mode__art { font-size: 2.8rem; }
}

/* ── Окно мультиплеера в палитре оболочки ── */
.theme-neon .multiplayer-room,
.theme-neon .multiplayer-results {
  border: 1px solid var(--sh-line);
  border-radius: 16px;
  background: var(--sh-card-2);
  font-family: var(--sh-font);
  line-height: 1.5;
}
.theme-neon .multiplayer-results { border-color: rgba(251, 191, 36, 0.35); }
.theme-neon .multiplayer-capacity label {
  border: 1px solid var(--sh-line);
  border-radius: 12px;
  background: var(--sh-card-2);
  font-family: var(--sh-font);
}
.theme-neon .multiplayer-join input {
  border: 1px solid var(--sh-line);
  border-radius: 12px;
  background: var(--sh-bg);
  color: var(--sh-text);
  font-family: var(--sh-font);
}
.theme-neon .multiplayer-help { color: var(--sh-muted); }

/* ── Остальные экраны (проигрыш, магазин, задания…) в палитре оболочки ── */
.theme-neon .panel .btn,
.theme-neon .segmented-tab,
.theme-neon .shop-btn,
.theme-neon .sound-toggle {
  background: var(--sh-card-2) !important;
  border: 1px solid var(--sh-line) !important;
  box-shadow: none !important;
  font-family: var(--sh-font);
}
.theme-neon .panel .btn:hover,
.theme-neon .segmented-tab:hover { border-color: rgba(90, 162, 255, 0.5) !important; box-shadow: none !important; }
.theme-neon .mode-switch .mode-chip.mode-chip--active,
.theme-neon .segmented-tab.segmented-tab--active {
  background: rgba(90, 162, 255, 0.14) !important;
  border-color: var(--sh-blue) !important;
  color: var(--sh-text) !important;
  box-shadow: none !important;
}
.theme-neon .panel .btn.menu-start-btn {
  background: var(--sh-grad) !important;
  border: 0 !important;
  box-shadow: 0 10px 30px rgba(90, 120, 255, 0.3) !important;
  font-family: var(--sh-font);
}
.theme-neon .menu-start-btn::before { filter: none; }
.theme-neon #menuPanel.is-gameover #title {
  font-family: var(--sh-font);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--sh-muted);
  text-shadow: none;
}
.theme-neon .go-stats__value { font-family: var(--sh-font); text-shadow: none; }
.theme-neon .go-stats__record {
  border: 0;
  background: linear-gradient(100deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: none;
}
.theme-neon .go-home-btn { background: var(--sh-card-2); border: 1px solid var(--sh-line); box-shadow: none; }
.theme-neon .go-share-btn { background: var(--sh-grad); border: 0; color: #fff; box-shadow: none; }
.theme-neon .settings-fab { background: var(--sh-card-2); border-color: var(--sh-line); box-shadow: none; }
.theme-neon .shop-panel-heading { font-family: var(--sh-font); font-weight: 800; text-shadow: none; color: var(--sh-text); }
.theme-neon .overlay-wallet-line { font-family: var(--sh-font); text-shadow: none; }
.theme-neon .panel { border-radius: 24px; }

/* ── Прокрутка экранов поверх меню (магазин, лидерборд, задания…) ──
   Раньше панель была ограничена 92vh (без учёта шапки Telegram и строки монет —
   низ уходил за экран), а сетка магазина и таблицы листались в своих окошках
   внутри листающейся панели. Теперь: панель занимает доступную высоту и
   листается целиком, одним скроллом. */
.theme-neon #overlay > .overlay-stack {
  max-height: 100%;
  min-height: 0;
}
.theme-neon .overlay-stack > .panel {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.theme-neon .shop-grid,
.theme-neon .lb-body,
.theme-neon .mountain-lb-body {
  max-height: none;
  overflow: visible;
}

/* ── Донатные скины — такие же карточки, как обычные (та же сетка) ── */
.theme-neon .shop-grid.shop-grid--iap { display: block; }
.theme-neon .shop-iap-mini-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: none;
}
.theme-neon .shop-iap-mini-row > .shop-card.shop-card--trinity {
  width: auto;
  max-width: none;
  height: auto;
}
.theme-neon .shop-iap-mini-row .shop-card--trinity .shop-card__pic,
.theme-neon .shop-iap-mini-row .shop-card--trinity .shop-card__pic-canvas,
.theme-neon .shop-iap-mini-row .shop-card--trinity .shop-iap-stub-visual {
  width: 100%;
  margin-inline: 0;
}
.theme-neon .shop-iap-mount { overflow: visible; }
/* Заглушка «Скоро — отдельный донат в разработке» ничего не продаёт */
.theme-neon .shop-card--iap-stub { display: none; }
/* «Покупки доступны через Telegram-бота» — в самом Telegram это лишнее */
.tg-app .shop-trinity__offline { display: none; }

/* ── Админка: статистика ── */
.sh-backlink { display: inline-flex !important; align-items: center; gap: 4px; color: var(--sh-blue) !important; font-weight: 700; align-self: flex-start; }
.sh-flip { transform: rotate(180deg); width: 18px; height: 18px; }
.sh-inline { color: var(--sh-blue) !important; font-weight: 700; text-decoration: underline; }
.sh-adm-tag {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(123, 97, 255, 0.2);
  color: #b9a8ff;
  font-size: 0.7rem;
  font-weight: 800;
}
.sh-menu__row .sh-adm-tag { margin-left: auto; }
.sh-menu__row .sh-adm-tag + .sh-chev { margin-left: 8px; }
.sh-adm-rec,
.sh-adm-player {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sh-line);
  font-size: 0.88rem;
}
.sh-adm-rec span { color: var(--sh-muted); }
.sh-adm-rec b { margin-left: auto; text-align: right; }
.sh-adm-player { flex-direction: column; gap: 4px; }
.sh-adm-player .sh-muted { margin-left: 6px; }
.sh-adm-player div.sh-muted { margin-left: 0; font-size: 0.8rem; }
.sh-adm > :last-child { border-bottom: 0; }

/* ── Никакой прокрутки вбок ──
   overflow-y:auto включает и горизонтальную прокрутку: хватало одного элемента
   шире экрана (на iPhone — <select> в редакторе Троицы растягивается по самому
   длинному названию умения), чтобы экран начинал листаться вправо. */
.theme-neon .panel,
.sh-screen,
.theme-neon .skill-modal__panel,
.theme-neon .pre-run-scroll,
.theme-neon .shop-grid,
.theme-neon .lb-body {
  overflow-x: hidden;
}
.theme-neon .shop-card,
.theme-neon .lb-row,
.theme-neon .meta-card-list > *,
.sh-screen > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.theme-neon select,
.theme-neon .shop-trinity-slot__select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
/* Троица с редактором умений — на всю ширину сетки, иначе шести спискам тесно */
.theme-neon .shop-iap-mini-row > .shop-card--trinity:has(.shop-trinity-slot__select) {
  grid-column: 1 / -1;
}
.theme-neon .multiplayer-join input { min-width: 0; flex: 1 1 120px; }
.theme-neon .shop-iap-mini-row > .shop-card--trinity:has(.shop-trinity-slot__select) .shop-card__pic,
.theme-neon .shop-iap-mini-row > .shop-card--trinity:has(.shop-trinity-slot__select) .shop-card__pic-canvas {
  width: min(150px, 50%);
  margin-inline: auto;
}

/* «Оборона» скрыта, пока режим не доведён */
#modeDefenseChip { display: none !important; }

/* ── Прокачка скинов ── */
.sh-wide--upgrade { background: linear-gradient(100deg, #1f3b5c, #3b2a6b); border: 0; }
.sh-skin-thumb { width: 72px; height: 72px; border-radius: 16px; background: #1b1330; flex-shrink: 0; }
.sh-skin-thumb--sm { width: 48px; height: 48px; border-radius: 12px; }
.sh-skin-thumb--lg { width: 132px; height: 132px; border-radius: 28px; }
.sh-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sh-skin-card {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 20px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line) !important;
  text-align: center !important;
}
.sh-skin-card.is-on { border-color: var(--sh-blue) !important; }
.sh-skin-card .sh-bar { width: 100%; background: rgba(255, 255, 255, 0.08); }
.sh-skin-card__lvl { color: var(--sh-blue); font-weight: 800; font-size: 0.9rem; }
.sh-skin-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 6px; }
.sh-skin-hero__lvl { font-size: 1.05rem; }
.sh-skin-hero__lvl b { font-size: 1.5rem; }
.sh-primary--sm { flex: 0 0 auto; min-height: 42px; padding: 0 18px; }
.sh-primary--ghost { background: var(--sh-card) !important; border: 1px solid var(--sh-line) !important; }
.sh-primary[disabled], .sh-chip[disabled] { opacity: 0.4; pointer-events: none; }
.sh-break { align-items: center; border-color: rgba(251, 191, 36, 0.4); }
.sh-train { flex-direction: column; align-items: stretch; gap: 10px; }
.sh-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-chip {
  min-height: 42px;
  border-radius: 12px;
  background: var(--sh-card-2) !important;
  border: 1px solid var(--sh-line) !important;
  font-weight: 800;
  text-align: center !important;
  color: var(--sh-text) !important;
}
.sh-perks { padding: 4px 0; }
.sh-perk { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--sh-line); opacity: 0.55; }
.sh-perk:last-child { border-bottom: 0; }
.sh-perk.is-open { opacity: 1; }
.sh-perk__lvl {
  flex-shrink: 0;
  min-width: 56px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--sh-card-2);
  color: var(--sh-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}
.sh-perk.is-open .sh-perk__lvl { background: rgba(74, 222, 128, 0.15); color: var(--sh-green); }
.sh-perk__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* Опыт за забег на экране «Всё. Конец.» */
.go-xp { margin: -2px 0 8px; font-weight: 700; color: #b9a8ff; font-size: 0.95rem; }
.go-xp[hidden] { display: none; }
.go-xp b { color: #fff; }

/* Подсказка в забеге: короткая и исчезает через 4 с, чтобы не закрывать поле */
@keyframes hud-hint-fade { to { opacity: 0; visibility: hidden; } }
/* Только в Преградах: в Космосе в эту строку приходит предупреждение о фазе босса */
body.mountain-active.game-playing #hud #hint { animation: hud-hint-fade 0.6s ease 4s forwards; }
#hud .hint { max-width: min(80vw, 320px); margin-inline: auto; }

/* ── Магазин (оболочка) ── */
.sh-shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sh-coins {
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-weight: 800;
}
.sh-pills--2 { grid-template-columns: repeat(2, 1fr); }
.sh-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sh-shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 12px;
  border-radius: 20px;
  background: var(--sh-card);
  border: 1px solid var(--sh-line);
  text-align: center;
  cursor: pointer;
  min-width: 0;
}
.sh-shop-card.is-on { border-color: var(--sh-blue); box-shadow: 0 0 0 1px var(--sh-blue) inset; }
.sh-shop-card.is-locked .sh-skin-thumb { opacity: 0.75; }
.sh-shop-card__name { font-size: 1.02rem; }
.sh-shop-card__brief {
  color: var(--sh-muted);
  font-size: 0.78rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.sh-shop-card__meta { color: var(--sh-blue); font-weight: 800; font-size: 0.82rem; }
.sh-shop-card .sh-chip,
.sh-shop-state { width: 100%; margin-top: auto; }
.sh-shop-state {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
}
.sh-shop-state--on { background: rgba(74, 222, 128, 0.12); color: var(--sh-green); }
.sh-chip--blue { background: rgba(90, 162, 255, 0.16) !important; border-color: rgba(90, 162, 255, 0.5) !important; }
.sh-chip--buy { background: var(--sh-grad) !important; border: 0 !important; color: #fff !important; }
.sh-donate {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.22), rgba(236, 72, 153, 0.14)), var(--sh-card);
  border: 1px solid rgba(123, 97, 255, 0.35);
}
.sh-donate .sh-skin-thumb--lg { width: 96px; height: 96px; border-radius: 22px; }
.sh-donate__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sh-donate__name { font-size: 1.15rem; }
.sh-donate__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sh-donate__actions .sh-chip { padding: 0 14px; }
