/* Win celebration overlays (admin preview + frontend) */

.spinner-wrapper,
.wsww-preview-container,
#design_preview,
#preview-chart {
	position: relative;
}

.wsww-win-fx-layer {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 30;
}

.wsww-win-fx-piece {
	position: absolute;
	left: 50%;
	top: 50%;
	pointer-events: none;
	will-change: transform, opacity;
}

.wsww-win-fx-confetti {
	border-radius: 1px;
}

.wsww-win-fx-coin {
	border-radius: 50%;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.18);
}

.wsww-win-fx-spark {
	border-radius: 50%;
	filter: blur(0.2px);
}

.wsww-win-fx-balloon {
	border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
}

.wsww-win-fx-balloon::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 1px;
	height: 18px;
	background: currentColor;
	opacity: 0.45;
	transform: translateX(-50%);
}

.wsww-win-fx-ribbon {
	border-radius: 999px;
	transform-origin: center;
}

.wsww-win-fx-ring {
	border-radius: 50%;
	border-style: solid;
	background: transparent;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(0.2);
	opacity: 0.7;
}

.wsww-wheel-pointer.is-wobbling image,
.wsww-preview-arrow.is-wobbling image {
	transform-box: fill-box;
	transform-origin: center;
	animation: wswwPointerWobble 0.9s ease-out;
}

@keyframes wswwPointerWobble {
	0% { transform: rotate(0deg); }
	18% { transform: rotate(-18deg); }
	36% { transform: rotate(14deg); }
	54% { transform: rotate(-10deg); }
	72% { transform: rotate(6deg); }
	100% { transform: rotate(0deg); }
}

/* ——— Inline win stage (dimmed page + wheel card + win card) ——— */
/* One isolated body-level layer: theme/layout CSS cannot reach it. Text colours follow
   the wheel's own card colours; gold is used only for decoration and the CTA, so the
   design reads correctly on both light and dark card backgrounds. */

html.wsww-win-spotlight-open,
body.wsww-win-spotlight-open {
	overflow: hidden !important;
	touch-action: none;
}

.wsww-win-stage {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483647 !important;
	box-sizing: border-box;
	display: flex;
	padding: 24px 16px;
	overflow-x: hidden;
	overflow-y: auto;
	background:
		radial-gradient(ellipse 70% 60% at 50% 50%, rgba(212, 175, 55, 0.16), transparent 62%),
		rgba(6, 9, 18, 0.84);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	animation: wswwSpotlightFadeIn 0.35s ease-out;
}

