/* Общая структура сайта.
   Цвета, шрифты и скругления задаются переменными в theme.css.
   Сначала стили для телефона, внизу — добавки для больших экранов. */

* { box-sizing: border-box; }

/* Скрытые фильтром карточки: без этого display: flex у .card пересилит hidden */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: var(--font-size, 16px);
  line-height: 1.5;
}

a { color: inherit; }

/* Видимая рамка у элемента, выбранного с клавиатуры (Tab) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Для тех, у кого в системе включено «уменьшить движение» */
/* Все анимации сайта собраны в разделе «Анимации» в конце файла */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Текст только для экранных чтецов */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* «Перейти к содержимому» — появляется при первом нажатии Tab */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.skip-link:focus { top: 8px; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Плашка «это макет» (на настоящем сайте её не будет) ---------- */

.mockup-bar {
  padding: 6px 16px;
  background: #3b2f00;
  color: #fde68a;
  text-align: center;
  font-size: 14px;
}

/* ---------- Шапка ---------- */

.header {
  position: relative;
  z-index: 20; /* меню игр должно быть поверх прилипающих фильтров */
  background: var(--header-bg, var(--surface));
  border-bottom: 1px solid var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.logo-text span { color: var(--accent-text); }

/* Значок-логотип №2 «Block chart»: цвета берёт из темы и гаммы (--accent, --on-accent) */
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; }
.logo-mark svg { width: 34px; height: 34px; overflow: visible; }
.logo-bg { fill: var(--accent); }
.logo-blocks { fill: var(--on-accent); }
.logo-line { fill: none; stroke: var(--on-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }

/* ---------- Валюта ---------- */

/* В HTML цены есть в обеих валютах; видна только выбранная.
   Класс cur-eur на <html> ставит скрипт в <head>, без него видны доллары. */
html:not(.cur-eur) [data-currency="eur"],
html.cur-eur [data-currency="usd"] {
  display: none !important;
}

.currency-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr; /* обе кнопки одной ширины — по ним ездит «бегунок» */
  flex: none;
  margin-left: auto; /* прижимаем к правому краю, рядом с меню игр */
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small, 10px);
}

.currency-option {
  min-width: 64px;
  min-height: 38px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: calc(var(--radius-small, 10px) - 3px);
  cursor: pointer;
}

/* Белый «бегунок» под выбранной валютой. Он один и переезжает с $ на € (анимация — в конце файла).
   Положение зависит только от класса cur-eur на <html>, поэтому верно сразу при открытии страницы */
.currency-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--surface);
  border-radius: calc(var(--radius-small, 10px) - 3px);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.15);
}
html.cur-eur .currency-switch::before { transform: translateX(100%); }
.currency-option { position: relative; transition: color 0.25s; } /* текст поверх бегунка */

.currency-option[aria-pressed="true"] { color: var(--text); }

/* Сайт не отдаёт эту валюту — цена показана в долларах */
.usd-only {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

/* ---------- Меню выбора игры ---------- */

.game-menu { position: relative; }

/* На телефоне меню игр — отдельная строка на всю ширину под логотипом:
   так название игры помещается целиком и в кнопку легко попасть пальцем */
@media (max-width: 719px) {
  .header .container {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 12px;
    gap: 10px;
  }
  .game-menu { width: 100%; }
  .game-button { width: 100%; }
  .game-button .chevron { margin-left: auto; }
  .game-menu .game-panel { left: 0; width: 100%; }
}

.game-button-name { white-space: nowrap; }

.game-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 12px 6px 6px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small, 10px);
  cursor: pointer;
}

.game-button:hover { border-color: var(--accent); }

.game-button-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.game-button-label {
  font-size: 12px;
  color: var(--muted);
}

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

.chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.15s;
}

.game-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* Квадратный значок игры с короткой подписью */
.game-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.game-icon.large {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 14px;
}

/* Значок игры — официальная иконка Murder Mystery 2 из каталога Roblox (static/games/mm2.png, 128×128).
   Новая игра = ещё одна картинка в static/games/ */
.game-mm2 { overflow: hidden; background: #111; }
.game-icon img { width: 100%; height: 100%; object-fit: cover; }

.game-soon {
  color: var(--muted);
  background: var(--surface-2);
  border: 2px dashed var(--border);
  font-size: 22px;
  font-weight: 400;
}

.game-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 32px));
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}

.game-panel-title {
  margin: 4px 8px 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 10px;
  border-radius: var(--radius-small, 10px);
  text-decoration: none;
}

a.game-option:hover { background: var(--surface-2); }

.game-option[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.game-option-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.3;
}

.game-option-text strong { font-size: 16px; }

.game-option-text small {
  font-size: 14px;
  color: var(--muted);
}

.game-check {
  color: var(--accent-text);
  font-size: 18px;
  font-weight: 800;
}

.game-option.soon { color: var(--muted); }

/* ---------- Время обновления ---------- */

.updated {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.updated::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--good);
}

/* ---------- Редкость: задаёт переменную --r для карточки ---------- */

.r-common { --r: var(--common); }
.r-uncommon { --r: var(--uncommon); }
.r-rare { --r: var(--rare); }
.r-legendary { --r: var(--legendary); }
.r-godly { --r: var(--godly); }
.r-ancient { --r: var(--ancient); }
.r-vintage { --r: var(--vintage); }
.r-unique { --r: var(--unique); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.badge.rarity {
  color: var(--r);
  background: color-mix(in srgb, var(--r) 14%, transparent);
}

.badge.chroma {
  color: #111;
  background: linear-gradient(90deg, #fca5a5, #fde68a, #86efac, #93c5fd, #f9a8d4);
}

/* ---------- Главная: поиск и фильтры ---------- */

.page-title {
  font-size: 26px;
  line-height: 1.2;
  margin: 24px 0 6px;
}

.page-subtitle {
  margin: 0 0 6px;
  color: var(--muted);
}

.filters {
  background: var(--bg);
}

.search {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  font: inherit;
  font-size: 17px; /* не меньше 16px, иначе iPhone приближает страницу при вводе */
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

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

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 12px 0;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.chip {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--chip-radius, 999px);
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* Подпись над выпадающим списком — чтобы было понятно, что он делает */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.select {
  min-height: 46px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small, 10px);
}

.results-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0 12px;
  min-height: 32px;
}

.count {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

.link-button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Главная: карточки предметов ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow, none);
}

.card-image {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--r) var(--glow, 25%), transparent), transparent 70%);
}

.card-image img {
  width: 72%;
  height: auto;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px 12px;
  flex: 1;
}

.card-name {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-price {
  margin-top: auto;
  padding-top: 6px;
  font-size: 19px;
  font-weight: 800;
}

.card-price small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.from {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.sold-out {
  color: var(--muted);
  font-weight: 600;
  font-size: 16px;
}

/* «Show more» под сеткой: сама срабатывает при прокрутке, кнопка — для клавиатуры и на всякий случай */
.more {
  display: flex;
  justify-content: center;
  margin: 0 0 32px;
}

.more-button {
  width: 100%;
  max-width: 320px;
  cursor: pointer;
  font-family: inherit;
}

/* Высота как у кнопки, чтобы страница не прыгала, когда одно сменяет другое */
.more-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

/* Крутящийся кружок. При «уменьшить движение» в системе не крутится (правило в начале файла) */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Реклама: фиксированная высота, чтобы страница не прыгала ---------- */

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 100px;
  margin: 28px 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Страница предмета ---------- */

.back {
  display: inline-block;
  margin: 16px 0;
  padding: 6px 0;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

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

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-image {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--r) var(--glow, 25%), transparent), transparent 70%),
    var(--surface);
}

.hero-image img { width: 75%; height: auto; }

.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.best {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--good-soft);
  border: 1px solid var(--good-border);
}

/* Нигде нет в продаже — не зелёным, чтобы не выглядело как выгодное предложение */
.best.unavailable {
  background: var(--surface);
  border-color: var(--border);
}

.best.unavailable .best-price {
  font-size: 28px;
  color: var(--muted);
}

.best-label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.best-price {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}

.best-site { font-size: 16px; }

.section-title {
  font-size: 22px;
  margin: 32px 0 12px;
}

.offers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow, none);
}

.offer.cheapest {
  border: 2px solid var(--good);
}

.offer-site {
  font-weight: 700;
  font-size: 18px;
}

.offer-tag {
  display: block;
  color: var(--good-text);
  font-size: 14px;
  font-weight: 700;
}

.offer-price {
  font-size: 24px;
  font-weight: 800;
  text-align: right;
}

