@font-face {
	font-family: "LoadingPanton";
	src: url("fonts/iCielPanton-Black.otf") format("opentype");
	font-weight: 900;
	font-style: normal;
	font-display: block;
}

.game-loading-screen {
	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: grid;
	place-items: center;
	overflow: hidden;
	background:
		linear-gradient(180deg, #dfeafe 0 90px, #f7f7f7 91px 100%),
		#f7f7f7;
	color: #ffffff;
	font-family: "LoadingPanton", "Arial Rounded MT Bold", Arial, sans-serif;
	opacity: 1;
	visibility: visible;
	transition: opacity 240ms ease, visibility 240ms ease;
}

.game-loading-screen.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.loading-sky {
	position: absolute;
	top: 0;
	left: -8%;
	width: 116%;
	height: 108px;
	background:
		radial-gradient(42px 20px at 9% 88px, transparent 96%, #7c99c9 100%, transparent 107%),
		radial-gradient(70px 28px at 27% 88px, transparent 96%, #7c99c9 100%, transparent 107%),
		radial-gradient(64px 26px at 49% 88px, transparent 96%, #7c99c9 100%, transparent 107%),
		radial-gradient(76px 31px at 71% 88px, transparent 96%, #7c99c9 100%, transparent 107%),
		radial-gradient(58px 23px at 91% 88px, transparent 96%, #7c99c9 100%, transparent 107%),
		linear-gradient(180deg, #dfeafe 0%, #cedcf9 100%);
	filter: drop-shadow(0 5px 7px rgba(35, 77, 139, 0.38));
}

.loading-sky::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -16px;
	height: 34px;
	background:
		radial-gradient(74px 24px at 10% 3px, #f7f7f7 98%, transparent 100%),
		radial-gradient(86px 27px at 31% 4px, #f7f7f7 98%, transparent 100%),
		radial-gradient(78px 24px at 53% 3px, #f7f7f7 98%, transparent 100%),
		radial-gradient(92px 28px at 76% 4px, #f7f7f7 98%, transparent 100%),
		radial-gradient(76px 24px at 96% 3px, #f7f7f7 98%, transparent 100%);
}

.loading-card {
	position: relative;
	width: min(78vw, 370px);
	min-height: 390px;
	display: grid;
	justify-items: center;
	align-content: center;
	gap: 22px;
	transform: translateY(8px);
}

.loading-badge {
	position: relative;
	padding: 13px 38px 15px;
	border-radius: 28px;
	background: linear-gradient(180deg, #126aa2 0%, #075081 100%);
	box-shadow:
		0 5px 0 #0690c9,
		0 9px 14px rgba(0, 58, 104, 0.28),
		inset 0 2px 0 rgba(255, 255, 255, 0.18);
	font-family: "LoadingPanton", "Arial Rounded MT Bold", Arial, sans-serif;
	font-size: clamp(25px, 7vw, 34px);
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	text-shadow:
		0 3px 0 rgba(0, 0, 0, 0.38),
		0 -1px 0 rgba(255, 255, 255, 0.22);
	animation: loading-label-bounce 1.35s ease-in-out infinite;
}

.loading-cloud {
	position: relative;
	width: min(82vw, 340px);
	height: 174px;
	animation: loading-float 2.2s ease-in-out infinite;
}

.loading-cloud::before {
	content: "";
	position: absolute;
	left: 7%;
	right: 7%;
	bottom: 34px;
	height: 82px;
	border-radius: 44px;
	background: #7fd2f6;
	border: 5px solid #ffffff;
	box-shadow:
		0 3px 0 #59a9d1,
		0 9px 16px rgba(77, 120, 147, 0.28),
		inset 0 -4px 0 rgba(31, 117, 166, 0.12);
}

.cloud-bump {
	position: absolute;
	display: block;
	background: #7fd2f6;
	border: 5px solid #ffffff;
	border-bottom-color: transparent;
	box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.12);
}

.bump-a {
	left: 17%;
	top: 45px;
	width: 86px;
	height: 74px;
	border-radius: 58px 58px 20px 20px;
	transform: rotate(-18deg);
}

.bump-b {
	left: 34%;
	top: 16px;
	width: 116px;
	height: 112px;
	border-radius: 70px 70px 34px 34px;
}

.bump-c {
	right: 14%;
	top: 56px;
	width: 88px;
	height: 64px;
	border-radius: 56px 56px 22px 22px;
	transform: rotate(13deg);
}

.screw {
	position: absolute;
	z-index: 2;
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.14);
	font-family: Arial, sans-serif;
	font-size: 35px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	text-shadow: 0 2px 1px rgba(255, 255, 255, 0.42);
	box-shadow:
		0 4px 0 rgba(0, 0, 0, 0.24),
		0 7px 9px rgba(0, 0, 0, 0.2),
		inset 0 3px 0 rgba(255, 255, 255, 0.46),
		inset 0 -5px 0 rgba(0, 0, 0, 0.18);
	animation: screw-wiggle 1.4s ease-in-out infinite;
}

.screw-pink {
	background: linear-gradient(180deg, #ff4ab0, #d90a76);
	color: #8e004b;
}

.screw-lime {
	background: linear-gradient(180deg, #c7f33a, #7fbd08);
	color: #3f7000;
}

.screw-blue {
	background: linear-gradient(180deg, #39a8ff, #096ee9);
	color: #043fa0;
}

.screw-a {
	left: 28%;
	top: 73px;
}

.screw-b {
	right: 20%;
	top: 54px;
	animation-delay: 160ms;
}

.screw-c {
	left: 55%;
	bottom: 22px;
	animation-delay: 320ms;
}

.loading-track {
	display: flex;
	gap: 17px;
	align-items: center;
	justify-content: center;
	height: 34px;
}

.loading-bolt {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: linear-gradient(180deg, #6b737a, #272e34);
	border: 4px solid #f5f8fd;
	box-shadow:
		0 2px 0 #abb3bd,
		0 4px 6px rgba(0, 0, 0, 0.25),
		inset 0 3px 0 rgba(255, 255, 255, 0.2);
	animation: bolt-pop 1.15s ease-in-out infinite;
}

.bolt-b {
	animation-delay: 120ms;
}

.bolt-c {
	animation-delay: 240ms;
}

.bolt-d {
	animation-delay: 360ms;
}

.bolt-e {
	animation-delay: 480ms;
}

@keyframes loading-label-bounce {
	0%, 100% {
		transform: translateY(0) scale(1);
	}
	50% {
		transform: translateY(-4px) scale(1.02);
	}
}

@keyframes loading-float {
	0%, 100% {
		transform: translateY(0) rotate(-1deg);
	}
	50% {
		transform: translateY(-10px) rotate(1deg);
	}
}

@keyframes screw-wiggle {
	0%, 100% {
		transform: rotate(-8deg) scale(1);
	}
	50% {
		transform: rotate(9deg) scale(1.06);
	}
}

@keyframes bolt-pop {
	0%, 100% {
		transform: translateY(0) scale(0.82);
		opacity: 0.62;
	}
	50% {
		transform: translateY(-5px) scale(1);
		opacity: 1;
	}
}

@media (max-width: 420px) {
	.loading-card {
		width: 92vw;
		min-height: 350px;
		gap: 20px;
	}

	.loading-cloud {
		width: 300px;
		max-width: 88vw;
		transform: scale(0.92);
	}

	.loading-track {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.loading-badge,
	.loading-cloud,
	.screw,
	.loading-bolt {
		animation: none;
	}
}
