body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    color: #333;
}

h1 {
    color: #1a2b4d;
}

#sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 40px);
    grid-template-rows: repeat(9, 40px);
    border: 3px solid #333;
    margin: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sudoku-cell {
    width: 40px;
    height: 40px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    border: 1px solid #ddd;
    box-sizing: border-box; /* Important */
    padding: 0;
    
    /* Remove arrows from number input */
    -moz-appearance: textfield;
}
.sudoku-cell::-webkit-outer-spin-button,
.sudoku-cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Add thicker borders for 3x3 boxes */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid #333;
}
.sudoku-cell:nth-child(9n) {
    border-right: 1px solid #ddd; /* Reset last one */
}
#sudoku-board tr:nth-child(3n) .sudoku-cell {
    border-bottom: 2px solid #333;
}
/* A bit tricky without row elements, let's use JS to add classes */
.row-start { border-top: 2px solid #333; }
.col-start { border-left: 2px solid #333; }

.sudoku-cell.given {
    background-color: #eee;
    color: #333;
    font-weight: bold;
}

.controls button {
    font-size: 1rem;
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
}
#solve-btn { background-color: #28a745; }
#check-btn { background-color: #ffc107; color: #333; }

#status-message {
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: bold;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 1rem;
    color: #007bff;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }