/* tokens.css */
/*
 * CaseDays («Гусь») — дизайн-токены. Единственное место с цветами (HEX) в CSS проекта.
 * Источник: tz_project.md → «Оформление», макет design/mockup/; палитра — docs/BRAND_GOOSE.md (хром, чёрный хром, белый, золото).
 */

/* Запасной шрифт с метриками Montserrat: пока WOFF2 грузится, текст занимает то же место — без сдвига вёрстки при замене */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 113.95%;
  ascent-override: 84.95%;
  descent-override: 22.03%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/montserrat-500.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/montserrat-800.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  /* Поверхности — «чёрный хром»: графит с холодным отливом */
  --bg: #0E0F11;
  --surface-1: #15171A;
  --surface-2: #1C1F23;
  --surface-3: #272A30;
  --line: #31353C;

  /* Текст — белый и «серый хром» */
  --text: #F4F5F7;
  --text-muted: #8F959E;

  /* Хром: металлические переливы для рамок, заголовков и плашек */
  --chrome-hi: #E9ECF0;
  --chrome-mid: #A3AAB4;
  --chrome-lo: #4A4F57;

  /* Акцент — золото бренда «Гусь» и статусы */
  --accent: #F5C542;
  --accent-hover: #FFD668;
  --accent-deep: #B88A2B;
  --accent-ink: #0E0F11;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #5B8DEF;

  /* Фоны плиток и баннеров — графитовые оттенки, плавно уходят в --surface-2 */
  --tile-wine: #3A2B2E;
  --tile-brown: #3A3127;
  --tile-violet: #2F2D3D;
  --tile-green: #26332F;
  --tile-gold: #4A3B1C;
  --tile-blue: #27303C;
  --hero-teal: #2A3038;
  --hero-red: #4A3A1A;

  /* Редкость (всегда вместе с текстовым названием) */
  --rarity-consumer: #A3ABB8;
  --rarity-industrial: #6BA4E8;
  --rarity-milspec: #4F6DF5;
  --rarity-restricted: #8A4DF2;
  --rarity-classified: #D23CE0;
  --rarity-covert: #F04848;
  --rarity-extraordinary: #F2A93B;

  /* Градиенты бренда */
  --grad-chrome: linear-gradient(180deg, var(--chrome-hi) 0%, var(--chrome-mid) 48%, var(--chrome-hi) 100%);
  --grad-gold: linear-gradient(180deg, var(--accent-hover) 0%, var(--accent) 45%, var(--accent-deep) 100%);
  --grad-steel: linear-gradient(180deg, var(--surface-3) 0%, var(--surface-1) 100%);
  --edge-chrome: linear-gradient(135deg, color-mix(in srgb, var(--chrome-hi) 55%, transparent), color-mix(in srgb, var(--chrome-lo) 30%, transparent) 40%, color-mix(in srgb, var(--chrome-hi) 25%, transparent));

  /* Производные (полупрозрачные) — только через color-mix от токенов */
  --overlay: color-mix(in srgb, var(--bg) 80%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --success-soft: color-mix(in srgb, var(--success) 14%, transparent);
  --warning-soft: color-mix(in srgb, var(--warning) 14%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 14%, transparent);
  --info-soft: color-mix(in srgb, var(--info) 18%, transparent);
  --info-text: color-mix(in srgb, var(--info) 70%, var(--text)); /* текст и ссылки: контраст AA на тёмных слоях */
  --danger-text: color-mix(in srgb, var(--danger) 70%, var(--text));
  --text-soft: color-mix(in srgb, var(--text) 8%, transparent);

  /* Типографика */
  --font: "Montserrat", "Montserrat Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
  --fs-h1: 40px;
  --lh-h1: 48px;
  --fs-banner: 30px;
  --lh-banner: 36px;
  --fs-tile: 28px;
  --lh-tile: 32px;
  --fs-h2: 22px;
  --lh-h2: 28px;
  --fs-value: 20px; /* число в плитке-показателе (stat) */
  --lh-value: 28px;
  --fs-h3: 18px;
  --lh-h3: 24px;
  --fs-body: 16px;
  --lh-body: 24px;
  --fs-small: 14px;
  --lh-small: 20px;
  --fs-xs: 12px;
  --lh-xs: 16px;
  --tracking-caps: 0.01em;

  /* Сетка — шаг 4 px */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --container: 1320px;
  --gap-block: 24px;
  --pad-card: 24px;

  /* Формы */
  --radius-card: 16px;
  --radius-control: 10px;
  --radius-modal: 20px;
  --radius-pill: 999px;
  --control-h: 44px;
  --control-h-sm: 36px;
  --border: 1px solid var(--line);

  /* Движение */
  --dur-micro: 150ms;
  --dur-base: 220ms;
  --dur-slow: 260ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Слои */
  --z-header: 50;
  --z-dropdown: 60;
  --z-modal: 100;
  --z-toast: 120;
}