.button {
  grid-column: 1 / -1;
  display: block;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: var(--radius-small, 10px);
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.offer.cheapest .button {
  background: var(--good-button);
  border-color: var(--good-button);
  color: var(--on-good);
}

.note {
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0 0;
}

/* ---------- Иконки сайтов, рост и падение цены ---------- */

/* Светлая подложка: у некоторых сайтов тёмная иконка, на тёмной теме её не видно */
.site-icon {
  width: 22px;
  height: 22px;
  padding: 2px;
  flex: none;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
  vertical-align: middle;
}

.change { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.change.up { color: var(--good-text); }
.change.down { color: var(--down); }
.change.flat { color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }

.offer-site { display: inline-flex; align-items: center; gap: 8px; }
.best-site .site-icon { margin: 0 2px; }

/* ---------- Плашка «LIVE · Prices updated…» ---------- */

.updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--surface-2);
}

/* Цены давно не обновлялись — без зелёной точки */
.updated.stale::before { background: var(--muted); }
.updated:has(.live:not([hidden]))::before { display: none; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--good-soft);
  border: 1px solid var(--good-border);
  color: var(--good-text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}

/* ---------- Избранное: звёздочка ---------- */

.card-wrap { position: relative; display: flex; }
.card-wrap > .card { flex: 1; }

.star {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  font: inherit;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.star:hover { color: var(--text); }
.star[aria-pressed="true"] { color: #d97706; border-color: #d97706; }

.card-wrap > .star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  font-size: 19px;
}

.hero-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }


/* ---------- Главная: счётчики и «Biggest moves» ---------- */

.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.counter {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.counter strong { color: var(--text); font-size: 18px; }
a.counter:hover { border-color: var(--accent); }

.section-subtitle { color: var(--muted); margin: -6px 0 12px; font-size: 15px; }

/* ---------- Главная: быстрый поиск ---------- */

.home-hero { margin-bottom: 14px; }
.quick-search { position: relative; margin-top: 12px; max-width: 640px; }
.quick-search .search { padding-right: 48px; }
/* Подсказка «нажми /»: только там, где есть клавиатура, и пока поле пустое */
.search-key {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  pointer-events: none;
}
.quick-search .search:not(:placeholder-shown) ~ .search-key,
.quick-search .search:focus ~ .search-key { display: none; }
@media (pointer: coarse) { .search-key { display: none; } }

.suggest {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.16);
}
.suggest-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 8px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.suggest-option[aria-selected="true"], .suggest-option:hover { background: var(--surface-2); }
.suggest-option .thumb { width: 38px; height: 38px; }
.suggest-option .thumb img { width: 32px; height: 32px; }
.suggest-name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.25; }
.suggest-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.suggest-price { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.suggest-all { justify-content: center; min-height: 44px; color: var(--accent-text); font-weight: 700; }
.suggest-empty { padding: 10px 8px; color: var(--muted); }

/* Строка под заголовком главной: большой поиск и кнопка калькулятора инвентаря — одной высоты */
.hero-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.hero-row .quick-search { flex: 1 1 360px; margin-top: 0; max-width: none; }
.hero-button {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 300px;
  min-height: 54px;
  padding: 6px 16px 6px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.hero-button:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
.hero-button-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--on-accent); }
.hero-button-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-button-text { display: flex; flex-direction: column; font-weight: 800; line-height: 1.2; }
.hero-button-text small { font-weight: 500; font-size: 13px; color: var(--muted); }
.hero-button-arrow { margin-left: auto; color: var(--accent-text); font-weight: 800; transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.hero-button:hover .hero-button-arrow { transform: translateX(5px); }
.hero-button:hover .hero-button-icon { animation: switch-pop 0.4s ease; }
@media (max-width: 719px) { .hero-button { flex-basis: 100%; } }

/* ---------- Главная: «Best deals now», «Biggest moves», виды предметов ---------- */

/* Блоки всегда в один ряд (решение 10 ноября 2026). На ПК — все сразу, поровну ширины;
   на телефоне и планшете — лента, которую листают пальцем вбок (блок встаёт ровно к краю) */
.widgets {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 86%);
  gap: 14px;
  margin: 18px -16px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}
