/* =============================================================
 * Bethplanet — global chrome 2026
 * Шапка ($GLOBAL_CLEFTER$), сайдбар-информеры ($GLOBAL_DRIGHTER$),
 * футер ($GLOBAL_BFOOTER$). Использует токены --bp-g-* из game.css.
 * Заменяет Bootstrap-зависимости поверх legacy-разметки.
 * ============================================================= */

/* =============================================================
 * HEADER — sticky top bar
 * ============================================================= */
.bp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--bp-g-line);
  box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04);
  font-family: var(--bp-g-font);
}

.bp-header__row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.bp-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  height: 40px;
}

.bp-header__logo img {
  max-height: 36px;
  width: auto;
  display: block;
}

.bp-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--bp-g-text);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__menu-toggle:hover,
.bp-header__menu-toggle:focus-visible {
  background: var(--bp-g-surface);
  border-color: var(--bp-g-brand-line);
  outline: none;
}

.bp-header__menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

@media (max-width: 900px) {
  .bp-header__menu-toggle {
    display: inline-flex;
  }
}

/* --- Primary navigation (desktop) --- */
.bp-header__nav {
  flex: 1 1 auto;
  min-width: 0;
}

.bp-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-nav__item {
  position: relative;
}

.bp-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 14px;
  color: var(--bp-g-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--bp-g-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-nav__link:hover,
.bp-nav__link:focus-visible {
  background: var(--bp-g-surface);
  color: var(--bp-g-brand);
  outline: none;
  text-decoration: none;
}

.bp-nav__link.is-active {
  color: var(--bp-g-brand);
  background: var(--bp-g-brand-soft);
}

.bp-nav__chevron {
  width: 12px;
  height: 12px;
  fill: currentColor;
  opacity: 0.6;
  transition: transform var(--bp-g-dur) var(--bp-g-ease);
}

.bp-nav__item--has-dropdown:hover .bp-nav__chevron,
.bp-nav__item.is-open .bp-nav__chevron {
  transform: rotate(180deg);
}

.bp-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 110;
  min-width: 240px;
  margin: 6px 0 0;
  padding: 8px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--bp-g-dur) var(--bp-g-ease),
    transform var(--bp-g-dur) var(--bp-g-ease),
    visibility 0s linear var(--bp-g-dur);
}

.bp-nav__item--has-dropdown:hover > .bp-nav__dropdown,
.bp-nav__item--has-dropdown:focus-within > .bp-nav__dropdown,
.bp-nav__item.is-open > .bp-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.bp-nav__dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--bp-g-text);
  text-decoration: none;
  border-radius: var(--bp-g-radius-sm);
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-nav__dropdown a:hover,
.bp-nav__dropdown a:focus-visible {
  background: var(--bp-g-surface);
  color: var(--bp-g-brand);
  outline: none;
  text-decoration: none;
}

@media (max-width: 900px) {
  .bp-header__nav {
    display: none;
  }
}

/* --- Right actions: search + user / login --- */
.bp-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bp-header__search {
  position: relative;
  display: flex;
  align-items: center;
}

.bp-header__search-input {
  width: 180px;
  height: 40px;
  padding: 0 36px 0 14px;
  background: var(--bp-g-surface);
  color: var(--bp-g-text);
  font-family: inherit;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: var(--bp-g-radius-pill);
  outline: none;
  transition: width var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease),
    background var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__search-input::placeholder {
  color: var(--bp-g-text-dim);
}

.bp-header__search-input:focus {
  width: 260px;
  background: #ffffff;
  border-color: var(--bp-g-brand);
}

.bp-header__search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--bp-g-text-muted);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__search-btn:hover,
.bp-header__search-btn:focus-visible {
  color: var(--bp-g-brand);
  outline: none;
}

.bp-header__search-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 700px) {
  .bp-header__search-input {
    width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .bp-header__search-input:focus {
    width: 200px;
    padding: 0 36px 0 14px;
    background: #ffffff;
    border: 1px solid var(--bp-g-brand);
  }
}

.bp-header__user {
  position: relative;
}

.bp-header__user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--bp-g-radius-pill);
  cursor: pointer;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__user-btn:hover,
.bp-header__user-btn:focus-visible {
  background: var(--bp-g-surface);
  border-color: var(--bp-g-line);
  outline: none;
}

.bp-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.bp-header__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--bp-g-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
}

.bp-header__user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 110;
  min-width: 200px;
  margin: 6px 0 0;
  padding: 8px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--bp-g-dur) var(--bp-g-ease),
    transform var(--bp-g-dur) var(--bp-g-ease),
    visibility 0s linear var(--bp-g-dur);
}

.bp-header__user.is-open .bp-header__user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.bp-header__user-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--bp-g-text);
  text-decoration: none;
  border-radius: var(--bp-g-radius-sm);
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__user-menu a:hover,
.bp-header__user-menu a:focus-visible {
  background: var(--bp-g-surface);
  color: var(--bp-g-brand);
  outline: none;
  text-decoration: none;
}

.bp-header__user-menu-divider {
  height: 1px;
  background: var(--bp-g-line);
  margin: 6px 0;
}

