:root {
    --border-color: #333;
    --light-border: #ccc;
    --bg-fixed: #f0f0f0;
    --text-fixed: #333;
    --text-input: #0056b3;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fafafa;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.game-container {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

h1 {
    margin-top: 0;
    color: #222;
}

.controls {
    margin-bottom: 20px;
}

select, button {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin: 0 5px;
    cursor: pointer;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    transition: background 0.2s;
}

button:hover {
    background-color: #0056b3;
}

#check-btn {
    background-color: #28a745;
}

#check-btn:hover {
    background-color: #218838;
}

/* 9x9 Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(9, 45px);
    grid-template-rows: repeat(9, 45px);
    gap: 0;
    border: 3px solid var(--border-color);
    margin: 0 auto;
    width: max-content;
}

/* Cell Styling */
.cell {
    width: 45px;
    height: 45px;
    text-align: center;
    font-size: 18px;
    border: 1px solid var(--light-border);
    box-sizing: border-box;
    outline: none;
}

/* Thicker borders for 3x3 boxes */
.cell:nth-child(3n) {
    border-right: 2px solid var(--border-color);
}
.cell:nth-child(9n) {
    border-right: none; /* Keeps outer border clean */
}
.grid > input:nth-child(27n),
.grid > input:nth-child(54n) {
    border-bottom: 2px solid var(--border-color);
}

/* Styling for starting numbers vs user inputs */
.cell.fixed {
    background-color: var(--bg-fixed);
    color: var(--text-fixed);
    font-weight: bold;
}

.cell:not(.fixed) {
    color: var(--text-input);
}

/* Hide spin buttons on number inputs */
.cell::-webkit-outer-spin-button,
.cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.message {
    margin-top: 15px;
    font-weight: bold;
    font-size: 16px;
    min-height: 24px;
}

.success { color: #28a745; }
.error { color: #dc3545; }