.game {
    width: 100%;
    /* max-width: 800px; */
    margin: 0 auto;
    min-height: 100%;
    height: 100%;
    padding: 0 20px;
}

.card {
    float: left;
    width: 20%;
    height: 25%;
    padding: 5px;
    text-align: center;
    display: block;
    perspective: 500px;
    position: relative;
    cursor: pointer;
    z-index: 50;
}

@media(max-width:800px) {
    .card {
        width: 25%;
        height: 20%;
    }
}

.card .inside {
    width: 100%;
    height: 100%;
    display: block;
    transform-style: preserve-3d;
    transition: .4s ease-in-out;
    background: #fff;
}

.card .inside.picked,
.card .inside.matched {
    transform: rotateY(180deg);
}

.card .inside.matched {
    animation: matchAnim 1s ease-in-out .4s both;
}

@keyframes matchAnim {
    0% {
        background-color: #bcffcc;
    }

    100% {
        background-color: #ffffff;
    }
}

.card .front,
.card .back {
    border: 1px solid #000;
    backface-visibility: hidden;
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card .front img,
.card .back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.back img {
    content: url("../img/back.png");
}

.card .front {
    transform: rotateY(-180deg);
}