.bp-header__cta {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--bp-g-radius-pill);
  white-space: nowrap;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__cta--ghost {
  background: transparent;
  color: var(--bp-g-text);
  border: 1px solid var(--bp-g-line-strong);
}

.bp-header__cta--ghost:hover,
.bp-header__cta--ghost:focus-visible {
  background: var(--bp-g-surface);
  border-color: var(--bp-g-text-muted);
  color: var(--bp-g-text);
  outline: none;
  text-decoration: none;
}

.bp-header__cta--primary {
  background: var(--bp-g-brand);
  color: #fff;
  border: 1px solid var(--bp-g-brand);
}

.bp-header__cta--primary:hover,
.bp-header__cta--primary:focus-visible {
  background: var(--bp-g-brand-hover);
  border-color: var(--bp-g-brand-hover);
  color: #fff;
  outline: none;
  text-decoration: none;
}

@media (max-width: 700px) {
  .bp-header__cta {
    padding: 0 12px;
    font-size: 13px;
  }
}

.bp-header__add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  background: var(--bp-g-success);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--bp-g-radius-pill);
  transition: background var(--bp-g-dur) var(--bp-g-ease);
}

.bp-header__add:hover,
.bp-header__add:focus-visible {
  background: #166e3c;
  color: #ffffff;
  outline: none;
  text-decoration: none;
}

.bp-header__add svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* =============================================================
 * Mobile drawer (≤900px)
 * ============================================================= */
.bp-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--bp-g-dur) var(--bp-g-ease),
    visibility 0s linear var(--bp-g-dur);
}

.bp-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.bp-mobile-menu__panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: #ffffff;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--bp-g-dur) var(--bp-g-ease);
  -webkit-overflow-scrolling: touch;
}

.bp-mobile-menu.is-open .bp-mobile-menu__panel {
  transform: translateX(0);
}

.bp-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bp-g-line);
}

.bp-mobile-menu__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--bp-g-text);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--bp-g-dur) var(--bp-g-ease);
}

.bp-mobile-menu__close:hover {
  background: var(--bp-g-surface);
}

.bp-mobile-menu__close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.bp-mobile-menu__list {
  margin: 0;
  padding: 8px 12px;
  list-style: none;
}

.bp-mobile-menu__list a {
  display: block;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--bp-g-text);
  text-decoration: none;
  border-radius: var(--bp-g-radius-sm);
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease);
}

.bp-mobile-menu__list a:hover {
  background: var(--bp-g-surface);
  color: var(--bp-g-brand);
}

.bp-mobile-menu__group {
  margin: 0 0 4px;
}

.bp-mobile-menu__group-label {
  display: block;
  padding: 14px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-g-text-dim);
}

.bp-mobile-menu__group-list {
  margin: 0;
  padding: 0 0 0 12px;
  list-style: none;
}

.bp-mobile-menu__group-list a {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--bp-g-text-muted);
}

body.bp-mobile-menu-open {
  overflow: hidden;
}

/* =============================================================
 * SIDEBLOCK — глобальная стилизация информеров $GLOBAL_DRIGHTER$
 * Применяется на ВСЕХ страницах с .sideblock (без scope) —
 * редизайн legacy через CSS, без правки разметки модулей.
 * ============================================================= */
.sideblock {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: var(--bp-g-bg);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-md);
  box-shadow: var(--bp-g-shadow-card);
  font-family: var(--bp-g-font);
  color: var(--bp-g-text);
}

.sideblock .h2 {
  display: block;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-g-text-dim);
}

.sideblock > a {
  color: inherit;
  text-decoration: none;
}

.sideblock > a:hover .h2,
.sideblock > a:focus-visible .h2 {
  color: var(--bp-g-brand);
}

/* List of recent items inside .sideblock (Новости / Моды / Форум) */
.sideblock .list-group {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.sideblock .list-group-item {
  display: block;
  padding: 10px 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--bp-g-text);
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid var(--bp-g-line);
  background: transparent;
  transition: color var(--bp-g-dur) var(--bp-g-ease),
    padding-left var(--bp-g-dur) var(--bp-g-ease);
}

.sideblock .list-group-item:last-child {
  border-bottom: 0;
}

.sideblock .list-group-item:hover,
.sideblock .list-group-item:focus-visible {
  color: var(--bp-g-brand);
  text-decoration: none;
  outline: none;
}

/* "Скоро выйдут" — отдельный формат, с картинками-плитками */
.sideblock .row.list-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 !important;
}

.sideblock .row.list-group .list-group-item,
.sideblock .row.list-group > div,
.sideblock .row.list-group > a {
  padding: 0;
  border: 0;
  border-radius: var(--bp-g-radius-sm);
  overflow: hidden;
  background: var(--bp-g-surface-2);
  font-size: 12px;
  line-height: 1.3;
  color: var(--bp-g-text);
  text-align: center;
}

.sideblock .row.list-group img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--bp-g-radius-sm);
}

