:root {
	color: #1b5965;
	background: #54ad96;
	font-family: "Trebuchet MS", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	min-width: 320px;
	min-height: 100vh;
	margin: 0;
	background: linear-gradient(#54ad96 0%, #8bc9b8 68%, #1b9bb1 68%, #1b9bb1 100%);
}

button,
select {
	font: inherit;
}

button {
	cursor: pointer;
}

.app {
	width: min(100% - 28px, 680px);
	min-height: 100vh;
	margin: 0 auto;
	padding: 8px 0 24px;
}

.game-header {
	display: grid;
	grid-template-columns: 46px 1fr auto;
	align-items: center;
	min-height: 70px;
	padding: 9px 14px;
	border-radius: 12px;
	background: #fffdf5;
	box-shadow: 0 6px 0 rgb(27 91 101 / 25%);
}

.menu-toggle {
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	color: #fff;
	background: #eb5777;
	font-size: 1.45rem;
	font-weight: bold;
	line-height: 1;
}

.brand-lockup {
	text-align: center;
}

.eyebrow {
	margin: 0;
	color: #eb5777;
	font-size: .72rem;
	font-weight: bold;
	letter-spacing: 0;
	text-transform: uppercase;
}

h1 {
	margin: 2px 0 0;
	color: #1b5965;
	font-size: 1.8rem;
	line-height: 1;
	letter-spacing: 0;
}

.level-display {
	min-width: 56px;
	text-align: right;
	color: #54ad96;
	font-size: .64rem;
	font-weight: bold;
	text-transform: uppercase;
}

.level-display strong {
	display: block;
	color: #1b5965;
	font-size: 1.4rem;
	line-height: 1;
}

.game-menu {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7px;
	margin: 14px auto 0;
	padding: 8px;
	border-radius: 10px;
	background: #1b9bb1;
	box-shadow: 0 6px 0 rgb(27 91 101 / 30%);
}

.game-menu button,
.new-puzzle-button {
	min-height: 38px;
	border: 0;
	border-radius: 7px;
	color: #fff;
	background: #eb5777;
	box-shadow: inset 0 -4px 0 rgb(160 54 78 / 27%);
	font-weight: bold;
	letter-spacing: 0;
	text-transform: uppercase;
}

.game-menu button:first-child,
.new-puzzle-button {
	background: #54ad96;
}

.game-panel {
	display: grid;
	justify-items: center;
	padding-top: 18px;
}

.game-toolbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 7px;
	margin-bottom: 8px;
}

.difficulty-label {
	color: #1b5965;
	font-size: .76rem;
	font-weight: bold;
	text-transform: uppercase;
}

select {
	min-height: 36px;
	padding: 0 8px;
	border: 0;
	border-radius: 7px;
	color: #1b5965;
	background: #fffdf5;
	font-weight: bold;
}

.new-puzzle-button {
	min-height: 36px;
	padding: 0 11px;
	font-size: .72rem;
}

.status {
	min-height: 18px;
	margin: 0 0 8px;
	color: #1b5965;
	font-size: .78rem;
	font-weight: bold;
	text-shadow: 0 1px rgb(255 253 245 / 30%);
}

.status.is-error {
	color: #c3475e;
	text-shadow: none;
}

.status.is-complete {
	color: #197f73;
	text-shadow: none;
}

.status.is-hint {
	color: #9c7b16;
	text-shadow: none;
}

.board {
	display: grid;
	grid-template-columns: repeat(9, 1fr);
	width: min(100%, 500px);
	aspect-ratio: 1;
	padding: clamp(9px, 2vw, 14px);
	border-radius: 13px;
	background: #fffdf5;
	box-shadow: 0 7px 0 rgb(27 91 101 / 27%);
	gap: clamp(3px, .7vw, 5px);
}

.cell {
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d8e7e0;
	box-shadow: inset 0 -2px 0 rgb(27 91 101 / 13%);
	transition: transform 120ms ease, filter 120ms ease;
}

.cell:not(:disabled):hover {
	filter: brightness(.93);
	transform: translateY(-1px);
}

.cell:focus-visible,
button:focus-visible,
select:focus-visible {
	outline: 3px solid #ffe143;
	outline-offset: 3px;
}

.color-swatch[data-value="1"],
.cell.value-red {
	background: #eb5777;
}

.color-swatch[data-value="2"],
.cell.value-yellow {
	background: #ffe143;
}

.color-swatch[data-value="3"],
.cell.value-blue {
	background: #1b9bb1;
}

.cell.is-given {
	box-shadow: inset 0 0 0 4px rgb(255 255 255 / 43%), inset 0 -3px 0 rgb(27 91 101 / 18%);
}

.palette {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
}

.color-swatch {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 4px solid transparent;
	border-radius: 50%;
	box-shadow: 0 4px 0 rgb(27 91 101 / 28%);
}

.color-swatch.is-selected {
	border-color: #fffdf5;
	outline: 3px solid #1b5965;
	outline-offset: 2px;
}

.clear-button,
.hint-button {
	min-height: 38px;
	padding: 0 12px;
	border: 0;
	border-radius: 8px;
	color: #fff;
	background: #1b9bb1;
	box-shadow: inset 0 -4px 0 rgb(27 91 101 / 27%);
	font-size: .7rem;
	font-weight: bold;
	text-transform: uppercase;
}

.hint-button {
	background: #f07a6a;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 520px) {
	.app {
		width: min(100% - 20px, 680px);
		padding-top: 8px;
	}

	.game-header {
		grid-template-columns: 42px 1fr 48px;
		min-height: 66px;
		padding: 8px 9px;
	}

	.menu-toggle {
		width: 34px;
		height: 34px;
	}

	h1 {
		font-size: 1.55rem;
	}

	.level-display {
		min-width: 48px;
	}

	.game-menu {
		gap: 6px;
		margin-top: 10px;
		padding: 7px;
	}

	.game-menu button {
		min-height: 34px;
		font-size: .67rem;
	}

	.game-panel {
		padding-top: 14px;
	}

	.board {
		width: min(100%, 440px);
		border-radius: 11px;
	}

	.palette {
		gap: 8px;
		margin-top: 16px;
	}

	.color-swatch {
		width: 36px;
		height: 36px;
	}

	.clear-button,
	.hint-button {
		min-height: 35px;
		padding: 0 10px;
		font-size: .65rem;
	}
}