/* =========================================================================
   Spin to Win — prize wheel
   Self-contained: literal brand colors (no dependency on theme-polish tokens).
   ====================================================================== */
.stw-tab,
.stw-modal {
	--stw-red: #dc3545;
	--stw-red-dark: #b91c2e;
	--stw-orange: #F26322;
	--stw-ink: #0f172a;
	--stw-ink-2: #1e293b;
	--stw-gold: #f4b400;
	--stw-surface: #ffffff;
	--stw-radius: 18px;
	--stw-ease: cubic-bezier(.4, 0, .2, 1);
}

/* =========================================================================
   FLOATING TAB
   ====================================================================== */
.stw-tab {
	position: fixed;
	z-index: 1030;
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	margin: 0;
	padding: .7rem 1rem;
	border: 0;
	cursor: pointer;
	color: #fff;
	font-weight: 800;
	font-size: .92rem;
	letter-spacing: .01em;
	line-height: 1;
	background: linear-gradient(135deg, var(--stw-red) 0%, var(--stw-red-dark) 100%);
	box-shadow: 0 10px 28px -6px rgba(220, 53, 69, .55), 0 2px 8px rgba(15, 23, 42, .2);
	animation: stw-pulse 2.6s var(--stw-ease) infinite;
	transition: transform .25s var(--stw-ease), box-shadow .25s var(--stw-ease);
	-webkit-tap-highlight-color: transparent;
}
.stw-tab:hover,
.stw-tab:focus-visible {
	transform: scale(1.05);
	box-shadow: 0 16px 38px -6px rgba(220, 53, 69, .65), 0 3px 10px rgba(15, 23, 42, .25);
	outline: none;
}
.stw-tab:focus-visible { box-shadow: 0 0 0 4px rgba(220, 53, 69, .35), 0 16px 38px -6px rgba(220, 53, 69, .6); }

