body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.difficulty-selector {
    margin-bottom: 15px;
}

.difficulty-selector button {
    padding: 8px 15px;
    margin: 0 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.difficulty-selector button:hover {
    background-color: #45a049;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 450px;
    margin-bottom: 10px;
    background-color: #d0d0d0;
    padding: 10px;
    border: 2px solid #808080;
    border-radius: 5px;
    box-sizing: border-box;
}

.mine-count, .timer {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    background-color: #000;
    color: #f00;
    padding: 5px 10px;
    border: 2px inset #808080;
    min-width: 60px;
    text-align: center;
}

.reset-button {
    width: 40px;
    height: 40px;
    font-size: 24px;
    background-color: #d0d0d0;
    border: 2px outset #808080;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.reset-button:hover {
    background-color: #c0c0c0;
}

.sound-toggle {
    width: 40px;
    height: 40px;
    font-size: 24px;
    background-color: #d0d0d0;
    border: 2px outset #808080;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sound-toggle:hover {
    background-color: #c0c0c0;
}

.board {
    display: grid;
    grid-template-columns: repeat(9, 30px);
    grid-template-rows: repeat(9, 30px);
    gap: 1px;
    background-color: #808080;
    border: 2px solid #808080;
    padding: 2px;
    max-width: 100%;
    overflow: auto;
}

.cell {
    width: 30px;
    height: 30px;
    background-color: #c0c0c0;
    border: 2px outset #d0d0d0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.cell:hover {
    background-color: #b0b0b0;
}

.cell.revealed {
    background-color: #d0d0d0;
    border: 1px solid #808080;
}

.cell.mine {
    background-color: #ff0000;
}

.cell.flagged::after {
    content: "🚩";
}

.cell.question::after {
    content: "?";
}

.number-1 { color: blue; }
.number-2 { color: green; }
.number-3 { color: red; }
.number-4 { color: darkblue; }
.number-5 { color: darkred; }
.number-6 { color: teal; }
.number-7 { color: black; }
.number-8 { color: gray; }

.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    z-index: 1000;
}

.win-message.hidden {
    display: none;
}

/* Responsive design */
@media (max-width: 600px) {
    .board {
        grid-template-columns: repeat(9, 25px);
        grid-template-rows: repeat(9, 25px);
    }
    
    .cell {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }
    
    .game-header {
        max-width: 320px;
    }
    
    .mine-count, .timer {
        font-size: 20px;
        min-width: 50px;
    }
    
    .reset-button {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}