@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../font/NotoSans-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../font/NotoSans-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #fcfbf6;
  --black: #000000;
  --text-secondary: #414141;
  --gray: #7b7b7b;
  --placeholder: #828282;
  --primary: #3e2269;
  --link: #7c59b4;
  --border: #dbdbdb;
  --header-border: #bcbcbc;
  --footer-bg: #0d0030;
  --footer-bg-mobile: #210b44;
  --container: 1366px;
  --gradient: linear-gradient(90deg, #191497 0%, #bf2eee 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans", Arial, sans-serif;
  font-size: 16px;
  color: var(--black);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
}

/* ---------- Шапка ---------- */

.header {
  background: #ffffff;
  border-bottom: 1px solid var(--header-border);
}

.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 80px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 35px;
}

.header__logo {
  flex-shrink: 0;
  line-height: 0;
}

.header__logo-icon {
  display: none;
}

.header__lang {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: none;
  border: none;
}

.header__lang-text {
  font-size: 17px;
  color: var(--primary);
}

/* ---------- Поиск ---------- */

.header__search {
  position: relative;
  flex: 0 1 330px;
  min-width: 0;
  margin: 0 auto;
}

.search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 15px;
  background: #fffcf8;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: border-color 0.15s;
}

.search.is-open .search__field,
.search__field:focus-within {
  border-color: var(--black);
}

.search__icon {
  flex-shrink: 0;
}

.search__input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--black);
}

.search__input::placeholder {
  color: var(--placeholder);
}

.search__clear {
  display: none;
  flex-shrink: 0;
  background: none;
  border: none;
  line-height: 0;
  padding: 2px;
}

.search.has-value .search__clear {
  display: block;
}

.search__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 20px); /* панель прилегает к нижней границе шапки */
  left: 0;
  right: 0;
  z-index: 20;
}

.search.is-open .search__dropdown {
  display: block;
}

.search__item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0 5px 5px 0;
}

.search__item + .search__item {
  margin-top: -1px;
}

.search__item.is-hidden {
  display: none;
}

.search__link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 45px;
  font-size: 17px;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
}

.search__link span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search__link:hover {
  background: #f5f3ee;
}

.search__thumb {
  width: 84px;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

.search__empty {
  display: none;
  align-items: center;
  justify-content: center;
  height: 47px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0 5px 5px 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--black);
}

.search.is-empty .search__empty {
  display: flex;
}

.search.is-empty .search__list {
  display: none;
}

/* ---------- Заголовок и фильтры ---------- */

.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 45px 35px 60px;
}

.page__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}

.page__title {
  font-size: 28px;
  font-weight: 500;
}

.page__count {
  margin-left: 15px;
  font-size: 22px;
  font-weight: 400;
  color: var(--gray);
}

.filters {
  display: flex;
  align-items: center;
  gap: 28px;
}

.filters__group {
  position: relative;
}

.filters__btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 15px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filters__chevron {
  transition: transform 0.2s;
}

.filters__group.is-open .filters__chevron {
  transform: rotate(180deg);
}

.filters__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  z-index: 20;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.filters__group.is-open .filters__dropdown {
  display: flex;
  flex-direction: column;
}

.filters__dropdown--sort {
  left: 0;
  width: 209px;
  padding: 15px;
  gap: 15px;
}

.filters__dropdown--genre {
  right: 0;
  width: 227px;
  padding: 5px 0;
}

/* радио-пункты сортировки */

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.radio__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio__mark {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid var(--link);
  border-radius: 50%;
}

.radio__input:checked + .radio__mark::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--link);
}

.radio__label {
  font-size: 15px;
  color: var(--text-secondary);
}

/* пункты жанров */

.genre {
  padding: 6px 15px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
}

.genre:hover {
  color: var(--link);
}

.genre--active {
  background: #f1f1f1;
}

/* ---------- Карточки ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0 0 5px 5px;
  padding-bottom: 20px;
  overflow: hidden;
}

.card__img {
  width: 100%;
  aspect-ratio: 303 / 170;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 15px 0;
  margin-bottom: 25px;
}

.card__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
}

.card__img-link {
  display: block;
  line-height: 0;
}

.card__link {
  color: inherit;
  text-decoration: none;
}

.card__link:hover {
  color: var(--link);
}

.card__text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.card__btn {
  display: inline-block;
  align-self: center;
  margin-top: auto;
  padding: 8px 27px;
  background: var(--primary);
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.card__btn:hover {
  opacity: 0.85;
}

/* ---------- Пагинация ---------- */

.pagination {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 42px;
}

/* разделитель между порциями карточек внутри сетки */
.cards .pagination {
  grid-column: 1 / -1;
  margin-top: 0;
}

/* пустой результат поиска на главной */
.cards__empty {
  grid-column: 1 / -1;
  padding: 30px 0;
  text-align: center;
  font-size: 17px;
  color: var(--gray);
}

.pagination__line {
  flex: 1 1 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.45) 0 14px,
    transparent 14px 30px
  );
}