@media (max-width: 767px) {
  :root {
    --fs-h1: 28px;
    --lh-h1: 34px;
    --fs-banner: 24px;
    --lh-banner: 30px;
    --fs-tile: 22px;
    --lh-tile: 28px;
    --fs-value: 18px;
    --lh-value: 24px;
    --gap-block: 16px;
    --pad-card: 16px;
    --control-h: 48px;
    --control-h-sm: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-micro: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}

/* base.css */
/* CaseDays — сброс, типографика, утилиты. Цвета — только var(--…) из tokens.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-medium);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Типографика */
.h1,
.h2,
.h-banner,
.h-tile {
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}

.h-banner {
  font-size: var(--fs-banner);
  line-height: var(--lh-banner);
}

.h-tile {
  font-size: var(--fs-tile);
  line-height: var(--lh-tile);
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  font-weight: var(--fw-bold);
}

.text-small {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.text-xs {
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
}

.text-muted {
  color: var(--text-muted);
}

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

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.num,
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.link {
  color: var(--info-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-micro) var(--ease);
}

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

/* Иконки из спрайта */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

/* Утилиты */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .container {
    padding-inline: var(--sp-4);
  }
}

/* components.css */
/* CaseDays — компоненты UI-кита. Только токены из tokens.css, теней нет. */

/* ---------- Кнопки ---------- */
.btn {
  --btn-bg: var(--surface-3);
  --btn-bg-hover: var(--line);
  --btn-color: var(--text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--control-h);
  padding: 0 var(--sp-5);
  border: 0;
  border-radius: var(--radius-control);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}

.btn:hover {
  background: var(--btn-bg-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn--accent {
  --btn-bg: var(--accent);
  --btn-bg-hover: var(--accent-hover);
  --btn-color: var(--accent-ink);
}

.btn--secondary {
  --btn-bg: var(--surface-3);
  --btn-bg-hover: var(--line);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: var(--surface-3);
  --btn-color: var(--text-muted);
}

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

.btn--danger {
  --btn-bg: var(--danger-soft);
  --btn-bg-hover: color-mix(in srgb, var(--danger) 24%, transparent);
  --btn-color: var(--danger-text);
}

/* Скошенные углы с обводкой — «Принять», «Оплатить», «Отмена», «Применить» (макет модалок) */
.btn--confirm,
.btn--cancel,
.btn--apply {
  --cut: 10px;
  --btn-line: var(--success);
  --btn-bg: var(--success-soft);
  --btn-bg-hover: color-mix(in srgb, var(--success) 26%, transparent);
  border-radius: 0;
  background: var(--btn-line);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  isolation: isolate;
}

.btn--confirm::before,
.btn--cancel::before,
.btn--apply::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: -1;
  background: linear-gradient(var(--btn-bg), var(--btn-bg)), var(--surface-2);
  clip-path: inherit;
  transition: background var(--dur-micro) var(--ease);
}

.btn--confirm:hover,
.btn--cancel:hover,
.btn--apply:hover {
  background: var(--btn-line);
}

.btn--confirm:hover::before,
.btn--cancel:hover::before,
.btn--apply:hover::before {
  background: linear-gradient(var(--btn-bg-hover), var(--btn-bg-hover)), var(--surface-2);
}

.btn--confirm .icon {
  color: var(--success);
}

.btn--cancel {
  --btn-line: var(--surface-3);
  --btn-bg: var(--surface-2);
  --btn-bg-hover: var(--surface-3);
  --btn-color: var(--text-muted);
}

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

.btn--apply {
  --btn-line: var(--info);
  --btn-bg: var(--info-soft);
  --btn-bg-hover: color-mix(in srgb, var(--info) 30%, transparent);
}

.btn--sm {
  height: var(--control-h-sm);
  padding: 0 var(--sp-4);
}

.btn--lg {
  height: 52px;
  padding: 0 var(--sp-6);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: var(--control-h);
  padding: 0;
}

.btn--icon.btn--sm {
  width: var(--control-h-sm);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.is-loading {
  color: transparent;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid var(--btn-color);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

/* ---------- Поля ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field__label {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
}

.field__hint {
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  color: var(--text-muted);
}

.field__error {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  color: var(--danger);
}

.input {
  width: 100%;
  height: var(--control-h);
  padding: 0 var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-1);
  color: var(--text);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  transition: border-color var(--dur-micro) var(--ease);
}

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

.input:hover {
  border-color: var(--surface-3);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

textarea.input {
  height: auto;
  min-height: 96px;
  padding: var(--sp-3) var(--sp-4);
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: var(--sp-10);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group > .icon {
  position: absolute;
  left: var(--sp-4);
  color: var(--text-muted);
  pointer-events: none;
}

.input-group > .input {
  padding-left: var(--sp-12);
}

/* Чекбокс — квадрат с галочкой, как в модалке согласия */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--text-muted);
}

.check__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check__box {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  margin-top: -2px;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 55%, transparent);
  border-radius: 6px;
  background: var(--surface-1);
  color: transparent;
  transition: background-color var(--dur-micro) var(--ease), border-color var(--dur-micro) var(--ease);
}

.check__box .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.check__input:checked + .check__box {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.check__input:focus-visible + .check__box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.check__input:checked ~ .check__text {
  color: var(--text);
}

/* Переключатель — «Быстро», «Демо», звук */
.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
}

.switch__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch__track {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line); /* дорожка видна и на графитовом фоне */
  transition: background-color var(--dur-base) var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) var(--ease);
}

