/* Memory Card Game Section */
#memory {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 120px;
    min-height: 90vh;
    width: 100%;
}

.memory-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.memory-header {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 4px solid #d4af37;
    padding: 20px 40px;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.4);
    text-align: center;
}

.memory-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #f4e4b0;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    margin-bottom: 15px;
}

.memory-timer {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #d4af37;
    margin-top: 10px;
}

.memory-timer.warning {
    color: #ff6b6b;
    animation: pulse 0.5s infinite;
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 4px solid #d4af37;
    padding: 40px;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.4);
}

.memory-card {
    position: relative;
    width: 150px;
    height: 210px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    border-radius: 10px;
    perspective: 1000px;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    cursor: default;
}

.memory-card.matched .card-front {
    border-color: #90ee90;
    box-shadow: 0 0 30px rgba(144, 238, 144, 0.6);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid #d4af37;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
}

.card-back {
    background: linear-gradient(145deg, #3d2817, #2a1810);
    border: 3px solid #d4af37;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.2);
    position: absolute;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid #8b7355;
    border-radius: 5px;
}

.card-back::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #d4af37 0%, #8b7355 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.card-front {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #f5f5f0, #e8e8e0);
    border: 3px solid #d4af37;
    position: relative;
}

.card-symbol {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: bold;
    color: #000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.card-corner {
    position: absolute;
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: bold;
    color: #000;
}

.card-corner.top-left {
    top: 10px;
    left: 10px;
    /*transform: rotate(180deg);*/

}

.card-corner.bottom-right {
    bottom: 10px;
    right: 10px;
    /*transform: rotate(180deg);*/
}

.memory-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    padding: 40px 60px;
    border-radius: 10px;
    z-index: 100;
    text-shadow: 0 0 20px currentColor;
    animation: pulse 1.5s infinite;
    pointer-events: none;
    display: none;
}

.memory-result.victory {
    background: rgba(15, 80, 19, 0.95);
    color: #90ee90;
    border: 4px solid #90ee90;
    box-shadow: 0 0 40px rgba(144, 238, 144, 0.6);
}

.memory-result.defeat {
    background: rgba(139, 0, 0, 0.95);
    color: #ff6b6b;
    border: 4px solid #ff6b6b;
    box-shadow: 0 0 40px rgba(255, 107, 107, 0.6);
}

@media (max-width: 768px) {
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        padding: 20px;
    }

    .memory-card {
        width: 70px;
        height: 98px;
    }

    .card-symbol {
        font-size: 2rem;
    }

    .card-corner {
        font-size: 0.8rem;
    }
}
#memory {
    display: none;
}