#sudoku {
	max-width: 30rem;
	margin: 0 auto;
}

.sudoku-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
}
.sudoku-difficulty,
.sudoku-mode {
	display: inline-flex;
	border: 1px solid #333;
	border-radius: 4px;
	overflow: hidden;
}
.sudoku-mode {
	display: flex;
	width: fit-content;
}
.sudoku-mode-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 1rem auto;
}
.sudoku-difficulty button,
.sudoku-mode button {
	padding: 0.4rem 0.9rem;
	font-size: 1rem;
	border: none;
	border-left: 1px solid #333;
	background: #fff;
	color: #666;
	cursor: pointer;
}
.sudoku-difficulty button:first-child,
.sudoku-mode button:first-child { border-left: none; }
.sudoku-difficulty button.active,
.sudoku-mode button.active {
	background: #333;
	color: #fff;
	font-weight: bold;
}
.sudoku-autonotes {
	padding: 0.4rem 0.9rem;
	font-size: 1rem;
	border: 1px solid #333;
	border-radius: 4px;
	background: #fff;
	color: #666;
	cursor: pointer;
}
.sudoku-autonotes.active {
	background: #333;
	color: #fff;
	font-weight: bold;
}
.sudoku-board {
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	grid-template-rows: repeat(9, 1fr);
	width: 100%;
	aspect-ratio: 1 / 1;
	border: 2px solid #333;
	box-sizing: border-box;
}

.sudoku-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #cfcfcf;
	font-size: clamp(1rem, 6vw, 1.6rem);
	line-height: 1;
	cursor: pointer;
	user-select: none;
	background: #fff;
	color: #1a4b8c;
}
.sudoku-cell.br { border-right: 2px solid #333; }
.sudoku-cell.bb { border-bottom: 2px solid #333; }
.sudoku-cell.given {
	color: #000;
	font-weight: bold;
	cursor: default;
}
.sudoku-cell.has-marks { padding: 0; }
.sudoku-marks {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(3, 1fr);
	width: 100%;
	height: 100%;
	font-size: clamp(0.5rem, 2.2vw, 0.75rem);
	line-height: 1;
	font-weight: normal;
	color: #888;
}
.sudoku-marks span {
	display: flex;
	align-items: center;
	justify-content: center;
}

.sudoku-cell.selected { background: #d7e8ff; }
.sudoku-cell.peer { background: #eef3fb; }
.sudoku-cell.conflict {
	background: #ffd9d9;
	color: #b00020;
}
.sudoku-cell.selected.conflict { background: #ffc2c2; }

.sudoku-board.solved .sudoku-cell {
	background: #e4f6e6;
	transition: background 0.4s ease;
}

.sudoku-board.loading {
	pointer-events: none;
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

.sudoku-pad {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.4rem;
}
.sudoku-pad button,
.sudoku-actions button {
	padding: 0.75rem 0;
	font-size: 1.15rem;
	cursor: pointer;
}
.sudoku-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.4rem;
	margin-top: 1.2rem;
}
