@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700&display=swap');

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

body {
    height: 90vh;
    background-color: linen;
    font-family: Manrope;
    color: #314455;
}

.title{
    display: flex;
    width: 100%;
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    justify-content: center;
    margin: 2rem 0;
}

.license {
    display: flex;
    width: 100%;
    font-size: 1rem;
    font-weight: 500;
    justify-content: center;
    margin-top: 2rem;
    white-space: pre;
}

.license a {
    color: #314455;
}

img {
    width: 4rem;
}

.memory-game {
    width: 50%;
    height: 75%;
    display: flex;
    flex-wrap: wrap;
    margin: auto;
    perspective: 1000px;
}

.memory-card {
    width: calc(20% - 10px);
    height: calc(25% - 10px);
    position: relative;
    margin: 5px;
    transform: scale(1);
    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    -o-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform .5s;
}

.memory-card:hover {
    cursor: pointer;
}

@media only screen and (max-width: 320px) {
    .memory-game {
        width: 80%;
    }
    .memory-card {
        width: calc(25% - 10px);
        height: calc(20% - 10px);
    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {
    .memory-game {
        width: 80%;
        height: 75%;
    }
    .memory-card {
        width: calc(25% - 10px);
        height: calc(20% - 10px);
    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .memory-game {
        width: 50%;
        height: 75%;
    }
    .memory-card {
        width: calc(25% - 10px);
        height: calc(20% - 10px);
    }
}

@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .memory-game {
        width: 80%;
        height: 75%;
    }
    .memory-card {
        width: calc(25% - 10px);
        height: calc(20% - 10px);
    }
}

.memory-card:active {
    transform: scale(.97);
    transition: transform .2s;
}

.front, .back {
    width: 100%;
    height: 100%;
    padding: 2rem;
    position: absolute;
    background: lightpink;
    border-radius: 10px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -ms-backface-visibility: visible;
}

.front {
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
    -ms-transform: rotateY(180deg);
    -o-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

.back {
    -webkit-transform: rotateY(0deg);
    -moz-transform: rotateY(0deg);
    -ms-transform: rotateY(0deg);
    -o-transform: rotateY(0deg);
    transform: rotateY(0deg);
}

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