@import "./fonts.css";

/* ═══════════════════════════════════════════════════════════════════════════
   HornyLink Web — оформление сайта.

   Токены --th-* и производные от них скопированы из base.css приложения
   (уровень 1 и 2 той же схемы), --hl-* — из ds.css (дизайн-система 2026:
   чёрный + красный, Manrope + Unbounded), поэтому сайт и лаунчер выглядят
   одинаково. Красный ТЕКСТ на тёмном — только --hl-red-text: насыщенный
   красный мелким шрифтом на чёрном не читается.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Уровень 1: исходные токены темы ─────────────────────────────────── */
  --th-bg:      #0b0b0d;
  --th-surface: #17171b;
  --th-accent:  #dc2235;
  --th-text:    #f4f4f5;
  --th-danger:  #f87171;
  --th-success: #4ade80;
  --th-warning: #fbbf24;

  --th-radius:  3px;
  --th-elevate: 0.07;

  /* ── Дизайн-система приложения (ds.css) ──────────────────────────────── */
  --hl-s1: #111114;
  --hl-s2: #17171b;
  --hl-s3: #1f1f24;
  --hl-s4: #26262c;
  --hl-red:      #dc2235;
  --hl-red-hi:   #ee2c40;
  --hl-red-lo:   #b3141f;
  --hl-red-text: #ff5c66;
  --hl-red-glow: 0 8px 28px -6px rgb(238 44 64 / 0.55);
  --hl-gold:     #e8b04b;
  --hl-font:    "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hl-display: "Unbounded", "Manrope", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-std: cubic-bezier(0.2, 0, 0, 1);

  /* ── Уровень 2: производные ──────────────────────────────────────────── */
  --bg-page:      var(--th-bg);
  --bg-container: color-mix(in srgb, var(--th-surface) 55%, var(--th-bg));
  --bg-card:      var(--th-surface);
  --bg-input:     color-mix(in srgb, var(--th-text) 4%, var(--th-surface));
  --bg-input-focus: color-mix(in srgb, var(--th-text) 8%, var(--th-surface));
  --bg-hover:     color-mix(in srgb, var(--th-text) 5%, var(--th-surface));

  --accent-primary:        var(--th-accent);
  --accent-primary-hover:  color-mix(in srgb, white 15%, var(--th-accent));
  --accent-primary-active: color-mix(in srgb, black 12%, var(--th-accent));
  --accent-blue:   var(--hl-red-text);
  --accent-green:  #ff8a91;
  --accent-purple: #a855f7;
  --accent-info:   var(--hl-red-text);

  --danger:  var(--th-danger);
  --warning: var(--th-warning);
  --success: var(--th-success);

  --text-primary:   var(--th-text);
  --text-secondary: color-mix(in srgb, var(--th-text) 61%, var(--th-surface));
  --text-dim:       color-mix(in srgb, var(--th-text) 29%, var(--th-surface));
  --text-muted:     color-mix(in srgb, var(--th-text) 23%, var(--th-surface));
  --text-link:      var(--accent-blue);

  --border-primary: rgba(255, 255, 255, calc(var(--th-elevate) * 1.667));
  --border-subtle:  rgba(255, 255, 255, var(--th-elevate));
  --border-accent:  color-mix(in srgb, var(--th-accent) 22%, transparent);
  --border-radius:        var(--th-radius);
  --border-radius-medium: calc(var(--th-radius) * 4);
  --border-radius-large:  calc(var(--th-radius) * 16 / 3);

  --accent-08: color-mix(in srgb, var(--th-accent)  8%, transparent);
  --accent-12: color-mix(in srgb, var(--th-accent) 12%, transparent);
  --accent-18: color-mix(in srgb, var(--th-accent) 18%, transparent);
  --accent-25: color-mix(in srgb, var(--th-accent) 25%, transparent);
  --accent-30: color-mix(in srgb, var(--th-accent) 30%, transparent);
  --accent-40: color-mix(in srgb, var(--th-accent) 40%, transparent);
  --accent-50: color-mix(in srgb, var(--th-accent) 50%, transparent);

  --success-20: color-mix(in srgb, var(--th-success) 20%, transparent);
  --success-30: color-mix(in srgb, var(--th-success) 30%, transparent);
  --danger-20:  color-mix(in srgb, var(--th-danger)  20%, transparent);
  --danger-30:  color-mix(in srgb, var(--th-danger)  30%, transparent);
  --danger-50:  color-mix(in srgb, var(--th-danger)  50%, transparent);
  --warning-20: color-mix(in srgb, var(--th-warning) 20%, transparent);
  --warning-35: color-mix(in srgb, var(--th-warning) 35%, transparent);

  --fx-white-04: rgba(255, 255, 255, 0.04);
  --fx-white-06: rgba(255, 255, 255, 0.06);
  --fx-white-08: rgba(255, 255, 255, 0.08);
  --fx-white-15: rgba(255, 255, 255, 0.15);
  --fx-black-40: rgba(0, 0, 0, 0.40);
  --fx-black-50: rgba(0, 0, 0, 0.50);
  --fx-black-60: rgba(0, 0, 0, 0.60);
  --fx-black-70: rgba(0, 0, 0, 0.70);

  --gradient-primary: linear-gradient(135deg, var(--hl-red) 0%, var(--hl-red-hi) 100%);
  --transition-fast: 0.15s ease;

  --header-height: 64px;
  --page-max: 1400px;

  font-family: var(--hl-font);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Фоновое свечение — единственная декорация, повторяет «обои» приложения. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 12% -8%,  var(--accent-12), transparent 62%),
    radial-gradient(760px 460px at 96% 4%,   var(--accent-08), transparent 60%);
}