.switch__input:checked + .switch__track {
  background: var(--accent);
}

.switch__input:checked + .switch__track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

/* Тумблер-кнопка (звук): состояние — aria-pressed */
.switch--button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
}

.switch--button[aria-pressed="true"] .switch__track {
  background: var(--accent);
}

.switch--button[aria-pressed="true"] .switch__track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}

.switch--button:focus-visible .switch__track,
.switch__input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Сегменты — ×1…×10 */
.segmented {
  display: inline-flex;
  gap: var(--sp-1);
  padding: var(--sp-1);
  border-radius: var(--radius-control);
  background: var(--surface-1);
}

.segmented__item {
  min-width: 44px;
  height: var(--control-h-sm);
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}

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

.segmented__item[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--accent);
}

/* ---------- Чипы ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control-h-sm);
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
}

button.chip:hover {
  background: var(--line);
}

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

/* ---------- Бейджи ---------- */
.badge {
  --badge-color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 24px;
  padding: 0 var(--sp-2);
  border-radius: 6px;
  /* Текст светлее подложки: серый, info и danger на своей 16 % подложке иначе не дают AA */
  --badge-text: color-mix(in srgb, var(--badge-color) 60%, var(--text));
  background: color-mix(in srgb, var(--badge-color) 16%, transparent);
  color: var(--badge-text);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge .icon {
  width: 14px;
  height: 14px;
}

.badge--accent { --badge-color: var(--accent); --badge-text: var(--accent); }
.badge--success { --badge-color: var(--success); --badge-text: var(--success); }
.badge--warning { --badge-color: var(--warning); --badge-text: var(--warning); }
.badge--danger { --badge-color: var(--danger); }
.badge--info { --badge-color: var(--info); }

/* Плотный бейдж — тип способа оплаты (CARD, ONLINE) на макете */
.badge--solid {
  background: var(--badge-color);
  color: var(--text);
}

.badge--solid.badge--accent {
  color: var(--accent-ink);
}

/* ---------- Редкость ---------- */
.rarity--consumer { --rarity: var(--rarity-consumer); }
.rarity--industrial { --rarity: var(--rarity-industrial); }
.rarity--milspec { --rarity: var(--rarity-milspec); }
.rarity--restricted { --rarity: var(--rarity-restricted); }
.rarity--classified { --rarity: var(--rarity-classified); }
.rarity--covert { --rarity: var(--rarity-covert); }
.rarity--extraordinary { --rarity: var(--rarity-extraordinary); }

.rarity-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
  color: var(--rarity, var(--text-muted));
}

