* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.game-title {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    background-color: #f0f0f0;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.info-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.game-container {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    width: 100%;
    aspect-ratio: 4/3;
    margin: 0 auto;
    max-width: 600px;
}

.card {
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card.selected {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.card.matched {
    background-color: #4CAF50;
    border-color: #45a049;
    animation: matchAnimation 0.5s ease-in-out;
    cursor: default;
}

.card.hidden {
    background-color: #ddd;
    cursor: default;
    opacity: 0.5;
}

@keyframes matchAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(0); opacity: 0; }
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-instructions {
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 15px;
    text-align: left;
}

.game-instructions h3 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.game-instructions ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #666;
    line-height: 1.6;
}

.game-instructions li {
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .game-board {
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(6, 1fr);
        gap: 3px;
    }
    
    .card {
        font-size: 1.5em;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .info-item {
        padding: 8px 12px;
    }
    
    .info-value {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5em;
    }
    
    .game-board {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
    
    .card {
        font-size: 1.2em;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
        min-width: 80px;
    }
}