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

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

.game-wrapper {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.game-header p {
    color: #666;
    font-size: 1.1em;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.difficulty-selector {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #2196F3;
    background: white;
    color: #2196F3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover {
    background: #e3f2fd;
}

.difficulty-btn.active {
    background: #2196F3;
    color: white;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    color: #333;
    font-size: 28px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.game-board {
    display: grid;
    gap: 2px;
    background: #999;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.cell {
    width: 35px;
    height: 35px;
    background: #c0c0c0;
    border: 3px solid;
    border-color: #fff #808080 #808080 #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
}

.cell:hover:not(.revealed):not(.flagged) {
    background: #d0d0d0;
}

.cell.revealed {
    background: #bdbdbd;
    border: 1px solid #999;
}

.cell.mine {
    background: #ff5252;
}

.cell.flagged {
    background: #ffd54f;
}

.cell.mine-exploded {
    background: #ff1744;
    border: 2px solid #b71c1c;
}

/* 数字颜色 */
.cell[data-value="1"] { color: #0000ff; }
.cell[data-value="2"] { color: #008000; }
.cell[data-value="3"] { color: #ff0000; }
.cell[data-value="4"] { color: #000080; }
.cell[data-value="5"] { color: #800000; }
.cell[data-value="6"] { color: #008080; }
.cell[data-value="7"] { color: #000000; }
.cell[data-value="8"] { color: #808080; }

.game-message {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    min-height: 50px;
}

.game-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.game-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.game-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.game-instructions {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.game-instructions h3 {
    color: #333;
    margin-bottom: 15px;
}

.game-instructions ul {
    list-style: none;
    padding-left: 0;
}

.game-instructions li {
    color: #666;
    margin-bottom: 8px;
    padding-left: 25px;
    position: relative;
}

.game-instructions li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #2196F3;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .game-wrapper {
        padding: 20px;
    }

    .game-header h1 {
        font-size: 2em;
    }

    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .difficulty-selector {
        justify-content: center;
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}