/* clip, а не hidden: hidden сделал бы #app скролл-контейнером и сломал
   position: sticky у шапки и панели каталога. */
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--accent-green); }

img { max-width: 100%; }

::selection { background: var(--accent-40); color: #fff; }
:focus-visible { outline: 2px solid var(--hl-red-text); outline-offset: 2px; }
button, input, textarea, select { font-family: inherit; }

/* Скроллбар как в приложении */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--fx-white-08);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--fx-white-15); background-clip: padding-box; }

/* ═══ ШАПКА ══════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: color-mix(in srgb, var(--hl-s1) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--hl-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  flex-shrink: 0;
}
.brand:hover { color: var(--text-primary); }
.brand-mark {
  width: 30px; height: 30px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-name b { color: var(--hl-red); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--border-radius-medium);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-link:hover { background: var(--fx-white-04); color: var(--text-primary); }
.nav-link.active { color: #fff; }
/* Активный раздел — красная черта под названием, как в шапке приложения */
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -2px;
  transform: translateX(-50%);
  width: 18px; height: 3px;
  border-radius: 2px;
  background: var(--hl-red);
}

.header-spacer { flex: 1; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.burger {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  color: var(--text-secondary);
  cursor: pointer;
}
.burger svg { width: 17px; height: 17px; }

/* ═══ КНОПКИ ═════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast),
              transform var(--transition-fast), box-shadow var(--transition-fast);
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--hl-red);
  color: #fff;
  box-shadow: var(--hl-red-glow);
}
.btn-primary:hover { color: #fff; background: var(--hl-red-hi); }

.btn-secondary {
  background: var(--bg-input);
  border-color: var(--border-primary);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-input-focus); border-color: var(--border-accent); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-primary);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--fx-white-04); color: var(--text-primary); }

.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ═══ ОБЩИЙ КАРКАС СТРАНИЦ ═══════════════════════════════════════════════ */

.page { flex: 1; max-width: var(--page-max); width: 100%; margin: 0 auto; padding: 0 20px 64px; }
.page-wide { max-width: none; padding: 0; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 42px 0 16px;
}
.section-title h2 { margin: 0; font-family: var(--hl-display); font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
.section-title .sub { font-size: 12px; color: var(--text-dim); }

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

/* ═══ ГЛАВНАЯ: ГЕРОЙ ═════════════════════════════════════════════════════ */

.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 68px 20px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hl-red-text);
  letter-spacing: 0.2px;
  margin-bottom: 20px;
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hl-red-hi);
  box-shadow: 0 0 8px var(--hl-red-hi);
}

.hero h1 {
  margin: 0 0 16px;
  font-family: var(--hl-display);
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -1.2px;
}
.hero h1 .accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 540px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 30px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}
.hero-stat .value {
  font-family: var(--hl-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.6px;
  line-height: 1.1;
}
.hero-stat .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-top: 3px;
}

/* Коллаж обложек справа */
.hero-art {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hero-tile {
  aspect-ratio: 460 / 215;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 14px 40px var(--fx-black-60);
}

.hero-tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .5s ease; }
.hero-tile img.img-loaded { opacity: 1; }

/* ═══ ФИЧИ ═══════════════════════════════════════════════════════════════ */

.feature-grid {
  display: grid;
  /* Шесть возможностей ложатся в 3×2. При auto-fit пятая помещалась в ряд,
     а шестая оставалась одна — сетка выглядела оборванной. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1000px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .feature-grid { grid-template-columns: minmax(0, 1fr); } }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  padding: 20px;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.feature-card:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.feature-icon {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  display: grid; place-items: center;
  color: var(--hl-red-text);
  margin-bottom: 13px;
}
.feature-icon svg { width: 17px; height: 17px; }
.feature-card h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.feature-card p { margin: 0; font-size: 12.8px; line-height: 1.6; color: var(--text-secondary); }

/* ═══ КАТАЛОГ ════════════════════════════════════════════════════════════ */

.catalog-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  padding: 12px 0;
  margin-bottom: 18px;
}
/* Панель живёт в колонке контента, а её подложка должна идти во всю ширину
   окна — как у шапки. Растягиваем не сам элемент, а фон под ним: иначе
   пришлось бы двигать поля, и поиск разъезжался бы с карточками ниже.
   Горизонтальный скролл от вылета за края гасит overflow-x: clip у #app. */
