@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

* {
    font-family: 'Roboto', sans-serif;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: #c192d6;
    color: white;
}

main {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
    justify-items: center;
}

.card {
    border: 1px solid #a51be3;
    background-color: #a51be3;
    background-size: cover;
    background-position: center;

    width: 100%;
    aspect-ratio: 1 / 1;

    border-radius: 10px;
    transition: transform 0.2s;
    transform: rotate3d(0, 1, 0, 0deg);
    cursor: pointer;
}

.card:hover {
    transform: rotate3d(0, 1, 0, 20deg);
}

.card.clicked {
    transform: rotate3d(0, 1, 0, 180deg);
}

.matched {
    border: 3px solid #4CAF50;
}

button {
    border: none;
    background-color: #a51be3;
    color: white;
    padding: 15px 30px;
    margin-top: 30px;
    font-size: 1.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #8e15c4;
}

@media (max-width: 600px) {
    .cards {
        gap: 8px;
        max-width: 100%;
    }

    * {
        font-size: 8rem;
    }

    button {
        width: 100%;
        padding: 15px;
        font-size: 5rem;
    }
}

@keyframes anim {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(200px);
    }
    100% {
        transform: translateY(0);
    }
}

.anim {
    animation: anim 2s ease-in-out;
}