* {
	box-sizing: border-box;
}

body {
	display: grid;
	place-items: center;
	min-height: 100vh;
	margin: 0;
	background: #f4f4f6;
	font-family: system-ui, sans-serif;
	color: #1c1c22;
}

.counter {
	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);
}

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

.counter-value {
	margin: 1rem 0 2rem;
	font-size: 5rem;
	font-weight: 700;
	/* Every digit takes the same width, so the number doesn't jiggle. */
	font-variant-numeric: tabular-nums;
}

/* The colour is set by JavaScript adding one of these classes. */
.counter-value.is-positive {
	color: #15803d;
}

.counter-value.is-negative {
	color: #b91c1c;
}

.counter-buttons {
	display: flex;
	gap: 0.5rem;
}

.counter-button {
	flex: 1;
	padding: 0.75rem 0.5rem;
	border: 2px solid #1c1c22;
	border-radius: 999px;
	background: #ffffff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.counter-button:hover {
	background: #1c1c22;
	color: #ffffff;
}

/* A visible outline for keyboard users only. */
.counter-button:focus-visible {
	outline: 3px solid #2563eb;
	outline-offset: 3px;
}