.pagination__label {
  font-size: 22px;
  color: var(--gray);
}

/* ---------- Обзор игры ---------- */

.review__title {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 22px;
}

.review__top {
  display: grid;
  grid-template-columns: 1fr 441px;
  gap: 55px;
  align-items: start;
  margin-bottom: 45px;
}

.review__text {
  font-size: 17px;
  line-height: 1.45;
}

/* в свёрнутом виде блоки после первых абзацев полностью скрыты
   (но остаются в HTML страницы) */
.review__text--collapsed .review__more {
  display: none;
}

.review__text > * + * {
  margin-top: 17px;
}

.review__text h2 {
  font-size: 24px;
  font-weight: 500;
  margin-top: 30px;
}

.review__text h3 {
  font-size: 20px;
  font-weight: 500;
  margin-top: 25px;
}

.review__text a {
  color: var(--link);
}

.review__text ul,
.review__text ol {
  padding-left: 22px;
}

.review__text ul {
  list-style: disc;
}

.review__text ol {
  list-style: decimal;
}

.review__text li + li {
  margin-top: 8px;
}

.review__text li::marker {
  color: var(--link);
}

.review__toggle {
  margin-top: 22px;
  padding: 0;
  background: none;
  border: none;
  color: var(--link);
  font-size: 17px;
}

.review__toggle:hover {
  text-decoration: underline;
}

/* карточка «Особенности игры» */

.features {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 20px;
}

.features__title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
}

.features__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.features__row {
  display: flex;
  font-size: 17px;
  line-height: 1.45;
}

.features__row dt {
  flex-shrink: 0;
  width: 172px;
  color: var(--text-secondary);
}

.features__row a {
  color: var(--link);
  text-decoration: none;
}

.features__row a:hover {
  text-decoration: underline;
}

/* галерея: видео + изображения */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 45px;
}

.gallery__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
}

.gallery__video {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: none;
  border-radius: 5px;
  background-color: var(--footer-bg);
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.gallery__video::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background: rgba(13, 0, 48, 0.35);
  transition: background 0.2s;
}

.gallery__video:hover::before {
  background: rgba(13, 0, 48, 0.5);
}

.gallery__play {
  position: relative;
}

/* отзывы: блок шириной в две колонки галереи */

.reviews {
  width: calc((100% - 60px) / 3 * 2 + 30px);
}

.reviews__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 30px;
}

.reviews__count {
  font-size: 24px;
  font-weight: 500;
}

.reviews__cta {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 20px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.reviews__cta:hover {
  opacity: 0.85;
}

/* display у класса сильнее UA-правила для [hidden] — скрываем явно */
.reviews__cta[hidden],
.review-form[hidden] {
  display: none;
}

.review-form {
  margin-bottom: 30px;
}

.review-form__text {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 15px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.review-form__text::placeholder,
.review-form__name::placeholder {
  color: var(--placeholder);
}

.review-form__text:focus,
.review-form__name:focus {
  border-color: var(--black);
}

.review-form__bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.review-form__name {
  width: 180px;
  height: 45px;
  padding: 0 15px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 17px;
  outline: none;
}

.review-form__submit {
  height: 38px;
  padding: 0 27px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.review-form__submit:hover {
  opacity: 0.85;
}

.reviews__list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.review-card {
  display: flex;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 20px;
}

.review-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--link);
  color: #ffffff;
  font-size: 26px;
  font-weight: 500;
}

.review-card__body {
  min-width: 0;
}

.review-card__head {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.review-card__name {
  font-size: 16px;
  font-weight: 500;
}

.review-card__date {
  color: var(--placeholder);
  font-size: 15px;
}

.review-card__text {
  font-size: 17px;
  line-height: 1.45;
  /* объединённые отзывы разделяются пустой строкой */
  white-space: pre-line;
}

/* поп-ап с видео */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 0, 48, 0.75);
}

.modal__dialog {
  position: relative;
  width: min(900px, 100%);
}

.modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  padding: 4px;
  background: none;
  border: none;
  line-height: 0;
}

.modal__close:hover {
  opacity: 0.8;
}

.modal__video {
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 5px;
  overflow: hidden;
}

.modal__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

/* поп-ап обратной связи */

.modal__panel {
  position: relative;
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 25px;
}

.modal__panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px;
  background: none;
  border: none;
  line-height: 0;
}

.modal__panel-close:hover {
  opacity: 0.7;
}

.modal__title {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
}

.feedback-form__field {
  margin-bottom: 15px;
}

.feedback-form__text {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 15px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}

.feedback-form__email {
  width: 100%;
  height: 45px;
  padding: 0 15px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 17px;
  outline: none;
}

.feedback-form__text::placeholder,
.feedback-form__email::placeholder {
  color: var(--placeholder);
}

.feedback-form__text:focus,
.feedback-form__email:focus {
  border-color: var(--black);
}

.feedback-form__text.is-invalid,
.feedback-form__email.is-invalid {
  border-color: #d64040;
}