.stw-tab__icon { display: inline-flex; }
.stw-tab__wheel { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.stw-tab__wheel-spin { transform-origin: 16px 16px; animation: stw-minispin 7s linear infinite; }
.stw-tab__text { white-space: nowrap; }

/* Right / left vertical edge tabs */
.stw-tab--right,
.stw-tab--left {
	top: 50%;
	flex-direction: row;
}
.stw-tab--right {
	right: 0;
	transform-origin: right center;
	border-radius: var(--stw-radius) 0 0 var(--stw-radius);
	transform: translateY(-50%);
	animation-name: stw-pulse-r;
}
.stw-tab--right:hover,
.stw-tab--right:focus-visible { transform: translateY(-50%) scale(1.05); }
.stw-tab--left {
	left: 0;
	border-radius: 0 var(--stw-radius) var(--stw-radius) 0;
	transform: translateY(-50%);
	animation-name: stw-pulse-l;
}
.stw-tab--left:hover,
.stw-tab--left:focus-visible { transform: translateY(-50%) scale(1.05); }

/* Bottom-right corner pill */
.stw-tab--bottom {
	right: 18px;
	bottom: 18px;
	border-radius: 999px;
	padding: .8rem 1.15rem;
}

/* Pulse only the shadow ring — never transform — so hover-scale stays
   visible and the tab is positionally stable. */
@keyframes stw-pulse {
	0%, 100% { box-shadow: 0 10px 28px -6px rgba(220, 53, 69, .5), 0 0 0 0 rgba(220, 53, 69, .4); }
	50%      { box-shadow: 0 12px 30px -6px rgba(220, 53, 69, .6), 0 0 0 12px rgba(220, 53, 69, 0); }
}
@keyframes stw-pulse-r {
	0%, 100% { box-shadow: 0 10px 28px -6px rgba(220, 53, 69, .5), 0 0 0 0 rgba(220, 53, 69, .4); }
	50%      { box-shadow: 0 12px 30px -6px rgba(220, 53, 69, .6), 0 0 0 12px rgba(220, 53, 69, 0); }
}
@keyframes stw-pulse-l {
	0%, 100% { box-shadow: 0 10px 28px -6px rgba(220, 53, 69, .5), 0 0 0 0 rgba(220, 53, 69, .4); }
	50%      { box-shadow: 0 12px 30px -6px rgba(220, 53, 69, .6), 0 0 0 12px rgba(220, 53, 69, 0); }
}
@keyframes stw-minispin { to { transform: rotate(360deg); } }

/* =========================================================================
   MODAL SHELL  (Bootstrap modal mechanics, fully custom .stw-content)
   ====================================================================== */
.stw-modal .modal-dialog { max-width: 470px; }

.stw-content {
	position: relative;
	width: 100%;
	overflow: hidden;
	/* Bootstrap sets .modal-dialog { pointer-events: none }; .modal-content
	   normally restores it. We use .stw-content instead, so restore it here —
	   otherwise clicks fall through to the backdrop and dismiss the modal. */
	pointer-events: auto;
	border-radius: 22px;
	padding: 2rem 1.75rem 1.6rem;
	color: #fff;
	text-align: center;
	background:
		radial-gradient(120% 90% at 50% -10%, rgba(242, 99, 34, .35) 0%, rgba(242, 99, 34, 0) 55%),
		radial-gradient(120% 90% at 50% 110%, rgba(220, 53, 69, .35) 0%, rgba(220, 53, 69, 0) 55%),
		linear-gradient(160deg, #2a1437 0%, #161033 50%, #0d1b3a 100%);
	box-shadow: 0 40px 90px -25px rgba(7, 6, 20, .8);
	transition: background .4s var(--stw-ease);
}
/* Confetti dots backdrop sparkle */
.stw-content::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(2px 2px at 20% 18%, rgba(255, 255, 255, .55) 50%, transparent 51%),
		radial-gradient(2px 2px at 78% 12%, rgba(255, 255, 255, .4) 50%, transparent 51%),
		radial-gradient(2px 2px at 12% 70%, rgba(255, 255, 255, .35) 50%, transparent 51%),
		radial-gradient(2px 2px at 88% 64%, rgba(255, 255, 255, .4) 50%, transparent 51%);
	pointer-events: none;
}

/* Light mode for the claim/form step (form legibility) */
.stw-content.stw-on-claim {
	color: var(--stw-ink);
	background: var(--stw-surface);
}
.stw-content.stw-on-claim::before { opacity: 0; }

.stw-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	color: #fff;
	background: rgba(255, 255, 255, .14);
	cursor: pointer;
	transition: background .2s var(--stw-ease), transform .2s var(--stw-ease);
}
.stw-close:hover { background: rgba(255, 255, 255, .26); transform: rotate(90deg); }
.stw-content.stw-on-claim .stw-close { color: var(--stw-ink); background: rgba(15, 23, 42, .08); }
.stw-content.stw-on-claim .stw-close:hover { background: rgba(15, 23, 42, .16); }

/* View switching + entrance */
.stw-view[hidden] { display: none; }
.stw-view { animation: stw-fade .4s var(--stw-ease) both; }
@keyframes stw-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stw-head { margin-bottom: 1rem; }
.stw-headline {
	margin: 0 0 .25rem;
	font-size: 1.7rem;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.05;
	color: #fff;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.stw-subtext { margin: 0; font-size: .98rem; color: rgba(255, 255, 255, .82); }

/* =========================================================================
   WHEEL
   ====================================================================== */
.stw-wheelwrap {
	position: relative;
	width: 320px;
	max-width: 78vw;
	margin: .25rem auto .5rem;
	aspect-ratio: 1 / 1;
}
.stw-wheel {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 8px rgba(255, 255, 255, .14), 0 0 0 14px rgba(255, 255, 255, .06), 0 20px 50px -12px rgba(0, 0, 0, .55);
}
.stw-wheel svg { display: block; width: 100%; height: 100%; border-radius: 50%; }
.stw-wheel__spin { transform-origin: 50% 50%; }

/* Pointer pinned to top, does not rotate */
.stw-pointer {
	position: absolute;
	top: -16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 4;
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45));
	transform-origin: 50% 90%;
}
.stw-pointer.is-tick { animation: stw-tick .12s var(--stw-ease); }
@keyframes stw-tick {
	0% { transform: translateX(-50%) rotate(0deg); }
	45% { transform: translateX(-50%) rotate(-11deg); }
	100% { transform: translateX(-50%) rotate(0deg); }
}