/* =============================================================
 * Game-info card (#gameinfo) — карточка с описанием игры
 * в боковой колонке legacy-модулей (load/photo/board/publ).
 * Структура: <div class="sideblock" id="gameinfo">
 *   <div class="content">
 *     <a><img id="gamelogo">
 *     <table class="table">
 *       <caption><a>Название</a>
 *       <tbody><tr><th>Дата выхода</th><td>...</td></tr>...
 * ============================================================= */
#gameinfo {
  padding: 0;
  overflow: hidden;
}

#gameinfo .content {
  display: flex;
  flex-direction: column;
}

#gameinfo #gamelogo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bp-g-surface-2);
}

#gameinfo .table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#gameinfo .table caption {
  display: block;
  padding: 14px 18px 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--bp-g-text);
  text-align: left;
  caption-side: top;
}

#gameinfo .table caption a {
  color: inherit;
  text-decoration: none;
}

#gameinfo .table caption a:hover {
  color: var(--bp-g-brand);
}

#gameinfo .table tr {
  display: grid;
  grid-template-columns: minmax(0, 100px) 1fr;
  gap: 10px;
  padding: 6px 18px;
}

#gameinfo .table tr:last-child {
  padding-bottom: 14px;
}

#gameinfo .table tr:empty {
  display: none;
}

#gameinfo .table th,
#gameinfo .table td {
  padding: 0;
  background: transparent;
  border: 0;
  font-weight: 400;
  text-align: left;
  color: var(--bp-g-text);
  vertical-align: top;
}

#gameinfo .table th {
  font-size: 12px;
  color: var(--bp-g-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* =============================================================
 * Sidebar — социальные ссылки + футер-блок DRIGHTER
 * Старая разметка (.fa-stack) заменяется на наш bp-social-icons,
 * но мы также стилизуем .sociallinks fallback под FontAwesome,
 * пока DRIGHTER не переписан.
 * ============================================================= */
.sideblock .content-bottom {
  font-size: 12px;
  color: var(--bp-g-text-muted);
  line-height: 1.5;
}

.sideblock .content-bottom p {
  margin: 0 0 10px;
}

.sociallinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px !important;
}

.sociallinks > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bp-g-surface);
  color: var(--bp-g-text-muted);
  border: 1px solid var(--bp-g-line);
  border-radius: var(--bp-g-radius-sm);
  text-decoration: none;
  transition: background var(--bp-g-dur) var(--bp-g-ease),
    color var(--bp-g-dur) var(--bp-g-ease),
    border-color var(--bp-g-dur) var(--bp-g-ease);
}

.sociallinks > a:hover,
.sociallinks > a:focus-visible {
  background: var(--bp-g-brand-soft);
  color: var(--bp-g-brand);
  border-color: var(--bp-g-brand-line);
  outline: none;
}

/* Скрыть оригинальный fa-stack background-square — оставляем только иконку */
.sociallinks .fa-stack {
  font-size: 1em !important;
  width: auto;
  height: auto;
  line-height: 1;
}

.sociallinks .fa-stack .fa-stop {
  display: none !important;
}

.sociallinks .fa-stack .fa-stack-1x {
  position: static;
  font-size: 18px;
  line-height: 1;
  color: inherit !important;
}

/* =============================================================
 * Ad banner placeholders & misc cleanups in sidebar
 * ============================================================= */
.bp-news-side .bannerad,
.bp-game-layout__aside .bannerad {
  margin: 0 0 14px;
  min-height: 0;
}

/* =============================================================
 * Hide legacy old-design fragments that we deprecated
 * ============================================================= */
.side-menu.visible-xs {
  display: none !important;
}

.topus,
.top-menu {
  display: none !important;
}

/* =============================================================
 * Layout base (legacy pages that still use .container/.row/.col-*)
 * Они подхватывают bootstrap; здесь мы добавляем минимальные правки
 * по бренд-цветам, чтобы legacy-страницы выглядели согласованно с
 * редизайнной шапкой.
 * ============================================================= */
body {
  font-family: var(--bp-g-font);
  background-color: var(--bp-g-page-bg);
}

/* Breadcrumb header (legacy) — пока шаблоны легаси модулей не переписаны */
.header-bread {
  background: transparent;
  padding: 0;
}

.header-bread .breadcrumb {
  background: transparent;
  padding: 18px 0 6px;
  margin: 0;
  font-size: 13px;
  color: var(--bp-g-text-muted);
  border-radius: 0;
}

.header-bread .breadcrumb > li + li::before {
  content: "›";
  color: var(--bp-g-text-dim);
  padding: 0 6px;
}

.header-bread .breadcrumb a {
  color: var(--bp-g-text-muted);
  text-decoration: none;
}

.header-bread .breadcrumb a:hover {
  color: var(--bp-g-brand);
}

.header-bread .breadcrumb .active {
  color: var(--bp-g-text);
  font-weight: 600;
}

/* =============================================================
 * Reduced motion
 * ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .bp-nav__dropdown,
  .bp-header__user-menu,
  .bp-header__search-input,
  .bp-mobile-menu,
  .bp-mobile-menu__panel,
  .bp-nav__chevron,
  .sideblock .list-group-item {
    transition: none;
  }
}
