:root {
    --cell-size: 60px; /* Size of each cell */
    --cell-border-width: 1px; /* Border width of each cell */
    --board-gap: 2px; /* Gap between cells */
}

#sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-gap: var(--board-gap);
    margin: auto;
    padding: 10px;
    background-color: #f5f5f5;
    border: 3px solid #333;
    /* Calculate the width based on cell size, border, and gap */
    width: calc(9 * var(--cell-size) + 8 * var(--board-gap) + 18 * var(--cell-border-width));
}

.sudoku-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border: var(--cell-border-width) solid #ddd;
    text-align: center;
    font-size: 24px;
    line-height: var(--cell-size);
}



/* Highlight every 3rd row and column to distinguish 3x3 subgrids */
.sudoku-row:nth-child(3n) .sudoku-cell,
.sudoku-row .sudoku-cell:nth-child(3n) {
    border-right: 2px solid #333;
}

.sudoku-row:nth-child(3n) .sudoku-cell {
    border-bottom: 2px solid #333;
}

/* Style for the focused cell */
.sudoku-cell:focus {
    outline: none;
    background-color: #e0e0e0;
}

/* Optional: Responsive adjustments */
@media (max-width: 500px) {
    .sudoku-cell {
        width: 40px;
        height: 40px;
        font-size: 18px;
        line-height: 40px;
    }
}