.catalog-toolbar::before {
  content: '';
  position: absolute;
  inset: 0 -100vmax;
  z-index: -1;
  background: color-mix(in srgb, var(--th-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box { position: relative; flex: 1; min-width: 190px; }
.search-box svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-dim); pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.search-box input:focus { border-color: var(--accent-50); background: var(--bg-input-focus); }
.search-box input::placeholder { color: var(--text-muted); }

.select-wrap { position: relative; }
select.hl-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 30px 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}
select.hl-select:focus { border-color: var(--accent-50); }
select.hl-select option { background: var(--th-surface); color: var(--text-primary); }
.select-wrap::after {
  content: '';
  position: absolute; right: 12px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--text-dim);
  border-bottom: 1.6px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.tag-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag-chip {
  padding: 4px 11px;
  background: var(--fx-white-04);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.tag-chip:hover { background: var(--accent-12); border-color: var(--accent-30); color: var(--text-primary); }
.tag-chip.active { background: var(--accent-25); border-color: var(--accent-50); color: var(--hl-red-text); font-weight: 600; }

.results-line {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* Сетка карточек — размеры и пропорции повторяют каталог в приложении */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  align-content: start;
}

/* Реклама */
.ad-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  opacity: 0.65;
  margin-bottom: 8px;
  text-align: center;
}
.ad-slot { display: flex; flex-direction: column; align-items: center; }
.ad-slot-native {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 14px;
}
.ad-block { text-align: center; }
.ad-slot-banner { min-height: 250px; justify-content: center; }

.game-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -12px var(--fx-black-70), 0 0 0 1px var(--accent-40);
  border-color: var(--accent-40);
  color: inherit;
}

.game-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 460 / 215;
  overflow: hidden;
  background: var(--bg-input);
  flex-shrink: 0;
}
.game-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.game-cover.img-loaded { opacity: 1; }
.game-card:hover .game-cover { transform: scale(1.04); }

.game-cover-noart {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.game-cover-overlay {
  position: absolute; inset: 0;
  background: var(--fx-black-50);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.game-card:hover .game-cover-overlay { opacity: 1; }
.overlay-view {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.7);
  padding: 6px 16px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}

.game-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.game-card-title {
  font-size: 14px; font-weight: 800; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.game-card-author {
  font-size: 11px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.game-card-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.game-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  background: var(--hl-s3);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  white-space: nowrap;
}
.game-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px; width: 100%;
}
.game-card-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.game-card-engine, .game-card-languages {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--fx-white-04);
  border: 1px solid var(--fx-white-06);
  border-radius: 6px;
  font-weight: 700;
  padding: 2px 6px;
}
.game-card-rating { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim); }
.rating-positive { color: var(--success); }
.rating-negative { color: var(--danger); }

/* Скелетоны загрузки */
.game-card-skeleton { pointer-events: none; }
.skeleton-shimmer {
  background: linear-gradient(90deg, var(--fx-white-04) 25%, var(--fx-white-08) 37%, var(--fx-white-04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-line { height: 12px; border-radius: 4px; }

/* Пагинация */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.page-btn {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.page-btn:hover:not(:disabled) { background: var(--bg-input-focus); color: var(--text-primary); border-color: var(--border-accent); }
.page-btn.active { background: var(--hl-red); border-color: transparent; color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.page-dots { color: var(--text-muted); padding: 0 2px; }

/* ═══ СТРАНИЦА ИГРЫ ══════════════════════════════════════════════════════ */

.game-hero {
  position: relative;
  margin: 0 0 26px;
  overflow: hidden;
}
.game-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(38px) saturate(1.15);
  opacity: 0.30;
  transform: scale(1.15);
}
.game-hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--th-bg) 45%, transparent), var(--bg-page) 92%);
}
.game-hero-inner {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 4px;
}

.breadcrumbs { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--hl-red-text); }

/* Страница игры идёт одним потоком: название → фото → описание →
   характеристики → теги → комментарии. Колонка уже основной, потому что
   строка длиной во весь экран читается заметно хуже. */
.page-game { max-width: 1000px; }

.game-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.game-title { margin: 0; font-family: var(--hl-display); font-size: clamp(20px, 3vw, 30px); font-weight: 600; letter-spacing: -0.8px; line-height: 1.2; }
.game-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.game-subtitle b { color: var(--text-primary); font-weight: 600; }

/* Галерея */
.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--fx-black-60);
  border: 1px solid var(--fx-white-15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}
.gallery-main:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: var(--fx-black-70); }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav svg { width: 16px; height: 16px; }
.gallery-counter {
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 9px;
  background: var(--fx-black-70);
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
}

.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gallery-thumb {
  flex: 0 0 auto;
  width: 108px;
  aspect-ratio: 16 / 9;
  border-radius: var(--border-radius-medium);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-input);
  cursor: pointer;
  padding: 0;
  transition: border-color var(--transition-fast), opacity var(--transition-fast);
  opacity: 0.6;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--accent-primary); opacity: 1; }

