body,
html {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.hidden {
	display: none !important;
}

body {
	background-color: #111827;
}

#app-container {
	position: relative;
	width: 100%;
	height: 100vh;
	background-color: #000;
	font-family: "Nosifer", sans-serif;
}

#initial-screen {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

#initial-screen h1 {
	font-family: "Kablammo", system-ui;
	font-size: clamp(2rem, 8vw, 4.5rem);
	line-height: 1.2;
	font-weight: 700;
	color: #f87171;
	text-align: center;
	padding: 0 1rem;
}

#demo-container {
	position: relative;
	width: 100%;
	height: 100%;
}

#canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#running-ui {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 1.5rem;
	padding-top: 3rem;
	pointer-events: none;
}

#title-text {
	font-family: "Kablammo", system-ui;
	font-weight: 700;
	color: rgba(252, 165, 165, 0.8);
	white-space: nowrap;
	text-align: center;
	transition-property: transform;
	transition-duration: 100ms;
	transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

#loading-overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background-color: #000;
}

#loader-text {
	margin-top: 2rem;
	font-size: clamp(1rem, 4vw, 1.25rem);
	line-height: 1.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: #f87171;
	text-transform: uppercase;
	text-align: center;
	padding: 0 1rem;
}

#ending-overlay {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 20;
	background-color: #000;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(1rem);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.animate-fade-in-up {
	opacity: 0;
	animation: fadeInUp 1s ease-out forwards;
}
.animation-delay-300 {
	animation-delay: 300ms;
}
.animation-delay-500 {
	animation-delay: 500ms;
}
.loading-bg {
	background: radial-gradient(
		ellipse at center,
		rgba(100, 20, 20, 0.2) 0%,
		rgba(0, 0, 0, 1) 70%
	);
	position: relative;
}
.loading-bg::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	pointer-events: none;
	box-shadow: inset 0 0 15vw 2vw rgba(0, 0, 0, 0.5);
	animation: static-flicker 0.15s steps(2) infinite;
}
.vignette {
	box-shadow: inset 0 0 15vw 5vw rgba(0, 0, 0, 0.9);
}
@keyframes static-flicker {
	0%,
	100% {
		opacity: 0.05;
	}
	25% {
		opacity: 0.1;
	}
	50% {
		opacity: 0.02;
	}
	75% {
		opacity: 0.15;
	}
}
@keyframes spinner-rotate {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}
.loader-spinner {
	width: 4rem;
	height: 4rem;
	border-radius: 50%;
	border: 4px solid #450a0a;
	border-top-color: #ef4444;
	box-shadow: 0 0 10px #ef4444;
	animation: spinner-rotate 0.8s linear infinite;
}
@keyframes text-pulse {
	0%,
	100% {
		opacity: 0.6;
	}
	50% {
		opacity: 1;
	}
}
.loader-text {
	animation: text-pulse 2s ease-in-out infinite;
}
#subtitle {
	margin-top: 0.5rem;
	font-family: "Nosifer", sans-serif;
	color: #fca5a5;
	font-size: clamp(1rem, 3vw, 1.25rem);
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
	text-align: center;
	padding: 0 1rem;
}
.ritual-button {
	position: relative;
	padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
	margin-top: 1.5rem;
	font-family: "Nosifer", sans-serif;
	font-size: clamp(1rem, 3.5vw, 1.25rem);
	font-weight: 700;
	color: #fca5a5;
	background-color: #1a0000;
	border: 2px solid #991b1b;
	border-radius: 0.5rem;
	cursor: pointer;
	overflow: hidden;
	transition: all 0.3s ease-out;
	box-shadow: 0 0 15px rgba(220, 38, 38, 0.3),
		inset 0 0 10px rgba(220, 38, 38, 0.2);
	white-space: nowrap;
}
.ritual-button::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	background: radial-gradient(
		circle,
		rgba(239, 68, 68, 0.5) 0%,
		transparent 70%
	);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: width 0.4s ease-in-out, height 0.4s ease-in-out;
	z-index: 0;
}
.ritual-button:hover::before,
.ritual-button:focus::before {
	width: 300px;
	height: 300px;
}
.ritual-button:hover {
	border-color: #ef4444;
	box-shadow: 0 0 25px rgba(239, 68, 68, 0.6), inset 0 0 15px rgba(239, 68, 0.4);
	transform: scale(1.05);
}
.ritual-button:focus {
	outline: none;
}
.ritual-button-text {
	position: relative;
	z-index: 1;
	transition: color 0.3s ease, text-shadow 0.3s ease;
}
.ritual-button:hover .ritual-button-text {
	color: #ffffff;
	text-shadow: 0 0 10px #f87171;
}
.title-3d {
	text-shadow: 1px 1px 0px #7f1d1d, 2px 2px 0px #7f1d1d, 3px 3px 0px #450a0a,
		4px 4px 0px #450a0a, 0 0 15px rgba(239, 68, 68, 0.4),
		8px 8px 15px rgba(0, 0, 0, 0.8);
}
#countdown {
	margin-top: 2rem;
	font-family: "Nosifer", sans-serif;
	color: #f87171;
	font-size: clamp(0.875rem, 3vw, 1.125rem);
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
	text-align: center;
	letter-spacing: 0.1em;
	padding: 0 1rem;
	opacity: 0.8;
}
#guest-form-overlay {
	position: absolute;
	left: 50%;
	bottom: 6.5rem;
	z-index: 12;
	width: min(22rem, calc(100% - 2rem));
	transform: translateX(-50%);
	padding: 1.25rem 1.5rem 1.5rem;
	background: linear-gradient(
		180deg,
		rgba(26, 0, 0, 0.88) 0%,
		rgba(10, 0, 0, 0.92) 100%
	);
	border: 2px solid #991b1b;
	box-shadow: 0 0 24px rgba(220, 38, 38, 0.35),
		inset 0 0 18px rgba(220, 38, 38, 0.15);
	animation: fadeInUp 0.7s ease-out forwards;
}

