/* ==========================================================================
   SUPER — 21+ Age Verification Gate
   Visible by default; hidden as soon as the head check finds a valid choice.
   ========================================================================== */

html.sp-age-pending,
html.sp-age-denied { overflow: hidden !important; }
html.sp-age-pending body,
html.sp-age-denied body { overflow: hidden !important; }
html.sp-age-ok .sp-gate { display: none !important; }

.sp-gate {
	--g-accent: #ff2d55;
	--g-accent-2: #ff7a18;
	--g-cyan: #29f0ff;
	--g-text: #f5f5f7;
	--g-muted: #9d9daa;

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: grid;
	place-items: center;
	padding: clamp(1.25rem, 4vw, 3rem);
	background: #000;
	color: var(--g-text);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	overflow: hidden auto;
	transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s;
	-webkit-font-smoothing: antialiased;
}
.sp-gate *,
.sp-gate *::before,
.sp-gate *::after { box-sizing: border-box; }

/* Exit transition */
.sp-gate.is-leaving { opacity: 0; transform: scale(1.08); filter: blur(10px); pointer-events: none; }
.sp-gate.is-leaving .sp-gate__panel { transform: translateY(-14px) scale(0.98); }

/* ---------- Atmosphere ---------- */
.sp-gate__stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.sp-gate__grain {
	position: absolute; inset: -100%;
	opacity: 0.11;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
	animation: sp-gate-grain 0.9s steps(6) infinite;
}
@keyframes sp-gate-grain {
	0% { transform: translate(0, 0); }
	20% { transform: translate(-6%, 4%); }
	40% { transform: translate(5%, -7%); }
	60% { transform: translate(-3%, 9%); }
	80% { transform: translate(8%, 2%); }
	100% { transform: translate(0, 0); }
}
.sp-gate__vignette {
	position: absolute; inset: 0; pointer-events: none;
	background:
		radial-gradient(60% 45% at 50% 42%, rgba(255, 45, 85, 0.16) 0%, transparent 70%),
		radial-gradient(40% 35% at 70% 75%, rgba(123, 97, 255, 0.12) 0%, transparent 70%),
		radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.9) 100%);
}
.sp-gate__scan {
	position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
	background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px);
	mix-blend-mode: overlay;
}
.sp-gate__scan::after {
	content: ""; position: absolute; left: 0; right: 0; height: 22vh; top: -22vh;
	background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.06), transparent);
	animation: sp-gate-sweep 7s linear infinite;
}
@keyframes sp-gate-sweep { to { transform: translateY(130vh); } }

/* ---------- Panel ---------- */
.sp-gate__panel {
	position: relative;
	z-index: 2;
	width: min(100%, 980px);
	text-align: center;
	transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.sp-gate__panel > * { opacity: 0; transform: translateY(18px); animation: sp-gate-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.sp-gate__panel > :nth-child(1) { animation-delay: 0.1s; }
.sp-gate__panel > :nth-child(2) { animation-delay: 0.35s; }
.sp-gate__panel > :nth-child(3) { animation-delay: 0.5s; }
.sp-gate__panel > :nth-child(4) { animation-delay: 0.68s; }
.sp-gate__panel > :nth-child(5) { animation-delay: 0.68s; }
@keyframes sp-gate-in { to { opacity: 1; transform: none; } }

/* Logo */
.sp-gate__brand { margin-bottom: clamp(1.25rem, 3vw, 2rem); display: flex; flex-direction: column; align-items: center; gap: clamp(1rem, 2.5vw, 1.5rem); }
.sp-gate__mark { width: clamp(60px, 9vw, 84px); height: auto; border-radius: 22%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px -14px rgba(255, 45, 85, 0.75); animation: sp-gate-pulse 3.6s ease-in-out infinite; }
@keyframes sp-gate-pulse { 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 20px 70px -10px rgba(255, 122, 24, 0.9); } }
.sp-gate__logo-img { max-width: min(80vw, 460px); max-height: 180px; width: auto; height: auto; filter: drop-shadow(0 0 30px rgba(255, 45, 85, 0.35)); }
.sp-gate__logo {
	position: relative;
	display: inline-block;
	font-family: "Inter", system-ui, sans-serif;
	font-weight: 800;
	font-style: normal;
	text-transform: uppercase;
	font-size: clamp(1.8rem, 8vw, 5.5rem);
	line-height: 1;
	letter-spacing: 0.01em;
	color: #fff;
	text-shadow: 0 0 22px rgba(255, 45, 85, 0.45), 0 0 60px rgba(255, 122, 24, 0.25);
	white-space: nowrap;
}
.sp-gate__logo::before,
.sp-gate__logo::after {
	content: attr(data-text);
	position: absolute; inset: 0;
	pointer-events: none;
	text-shadow: none;
}
.sp-gate__logo::before { color: var(--g-cyan); mix-blend-mode: screen; animation: sp-glitch-a 3.6s infinite steps(1); }
.sp-gate__logo::after { color: var(--g-accent); mix-blend-mode: screen; animation: sp-glitch-b 3.6s infinite steps(1); }

@keyframes sp-glitch-a {
	0%, 86%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
	87% { transform: translate(-4px, -1px); clip-path: inset(12% 0 64% 0); }
	89% { transform: translate(5px, 1px); clip-path: inset(58% 0 18% 0); }
	91% { transform: translate(-3px, 0); clip-path: inset(32% 0 46% 0); }
	93% { transform: translate(2px, -2px); clip-path: inset(78% 0 4% 0); }
	95% { transform: none; clip-path: inset(0 0 100% 0); }
}
@keyframes sp-glitch-b {
	0%, 86%, 100% { transform: none; clip-path: inset(100% 0 0 0); }
	88% { transform: translate(4px, 1px); clip-path: inset(66% 0 10% 0); }
	90% { transform: translate(-5px, 0); clip-path: inset(20% 0 58% 0); }
	92% { transform: translate(3px, 2px); clip-path: inset(44% 0 36% 0); }
	94% { transform: none; clip-path: inset(100% 0 0 0); }
}

/* 21+ rule */
.sp-gate__rule {
	display: flex; align-items: center; justify-content: center; gap: 1rem;
	margin: 0 auto clamp(1rem, 2.5vw, 1.5rem);
	max-width: 420px;
}
.sp-gate__rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); }
.sp-gate__rule b {
	font-family: "Manrope", system-ui, sans-serif; font-weight: 900; font-size: 0.85rem; letter-spacing: 0.25em;
	padding: 0.35rem 0.8rem 0.35rem 1.05rem; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.04);
}