/* Center hub = the SPIN button */
.stw-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	width: 27%;
	height: 27%;
	min-width: 72px;
	min-height: 72px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: #fff;
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: .03em;
	background: radial-gradient(circle at 35% 30%, #fff 0%, #ffe08a 18%, var(--stw-gold) 46%, #d99400 100%);
	color: #3a2400;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .4), inset 0 2px 4px rgba(255, 255, 255, .7), inset 0 -4px 8px rgba(160, 100, 0, .5);
	transition: transform .18s var(--stw-ease), box-shadow .18s var(--stw-ease);
}
.stw-hub:hover { transform: translate(-50%, -50%) scale(1.07); }
.stw-hub:active { transform: translate(-50%, -50%) scale(.96); }
.stw-hub:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), 0 6px 18px rgba(0, 0, 0, .4); }
.stw-hub.is-spinning { pointer-events: none; opacity: .92; }
.stw-hub__label { display: block; line-height: 1; }

.stw-fineprint { margin: .35rem 0 0; font-size: .72rem; color: rgba(255, 255, 255, .55); }

/* =========================================================================
   RESULT
   ====================================================================== */
.stw-view--result { padding: .5rem 0 .25rem; }
.stw-result__badge {
	width: 92px;
	height: 92px;
	margin: 0 auto 1rem;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-size: 2.6rem;
	color: #fff;
	background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, var(--stw-orange), var(--stw-red));
	box-shadow: 0 12px 30px -8px rgba(220, 53, 69, .65);
	animation: stw-pop .5s var(--stw-ease) both;
}
@keyframes stw-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.stw-result__headline {
	margin: 0 0 .35rem;
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: -.01em;
	color: #fff;
}
.stw-result__message { margin: 0 auto 1.25rem; max-width: 30ch; color: rgba(255, 255, 255, .82); font-size: 1rem; }