#guest-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.entry-note {
	margin: 0 0 0.15rem;
	font-family: "Kablammo", system-ui;
	font-size: clamp(1rem, 3vw, 1.25rem);
	color: #f87171;
	text-align: center;
	letter-spacing: 0.04em;
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

#guest-form label {
	font-family: "Kablammo", system-ui;
	font-size: clamp(1.1rem, 3vw, 1.5rem);
	color: #fca5a5;
	text-align: center;
	text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

#guest-name {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.85rem;
	font-family: "Kablammo", system-ui;
	font-size: 1.1rem;
	color: #fecaca;
	background: #0a0000;
	border: 1px solid #7f1d1d;
	outline: none;
}

#guest-name::placeholder {
	color: rgba(252, 165, 165, 0.4);
}

#guest-name:focus {
	border-color: #ef4444;
	box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

#guest-form .ritual-button {
	margin-top: 0.25rem;
	align-self: center;
}

#app-container.form-open,
#app-container.volume-open {
	cursor: default;
}

#volume-control {
	position: absolute;
	right: 1.25rem;
	bottom: 1.5rem;
	z-index: 12;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
	background: linear-gradient(
		180deg,
		rgba(26, 0, 0, 0.88) 0%,
		rgba(10, 0, 0, 0.92) 100%
	);
	border: 2px solid #991b1b;
	box-shadow: 0 0 18px rgba(220, 38, 38, 0.3),
		inset 0 0 12px rgba(220, 38, 38, 0.12);
	animation: fadeInUp 0.5s ease-out forwards;
	pointer-events: auto;
}

#volume-control label {
	font-family: "Kablammo", system-ui;
	font-size: 0.95rem;
	color: #fca5a5;
	white-space: nowrap;
}

#volume-slider {
	width: 8rem;
	accent-color: #ef4444;
	cursor: pointer;
}

@media (max-width: 480px) {
	#volume-control {
		left: 50%;
		right: auto;
		bottom: 5.5rem;
		transform: translateX(-50%);
	}
}

#running-countdown-container {
	position: absolute;
	bottom: 1.5rem;
	left: 0;
	right: 0;
	pointer-events: none;
	font-family: "Nosifer", sans-serif;
	color: #ffffff;
	font-size: clamp(0.75rem, 2vw, 1rem);
	text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
	text-align: center;
	letter-spacing: 0.1em;
	padding: 0 1rem;
	opacity: 0.9;
}
.time-block {
	display: inline-block;
	margin: 0 0.2rem;
}
.time-value {
	display: inline-block;
	min-width: 1.5em;
	text-align: right;
}
.time-label {
	padding-left: 0.2em;
}
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.animate-fade-in {
	animation: fadeIn 4s ease-out forwards;
}
.scanline-overlay::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	background-image: linear-gradient(rgba(0, 0, 0, 0.4) 50%, transparent 50%);
	background-size: 100% 4px;
	opacity: 0.3;
	z-index: 15;
}