:root {
    --primary-color: #3d99f5; /* Blue for buttons */
    --secondary-color: #e0f2fe; /* Light blue for pre-filled cells */
    --background-color: #f9f9f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent-color: #bfdbfe;
    --solved-color: #d1e7dd; /* Light green for user input cells */
    --error-color: #fee2e2; /* Red for invalid inputs */
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.button_primary {
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.375rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    transition: background-color 0.2s;
}

.button_primary:hover {
    background-color: #2563eb;
}

.button_primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.button_difficulty {
    background-color: #6b7280; /* Gray for difficulty buttons */
    color: white;
    border-radius: 0.375rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    transition: background-color 0.2s;
}

.button_difficulty:hover {
    background-color: #4b5563;
}

.button_difficulty.active {
    background-color: var(--primary-color);
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 3px solid var(--text-primary);
    aspect-ratio: 1;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 8px;
    background-color: white;
}

.sudoku-cell {
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.sudoku-cell input {
    width: 100%;
    height: 100%;
    text-align: center;
    border: none;
    background-color: transparent;
    font-size: 1.25rem;
    color: var(--text-primary);
    padding: 0.25rem;
    box-sizing: border-box;
}

.sudoku-cell input:focus {
    outline: none;
    background-color: var(--solved-color); /* Light green for user input focus */
}

.sudoku-cell input[readonly] {
    background-color: var(--secondary-color); /* Light blue for pre-filled cells */
    cursor: default;
}

.sudoku-cell input.user-input {
    background-color: var(--solved-color); /* Persistent light green for user inputs */
}

.sudoku-cell input.error {
    background-color: var(--error-color);
}

.sudoku-cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 2px solid var(--text-primary);
}

.sudoku-grid > div:nth-child(n+28):nth-child(-n+36),
.sudoku-grid > div:nth-child(n+55):nth-child(-n+63) {
    border-top: 2px solid var(--text-primary);
}

.timer {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 1rem;
    text-align: center;
}
