@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

* {
	box-sizing: border-box;
}

html, body {
	height: 100%;
	margin: 0;
}

body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
	font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
	background-color: #14121a;
	background-image:
		repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 26px),
		radial-gradient(circle at 18% 22%, rgba(255, 47, 178, .55), transparent 42%),
		radial-gradient(circle at 84% 20%, rgba(200, 255, 47, .4), transparent 45%),
		radial-gradient(circle at 50% 90%, rgba(47, 224, 255, .5), transparent 48%);
	background-size: auto, 150% 150%, 150% 150%, 150% 150%;
	background-repeat: repeat, no-repeat, no-repeat, no-repeat;
	animation: drift 16s ease-in-out infinite;
	overflow-x: hidden;
}

@keyframes drift {
	0%, 100% {
		background-position: 0 0, 10% 10%, 90% 10%, 50% 100%;
	}
	50% {
		background-position: 0 0, 25% 35%, 70% 30%, 40% 75%;
	}
}

.stage {
	width: 100%;
	max-width: 460px;
	padding: 1rem;
	text-align: center;
	animation: rise 0.7s cubic-bezier(.2, .9, .3, 1.2) both;
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(24px) scale(.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.eyebrow {
	display: inline-block;
	margin: 0 0 .75rem;
	padding: .35rem 1rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	font-family: 'Bungee', sans-serif;
	font-size: .6rem;
	color: #000;
	background: #c8ff2f;
	border: 3px solid #000;
	border-radius: 999px;
	box-shadow: 3px 3px 0 #000;
	transform: rotate(-2deg);
}

.title {
	margin: 0 0 1.75rem;
	font-family: 'Bungee', sans-serif;
	font-size: clamp(2.2rem, 11vw, 3.4rem);
	line-height: 1.1;
	text-transform: uppercase;
	color: #ff2fb2;
	-webkit-text-stroke: 1.5px #000;
	text-shadow: 4px 4px 0 #000;
	transform: rotate(-1.5deg);
}

.portrait-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 2rem;
	animation: bob 4s ease-in-out infinite;
	perspective: 700px;
}

@keyframes bob {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.portrait {
	width: clamp(190px, 55vw, 320px);
	height: auto;
	filter: drop-shadow(0 12px 25px rgba(0, 0, 0, .35));
	cursor: pointer;
}

/* one of these gets picked at random -- see confetti.js */

.portrait.fx-spin {
	animation: fx-spin .9s ease-in-out;
}

@keyframes fx-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(720deg);
	}
}

.portrait.fx-zoom {
	animation: fx-zoom .8s ease-in-out;
}

@keyframes fx-zoom {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.6);
	}
}

.portrait.fx-shake {
	animation: fx-shake .6s ease-in-out;
}

@keyframes fx-shake {
	0%, 100% {
		transform: translate(0, 0) rotate(0deg);
	}
	20% {
		transform: translate(-10px, 4px) rotate(-8deg);
	}
	40% {
		transform: translate(10px, -4px) rotate(8deg);
	}
	60% {
		transform: translate(-8px, 3px) rotate(-5deg);
	}
	80% {
		transform: translate(8px, -3px) rotate(5deg);
	}
}

.portrait.fx-wobble {
	animation: fx-wobble .8s ease-in-out;
}

@keyframes fx-wobble {
	0%, 100% {
		transform: scale(1, 1);
	}
	25% {
		transform: scale(1.3, .7);
	}
	50% {
		transform: scale(.75, 1.3);
	}
	75% {
		transform: scale(1.15, .9);
	}
}

.portrait.fx-flip {
	animation: fx-flip .9s ease-in-out;
}

@keyframes fx-flip {
	from {
		transform: rotateY(0deg);
	}
	to {
		transform: rotateY(360deg);
	}
}

.portrait.fx-party {
	animation: fx-party 1.1s ease-in-out;
}

@keyframes fx-party {
	0% {
		filter: drop-shadow(0 12px 25px rgba(0, 0, 0, .35)) hue-rotate(0deg) saturate(1);
		transform: scale(1) rotate(0deg);
	}
	50% {
		filter: drop-shadow(0 12px 25px rgba(0, 0, 0, .35)) hue-rotate(180deg) saturate(3);
		transform: scale(1.15) rotate(10deg);
	}
	100% {
		filter: drop-shadow(0 12px 25px rgba(0, 0, 0, .35)) hue-rotate(360deg) saturate(1);
		transform: scale(1) rotate(0deg);
	}
}

.portrait.fx-groove {
	animation: fx-groove .55s ease-in-out infinite;
}

@keyframes fx-groove {
	0%, 100% {
		transform: translateY(0) rotate(-8deg);
	}
	25% {
		transform: translateY(-16px) rotate(8deg);
	}
	50% {
		transform: translateY(0) rotate(-8deg);
	}
	75% {
		transform: translateY(-16px) rotate(8deg);
	}
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: .85rem;
	justify-content: center;
}

.confetti-button {
	--tilt: -2deg;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-width: 130px;
	height: 54px;
	padding: 0 1.2rem;
	cursor: pointer;
	color: #000;
	font-family: 'Bungee', -apple-system, "Segoe UI", system-ui, sans-serif;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .03em;
	border-radius: 12px;
	border: 3px solid #000;
	position: relative;
	background: #ff2fb2;
	box-shadow: 5px 5px 0 #000;
	transform: rotate(var(--tilt));
	transition: transform .12s ease, box-shadow .12s ease;
}

.confetti-button:nth-child(1) {
	--tilt: -3deg;
	background: #ff2fb2;
}

