.minesweeper-board {
    display: inline-grid;
    gap: 1px;
    background: #999;
    border: 3px solid #999;
    padding: 0;
    margin: 0 auto;
    user-select: none;
    max-width: 100%;
    overflow-x: auto;
}

#gameBoard {
    width: 100%;
    overflow-x: auto;
    text-align: center;
}

.minesweeper-cell {
    width: 30px;
    height: 30px;
    background: #ddd;
    border: 2px outset #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s;
}

.minesweeper-cell:hover:not(.revealed):not(.flagged) {
    background: #eee;
}

.minesweeper-cell:active:not(.revealed):not(.flagged) {
    border-style: inset;
}

.minesweeper-cell.revealed {
    background: #ccc;
    border: 1px solid #999;
    cursor: default;
}

.minesweeper-cell.flagged {
    background: #ffd700;
}

.minesweeper-cell.mine {
    background: #ff4444;
}

.minesweeper-cell.mine-wrong {
    background: #ffaa44;
}

/* Number colors */
.minesweeper-cell[data-count="1"] { color: #0000ff; }
.minesweeper-cell[data-count="2"] { color: #008000; }
.minesweeper-cell[data-count="3"] { color: #ff0000; }
.minesweeper-cell[data-count="4"] { color: #000080; }
.minesweeper-cell[data-count="5"] { color: #800000; }
.minesweeper-cell[data-count="6"] { color: #008080; }
.minesweeper-cell[data-count="7"] { color: #000000; }
.minesweeper-cell[data-count="8"] { color: #808080; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .minesweeper-cell {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .minesweeper-cell {
        width: 20px;
        height: 20px;
        font-size: 10px;
        border-width: 1px;
    }
}

/* Dark mode */
[data-bs-theme="dark"] .minesweeper-cell {
    background: #444;
    border-color: #666;
}

[data-bs-theme="dark"] .minesweeper-cell:hover:not(.revealed):not(.flagged) {
    background: #555;
}

[data-bs-theme="dark"] .minesweeper-cell.revealed {
    background: #333;
    border-color: #555;
}

[data-bs-theme="dark"] .minesweeper-cell.flagged {
    background: #b8860b;
}

[data-bs-theme="dark"] .minesweeper-cell.mine {
    background: #cc0000;
}

[data-bs-theme="dark"] .minesweeper-cell.mine-wrong {
    background: #cc7700;
}

/* Emoji icons */
.minesweeper-cell.mine,
.minesweeper-cell.flagged {
    font-size: 16px;
    line-height: 1;
}

@media (max-width: 768px) {
    .minesweeper-cell.mine,
    .minesweeper-cell.flagged {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .minesweeper-cell.mine,
    .minesweeper-cell.flagged {
        font-size: 12px;
    }
}

/* Fullscreen mode */
#minesweeperGame.fullscreen-mode {
    background: var(--bs-body-bg);
    padding: 20px;
    overflow-y: auto;
}

#minesweeperGame.fullscreen-mode .card {
    margin-bottom: 1rem;
}

#minesweeperGame.fullscreen-mode #gameBoard {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 400px);
}

#minesweeperGame.fullscreen-mode .minesweeper-board {
    margin: 0 auto;
}

/* Dark mode fullscreen */
[data-bs-theme="dark"] #minesweeperGame.fullscreen-mode {
    background: var(--bs-body-bg);
}