.rarity-tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
}

/* Карточка предмета (сетка содержимого кейса, инвентарь) */
.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-4);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity, var(--surface-3)) 18%, var(--surface-2)) 0%, var(--surface-2) 70%);
  overflow: hidden;
}

.item-card::after {
  content: "";
  position: absolute;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--rarity, var(--surface-3));
}

.item-card__img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: contain;
}

.item-card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  color: var(--rarity, var(--text-muted));
}

.item-card__placeholder {
  width: 44px;
  height: 44px;
  stroke-width: 1.25;
}

.item-card__weapon {
  margin-bottom: calc(-1 * var(--sp-2));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card__st {
  color: var(--rarity-covert);
  font-weight: var(--fw-bold);
}

.item-card__name {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

/* Цена в карточке предмета — как название: 14/20, жирным */
.item-card__price {
  min-width: 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-bold);
}

/* ---------- Карточки и плитки ---------- */
.card {
  padding: var(--pad-card);
  border-radius: var(--radius-card);
  background: var(--surface-2);
}

.card--flat {
  background: var(--surface-1);
}

.tile {
  --tile: var(--surface-3);
  position: relative;
  padding: var(--pad-card);
  border-radius: var(--radius-card);
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--chrome-hi) 7%, transparent), transparent 60%),
    linear-gradient(135deg, var(--tile) 0%, var(--surface-2) 100%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chrome-hi) 14%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--chrome-hi) 6%, transparent);
  overflow: hidden;
}

.tile--wine { --tile: var(--tile-wine); }
.tile--brown { --tile: var(--tile-brown); }
.tile--violet { --tile: var(--tile-violet); }
.tile--green { --tile: var(--tile-green); }
.tile--gold { --tile: var(--tile-gold); }
.tile--blue { --tile: var(--tile-blue); }
.tile--hero-teal { --tile: var(--hero-teal); }
.tile--hero-red { --tile: var(--hero-red); }

/* ---------- Фильтры списков (каталог, инвентарь) ---------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.filters__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.filters__search {
  flex: 1 1 280px;
}

.filters__sort {
  flex: 0 1 240px;
}

.filters__more {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.filters__toggle {
  align-self: flex-start;
  list-style: none;
}

.filters__toggle::-webkit-details-marker {
  display: none;
}

.filters__more[open] .filters__toggle {
  background: var(--line);
}

.filters__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.filters__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-4);
  border-radius: var(--radius-card);
  background: var(--surface-1);
}

.filters__price {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filters__price legend {
  float: left;
  margin-right: var(--sp-2);
}

.filters__price .input {
  width: 104px;
  height: var(--control-h-sm);
}

.filters__flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.filters__chip {
  cursor: pointer;
}

.filters__chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.filters__chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filters__actions {
  display: flex;
  gap: var(--sp-2);
  margin-left: auto;
}

/* ---------- Пагинация ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding-top: var(--sp-2);
}

@media (max-width: 767px) {
  .filters__sort {
    flex: 1 1 100%;
  }

  .filters__panel {
    flex-direction: column;
    flex-wrap: nowrap; /* в колонке с переносом ширина строки бралась по контенту */
    align-items: stretch;
  }

  .filters__price .input {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .filters__actions {
    margin-left: 0;
  }

  .filters__actions .btn {
    flex: 1;
  }
}

/* ---------- Аватар (шапка, лента, профиль, админка) ---------- */
.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
}

.avatar--sm {
  width: 28px;
  height: 28px;
}

.avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar__initial {
  color: var(--text);
  font-weight: var(--fw-bold);
  font-size: var(--fs-small);
}

.avatar__anon {
  color: var(--text-muted);
}

.avatar--sm .avatar__initial {
  font-size: var(--fs-xs);
}

.avatar__level {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 22px;
  height: 18px;
  padding: 0 var(--sp-1);
  border: 2px solid var(--bg);
  border-radius: var(--radius-pill);
  background: var(--info);
  color: var(--text);
  font-size: var(--fs-xs);
  line-height: 14px;
  font-weight: var(--fw-bold);
  text-align: center;
}

