* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.memory-game {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-wrap: wrap;
}

.memory-card {
    width: calc(25% - 10px);
    height: calc(33.33% - 10px);
    margin: 5px;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
    position: relative;
    cursor: pointer;
}

.front-face,
.back-face {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backface-visibility: hidden;
}

.front-face {
    transform: rotateY(0.5turn);
}

.memory-card:active {
    transform: scale(0.97);
    transition: transform 0.15s ease-out;
}

.memory-card.flip {
    transform: rotateY(180deg) perspective(1000px);
}
