/* 记忆翻牌游戏专用样式 */

.game-container {
    min-height: calc(100vh - 200px);
    padding: 40px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 40px;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.game-header h1 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.game-header h1 i {
    font-size: 40px;
}

.game-description {
    font-size: 18px;
    color: var(--gray-color);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.stat {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: var(--transition);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
}

#timer {
    color: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.difficulty-select {
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    font-size: 16px;
    font-family: 'Noto Sans SC', sans-serif;
    background-color: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.difficulty-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.3);
}

/* 游戏区域 */
.game-area {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    margin-bottom: 40px;
}

.memory-board {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    justify-items: center;
    align-items: center;
    min-height: 400px;
}

.memory-card {
    width: 100%;
    height: 100px;
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.memory-card-front {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.memory-card-back {
    background-color: white;
    color: var(--dark-color);
    transform: rotateY(180deg);
    border: 3px solid var(--primary-color);
}

.memory-card.matched .memory-card-back {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.memory-card i {
    font-size: 32px;
}

.game-instructions {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.game-instructions h3 {
    font-size: 24px;
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-instructions ul {
    list-style: none;
    margin-bottom: 25px;
}

.game-instructions li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-instructions li:last-child {
    border-bottom: none;
}

.game-instructions li i {
    color: var(--primary-color);
    width: 20px;
}

.scoring-info {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.scoring-info h4 {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.scoring-info p {
    color: var(--gray-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 游戏结果 */
.game-result {
    background-color: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-content {
    max-width: 600px;
    margin: 0 auto;
}

.result-content h2 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.result-stat {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.result-label {
    display: block;
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 8px;
}

.result-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .game-area {
        grid-template-columns: 1fr;
    }
    
    .game-instructions {
        order: -1;
    }
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 28px;
    }
    
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 20px;
    }
    
    .memory-card {
        height: 80px;
    }
    
    .memory-card i {
        font-size: 24px;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .difficulty-select {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .game-stats {
        grid-template-columns: 1fr;
    }
    
    .memory-board {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .memory-card {
        height: 70px;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}

/* 困难模式样式 */
.memory-board.hard {
    grid-template-columns: repeat(6, 1fr);
}

.memory-board.hard .memory-card {
    height: 80px;
}

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

@media (max-width: 480px) {
    .memory-board.hard {
        grid-template-columns: repeat(3, 1fr);
    }
}