/* ---------- Таблица (история, Provably Fair) ---------- */
.table-wrap {
  position: relative; /* скрытые подписи внутри таблицы не выходят за контейнер прокрутки */
  padding: 0;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.table th {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: var(--border);
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table__row {
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease);
}

.table__row:hover {
  background: var(--surface-3);
}

.table__amount,
.table__price,
.table__item_price,
.table__fee {
  text-align: right;
}

.table__action {
  width: 48px;
  text-align: right;
}

.table__mono {
  font-variant-numeric: tabular-nums;
}

.table .rarity-tag {
  color: var(--text);
}

.table .rarity-tag::before {
  background: var(--rarity, var(--text-muted));
}

@media (max-width: 767px) {
  /* Таблица → карточки строк */
  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
  }

  .table__row {
    position: relative;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: var(--border);
  }

  .table td {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-1) 0;
    border: 0;
    text-align: right;
  }

  .table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    text-align: left;
  }

  .table__action {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-2);
    width: auto;
  }

  .table__action::before {
    content: none;
  }

  .table td.table__date {
    padding-right: var(--sp-10);
  }
}

/* ---------- Список «ключ — значение» (деталь операции, seed, Provably Fair) ---------- */
.details {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: var(--sp-4);
  border-radius: var(--radius-card);
  background: var(--surface-1);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.details__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-bold);
}

.details__title .icon {
  color: var(--success);
}

.details__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
}

.details__row[hidden] {
  display: none;
}

.details__row dt {
  color: var(--text-muted);
}

.details__row dd {
  margin: 0;
  min-width: 0;
  text-align: right;
  font-weight: var(--fw-semibold);
}

.details__row--stack {
  flex-direction: column;
  gap: var(--sp-1);
}

.details__row--stack dd {
  text-align: left;
}

.details__multiline {
  white-space: pre-line;
}

.details__mono {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.details__copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

/* ---------- FAQ-аккордеон (главная, кейс, /faq) ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.faq__item {
  border-radius: var(--radius-control);
  background: var(--surface-2);
}

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__chevron {
  flex: none;
  color: var(--text-muted);
  transition: transform var(--dur-base) var(--ease);
}

.faq__item[open] .faq__chevron {
  transform: rotate(180deg);
}

.faq__a {
  padding: 0 var(--sp-5) var(--sp-4);
  max-width: 920px;
}

/* ---------- Табы ---------- */
.tabs {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
}

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

/* Горизонтальные полосы (js/layout.js initScrollers): затухание у края, за которым ещё есть пункты */
.is-fade-end {
  -webkit-mask-image: linear-gradient(90deg, var(--bg) calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, var(--bg) calc(100% - 40px), transparent);
}

.is-fade-start {
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--bg) 40px);
  mask-image: linear-gradient(90deg, transparent, var(--bg) 40px);
}

.is-fade-start.is-fade-end {
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--bg) 40px, var(--bg) calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, var(--bg) 40px, var(--bg) calc(100% - 40px), transparent);
}

.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--control-h-sm);
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}

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

.tabs__tab[aria-selected="true"],
.tabs__tab[aria-current="page"] {
  background: var(--surface-3);
  color: var(--text);
}

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

.tabs__tab[aria-selected="true"] .tabs__count,
.tabs__tab[aria-current="page"] .tabs__count {
  color: var(--text);
}

/* ---------- Прогресс ---------- */
.progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease);
}

/* ---------- Скелетоны ---------- */
.skeleton {
  display: block;
  border-radius: var(--radius-control);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.skeleton--text {
  height: 14px;
  border-radius: 4px;
}

.skeleton--card {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
}

/* ---------- Пустое состояние ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--text-muted);
}

.empty > .icon {
  width: 40px;
  height: 40px;
  stroke-width: 1.5;
}

/* Бренд «Гусь»: в пустых состояниях — гусь у пустой кормушки вместо значка (компактные списки — .empty--sm без арта) */
.empty:not(.empty--sm)::before {
  content: "";
  width: 120px;
  height: 120px;
  background: url("/assets/img/states/empty-sm.webp") center / contain no-repeat;
}

.empty:not(.empty--sm) > .icon:first-child {
  display: none;
}

.empty__title {
  color: var(--text);
  font-weight: var(--fw-bold);
}

/* ---------- Спиннер ---------- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

/* ---------- Тосты ---------- */
.toast-stack {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(380px, calc(100vw - 2 * var(--sp-4)));
  pointer-events: none;
}

.toast {
  --toast-color: var(--info);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: var(--border);
  border-left: 3px solid var(--toast-color);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  pointer-events: auto;
  animation: toast-in var(--dur-base) var(--ease);
}

.toast > .icon {
  color: var(--toast-color);
}

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: var(--fw-bold);
}