.confetti-button:nth-child(2) {
	--tilt: 2deg;
	background: #c8ff2f;
}

.confetti-button:nth-child(3) {
	--tilt: -2deg;
	background: #2fe0ff;
}

.confetti-button:hover {
	animation: wiggle .25s ease-in-out infinite;
	box-shadow: 7px 7px 0 #000;
}

@keyframes wiggle {
	0%, 100% {
		transform: rotate(calc(var(--tilt) - 4deg)) translate(-1px, -3px);
	}
	50% {
		transform: rotate(calc(var(--tilt) + 4deg)) translate(1px, -5px);
	}
}

.confetti-button:active {
	animation: none;
	transform: rotate(var(--tilt)) scale(.92) translate(3px, 3px);
	box-shadow: 1px 1px 0 #000;
	transition: transform .05s ease, box-shadow .05s ease;
}

.disco-button {
	--tilt: 3deg;
	display: none;
	background: repeating-linear-gradient(45deg, #eee 0 6px, #9a9a9a 6px 12px);
	opacity: 0;
	transform: translateY(14px) scale(.7) rotate(var(--tilt));
	transition: opacity .5s ease, transform .5s cubic-bezier(.2, .9, .3, 1.4), box-shadow .12s ease;
}

.disco-button.unlocked {
	display: inline-flex;
}

.disco-button.show {
	opacity: 1;
	transform: translateY(0) scale(1) rotate(var(--tilt));
	animation: disco-lure 1.6s ease-in-out infinite;
}

.disco-button.show:hover {
	animation: wiggle .25s ease-in-out infinite;
}

@keyframes disco-lure {
	0%, 100% {
		box-shadow: 5px 5px 0 #000, 0 0 10px 1px rgba(255, 255, 255, .5);
	}
	50% {
		box-shadow: 5px 5px 0 #000, 0 0 22px 6px rgba(255, 255, 255, .9);
	}
}

#disco-overlay {
	position: fixed;
	inset: 0;
	z-index: 900;
	pointer-events: none;
	opacity: 0;
	overflow: hidden;
	transition: opacity .5s ease;
}

#disco-overlay.active {
	opacity: 1;
}

.disco-dark {
	position: absolute;
	inset: 0;
	background: rgba(6, 4, 12, .82);
}

.rafters {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
}

.beam {
	position: absolute;
	top: -4%;
	left: 50%;
	width: 170px;
	height: 132%;
	background: linear-gradient(to bottom, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .32) 42%, transparent 82%);
	clip-path: polygon(47% 0%, 53% 0%, 100% 100%, 0% 100%);
	transform-origin: top center;
	transform: translateX(-50%) rotate(var(--beam-angle, 0deg));
	mix-blend-mode: screen;
	filter: blur(2px);
	opacity: .7;
	animation: beam-sway var(--sway-duration, 3s) ease-in-out infinite, beam-flicker 2.2s ease-in-out infinite;
	animation-delay: var(--sway-delay, 0s), var(--flicker-delay, 0s);
}

.beam::before {
	content: '';
	position: absolute;
	top: -7px;
	left: 50%;
	width: 20px;
	height: 20px;
	transform: translateX(-50%);
	border-radius: 50%;
	background: radial-gradient(circle, #fff, rgba(255, 255, 255, .5) 55%, transparent 75%);
	box-shadow: 0 0 20px 7px rgba(255, 255, 255, .85);
}

@keyframes beam-sway {
	0%, 100% {
		transform: translateX(-50%) rotate(var(--beam-angle, 0deg));
	}
	50% {
		transform: translateX(-50%) rotate(calc(var(--beam-angle, 0deg) + var(--sway-amount, 14deg)));
	}
}

@keyframes beam-flicker {
	0%, 100% {
		opacity: .5;
	}
	50% {
		opacity: .9;
	}
}

.discoball-rig {
	position: absolute;
	top: 4%;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform-origin: top center;
	transform: translateY(-260px);
}

.discoball-rig.left {
	left: 8%;
}

.discoball-rig.right {
	right: 8%;
}

.discoball-rig.dropping {
	animation: ball-drop .9s cubic-bezier(.25, 1.6, .4, 1) forwards, ball-swing 3.2s ease-in-out infinite .9s;
}

@keyframes ball-drop {
	from {
		transform: translateY(-260px);
	}
	to {
		transform: translateY(0);
	}
}

@keyframes ball-swing {
	0%, 100% {
		transform: translateY(0) rotate(-9deg);
	}
	50% {
		transform: translateY(0) rotate(9deg);
	}
}

.discoball-string {
	width: 2px;
	height: 64px;
	background: linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .65));
}

.discoball {
	width: clamp(90px, 20vw, 170px);
	height: clamp(90px, 20vw, 170px);
	border-radius: 50%;
	background:
		radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .95), transparent 38%),
		radial-gradient(circle at 68% 74%, rgba(0, 0, 0, .4), transparent 55%),
		repeating-conic-gradient(#e4e4e4 0deg 9deg, #8a8a8a 9deg 18deg);
	box-shadow: 0 0 55px 14px rgba(255, 255, 255, .4);
	animation: discoball-spin 3s linear infinite;
}

@keyframes discoball-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

body.disco-mode .stage {
	position: relative;
	z-index: 901;
	animation: disco-strobe .3s linear infinite;
}

@keyframes disco-strobe {
	0%, 100% {
		filter: brightness(1);
	}
	50% {
		filter: brightness(1.2);
	}
}

@media (max-width: 360px) {
	.button-row {
		gap: .6rem;
	}

	.confetti-button {
		min-width: 110px;
		height: 48px;
		font-size: .75rem;
	}
}