.widgets::-webkit-scrollbar { display: none; }
.widgets > .widget { scroll-snap-align: start; }
@media (min-width: 720px) { .widgets { grid-auto-columns: minmax(300px, 46%); } }
@media (min-width: 1100px) {
  .widgets { grid-auto-columns: minmax(0, 1fr); margin: 18px 0; padding: 0; overflow: visible; }
}
/* В узком блоке названия — в одну строку с многоточием, график и картинки поменьше */
.widget { padding: 14px; }
.widget .row { gap: 8px; }
.widget .row-name { overflow: hidden; }
.widget .row-name, .widget .row-name small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.widget .thumb { width: 38px; height: 38px; }
.widget .thumb img { width: 32px; height: 32px; }
.widget .trend { width: 48px; }
.widget-title { font-size: 17px; }
/* Узкий блок (4 в ряд на ноутбуке): без мини-графика и с цифрами помельче — чтобы влезло название */
.widget { container-type: inline-size; }
@container (max-width: 330px) {
  .widget .trend { display: none; }
  .widget .row-end { font-size: 15px; }
  .widget .row-end small { font-size: 12px; }
}
.panel {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow, none);
}
.widget-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.widget-subtitle { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.rows { margin: 0; padding: 0; list-style: none; }
.rows li + li { border-top: 1px solid var(--border); }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 4px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.row:hover { background: var(--surface-2); }
.thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: radial-gradient(circle, color-mix(in srgb, var(--r, var(--accent)) var(--glow, 25%), transparent), transparent 70%), var(--surface-2);
}
.thumb img { width: 38px; height: 38px; object-fit: contain; }
.row-name { flex: 1; min-width: 0; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.row-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.row-end { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-end small { display: block; font-size: 13px; }
.deal-off { color: var(--good-text); font-weight: 700; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 18px; }
.cat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.cat:hover { border-color: var(--accent); }
.cat small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

/* ---------- Главная: вид «таблица» ---------- */


.table-wrap { overflow-x: auto; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.market { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.market th, .market td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.market thead th { background: var(--surface-2); color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.market thead th:first-child, .market tbody th { text-align: left; }
/* Первый столбец не уезжает при прокрутке таблицы вбок (на телефоне) */
.market tbody th, .market thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.market thead th:first-child { background: var(--surface-2); }
.market tbody tr:hover > * { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.market tbody tr:last-child > * { border-bottom: 0; }
.item-cell { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; }
.item-cell .thumb { width: 38px; height: 38px; }
.item-cell .thumb img { width: 32px; height: 32px; }
.item-cell .row-name { white-space: normal; min-width: 140px; }
.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.th-sort:hover { color: var(--text); }
.th-sort img { width: 18px; height: 18px; border-radius: 5px; background: #fff; padding: 1px; }
.th-arrow { min-width: 0.8em; color: var(--accent-text); }
.market td.cheapest { color: var(--good-text); font-weight: 800; }
.market td.cheapest::before { content: "★ "; font-size: 12px; }
.market td.usd-only { color: var(--muted); }
.market td.usd-only small { display: block; font-size: 11px; }
.spread { display: inline-block; min-width: 54px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 700; }
.table-note { padding: 24px !important; text-align: center !important; color: var(--muted); white-space: normal !important; }

/* ---------- Страница предмета: «Is this a good price?» ---------- */

.meter-panel { margin: 18px 0 0; max-width: 640px; }
.meter {
  position: relative;
  height: 12px;
  margin: 14px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--good) 0 33%, #eab308 33% 66%, var(--down) 66%);
}
/* Отметка «сейчас»: тёмная полоска с ободком цвета фона — видна на любом участке шкалы */
.meter i {
  position: absolute;
  top: -5px;
  width: 6px;
  height: 22px;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--surface);
}
.meter-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.meter-verdict { margin: 10px 0 0; }
.verdict-good { color: var(--good-text); }
.verdict-fair { color: var(--gold-text, #b45309); }
.verdict-high { color: var(--down); }

/* ---------- Калькулятор инвентаря (inventory.html) ---------- */

.inv { display: grid; gap: 16px; margin-top: 12px; }
@media (min-width: 900px) { .inv { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.inv-search { margin: 10px 0 8px; max-width: none; }
.inv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 4px 0; }
.inv-row .row { flex: 1 1 220px; min-width: 0; }
.inv-row .row-end { min-width: 72px; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}
.qty-button:hover { border-color: var(--accent); }
.qty-value { min-width: 2.2em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-remove { width: 44px; height: 44px; }
.inv-totals-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.inv-totals-top .seg { --h: 42px; }
.inv-total { margin: 10px 0 0; font-size: 36px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inv-sites { margin: 6px 0 0; padding: 0; list-style: none; }
.site-total { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 12px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-2); }
.site-total.is-best { background: var(--good-soft); border-color: var(--good-border); }
.site-total img { width: 28px; height: 28px; border-radius: 8px; background: #fff; padding: 2px; }
.site-total-name { font-weight: 700; }
.site-total-name small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.site-total b { margin-left: auto; font-size: 20px; font-variant-numeric: tabular-nums; }
.site-total.is-best b { color: var(--good-text); }
.inv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.inv-actions .button { width: auto; padding: 0 18px; }

/* ---------- Страница предмета: уведомление о цене ---------- */

.alert-panel { margin: 18px 0 0; max-width: 640px; }
.alert-form label { display: block; margin: 8px 0 6px; color: var(--muted); }
.alert-row { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-input { position: relative; flex: 1 1 140px; }
.alert-input > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.alert-input .search { padding-left: 32px; }
.alert-row .button { width: auto; padding: 0 22px; }
/* Телефон: поле на всю ширину (подсказка «Price you're waiting for» видна целиком), кнопка — под ним */
@media (max-width: 719px) { .alert-input { flex-basis: 100%; } .alert-row .button { width: 100%; } }
.alert-error { color: var(--down); }
.alert-list { margin: 8px 0 0; padding: 0; list-style: none; }
.alert-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.alert-item .link-button { min-height: 44px; }

/* ---------- Страница предмета: продажи, value, наборы ---------- */

.item-panels { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 900px) { .item-panels { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; } }
.item-panels:empty { display: none; }
.sales-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.sales-stats > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.stat-value { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { display: block; color: var(--muted); font-size: 13px; }
.stat-label .change { font-size: 13px; }
.sales-table .market { min-width: 0; }
.sales-table .market th, .sales-table .market td { padding: 8px 10px; }
.sales-table .market tbody th small { display: block; margin-left: 30px; color: var(--muted); font-size: 12px; font-weight: 400; }
.sales-table .market th img, .sales-table .market td img { vertical-align: middle; margin-right: 6px; }
.facts { display: grid; gap: 8px; margin: 12px 0; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.set-link { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; border-radius: 10px; color: var(--text); text-decoration: none; }
.set-link:hover { background: var(--surface-2); }
.set-thumbs { display: flex; flex: none; }
.set-thumbs .thumb { width: 38px; height: 38px; border: 2px solid var(--surface); }
.set-thumbs .thumb + .thumb { margin-left: -10px; }
.set-thumbs .thumb img { width: 32px; height: 32px; }

/* ---------- Страница наборов (sets.html) ---------- */

.sets-filter { position: static; margin: 12px 0 4px; padding: 0; border: 0; }
.sets-grid { display: grid; gap: 14px; margin: 12px 0 24px; }
@media (min-width: 900px) { .sets-grid { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; } }
.set-total { margin: 4px 0 8px; font-size: 17px; }
.set-total strong { font-size: 20px; }
.set-items { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.set-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px; border-radius: 10px; color: var(--text); text-decoration: none; }
.set-item:hover { background: var(--surface-2); }
.set-item .thumb { width: 40px; height: 40px; }
.set-item .thumb img { width: 34px; height: 34px; }

/* ---------- Главная: цена или value (переключатель Price / Value) ---------- */


/* На карточке — либо цена с графиком, либо value */
.card-value {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--r, var(--accent)) 14%, var(--surface-2));
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.card-value small { font-size: 13px; font-weight: 400; color: var(--muted); }
.card-value.no-value { font-size: 15px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.value-mark { color: var(--r, var(--accent-text)); }
html:not(.show-value) .card-value,
html.show-value .card-bottom > .card-price,
html.show-value .card-bottom > .trend,
html.show-value .deal-flag { display: none; }
.market .value-cell { font-weight: 800; }

/* Плитки видов — это фильтр: выбранная подсвечена; Sets — ссылка на другую страницу (стрелка) */
.cat[aria-current="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.cat-link { position: relative; }
.cat-arrow { margin-left: auto; color: var(--muted); font-weight: 700; }

/* ---------- Таблица на главной помещается без прокрутки вбок (10 ноября 2026) ----------
   ПК: все столбцы; поуже — прячем график, ещё уже — Spread; телефон — каждая строка становится карточкой:
   предмет сверху, под ним value, цены сайтов и 7d с подписями (data-label) */
/* clip — обрезает серую шапку по скруглённым углам рамки (visible давал торчащие углы); на телефоне рамки нет */
#table-wrap { overflow: clip; }
#table-wrap .market th, #table-wrap .market td { padding: 8px 10px; }
#table-wrap .item-cell .row-name { min-width: 0; }
@media (max-width: 1180px) { #table-wrap .col-chart { display: none; } }
@media (max-width: 960px) { #table-wrap .col-spread { display: none; } #table-wrap .th-sort img { display: none; } }
@media (max-width: 719px) {
  #table-wrap { border: 0; background: none; overflow: visible; }
  #table-wrap .market thead { display: none; }
  #table-wrap .market, #table-wrap .market tbody { display: block; }
  #table-wrap .market tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
  }
  #table-wrap .market tbody th { grid-column: 1 / -1; position: static; padding: 0; background: none; }
  #table-wrap .market td { padding: 0; border: 0; text-align: left; font-size: 15px; }
  #table-wrap .market td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  #table-wrap .market td.cheapest::before { content: "★ " attr(data-label); }
  #table-wrap .col-spread { display: block; }
  #table-wrap .market tbody tr:hover > * { background: none; }
}

/* ---------- Слежка за ценой: блок на странице предмета и страница alerts.html (10 ноября 2026) ---------- */

.alert-kind { --h: 42px; margin: 6px 0 4px; }
.alert-input > span.after { left: auto; right: 14px; }
.alert-input:has(> span.after) .search { padding-left: 14px; padding-right: 34px; }
.alert-hint { margin: 6px 0 0; color: var(--muted); font-size: 14px; min-height: 1.4em; }
.alert-links { margin: 10px 0 0; font-size: 14px; }
.alert-links a { color: var(--accent-text); font-weight: 700; }
.permission-guide {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #eab308 45%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, #eab308 10%, var(--surface));
  font-size: 15px;
}
.permission-guide ol { margin: 6px 0; padding-left: 22px; }
.permission-guide li { margin: 4px 0; line-height: 1.5; }
.guide-title { margin: 0 0 4px; font-weight: 800; }
.guide-name { margin: 10px 0 0; font-weight: 700; }
.permission-guide details summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; color: var(--accent-text); font-weight: 700; }
.guide-discord { margin: 8px 0 0; }
.guide-discord a { color: var(--accent-text); font-weight: 700; }
.alert-item a { color: var(--text); }
.alerts-layout { display: grid; gap: 16px; margin: 14px 0 16px; }
@media (min-width: 900px) { .alerts-layout { grid-template-columns: 1fr 1fr; align-items: start; } }
.steps { margin: 8px 0; padding-left: 22px; line-height: 1.6; }
.steps li { margin: 6px 0; }
.steps-title { margin: 16px 0 4px; font-size: 16px; }
.commands { list-style: none; padding-left: 0; }
.discord-panel { margin-bottom: 24px; scroll-margin-top: 20px; }
.discord-button {
  display: flex; width: fit-content; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0 2px; padding: 0 18px;
  border-radius: 12px; background: #5865f2; color: #fff; font-weight: 800; text-decoration: none;
}
.soon-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; vertical-align: middle; }

/* ---------- Мини-график за 7 дней (карточки, «Biggest moves», таблица) ---------- */

.trend { flex: none; width: 70px; height: 26px; overflow: visible; }
.trend path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend.up path { stroke: var(--good); }
.trend.down path { stroke: var(--down); }
.trend.flat path { stroke: var(--muted); }

/* Низ карточки: цена слева, мини-график справа (на узкой карточке график уходит под цену) */
.card-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 6px; }
.card-bottom .card-price { margin-top: 0; }

.card-image { position: relative; }
.deal-flag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--good-border);
  background: var(--good-soft);
  color: var(--good-text);
  font-size: 12px;
  font-weight: 800;
}

/* ---------- «Хлебные крошки» ---------- */

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--muted);
}

.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.breadcrumbs a { color: var(--muted); font-weight: 600; text-decoration: none; padding: 4px 0; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- График истории цен ---------- */

.history-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.history-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.history-label { color: var(--muted); font-size: 15px; min-height: 1.4em; }
.history-price { font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.history-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; min-height: 30px; font-size: 16px; }
.history-site { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.history-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.history-buy { min-height: 46px; padding: 11px 16px; }

.periods { display: flex; gap: 6px; }
.periods .chip { min-height: 40px; padding: 0 14px; }

/* Цифры периода: самая низкая, самая высокая цена и экономия */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 4px; }
.stat { min-width: 0; padding: 8px 10px; border-radius: var(--radius-small); background: var(--surface-2); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* Кнопки сайтов: иконка, домен, цена, изменение. На телефоне — по одной в строку. */
.site-chips { display: grid; gap: 8px; margin: 14px 0 10px; padding: 0; list-style: none; }

.site-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.site-chip .site-icon { border-radius: 50%; }
.site-chip[aria-pressed="true"] { background: var(--surface); border-color: var(--chip-color); }
.site-chip[aria-pressed="false"] { opacity: 0.6; }
.site-chip[aria-pressed="false"] .site-icon { filter: grayscale(1); }
.site-chip-domain { font-weight: 700; }
.site-chip-line { display: none; width: 14px; height: 4px; border-radius: 2px; background: var(--chip-color); }
.site-chip[aria-pressed="false"] .site-chip-line { background: var(--line-off); }
.site-chip-price { font-variant-numeric: tabular-nums; }
.site-chip .change { margin-left: auto; }

.best-mark {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--good-soft);
  border: 1px solid var(--good-border);
  color: var(--good-text);
  font-size: 12px;
  font-weight: 700;
}

.plot { position: relative; height: 260px; min-width: 0; }
/* График C «мягкий»: область графика на светлой подложке со скруглёнными углами */
.history-card .plot, .zoom .plot { padding: 8px 4px 2px 8px; background: var(--surface-2); border-radius: 14px; }
.since { min-height: 1.3em; margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Подвал ---------- */

.footer {
  margin-top: 40px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* Ссылки в подвале: отдельной строкой, с запасом по высоте для пальца */
.footer-links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.footer a {
  display: inline-block;
  margin-top: 4px;
  padding: 12px 0;
  color: var(--text);
  font-weight: 600;
}

/* Страница About: обычный текст, строки не шире ~70 символов — так легче читать */
.prose { max-width: 70ch; }
.prose h2 { margin: 28px 0 8px; font-size: 20px; }
.prose p, .prose li { line-height: 1.6; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 0.92em; overflow-wrap: anywhere; }

/* ---------- Большие экраны ---------- */

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
  .page-title { font-size: 32px; }
  .toolbar .field { flex: none; width: 230px; }

  .hero { flex-direction: row; align-items: flex-start; gap: 28px; }
  .hero-image { width: 220px; height: 220px; margin: 0; flex: none; }
  .hero-info { flex: 1; }
  .hero h1 { font-size: 38px; }
  .best { display: inline-block; min-width: 340px; }

  .offer { grid-template-columns: 1fr auto 220px; }
  .button { grid-column: auto; }

  .history-card { padding: 20px; }
  .history-price { font-size: 40px; }
  .history-actions { width: auto; align-items: flex-end; }
  .site-chips { display: flex; flex-wrap: wrap; }
  .site-chip { width: auto; gap: 8px; }
  .site-chip-line { display: inline-block; }
  .site-chip .change { margin-left: 0; }
  .plot { height: 340px; }
}

/* ---------- Анимации (выбраны по образцу design/animations.html) ----------
   При «Уменьшить движение» в системе всё это выключает правило в начале файла. */

/* 1. Карточки плавно выплывают снизу по очереди — при открытии, подгрузке порции и смене фильтра.
   Анимация запускается сама, когда карточка становится видимой; --i (номер в порции) задаёт home.js */
.card-wrap:not([hidden]) {
  animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

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

/* 2. Карточка при наведении: приподнимается, тень цвета редкости, предмет чуть поворачивается */
.card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s; }

.card:hover {
  border-color: var(--r);
  transform: translateY(-5px);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--r) 70%, transparent);
}

.card:active { transform: translateY(-1px) scale(0.98); }
.card-image img { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.card:hover .card-image img { transform: scale(1.08) rotate(-4deg); }

/* 3. Пока картинка грузится — мерцающая подложка (класс loading ставит site.js), потом картинка проявляется.
   Прячется картинка сразу, а проявляется плавно — чтобы не мелькнул значок «нет картинки» */
.card-image:not(.loading) img { transition: opacity 0.4s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.card-image.loading img { opacity: 0; }

.card-image.loading {
  background: linear-gradient(100deg,
    var(--surface-2) 35%, color-mix(in srgb, var(--surface-2), var(--text) 12%) 50%, var(--surface-2) 65%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* 4. Звёздочка «в избранное» подпрыгивает, вокруг разлетаются маленькие звёзды (их создаёт site.js) */
.star[aria-pressed="true"] { animation: star-pop 0.45s cubic-bezier(0.2, 0.7, 0.3, 1.6); }

@keyframes star-pop {
  40% { transform: scale(1.35) rotate(-14deg); }
}

/* Звёзды разлетаются от центра кнопки (у звезды на карточке своё position: absolute — оно сильнее) */
.star { position: relative; }

/* Маленькая звезда вылетает из центра в сторону (--dx, --dy), крутится и тает */
.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: var(--size);
  line-height: 1;
  pointer-events: none;
  animation: spark 0.75s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes spark {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--turn)); }
}

/* 6. Зелёная точка LIVE мягко пульсирует */
.live::before { animation: live-pulse 2s ease-out infinite; }

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 65%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* 7. Цены плавно выплывают при переключении $ / €. Класс cur-anim ставит site.js при первом нажатии,
   чтобы при открытии страницы цены не «прыгали» */
.cur-anim [data-currency] { animation: price-in 0.35s ease both; }

@keyframes price-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Переключение валюты (9 ноября 2026): бегунок переезжает с пружинкой, цены выплывают снизу
   из лёгкого размытия, а символ $ / € на кнопке подпрыгивает */
.currency-switch::before { transition: transform 0.45s cubic-bezier(0.3, 1.35, 0.5, 1); }
.cur-anim [data-currency]:not(.currency-option) { animation: price-swap 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes price-swap {
  from { opacity: 0; transform: translateY(0.45em) scale(0.97); filter: blur(3px); }
}
.currency-option.bump { animation: currency-bump 0.45s ease-out; }
@keyframes currency-bump { 35% { transform: scale(1.12); } 70% { transform: scale(0.97); } }

/* Меню выбора игры (9 ноября 2026): панель раскрывается от кнопки с пружинкой, пункты появляются
   по очереди, значок игры на кнопке покачивается. Закрытие — короткое затухание (site.js) */
.game-panel:not([hidden]) { animation: game-panel-in 0.32s cubic-bezier(0.25, 1.25, 0.5, 1) both; transform-origin: top right; }
.game-panel:not([hidden]) .game-list > li { animation: game-item-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.game-panel:not([hidden]) .game-list > li:nth-child(2) { animation-delay: 0.05s; }
.game-panel:not([hidden]) .game-list > li:nth-child(3) { animation-delay: 0.1s; }
.game-panel:not([hidden]) .game-list > li:nth-child(4) { animation-delay: 0.15s; }
.game-panel:not([hidden]) .game-list > li:nth-child(n+5) { animation-delay: 0.2s; }
.game-panel.closing { animation: game-panel-out 0.16s ease-in both; }
.game-button[aria-expanded="true"] .game-icon { animation: game-wiggle 0.5s ease-out; }
.chevron { transition: transform 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
/* Пустой значок «More Coming Soon» тихонько «дышит», пока меню открыто */
.game-panel:not([hidden]) .game-soon { animation: soon-breathe 2.4s ease-in-out 0.4s infinite; }
@keyframes game-panel-in { from { opacity: 0; transform: translateY(-6px) scale(0.92); } }
@keyframes game-panel-out { to { opacity: 0; transform: translateY(-4px) scale(0.96); } }
@keyframes game-item-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes game-wiggle { 25% { transform: rotate(-10deg) scale(1.08); } 55% { transform: rotate(7deg); } 80% { transform: rotate(-3deg); } }
@keyframes soon-breathe { 50% { border-color: var(--accent); color: var(--accent-text); transform: scale(1.06); } }
@media (max-width: 719px) {
  .game-panel:not([hidden]) { transform-origin: top center; }
}

/* 9. Кнопки сайтов у графика плавно гаснут и загораются (саму линию плавно перекрашивает item.js) */
.site-chip { transition: opacity 0.3s, background-color 0.3s, border-color 0.3s; }
.site-chip .site-icon { transition: filter 0.3s; }

/* 10. Переход между страницами: старая плавно сменяется новой, а картинка предмета «перелетает»
   с карточки на своё место на странице предмета. Имя hero у картинок расставляет site.js.
   Работает в Chrome, Edge и Safari; другие браузеры просто открывают страницу, как раньше */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

.hero-image img { view-transition-name: hero; }

::view-transition-group(hero) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1);
}


/* ---------- Сравнение предметов (выбрано по образцу design/compare.html) ---------- */

/* Место под плавающую кнопку Compare: она не должна закрывать низ страницы */
body { padding-bottom: 84px; }
.container.wide { max-width: 1440px; }
.page-top { margin-top: 16px; }

/* Кнопка «в сравнение»: на карточке — рядом со звездой, на странице предмета — рядом с заголовком */
.cmp-toggle {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.cmp-toggle:hover { color: var(--text); }
.cmp-toggle svg { width: 22px; height: 22px; }

/* Предмет в сравнении — кнопка «горит» цветом сайта (как звёздочка — жёлтым) и подпрыгивает */
.cmp-toggle[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  animation: toggle-pop 0.45s cubic-bezier(0.2, 0.7, 0.3, 1.6);
}

@keyframes toggle-pop { 40% { transform: scale(1.3); } }

.card-wrap > .cmp-toggle {
  position: absolute;
  top: 8px;
  right: 52px;
  width: 38px;
  height: 38px;
}

.card-wrap > .cmp-toggle svg { width: 20px; height: 20px; }
.hero-actions { display: flex; gap: 8px; flex: none; }

/* Плавающая кнопка «Compare (n)»: на ПК — справа внизу, на телефоне — по центру */
.compare-fab {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 12px 0 16px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 12px 30px -8px rgb(0 0 0 / 0.4);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  /* При переходе между страницами кнопка стоит на месте, а не мигает вместе со страницей */
  view-transition-name: compare-fab;
}

.compare-fab:hover { filter: brightness(1.08); }
.fab-icon svg { display: block; width: 24px; height: 24px; }

.fab-count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  overflow: hidden;
  color: var(--accent-text);
  background: var(--surface);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.fab-count span { grid-area: 1 / 1; }

@media (max-width: 719px) {
  .compare-fab { right: auto; left: 50%; bottom: 14px; translate: -50% 0; }
}

/* Предмет «влетел» — кнопка подпрыгивает, цифра прокручивается; сравнение заполнено — кнопка «мотает головой» */
.compare-fab.bump, .tab-icon.bump { animation: fab-bump 0.5s cubic-bezier(0.2, 0.7, 0.3, 1.6); }
.compare-fab.shake { animation: fab-shake 0.45s ease; }
.fab-count .in { animation: roll-in 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.fab-count .out { animation: roll-out 0.35s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes fab-bump { 30% { transform: scale(1.18); } 60% { transform: scale(0.96); } }
@keyframes fab-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes roll-in { from { transform: translateY(110%); } }
@keyframes roll-out { to { transform: translateY(-110%); } }

/* Картинка, которая летит с карточки в кнопку Compare (её создаёт site.js) */
.fly { position: fixed; z-index: 40; pointer-events: none; }
.fly > div { width: 100%; height: 100%; }
.fly img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.3)); }

/* Всплывающая подсказка над кнопкой Compare («Compare is full…») */
.toast {
  position: fixed;
  z-index: 31;
  left: 50%;
  bottom: 88px;
  translate: -50% 0;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
}

.toast.show { animation: toast-in 0.3s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Кнопка «← Back»: при наведении стрелка тянется влево, при нажатии «выстреливает» */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.back-button:hover { border-color: var(--accent); }
.back-arrow { width: 22px; height: 22px; overflow: visible; transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.back-arrow .shaft { transform-box: fill-box; transform-origin: right center; transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.back-button:hover .back-arrow { transform: translateX(-4px); }
.back-button:hover .shaft { transform: scaleX(1.35); }
.back-button.go .back-arrow { animation: back-shoot 0.28s ease-in forwards; }

@keyframes back-shoot {
  35% { transform: translateX(3px); }
  100% { transform: translateX(-28px); opacity: 0; }
}

/* ----- Страница сравнения ----- */
.cmp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 8px; }
.cmp-count { margin: 0; color: var(--muted); }
.cmp-toolbar .link-button { min-height: 44px; }
.save-image { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 44px; margin-left: auto; padding: 0 16px; }
.only-phone, .only-wide { display: inline; }
@media (max-width: 719px) { .only-wide { display: none; } }
@media (min-width: 720px) { .only-phone { display: none; } }

/* Колонок столько, сколько предметов, но не больше: телефон 2, планшет 3, ПК 4.
   Так 2–3 предмета растягиваются на всю ширину. --cols выставляет compare.js */
.cmp-grid {
  --max-cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 0 10px;
  margin-top: 8px;
  overflow-anchor: none; /* браузер не должен сам двигать страницу, когда карточки меняются местами */
}

@media (min-width: 720px) { .cmp-grid { --max-cols: 3; gap: 16px; } }
@media (min-width: 1024px) { .cmp-grid { --max-cols: 4; } }

.cmp-slot { position: relative; display: flex; flex-direction: column; min-width: 0; }

.cmp-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow, none);
  transition: border-color 0.3s, box-shadow 0.3s;
}

@media (min-width: 720px) { .cmp-card { padding: 14px; } }

/* Перетаскиваемая карточка — над остальными, с большой тенью */
.cmp-slot.dragging { z-index: 10; }
.cmp-slot.dragging .cmp-card { box-shadow: 0 24px 50px -12px rgb(0 0 0 / 0.35); border-color: var(--accent); }
body.is-dragging { cursor: grabbing; user-select: none; }

.cmp-tools { display: flex; align-items: flex-start; gap: 6px; min-height: 36px; }

.icon-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  font: inherit;
  font-size: 18px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.icon-button:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Кнопка темы в шапке ---------- */
.theme-button {
  width: 44px;
  height: 44px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.appearance + .currency-switch { margin-left: 0; }

/* Панель Appearance под кнопкой ◐: тема и цветовая гамма */
.appearance { position: relative; margin-left: auto; /* прижимаем к правому краю, валюта — сразу за ней */ }
.appearance-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: -60px;
  width: 316px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.22);
}
.appearance-title { margin: 0 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.appearance-title:not(:first-child) { margin-top: 16px; }
.theme-modes { --h: 42px; display: grid; width: 100%; }
.palettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.palette-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 70px; padding: 8px 2px 6px; border: 1px solid transparent; border-radius: 14px;
  background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.palette-option:hover { background: var(--surface-2); color: var(--text); }
.palette-option[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--text); }
/* Кружок: слева — акцент светлой темы, справа — тёмной */
.swatch {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sw-light) 50%, var(--sw-dark) 50%);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
}
.palette-option[aria-pressed="true"] .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.palette-option[aria-pressed="true"] .swatch::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 900; text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}
@media (max-width: 719px) {
  .appearance-panel { position: fixed; top: 64px; left: 12px; right: 12px; width: auto; }
}
.theme-icon { width: 22px; height: 22px; overflow: visible; }
/* Три значка лежат друг на друге: виден тот, что подходит к выбору (data-mode ставит site.js) */
.theme-icon > * {
  transform-box: view-box;
  transform-origin: 12px 12px;
  transition: opacity 0.25s, transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.theme-button:not([data-mode="light"]) .theme-sun,
.theme-button:not([data-mode="dark"]) .theme-moon,
.theme-button[data-mode="light"] .theme-auto,
.theme-button[data-mode="dark"] .theme-auto { opacity: 0; transform: rotate(-120deg) scale(0.3); }
.theme-button.theme-spin { animation: toggle-pop 0.4s ease-out; }

/* Смена темы: новая тема расходится кругом от кнопки (site.js, View Transitions).
   Только пока идёт смена темы — у перехода на страницу предмета свои правила */
html.theme-vt::view-transition-old(root),
html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-new(root) { z-index: 2; }
.cmp-drag { cursor: grab; touch-action: none; }
.cmp-remove { margin-left: auto; }
/* На телефоне ⠿ тоже работает (9 ноября 2026): тянуть пальцем.
   Чтобы долгое нажатие не выделяло текст и не открывало меню iPhone */
.cmp-drag { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (max-width: 719px) { .cmp-drag { width: 44px; height: 44px; font-size: 22px; } }

/* Значки «Cheapest» и «Top gainer»: выпрыгивают с пружинкой, вокруг расходится светящееся кольцо,
   а у карточки загорается рамка того же цвета */
.cmp-flags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; padding-top: 6px; }

.flag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  /* С задержкой: сначала карточки влетают и графики пробегают, потом выпрыгивают значки — так их видно */
  animation: flag-pop 0.6s cubic-bezier(0.2, 0.7, 0.3, 1.8) 1s both, flag-glow 1.2s ease-out 1.35s 2;
}

.flag.cheapest { --flag: var(--good-text); color: var(--good-text); background: var(--good-soft); border: 1px solid var(--good-border); }
.flag.gainer { --flag: var(--gold-text); color: var(--gold-text); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold-text) 35%, transparent); }
.cmp-card.is-cheapest { border-color: var(--good-border); box-shadow: 0 0 0 1px var(--good-border); }
.cmp-card.is-gainer:not(.is-cheapest) { border-color: color-mix(in srgb, var(--gold-text) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold-text) 45%, transparent); }

@keyframes flag-pop {
  0% { opacity: 0; transform: scale(0.2) rotate(-8deg); }
  60% { transform: scale(1.25) rotate(3deg); }
}

@keyframes flag-glow {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--flag) 55%, transparent); }
  to { box-shadow: 0 0 0 10px transparent; }
}

