*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	color-scheme: light;
	--grund: #f6f4ef;
	--tinte: #16181d;
	--leise: #5d6470;
	--linie: #e2ded5;
	font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	background: var(--grund);
	color: var(--tinte);
}

.kopf {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 32px;
	padding: 24px 28px;
}

h1 {
	margin: 0;
	font-size: clamp(28px, 4vw, 40px);
	letter-spacing: -0.02em;
}

.kopf p {
	max-width: 520px;
	margin: 6px 0 0;
	color: var(--leise);
	line-height: 1.5;
}

kbd {
	padding: 1px 6px;
	font: 0.9em ui-monospace, monospace;
	background: #fff;
	border: 1px solid var(--linie);
	border-bottom-width: 2px;
	border-radius: 5px;
}

.steuerung {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.steuerung label {
	color: var(--leise);
	font-size: 14px;
}

select,
.knopf {
	min-height: 40px;
	padding: 0 14px;
	font: inherit;
	font-size: 15px;
	border-radius: 8px;
	cursor: pointer;
}

select {
	color: var(--tinte);
	background: #fff;
	border: 1px solid var(--linie);
}

.knopf {
	color: #fff;
	background: var(--tinte);
	border: 1px solid var(--tinte);
}

.knopf.zweit {
	color: var(--tinte);
	background: transparent;
}

button:focus-visible,
select:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 2px;
}

.palette {
	display: flex;
	flex: 1;
	min-height: 420px;
}

.farbe {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	padding: 28px 10px;
	transition:
		background-color 0.45s ease,
		color 0.45s ease;
}

/* auf farbigem Grund zeigt der Fokus die Schriftfarbe der Farbe */
.farbe button:focus-visible {
	outline-color: currentColor;
}

.wert {
	padding: 8px 14px;
	font: 600 15px ui-monospace, 'SF Mono', monospace;
	letter-spacing: 0.04em;
	color: inherit;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 999px;
	cursor: pointer;
}

.schloss {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.6;
}

.schloss[aria-pressed='true'],
.schloss:hover {
	opacity: 1;
}

.schloss svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.meldung {
	position: fixed;
	bottom: 20px;
	left: 50%;
	margin: 0;
	padding: 10px 16px;
	color: #fff;
	font-size: 14px;
	background: var(--tinte);
	border-radius: 999px;
	transform: translateX(-50%);
}

.meldung:empty {
	display: none;
}

@media (max-width: 700px) {
	.kopf {
		padding: 20px;
	}

	.palette {
		flex-direction: column;
	}

	.farbe {
		flex-direction: row;
		justify-content: space-between;
		min-height: 88px;
		padding: 18px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.farbe {
		transition: none;
	}
}