.toast__text {
  color: var(--text-muted);
}

.toast__close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: -2px -4px 0 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
}

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

.toast--success { --toast-color: var(--success); }
.toast--warning { --toast-color: var(--warning); }
.toast--danger { --toast-color: var(--danger); }

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}

/* ---------- Модалка (<dialog>) ---------- */
.modal {
  width: min(560px, calc(100vw - 2 * var(--sp-4)));
  max-height: calc(100dvh - 2 * var(--sp-6));
  padding: 0;
  border: var(--border);
  border-radius: var(--radius-modal);
  background: var(--surface-2);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
}

.modal--wide {
  width: min(960px, calc(100vw - 2 * var(--sp-4)));
}

.modal::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modal-in var(--dur-base) var(--ease);
}

.modal__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  padding: var(--sp-8);
}

.modal__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-muted);
  transition: color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
}

.modal__close:hover {
  background: var(--line);
  color: var(--text);
}

.modal__head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-right: var(--sp-10);
}

.modal__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.modal__subtitle {
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.modal__footer > .btn {
  flex: 1 1 160px;
}

/* Индикатор-точка у заголовка (макет «Выбор способа оплаты») */
.dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--success);
}

@media (max-width: 767px) {
  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    margin: auto auto 0;
    border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  }

  .modal__inner {
    padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom));
  }

  .toast-stack {
    right: var(--sp-4);
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ---------- Анимации ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .spinner,
  .btn.is-loading::after {
    animation-duration: 2s;
  }

  .modal[open],
  .toast {
    animation: none;
  }
}

/* ---------- Вход нужен / вход не удался (auth/required, auth/failed) ---------- */
.auth-required {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  max-width: 560px;
  margin: var(--sp-10) auto;
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
}

.auth-required__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.auth-required__actions {
  justify-content: center;
}

.auth-required__icon--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- Плашка-сообщение (настройки, эмулятор оплаты) ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-control);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.notice--warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.notice--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.notice--success {
  background: var(--success-soft);
  color: var(--success);
}

/* ---------- Эмулятор оплаты Sandbox ---------- */
.sandbox-pay {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 560px;
  margin: var(--sp-10) auto;
  padding: var(--sp-6);
}

.sandbox-pay__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

@media (max-width: 767px) {
  .sandbox-pay {
    margin: var(--sp-4) auto;
    padding: var(--sp-4);
  }

  .sandbox-pay__actions {
    grid-template-columns: 1fr;
  }
}


/* ---------- Тема события «Новый год» (настройка theme.event = new_year) ---------- */
.theme--new-year .case-card__link::after,
.theme--new-year .promo::after,
.theme--new-year .game::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 14px;
  width: 46px;
  height: 14px;
  border-radius: 999px 999px 10px 10px;
  background: var(--text);
  pointer-events: none;
}

.theme--new-year::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20px 30px, color-mix(in srgb, var(--text) 70%, transparent) 50%, transparent 51%),
    radial-gradient(3px 3px at 120px 80px, color-mix(in srgb, var(--text) 50%, transparent) 50%, transparent 51%),
    radial-gradient(2px 2px at 200px 160px, color-mix(in srgb, var(--text) 60%, transparent) 50%, transparent 51%),
    radial-gradient(3px 3px at 60px 210px, color-mix(in srgb, var(--text) 40%, transparent) 50%, transparent 51%);
  background-size: 240px 240px;
  animation: snow-fall 18s linear infinite;
}

.theme--new-year .promo::after,
.theme--new-year .game::after {
  top: 0;
  z-index: 1;
  border-radius: 0 0 12px 12px;
}

