:root {
    --bg:            #ffffff;
    --card:          #ffffff;
    --text:          #28282a;
    --given:         #404040;
    --accent:        #ff8000;
    --accent-light:  #ffb061;
    --selected:      #ff8000;
    --highlight:     #fff3e6;
    --conflict:      #d32f2f;
}

.sudoku-wrapper {
    text-align: center;
    margin: 30px auto;
    max-width: 500px;
    font-family: 'Times New Roman', Times, serif;
}

.sudoku-wrapper h1 {
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 2rem;
    color: #404040;
}

.sudoku-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.sudoku-controls button {
    background: #ff8000;
    color: #ffffff;
    border: 2px solid #ff8000;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
}

.sudoku-controls button:hover {
    background: #e67300;
    border-color: #e67300;
}

#sudoku-status {
    margin: 8px 0 14px;
    min-height: 24px;
    font-weight: 500;
    font-size: 1.1rem;
}

.board-wrapper {
    display: inline-block;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
/*     border: 2px solid #ff8000; */
/*     box-shadow: 0 4px 12px rgba(0,0,0,0.08); */
}

#board {
    display: grid;
    grid-template-columns: repeat(9, 50px);
    grid-template-rows: repeat(9, 50px);
    border: 2px solid #ff8000;
}

.cell {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-weight: 600;
    border: 1px solid #ddd;
    cursor: pointer;
    user-select: none;
    background: #fff;
    color: #28282a;
    transition: background 0.1s;
}

.cell.given {
    color: #404040;
    font-weight: 700;
    cursor: default;
    background: #fafafa;
}

.cell.selected {
    background: #ff8000 !important;
    color: #ffffff !important;
}

.cell.highlight {
    background: #fff3e6;
}

.cell.conflict {
    color: #d32f2f !important;
}

.cell:nth-child(3n) {
    border-right: 2px solid #ff8000;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid #ff8000;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 22px auto 0;
    max-width: 320px;
}

.numpad button {
    height: 56px;
    font-size: 22px;
    font-weight: 600;
    border-radius: 8px;
    background: #ffffff;
    border: 2px solid #ff8000;
    color: #28282a;
    cursor: pointer;
    font-family: inherit;
}

.numpad button:hover {
    background: #ffb061;
}

.numpad button.erase {
    font-size: 24px;
}

@media (max-width: 520px) {
    #board {
        grid-template-columns: repeat(9, 38px);
        grid-template-rows: repeat(9, 38px);
    }
    .cell {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .numpad {
        max-width: 280px;
    }
    .numpad button {
        height: 48px;
        font-size: 20px;
    }
}
