/* 记忆翻牌游戏样式 */
.game-container {
    padding: 2rem 0 4rem;
}

.game-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #343a40;
}

.game-info {
    max-width: 600px;
    margin: 0 auto 2rem;
    text-align: center;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.stat {
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-weight: bold;
    margin-right: 0.5rem;
}

#restart-button {
    background-color: #6c757d;
    margin-left: 0.5rem;
}

#restart-button:hover {
    background-color: #5a6268;
}

.memory-game {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    perspective: 1000px;
}

.memory-card {
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.memory-card.matched {
    transform: rotateY(180deg);
    box-shadow: 0 0 5px 2px rgba(46, 204, 113, 0.5);
}

.front-face, .back-face {
    width: 100%;
    height: 100%;
    padding: 10px;
    position: absolute;
    border-radius: 5px;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.front-face {
    background-color: white;
    transform: rotateY(180deg);
}

.back-face {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
}

.memory-card i {
    font-size: 2.5rem;
}

#game-complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    z-index: 10;
}

.complete-message {
    text-align: center;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.complete-message h3 {
    font-size: 2rem;
    color: #343a40;
    margin-bottom: 1rem;
}

.complete-message p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#play-again {
    margin-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 576px) {
    #game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .memory-card {
        height: 100px;
    }
    
    .memory-card i {
        font-size: 2rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}