@keyframes wswwSpotlightFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wswwSpotlightCardIn {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.wsww-win-stage__close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 5;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 10px;
	background: var(--from_button_background_color, rgba(127, 127, 127, 0.22));
	color: var(--from_button_color, #fff);
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	outline: 0;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.15s ease, opacity 0.15s ease;
}

/* Geometric X — centered without font glyph metrics */
.wsww-win-stage__close span {
	position: absolute;
	inset: 0;
	display: block;
	font-size: 0;
	line-height: 0;
	color: transparent;
	pointer-events: none;
}

.wsww-win-stage__close span::before,
.wsww-win-stage__close span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	border-radius: 1px;
	background: var(--from_button_color, #fff);
}

.wsww-win-stage__close span::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.wsww-win-stage__close span::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.wsww-win-stage__close:hover {
	opacity: 0.85;
}

.wsww-win-stage__close:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

.wsww-win-stage__inner {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 28px;
	width: fit-content;
	max-width: 100%;
	margin: auto; /* centres vertically; tall content scrolls from the top */
	padding: 32px;
	border-radius: 28px;
	background: var(--card_background, #ffffff);
	color: var(--card_color, #111827);
	box-shadow:
		0 0 0 1px rgba(240, 215, 140, 0.45),
		0 0 56px rgba(212, 175, 55, 0.26),
		0 32px 80px rgba(0, 0, 0, 0.55);
	animation: wswwSpotlightCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Wheel and prize sit directly on the shared panel, split by a hairline divider. */
.wsww-win-card {
	box-sizing: border-box;
	flex: 0 1 440px;
	min-width: 0;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	color: inherit;
	text-align: center;
}

.wsww-win-card--result {
	padding-left: 28px;
}

/* Wheel card (clone of the live wheel at its final angle) */
.wsww-win-card--wheel .wsww-chart {
	position: relative;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 auto !important;
	padding: 0 !important;
}

.wsww-win-card--wheel .wsww-chart svg {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	margin: 0 auto !important;
	overflow: visible;
}

/* Win card */
.wsww-win-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0 0 18px;
	animation: wswwWinIconPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.wsww-win-hero__icon {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, #fef9e7 0%, #f5e6b8 45%, #e8c547 100%);
	box-shadow:
		0 0 0 7px rgba(212, 175, 55, 0.18),
		0 12px 28px rgba(201, 162, 39, 0.4);
}

.wsww-win-hero__icon svg {
	width: 40px;
	height: 40px;
	display: block;
}

.wsww-win-card .wsww-win-hero__eyebrow {
	margin: 14px 0 0;
	padding: 0;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: inherit;
}

.wsww-win-card__body {
	width: 100%;
	text-align: center;
}

/* Campaign title becomes a quiet caption above the prize message. */
.wsww-win-card__body .description {
	margin: 0 0 10px;
	padding: 0;
}

.wsww-win-card__body .description h3,
.wsww-win-card__body .description .h3 {
	margin: 0;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.04em;
	color: inherit;
	opacity: 0.68;
}

.wsww-win-card__body .win-card,
.wsww-win-card__body .loss-card {
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.wsww-win-card__body .spin-message {
	margin: 0;
	padding: 0;
	max-height: none;
	overflow: visible;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.55;
	letter-spacing: 0;
	color: inherit;
	text-align: center;
}

/* Coupon block */
.wsww-win-card__body .wsww-coupon-reward {
	margin: 20px 0 0;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	background: rgba(212, 175, 55, 0.12);
	border: 1px dashed rgba(201, 162, 39, 0.9);
	border-radius: 14px;
}

.wsww-win-card__body .wsww-coupon-reward__title {
	margin: 0;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.75;
}

.wsww-win-card__body .wsww-coupon-reward__row {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 8px;
	width: 100%;
}

.wsww-win-card__body .wsww-coupon-code {
	flex: 1 1 140px;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: #0f172a;
	background: #ffffff;
	border: 1px solid rgba(201, 162, 39, 0.55);
	border-radius: 10px;
}

.wsww-win-card__body .wsww-copy-coupon,
.wsww-win-card__body .wsww-tyl-btn.wsww-copy-coupon {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
	padding: 10px 18px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	border: 1px solid rgba(201, 162, 39, 0.9);
	border-radius: 10px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.wsww-win-card__body .wsww-copy-coupon:hover {
	background: #e0b73d;
	color: #1a1304;
}

.wsww-win-card__body .wsww-coupon-cart-status,
.wsww-win-card__body .wsww-coupon-limit-msg {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.45;
}

/* Below ~1000px the two columns no longer fit: stack them in a single, capped-width panel. */
@media (max-width: 1000px) {
	.wsww-win-stage__inner {
		width: 100% !important;
		max-width: 560px;
		gap: 22px;
		padding: 26px 22px;
		border-radius: 22px;
	}

	.wsww-win-card {
		flex-basis: 100% !important;
	}

	/* Keep the whole wheel on screen when stacked. */
	.wsww-win-card--wheel .wsww-chart svg {
		max-height: 42vh;
	}

	/* Result first; the wheel follows beneath it, split by a divider. */
	.wsww-win-card--result {
		order: -1;
		padding: 0;
	}
}

@media (max-width: 767px) {
	.wsww-win-stage__inner {
		padding: 22px 18px;
		border-radius: 20px;
	}

	.wsww-win-card__body .spin-message {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsww-win-stage,
	.wsww-win-stage__inner,
	.wsww-win-hero {
		animation: none !important;
	}
}

.wsww-win-fx-host {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483647 !important;
	pointer-events: none !important;
	overflow: hidden !important;
}

/* ——— Full-screen win reveal ——— */

html.wsww-win-reveal-open,
body.wsww-win-reveal-open {
	overflow: hidden !important;
	/* Keep fixed overlays tied to the viewport, not a transformed/clipped ancestor. */
	touch-action: none;
}

.wsww-win-reveal,
dialog.wsww-win-reveal {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	/* Must sit above the Bootstrap spin popup (z-index 2147483647). */
	z-index: 2147483647 !important;
	display: block !important;
	box-sizing: border-box;
	overflow: hidden;
	transform: none !important;
	color: inherit;
}

.wsww-win-reveal.is-page,
dialog.wsww-win-reveal.is-page {
	z-index: 2147483647 !important;
}

/* While the win reveal is open, keep the spin popup/backdrop underneath it. */
body.wsww-win-reveal-open .modal[id^="wsww-spin-modal-"],
body.wsww-win-reveal-open .modal-backdrop,
html.wsww-win-reveal-open .modal[id^="wsww-spin-modal-"],
html.wsww-win-reveal-open .modal-backdrop {
	z-index: 2147483645 !important;
}

.wsww-win-reveal::backdrop {
	background: transparent;
}

.wsww-win-reveal__backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(ellipse 80% 60% at 50% 50%, rgba(212, 175, 55, 0.18), transparent 60%),
		radial-gradient(ellipse 100% 80% at 50% 100%, rgba(15, 23, 42, 0.55), transparent 55%),
		rgba(8, 12, 24, 0.78);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	animation: wswwWinBackdropIn 0.35s ease-out;
}

.wsww-win-reveal > .wsww-win-fx-layer {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
	pointer-events: none;
}

.wsww-win-reveal__stage {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
	pointer-events: none;
}

.wsww-win-reveal__card {
	position: relative;
	z-index: 2;
	flex: 0 1 auto;
	width: min(440px, 100%);
	max-height: min(90%, 720px);
	overflow: auto;
	pointer-events: auto;
	background:
		linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
	color: #0f172a;
	border-radius: 20px;
	padding: 36px 28px 28px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.65) inset,
		0 1px 0 rgba(255, 255, 255, 0.9) inset,
		0 28px 64px rgba(0, 0, 0, 0.35),
		0 8px 24px rgba(0, 0, 0, 0.18);
	text-align: center;
	transform: none;
	animation: wswwWinRevealIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.wsww-win-reveal__card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 24px;
	right: 24px;
	height: 3px;
	border-radius: 0 0 3px 3px;
	background: linear-gradient(90deg, #c9a227, #f0d78c, #c9a227);
}

.wsww-win-reveal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #475569;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.wsww-win-reveal__close span {
	position: absolute;
	inset: 0;
	display: block;
	font-size: 0;
	line-height: 0;
	color: transparent;
	pointer-events: none;
}

.wsww-win-reveal__close span::before,
.wsww-win-reveal__close span::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
}

.wsww-win-reveal__close span::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.wsww-win-reveal__close span::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.wsww-win-reveal__close:hover {
	background: #e2e8f0;
	color: #0f172a;
}

.wsww-win-reveal__close:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 2px;
}

.wsww-win-reveal__icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, #fef9e7 0%, #f5e6b8 45%, #e8c547 100%);
	box-shadow:
		0 0 0 6px rgba(201, 162, 39, 0.12),
		0 10px 24px rgba(201, 162, 39, 0.28);
	animation: wswwWinIconPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.wsww-win-reveal__icon svg {
	width: 34px;
	height: 34px;
	display: block;
}

.wsww-win-reveal__eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #a16207;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wsww-win-reveal__body {
	padding: 0;
}

.wsww-win-reveal__body .description {
	margin: 0 0 10px;
}

.wsww-win-reveal__body .description h3,
.wsww-win-reveal__body .description .h3 {
	margin: 0;
	padding: 0;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #0f172a;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wsww-win-reveal__body .win-card,
.wsww-win-reveal__body .loss-card {
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
	border: 0;
}

.wsww-win-reveal__body .spin-message {
	margin: 0;
	padding: 0;
	max-height: none;
	overflow: visible;
	font-size: 15px !important;
	line-height: 1.55 !important;
	letter-spacing: 0 !important;
	color: #475569 !important;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
	font-weight: 400;
}

.wsww-win-reveal__body .wsww-coupon-reward {
	margin-top: 22px;
	padding: 16px;
	background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
	border: 1px dashed #d4a017;
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.wsww-win-reveal__body .wsww-coupon-reward__title {
	margin: 0;
	font-weight: 600;
	font-size: 12px;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #92400e;
}

.wsww-win-reveal__body .wsww-coupon-reward__row {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	width: 100%;
}

.wsww-win-reveal__body .wsww-coupon-code {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.08em;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e8c547;
	border-radius: 10px;
	color: #0f172a;
	text-align: center;
}

.wsww-win-reveal__body .wsww-copy-coupon,
.wsww-win-reveal__body .wsww-tyl-btn.wsww-copy-coupon {
	flex: 0 0 auto;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 16px;
	line-height: 1.2;
	border-radius: 10px;
	border: 0;
	background: #0f172a;
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.wsww-win-reveal__body .wsww-copy-coupon:hover {
	background: #1e293b;
}

.wsww-win-reveal__body .wsww-coupon-cart-status,
.wsww-win-reveal__body .wsww-coupon-limit-msg {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.4;
}

.wsww-win-reveal__actions {
	margin-top: 24px;
}

.wsww-win-reveal__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 160px;
	padding: 12px 28px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wsww-win-reveal__cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 24px rgba(15, 23, 42, 0.3);
}

.wsww-win-reveal__cta:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 3px;
}

@keyframes wswwWinBackdropIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes wswwWinRevealIn {
	from {
		opacity: 0;
		transform: translateY(18px) scale(0.94);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes wswwWinIconPop {
	from {
		opacity: 0;
		transform: scale(0.55);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@media (max-width: 480px) {
	.wsww-win-reveal__card {
		padding: 32px 20px 22px;
		border-radius: 16px;
	}

	.wsww-win-reveal__icon {
		width: 64px;
		height: 64px;
	}

	.wsww-win-reveal__body .description h3,
	.wsww-win-reveal__body .description .h3 {
		font-size: 19px;
	}

	.wsww-win-reveal__body .spin-message {
		font-size: 14px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wsww-win-fx-piece,
	.wsww-win-fx-ring,
	.wsww-win-reveal__card,
	.wsww-win-reveal__backdrop,
	.wsww-win-reveal__icon,
	.wsww-wheel-pointer.is-wobbling image,
	.wsww-preview-arrow.is-wobbling image {
		animation: none !important;
	}
}
