* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, sans-serif;
    background: #f2f2f2;
    padding: 16px;
}

.container {
    max-width: min(720px, 95vw);
    margin: 0 auto;
    text-align: center;
}

h1 {
    font-size: 2rem;
    background-color: green;
    color: white;
    padding: 15px 0;
    border-radius: 5px;
    width: 75%;
    margin: auto;
    margin-bottom: 16px;
}

.controls {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.controls button {
    padding: 8px 30px;
    font-size: 2rem;
    cursor: pointer;
    font-weight: bold;
}

/* button colors */
#solve {
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 5px;
}

#solve:hover {
    background-color: #218838;
}

#clear {
    background-color: #ff7043;
    color: #fff;
    border: none;
    border-radius: 5px;
}

#clear:hover {
    background-color: #f4511e;
}

.board-frame {
    display: inline-block;
    padding: 4px;
    background: black;
    padding-right: 8px;
    padding-bottom: 8px;
}

#board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #000;
    max-width: max-content;
    margin: 0 auto;
}

.cell {
    background: #fff;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.cell input {
    width: 100%;
    height: 100%;
    border: 0;
    text-align: center;
    font-size: 1.9rem;
    padding: 0;
    color: black;
    background: transparent;
}

/* user-filled value */
.user-input {
    color: red !important;
    font-weight: bold;
}

/* highlight background for same row/col */
.cell-highlight {
    background-color: #f0f8ff;
}

.conflict {
    background-color: #ffcccc !important;
}

/* thick borders around 3x3 boxes */
.thick-right {
    border-right: 4px solid black;
}

.thick-bottom {
    border-bottom: 4px solid black;
}

.thick-left {
    border-left: 4px solid black;
}

.thick-top {
    border-top: 4px solid black;
}