* {
	box-sizing: border-box;
}

/* The one value JavaScript changes. Everything that uses it updates. */
:root {
	--color: #f4f4f6;
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	margin: 0;
	background-color: var(--color);
	font-family: system-ui, sans-serif;
	color: #1c1c22;
	transition: background-color 0.4s ease;
}

/* Skip the fade for people who've asked their device for less motion. */
@media (prefers-reduced-motion: reduce) {
	body {
		transition: none;
	}
}

.flipper {
	width: min(24rem, 90vw);
	padding: 2.5rem 2rem;
	border-radius: 1.5rem;
	background: #ffffff;
	text-align: center;
	box-shadow: 0 10px 30px -15px rgb(0 0 0 / 0.25);
}

.flipper-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b6b76;
}

.format-picker {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin: 1.5rem 0 0;
	padding: 0;
	border: 0;
}

.format-legend {
	margin: 0 auto 0.75rem;
	padding: 0;
	font-size: 0.875rem;
	color: #6b6b76;
}

.format-option {
	position: relative;
	padding: 0.5rem 1rem;
	border: 2px solid #1c1c22;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
}

/* The real radio stays in the page for keyboards and screen readers. */
.format-option input {
	position: absolute;
	opacity: 0;
}

/* :has() styles the label based on the radio inside it. */
.format-option:has(input:checked) {
	background: #1c1c22;
	color: #ffffff;
}

.format-option:has(input:focus-visible) {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}

.color-value {
	margin: 1.5rem 0;
	font-family: ui-monospace, monospace;
	font-size: 1.5rem;
	font-weight: 700;
}

.flip-button {
	width: 100%;
	padding: 0.75rem;
	border: 2px solid #1c1c22;
	border-radius: 999px;
	background: #1c1c22;
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.flip-button:hover {
	background: #3a3a44;
}

.flip-button:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}
