.game-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    margin: 20px auto;
    max-width: 800px;
    width: 95%;
}
.nav-back {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.nav-back:hover {
    color: var(--text-primary);
}
.nav-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 16px 24px;
    margin-bottom: 24px;
}
.stat-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-color);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}
.stat-value {
    font-family: monospace;
    font-size: 1.5rem;
    color: var(--danger-color);
    font-weight: 800;
}
select#difficulty-select {
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
}

.board-wrapper {
    position: relative;
    padding: 24px;
    background: var(--surface-color);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    max-width: 100%;
}
.board {
    display: grid;
    gap: 2px;
    background: var(--glass-border);
    border: 2px solid var(--glass-border);
}

.cell {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    background-color: #334155; /* Slate 700 - Hidden cell */
    border: 2px outset #64748b; /* Slate 500 */
    transition: background-color 0.1s;
}

.cell:hover:not(.revealed) {
    background-color: #475569;
}

.cell.revealed {
    background-color: #1e293b; /* Slate 800 */
    border: 1px solid #0f172a;
    cursor: default;
}

.cell.mine {
    background-color: transparent;
}
.cell.exploded {
    background-color: var(--danger-color) !important;
}
.cell.flagged {
    /* flag icon added via content in js, but styling here */
}

/* Number colors for 1-8 based on typical minesweeper */
.cell[data-value="1"] { color: #38bdf8; } /* Light Blue */
.cell[data-value="2"] { color: #10b981; } /* Green */
.cell[data-value="3"] { color: #ef4444; } /* Red */
.cell[data-value="4"] { color: #818cf8; } /* Indigo */
.cell[data-value="5"] { color: #a855f7; } /* Purple */
.cell[data-value="6"] { color: #14b8a6; } /* Teal */
.cell[data-value="7"] { color: #f59e0b; } /* Orange */
.cell[data-value="8"] { color: #fbbf24; } /* Amber */

.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.85); /* Slate 900 */
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 14px;
}
.overlay.hidden {
    display: none;
}
.overlay h2 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: 800;
}
.overlay p {
    font-size: 1.2rem;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
