/* CDX Spin Wheel — front end. Everything is namespaced under .cdxsw- to stay out of theme styles. */

html.cdxsw-lock,
html.cdxsw-lock body {
	overflow: hidden !important;
}

.cdxsw-overlay {
	--cdxsw-primary: #e11d74;
	--cdxsw-btn-text: #fff;
	--cdxsw-panel-bg: #fff;
	--cdxsw-panel-text: #1f2937;
	--cdxsw-overlay: rgba(17, 12, 34, .72);
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--cdxsw-overlay);
	opacity: 0;
	transition: opacity .25s ease;
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}
.cdxsw-overlay[hidden] {
	display: none;
}
.cdxsw-overlay.is-open {
	opacity: 1;
}
.cdxsw-overlay *,
.cdxsw-overlay *::before,
.cdxsw-overlay *::after {
	box-sizing: border-box;
}

.cdxsw-modal {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 880px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	border-radius: 22px;
	background: var(--cdxsw-panel-bg);
	color: var(--cdxsw-panel-text);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
	font-family: inherit;
	line-height: 1.45;
	transform: translateY(18px) scale(.97);
	transition: transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.cdxsw-overlay.is-open .cdxsw-modal {
	transform: none;
}

.cdxsw-close {
	position: absolute;
	top: 10px;
	inset-inline-end: 12px;
	z-index: 5;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .06);
	color: inherit;
	font-size: 26px;
	line-height: 36px;
	cursor: pointer;
	transition: background .2s;
}
.cdxsw-close:hover,
.cdxsw-close:focus-visible {
	background: rgba(0, 0, 0, .14);
}

/* Wheel column */
.cdxsw-wheel-col {
	flex: 0 0 52%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 34px 26px;
	background: #2a0f3a var(--cdxsw-bg-image, none) center / cover no-repeat;
}
.cdxsw-wheel {
	position: relative;
	width: 100%;
	max-width: 400px;
	aspect-ratio: 1 / 1;
	user-select: none;
	-webkit-user-select: none;
}
.cdxsw-rotor {
	position: absolute;
	top: 50%;
	left: 50%;
	translate: -50% -50%;
	border-radius: 50%;
	will-change: transform;
	animation: cdxsw-idle 4s ease-in-out infinite;
}
.cdxsw-wheel.is-spinning .cdxsw-rotor,
.cdxsw-modal.has-result .cdxsw-rotor {
	animation: none;
}
.cdxsw-rotor svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, .12), inset 0 0 18px rgba(0, 0, 0, .3);
}
.cdxsw-seg-label,
.cdxsw-seg-sub {
	font-family: inherit;
	paint-order: stroke;
	stroke: rgba(0, 0, 0, .12);
	stroke-width: .4px;
}
.cdxsw-frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45));
}
.cdxsw-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 19%;
	height: auto;
	translate: -50% -50%;
	pointer-events: none;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35));
}
.cdxsw-pointer {
	position: absolute;
	top: -3%;
	left: 50%;
	width: 11%;
	height: auto;
	translate: -50% 0;
	transform-origin: 50% 18%;
	pointer-events: none;
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4));
	z-index: 2;
}
.cdxsw-wheel.is-spinning .cdxsw-pointer {
	animation: cdxsw-tick .14s ease-in-out infinite alternate;
}

/* CSS fallbacks when no artwork is used */
.cdxsw-no-frame .cdxsw-rotor {
	box-shadow: 0 0 0 10px var(--cdxsw-primary), 0 12px 30px rgba(0, 0, 0, .35);
}
.cdxsw-hub-css {
	width: 16%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff, #e5e7eb 45%, #9ca3af);
	border: 4px solid var(--cdxsw-primary);
}
.cdxsw-pointer-css {
	top: -4%;
	width: 0;
	height: 0;
	border-inline: 16px solid transparent;
	border-top: 30px solid var(--cdxsw-primary);
}

