body{
    background-image: url(img/pexels-miriam-espacio-110854.jpeg);
    background-color: black;
    height: 100vh;
}

h1{
    text-align: center;
    padding:40px 0 20px 0;
}

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

.memoryGame{
    width: 800px;
    height: 530px;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    perspective: 1000px;
}

.card{
    width: calc(16.666% - 10px);
    height: calc(25% - 10px);
    margin:5px;
    position: relative;
    transform: scale(1); /*original size*/
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

@media only screen and (max-width: 992px) {
    .memoryGame{
        width: 600px;
        height: 600px;
    }
    .card{
        width: calc(25% - 10px);
        height: calc(16.666%- 10px);
    }
}

@media only screen and (max-width: 600px) {
    .memoryGame{
        width: 350px;
        height: 350px;
    }
    .card{
        width: calc(25% - 10px);
        height: calc(16.666%- 10px);
    }
    h1 img{
        width: 400px;
    }
}


.card:active{
    transform: scale(0.97);
    transition: transform .2s;
}

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

.back{
    transform: rotateY(180deg);
}

.back,
.front{
    width: 100%;
    height: 100%;
    padding: 10px;
    position: absolute;
    border-radius: 5px;
    background-color: lightgrey;
    backface-visibility: hidden;
}
