:root {
	color-scheme: dark;
	font-family: system-ui, sans-serif;
	color: #fff;
	background: #212423;
}

* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

body {
	margin: 0;
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: url("/imgs/background.jpg") center / cover fixed no-repeat;
}

.branding {
	position: fixed;
	inset: 0;
	pointer-events: none;
	opacity: 0.25;
	background:
		url("/imgs/logo.png") 5% 15% / min(60vw, 90vh) auto no-repeat,
		url("/imgs/ananas.png") 95% 95% / auto min(70vh, 55vw) no-repeat;
}

#board, #pin_form {
	position: relative;
}

#board {
	width: min(92vw, 92rem);
}

.framed {
	border: 1px solid #ffffff40;
	border-radius: 0.65rem;
	background: #171716e8;
	box-shadow: 0.35rem 0.45rem 1rem #0007;
}

#last_entry {
	min-height: 3rem;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: clamp(0.65rem, 3vw, 2.5rem);
	padding: 0.4rem;
	color: #d4d4d4;
	font-size: clamp(0.85rem, 3vw, 2.25rem);
	font-weight: 650;
	white-space: nowrap;
}

#last_entry > :last-child {
	color: #fff;
	font-size: 1.25em;
	font-weight: 850;
}

#columns {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(0.15rem, 1vw, 1rem);
	margin-top: clamp(0.5rem, 2vh, 1.75rem);
	padding: clamp(0.3rem, 1vw, 1.25rem);
}

.column {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.15rem;
}

.letter {
	margin: 0 0 0.35rem;
	text-align: center;
	border-bottom: 1px solid #ffffff55;
	font-size: clamp(1.15rem, min(6vw, 5vh), 3.5rem);
}

.number {
	display: grid;
	place-items: center;
	min-width: 0;
	min-height: clamp(1.25rem, 4vh, 3.25rem);
	border-radius: 0.3rem;
	color: #b7b7b7;
	font-size: clamp(0.9rem, min(4.5vw, 3.6vh), 2.4rem);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.number.on {
	color: #fff;
	background: #a83227;
	font-weight: 850;
}

#number_popup {
	position: fixed;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	background: #000e;
	pointer-events: none;
}

#number_popup > span {
	font-size: min(24vw, 45vh);
	font-weight: 900;
	line-height: 1;
	white-space: nowrap;
	text-shadow: 0 0 0.2em #fff6;
	animation: number-pop 450ms ease-out both;
}

@keyframes number-pop {
	0% { opacity: 0; transform: scale(0.35); }
	65% { opacity: 1; transform: scale(1.12); }
	100% { opacity: 1; transform: scale(1); }
}

#celebration {
	position: fixed;
	inset: 0;
	z-index: 6;
	display: grid;
	place-items: center;
	overflow: hidden;
	padding: 1rem;
	background: radial-gradient(ellipse, #241737, #080610 75%);
	pointer-events: none;
}

#celebration p {
	position: relative;
	margin: 0;
	max-width: 18ch;
	font-size: clamp(2rem, min(10vw, 16vh), 9rem);
	font-weight: 900;
	line-height: 1.05;
	text-align: center;
	text-wrap: balance;
	text-shadow: 0 0 0.15em #080610, 0 0.05em 0.35em #080610, 0 0 0.6em #ffbc7170;
}

.fireworks {
	position: absolute;
	inset: 0;
}

.fireworks span {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: min(var(--size), 72vw);
	aspect-ratio: 1;
	translate: -50% -50%;
	opacity: 0;
	background:
		radial-gradient(circle, currentColor 30%, transparent 60%) 50% 3%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 73% 9%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 91% 25%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 97% 50%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 89% 73%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 74% 90%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 50% 97%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 27% 89%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 10% 74%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 3% 50%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 11% 26%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 26% 10%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 36% 31%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 66% 34%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 61% 64%,
		radial-gradient(circle, currentColor 30%, transparent 60%) 34% 66%;
	background-size: clamp(0.4rem, 2vmin, 1.2rem) clamp(0.4rem, 2vmin, 1.2rem);
	background-repeat: no-repeat;
	filter: drop-shadow(0 0 0.4rem currentColor);
	animation: fireworks-burst var(--cycle) ease-out var(--delay) infinite;
}

.fireworks span:nth-child(1) { --x: 16%; --y: 24%; --size: 42vmin; --cycle: 2.9s; --delay: 0s; color: #ffcf66; }
.fireworks span:nth-child(2) { --x: 80%; --y: 21%; --size: 47vmin; --cycle: 3.3s; --delay: 0.35s; color: #ff81c8; }
.fireworks span:nth-child(3) { --x: 73%; --y: 77%; --size: 50vmin; --cycle: 3.9s; --delay: 0.75s; color: #83edff; }
.fireworks span:nth-child(4) { --x: 23%; --y: 72%; --size: 38vmin; --cycle: 3.5s; --delay: 1.1s; color: #ff9875; }
.fireworks span:nth-child(5) { --x: 49%; --y: 42%; --size: 67vmin; --cycle: 4.7s; --delay: 0.6s; color: #cdaaff; }

@keyframes fireworks-burst {
	0% { opacity: 0; transform: translateY(24vh) scale(0.04); }
	12% { opacity: 1; transform: translateY(0) scale(0.08); }
	35% { opacity: 1; transform: scale(0.78) rotate(5deg); }
	75%, 100% { opacity: 0; transform: translateY(5vh) scale(1.12) rotate(12deg); }
}

#pin_form {
	display: grid;
	width: min(24rem, 100%);
	gap: 0.8rem;
	padding: 1.5rem;
}

#pin_form h1 {
	margin: 0;
	font-size: 1.4rem;
}

#pin_form input {
	width: 100%;
	padding: 0.6rem;
	border: 1px solid #a7a7a7;
	border-radius: 0.3rem;
	font: inherit;
}

button {
	border: 1px solid #ffffff26;
	border-radius: 0.3rem;
	background: #353432;
	color: #fff;
	padding: 0.45rem 0.75rem;
	font: inherit;
	cursor: pointer;
}

button.number {
	padding: 0.1rem;
}

button:hover:enabled {
	border-color: #fff;
}

button:disabled {
	cursor: default;
}

#advanced_controls button:disabled, #pin_form button:disabled {
	opacity: 0.55;
}

:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.admin_header {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.admin_header > * {
	flex: 1 1 auto;
}

#advanced_controls {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem;
}

#bingo_btn {
	background: #872e24;
	font-weight: 750;
}

.status, .feedback {
	margin: 0 0 0.5rem;
	padding: 0.45rem;
	border-radius: 0.3rem;
	background: #221c14;
	color: #ffe1a7;
	text-align: center;
}

.feedback {
	margin: 0.5rem 0 0;
}

@media (orientation: landscape) {
	.column {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.letter, .number:last-child {
		grid-column: 1 / -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	#number_popup > span {
		animation: none;
	}

	.fireworks span {
		animation: none;
		opacity: 0.65;
	}
}