/* Блоки контента */
.content-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  padding: 20px;
  margin-top: 18px;
}
.content-block h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}
.game-description {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.game-description.clamped { max-height: 260px; overflow: hidden; mask-image: linear-gradient(180deg, #000 62%, transparent); }
.desc-toggle {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--hl-red-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a {
  font-size: 11.5px;
  padding: 3px 10px;
  background: var(--accent-12);
  color: var(--hl-red-text);
  border: 1px solid var(--accent-25);
  border-radius: 999px;
  transition: all var(--transition-fast);
}
.tag-list a:hover { background: var(--accent-30); border-color: var(--accent-50); color: var(--hl-red-text); }

/* Правая колонка */
.play-card {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--border-radius-large);
  padding: 18px;
  margin-top: 18px;
  box-shadow: 0 10px 34px var(--fx-black-50);
}
/* Кнопки объявлены inline-flex, а на инлайновом боксе margin: 0 auto не
   центрирует — здесь нужен блочный flex, иначе кнопка липнет к левому краю. */
.play-card .btn { display: flex; max-width: 420px; margin: 0 auto; }
.play-card .hint { font-size: 11.5px; color: var(--text-dim); text-align: center; margin-top: 10px; line-height: 1.5; }

.meta-table { display: flex; flex-direction: column; gap: 1px; }
.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.8px;
}
.meta-row:last-child { border-bottom: none; }
.meta-table-wide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0 28px;
}
.meta-row .k { color: var(--text-dim); flex-shrink: 0; }
.meta-row .v { color: var(--text-primary); text-align: right; font-weight: 500; word-break: break-word; }

.rating-bar { height: 5px; border-radius: 3px; background: var(--danger); overflow: hidden; margin-top: 8px; }
.rating-bar span { display: block; height: 100%; background: var(--success); }

.variant-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-switch a {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--border-radius-medium);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
}
.variant-switch a:hover { border-color: var(--border-accent); color: var(--text-primary); }
.variant-switch a.current { background: var(--accent-25); border-color: var(--accent-50); color: var(--hl-red-text); }

/* ═══ СТРАНИЦА СКАЧИВАНИЯ ════════════════════════════════════════════════ */

.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.download-card.primary { border-color: var(--border-accent); box-shadow: 0 10px 34px var(--fx-black-50); }
.download-os { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.download-os svg { width: 20px; height: 20px; color: var(--hl-red-text); }
.download-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.download-card .btn { margin-top: auto; }
.download-alt { font-size: 12px; margin-top: 10px; text-align: center; }

.steps { counter-reset: step; display: grid; gap: 14px; margin-top: 20px; }
.step {
  display: flex; gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  padding: 16px 18px;
}
.step-num {
  counter-increment: step;
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  color: var(--hl-red-text);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.step-num::before { content: counter(step); }
.step h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.step p { margin: 0; font-size: 12.8px; color: var(--text-secondary); line-height: 1.6; }

/* ═══ МОДАЛКА «ОТКРЫТЬ В ПРИЛОЖЕНИИ» ════════════════════════════════════ */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 0.16s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

.modal {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-large);
  box-shadow: 0 26px 70px var(--fx-black-70);
  padding: 24px;
  animation: pop-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--accent-12);
  border: 1px solid var(--accent-25);
  display: grid; place-items: center;
  color: var(--hl-red-text);
  margin: 0 auto 14px;
}
.modal-icon svg { width: 22px; height: 22px; }
.modal-icon.spin svg { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; text-align: center; }
.modal p { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); text-align: center; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-close {
  background: none; border: none;
  color: var(--text-dim);
  font-size: 12.5px; font-family: inherit;
  cursor: pointer;
  padding: 6px;
}
.modal-close:hover { color: var(--text-primary); }

/* Лайтбокс скриншотов */
.lightbox {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.16s ease;
}
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--fx-black-60);
  border: 1px solid var(--fx-white-15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}
.lightbox-close { top: 18px; right: 18px; }
.lightbox-nav.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox svg { width: 18px; height: 18px; }

/* ═══ ПОДВАЛ ═════════════════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 30px 20px;
  background: color-mix(in srgb, var(--th-bg) 60%, #000);
}
.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-dim);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); }

/* Состояния */
.empty-state, .error-state { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty-state h3, .error-state h3 { color: var(--text-primary); font-size: 17px; margin: 0 0 8px; }
.empty-state p, .error-state p { margin: 0 0 18px; font-size: 13px; }

.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--fx-white-08);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}

