/*!
 * NC Sorteo — estilos del widget
 * Version: 1.1.2
 * https://ninjaclan.com.ar
 */

.nc-sorteo {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	--nc-sorteo-ganador: #1a7f37;
}

.nc-sorteo__badge {
	display: inline-block;
	margin: 0 0 12px;
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.4;
	border: 1px dashed currentColor;
	border-radius: 999px;
	opacity: .7;
}

.nc-sorteo__titulo {
	margin: 0 0 .25em;
}

.nc-sorteo__participan {
	margin: 0 0 1em;
	opacity: .75;
}

/* El visor: la única pieza con protagonismo. */
.nc-sorteo__visor {
	position: relative;
	display: block;
	width: max-content;
	max-width: 100%;
	box-sizing: border-box;
	min-width: 6ch;
	margin: 0 0 1.25em;
	padding: .35em 1em .6em;
	border-radius: 16px;
	background: rgba(0, 0, 0, .05);
	overflow: hidden;
}

.nc-sorteo__numero {
	font-size: clamp(64px, 18vw, 140px);
	line-height: 1.05;
	font-weight: 800;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums lining-nums;
	font-feature-settings: "tnum" 1, "lnum" 1;
	transition: color .3s ease, transform .3s ease;
}

/* Odómetro: cada dígito es una columna enmascarada con una tira 0-9 que se desplaza. */
.nc-sorteo__numero {
	--nc-mask: .18em;
	display: inline-flex;
	justify-content: center;
	line-height: 1;
	padding: var(--nc-mask) 0;
}

.nc-sorteo__digito {
	display: inline-block;
	position: relative;
	width: 1ch;
	height: 1em;
	overflow: hidden;
	transition: opacity .2s ease, width .2s ease;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--nc-mask), #000 calc(100% - var(--nc-mask)), transparent);
	mask-image: linear-gradient(to bottom, transparent, #000 var(--nc-mask), #000 calc(100% - var(--nc-mask)), transparent);
}

.nc-sorteo__digito.is-vacia {
	width: 0;
	opacity: 0;
}

.nc-sorteo__tira {
	display: block;
	will-change: transform;
	transition-property: transform;
	transition-timing-function: cubic-bezier(.3, 0, .2, 1);
}

.nc-sorteo__tira > span {
	display: block;
	height: 1em;
	line-height: 1;
	text-align: center;
}

.nc-sorteo__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.nc-sorteo.is-ganador .nc-sorteo__numero {
	color: var(--nc-sorteo-ganador);
	animation: nc-sorteo-pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes nc-sorteo-pop {
	0%   { transform: scale(.85); }
	100% { transform: scale(1); }
}

.nc-sorteo__resultado {
	display: flex;
	flex-direction: column;
	gap: .15em;
	margin-top: .25em;
	animation: nc-sorteo-reveal .5s ease .15s both;
}

@keyframes nc-sorteo-reveal {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.nc-sorteo__etiqueta {
	font-size: clamp(14px, 2.5vw, 18px);
	opacity: .75;
}

.nc-sorteo__nombre {
	font-size: clamp(22px, 5vw, 36px);
	font-weight: 700;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.nc-sorteo__email {
	font-size: clamp(14px, 2.4vw, 18px);
	overflow-wrap: anywhere;
	opacity: .8;
}

.nc-sorteo__id {
	font-size: clamp(13px, 2.2vw, 16px);
	font-variant-numeric: tabular-nums;
	opacity: .6;
}

.nc-sorteo__boton {
	display: inline-block;
	padding: .9em 2.2em;
	font-size: clamp(16px, 2.6vw, 20px);
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	border: 0;
	border-radius: 999px;
	color: #fff;
	background: #1d1d1f;
	transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
	-webkit-tap-highlight-color: transparent;
}

.nc-sorteo__boton:hover,
.nc-sorteo__boton:focus-visible {
	transform: translateY(-1px);
}

.nc-sorteo__boton:focus-visible {
	outline: 3px solid #1d1d1f;
	outline-offset: 3px;
}

.nc-sorteo__boton:active {
	transform: scale(.97);
}

.nc-sorteo__boton[disabled] {
	opacity: .5;
	cursor: wait;
	transform: none;
}

.nc-sorteo__aviso,
.nc-sorteo__error {
	margin: .5em 0 0;
	font-size: 14px;
}

.nc-sorteo__error {
	color: #b32d2e;
}

.nc-sorteo__confeti {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

@media (max-width: 767px) {
	.nc-sorteo__visor {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nc-sorteo__numero,
	.nc-sorteo__resultado,
	.nc-sorteo__boton {
		animation: none !important;
		transition: none !important;
	}
}

/* Formulario de contraseña. */
.nc-sorteo-gate {
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
}

.nc-sorteo__gate-label {
	display: block;
	margin: 0 0 .75em;
	opacity: .8;
}

.nc-sorteo__gate-fila {
	display: flex;
	gap: 8px;
	width: 100%;
}

.nc-sorteo__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: .8em 1em;
	font: inherit;
	color: inherit;
	background: rgba(0, 0, 0, .05);
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 999px;
	outline: none;
}

.nc-sorteo__input:focus-visible {
	border-color: currentColor;
}

.nc-sorteo-gate .nc-sorteo__boton {
	flex: 0 0 auto;
	font-size: inherit;
	padding: .8em 1.6em;
}

@media (max-width: 480px) {
	.nc-sorteo__gate-fila {
		flex-direction: column;
	}
	.nc-sorteo-gate .nc-sorteo__boton {
		width: 100%;
	}
}

/* El atributo hidden tiene que ganarle al display propio de cada pieza. */
.nc-sorteo [hidden] {
	display: none !important;
}
