
/* Memory */

:root {
    --card-color: #fff;
}

.memory-wrapper {
    height: 460px;
    width: 400px;
    padding: 25px;
    background: #f8f8f8;
    border-radius: 10px;
    display: flex;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    flex-direction: column;
}

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

.cards {
    height: 100%;
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
}

.cards .card {
    cursor: pointer;
    position: relative;
    perspective: 800px;
    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: var(--card-color);
    border-radius: 7px;
    backface-visibility: hidden;
    transition: transform 0.25s linear;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

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

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

.card .back-view img {
    max-width: 45px;
}

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

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

.hidden img {
    visibility: hidden;
}

/* ------------------- */ 

.memory-header {
    width: 400px;
    height: 60px;
    background-color: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    width: 100%;
    margin-top: auto;
    margin-top: 20px;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
