/* Wrapper */
.sudoku-wrapper {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.sudoku-game {
    width: 100%;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-screen {
    background: #0f0f18;
    border-radius: 14px;
    padding: 15px;
    box-shadow: 0 0 25px rgba(124, 77, 255, .25);
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* Sudoku Board */
#sudokuBoard {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(9, 1fr);
    width: 70%;
}

/* Cells */
.cell {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(14px, 2vw, 22px);
    border-radius: 6px;
    background: #1e1e2f;
    cursor: pointer;
    transition: .15s;
    position: relative;
}

.cell:hover { background: #2a2a40; }
.cell.prefilled { color: #7c4dff; cursor: default; font-weight: bold; }
.cell.user { color: #00d26a; }
.cell.invalid { color: #ff4c4c; }
.cell.selected { outline: 2px solid #ff7a00; }

/* Highlight row/col/box */
.cell.highlight { background: rgba(124,77,255,0.2); }

/* Sidebar numbers */
#numberSidebar {
    width: 30%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

#numberSidebar .numberBtn {
    background: #7c4dff;
    color: #fff;
    border-radius: 6px;
    text-align: center;
    font-size: 18px;
    cursor: pointer;
    padding: 10px;
}

#numberSidebar .numberBtn:active { background: #ff7a00; }

/* Buttons */
.game-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.game-btn.primary { background: #7c4dff; color: white; }
.game-btn.secondary { background: #1f1f2f; color: white; border: 1px solid #7c4dff; }

/* Overlay */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.9);
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transition: .25s;
}
.overlay.active { opacity:1; pointer-events:auto; }

/* Difficulty buttons */
.difficulty-group { display: flex; gap: 12px; margin-top: 10px; }

/* Mobile */
@media(max-width:600px) {
    .game-screen { flex-direction: column; }
    #sudokuBoard { width: 100%; }
    #numberSidebar { width: 100%; grid-template-columns: repeat(9, 1fr); }
}