/* Возрастная заглушка */
.age-gate {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.age-gate .modal { max-width: 400px; }
.age-gate .modal h3 { font-size: 20px; }

/* ═══ АДАПТИВ ════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding-top: 44px;
  }
  .hero-art { max-width: 520px; }
}

@media (max-width: 780px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: color-mix(in srgb, var(--th-bg) 97%, transparent);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: 0 16px 40px var(--fx-black-60);
  }
  .main-nav.open { display: flex; }
  .nav-link { padding: 11px 14px; font-size: 14px; }
  .burger { display: flex; }
  .header-actions .btn span { display: none; }
  .header-actions .btn { padding: 9px 11px; }

  .page { padding: 0 14px 48px; }
  .hero { padding: 32px 14px 30px; }
  .hero-stats { gap: 22px; }
  .hero-stat .value { font-size: 21px; }

  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .game-card-body { padding: 8px 9px 10px; }
  .game-card-title { font-size: 12px; }

  .catalog-toolbar { padding: 10px 0; }
  .tag-filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    margin: 0 -14px 14px;
    padding-left: 14px;
    padding-right: 14px;
    scrollbar-width: none;
  }
  .tag-filter-bar::-webkit-scrollbar { display: none; }
  .tag-chip { flex: 0 0 auto; }
  .toolbar-inner { gap: 8px; }
  .search-box { min-width: 100%; order: -1; }

  .game-hero { margin: 0 0 20px; }
  .game-hero-inner { padding: 20px 14px 4px; }
  .content-block { padding: 16px; }
  .gallery-thumb { width: 88px; }
  .gallery-nav { opacity: 1; width: 32px; height: 32px; }

  .section-title { margin: 30px 0 12px; }
  .section-title h2 { font-size: 17px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 420px) {
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-card-footer { padding-top: 6px; }
  .game-card-languages { display: none; }
  .hero h1 { letter-spacing: -0.9px; }
  .btn-lg { padding: 11px 18px; }
}

/* Пользователи с prefers-reduced-motion не должны ловить параллакс и всплытия */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .game-card:hover { transform: none; }
}


/* ═══ КОММЕНТАРИИ ════════════════════════════════════════════════════════ */

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.comments-head h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.comment:last-child { border-bottom: none; }

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.comment-date { font-size: 11.5px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.comment-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  /* Обёртка аватара 48px + зазор 8px — текст встаёт ровно под ником */
  padding-left: 56px;
}
.comment-body a { word-break: break-all; }

.comment-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  padding-left: 56px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.comment-score { display: inline-flex; align-items: center; gap: 5px; }
.comment-score svg { width: 13px; height: 13px; }
.comment-score.is-positive { color: var(--success); }
.comment-score.is-negative { color: var(--danger); }

.comment-removed .comment-body { padding-left: 0; font-style: italic; color: var(--text-muted); }

/* Ветка ответов. Линия слева показывает вложенность лучше голого отступа. */
.comment-children {
  margin-left: 22px;
  padding-left: 16px;
  border-left: 2px solid var(--border-subtle);
}
.comment-children .comment-body,
.comment-children .comment-foot { padding-left: 56px; }

.comments-empty { padding: 26px 0; text-align: center; color: var(--text-dim); font-size: 13px; }

.comments-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  background: var(--accent-08);
  border: 1px solid var(--accent-25);
  border-radius: var(--border-radius-medium);
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
}
.comments-cta svg { width: 15px; height: 15px; color: var(--hl-red-text); flex-shrink: 0; }

/* ═══ ПРОФИЛЬ ════════════════════════════════════════════════════════════ */

.profile-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}
.profile-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.28;
}
.profile-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--th-bg) 55%, transparent), var(--bg-page) 96%),
    linear-gradient(90deg, var(--bg-page), color-mix(in srgb, var(--th-bg) 20%, transparent) 60%);
}
.profile-hero-inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px 20px 26px;
}

.profile-identity { margin-bottom: 14px; }
.profile-identity .ub-name { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }

.profile-about { max-width: 640px; margin-bottom: 14px; }
.profile-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  word-break: break-word;
}
.profile-bio {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
/* Свёрнутое био: ровно столько строк, чтобы шапка не выдавливала статистику. */
.profile-bio.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.profile-facts {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}
.profile-facts span { display: inline-flex; align-items: center; gap: 6px; }
.profile-facts svg { width: 13px; height: 13px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  padding: 16px 18px;
}
.stat-value { font-size: 21px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.stat-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 4px; }

.profile-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.profile-cols .content-block:first-child { margin-top: 0; }

.lib-list { display: flex; flex-direction: column; gap: 2px; }
.lib-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--border-radius-medium);
  color: inherit;
  transition: background var(--transition-fast);
}
.lib-item:hover { background: var(--bg-hover); color: inherit; }
.lib-item-cover {
  width: 68px;
  aspect-ratio: 460 / 215;
  flex-shrink: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--bg-input);
}
.lib-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item-info { min-width: 0; flex: 1; }
.lib-item-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-item-meta {
  font-size: 11px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-item-time { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }

.activity-list { display: flex; flex-direction: column; gap: 1px; }
.activity-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { color: var(--hl-red-text); }
.activity-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-date { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }

.tag-count {
  margin-left: 6px;
  opacity: 0.6;
  font-size: 10.5px;
}

@media (max-width: 900px) {
  .profile-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 780px) {
  .profile-hero-inner { padding: 20px 14px 18px; }

  /* Аватар xl рассчитан на десктоп: 140px картинки плюс по 30px вылета рамки
     съедали больше половины ширины телефона, и ник ломался на три строки. */
  .profile-identity .ub-xl .ub-avatar-wrap { width: 115px; height: 115px; }
  .profile-identity .ub-xl .ub-avatar { width: 92px; height: 92px; border-width: 3px; }
  .profile-identity .ub-xl .ub-frame { width: 115px; height: 115px; }
  .profile-identity .ub-xl .ub-level { width: 24px; height: 24px; bottom: -4px; left: -4px; }
  .profile-identity .ub-name { font-size: 20px; }
  .profile-identity .ub-xl .ub-title { font-size: 12px; }
  .profile-identity .ub { gap: 12px; }
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
  .stat-tile { padding: 12px 14px; }
  .stat-value { font-size: 18px; }

  /* На узком экране отступ под аватар съедал шестую часть строки —
     текст уходит на всю ширину, под шапку комментария. */
  .comment-body, .comment-foot,
  .comment-children .comment-body,
  .comment-children .comment-foot { padding-left: 0; }
  .comment-children { margin-left: 8px; padding-left: 10px; }
  .comment-date { margin-left: auto; }
}


/* ═══ РАМКИ АВАТАРОВ ═════════════════════════════════════════════════════
   Базовые пресеты user-badge.css рассчитаны на «вылет» рамки далеко за
   аватар, из-за чего между картинкой и рамкой оставался заметный зазор.
   Здесь повторены пропорции, с которыми рамки нарисованы и с которыми их
   показывает само приложение: комментарии — как .comment-header в game.css
   (аватар 36 / рамка 48), профиль — как .profile-avatar-frame (140 / 175).
   ══════════════════════════════════════════════════════════════════════ */

.comment .ub-md .ub-avatar-wrap { width: 48px; height: 48px; }
.comment .ub-md .ub-avatar {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--fx-white-06);
}
.comment .ub-md .ub-frame { width: 48px; height: 48px; }

