/* =============================================================
 * Bethplanet — game.css overrides
 * Загружается ПОСЛЕ /assets/css/game.css в AHEADER. Сюда копим
 * мелкие правки между релизами; раз в N изменений переливаем
 * в основной game.css и обнуляем этот файл.
 * ============================================================= */

/* Card title: убрать резерв под moder-панель — она и так редкая
 * (только для админов), пустота справа на title мозолит глаз. */
.bp-game-card__title {
  padding-right: 0 !important;
}

/* =============================================================
 * Layout flip: sidebar СЛЕВА, main справа.
 * Реализация через flex `order` — DOM-порядок сохраняем
 * (main → aside, важно для SEO и screen readers). Визуально
 * меняем местами через order: 1/2.
 * На мобильных (≤1024px) main возвращается наверх (order 1).
 * ============================================================= */

.bp-game-layout {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}

.bp-game-layout__aside {
  order: 1;
  flex: 0 0 320px;
  min-width: 0;
  max-width: 320px;
}

.bp-game-layout__main {
  order: 2;
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 1024px) {
  .bp-game-layout {
    gap: 20px;
  }

  .bp-game-layout__aside,
  .bp-game-layout__main {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .bp-game-layout__main {
    order: 1;
  }

  .bp-game-layout__aside {
    order: 2;
  }
}

/* =============================================================
 * Catalog toolbar — search + sort на главной /games/
 * ============================================================= */

.bp-game-toolbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
}

/* -------- Search v2: лупа внутри инпута, без отдельной кнопки -------- */

.bp-game-search--icon {
  position: relative;
  max-width: none;
  margin: 0;
}

.bp-game-search--icon .bp-game-search__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  pointer-events: none;
  color: var(--bp-g-text-dim);
  z-index: 2;
}

.bp-game-search--icon .bp-game-search__icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.bp-game-search--icon .bp-game-search__input {
  padding: 0 44px 0 44px;
  border: 1px solid var(--bp-g-line-strong);
  border-radius: var(--bp-g-radius-pill);
}

.bp-game-search--icon .bp-game-search__input:focus {
  border-color: var(--bp-g-brand);
}

/* Submit-кнопку прячем визуально, но оставляем доступной для скринридеров
 * и для submit без JS (Enter работает). */
.bp-game-search--icon .bp-game-search__btn {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

/* Кнопка-крестик «очистить» — появляется через JS-класс is-visible */
.bp-game-search__clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--bp-g-surface-2);
  color: var(--bp-g-text-muted);
  font-family: inherit;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-game-search__clear.is-visible {
  display: inline-flex;
}

.bp-game-search__clear:hover,
.bp-game-search__clear:focus-visible {
  background: var(--bp-g-text-muted);
  color: #fff;
  outline: none;
}

.bp-game-search__clear svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* -------- Sort: chips с подчёркиванием (по правилу 5 редизайна) -------- */

.bp-game-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--bp-g-font);
}

.bp-game-sort__label {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-g-text-dim);
}

.bp-game-sort__chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-game-sort__chip:link,
.bp-game-sort__chip:visited {
  color: var(--bp-g-text-muted);
}

.bp-game-sort__chip:hover,
.bp-game-sort__chip:focus-visible {
  color: var(--bp-g-text);
  border-bottom-color: var(--bp-g-line-strong);
  text-decoration: none;
  outline: none;
}

.bp-game-sort__chip.is-active,
.bp-game-sort__chip.is-active:hover,
.bp-game-sort__chip.is-active:focus-visible {
  color: var(--bp-g-brand);
  border-bottom-color: var(--bp-g-brand);
  font-weight: 600;
}