@keyframes snow-fall {
  from { background-position: 0 0; }
  to { background-position: 60px 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme--new-year::after {
    display: none;
  }
}

/* ---------- Хлебные крошки (кейс, батлы) ---------- */
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.crumbs__list li + li::before {
  content: "/";
  margin-right: var(--sp-2);
  color: var(--surface-3);
}

.crumbs__list a {
  transition: color var(--dur-micro) var(--ease);
}

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

.crumbs__list [aria-current] {
  color: var(--text);
}

/* ---------- Показатель: подпись + значение ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.stat__label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.stat__value {
  min-width: 0;
  margin: 0;
  font-size: var(--fs-value);
  line-height: var(--lh-value);
  font-weight: var(--fw-bold);
}

/* Пояснение к числу — второй строкой, обычным текстом */
.stat__value > .text-small {
  display: block;
  font-weight: var(--fw-medium);
  white-space: normal;
}

.stat__value--item {
  display: flex;
  flex-direction: column;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-bold);
}

.stat__item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rarity, var(--text));
}

/* ---------- Гусь-талисман в заголовке игровой страницы ---------- */
.game-mascot {
  position: relative;
  flex: none;
  display: grid;
  place-items: end center;
  width: 88px;
  height: 88px;
  border-radius: var(--radius-card);
  background:
    radial-gradient(80% 70% at 50% 35%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--grad-steel);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chrome-hi) 18%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  overflow: hidden; /* гусь целиком внутри плашки, без вылезания за край */
}

.game-mascot__art {
  width: 100%;
  height: 100%;
  padding: var(--sp-1) var(--sp-1) 0;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--bg) 70%, transparent));
}

@media (max-width: 767px) {
  .game-mascot {
    width: 64px;
    height: 64px;
  }

}

/* skin.css */
/*
 * CaseDays «Гусь» — общая графика (подключается во все страницы через css_bundle):
 * фирменный скроллбар, значок крошки у сумм, шестигранная подложка предметов (hex-art)
 * и карточка выпадения (drop-card) для ленты «Пруд сейчас». Только токены из tokens.css.
 */

/* ---------- Скроллбар ---------- */
html {
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--surface-3)) var(--bg);
  scrollbar-width: thin;
}

* {
  scrollbar-color: color-mix(in srgb, var(--chrome-lo) 80%, var(--surface-3)) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--chrome-lo) 80%, var(--surface-3)) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-deep) padding-box;
}

html::-webkit-scrollbar-thumb {
  background: var(--grad-gold);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- Значок крошки у суммы ----------
 * Любая сумма с классом .money получает графическую крошку (рубли пополнения — .money--rub — без неё).
 * money_html() выводит значок разметкой (.money__icon) — тогда псевдоэлемент не дублируется. */
.money:not(.money--rub):not(s):not(del):not(:has(> .money__icon))::before,
.money__icon,
.crumb-icon {
  content: "";
  display: inline-block;
  flex: none;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.3em;
  vertical-align: -0.16em;
  background: url("/assets/img/brand/crumb.webp") center / contain no-repeat;
}

s.money::before,
del.money::before {
  display: none;
}

.money:has(> .money__icon) {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  white-space: nowrap;
}

.money__word {
  margin-left: 0.28em; /* в inline-flex пробел между числом и словом схлопывается */
}

/* Кошелёк в шапке: значок крошки заменяет иконку кошелька */
.wallet:has(.money__icon) .wallet__icon {
  display: none;
}

/* ---------- Шестигранная подложка предмета (как в ленте и карточках) ---------- */
.hex-art {
  --hex-c: var(--rarity, var(--chrome-mid));
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.hex-art__hex {
  position: absolute;
  z-index: -1;
  display: grid;
  place-items: center;
  width: 62%;
  aspect-ratio: 0.88;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background:
    radial-gradient(80% 60% at 50% 30%, color-mix(in srgb, var(--hex-c) 55%, var(--chrome-hi)) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--hex-c) 70%, var(--surface-2)) 0%, color-mix(in srgb, var(--hex-c) 35%, var(--bg)) 100%);
}

.hex-art__hex::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  clip-path: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hex-c) 45%, var(--surface-1)), color-mix(in srgb, var(--hex-c) 22%, var(--bg)));
}

