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

.game-container {
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

.game-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.mine-counter {
    font-size: 1rem;
    font-weight: bold;
    color: #2f4f4f;
    display: flex;
    align-items: center;
}

.label {
    color: #2f4f4f;
    margin-right: 5px;
}

.game-button {
    background-color: #b0c4de;
    color: #2f4f4f;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
}

.game-button:hover {
    background-color: #9fb8d9;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-auto-rows: 1fr;
    gap: 0;
    background: #000;
    border: 2px solid #000;
    max-width: 600px;
    margin: 0 auto 20px;
    aspect-ratio: 1;
}

.cell {
    background: #ddd;
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    user-select: none;
    transition: all 0.1s;
    min-height: 0;
}

.cell:hover {
    background: #ccc;
}

.cell.revealed {
    background: white;
    border: 1px solid #000;
    cursor: default;
}

.cell.revealed:hover {
    background: white;
}

.cell.flagged {
    background: #ffeb3b;
    color: #d32f2f;
    font-weight: bold;
}

.cell.mine {
    background: #f44336;
    color: white;
}

.cell.exploded {
    background: #d32f2f;
    color: white;
    animation: explode 0.3s ease-out;
}

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

/* Number colors inspired by Sudoku */
.cell.num-1 { color: #2196f3; }
.cell.num-2 { color: #4caf50; }
.cell.num-3 { color: #f44336; }
.cell.num-4 { color: #9c27b0; }
.cell.num-5 { color: #ff9800; }
.cell.num-6 { color: #607d8b; }
.cell.num-7 { color: #795548; }
.cell.num-8 { color: #e91e63; }

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.overlay-content h2 {
    margin-bottom: 15px;
    color: #333;
}

.overlay-content p {
    margin-bottom: 20px;
    color: #666;
}

.win-overlay {
    color: #4caf50;
}

.lose-overlay {
    color: #f44336;
}