.stw-claim {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 54px;
	padding: .9rem 2rem;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	color: #fff;
	font-size: 1.08rem;
	font-weight: 800;
	background: linear-gradient(135deg, var(--stw-red) 0%, var(--stw-red-dark) 100%);
	box-shadow: 0 10px 26px -6px rgba(220, 53, 69, .6);
	transition: transform .2s var(--stw-ease), box-shadow .2s var(--stw-ease);
	animation: stw-cta-breathe 2s var(--stw-ease) infinite;
}
.stw-claim:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -6px rgba(220, 53, 69, .7); }
.stw-claim:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(255, 255, 255, .5), 0 12px 28px -6px rgba(220, 53, 69, .6); }
@keyframes stw-cta-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.stw-maybe {
	display: block;
	margin: .85rem auto 0;
	padding: .35rem .75rem;
	border: 0;
	background: none;
	cursor: pointer;
	color: rgba(255, 255, 255, .6);
	font-size: .85rem;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.stw-maybe:hover { color: rgba(255, 255, 255, .9); }
.stw-content.stw-on-claim .stw-maybe { color: #64748b; }
.stw-content.stw-on-claim .stw-maybe:hover { color: var(--stw-ink); }

/* =========================================================================
   CLAIM / FORM
   ====================================================================== */
.stw-claim__head { margin-bottom: 1.1rem; }
.stw-claim__chip {
	display: inline-block;
	margin-bottom: .6rem;
	padding: .35rem .85rem;
	border-radius: 999px;
	font-size: .82rem;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, var(--stw-orange), var(--stw-red));
	box-shadow: 0 6px 16px -4px rgba(220, 53, 69, .5);
}
.stw-claim__chip:empty { display: none; }
.stw-claim__headline { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; color: var(--stw-ink); }
.stw-form { text-align: left; margin-top: .5rem; }
.stw-form .gform_wrapper { margin: 0; }
.stw-form .gfield_label { font-weight: 600; }

/* =========================================================================
   EMAIL-FIRST GATE
   ====================================================================== */
.stw-view--email { padding: .5rem 0 .25rem; }
.stw-emailform { max-width: 320px; margin: 1.35rem auto 0; }
.stw-emailform__input {
	width: 100%;
	height: 52px;
	padding: 0 1.1rem;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--stw-ink);
	font-size: 1rem;
	text-align: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.stw-emailform__input:focus { outline: none; box-shadow: 0 0 0 4px rgba(255, 255, 255, .4), 0 6px 18px rgba(0, 0, 0, .25); }
.stw-emailform__error { margin: .55rem 0 0; color: #fecaca; font-size: .85rem; font-weight: 600; }
.stw-emailform__btn { margin-top: .9rem; width: 100%; }

/* =========================================================================
   OPEN-THE-WHEEL BUTTON (shortcode / menu item) — literal colors so it works
   anywhere on the page, outside the modal's variable scope.
   ====================================================================== */
.stw-open-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: .7rem 1.4rem;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	color: #fff;
	font-weight: 700;
	background: linear-gradient(135deg, #dc3545 0%, #b91c2e 100%);
	box-shadow: 0 8px 22px -6px rgba(220, 53, 69, .5);
	transition: transform .2s cubic-bezier(.4, 0, .2, 1), box-shadow .2s cubic-bezier(.4, 0, .2, 1);
}
.stw-open-btn:hover,
.stw-open-btn:focus { transform: translateY(-2px); box-shadow: 0 12px 28px -6px rgba(220, 53, 69, .6); color: #fff; }

/* =========================================================================
   ALREADY PLAYED
   ====================================================================== */
.stw-view--played { padding: 1rem 0; }
.stw-played__emoji { font-size: 3rem; margin-bottom: .5rem; animation: stw-pop .5s var(--stw-ease) both; }
.stw-played__headline { margin: 0 0 .4rem; font-size: 1.5rem; font-weight: 800; color: #fff; }
.stw-played__message { margin: 0 auto; max-width: 32ch; color: rgba(255, 255, 255, .82); }

/* =========================================================================
   CONFETTI canvas (created by JS, appended to body)
   ====================================================================== */
.stw-confetti {
	position: fixed;
	inset: 0;
	z-index: 1090;
	pointer-events: none;
}

/* =========================================================================
   RESPONSIVE — mobile bottom-sheet
   ====================================================================== */
@media (max-width: 575.98px) {
	.stw-tab { font-size: .82rem; padding: .6rem .8rem; }
	.stw-tab__text { max-width: 5.5em; white-space: normal; line-height: 1.05; }
	.stw-tab--bottom { right: 12px; bottom: 12px; }

	.stw-modal .modal-dialog {
		margin: 0;
		max-width: 100%;
		min-height: 100%;
		align-items: flex-end;
	}
	.stw-content {
		border-radius: 22px 22px 0 0;
		padding: 1.6rem 1.1rem 1.2rem;
	}
	.stw-headline { font-size: 1.45rem; }
	.stw-wheelwrap { max-width: 82vw; }
}

@media (max-width: 360px) {
	.stw-tab--right .stw-tab__text,
	.stw-tab--left .stw-tab__text { display: none; }
}

/* =========================================================================
   REDUCED MOTION
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
	.stw-tab,
	.stw-tab__wheel-spin,
	.stw-claim,
	.stw-result__badge,
	.stw-played__emoji { animation: none !important; }
	.stw-view { animation-duration: .01ms; }
	.stw-pointer.is-tick { animation: none !important; }
}
