* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	color: #ecebff;
	background:
		radial-gradient(circle at 10% 15%, #2c205e 0, transparent 32%),
		radial-gradient(circle at 85% 20%, #1e2f66 0, transparent 28%),
		linear-gradient(140deg, #090b1d 0%, #111733 40%, #0b1024 100%);
	background-size: 150% 150%, 150% 150%, 180% 180%;
	animation: auroraFlow 22s ease-in-out infinite;
	display: grid;
	place-items: center;
	padding: 2rem;
	position: relative;
	overflow: hidden;
}

body::before,
body::after {
	content: '';
	position: fixed;
	z-index: -1;
	border-radius: 50%;
	filter: blur(44px);
	opacity: 0.45;
	pointer-events: none;
}

body::before {
	width: 320px;
	height: 320px;
	left: -80px;
	top: 8%;
	background: radial-gradient(circle, rgba(109, 125, 255, 0.55) 0%, rgba(109, 125, 255, 0) 70%);
	animation: driftOne 16s ease-in-out infinite;
}

body::after {
	width: 360px;
	height: 360px;
	right: -110px;
	bottom: 6%;
	background: radial-gradient(circle, rgba(111, 235, 255, 0.42) 0%, rgba(111, 235, 255, 0) 70%);
	animation: driftTwo 18s ease-in-out infinite;
}

.page {
	width: min(760px, 100%);
	display: grid;
	gap: 1.5rem;
	position: relative;
	z-index: 2;
}

.hero {
	text-align: center;
	position: relative;
}

.eyebrow {
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.75rem;
	color: #a7b0ff;
}

h1 {
	margin: 0.5rem 0 0.4rem;
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	line-height: 1.1;
	letter-spacing: -0.02em;
	background: linear-gradient(180deg, #ffffff 0%, #cfd7ff 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.subtitle {
	margin: 0;
	color: #b8bde6;
	font-size: 1rem;
}

.card {
	background:
		linear-gradient(140deg, rgba(24, 31, 71, 0.62) 0%, rgba(11, 15, 35, 0.65) 100%) padding-box,
		linear-gradient(
			115deg,
			rgba(126, 145, 255, 0.9) 0%,
			rgba(136, 170, 255, 0.9) 16%,
			rgba(122, 214, 255, 0.9) 34%,
			rgba(139, 227, 255, 0.9) 50%,
			rgba(171, 201, 255, 0.9) 66%,
			rgba(186, 169, 255, 0.9) 82%,
			rgba(161, 159, 255, 0.9) 100%
		) border-box;
	border: 1px solid transparent;
	backdrop-filter: blur(12px);
	border-radius: 20px;
	padding: clamp(1.2rem, 4vw, 2rem);
	box-shadow:
		0 22px 70px rgba(3, 5, 16, 0.65),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	display: grid;
	gap: 1rem;
	position: relative;
	overflow: hidden;
	background-size: 100% 100%, 260% 260%;
	animation: borderFlow 8.5s ease-in-out infinite alternate, borderGlow 3s ease-in-out infinite;
}

.card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, rgba(142, 158, 255, 0.16) 0%, rgba(142, 158, 255, 0) 45%);
	pointer-events: none;
}

.card::after {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	height: 3px;
	width: 100%;
	background: linear-gradient(90deg, rgba(124, 228, 255, 0) 0%, rgba(124, 228, 255, 0.95) 50%, rgba(124, 228, 255, 0) 100%);
	opacity: 0;
	pointer-events: none;
	transform: translateX(-100%);
}

.rain-layer {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}

.rain-chip {
	position: absolute;
	top: -14vh;
	left: 0;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.09em;
	padding: 0.28rem 0.5rem;
	border-radius: 999px;
	color: rgba(225, 232, 255, 0.7);
	background: rgba(110, 125, 255, 0.14);
	border: 1px solid rgba(168, 179, 255, 0.2);
	opacity: 0;
	transform: translateY(0) translateX(0) rotate(0deg);
	animation: rainDrop var(--chip-duration, 7s) linear 1 forwards;
}

.status {
	margin: 0;
	color: #a9b0e5;
	font-size: 0.9rem;
	position: relative;
	z-index: 2;
}

.fortune-shell {
	width: min(360px, 100%);
	aspect-ratio: 1;
	margin-inline: auto;
	border-radius: 50%;
	padding: 1rem;
	background: radial-gradient(circle at 32% 24%, #3449ad 0%, #111739 58%, #05070f 100%);
	border: 1px solid rgba(175, 188, 255, 0.28);
	box-shadow:
		inset 0 20px 55px rgba(255, 255, 255, 0.05),
		0 24px 52px rgba(5, 7, 18, 0.66);
	display: grid;
	place-items: center;
	transition: transform 260ms ease, filter 260ms ease, box-shadow 260ms ease;
	position: relative;
	z-index: 2;
	overflow: visible;
}

.fortune-shell.is-revealed {
	animation: revealSpin 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fortune-core {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: grid;
	place-items: center;
	padding: clamp(1.1rem, 3vw, 1.8rem);
	background: radial-gradient(circle at center, rgba(42, 57, 136, 0.95) 0%, rgba(10, 14, 38, 0.98) 72%);
	border: 1px solid rgba(169, 181, 255, 0.22);
	box-shadow: inset 0 0 34px rgba(130, 151, 255, 0.24);
	position: relative;
	z-index: 3;
}

.phrase {
	margin: 0;
	text-align: center;
	font-size: clamp(1rem, 2.8vw, 1.35rem);
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
	transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
	padding: clamp(0.85rem, 2.4vw, 1.15rem);
	border-radius: 12px;
	background: linear-gradient(160deg, rgba(67, 86, 196, 0.32) 0%, rgba(22, 30, 71, 0.66) 100%);
	border: 1px solid rgba(166, 177, 255, 0.25);
	position: relative;
}

.phrase::before,
.phrase::after {
	position: absolute;
	font-size: 1.5rem;
	font-weight: 800;
	color: rgba(178, 190, 255, 0.5);
}

.phrase::before {
	content: '“';
	left: 0.65rem;
	top: 0.4rem;
}

.phrase::after {
	content: '”';
	right: 0.65rem;
	bottom: 0.2rem;
}

.card.is-loading .phrase {
	opacity: 0.55;
	transform: translateY(2px);
	filter: blur(0.6px);
	animation: phraseBreath 1.1s ease-in-out infinite;
}

.card.is-loading .fortune-shell {
	animation: oracleShake 680ms ease-in-out infinite;
	filter: saturate(1.15);
	box-shadow:
		inset 0 20px 55px rgba(255, 255, 255, 0.05),
		0 22px 56px rgba(32, 53, 167, 0.45);
}

.card.is-loading .fortune-core {
	animation: oraclePulse 900ms ease-in-out infinite;
}

.card.is-loading {
	animation-duration: 3.6s, 1.25s;
}

.card.is-loading::after {
	opacity: 1;
	animation: scanLine 1.3s linear infinite;
}

.meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	position: relative;
	z-index: 2;
}

.reject-stamp {
	position: absolute;
	right: 1.25rem;
	bottom: 5.2rem;
	margin: 0;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	color: rgba(255, 126, 126, 0.95);
	border: 2px solid rgba(255, 126, 126, 0.9);
	border-radius: 8px;
	padding: 0.3rem 0.55rem;
	transform: rotate(-14deg) scale(0.6);
	opacity: 0;
	text-shadow: 0 0 10px rgba(255, 88, 88, 0.25);
	background: rgba(45, 7, 11, 0.25);
	pointer-events: none;
	z-index: 3;
}

.card.is-stamped .reject-stamp {
	animation: stampIn 560ms cubic-bezier(0.18, 0.82, 0.24, 1);
}

.badge {
	font-size: 0.8rem;
	color: #c5cbff;
	background: rgba(98, 110, 241, 0.2);
	border: 1px solid rgba(151, 161, 255, 0.4);
	border-radius: 999px;
	padding: 0.35rem 0.75rem;
}

.time {
	font-size: 0.85rem;
	color: #98a0d1;
}

.cta {
	border: 0;
	border-radius: 12px;
	padding: 0.9rem 1.1rem;
	font-size: 1rem;
	font-weight: 700;
	color: #0a0f25;
	background: linear-gradient(135deg, #8fa3ff 0%, #7ce4ff 100%);
	cursor: pointer;
	transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
	position: relative;
	overflow: hidden;
	z-index: 2;
}

.cta::after {
	content: '';
	position: absolute;
	top: 0;
	left: -40%;
	width: 30%;
	height: 100%;
	background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
	transform: skewX(-20deg);
	transition: left 320ms ease;
}

.cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(124, 228, 255, 0.25);
	filter: saturate(1.1);
}

.cta:hover::after {
	left: 115%;
}

.cta:active {
	transform: translateY(0);
}

.cta:disabled {
	opacity: 0.65;
	cursor: wait;
}

.cta.is-loading {
	filter: saturate(0.95);
}

.cta.is-loading::after {
	left: -50%;
	animation: buttonSweep 1s linear infinite;
}

body.is-fetching::before {
	animation-duration: 7.5s;
	opacity: 0.58;
}

body.is-fetching::after {
	animation-duration: 8.5s;
	opacity: 0.56;
}

@media (prefers-reduced-motion: reduce) {
	body::before,
	body::after,
	.phrase,
	.cta {
		transition: none;
		animation: none;
	}

	body,
	.card::after {
		animation: none;
	}

	.card {
		animation: none;
	}

	.no-chip,
	.reject-stamp,
	.card.is-stamped .reject-stamp {
		animation: none !important;
	}

	.rain-chip {
		animation: none !important;
	}

	.fortune-shell,
	.fortune-shell.is-revealed,
	.card.is-loading .fortune-shell,
	.card.is-loading .fortune-core {
		animation: none !important;
	}
}

@keyframes auroraFlow {
	0%,
	100% {
		background-position: 0% 0%, 100% 0%, 50% 50%;
	}
	50% {
		background-position: 18% 20%, 82% 30%, 50% 65%;
	}
}

@keyframes driftOne {
	0%,
	100% {
		transform: translateY(0) translateX(0);
	}
	50% {
		transform: translateY(-20px) translateX(12px);
	}
}

@keyframes driftTwo {
	0%,
	100% {
		transform: translateY(0) translateX(0);
	}
	50% {
		transform: translateY(16px) translateX(-14px);
	}
}

@keyframes scanLine {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

@keyframes phraseBreath {
	0%,
	100% {
		opacity: 0.45;
		transform: translateY(2px) scale(0.995);
	}
	50% {
		opacity: 0.72;
		transform: translateY(0) scale(1);
	}
}

@keyframes buttonSweep {
	0% {
		left: -50%;
	}
	100% {
		left: 120%;
	}
}

@keyframes oracleShake {
	0%,
	100% {
		transform: rotate(0deg) translateY(0);
	}
	25% {
		transform: rotate(-1deg) translateY(-2px);
	}
	75% {
		transform: rotate(1deg) translateY(2px);
	}
}

@keyframes oraclePulse {
	0%,
	100% {
		box-shadow: inset 0 0 14px rgba(130, 151, 255, 0.1);
	}
	50% {
		box-shadow: inset 0 0 36px rgba(140, 165, 255, 0.34);
	}
}

@keyframes revealSpin {
	0% {
		transform: rotate(0deg) scale(0.98);
	}
	55% {
		transform: rotate(10deg) scale(1.01);
	}
	100% {
		transform: rotate(0deg) scale(1);
	}
}

@keyframes rainDrop {
	0% {
		opacity: 0;
		transform: translateY(-10vh) translateX(0) rotate(0deg);
	}
	12% {
		opacity: 0.52;
	}
	86% {
		opacity: 0.48;
	}
	100% {
		opacity: 0;
		transform: translateY(115vh) translateX(var(--chip-drift, 12px)) rotate(var(--chip-rotation, 5deg));
	}
}

@keyframes stampIn {
	0% {
		opacity: 0;
		transform: rotate(-14deg) scale(0.5);
	}
	50% {
		opacity: 0.98;
		transform: rotate(-14deg) scale(1.12);
	}
	100% {
		opacity: 0.82;
		transform: rotate(-14deg) scale(1);
	}
}

@keyframes borderFlow {
	0% {
		background-position: 0 0, 0% 50%;
	}
	100% {
		background-position: 0 0, 100% 50%;
	}
}

@keyframes borderGlow {
	0%,
	100% {
		box-shadow:
			0 22px 70px rgba(3, 5, 16, 0.65),
			0 0 0 rgba(110, 230, 255, 0),
			inset 0 1px 0 rgba(255, 255, 255, 0.08);
	}
	50% {
		box-shadow:
			0 22px 70px rgba(3, 5, 16, 0.65),
			0 0 18px rgba(120, 234, 255, 0.2),
			inset 0 1px 0 rgba(255, 255, 255, 0.12);
	}
}

@media (max-width: 560px) {
	body {
		padding: 1rem;
	}

	.meta {
		flex-direction: column;
		align-items: flex-start;
	}

	.reject-stamp {
		right: 1rem;
		bottom: 5rem;
	}

	.fortune-core {
		padding: 1.2rem;
	}

}
