.memory-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 120px;
}

.stack-wrapper {
    position: relative;
    width: 250px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memory-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    padding: 10px 10px 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s;
    user-select: none;

    /* Stacking effect based on index --i */
    transform: rotate(calc(var(--i) * 3deg)) translateY(calc(var(--i) * -10px));
    z-index: calc(10 - var(--i));
}

.card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.img-box {
    flex: 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    margin-bottom: 15px;
    border-radius: 3px;
    overflow: hidden;
    /* Ensure image doesn't bleed out */
}

.memory-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.red-glow {
    border: 2px solid var(--primary);
}

.black-glow {
    border: 2px solid #000;
}

.card-text {
    font-family: 'Dancing Script', cursive;
    color: #111;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 700;
}

/* "Throw away" animation */
.memory-card.away {
    transform: translateX(150%) rotate(45deg) scale(0.8);
    opacity: 0;
    pointer-events: none;
}

.hint-text {
    margin-top: 50px;
    text-align: center;
    color: var(--text-light);
    animation: pulse 2s infinite;
}

.hint-text i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--primary);
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@media (max-width: 600px) {
    .stack-wrapper {
        width: 220px;
        height: 280px;
    }
}