.comment .ub-sm .ub-avatar-wrap { width: 40px; height: 40px; }
.comment .ub-sm .ub-avatar { width: 30px; height: 30px; }
.comment .ub-sm .ub-frame { width: 40px; height: 40px; }

.profile-identity .ub-xl .ub-avatar-wrap { width: 175px; height: 175px; }
.profile-identity .ub-xl .ub-frame { width: 175px; height: 175px; }


/* ═══ ГАЛЕРЕЯ СКРИНШОТОВ ПРИЛОЖЕНИЯ ═════════════════════════════════════ */

.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.shots-view {
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  background: var(--bg-input);
  box-shadow: 0 16px 44px var(--fx-black-60);
  aspect-ratio: 1455 / 951;
}
.shots-view img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shots-side { display: flex; flex-direction: column; gap: 6px; }

.shot-tab {
  text-align: left;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-medium);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.shot-tab:hover { background: var(--bg-hover); border-color: var(--border-accent); }
.shot-tab.active { background: var(--accent-12); border-color: var(--accent-50); }
.shot-tab-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.shot-tab.active .shot-tab-title { color: var(--hl-red-text); }
.shot-tab-text { display: block; font-size: 11.8px; line-height: 1.5; color: var(--text-dim); margin-top: 3px; }

@media (max-width: 900px) {
  .shots { grid-template-columns: minmax(0, 1fr); }
  /* Список превращается в ленту: шесть карточек описаний заняли бы весь экран. */
  .shots-side {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .shots-side::-webkit-scrollbar { display: none; }
  .shot-tab { flex: 0 0 auto; padding: 8px 14px; }
  .shot-tab-text { display: none; }
}


/* ═══ ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА ════════════════════════════════════════════════ */

.lang-switch {
  display: flex;
  padding: 2px;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
}
.lang-btn {
  padding: 5px 9px;
  background: none;
  border: none;
  border-radius: calc(var(--border-radius-medium) - 2px);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.lang-btn:hover { color: var(--text-primary); }
.lang-btn.active { background: var(--accent-25); color: var(--hl-red-text); }

@media (max-width: 780px) {
  .lang-btn { padding: 5px 7px; font-size: 11px; }
}

/* Юридические страницы (/terms, /privacy) */
.legal { max-width: 820px; padding-top: 32px; }
.legal h1 { font-family: var(--font-display, inherit); font-size: 28px; margin: 0 0 6px; }
.legal h2 { font-size: 18px; margin: 28px 0 10px; }
.legal p { line-height: 1.65; margin: 0 0 10px; color: var(--text-secondary); }
.legal .legal-meta { color: var(--text-dim); font-size: 13px; }
.legal .legal-num { color: var(--text-primary); font-weight: 600; }
.legal ul { margin: 0 0 12px; padding-left: 22px; color: var(--text-secondary); line-height: 1.65; }
.legal a { color: var(--accent-primary); }
.legal .legal-contact { margin-top: 28px; color: var(--text-primary); }

/* Документы: заметная полоса на главной и отдельная строка в футере */
.docs-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px;
  margin: 28px 0 8px; padding: 14px 18px;
  border: 1px solid var(--border-primary); border-radius: 14px;
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
}
.docs-strip-title { font-weight: 700; color: var(--text-primary); margin-right: 6px; }
.docs-strip-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14px;
  color: var(--text-primary); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
}
.docs-strip-link:hover { background: color-mix(in srgb, var(--accent-primary) 22%, transparent); }
.footer-docs { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; order: 5; }
.footer-docs a {
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px;
  color: var(--text-primary); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 55%, transparent);
}
.footer-docs a:hover { background: color-mix(in srgb, var(--accent-primary) 22%, transparent); }

