/* ==========================================================================
   Related Sliders — перелинковка на single-game
   Миссии / Гайды / Другие игры
   ========================================================================== */

/* --------------------------------------------------------------------------
   Общие переменные Swiper для этой страницы
   -------------------------------------------------------------------------- */
.related-swiper,
.other-games-swiper {
  --swiper-theme-color: var(--primary-clr, #ea3c46);
  --swiper-pagination-color: var(--primary-clr, #ea3c46);
  --swiper-pagination-bullet-inactive-color: #323248;
  --swiper-pagination-bullet-inactive-opacity: 1;
}

/* --------------------------------------------------------------------------
   Блок (миссии / гайды) — внутри колонки контента
   -------------------------------------------------------------------------- */
.related-slider-block {
  margin-top: 32px;
}

.related-slider-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.related-slider-block__title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.related-slider-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.related-slider-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-clr, #efecff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  position: static !important;
  margin: 0 !important;
}

.related-slider-btn:hover {
  background: rgba(234, 60, 70, 0.15);
  border-color: rgba(234, 60, 70, 0.4);
  color: var(--primary-clr, #ea3c46);
}

.related-slider-btn.swiper-button-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.related-slider-btn::after {
  display: none !important;
}

/* Swiper контейнер */
.related-swiper {
  overflow: hidden;
  padding-bottom: 36px !important;
  padding-top: 8px !important;
  margin-top: -8px !important;
}

.related-swiper .swiper-wrapper {
  align-items: stretch;
}

.related-swiper .swiper-slide {
  height: auto;
}

/* Пагинация */
.related-swiper-pagination {
  position: static !important;
  transform: none !important;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.related-swiper-pagination .swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #323248;
  opacity: 1;
  transition: width 0.2s ease, background 0.2s ease;
  margin: 0 !important;
}

.related-swiper-pagination .swiper-pagination-bullet-active {
  width: 20px;
  background: var(--primary-clr, #ea3c46);
}

/* Скрываем блок если слайдер пустой (на случай race condition) */
.related-slider-block[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Pre-init: предотвращаем прыжок верстки
   -------------------------------------------------------------------------- */
.related-swiper:not(.swiper-initialized) .swiper-wrapper {
  flex-wrap: nowrap;
  gap: 16px;
}

/* Миссии — всегда 1 слайд */
.missions-swiper:not(.swiper-initialized) .swiper-slide {
  min-width: 100%;
  width: 100%;
}

/* Гайды — 1 → 2 → 3 слайда */
.related-guides-swiper:not(.swiper-initialized) .swiper-slide {
  min-width: 100%;
  width: 100%;
}

@media (min-width: 480px) {
  .related-guides-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(50% - 8px);
    width: calc(50% - 8px);
  }
}

@media (min-width: 900px) {
  .related-guides-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(33.333% - 10.667px);
    width: calc(33.333% - 10.667px);
  }
}

/* --------------------------------------------------------------------------
   Карточка миссии / гайда (related-card)
   -------------------------------------------------------------------------- */
.related-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--border-medium, 12px);
  overflow: hidden;
  background: var(--background-card-gradient);
  border: 1px solid var(--field-border-clr);
  transition: all .3s ease;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

@media (hover: hover) {
  .related-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
    border-color: #6c6c8e;
  }
}

.related-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--tertiary-clr, #1a1a27);
  flex-shrink: 0;
}

.related-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .3s ease-in-out;
}

@media (hover: hover) {
  .related-card:hover .related-card__media img {
    transform: scale(1.05);
  }
}

.related-card__subtitle {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
  gap: 6px;
}

.related-card__title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text-clr, #efecff);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.related-card__desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--content-text-clr, #a5adcf);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (hover: hover) {
  .related-card:hover .related-card__title {
    color: var(--primary-clr, #ea3c46);
  }
}

.related-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.related-card__date,
.related-card__duration {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted, #a5adcf);
  white-space: nowrap;
}

.related-card__date svg,
.related-card__duration svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Секция «Другие игры» — вне layout-grid, полная ширина контейнера
   -------------------------------------------------------------------------- */
.other-games-section {
  margin-top: 40px;
}

.other-games-wrap {
  overflow: hidden;
  border-radius: 40px;
  padding: 40px;
}

.other-games-wrap__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.other-games-wrap__title {
  margin: 0;
}

.other-games-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.other-games-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-clr, #efecff);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  position: static !important;
  margin: 0 !important;
}

.other-games-btn:hover {
  background: rgba(234, 60, 70, 0.15);
  border-color: rgba(234, 60, 70, 0.4);
  color: var(--primary-clr, #ea3c46);
}

.other-games-btn.swiper-button-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.other-games-btn::after {
  display: none !important;
}

.other-games-swiper {
  overflow: hidden;
  padding-bottom: 40px !important;
  padding-top: 10px !important;
  margin-top: -10px !important;
}

.other-games-swiper .swiper-wrapper {
  align-items: stretch;
}

.other-games-swiper .swiper-slide {
  height: auto;
}

.other-games-pagination {
  position: static !important;
  transform: none !important;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.other-games-pagination .swiper-pagination-bullet {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #323248;
  opacity: 1;
  transition: width 0.2s ease, background 0.2s ease;
  margin: 0 !important;
}

.other-games-pagination .swiper-pagination-bullet-active {
  width: 22px;
  background: var(--primary-clr, #ea3c46);
}

/* Pre-init other-games: 2 → 3 → 4 → 5 слайдов */
.other-games-swiper:not(.swiper-initialized) .swiper-wrapper {
  flex-wrap: nowrap;
  gap: 16px;
}

.other-games-swiper:not(.swiper-initialized) .swiper-slide {
  min-width: calc(66.666% - 5px); /* ~1.5 слайда на мобилке */
  width: calc(66.666% - 5px);
}

@media (min-width: 480px) {
  .other-games-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(50% - 8px);
    width: calc(50% - 8px);
  }
}

@media (min-width: 768px) {
  .other-games-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(33.333% - 10.667px);
    width: calc(33.333% - 10.667px);
  }
}

@media (min-width: 1024px) {
  .other-games-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(25% - 12px);
    width: calc(25% - 12px);
  }
}

@media (min-width: 1280px) {
  .other-games-swiper:not(.swiper-initialized) .swiper-slide {
    min-width: calc(20% - 12.8px);
    width: calc(20% - 12.8px);
  }
}

/* --------------------------------------------------------------------------
   game-card в слайдере «Другие игры» — карточка занимает всю высоту слайда
   -------------------------------------------------------------------------- */
.other-games-swiper .game-card {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.other-games-swiper .game-card__inner {
  height: 100%;
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .other-games-wrap {
    padding: 28px 24px;
  }
}

@media (max-width: 640px) {
  .related-slider-block {
    margin-top: 24px;
  }

  .other-games-wrap {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .other-games-nav {
    display: none;
  }

  .related-slider-nav {
    display: none;
  }
}