/* Heading */
.sp-gate .sp-gate__title {
	position: relative;
	margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
	font-family: "Oswald", "Arial Narrow", system-ui, sans-serif;
	font-weight: 800;
	font-size: clamp(1.05rem, 0.7rem + 1.8vw, 1.75rem);
	letter-spacing: 0.28em;
	text-indent: 0.28em;
	text-transform: uppercase;
	line-height: 1.35;
	color: var(--g-text);
}
.sp-gate__title::before,
.sp-gate__title::after {
	content: attr(data-text);
	position: absolute; inset: 0;
	pointer-events: none;
	opacity: 0.8;
}
.sp-gate__title::before { color: var(--g-cyan); animation: sp-glitch-a 5.2s 1.2s infinite steps(1); }
.sp-gate__title::after { color: var(--g-accent); animation: sp-glitch-b 5.2s 1.2s infinite steps(1); }

/* Buttons */
.sp-gate__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }
.sp-gate__btn {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 220px;
	min-height: 60px;
	padding: 0 2rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.03);
	color: var(--g-text);
	font-family: "Oswald", "Arial Narrow", system-ui, sans-serif;
	font-weight: 800;
	font-size: 0.95rem;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s, border-color 0.25s, background-color 0.25s, color 0.25s;
	-webkit-tap-highlight-color: transparent;
}
.sp-gate__btn span { position: relative; z-index: 1; }
.sp-gate__btn--enter {
	border-color: transparent;
	background: linear-gradient(115deg, var(--g-accent) 0%, var(--g-accent-2) 100%);
	color: #fff;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 18px 50px -14px rgba(255, 45, 85, 0.75);
}
.sp-gate__btn--enter::before {
	content: ""; position: absolute; inset: 0; z-index: 0;
	background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
	transform: translateX(-120%);
	animation: sp-gate-shine 3.2s 1.6s infinite;
}
@keyframes sp-gate-shine { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }
.sp-gate__btn--enter:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 24px 60px -12px rgba(255, 45, 85, 0.9); }
.sp-gate__btn--leave:hover { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }
.sp-gate__btn:active { transform: translateY(0) scale(0.98); }
.sp-gate .sp-gate__btn:focus-visible { outline: 2px solid var(--g-cyan); outline-offset: 4px; border-radius: 999px; }

.sp-gate .sp-gate__note {
	margin: clamp(1.25rem, 3vw, 1.75rem) auto 0;
	max-width: 46ch;
	color: var(--g-muted);
	font-size: 0.8rem;
	line-height: 1.6;
	letter-spacing: 0.02em;
}

/* Denied state */
.sp-gate__denied { display: none; }
html.sp-age-denied .sp-gate__ask,
.sp-gate.is-denied .sp-gate__ask { display: none; }
html.sp-age-denied .sp-gate__denied,
.sp-gate.is-denied .sp-gate__denied { display: block; animation: sp-gate-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.sp-gate .sp-gate__denied-title {
	display: inline-block;
	margin: 0 0 0.75rem;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 77, 94, 0.5);
	background: rgba(255, 77, 94, 0.1);
	color: #ff6b7a;
	font-family: "Manrope", system-ui, sans-serif;
	font-weight: 800; font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase;
}
.sp-gate .sp-gate__denied-text { margin: 0 auto 1.5rem; max-width: 40ch; color: var(--g-text); font-size: 1.05rem; }
.sp-gate.is-denied .sp-gate__title::before,
.sp-gate.is-denied .sp-gate__title::after,
html.sp-age-denied .sp-gate__title::before,
html.sp-age-denied .sp-gate__title::after { animation-duration: 1.4s; }

/* Shake on deny */
.sp-gate.is-shaking .sp-gate__panel { animation: sp-gate-shake 0.45s; }
@keyframes sp-gate-shake {
	20% { transform: translateX(-10px); }
	40% { transform: translateX(9px); }
	60% { transform: translateX(-6px); }
	80% { transform: translateX(4px); }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
	.sp-gate__actions { flex-direction: column; align-items: stretch; }
	.sp-gate__btn { min-width: 0; width: 100%; min-height: 56px; }
	.sp-gate .sp-gate__title { letter-spacing: 0.16em; text-indent: 0.16em; }
}
@media (max-height: 520px) and (orientation: landscape) {
	.sp-gate { place-items: start center; }
	.sp-gate__logo { font-size: clamp(2rem, 8vh + 1rem, 3.5rem); }
	.sp-gate__brand { margin-bottom: 0.75rem; }
	.sp-gate .sp-gate__title { margin-bottom: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
	.sp-gate, .sp-gate * { animation: none !important; transition-duration: 0.01ms !important; }
	.sp-gate__panel > * { opacity: 1; transform: none; }
	.sp-gate__logo::before, .sp-gate__logo::after, .sp-gate__title::before, .sp-gate__title::after { display: none; }
}
