/* ==========================================================================
   Страница «Бренды в Roblox»: рейтинг брендированных игр
   Подключается после style.css
   ========================================================================== */

.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;
}

/* ---------- Вступление ---------- */
.bi-hero .bi-hero__inner { grid-template-columns: 1fr; }
.bi-hero .hero__title { font-size: clamp(30px, 4.2vw, 58px); max-width: 1000px; }
.bi-hero .hero__lead { max-width: 760px; }

.bi-kpis {
  position: relative; margin-top: clamp(40px, 6vw, 64px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.bi-kpi {
  display: flex; flex-direction: column; gap: 8px; padding: 24px;
  border-radius: var(--radius-lg); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-light);
}
.bi-kpi strong {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 3vw, 42px);
  line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-height: 1em;
}
.bi-kpi strong small { font-size: .5em; letter-spacing: 0; margin-left: 4px; color: var(--accent-light); }
.bi-kpi span { font-size: 15px; line-height: 1.4; color: rgba(255, 255, 255, .66); }

/* ---------- Заголовок рейтинга ---------- */
.bi { padding-top: clamp(56px, 7vw, 88px); }
.bi-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 28px; }
.bi-head .eyebrow { margin-bottom: 14px; }
.bi-updated {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px;
  border-radius: 999px; background: var(--white); border: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.bi-updated__dot { width: 8px; height: 8px; border-radius: 50%; background: #c2c8d6; flex: none; }
.bi-updated.is-live .bi-updated__dot { background: #17b26a; box-shadow: 0 0 0 0 rgba(23, 178, 106, .6); animation: biPulse 2.4s infinite; }
.bi-updated.is-cached .bi-updated__dot { background: #f2a33a; }
@keyframes biPulse { 70% { box-shadow: 0 0 0 8px rgba(23, 178, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 178, 106, 0); } }

/* ---------- Поиск и фильтры ---------- */
.bi-tools {
  padding: clamp(16px, 2.4vw, 24px); border-radius: var(--radius-lg);
  background: var(--white); border: 1px solid var(--line);
  display: grid; gap: 16px;
}
.bi-search {
  position: relative; display: flex; align-items: center;
  height: 58px; border-radius: 16px; background: var(--paper); border: 1.5px solid transparent;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.bi-search:focus-within { background: var(--white); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.bi-search svg { position: absolute; left: 18px; width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.bi-search input {
  flex: 1; min-width: 0; height: 100%; padding: 0 52px 0 52px;
  border: 0; background: none; outline: none; font: 500 17px/1 var(--font-body); color: var(--text);
}
.bi-search input::placeholder { color: var(--muted-light); }
.bi-search input::-webkit-search-cancel-button { cursor: pointer; }
.bi-search__kbd {
  position: absolute; right: 16px; min-width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid var(--line); background: var(--white);
  font: 600 13px/1 var(--font-body); color: var(--muted);
}
.bi-search:focus-within .bi-search__kbd { display: none; }

.bi-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bi-field { display: grid; gap: 6px; min-width: 0; }
.bi-field > span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: 4px; }
.bi-field select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 46px; padding: 0 40px 0 14px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23566079' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px;
  font: 500 15px/1.2 var(--font-body); color: var(--text); cursor: pointer;
  text-overflow: ellipsis; transition: border-color .2s, box-shadow .2s;
}
.bi-field select:hover { border-color: rgba(18, 18, 22, .25); }
.bi-field select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.bi-field select.is-set { border-color: var(--accent); background-color: var(--accent-soft); }

.bi-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.bi-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--white);
  font: 600 14px/1 var(--font-body); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s var(--ease-out);
}
.bi-chip:hover { border-color: rgba(18, 18, 22, .3); }
.bi-chip i { font-style: normal; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.bi-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.bi-chip[aria-pressed="true"] i { color: rgba(255, 255, 255, .6); }
.bi-chip[disabled] { opacity: .4; cursor: default; }
.bi-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }

/* ---------- Итог выборки ---------- */
.bi-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  margin: 22px 4px 18px; font-size: 15px; color: var(--muted);
}
.bi-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.bi-summary__reset {
  border: 0; background: none; padding: 0; font: 600 15px/1 var(--font-body); color: var(--accent);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}

/* ---------- Лидеры выборки ---------- */
.bi-leaders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bi-leaders:empty { display: none; }
.bi-leader {
  display: grid; align-content: start; gap: 6px; width: 100%; height: 100%;
  padding: 18px 20px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  transition: border-color .2s, transform .3s var(--ease-out), box-shadow .3s;
}
.bi-leader:hover { border-color: rgba(59, 107, 255, .45); transform: translateY(-2px); box-shadow: 0 16px 32px -24px rgba(15, 20, 36, .45); }
.bi-leader__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bi-leader__val {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.bi-leader__val small { font-family: var(--font-body); font-size: 13.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.bi-leader__who { display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.bi-leader__who .bi-icon { width: 40px; height: 40px; border-radius: 10px; }
.bi-leader__text { display: grid; gap: 1px; min-width: 0; }
.bi-leader__text b, .bi-leader__text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-leader__text b { font-weight: 600; }
.bi-leader__text span { font-size: 13.5px; color: var(--muted); }

/* На этой странице нет переключателя языка — бургер сам прижимается вправо */
.header__inner > .burger { margin-left: auto; }

/* ---------- Таблица ---------- */
.bi-table-wrap { border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); }
.bi-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.bi-table th.c-rank { width: 54px; }
.bi-table th.c-brand { width: 160px; }
.bi-table th.c-country { width: 128px; }
.bi-table th.c-visits { width: 118px; }
.bi-table th.c-online { width: 92px; }
.bi-table th.c-rating { width: 162px; }
.bi-table th.c-fav { width: 100px; }
.bi-table th.c-created { width: 92px; }
.bi-table th.c-more { width: 58px; }
.bi-table th {
  position: sticky; top: var(--header-h); z-index: 3;
  padding: 0 10px; height: 52px; background: var(--white); border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap;
}
.bi-table th:first-child { border-top-left-radius: var(--radius-lg); padding-left: 20px; }
.bi-table th:last-child { border-top-right-radius: var(--radius-lg); padding-right: 16px; }
.bi-table th button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer; white-space: nowrap;
}
.bi-table th button::after {
  content: ""; width: 8px; height: 8px; opacity: .35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 3 4 0l3 3M1 5l3 3 3-3' fill='none' stroke='%23566079' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat center / contain;
}
.bi-table th[aria-sort] { color: var(--text); }
.bi-table th[aria-sort] button::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath d='M1 2.5 4 5.5l3-3' fill='none' stroke='%233b6bff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}
.bi-table th button:hover { color: var(--text); }
.bi-table th.c-num, .bi-table td.c-num { text-align: right; }
.bi-table th.c-num button { flex-direction: row-reverse; }

.bi-row td {
  padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle;
  font-variant-numeric: tabular-nums; transition: background-color .2s;
}
.bi-row td:first-child { padding-left: 20px; }
.bi-row td:last-child { padding-right: 16px; }
.bi-row { cursor: pointer; }
.bi-row:hover td { background: #f8f9fc; }
.bi-row.is-open td { background: var(--accent-soft); border-bottom-color: transparent; }
.bi-row:last-child td { border-bottom: 0; }

.c-rank { color: var(--muted); font-weight: 600; }
.bi-row .c-rank { font-size: 14px; }
.bi-mrank { display: none; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; margin-right: 6px; border-radius: 6px; background: var(--paper); font-size: 12px; font-weight: 700; color: var(--muted); vertical-align: 1px; }

.bi-game { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bi-icon {
  flex: none; width: 44px; height: 44px; border-radius: 11px; overflow: hidden;
  background: linear-gradient(135deg, #e4e9f6, #d3dbef); display: grid; place-items: center;
  font: 700 15px/1 var(--font-display); color: #6b7695; box-shadow: inset 0 0 0 1px rgba(15, 20, 36, .06);
}
.bi-icon img { width: 100%; height: 100%; object-fit: cover; }
.bi-game__text { display: grid; gap: 2px; min-width: 0; }
.bi-game__name {
  display: inline-flex; align-items: center; gap: 6px; max-width: 340px;
  font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.3;
}
.bi-game__name > span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.bi-game__name svg { flex: none; width: 13px; height: 13px; color: var(--muted-light); transition: color .2s, transform .25s var(--ease-out); }
.bi-game__name:hover { color: var(--accent); }
.bi-game__name:hover svg { color: var(--accent); transform: translate(2px, -2px); }

/* Закрытая игра: пометка стоит в колонке «Онлайн» */
.bi-closed {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: #fdecec; color: #b42318; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.bi-closed svg { width: 11px; height: 11px; }

.bi-brand { display: grid; gap: 5px; justify-items: start; }
.bi-brand b { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.bi-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; background: color-mix(in srgb, var(--c, var(--accent)) 12%, white);
  font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--c, var(--accent)) 80%, black); white-space: nowrap;
}
.bi-row .c-country { font-size: 14px; line-height: 1.3; }
.bi-row .c-visits .bi-sub--wrap { white-space: normal; }
.bi-num { font-weight: 600; }
.bi-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.bi-up { color: #12925a; }
.bi-online { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-end; }
.bi-online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #c2c8d6; }
.bi-online.is-live::before { background: #17b26a; }

.bi-rating { display: grid; gap: 5px; min-width: 0; }
.bi-rating__top { display: flex; align-items: center; gap: 10px; }
.bi-rating__top .bi-rating__bar { flex: 1; min-width: 40px; }
.bi-rating__pct { font-weight: 700; }
.bi-rating__bar { height: 6px; border-radius: 6px; background: #f1d1d1; overflow: hidden; }
.bi-rating__bar i { display: block; height: 100%; border-radius: 6px; background: #17b26a; }
.bi-rating.is-mid .bi-rating__bar i { background: #e9a23b; }
.bi-rating.is-low .bi-rating__bar i { background: #e05454; }
.bi-votes { display: inline-flex; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bi-votes span { display: inline-flex; align-items: center; gap: 3px; }
.bi-votes svg { flex: none; width: 12px; height: 12px; }

.bi-toggle {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--white);
  display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: transform .35s var(--ease-out), background-color .2s, color .2s;
}
.bi-toggle svg { width: 14px; height: 14px; }
.bi-row:hover .bi-toggle { color: var(--text); }
.bi-row.is-open .bi-toggle { transform: rotate(180deg); background: var(--ink); border-color: var(--ink); color: var(--white); }

.bi-skeleton td { padding: 18px 20px; }
.bi-skeleton span {
  display: block; height: 48px; margin: 10px 0; border-radius: 12px;
  background: linear-gradient(90deg, #eef1f7 0%, #f7f8fb 40%, #eef1f7 80%) 0 0 / 300% 100%;
  animation: biShimmer 1.4s linear infinite;
}
@keyframes biShimmer { to { background-position: -150% 0; } }

/* ---------- Карточка игры (раскрытая строка) ---------- */
.bi-detail > td { padding: 0 !important; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.bi-detail:last-child > td { border-bottom: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.bi-card {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px);
  margin: 0 12px 12px; padding: clamp(18px, 2.6vw, 28px); border-radius: var(--radius);
  background: var(--white); border: 1px solid rgba(59, 107, 255, .14);
  animation: biOpen .45s var(--ease-out);
}
@keyframes biOpen { from { opacity: 0; transform: translateY(-8px); } }
.bi-card__media { display: grid; gap: 14px; align-content: start; }
.bi-shot {
  position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #1a2238, #2a3762);
}
.bi-shot img { width: 100%; height: 100%; object-fit: cover; }
.bi-shot__fallback { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .5); font-size: 14px; }
/* Надпись видна только когда картинки нет (img удаляется при ошибке загрузки) */
.bi-shot img + .bi-shot__fallback { display: none; }
.bi-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.bi-meta span {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 500; color: var(--muted);
}
.bi-meta svg { width: 14px; height: 14px; color: var(--accent); }
.bi-desc { font-size: 14.5px; line-height: 1.55; color: var(--muted); white-space: pre-line; }
.bi-desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bi-desc__more { justify-self: start; border: 0; background: none; padding: 0; font: 600 14px/1 var(--font-body); color: var(--accent); cursor: pointer; }

.bi-card__body { display: grid; gap: 22px; align-content: start; min-width: 0; }
.bi-card__title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.bi-card__title h3 { font-family: var(--font-display); font-size: clamp(19px, 2vw, 24px); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.bi-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Карточки цифр: ровная сетка, все карточки одной высоты, число всегда в одну строку */
.bi-stats { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.bi-stat {
  container-type: inline-size; display: flex; flex-direction: column; gap: 6px;
  min-height: 112px; padding: 16px 18px; border-radius: 14px; background: var(--paper);
}
.bi-stat dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bi-stat dd {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  font-size: clamp(13px, calc(100cqi / (var(--len, 8) * 0.78)), 26px);
}
.bi-stat__short { display: none; }
.bi-stat small { margin-top: auto; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* Сравнение с нишей: общая сетка для всех строк, поэтому шкалы одной длины */
.bi-bench { display: grid; gap: 12px; }
.bi-bench__title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bi-bench__row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 168px; align-items: center; gap: 16px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.bi-bench__title + .bi-bench__row { border-top: 0; padding-top: 2px; }
.bi-bench__label { color: var(--text); font-weight: 500; }
.bi-bench__track {
  position: relative; height: 12px; border-radius: 12px;
  background: linear-gradient(var(--paper), var(--paper)) padding-box; box-shadow: inset 0 0 0 1px var(--line);
}
.bi-bench__fill {
  position: absolute; inset: 0 auto 0 0; border-radius: 12px;
  background: linear-gradient(90deg, #6f93ff, var(--accent)); transition: width .6s var(--ease-out);
}
.is-down .bi-bench__fill { background: linear-gradient(90deg, #ffc36b, #f59e0b); }
.bi-bench__med {
  position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 3px;
  background: var(--ink); box-shadow: 0 0 0 2px var(--white);
}
.bi-bench__val { display: grid; justify-items: end; gap: 2px; text-align: right; }
.bi-bench__val b { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bi-bench__val small { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.is-up .bi-bench__val small { color: var(--accent); }
.is-down .bi-bench__val small { color: #c27803; }
.bi-bench__note { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.bi-bench__note i { flex: none; width: 3px; height: 14px; border-radius: 3px; background: var(--ink); }

.bi-places { display: flex; flex-wrap: wrap; gap: 8px; }
.bi-place {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.bi-place b { font-family: var(--font-display); font-size: 18px; color: var(--text); letter-spacing: -0.02em; }

.bi-chart { display: grid; gap: 10px; }
.bi-chart__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.bi-chart svg { width: 100%; height: 140px; overflow: visible; }
.bi-chart__wait {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--paper); font-size: 14px; color: var(--muted);
}
.bi-chart__wait svg { flex: none; width: 20px; height: 20px; color: var(--accent); }

/* ---------- Пусто и «показать ещё» ---------- */
.bi-empty { margin-top: 12px; padding: 48px 24px; text-align: center; border-radius: var(--radius-lg); background: var(--white); border: 1px dashed rgba(18, 18, 22, .2); display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.bi-empty__title { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text); }
.bi-empty a { color: var(--accent); }
.bi-more-wrap { display: flex; justify-content: center; margin-top: 24px; }
.bi-empty[hidden], .bi-more-wrap[hidden], .bi-table[hidden] { display: none; }

/* ---------- Как считаем ---------- */
.bi-method { padding-top: 0; }
.bi-method__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bi-method__card { padding: 28px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--line); display: grid; gap: 12px; align-content: start; }
.bi-method__num { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--accent); }
.bi-method__card h3 { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.bi-method__card p { font-size: 15.5px; color: var(--muted); }

/* ==========================================================================
   Адаптив
   ========================================================================== */
/* Ноутбуки 1240–1360: ужимаем отступы, чтобы колонка «Страна» осталась */
/* Ноутбуки 1240–1360: колонки уже, чтобы «Страна» осталась, а игре хватило места */
@media (max-width: 1360px) {
  .bi-table { font-size: 14.5px; }
  .bi-table th, .bi-row td { padding-left: 8px; padding-right: 8px; }
  .bi-table th.c-rank { width: 48px; }
  .bi-table th.c-brand { width: 146px; }
  .bi-table th.c-country { width: 118px; }
  .bi-table th.c-visits { width: 108px; }
  .bi-table th.c-online { width: 88px; }
  .bi-table th.c-rating { width: 150px; }
  .bi-table th.c-fav { width: 96px; }
  .bi-table th.c-created { width: 84px; }
  .bi-table th.c-more { width: 56px; }
  .bi-row .c-country { font-size: 13.5px; }
  .bi-votes { gap: 5px; font-size: 12px; }
  .bi-votes span { gap: 2px; }
  .bi-table th.c-rating { width: 152px; }
  .bi-table th.c-rank { width: 48px; }
  .bi-table th:first-child, .bi-row td:first-child { padding-left: 14px; }
  .bi-game { gap: 12px; }
}
@media (max-width: 1240px) {
  .c-country, .bi-row .c-country { display: none; }
}
@media (max-width: 1100px) {
  .bi-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Место в рейтинге переезжает к названию игры, дата запуска — в раскрытую карточку */
  .c-rank, .bi-row .c-rank { display: none; }
  .bi-game__name .bi-mrank { display: inline-grid; }
  .bi-table th:nth-child(2), .bi-row td:nth-child(2) { padding-left: 16px; }
  .bi-card { grid-template-columns: minmax(0, 1fr); }
  .bi-card__media { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); align-items: start; }
}

@media (max-width: 1100px) and (min-width: 961px) {
  .c-created { display: none; }
}

/* На узких экранах строки таблицы превращаются в карточки */
@media (max-width: 960px) {
  .bi-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi-leaders { grid-template-columns: minmax(0, 1fr); }
  .bi-method__grid { grid-template-columns: minmax(0, 1fr); }

  .bi-table-wrap { background: none; border: 0; }
  .bi-table, .bi-table tbody { display: block; }
  .bi-table thead { display: none; }
  .bi-row {
    position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    margin-bottom: 10px; padding: 16px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line);
  }
  .bi-row:hover td, .bi-row.is-open td { background: none; }
  .bi-row.is-open { border-color: rgba(59, 107, 255, .4); border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
  .bi-row td { display: block; padding: 0 !important; border: 0; text-align: left !important; }
  .bi-row .c-rank { display: none; }
  .bi-row .c-game { grid-column: 1 / -1; min-width: 0; padding-right: 44px !important; }
  .bi-row .c-more { position: absolute; top: 16px; right: 16px; }
  .bi-row .c-brand, .bi-row .c-country { grid-column: 1 / -1; }
  .bi-row .c-brand .bi-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .bi-row .c-country { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
  .bi-row .c-num, .bi-row .c-rating { padding: 10px 12px !important; border-radius: 12px; background: var(--paper); }
  .bi-row .c-rating { grid-column: 1 / -1; }
  .bi-row td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted);
  }
  .bi-row .bi-online { justify-content: flex-start; }
  .bi-game__name .bi-mrank { display: inline-grid; }
  .bi-game__name { max-width: none; }

  .bi-detail { display: block; }
  .bi-detail > td { display: block; background: none; border: 0 !important; }
  .bi-card {
    margin: 0 0 12px; border-radius: 0 0 var(--radius) var(--radius); border-color: rgba(59, 107, 255, .4); border-top: 0;
  }
  .bi-card__media { grid-template-columns: minmax(0, 1fr); }
  .bi-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi-stat { min-height: 104px; padding: 14px; }
  .bi-bench__row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; }
  .bi-bench__row .bi-bench__track { grid-column: 1 / -1; grid-row: 2; }
  .bi-skeleton { display: block; }
  .bi-skeleton td { display: block; padding: 0; }
}
@media (max-width: 600px) {
  /* Большие числа на телефоне — коротко («1,6 млрд»), чтобы шрифт оставался крупным */
  .bi-stat dd { font-size: clamp(14px, calc(100cqi / (var(--len-m, 8) * 0.78)), 24px); }
  .bi-stat__full { display: none; }
  .bi-stat__short { display: inline; }
  .bi-filters { grid-template-columns: minmax(0, 1fr); }
  .bi-cats { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1 + 0px); padding: 2px 4px 6px; scrollbar-width: none; }
  .bi-cats::-webkit-scrollbar { display: none; }
  .bi-search { height: 52px; }
  .bi-search input { font-size: 16px; padding-right: 16px; }
  .bi-search__kbd { display: none; }
  .bi-kpi { padding: 18px; }
  .bi-card__actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .bi-card, .bi-skeleton span, .bi-updated.is-live .bi-updated__dot { animation: none; }
}