.hex-art__mark {
  width: 46%;
  height: auto;
  aspect-ratio: 1;
  color: color-mix(in srgb, var(--hex-c) 35%, var(--chrome-hi));
  opacity: 0.32;
  stroke-width: 1.5;
}

.hex-art__img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px color-mix(in srgb, var(--bg) 70%, transparent));
  transition: transform var(--dur-base) var(--ease);
}

/* ---------- Карточка выпадения ---------- */
.drop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  border-radius: var(--radius-card);
  background:
    radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--rarity) 30%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--rarity) 22%, var(--surface-1)) 0%, color-mix(in srgb, var(--rarity) 8%, var(--bg)) 100%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--chrome-hi) 10%, transparent);
  text-align: center;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease), background-color var(--dur-base) var(--ease);
}

.drop-card:hover {
  transform: translateY(-2px);
}

.drop-card:hover .hex-art__img {
  transform: scale(1.06) rotate(-3deg);
}

.drop-card__art {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.drop-card__art .hex-art__img {
  width: 86%;
}

.drop-card__price {
  max-width: 100%;
  color: var(--accent);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.drop-card__price .money {
  justify-content: center;
}

.drop-card__name {
  max-width: 100%;
  color: var(--text);
  font-size: var(--fs-xs);
  line-height: var(--lh-xs);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Крупный выигрыш — золотая кромка */
.drop-card--ann {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 75%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .drop-card,
  .hex-art__img {
    transition: none;
  }
}

/* ---------- Карточки предметов и лента открытия: та же шестигранная подложка (без правки разметки) ---------- */
.item-card {
  background:
    radial-gradient(90% 60% at 50% 28%, color-mix(in srgb, var(--rarity, var(--chrome-mid)) 26%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--rarity, var(--surface-3)) 18%, var(--surface-1)) 0%, color-mix(in srgb, var(--rarity, var(--surface-3)) 6%, var(--bg)) 100%);
}

.item-card__media,
.upgrade-item__media,
.upgrade-card__media,
.pick-card__media,
.result-item__media,
.outcome__media,
.reel__item {
  position: relative;
  isolation: isolate;
}

.item-card__media::before,
.item-card__media::after,
.upgrade-item__media::before,
.upgrade-item__media::after,
.upgrade-card__media::before,
.upgrade-card__media::after,
.pick-card__media::before,
.pick-card__media::after,
.result-item__media::before,
.result-item__media::after,
.outcome__media::before,
.outcome__media::after,
.reel__item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  height: 80%;
  aspect-ratio: 0.88;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transform: translate(-50%, -50%);
  background:
    radial-gradient(80% 60% at 50% 30%, color-mix(in srgb, var(--rarity, var(--chrome-mid)) 45%, var(--chrome-hi)) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--rarity, var(--chrome-mid)) 60%, var(--surface-2)), color-mix(in srgb, var(--rarity, var(--chrome-mid)) 28%, var(--bg)));
}

.item-card__media::after,
.upgrade-item__media::after,
.upgrade-card__media::after,
.pick-card__media::after,
.result-item__media::after,
.outcome__media::after {
  height: calc(80% - 6px);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity, var(--chrome-mid)) 30%, var(--surface-1)), color-mix(in srgb, var(--rarity, var(--chrome-mid)) 12%, var(--bg)));
}

.reel__item::before {
  top: 42%;
  height: 64%;
  opacity: 0.85;
}

.item-card__img,
.reel__img {
  filter: drop-shadow(0 6px 8px color-mix(in srgb, var(--bg) 70%, transparent));
}

/* Длинные суммы словами не должны раздвигать узкие карточки */
.case-card__prices {
  flex-wrap: wrap;
  row-gap: 0;
}

@media (max-width: 767px) {
  .account__summary {
    flex-direction: column;
  }

  /* Старая цена переносится под новую — место под неё есть у всех карточек, цены в ряду на одной линии */
  .case-card .case-card__prices {
    display: grid;
    grid-template-rows: auto var(--lh-xs);
    justify-items: center;
    row-gap: 0;
  }
}

/* Баланс в шапке — всегда в одну строку */
.wallet .money {
  flex-wrap: nowrap;
}

/* Крупный баланс на «Подарках» — размер задаёт .rw-wallet__value (токен --fs-banner) */

