.game {
    background: var(--base-bg-beige);
    padding: 214px 0 0 0;
}

.game .wrapper {
    position: relative;
} 

.game__title {
    font-family: 'Playfair';
    font-size: 50px;
    font-weight: 400;
    font-style: italic;
    line-height: 130%;
    text-align: center;
    color: var(--base-color-green);
    margin: 0;
}

.game__description {
    max-width: 700px;
    font-size: 20px;
    font-weight: 600;
    line-height: 140%;
    text-align: center;
    color: var(--base-color-green);
    margin: 21px auto 0;
}

.game-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 53px 0 0 0;
    position: relative;
}

.game-card-list::before {
    position: absolute;
    content: '';
    width: 560px;
    height: 588px;
    top: -295px;
    right: -380px;
    background: url(../img/game-clicker.png) 0 0 / 100% no-repeat;
    z-index: 0;
}

.game-card {
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
}

.game-card__front {
    background-color: #8A0113;
    background-repeat: no-repeat;
    background-position: center;

    transform: rotateY(0deg);
    transform-style: preserve-3d;
    }

.game-card__front, 
.game-card__back {
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    backface-visibility: hidden;
    height: 240px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-card__back {
    background-color: #8A0113;

    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;

    transform: rotateY(180deg);
    transform-style: preserve-3d;

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.game-card.js-flipped .game-card__back {
    transform: rotateY(0deg);
}

.game-card.js-flipped .game-card__front {
    transform: rotateY(-180deg);
}


.game-card[data-value="card-1"] .game-card__back {
    background-image: url(../img/game/game-card-1.png);
}

.game-card[data-value="card-2"] .game-card__back {
    background-image: url(../img/game/game-card-2.png);
}

.game-card[data-value="card-3"] .game-card__back {
    background-image: url(../img/game/game-card-3.png);
}

.game-card[data-value="card-4"] .game-card__back {
    background-image: url(../img/game/game-card-4.png);
}

.game-card[data-value="card-5"] .game-card__back {
    background-image: url(../img/game/game-card-5.png);
}

.game-card[data-value="card-6"] .game-card__back {
    background-image: url(../img/game/game-card-6.png);
}

/* Popup */
.game-overlay {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    backdrop-filter: blur(4px);
    background-color: rgba(247, 232, 206, 0.8);
}

.game-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #294920;
    width: calc(100% - 20px);
    max-width: 1180px;
    padding: 40px;
    z-index: 100;
    border-radius: 20px;
}

.game-popup__close {
    background-color: transparent;
    width: 20px;
    height: 20px;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 40px;
    top: 25px;
}

.game-popup__close svg {
    stroke: #F7E8CE;
}

.game-popup__text {
    max-width: 600px;
    font-size: 20px;
    font-weight: 600;
    line-height: 140%;
    text-align: center;
    color: var(--base-color-beige);
    margin: 20px auto;
}

.ny-bow {
    top: -332px;
    position: absolute;
    z-index: 2;
}

.ny-bow:nth-of-type(1) {
    left: -33px;
}

.ny-bow:nth-of-type(2) {
    left: 20%;
}

.ny-bow:nth-of-type(3) {
    left: 40%;
}
.ny-bow:nth-of-type(4) {
    left: 63%;
}

.ny-bow:nth-of-type(5) {
    right: -56px;
}

@media(max-width: 1180px) {
    .game__title {
        max-width: 600px;
        margin: 0 auto;
    }

    .game-card-list::before {
        width: 459px;
        height: 488px;
        top: -242px;
        right: -177px;
    }
}

@media(max-width: 1024px) {
    .game-card-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .game-card-list::before {
        right: -206px;
    }

    .game-card__front, 
    .game-card__back {
        height: 220px;
    }

    .ny-bow {
        max-width: 185px;
        top: -311px;
    }

    .ny-bow:nth-of-type(2) {
        left: 19%;
    }
}

@media(max-width: 767px) {
    .game {
        padding: 134px 0 0 0;
    }

    .game__title {
        font-size: 28px;
        font-weight: 500;
        line-height: 120%;
        text-align: left;
    }

    .game__description {
        max-width: 250px;
        font-size: 16px;
        text-align: left;
        margin: 20px 0 0;
    }

    .game-card-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        margin: 22px 0 0 0;
    }

    .game-card-list::before {
        width: 285px;
        height: 296px;
        top: -145px;
        right: -140px;
    }

    .game-card__front, 
    .game-card__back {
        height: 100px;
    }

    .game-card .decor {
        width: 52px;
        height: 12px;
        stroke-width: 4px;
    }

    .ny-bow {
        max-width: 114px;
        top: -167px;
    }

    .ny-bow:nth-of-type(1) {
        left: 6px;
    }

    .ny-bow:nth-of-type(2) {
        left: 50%;
        transform: translate(-50%, 0);
    }

    .ny-bow:nth-of-type(3) {
        left: auto;
        right: 0;
    }

    .ny-bow:nth-of-type(4),
    .ny-bow:nth-of-type(5) {
        display: none;
    }
}