@import url('https://fonts.googleapis.com/css2?family=SUSE:wght@100..800&display=swap');

*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'SUSE', sans-serif;
}

p{
    font-size: 20;
}

body{
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: palegreen;
}

.wrapper{
    padding: 25px;
    background: blueviolet;
    border-radius: 10px;
    box-shadow: 0 10px 30px black;
}

.cards, .card, .view, .details, p{
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards{
    height: 350px;
    width: 350px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.cards .card{
    cursor: pointer;
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
    height: calc(100% / 4 - 10px);
    width: calc(100% / 4 - 10px);
}

.card.shake{
    animation: shake 0.35s ease-in-out;
}

@keyframes shake{
    0%, 100%{
        transform: translateX(0);
    }
    20%{
        transform: translateX(-13px);
    }
    40%{
        transform: translateX(13px);
    }
    60%{
        transform: translateX(-8px);
    }
    80%{
        transform: translateX(8px);
    }
}

.cards .card .view{
    width: 100%;
    height: 100%;
    user-select: none;
    pointer-events: none;
    position: absolute;
    background: white;
    border-radius: 10px;
    backface-visibility: hidden;
    transition: transform 0.25s linear;
    box-shadow: 0 3px 10px black;
}

.card .front-view i{
    font-size: 40px;
}

.card .back-view i{
    font-size: 40px;
}

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

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

.card.flip .back-view{
    transform: rotateY(0deg);
}

.details{
    width: 100%;
    margin-top: 15px;
    padding: 0 20px;
    background: white;
    border-radius: 10px;
    height: calc(100% / 4 - 30px);
    justify-content: space-between;
}

.details p{
    font-size: 18px;
    height: 17px;
    padding-right: 18px;
    border-right: 1px solid ghostwhite;
}

.details p span{
    margin-left: 8px;
}

.details p b{
    font-weight: 500;
}

.details button{
    cursor: pointer;
    font-size: 14px;
    color: blueviolet;
    border-radius: 4px;
    padding: 4px 11px;
    background: azure;
    border: 2px solid blueviolet;
    transition: 0.3s ease;
}

.details button:hover{
    color: azure;
    background: blueviolet;
}

::selection{
    color: azure;
    background: blueviolet;
}

@media screen and (max-width: 700px) {
    .cards{
        height: 350px;
        width: 350px;
    }
    .card .front-view i{
        font-size: 35px;
    }
    .card .back-view i{
        font-size: 35px;
    }
}

@media screen and (max-width: 530px) {
    .cards{
        height: 300px;
        width: 300px;
    }
    .card .back-view i{
        font-size: 30px;
    }
    .details{
        margin-top: 10px;
        padding: 0 15px;
        height: calc(100% / 4 - 20px);
    }
    .details p{
        height: 15px;
        font-size: 17px;
        padding-right: 13px;
    }
    .details button{
        font-size: 13px;
        padding: 5px 10px;
        border: none;
        color: azure;
        background: blueviolet;
    }
}