/* Body column */
.cdxsw-body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 40px 34px 30px;
	overflow-y: auto;
	text-align: center;
}
.cdxsw-logo {
	display: block;
	max-width: 140px;
	max-height: 60px;
	margin: 0 auto 14px;
	object-fit: contain;
}
.cdxsw-title,
.cdxsw-result-title {
	margin: 0 0 8px;
	color: inherit;
	font-size: clamp(24px, 3.2vw, 32px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.01em;
}
.cdxsw-subtitle,
.cdxsw-result-text {
	margin: 0 0 20px;
	font-size: 16px;
	opacity: .85;
}

.cdxsw-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	text-align: start;
}
.cdxsw-form[hidden],
.cdxsw-intro[hidden],
.cdxsw-result[hidden] {
	display: none;
}
.cdxsw-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	font-size: 14px;
}
.cdxsw-label {
	font-weight: 600;
}
.cdxsw-field input {
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 14px;
	border: 1.5px solid rgba(0, 0, 0, .18);
	border-radius: 12px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 16px; /* No iOS zoom. */
	transition: border-color .15s, box-shadow .15s;
}
.cdxsw-field input:focus {
	outline: none;
	border-color: var(--cdxsw-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdxsw-primary) 25%, transparent);
}
.cdxsw-consent {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 8px;
	align-items: start;
	margin: 0;
	font-size: 13px;
	opacity: .9;
}
.cdxsw-consent input {
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--cdxsw-primary);
}
.cdxsw-consent .cdxsw-error {
	grid-column: 1 / -1;
}
.cdxsw-consent a {
	color: inherit;
	text-decoration: underline;
}
.cdxsw-error,
.cdxsw-form-error {
	margin: 0;
	color: #dc2626;
	font-size: 13px;
	font-weight: 600;
}
.cdxsw-error:empty,
.cdxsw-form-error:empty {
	display: none;
}
.cdxsw-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
}

.cdxsw-btn,
.cdxsw-open {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	margin: 6px 0 0;
	padding: 12px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--cdxsw-primary);
	color: var(--cdxsw-btn-text) !important;
	font: inherit;
	font-size: 18px;
	font-weight: 800;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 10px 22px color-mix(in srgb, var(--cdxsw-primary) 40%, transparent);
	transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.cdxsw-btn:hover,
.cdxsw-open:hover {
	transform: translateY(-1px);
	filter: brightness(1.06);
}
.cdxsw-btn:disabled {
	cursor: progress;
	opacity: .75;
	transform: none;
}
.cdxsw-btn:focus-visible,
.cdxsw-open:focus-visible,
.cdxsw-decline:focus-visible,
.cdxsw-continue:focus-visible,
.cdxsw-copy:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--cdxsw-primary) 55%, transparent);
	outline-offset: 2px;
}
.cdxsw-decline,
.cdxsw-continue {
	align-self: center;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	opacity: .7;
	cursor: pointer;
}
.cdxsw-note {
	margin: 4px 0 0;
	font-size: 12px;
	text-align: center;
	opacity: .65;
}