.feedback-form__error {
  margin-top: 6px;
  font-size: 14px;
  color: #d64040;
}

.feedback-form__submit {
  height: 38px;
  padding: 0 27px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.feedback-form__submit:hover {
  opacity: 0.85;
}

.feedback-success__title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
}

.feedback-success__text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ---------- Страница 404 ---------- */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px 0 70px;
}

.error-page__code {
  font-size: 120px;
  font-weight: 600;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.error-page__title {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 12px;
}

.error-page__text {
  max-width: 480px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.error-page__btn {
  display: inline-block;
  padding: 10px 30px;
  background: var(--primary);
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.error-page__btn:hover {
  opacity: 0.85;
}

/* ---------- Подвал ---------- */

.footer {
  flex-shrink: 0;
  background: var(--footer-bg);
  color: #ffffff;
  font-size: 15px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 35px;
}

.footer__link {
  color: #ffffff;
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
}

/* ---------- Адаптив ---------- */

/* ~1000px: 3 колонки */
@media (max-width: 1100px) {
  .header__inner,
  .footer__inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .page {
    padding-left: 20px;
    padding-right: 20px;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .review__top {
    grid-template-columns: 1fr 360px;
    gap: 28px;
  }

  .reviews {
    width: 100%;
  }
}

/* ~768px: 2 колонки, без пагинации */
@media (max-width: 860px) {
  .header__inner,
  .footer__inner {
    padding-left: 28px;
    padding-right: 28px;
  }

  .page {
    padding: 40px 28px 50px;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .pagination {
    display: none;
  }

  .review__top {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }
}

/* ~480px: компактные карточки, фильтры под заголовком */
@media (max-width: 600px) {
  .header__inner {
    height: 60px;
    padding: 0 18px;
    gap: 12px;
  }

  .header__logo-full {
    display: none;
  }

  .header__logo-icon {
    display: block;
  }

  .header__search {
    flex: 1 1 auto;
  }

  .search__field {
    height: 36px;
    padding: 0 12px;
  }

  .search__dropdown {
    top: calc(100% + 12px);
  }

  .page {
    padding: 25px 18px 35px;
  }

  .page__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
  }

  .page__title {
    font-size: 24px;
  }

  .page__count {
    font-size: 19px;
    margin-left: 10px;
  }

  .filters {
    gap: 18px;
  }

  .filters__dropdown--genre {
    right: auto;
    left: 0;
  }

  .cards {
    gap: 18px;
  }

  .card {
    padding-bottom: 0;
  }

  .card__body {
    padding: 12px;
    margin-bottom: 0;
  }

  .card__title {
    font-size: 19px;
    line-height: 1.35;
  }

  .card__text,
  .card__btn {
    display: none;
  }

  .review__title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .error-page {
    padding: 30px 0 40px;
  }

  .error-page__code {
    font-size: 84px;
  }

  .error-page__title {
    font-size: 22px;
  }

  .error-page__text {
    font-size: 16px;
  }

  .review__top {
    gap: 30px;
    margin-bottom: 20px;
  }

  .review__text {
    font-size: 16px;
  }

  .review__toggle {
    font-size: 16px;
    margin-top: 20px;
  }

  /* карточка особенностей — на всю ширину экрана */
  .features {
    margin: 0 -18px;
    padding: 18px;
  }

  .features__title {
    font-size: 22px;
    margin-bottom: 18px;
  }

  .features__list {
    gap: 8px;
  }

  .features__row {
    font-size: 15px;
  }

  .features__row dt {
    width: 149px;
  }

  .gallery {
    gap: 15px;
    margin-bottom: 30px;
  }

  .reviews__head {
    margin-bottom: 20px;
  }

  .reviews__count {
    font-size: 22px;
  }

  .reviews__cta {
    height: 36px;
  }

  .review-form__text {
    min-height: 128px;
    padding: 12px 15px;
    font-size: 16px;
  }

  .review-form__bottom {
    gap: 18px;
    margin-top: 18px;
  }

  .review-form__name {
    flex: 1 1 auto;
    width: auto;
    height: 41px;
    font-size: 16px;
  }

  .review-form__submit {
    height: 36px;
  }

  .reviews__list {
    gap: 18px;
  }

  .review-card {
    gap: 12px;
    padding: 15px;
  }

  .review-card__avatar {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  .review-card__head {
    gap: 15px;
  }

  .review-card__name {
    font-size: 15px;
  }

  .review-card__date {
    font-size: 14px;
  }

  .review-card__text {
    font-size: 16px;
  }

  .footer {
    background: var(--footer-bg-mobile);
    font-size: 14px;
  }

  .footer__inner {
    height: 50px;
    padding: 0 18px;
  }
}

/* ~360px: без подписи языка, компактнее карточки */
@media (max-width: 480px) {
  .header__lang-text {
    display: none;
  }

  .card__body {
    padding: 10px;
  }

  .card__title {
    font-size: 16px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* в самой узкой версии отзывы без аватара */
  .review-card__avatar {
    display: none;
  }
}
