* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	color: #0b1220;
	background: radial-gradient(circle at 20% 20%, rgba(14,165,233,0.15), transparent 30%),
							radial-gradient(circle at 80% 0%, rgba(139,92,246,0.16), transparent 32%),
							#050914;
	min-height: 100svh;
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
	-webkit-tap-highlight-color: transparent;
}
.bg-shape { animation: bgPulse 10s ease-in-out infinite alternate, auroraMove 18s ease-in-out infinite; }
@keyframes bgPulse { from { opacity: 0.7; } to { opacity: 1; } }
@keyframes auroraMove {
	0% { transform: translate3d(-2%, -2%, 0) scale(1); filter: hue-rotate(0deg); }
	50% { transform: translate3d(1%, 0, 0) scale(1.08); filter: hue-rotate(45deg); }
	100% { transform: translate3d(3%, 2%, 0) scale(1.02); filter: hue-rotate(90deg); }
}
.bg-shape {
	position: fixed;
	inset: 0;
	background: linear-gradient(135deg, rgba(14,165,233,0.12), rgba(139,92,246,0.12));
	filter: blur(70px);
	opacity: 0.9;
	pointer-events: none;
}
.container {
	position: relative;
	max-width: 720px;
	margin: 8vh auto;
	padding: 32px 32px 28px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 20px;
	box-shadow: 0 25px 70px rgba(0,0,0,0.35);
	backdrop-filter: blur(10px);
	color: #e2e8f0;
	animation: cardIn .5s ease-out both;
}
@keyframes cardIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
.eyebrow { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #67e8f9; font-weight: 600; }
.title { margin: 0 0 8px; font-size: 30px; line-height: 1.2; color: #f8fafc; }
.subtitle { margin: 0 0 22px; color: #cbd5e1; }
.code-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.label { grid-column: 1/-1; font-weight: 600; color: #e2e8f0; }
.input {
	padding: 14px 16px;
	border: 1px solid rgba(148, 163, 184, 0.5);
	border-radius: 12px;
	font-size: 18px;
	min-height: 48px;
	outline: none;
	background: rgba(15, 23, 42, 0.6);
	color: #e2e8f0;
	transition: border-color 0.2s, box-shadow 0.2s, transform 0.08s;
}
.input::placeholder { color: #94a3b8; }
.input:focus { border-color: #67e8f9; box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.25); transform: translateY(-1px); }
.button {
	-webkit-appearance: none;
	appearance: none;
	padding: 14px 18px;
	border: none;
	border-radius: 12px;
	background: linear-gradient(120deg, #0ea5e9, #6366f1);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.05s, box-shadow 0.2s;
	box-shadow: 0 10px 30px rgba(14, 165, 233, 0.3);
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}
.button:hover { background: linear-gradient(120deg, #22d3ee, #8b5cf6); box-shadow: 0 12px 34px rgba(99, 102, 241, 0.35); }
.spinner { display: none; }
.button .spinner {
	width: 18px; height: 18px;
	border: 2px solid rgba(255,255,255,0.6);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	will-change: transform;
}
@keyframes spin { to { transform: rotate(360deg); } }
.button.loading { opacity: 0.95; pointer-events: none; }
.button.loading .spinner { display: inline-block; }
.button:active { transform: translateY(1px); }
.status { grid-column: 1/-1; min-height: 22px; font-size: 14px; color: #e2e8f0; }
.unlock { margin-top: 16px; }
.unlock[hidden] { display:none !important; }
.unlock-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.unlock-text { font-weight:600; color:#67e8f9; }
.unlock .lock { font-size:20px; animation: lockWiggle 1.1s ease-in-out infinite; }
@keyframes lockWiggle { 0%,100%{ transform:rotate(0deg);} 30%{ transform:rotate(-8deg);} 60%{ transform:rotate(6deg);} }
.progress { position:relative; height:8px; border-radius:999px; background: rgba(148,163,184,0.25); overflow:hidden; }
.progress .bar { position:absolute; left:0; top:0; height:100%; width:0%; background: linear-gradient(90deg, #22d3ee, #8b5cf6); box-shadow: 0 0 16px rgba(34,211,238,0.35); transition: width .9s ease; }
.clue { margin-top: 22px; display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.98); transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease; }
.clue[hidden] { display: none !important; }
.clue.visible { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.0); }
.clue img { max-width: 100%; border-radius: 14px; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
.clue img { max-height: min(70svh, 800px); object-fit: contain; }
.clue.img-loading::before {
	content: '';
	position: absolute;
	width: 80%;
	max-width: 720px;
	height: min(42svh, 420px);
	border-radius: 14px;
	background: linear-gradient(90deg, rgba(148,163,184,0.20) 0%, rgba(148,163,184,0.30) 50%, rgba(148,163,184,0.20) 100%);
	animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { opacity: .7; transform: translateX(-15%); } 100% { opacity: 1; transform: translateX(15%); } }

/* Success rings */
.ring { position: absolute; border: 2px solid rgba(34,211,238,0.6); border-radius: 9999px; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0.9; }
@keyframes ringExpand { from { width: 10px; height: 10px; opacity: 0.9; } to { width: 500px; height: 500px; opacity: 0; } }

/* Confetti layer */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.confetti { position: absolute; width: 8px; height: 14px; opacity: 0.9; will-change: transform; }
@keyframes confFall {
	0% { transform: translate3d(var(--x,0), -10%, 0) rotate(0deg); opacity: 1; }
	80% { opacity: 1; }
	100% { transform: translate3d(var(--x,0), 110%, 0) rotate(360deg); opacity: 0; }
}

@media (max-width: 640px) {
	.container { margin: 6vh 16px; padding: 26px 22px; }
	.code-form { grid-template-columns: 1fr; }
	.button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}