/* ==========================================================================
   Popup de bienvenida: tarjeta para rascar (solo portada)
   ========================================================================== */

html.sc-welcome-open { overflow: hidden; }

.sc-welcome {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.sc-welcome [hidden] { display: none !important; }

.sc-welcome__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 5, 6, .72);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .35s ease;
}
.sc-welcome.is-open .sc-welcome__backdrop { opacity: 1; }

/* Tarjeta */
@property --sc-angle {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}
.sc-welcome__card {
	position: relative;
	width: 100%;
	max-width: 392px;
	box-sizing: border-box;
	padding: 30px 24px 20px;
	border-radius: 24px;
	background:
		radial-gradient(120% 70% at 50% 0%, rgba(46, 230, 230, .17), transparent 60%),
		radial-gradient(80% 60% at 100% 100%, rgba(255, 79, 139, .10), transparent 70%),
		#111114;
	color: var(--sc-text, #f5f5f4);
	text-align: center;
	box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .9), 0 0 70px -24px rgba(46, 230, 230, .55);
	opacity: 0;
	transform: translateY(22px) scale(.92) rotate(-2deg);
	transition: opacity .35s ease, transform .55s cubic-bezier(.2, .9, .25, 1.25);
	outline: none;
}
.sc-welcome.is-open .sc-welcome__card { opacity: 1; transform: none; }

/* Borde neón que gira */
.sc-welcome__card::before {
	content: "";
	position: absolute;
	inset: 0;
	padding: 1.5px;
	border-radius: inherit;
	background: conic-gradient(from var(--sc-angle), #2ee6e6, transparent 22%, #ff4f8b 50%, transparent 72%, #2ee6e6);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: sc-spin 5s linear infinite;
	pointer-events: none;
}
@keyframes sc-spin { to { --sc-angle: 360deg; } }

.sc-welcome__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--sc-border, #2a2a30);
	border-radius: 50%;
	background: rgba(10, 10, 11, .6);
	color: var(--sc-text, #f5f5f4);
	cursor: pointer;
	transition: color .2s, border-color .2s, transform .2s;
}
.sc-welcome__close:hover { color: var(--sc-neon, #2ee6e6); border-color: var(--sc-neon, #2ee6e6); transform: rotate(90deg); }

.sc-welcome__eyebrow {
	margin: 0 0 10px;
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: var(--sc-muted, #a3a3a8);
}
.sc-welcome__eyebrow::before,
.sc-welcome__eyebrow::after { content: "✦"; margin: 0 .7em; color: var(--sc-neon, #2ee6e6); }

.sc-welcome__title {
	margin: 0 0 10px;
	font-size: clamp(1.9rem, 8vw, 2.3rem);
	line-height: .98;
}
.sc-welcome__title .sc-neon { display: block; }

.sc-welcome__text {
	margin: 0 auto;
	max-width: 30ch;
	font-size: .92rem;
	line-height: 1.45;
	color: var(--sc-muted, #a3a3a8);
}

/* Zona para rascar */
.sc-scratch {
	position: relative;
	height: 136px;
	margin: 18px 0 16px;
	border-radius: 16px;
	overflow: hidden;
	background:
		radial-gradient(70% 90% at 50% 50%, rgba(46, 230, 230, .14), transparent 70%),
		#0a0a0b;
	border: 1px dashed rgba(46, 230, 230, .45);
}
.sc-scratch__prize {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
}
.sc-scratch__amount {
	font-family: var(--sc-display, Impact, sans-serif);
	font-size: 4.4rem;
	line-height: .95;
	color: var(--sc-neon, #2ee6e6);
	text-shadow: var(--sc-glow);
}
.sc-scratch__label {
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--sc-text, #f5f5f4);
}
.sc-welcome.is-revealed .sc-scratch__amount { animation: sc-pop .7s cubic-bezier(.2, .9, .25, 1.5) both; }
@keyframes sc-pop {
	0% { transform: scale(.6); }
	60% { transform: scale(1.12); }
	100% { transform: scale(1); }
}

.sc-scratch__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	touch-action: none;
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='12' fill='%23f5c84c' stroke='%23a8801c' stroke-width='2'/%3E%3Ctext x='16' y='21' font-size='13' font-family='Arial' font-weight='bold' text-anchor='middle' fill='%23a8801c'%3E%E2%82%AC%3C/text%3E%3C/svg%3E") 16 16, pointer;
	transition: opacity .5s ease;
}
.sc-scratch__canvas:focus-visible { outline: 2px solid var(--sc-neon, #2ee6e6); outline-offset: -4px; }
.sc-scratch__canvas.is-done { opacity: 0; pointer-events: none; }

/* Código y botón tras descubrirlo */
.sc-welcome__reveal { display: grid; gap: 12px; }
.sc-code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 8px 8px 16px;
	border: 1.5px dashed var(--sc-neon, #2ee6e6);
	border-radius: 14px;
	background: rgba(46, 230, 230, .06);
}
.sc-code__value {
	font-weight: 800;
	font-size: 1.15rem;
	letter-spacing: .22em;
	user-select: all;
}
.sc-code__copy {
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--sc-surface-2, #1c1c20);
	color: var(--sc-text, #f5f5f4);
	font: inherit;
	font-size: .75rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.sc-code__copy:hover { background: var(--sc-text, #f5f5f4); color: var(--sc-bg, #0a0a0b); }
.sc-code__copy.is-ok { background: var(--sc-neon, #2ee6e6); color: var(--sc-bg, #0a0a0b); }
.sc-welcome__cta {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none !important;
}
.sc-welcome .sc-welcome__cta,
.sc-welcome .sc-welcome__cta:focus {
	background: var(--sc-neon, #2ee6e6);
	color: var(--sc-bg, #0a0a0b);
	outline: none;
}
.sc-welcome .sc-welcome__cta:hover { background: var(--sc-text, #f5f5f4); box-shadow: 0 0 28px -4px rgba(46, 230, 230, .6); }
.sc-welcome .sc-welcome__cta:focus-visible { outline: 2px solid var(--sc-text, #f5f5f4); outline-offset: 3px; }

.sc-welcome__skip {
	margin: 0;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--sc-muted, #a3a3a8);
	font: inherit;
	font-size: .85rem;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.sc-welcome__skip:hover { color: var(--sc-text, #f5f5f4); }

.sc-welcome__legal {
	margin: 12px 0 0;
	font-size: .68rem;
	color: #6f6f76;
}

/* Confeti */
.sc-confetti {
	position: absolute;
	top: 52%;
	width: 8px;
	height: 12px;
	border-radius: 2px;
	pointer-events: none;
	animation: sc-confetti 1.5s cubic-bezier(.15, .7, .35, 1) both;
}
@keyframes sc-confetti {
	0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 1; }
	55% { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); opacity: 1; }
	100% { transform: translate(calc(var(--x) * 1.15), calc(var(--y) + 260px)) rotate(calc(var(--r) * 1.6)) scale(.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.sc-welcome__card { transition: opacity .2s; transform: none; }
	.sc-welcome__card::before { animation: none; }
	.sc-welcome.is-revealed .sc-scratch__amount { animation: none; }
}