/* Плашка согласия с условиями (внизу, при первом заходе) */
.consent-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 150;
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-page) 92%, #000);
  border: 1px solid var(--border-primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
  font-size: 14px; line-height: 1.5; color: var(--text-secondary);
}
.consent-text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 2px; }
.consent-text b { color: var(--text-primary); }
.consent-text a { color: var(--accent-primary); text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }
@media (max-width: 560px) { .consent-actions { width: 100%; } .consent-actions .btn { flex: 1; } }

/* ═══ АККАУНТ В ШАПКЕ ════════════════════════════════════════════════════
   Как в приложении: аватар с рамкой и эффектом (UserBadge), ник, баланс.
   Меню — профиль, магазин, выход. */

.account-slot { position: relative; display: flex; align-items: center; }
.acc-login { padding: 9px 16px; }
.acc-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 12px 3px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  max-width: 260px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.acc-chip:hover { background: var(--bg-input-focus); border-color: var(--border-accent); }
.acc-chip .ub { min-width: 0; }
.acc-chip .ub-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.acc-chip.is-loading { width: 120px; height: 38px; cursor: default; }
.acc-skel { width: 30px; height: 30px; border-radius: 8px; background: var(--fx-white-06); }
.acc-bal { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }

.hl-diamond {
  display: inline-block; flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--hl-red-text), var(--hl-red));
  box-shadow: 0 0 8px rgb(255 92 102 / 0.6);
}

.acc-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 190px;
  display: flex; flex-direction: column;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  box-shadow: 0 16px 40px var(--fx-black-60);
}
.acc-menu[hidden] { display: none; }
.acc-menu a, .acc-menu button {
  padding: 9px 12px;
  border: 0; border-radius: 8px;
  background: none;
  color: var(--text-secondary);
  font: inherit; font-size: 13.5px; text-align: left;
  cursor: pointer; text-decoration: none;
}
.acc-menu a:hover, .acc-menu button:hover { background: var(--fx-white-06); color: var(--text-primary); }
.acc-menu button { color: var(--hl-red-text); }

/* Окно входа */
.login-modal { display: flex; flex-direction: column; gap: 12px; }
.login-modal p { margin: 0; }
.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.login-field input {
  padding: 11px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-medium);
  color: var(--text-primary);
  font: inherit; font-size: 14px;
  outline: none;
}
.login-field input:focus { border-color: var(--accent-50); background: var(--bg-input-focus); }
.login-error { font-size: 13px; color: var(--hl-red-text); text-align: center; }
.login-error[hidden] { display: none; }
.login-note { font-size: 12.5px !important; }

@media (max-width: 900px) {
  .acc-chip .ub-info { display: none; }
  .acc-chip { padding-right: 10px; }
}
@media (max-width: 560px) {
  .header-dl { display: none; }
  .acc-bal { display: none; }
  .acc-chip { padding: 3px; }
}

/* ═══ МАГАЗИН (только просмотр) ══════════════════════════════════════════ */

.hl-r-common    { --rar: #9aa0aa; }
.hl-r-uncommon  { --rar: #4ade80; }
.hl-r-rare      { --rar: #4f8dff; }
.hl-r-epic      { --rar: #b366ff; }
.hl-r-legendary { --rar: var(--hl-gold); }

.sh-gate { max-width: 460px; margin: 0 auto; }
.sh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 34px 0 18px; }
.sh-h1 { margin: 0 0 6px; font-family: var(--hl-display); font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.sh-note { margin: 0; font-size: 13px; color: var(--text-dim); }
.sh-note a { color: var(--hl-red-text); }
.sh-balance { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--text-dim); }
.sh-balance b { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.sh-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-primary); margin-bottom: 18px; overflow-x: auto; }
.sh-tab {
  padding: 10px 16px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.sh-tab:hover { color: var(--text-primary); }
.sh-tab.active { color: var(--text-primary); border-bottom-color: var(--hl-red); }

.sh-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sh-search { flex: 1; min-width: 200px; }
.sh-empty { text-align: center; color: var(--text-dim); padding: 50px 10px; grid-column: 1 / -1; }

.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.sh-grid > .spinner { grid-column: 1 / -1; }
.sh-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-large);
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.sh-card:hover { border-color: color-mix(in srgb, var(--rar) 45%, transparent); transform: translateY(-2px); }
.sh-card-media {
  position: relative;
  aspect-ratio: 1 / 0.8;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rar) 16%, transparent), transparent 70%), var(--hl-s1);
  display: grid; place-items: center;
}
.sh-card-media { overflow: hidden; }
.sh-card-prev { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.sh-prev-img { max-width: 72%; max-height: 72%; object-fit: contain; }
.sh-prev-ico { font-size: 12px; color: var(--text-dim); }
.sh-ub { display: grid; place-items: center; }
.sh-ub--name .ub-name { font-size: 18px; font-weight: 800; }
.sh-title-prev span {
  display: inline-block; padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--rar) 50%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rar) 12%, transparent);
  color: var(--text-primary); font-weight: 700; font-size: 13px;
}
.sh-bg-prev { width: 86%; height: 76%; border-radius: 10px; background-size: cover; background-position: center; box-shadow: 0 6px 20px var(--fx-black-50); }

