/* FONTS */

@font-face {
    font-family: "Dosis";
    src: url("../../fonts/Dosis/Dosis-Regular.woff2") format("woff2"), url("Dosis-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Junigarden Swash";
    src: url("../../fonts/Junigarden/JunigardenSwash-Regular.woff2") format("woff2"),
        url("../../fonts/Junigarden/JunigardenSwash-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Junigarden Serif";
    src: url("../../fonts/Junigarden/JunigardenSerif-Regular.woff2") format("woff2"),
        url("../../fonts/Junigarden/JunigardenSerif-Regular.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Arcane Nine";
    src: url("../../fonts/ArcaneNine/Arcane_Nine.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.font-dosis {
    font-family: "Dosis";
}

.font-junigarden-swash {
    font-family: "Junigarden Swash";
}

.font-junigarden-serif {
    font-family: "Junigarden Serif";
}

.font-arcane-nine {
    font-family: "Arcane Nine";
}

/* END FONTS */

.games-page {
    min-height: 100vh;
    color: #2e1c44;
    background: linear-gradient(
        180deg,
        rgba(255, 183, 93, 0.22) 0%,
        rgba(255, 255, 255, 0.96) 34%,
        rgba(163, 111, 190, 0.18) 100%
    );
}

.games-page .container-games {
    width: min(1280px, calc(100% - 32px));
    margin-inline: auto;
}

.games-page__hero {
    padding: clamp(70px, 10vw, 130px) 0 clamp(40px, 7vw, 80px);
    text-align: center;
}

.games-page__eyebrow {
    margin: 0 0 12px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.games-page__title {
    margin: 0;
    font-size: clamp(2.6rem, 8vw, 5rem);
    line-height: 0.95;
}

.games-page__intro {
    max-width: 680px;
    margin: 24px auto 0;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
    color: rgba(46, 28, 68, 0.78);
}

.games-catalog {
    padding-bottom: clamp(70px, 10vw, 130px);
}

.games-catalog__categories {
    display: flex;
    gap: 10px;
    padding: 8px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(46, 28, 68, 0.08);
    scrollbar-width: thin;
}

.games-catalog__category {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
    padding: 11px 16px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 14px;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.games-catalog__category:hover {
    color: inherit;
    background: rgba(111, 72, 139, 0.1);
    transform: translateY(-1px);
}

.games-catalog__category.is-active {
    color: #fff;
    background: #2e1c44;
}

.games-catalog__category-count {
    display: inline-grid;
    min-width: 24px;
    min-height: 24px;
    padding: 3px 7px;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 999px;
}

.games-catalog__header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: clamp(36px, 6vw, 64px) 0 24px;
}

.games-catalog__title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.games-catalog__count {
    margin: 8px 0 0;
    color: rgba(46, 28, 68, 0.65);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(20px, 3vw, 30px);
}

.games-catalog__empty {
    padding: 60px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 24px;
}

.games-catalog__empty h2 {
    margin-top: 0;
}

.games-catalog__empty p {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .games-page .container-games {
        width: min(100% - 24px, 1180px);
    }

    .games-page__hero {
        text-align: left;
    }

    .games-page__intro {
        margin-inline: 0;
    }

    .games-catalog__categories {
        margin-inline: -12px;
        padding-inline: 12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }
}

.games-filters-panel.is-open {
    display: block;
}

.games-filters__field {
    display: grid;
    gap: 8px;
}

.games-filters__label {
    font-family: "Arcane Nine";
    font-size: 0.85rem;
    font-weight: 700;
}

.games-filters__input,
.games-filters__select {
    font-family: "Dosis";
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    color: #2e1c44;
    background: #fff;
    border: 1px solid rgba(46, 28, 68, 0.18);
    border-radius: 12px;
    outline: none;
}

.games-filters__input:focus,
.games-filters__select:focus {
    border-color: #6f488b;
    box-shadow: 0 0 0 3px rgba(111, 72, 139, 0.14);
}

.games-filters__reset {
    min-height: 48px;
    padding: 10px 16px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    background: #2e1c44;
    border: 0;
    border-radius: 12px;
}

.games-filters__reset:hover {
    background: #51336b;
}

.games-catalog__category {
    font: inherit;
    cursor: pointer;
    border: 0;
}

.game-card[hidden] {
    display: none;
}

.games-catalog__no-results {
    padding: 60px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 24px;
}

.games-catalog__no-results h2 {
    margin-top: 0;
}

.games-catalog__no-results p {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .games-filters__reset {
        width: 100%;
    }
}

.game-modal {
    width: min(1240px, calc(100% - 50px));
    max-width: none;
    max-height: calc(100dvh - 40px);
    padding: 0;
    overflow: visible;
    color: #2e1c44;
    background: transparent;
    border: 0;
}

.game-modal::backdrop {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: none;
}

.game-modal__window {
    position: relative;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: #fff8d4;
    border: 2px solid #2e1c44;
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(46, 28, 68, 0.18);
}

.game-modal__close {
    position: sticky;
    top: 14px;
    z-index: 10;
    display: grid;
    width: 44px;
    height: 44px;
    margin: 14px 14px -58px auto;
    place-items: center;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    background: #2e1c44;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 5px 16px rgba(46, 28, 68, 0.25);
}

.game-modal__close:hover {
    background: #51336b;
}

.game-modal__content {
    min-height: 400px;
}

.game-modal__loader,
.game-modal__error {
    display: grid;
    min-height: 400px;
    padding: 40px;
    place-items: center;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.game-modal__loader[hidden],
.game-modal__error[hidden] {
    display: none;
}

.game-modal .game-detail {
    padding: 42px;
    background: #fff8d4;
    border: 0;
    border-radius: 30px;
    box-shadow: none;
}

.has-open-game-modal {
    overflow: hidden;
}

@media (max-width: 767px) {
    .game-modal {
        display: none;
    }
}

.games-catalog__layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 42px;
    align-items: start;
}

.games-catalog__sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
    height: max-content;
    min-width: 0;
}

.games-page,
.games-catalog,
.games-catalog > .container-games,
.games-catalog__layout {
    overflow: visible;
}

@media (max-width: 991px) {
    .games-catalog__sidebar {
        position: static;
        height: auto;
    }
}

.games-categories-menu {
    display: grid;
    gap: 12px;
}

.games-categories-menu__item {
    display: flex;
    width: 100%;
    min-height: 64px;
    padding: 14px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #2e1c44;
    text-align: left;
    cursor: pointer;
    background: #fff8d4;
    border: 1px solid #2e1c44;
    border-radius: 13px;
    box-shadow: 2px 3px 0 rgba(46, 28, 68, 0.22);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.games-categories-menu__item.is-active {
    color: #fff8d4;
    background: #2e1c44;
    border-color: #2e1c44;
    outline: none;
    box-shadow: 3px 4px 0 #f28a2f;
    transform: translateY(-2px);
}

.games-categories-menu__item.is-active .games-categories-menu__content > span {
    opacity: 0.85;
}

.games-categories-menu__item.is-active .games-categories-menu__arrow {
    color: #f28a2f;
    transform: translateX(3px);
}

.games-categories-menu__arrow {
    transition: color 160ms ease, transform 160ms ease;
}

.games-categories-menu__content {
    width: 100%;
    justify-content: center;
    display: flex;
    min-width: 0px;
}

.games-categories-menu__content strong {
    font-family: "Arcane Nine";
    font-size: 0.96rem;
    display: block;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
}

.games-categories-menu__content > span {
    font-family: "Dosis";
    font-size: 1rem;
    opacity: 0.72;
    margin: auto;
}

.games-catalog__main {
    min-width: 0;
}

.games-catalog__sections {
    display: grid;
    gap: clamp(34px, 4vw, 52px);
}

.games-category-section {
    min-width: 0;
}

.games-category-section__header {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.games-category-section__title {
    font-family: "Arcane Nine";
    position: relative;
    margin: 0;
    color: #2e1c44;
    font-size: clamp(1.65rem, 2.1vw, 2.2rem);
    font-weight: 600;
    line-height: 1.1;
}

.games-category-section__title::after {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.6em;
    vertical-align: top;
}

.games-category-section__view-all {
    font-family: "Arcane Nine";
    display: inline-flex;
    flex: 0 0 auto;
    gap: 10px;
    align-items: center;
    padding: 5px 0;
    color: #2e1c44;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: 0;
    transition: gap 160ms ease, color 160ms ease;
}

.games-category-section__view-all:hover {
    gap: 15px;
    color: #2e1c44;
}

.games-category-section__view-all span {
    font-size: 1.25rem;
    line-height: 1;
    position: relative;
    top: -2px;
}

@media (max-width: 991px) {
    .games-catalog__layout {
        grid-template-columns: 1fr;
    }

    .games-catalog__sidebar {
        position: static;
    }

    .games-categories-menu {
        gap: 10px;
    }

    .games-categories-menu__item {
        min-height: 64px;
    }
}

@media (max-width: 767px) {
    .games-category-section__header {
        gap: 12px;
        margin-bottom: 12px;
        align-items: flex-end;
    }

    .games-category-section__title {
        font-size: 1.45rem;
    }

    .games-category-section__title::after {
        margin-left: 5px;
        font-size: 0.55em;
    }

    .games-category-section__view-all {
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .games-category-section__view-all span {
        font-size: 1rem;
    }

    .games-catalog__sections {
        gap: 38px;
    }
}

.games-category-slider-shell {
    position: relative;
    min-width: 0;
}

.games-category-slider {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 4px 42px 26px;
    overflow: hidden;

    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 65px), transparent 100%);

    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 65px), transparent 100%);
}

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

.games-category-slider .swiper-slide {
    display: flex;
    height: auto;
}

.games-category-slider .game-card {
    width: 100%;
    max-width: none;
}

.games-category-slider__navigation {
    position: absolute;
    top: calc(50% - 18px);
    z-index: 10;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: #2e1c44;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    background: #fff;
    border: 1px solid rgba(46, 28, 68, 0.18);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(46, 28, 68, 0.16);
    transition: opacity 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.games-category-slider__navigation:hover {
    background: #fff8d4;
    transform: translateY(-1px);
}

.games-category-slider__navigation--previous {
    left: 1px;
}

.games-category-slider__navigation--previous span {
    position: absolute;
    top: -1px;
}

.games-category-slider__navigation--next {
    right: 1px;
}

.games-category-slider__navigation--next span {
    position: absolute;
    top: -1px;
}

.games-category-slider__navigation.swiper-button-disabled {
    cursor: default;
    opacity: 0.25;
    pointer-events: none;
}

.games-category-slider__pagination {
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;
    z-index: 4;
    text-align: center;
}

.games-category-slider__pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    margin: 0 4px !important;
    background: rgba(255, 248, 212, 0.75);
    opacity: 1;
}

.games-category-slider__pagination .swiper-pagination-bullet-active {
    width: 9px;
    height: 9px;
    background: #f28a2f;
}

@media (max-width: 767px) {
    .games-category-slider {
        margin-inline: -12px;
        width: calc(100% + 24px);
        padding: 4px 12px 32px;
    }

    .games-category-slider__navigation {
        display: none;
    }
}

.games-catalog-hero {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(260px, 380px);
    gap: clamp(24px, 4vw, 52px);
    align-items: start;
    margin-bottom: 20px;
}

.games-catalog-hero__title {
    font-family: "Junigarden Swash";
    font-size: clamp(2.5rem, 3.8vw, 4rem);
    line-height: 0.95;
}

.games-catalog-hero__title span {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.42em;
    vertical-align: top;
}

.games-catalog-hero__description {
    font-family: "Dosis";
    max-width: 580px;
    margin: 0;
    color: #2e1c44;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.45;
}

.games-catalog-hero__actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.games-search {
    position: relative;
    display: block;
    width: 100%;
}

.games-search__input {
    font-family: "Arcane Nine";
    width: 100%;
    min-height: 50px;
    padding: 0 52px 0 20px;
    color: #2e1c44;
    background: rgba(255, 248, 232, 0.92);
    border: 1px solid rgba(46, 28, 68, 0.12);
    border-radius: 16px;
    box-shadow: 0 9px 28px rgba(46, 28, 68, 0.08);
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.games-search__input::placeholder {
    color: rgba(46, 28, 68, 0.52);
}

.games-search__input:focus {
    border-color: rgba(46, 28, 68, 0.45);
    box-shadow: 0 0 0 3px rgba(239, 113, 44, 0.16), 0 9px 28px rgba(46, 28, 68, 0.1);
}

.games-search__icon {
    position: absolute;
    top: 50%;
    right: 18px;
    color: #2e1c44;
    font-size: 1.45rem;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
}

.games-filter-toggle {
    font-family: "Arcane Nine";
    display: inline-flex;
    min-width: 100px;
    min-height: 42px;
    gap: 10px;
    padding: 0 20px;
    padding-inline: 18px;
    align-items: center;
    justify-content: center;
    color: #2e1c44;
    font-weight: 700;
    cursor: pointer;
    background: rgba(255, 248, 232, 0.92);
    border: 1px solid rgba(46, 28, 68, 0.12);
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(46, 28, 68, 0.08);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.games-filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(46, 28, 68, 0.13);
}

.games-filters-panel {
    display: none;
    margin-bottom: 34px;
    padding: 18px;
    background: rgba(255, 248, 232, 0.88);
    border: 1px solid rgba(46, 28, 68, 0.08);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(46, 28, 68, 0.08);
}

.games-filters-panel.is-open {
    display: block;
}

.games-filters {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(170px, 1fr))
        auto;
    gap: 14px;
    align-items: end;
}

.games-filters__field {
    display: grid;
    gap: 8px;
}

.games-filters__label {
    font-family: "Arcane Nine";
    color: #2e1c44;
    font-size: 0.85rem;
    font-weight: 700;
}

.games-filters__input,
.games-filters__select {
    font-family: "Dosis";
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    color: #2e1c44;
    background: #fff;
    border: 1px solid rgba(46, 28, 68, 0.18);
    border-radius: 12px;
    outline: none;
}

.games-filters__reset {
    min-height: 48px;
    padding: 10px 16px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    background: #2e1c44;
    border: 0;
    border-radius: 12px;
}

.games-category-slider .swiper-slide[hidden] {
    display: none !important;
}

.games-page {
    background: linear-gradient(to bottom, #e96c20, #a05aa0);
    padding: 100px 0;
}

.games-category-section.is-expanded .games-category-slider {
    padding: 4px 0 12px;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
}

.games-category-section.is-expanded .games-category-slider .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 20px;
    transform: none !important;
    -webkit-mask-image: none;
    mask-image: none;
}

.games-category-section.is-expanded .games-category-slider .swiper-slide {
    width: auto !important;
    height: auto;
    margin: 0 !important;
}

.games-category-section.is-expanded .games-category-slider__navigation,
.games-category-section.is-expanded .games-category-slider__pagination {
    display: none;
}

.games-category-section.is-expanded .games-category-slider::after {
    display: none;
}

.games-category-slider:has(.games-category-slider__navigation--next.swiper-button-disabled) .swiper-wrapper {
    -webkit-mask-image: none;
    mask-image: none;
}

.games-category-section__view-all.is-active {
    color: #2e1c44;
}

@media (max-width: 640px) {
    .games-category-section.is-expanded .games-category-slider .swiper-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

.games-page-wrapper {
    overflow: visible;
}

.game-card--catalog .game-card__content {
    min-height: 94px;
}

.game-card--catalog .game-card__title {
    min-height: 2.2em;
}

@media (prefers-reduced-motion: reduce) {
    .games-catalog__category {
        transition: none;
    }

    .games-catalog__category:hover {
        transform: none;
    }
}

@media (max-width: 991px) {
    .games-catalog-hero {
        grid-template-columns: 1fr;
    }

    .games-catalog-hero__actions {
        width: 100%;
        justify-items: stretch;
    }

    .games-filter-toggle {
        justify-self: end;
    }

    .games-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .games-catalog__layout {
        display: block;
    }

    .games-catalog__sidebar {
        position: static;
        width: 100%;
        margin-bottom: 24px;
    }

    .games-catalog__main {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .games-catalog-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;

        width: 100%;
        min-width: 0;
    }

    .games-catalog-hero__content {
        width: 100%;
        min-width: 0;
    }

    .games-catalog-hero__actions {
        width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .games-catalog-hero__title {
        width: 100%;
        max-width: none;

        font-size: clamp(2rem, 10vw, 2.8rem);
        line-height: 1;
    }

    .games-catalog-hero__description {
        width: 100%;
        max-width: none;
    }
    .games-search {
        width: 100%;
    }

    .games-search input {
        width: 100%;
        min-width: 0;
    }

    .games-filter-toggle {
        align-self: flex-end;
        width: auto;
        margin-left: auto;
    }

    .games-catalog > .container {
        width: 100%;
        padding-inline: 14px;
    }

    .games-category-slider {
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 35px), transparent 100%);

        mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 35px), transparent 100%);
    }

    .games-category-slider__navigation {
        display: none;
    }

    .games-category-section__header {
        gap: 12px;
        margin-bottom: 12px;
    }

    .games-category-section__title {
        font-size: 1.35rem;
        line-height: 1.1;
    }

    .games-category-section__view-all {
        flex-shrink: 0;
        font-size: 0.7rem;
    }

    .games-category-section.is-expanded .games-category-slider {
        padding-inline: 12px;
    }

    .games-category-section.is-expanded .games-category-slider .swiper-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }
}

@media (max-width: 640px) {
    .games-filters {
        grid-template-columns: 1fr;
    }

    .games-filters__reset {
        width: 100%;
    }
}