/* Result */
.cdxsw-result {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	animation: cdxsw-pop .45s cubic-bezier(.2, .9, .3, 1.3);
}
.cdxsw-result .cdxsw-result-title {
	color: var(--cdxsw-primary);
}
.cdxsw-already {
	margin: 0;
	font-size: 14px;
	opacity: .75;
}
.cdxsw-code-box {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "label label" "code copy";
	gap: 6px 10px;
	align-items: center;
	padding: 14px 16px;
	border: 2px dashed var(--cdxsw-primary);
	border-radius: 14px;
	background: color-mix(in srgb, var(--cdxsw-primary) 7%, transparent);
	text-align: start;
}
.cdxsw-code-label {
	grid-area: label;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	opacity: .7;
}
.cdxsw-code {
	grid-area: code;
	padding: 0;
	background: none;
	color: inherit;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: .04em;
	word-break: break-all;
}
.cdxsw-copy {
	grid-area: copy;
	padding: 8px 14px;
	border: 0;
	border-radius: 10px;
	background: var(--cdxsw-panel-text);
	color: var(--cdxsw-panel-bg);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.cdxsw-expires {
	margin: 0;
	font-size: 13px;
	opacity: .7;
}

.cdxsw-countdown {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 8px;
	margin: -2px 0 2px;
	font-size: 14px;
	font-weight: 600;
}
.cdxsw-countdown-clock {
	padding: 4px 10px;
	border-radius: 8px;
	background: var(--cdxsw-panel-text);
	color: var(--cdxsw-panel-bg);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .05em;
	font-variant-numeric: tabular-nums;
}
.cdxsw-countdown.is-expired {
	color: #dc2626;
}

.cdxsw-confetti {
	position: fixed;
	inset: 0;
	z-index: 2147483100; /* Above the popup overlay. */
	width: 100vw;
	height: 100vh;
	pointer-events: none;
}

/* Floating launcher */
.cdxsw-launcher-wrap {
	position: fixed;
	bottom: 20px;
	z-index: 2147482000;
	display: inline-flex;
	align-items: flex-start;
	animation: cdxsw-bob 3s ease-in-out infinite;
}
.cdxsw-launcher-wrap[hidden] {
	display: none;
}
.cdxsw-launcher-left {
	left: 20px;
}
.cdxsw-launcher-right {
	right: 20px;
}
.cdxsw-launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 50px;
	margin: 0;
	padding: 10px 18px 10px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--cdxsw-primary, #e11d74);
	color: var(--cdxsw-btn-text, #fff);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
}
.cdxsw-launcher-icon {
	display: inline-flex;
}
.cdxsw-launcher-close {
	width: 24px;
	height: 24px;
	margin: -8px -10px 0 -6px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #374151;
	color: #fff;
	font-size: 15px;
	line-height: 18px;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.cdxsw-launcher-close:hover,
.cdxsw-launcher-close:focus-visible {
	background: #111827;
}

/* Free-product prize */
.cdxsw-gift {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--cdxsw-primary) 7%, transparent);
	font-weight: 700;
	text-align: start;
}
.cdxsw-gift img {
	width: 64px;
	height: 64px;
	border-radius: 10px;
	object-fit: cover;
	background: #fff;
}
.cdxsw-gift-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cdxsw-gift-prices {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}
.cdxsw-gift-prices del {
	opacity: .55;
	font-weight: 500;
}
.cdxsw-gift-prices ins {
	color: var(--cdxsw-primary);
	font-size: 1.25em;
	font-weight: 800;
	text-decoration: none;
}
.cdxsw-other {
	margin-top: -6px;
	font-size: 13px;
}
@keyframes cdxsw-idle {
	0%, 100% { rotate: -4deg; }
	50% { rotate: 4deg; }
}
@keyframes cdxsw-tick {
	from { rotate: -9deg; }
	to { rotate: 7deg; }
}
@keyframes cdxsw-pop {
	from { opacity: 0; transform: scale(.9); }
	to { opacity: 1; transform: none; }
}
@keyframes cdxsw-bob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

/* Mobile: stack, compact wheel on top */
@media (max-width: 767px) {
	.cdxsw-overlay {
		align-items: flex-end;
		padding: 0;
	}
	.cdxsw-modal {
		flex-direction: column;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 22px 22px 0 0;
		overflow-y: auto;
	}
	.cdxsw-wheel-col {
		flex: 0 0 auto;
		padding: 26px 16px 18px;
	}
	.cdxsw-wheel {
		max-width: min(300px, 74vw);
	}
	.cdxsw-body {
		padding: 20px 16px 22px;
		overflow: visible;
	}
	.cdxsw-title,
	.cdxsw-result-title {
		font-size: 24px;
	}
	.cdxsw-subtitle {
		margin-bottom: 14px;
		font-size: 15px;
	}
	.cdxsw-close {
		background: rgba(255, 255, 255, .85);
		color: #111;
	}
	.cdxsw-launcher-wrap {
		bottom: 14px;
	}
	.cdxsw-launcher {
		padding: 10px 14px;
	}
	.cdxsw-launcher-left {
		left: 14px;
	}
	.cdxsw-launcher-right {
		right: 14px;
	}
	.cdxsw-launcher-text {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cdxsw-rotor,
	.cdxsw-launcher-wrap,
	.cdxsw-result {
		animation: none !important;
	}
	.cdxsw-overlay,
	.cdxsw-modal {
		transition: none;
	}
}