.cmp-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; }

.cmp-image {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--r) 30%, transparent), transparent 70%);
}

.cmp-image img { width: 82%; height: auto; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.cmp-head:hover .cmp-image img { transform: scale(1.08) rotate(-4deg); }
.cmp-name { font-size: 17px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.cmp-head:hover .cmp-name { text-decoration: underline; }
.cmp-card .card-meta { justify-content: center; }

.cmp-price { text-align: center; line-height: 1.2; }
.cmp-price-label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.cmp-price-value { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cmp-price-value.sold-out { font-size: 18px; color: var(--muted); }
.cmp-price .change { display: inline-block; font-size: 15px; }
.cmp-on { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 22px; color: var(--muted); font-size: 14px; }

.cmp-sites { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }

.cmp-sites li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  min-width: 0;
  padding: 4px 8px 4px 4px;
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
}

.cmp-sites li.best { background: var(--good-soft); border-color: var(--good-border); }
.cmp-sites .site-icon { border-radius: 50%; }
.cmp-sites .domain { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-sites b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cmp-sites .na { margin-left: auto; color: var(--muted); }

/* На телефоне карточка узкая: у сайта видна только иконка (домен остаётся для экранных чтецов) */
@media (max-width: 719px) {
  .cmp-grid:not([data-cols="1"]) .cmp-sites .domain { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.cmp-open { display: flex; align-items: center; justify-content: center; min-height: 44px; color: var(--accent-text); font-weight: 700; font-size: 15px; }

/* Низ карточки: выбор линии и маленький график. margin-top: auto — графики в одном ряду на одной высоте */
.cmp-chart { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

/* «Выползалка» выбора линии — как меню выбора игры, только открывается вверх */
.picker { position: relative; }

.picker-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px 4px 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
}

.picker-button:hover { border-color: var(--accent); }
.picker-button .chevron { margin-left: auto; flex: none; }
.picker-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.picker-current { display: contents; }
.picker-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 6px var(--surface-2); }

.picker-panel {
  position: absolute;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
  transform-origin: bottom center;
  animation: panel-in 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes panel-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }

.picker-title { margin: 2px 6px 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 4px 8px 4px 6px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.picker-option:hover { background: var(--surface-2); }
.picker-option[aria-pressed="true"] { font-weight: 700; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.picker-option .picker-dot { box-shadow: inset 0 0 0 6px var(--surface); }
.picker-option .site-icon { border-radius: 50%; }
.picker-check { margin-left: auto; color: var(--accent-text); font-weight: 800; visibility: hidden; }
.picker-option[aria-pressed="true"] .picker-check { visibility: visible; }

/* Общая кнопка «All charts: …» над карточками сравнения. Открывается вниз, а не вверх */
.all-picker { flex: 0 1 300px; min-width: 0; }
.all-picker .picker-button { border-color: var(--border); background: var(--surface); }
.all-picker .picker-panel { top: calc(100% + 6px); bottom: auto; transform-origin: top center; }
.all-picker-label { flex: none; color: var(--muted); font-weight: 600; }
.picker-count { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.picker-count + .picker-check { margin-left: 6px; }
/* «Mixed»: у карточек разный выбор — половинка точки */
.picker-dot.mixed { background: linear-gradient(90deg, var(--accent) 50%, var(--muted) 50%); box-shadow: none; }
@media (max-width: 719px) {
  .all-picker { flex-basis: 100%; order: 3; } /* на телефоне — отдельной строкой под периодами */
}

.cmp-readout { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 6px; min-height: 1.4em; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.cmp-readout b { color: var(--text); }

/* Маленький график — это кнопка: нажатие (или Enter) увеличивает его */
.cmp-plot {
  position: relative;
  display: block;
  width: 100%;
  height: 110px;
  padding: 0;
  background: var(--surface-2); /* график C «мягкий»: подложка со скруглёнными углами */
  border: 0;
  border-radius: 14px;
  cursor: zoom-in;
}

/* Чем меньше колонок, тем шире карточка — и тем выше график */
.cmp-grid[data-cols="1"] .cmp-plot { height: 200px; }
@media (min-width: 720px) {
  .cmp-plot { height: 140px; }
  .cmp-grid[data-cols="3"] .cmp-plot { height: 170px; }
  .cmp-grid[data-cols="2"] .cmp-plot { height: 220px; }
  .cmp-grid[data-cols="1"] .cmp-plot { height: 260px; }
}

.cmp-plot:hover { background: color-mix(in srgb, var(--surface-2), var(--text) 6%); }
.cmp-plot canvas { display: block; }
.cmp-plot-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }

.zoom-hint {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.85;
  pointer-events: none;
}

.zoom-hint svg { width: 14px; height: 14px; }

/* Предметы влетают с боков: левые колонки слева, правые справа (--from и --i ставит compare.js) */
.cmp-slot.enter {
  animation: cmp-in 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes cmp-in { from { opacity: 0; transform: translateX(var(--from, -40px)) scale(0.95); } }

/* ----- Пустое сравнение: анимированная подсказка ----- */
.cmp-empty { display: flex; flex-direction: column; align-items: center; padding: 16px 0 24px; text-align: center; animation: price-in 0.4s ease both; }
.cmp-empty h2 { margin: 18px 0 6px; font-size: 24px; }
.cmp-empty p { max-width: 440px; margin: 0 0 18px; color: var(--muted); }
.cmp-empty .button { display: inline-flex; align-items: center; justify-content: center; min-width: 200px; }
.inline-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; vertical-align: middle; color: var(--on-accent); background: var(--accent); border-radius: 50%; }
.inline-icon svg { width: 16px; height: 16px; }

/* Сцена 300×230: карточка, палец, летящая картинка, кнопка Compare.
   Без анимации (или при «Уменьшить движение») видна итоговая картинка: палец у кнопки, в Compare — 1 */
.how { position: relative; width: 300px; height: 230px; }

.how-card {
  position: absolute;
  left: 20px;
  top: 10px;
  width: 130px;
  height: 166px;
  padding: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow, none);
}

.how-image {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 6px;
  background: radial-gradient(circle, color-mix(in srgb, var(--r) 30%, transparent), transparent 70%);
}

.how-image img { width: 80%; height: auto; }
.how-name { font-weight: 800; font-size: 15px; }
.how-line { height: 9px; margin-top: 7px; border-radius: 9px; background: var(--surface-2); }
.how-line.short { width: 60%; }

.how-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.how-btn svg { width: 17px; height: 17px; }
.how-fly { position: absolute; left: 45px; top: 22px; width: 80px; height: 80px; opacity: 0; }
.how-fly > div { width: 100%; height: 100%; }
.how-fly img { width: 100%; height: auto; }

.how-pill {
  position: absolute;
  right: 6px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 8px 0 12px;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.4);
}

.how-pill svg { width: 20px; height: 20px; }
.how-count { display: inline-grid; place-items: center; width: 26px; height: 26px; overflow: hidden; color: var(--accent-text); background: var(--surface); border-radius: 999px; }
.how-count span { grid-area: 1 / 1; }
.how-count span:first-child { opacity: 0; }
/* Кончик пальца — у нижнего края кнопки, чтобы кнопку было видно */
.how-hand { position: absolute; left: 114px; top: 40px; width: 52px; height: 61px; filter: drop-shadow(0 6px 8px rgb(0 0 0 / 0.25)); }
.hand-skin { fill: #fde7d2; }
.hand-line { fill: #1c1917; stroke: #1c1917; stroke-width: 5; }
.hand-cuff { fill: var(--accent); }

/* Цикл 5 секунд: палец подъезжает → нажимает → картинка летит в Compare → цифра 0 → 1 → всё сначала */
.how-hand { animation: how-hand 5s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
.how-btn { animation: how-btn 5s infinite; }
.how-fly { animation: how-fly-x 5s linear infinite; }
.how-fly > div { animation: how-fly-y 5s infinite; }
.how-pill { animation: how-pill 5s infinite; }
.how-count span:first-child { animation: how-zero 5s infinite; }
.how-count span:last-child { animation: how-one 5s infinite; }

@keyframes how-hand {
  0% { opacity: 0; transform: translate(80px, 130px); }
  10% { opacity: 1; }
  30% { transform: translate(0, 0) scale(1); }
  34% { transform: translate(0, 0) scale(0.86); }
  39% { transform: translate(0, 0) scale(1); }
  52% { opacity: 1; }
  62%, 100% { opacity: 0; transform: translate(50px, 100px); }
}

@keyframes how-btn {
  0%, 33% { color: var(--muted); background: var(--surface); border-color: var(--border); transform: scale(1); }
  34% { color: var(--on-accent); background: var(--accent); border-color: var(--accent); transform: scale(0.9); }
  40% { transform: scale(1.25); }
  46%, 92% { color: var(--on-accent); background: var(--accent); border-color: var(--accent); transform: scale(1); }
  97%, 100% { color: var(--muted); background: var(--surface); border-color: var(--border); }
}

@keyframes how-fly-x {
  0%, 36% { opacity: 0; transform: translateX(0); }
  37% { opacity: 1; transform: translateX(0); animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); }
  62% { opacity: 1; transform: translateX(95px); }
  64%, 100% { opacity: 0; transform: translateX(95px); }
}

@keyframes how-fly-y {
  0%, 37% { transform: translateY(0) scale(1); animation-timing-function: cubic-bezier(0.5, -0.7, 0.8, 0.6); }
  62%, 100% { transform: translateY(132px) scale(0.28) rotate(25deg); }
}

@keyframes how-pill {
  0%, 61% { transform: scale(1); }
  66% { transform: scale(1.15); }
  72%, 100% { transform: scale(1); }
}

@keyframes how-zero {
  0%, 62% { opacity: 1; transform: translateY(0); }
  66%, 94% { opacity: 0; transform: translateY(-100%); }
  98%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes how-one {
  0%, 62% { opacity: 0; transform: translateY(100%); }
  66%, 94% { opacity: 1; transform: translateY(0); }
  98%, 100% { opacity: 0; transform: translateY(100%); }
}

/* ----- Увеличенный график: вырастает из маленького до ширины экрана, фон размывается ----- */
.zoom {
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.45);
  overflow: auto;
}

.zoom::backdrop { background: rgb(12 10 9 / 0.5); backdrop-filter: blur(6px); animation: fade-in 0.35s ease both; }
.zoom.closing::backdrop { animation: fade-out 0.3s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.zoom-inner { padding: 16px; }
.zoom-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.zoom-image {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, color-mix(in srgb, var(--r) 30%, transparent), transparent 70%);
}

.zoom-image img { width: 85%; height: auto; }
.zoom-head h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; }
.zoom-close { margin-left: auto; align-self: flex-start; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; }
.zoom .plot { height: min(52vh, 420px); }
.zoom .site-chips { margin-top: 12px; }
@media (min-width: 720px) { .zoom-inner { padding: 22px; } }

/* Страница «не найдено»: кнопка по ширине текста, а не на всю страницу */
.empty .button { display: inline-block; min-width: 220px; }

/* ---------- Панель фильтров и переключатели: одна высота, один вид (10 ноября 2026) ---------- */

/* Переключатель-«сегменты» (Price / Value, Cards / Table, Prices / You get / Sales): кнопки одной ширины,
   под выбранной ездит один бегунок. Положение бегунка — по нажатой кнопке (:has), без скриптов */
.seg {
  --h: 46px;
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  flex: none;
  height: var(--h);
  margin: 0;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.seg::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n, 2));
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
  transition: transform 0.45s cubic-bezier(0.3, 1.35, 0.5, 1);
}
.seg:has(> button:nth-child(3)) { --n: 3; }
.seg:has(> button:nth-child(2)[aria-pressed="true"])::before { transform: translateX(100%); }
.seg:has(> button:nth-child(3)[aria-pressed="true"])::before { transform: translateX(200%); }
/* Price / Value: бегунок ставит класс на <html> (верно сразу при открытии, ещё до скриптов) */
html.show-value .show-switch::before { transform: translateX(100%); }
.seg > button {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s;
}
.seg > button[aria-pressed="true"] { color: var(--text); background: none; box-shadow: none; }

/* Строка фильтров: переключатели, Watchlist и два списка — всё 46px, скругление 12px */
.toolbar { align-items: center; margin: 0; gap: 12px; }
.toolbar .field { flex: 1 1 170px; }
/* Списки — в том же виде, что кнопки рядом: своя стрелка вместо системной (она разная в каждом браузере) */
.toolbar .select {
  width: 100%;
  height: 46px;
  min-height: 46px;
  padding: 0 40px 0 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a948e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  transition: border-color 0.2s;
}
.toolbar .select:hover { border-color: var(--accent); }
/* Панель фильтров: поиск и строка под ним — с ровным промежутком, а не вплотную */
.filters { display: grid; gap: 12px; }
.tool-button {
  flex: none;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.tool-button:hover { border-color: var(--accent); }
.tool-button[aria-pressed="true"] { border-color: #d97706; background: color-mix(in srgb, #d97706 14%, var(--surface)); }
/* На телефоне: переключатели в одну строку пополам, ниже — Watchlist и списки */
@media (max-width: 719px) {
  .toolbar { gap: 10px; }
  .toolbar .seg { flex: 1 1 calc(50% - 5px); }
  /* Watchlist и Rarity — рядом, сортировка — во всю ширину (иначе её текст обрезается) */
  .toolbar .tool-button { flex: 1 1 calc(50% - 5px); }
  .toolbar .field { flex: 1 1 calc(50% - 5px); }
  .toolbar .field:last-child { flex-basis: 100%; }
}

/* ---------- Навигация: меню-шторка и нижняя панель (10 ноября 2026) ---------- */

.menu-button svg, .drawer-icon svg, .tab-icon svg, .drawer-join svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.menu-button { flex: none; margin-right: 4px; }

/* Шторка: выезжает слева на всю высоту экрана, под ней — затемнение */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(330px, 88vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: 12px 0 40px rgb(0 0 0 / 0.25);
}
.drawer::backdrop { background: rgb(0 0 0 / 0.45); }
.drawer-inner { display: flex; flex-direction: column; gap: 4px; min-height: 100%; padding: 14px 14px 24px; overflow-y: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.drawer-title { margin: 0 6px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.drawer-section { margin: 14px 6px 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}
.drawer-link small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.drawer-link:hover { background: var(--surface-2); transform: translateX(3px); }
.drawer-link.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.drawer-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); color: var(--accent-text); }
.drawer-link.on .drawer-icon { background: var(--accent); color: var(--on-accent); }
.drawer-join {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; margin-top: auto; border-radius: 14px;
  background: #5865f2; color: #fff; font-weight: 800; text-decoration: none;
}

/* Нижняя панель — только на телефоне; на ПК и планшете вместо неё кнопка ☰ */
.tabbar { display: none; }
@media (max-width: 719px) {
  .menu-button { display: none; }
  .compare-fab { display: none; } /* Compare — в нижней панели */
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--header-bg, var(--surface)) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px; padding: 4px 0; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tab-icon { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background-color 0.25s; }
.tab.on { color: var(--text); }
.tab.on .tab-icon { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--accent-text); }
.tab-badge {
  position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 18px; text-align: center;
}

/* ---------- Анимации новых функций (10 ноября 2026) ----------
   Всё в одном месте. При «Уменьшить движение» в системе всё выключает правило в начале файла,
   скрипты тоже проверяют motionOK() (site.js), прежде чем что-то двигать. */

/* Быстрый поиск: поле мягко светится при фокусе, подсказки выпадают, строки появляются по очереди */
.quick-search .search { transition: box-shadow 0.25s, border-color 0.25s; }
.quick-search .search:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.suggest:not([hidden]) { animation: drop-in 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.1) both; transform-origin: top center; }
.suggest-option { animation: row-in 0.28s ease-out both; transition: background-color 0.15s; }
.suggest-option:nth-child(2) { animation-delay: 0.03s; }
.suggest-option:nth-child(3) { animation-delay: 0.06s; }
.suggest-option:nth-child(4) { animation-delay: 0.09s; }
.suggest-option:nth-child(5) { animation-delay: 0.12s; }
.suggest-option:nth-child(n+6) { animation-delay: 0.15s; }
.suggest-option .thumb img { transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.suggest-option[aria-selected="true"] .thumb img { transform: scale(1.15) rotate(-6deg); }

/* Блоки главной (Best deals, Biggest moves, Most traded, Trending) выплывают по очереди, строки — следом */
.widget { animation: panel-up 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.widget:nth-child(2) { animation-delay: 0.08s; }
.widget:nth-child(3) { animation-delay: 0.16s; }
.widget:nth-child(4) { animation-delay: 0.24s; }
.widget .rows li { animation: row-in 0.35s ease-out both; animation-delay: calc(0.25s + var(--n, 0) * 50ms); }
.widget .rows li:nth-child(2) { --n: 1; }
.widget .rows li:nth-child(3) { --n: 2; }
.widget .rows li:nth-child(4) { --n: 3; }
.widget .rows li:nth-child(5) { --n: 4; }
.row { transition: background-color 0.2s, transform 0.2s; }
.row:hover { transform: translateX(3px); }
.row .thumb img, .set-item .thumb img, .cat .thumb img { transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1.5); }
.row:hover .thumb img, .set-item:hover .thumb img, .cat:hover .thumb img { transform: scale(1.14) rotate(-6deg); }

/* Мини-график «прорисовывается» слева направо (pathLength="1" у линии) */
.trend path { stroke-dasharray: 1; animation: trend-draw 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.card-wrap .trend path { animation-delay: calc(0.2s + var(--i, 0) * 45ms); }
.widget .trend path { animation-delay: 0.45s; }
@keyframes trend-draw { from { stroke-dashoffset: 1; } }

/* Значок Deal выпрыгивает на карточке */
.deal-flag { animation: flag-pop 0.5s cubic-bezier(0.2, 0.7, 0.3, 1.6) both; animation-delay: calc(0.25s + var(--i, 0) * 45ms); }

/* Плитки видов: приподнимаются при наведении, выбранная «вдавливается» с пружинкой */
.cat { transition: transform 0.2s, border-color 0.25s, background-color 0.25s, box-shadow 0.25s; }
.cat:hover { transform: translateY(-3px); }
.cat:active { transform: translateY(0) scale(0.97); }
.cat[aria-current="true"] { animation: switch-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1); }
.cat-arrow { transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.cat-link:hover .cat-arrow { transform: translateX(5px); }

/* Переключатели: Price / Value — бегунок переезжает (как у $ / €), цена и value сменяют друг друга;
   Cards / Table и Prices / You get / Sales — выбранная кнопка подпрыгивает */
.show-option.bump { animation: currency-bump 0.45s ease-out; }
.show-anim .card-bottom > * { animation: price-swap 0.45s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.show-anim .suggest-price { animation: price-swap 0.45s ease both; }
.seg > button[aria-pressed="true"] { animation: switch-pop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes switch-pop { 40% { transform: scale(1.08); } }

/* Таблица: строки появляются по очереди (--i ставит home.js), заголовок сортировки подпрыгивает */
.market tbody tr { animation: row-in 0.3s ease-out both; animation-delay: calc(var(--i, 0) * 22ms); }
.th-arrow:not(:empty) { display: inline-block; animation: arrow-pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes arrow-pop { from { transform: translateY(-6px) scale(0.4); opacity: 0; } }

/* Страница предмета: панели выплывают, отметка на шкале «доезжает» до своего места,
   числа продаж набегают (site.js), строки фактов — по очереди */
.meter-panel, .item-panels > .panel, .alert-panel { animation: panel-up 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.item-panels > .panel:nth-child(2) { animation-delay: 0.08s; }
.item-panels > .panel:nth-child(3) { animation-delay: 0.16s; }
.meter i { animation: meter-in 1s cubic-bezier(0.2, 0.8, 0.3, 1.15) 0.25s both; }
@keyframes meter-in { from { left: 0; opacity: 0; } }
.sales-stats > div { animation: panel-up 0.45s ease-out both; }
.sales-stats > div:nth-child(2) { animation-delay: 0.06s; }
.sales-stats > div:nth-child(3) { animation-delay: 0.12s; }
.sales-stats > div:nth-child(4) { animation-delay: 0.18s; }
.facts > div { animation: row-in 0.35s ease-out both; }
.facts > div:nth-child(2) { animation-delay: 0.05s; }
.facts > div:nth-child(3) { animation-delay: 0.1s; }
.facts > div:nth-child(4) { animation-delay: 0.15s; }
.facts > div:nth-child(5) { animation-delay: 0.2s; }
.set-thumbs .thumb + .thumb { transition: margin-left 0.3s cubic-bezier(0.3, 1.4, 0.5, 1); }
.set-link:hover .set-thumbs .thumb + .thumb { margin-left: -2px; }

/* Уведомление о цене: колокольчик звенит, когда уведомление поставлено; новые строки выезжают */
.alert-panel.ringing .widget-title span { display: inline-block; animation: bell-ring 0.8s ease-in-out; transform-origin: top center; }
@keyframes bell-ring { 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
.alert-item { animation: row-in 0.35s ease-out both; }
.alert-row .button:active, .inv-actions .button:active, .save-image:active { transform: scale(0.96); }

/* Калькулятор инвентаря: новая строка выезжает, число штук и итог подпрыгивают при изменении (inventory.js) */
.inv-row.is-new { animation: row-in 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
.qty-value.bump, .inv-total.bump { display: inline-block; animation: currency-bump 0.4s ease-out; }
.inv-total.bump { display: block; transform-origin: left center; }
.qty-button { transition: border-color 0.2s, transform 0.15s; }
.qty-button:active { transform: scale(0.9); }
.site-total { transition: background-color 0.35s, border-color 0.35s; }
.site-total.is-best b { animation: switch-pop 0.4s ease-out; }

/* Сравнение: значок на «Save as image» покачивается при наведении, пока картинка рисуется — кнопка «дышит» */
.save-image svg { transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1); }
.save-image:hover svg { transform: rotate(-10deg) scale(1.12); }
.save-image:disabled { animation: busy-pulse 1s ease-in-out infinite; cursor: progress; }
@keyframes busy-pulse { 50% { opacity: 0.55; } }

/* Наборы: первые карточки выплывают по очереди, предметы набора сдвигаются при наведении */
.set-card { animation: panel-up 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.set-card:nth-child(2) { animation-delay: 0.05s; }
.set-card:nth-child(3) { animation-delay: 0.1s; }
.set-card:nth-child(4) { animation-delay: 0.15s; }
.set-card:nth-child(n+5) { animation-delay: 0.2s; }
.set-item { transition: background-color 0.2s, transform 0.2s; }
.set-item:hover { transform: translateX(3px); }

/* Общие движения */
@keyframes panel-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }

/* Навигация: шторка выезжает слева (и уезжает обратно), ссылки — по очереди; вкладка внизу подпрыгивает */
.drawer[open] { animation: drawer-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.drawer[open]::backdrop { animation: fade-in 0.25s ease both; }
.drawer.closing { animation: drawer-out 0.2s ease-in both; }
.drawer.closing::backdrop { animation: fade-out 0.2s ease-in both; }
.drawer[open] .drawer-link { animation: row-in 0.3s ease-out both; }
.drawer[open] .drawer-link:nth-child(2) { animation-delay: 0.03s; }
.drawer[open] .drawer-link:nth-child(3) { animation-delay: 0.06s; }
.drawer[open] .drawer-link:nth-child(4) { animation-delay: 0.09s; }
.drawer[open] .drawer-link:nth-child(5) { animation-delay: 0.12s; }
.drawer[open] .drawer-link:nth-child(6) { animation-delay: 0.15s; }
.drawer-join { transition: transform 0.2s, filter 0.2s; }
.drawer-join:hover { transform: translateY(-2px); filter: brightness(1.1); }
@keyframes drawer-in { from { transform: translateX(-100%); } }
@keyframes drawer-out { to { transform: translateX(-100%); } }
.tab.on .tab-icon { animation: switch-pop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
.tab:active .tab-icon { transform: scale(0.9); }
.tab-badge.bump, [data-compare-count].bump { display: inline-block; animation: currency-bump 0.4s ease-out; }

/* Наборы: пришли по ссылке «Part of a set» (sets.html#набор) — нужный набор встаёт в середину экрана
   и несколько секунд мягко светится цветом сайта (:target — набор из адреса после #) */
.set-card { scroll-margin-top: 30vh; }
.set-card:target { animation: set-found 4s ease-out both; }
@keyframes set-found {
  0%, 60% { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent); }
  10%, 30% { transform: scale(1.02); }
  20%, 40% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  /* без движения, но подсветка остаётся — иначе не видно, какой набор искали */
  .set-card:target { animation: none !important; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
}

/* Слежка: гайд по разрешениям выезжает, кнопка Discord приподнимается */
.permission-guide:not([hidden]) { animation: drop-in 0.3s ease both; }
.discord-button { transition: transform 0.2s, filter 0.2s; }
.discord-button:hover { transform: translateY(-2px); filter: brightness(1.1); }
.discord-panel:target { animation: set-found 4s ease-out both; }

/* Логотип: при наведении кубики подрастают по очереди, линия «прорисовывается» */
.logo-blocks rect { transform-box: fill-box; transform-origin: bottom; transition: transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); }
.logo:hover .logo-blocks rect { transform: scaleY(1.12); }
.logo:hover .logo-blocks rect:nth-child(2) { transition-delay: 0.05s; }
.logo:hover .logo-blocks rect:nth-child(3) { transition-delay: 0.1s; }
.logo-line { stroke-dasharray: 30; stroke-dashoffset: 0; transition: stroke-dashoffset 0.5s ease; }
.logo:hover .logo-line { animation: logo-line 0.6s ease; }
@keyframes logo-line { from { stroke-dashoffset: 30; } }

/* Appearance: панель раскрывается с пружинкой от кнопки, кружки гамм появляются по очереди,
   выбранный кружок подпрыгивает, а новое оформление расходится кругом (site.js) */
.appearance-panel:not([hidden]) { animation: game-panel-in 0.32s cubic-bezier(0.25, 1.25, 0.5, 1) both; transform-origin: top right; }
.appearance-panel.closing { animation: game-panel-out 0.16s ease-in both; }
.appearance-panel:not([hidden]) .palette-option { animation: game-item-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.appearance-panel:not([hidden]) .palette-option:nth-child(2) { animation-delay: 0.04s; }
.appearance-panel:not([hidden]) .palette-option:nth-child(3) { animation-delay: 0.08s; }
.appearance-panel:not([hidden]) .palette-option:nth-child(4) { animation-delay: 0.12s; }
.appearance-panel:not([hidden]) .palette-option:nth-child(5) { animation-delay: 0.16s; }
.palette-option { transition: background-color 0.2s, border-color 0.25s, color 0.2s; }
.swatch { transition: transform 0.3s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.25s; }
.palette-option:hover .swatch { transform: scale(1.1) rotate(-12deg); }
.palette-option.bump .swatch { animation: currency-bump 0.45s ease-out; }
.palette-option[aria-pressed="true"] .swatch::after { animation: flag-pop 0.4s cubic-bezier(0.2, 0.7, 0.3, 1.6) both; }
.theme-button[aria-expanded="true"] { border-color: var(--accent); }
@media (max-width: 719px) { .appearance-panel:not([hidden]) { transform-origin: top center; } }