.sh-rank { position: absolute; left: 10px; top: 10px; display: flex; gap: 3px; }
.sh-rank i { width: 6px; height: 6px; border-radius: 2px; transform: rotate(45deg); background: var(--fx-white-08); }
.sh-rank i.on { background: var(--rar); box-shadow: 0 0 6px color-mix(in srgb, var(--rar) 70%, transparent); }
.sh-badges { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sh-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.2px;
  background: var(--fx-white-08); color: var(--text-primary);
}
.sh-badge--sale { background: var(--hl-red); color: #fff; }
.sh-badge--vip { background: rgb(232 176 75 / 0.18); color: var(--hl-gold); }
.sh-badge--premium { background: rgb(179 102 255 / 0.18); color: #c99bff; }
.sh-badge--platinum { background: rgb(160 200 255 / 0.16); color: #b9d4ff; }
.sh-state {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: 3px 10px; border-radius: 999px;
  background: var(--fx-black-70); color: var(--text-secondary); font-size: 11px; font-weight: 700;
}

.sh-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.sh-card-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-card-meta { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sh-rar { color: var(--rar); font-weight: 700; }
.sh-card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.sh-price { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.sh-price s { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.sh-price--sale { color: var(--hl-red-text); }
.sh-price--free { color: var(--success); font-size: 13.5px; }
.sh-left, .sh-save { font-size: 11.5px; color: var(--text-dim); }
.sh-save { color: var(--success); font-weight: 700; }
.sh-desc { margin: 4px 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Наборы */
.sh-bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.sh-bundle { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--border-radius-large); overflow: hidden; }
.sh-bundle.is-weekly { border-color: var(--accent-50); box-shadow: var(--hl-red-glow); }
.sh-bundle-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--hl-s1); }
.sh-bundle-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sh-bundle-body h3 { margin: 0; font-size: 16px; }
.sh-bundle-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.sh-mini {
  position: relative; width: 44px; height: 44px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--rar) 50%, transparent);
  background: var(--hl-s1); display: grid; place-items: center; overflow: hidden;
}
.sh-mini img { max-width: 80%; max-height: 80%; object-fit: contain; }
.sh-mini span { width: 60%; height: 60%; border-radius: 50%; }
.sh-mini-own { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 11px; color: var(--success); }

/* Подписки */
.sh-subs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sh-sub {
  position: relative;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius-large);
}
.sh-sub--vip { --tier: var(--hl-gold); }
.sh-sub--premium { --tier: #b366ff; }
.sh-sub--platinum { --tier: #a9c8ff; }
.sh-sub { border-top: 3px solid var(--tier, var(--border-primary)); }
.sh-sub.is-active { box-shadow: 0 0 0 1px var(--tier) inset; }
.sh-sub h3 { margin: 0 0 8px; font-family: var(--hl-display); font-size: 20px; color: var(--tier); }
.sh-sub-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.sh-sub-price .sh-price { font-size: 22px; }
.sh-sub-price > span:last-child { font-size: 12.5px; color: var(--text-dim); }
.sh-sub-sale { position: absolute; right: 14px; top: 14px; }
.sh-sub-active { margin: 0 0 8px; font-size: 12.5px; color: var(--success); font-weight: 700; }
.sh-sub ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* Лутбоксы */
.sh-boxes { display: flex; flex-direction: column; gap: 10px; }
.sh-box { background: var(--bg-card); border: 1px solid var(--border-primary); border-radius: var(--border-radius-large); overflow: hidden; }
.sh-box summary { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; list-style: none; }
.sh-box summary::-webkit-details-marker { display: none; }
.sh-box-img { width: 72px; height: 72px; flex: none; border-radius: 12px; background: var(--hl-s1); display: grid; place-items: center; overflow: hidden; }
.sh-box-img img { max-width: 86%; max-height: 86%; object-fit: contain; }
.sh-box-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sh-box-info h3 { margin: 0; font-size: 15px; }
.sh-box-more { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.sh-box[open] .sh-box-more { color: var(--hl-red-text); }
.sh-box-list { border-top: 1px solid var(--border-primary); padding: 6px 14px 10px; }
.sh-box-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border-subtle); }
.sh-box-row:last-child { border-bottom: 0; }
.sh-box-row b { font-variant-numeric: tabular-nums; }
.sh-box-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 560px) {
  .sh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sh-bundles { grid-template-columns: 1fr; }
  .sh-box-row { grid-template-columns: 1fr auto; }
  .sh-box-row .sh-rar { display: none; }
  .sh-head { margin-top: 22px; }
  .sh-balance { align-items: flex-start; }
}
.sh-balance--guest { gap: 6px; }
.sh-balance--guest span { font-size: 11.5px; }
