/* ============================================================
   F222 Bonus Wheel — front-end styles (self-contained, scoped)
   ============================================================ */

.f222bw-lock { overflow: hidden; }

/* ---------- Modal ---------- */
.f222bw-modal {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.f222bw-modal.is-open { display: flex; }
.f222bw-modal * { box-sizing: border-box; }

.f222bw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 6, 16, 0.86);
	backdrop-filter: blur(3px);
	cursor: pointer;
}
.f222bw-modal__inner {
	position: relative;
	width: min(94vw, 560px);
	animation: f222bw-pop 0.35s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}
@keyframes f222bw-pop {
	from { opacity: 0; transform: scale(0.8) translateY(20px); }
	to   { opacity: 1; transform: none; }
}
.f222bw-modal__close {
	position: absolute;
	top: -6px;
	right: -6px;
	z-index: 5;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	color: #111;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
	transition: transform 0.15s ease;
}
.f222bw-modal__close:hover { transform: scale(1.08) rotate(90deg); }

/* ---------- Wheel shell ---------- */
.f222bw-wheel {
	--f222bw-ring: #7a0d16;
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0 auto;
}
.f222bw-inline .f222bw-wheel { max-width: 460px; }

/* Pointer (top) */
.f222bw-pointer {
	position: absolute;
	top: -3.5%;
	left: 50%;
	transform: translateX(-50%);
	z-index: 6;
	width: 8%;
	height: 9.5%;
	background: linear-gradient(180deg, #e11d2a, #a10c16);
	clip-path: polygon(18% 0, 82% 0, 82% 52%, 50% 100%, 18% 52%);
	border-radius: 3px;
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
}

/* Outer ring */
.f222bw-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background:
		radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.12), transparent 60%),
		var(--f222bw-ring);
	box-shadow:
		0 0 0 3px #e7bd5a,
		0 0 0 4px rgba(0, 0, 0, 0.4),
		inset 0 0 0 3px rgba(0, 0, 0, 0.35),
		0 18px 50px rgba(0, 0, 0, 0.6);
}
.f222bw-ring::after {
	/* inner gold rim that frames the wheel face */
	content: "";
	position: absolute;
	inset: 11%;
	border-radius: 50%;
	box-shadow: 0 0 0 3px #e7bd5a, inset 0 0 12px rgba(0, 0, 0, 0.5);
}

/* Bulbs */
.f222bw-bulbs { position: absolute; inset: 0; }
.f222bw-bulb {
	position: absolute;
	width: 4.3%;
	height: 4.3%;
	margin: -2.15% 0 0 -2.15%;
	border-radius: 50%;
	background: #ffd54a;
	box-shadow: 0 0 6px 2px rgba(255, 213, 74, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.3);
	animation: f222bw-blink 1s steps(1, end) infinite;
}
@keyframes f222bw-blink {
	0%, 49% { opacity: 1; }
	50%, 100% { opacity: 0.35; }
}

/* Wheel face (rotating SVG lives here) */
.f222bw-face {
	position: absolute;
	inset: 12.5%;
	border-radius: 50%;
	overflow: hidden;
	box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.45);
}
.f222bw-wheel-svg { display: block; width: 100%; height: 100%; }
.f222bw-wheel-rotor { transform-origin: 50% 50%; }
.f222bw-seg-main { letter-spacing: 0.5px; }

/* Centre hub / spin button */
.f222bw-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 4;
	width: 27%;
	height: 27%;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background: radial-gradient(circle at 38% 32%, #ff8a3d, #f2540b 55%, #c53a04);
	box-shadow:
		0 0 0 4px #e7bd5a,
		0 6px 16px rgba(0, 0, 0, 0.5),
		inset 0 -6px 12px rgba(0, 0, 0, 0.35),
		inset 0 6px 10px rgba(255, 255, 255, 0.4);
	color: #fff;
	font-weight: 800;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
	transition: transform 0.12s ease, filter 0.2s ease;
}
.f222bw-hub span {
	display: block;
	font-size: clamp(11px, 3.2vw, 17px);
	line-height: 1.1;
	padding: 0 6px;
}
.f222bw-hub:hover { filter: brightness(1.06); }
.f222bw-hub:active { transform: translate(-50%, -50%) scale(0.95); }
.f222bw-hub.is-spinning { pointer-events: none; }
.f222bw-hub.is-spinning span { animation: f222bw-pulse 0.8s ease-in-out infinite; }
@keyframes f222bw-pulse { 50% { opacity: 0.55; } }

/* ---------- Result screen ---------- */
.f222bw-result {
	position: absolute;
	inset: 12.5%;
	z-index: 8;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 50%, #0d0f18 55%, #05060c 100%);
	color: #fff;
	overflow: hidden;
	animation: f222bw-reveal 0.4s ease;
}
.f222bw-result.is-visible { display: flex; }
@keyframes f222bw-reveal {
	from { opacity: 0; transform: scale(0.9); }
	to   { opacity: 1; transform: none; }
}
.f222bw-result__main {
	font-size: clamp(40px, 15vw, 88px);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -1px;
	text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
.f222bw-result__sub {
	margin-top: 8px;
	font-size: clamp(12px, 3.4vw, 18px);
	font-weight: 700;
	letter-spacing: 0.5px;
}
.f222bw-claim {
	margin-top: clamp(14px, 4vw, 26px);
	display: inline-block;
	padding: 12px 34px;
	border: 0;
	border-radius: 999px;
	background: #16d78a;
	color: #04231a;
	font-size: clamp(14px, 3.6vw, 18px);
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(22, 215, 138, 0.45);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.f222bw-claim:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 12px 26px rgba(22, 215, 138, 0.55); }
.f222bw-claim[disabled] { background: #4a4a52; color: #cfcfd6; cursor: not-allowed; box-shadow: none; }

/* Decorative coins/cash on the result screen */
.f222bw-result__coins { position: absolute; inset: 0; pointer-events: none; }
.f222bw-result__coins i { position: absolute; border-radius: 50%; }
.f222bw-result__coins .c {
	width: 9%; height: 9%;
	background: radial-gradient(circle at 35% 30%, #ffe08a, #e0a020 60%, #a9720c);
	box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.3);
	animation: f222bw-float 3.5s ease-in-out infinite;
}
.f222bw-result__coins .c1 { top: 16%; left: 14%; }
.f222bw-result__coins .c2 { top: 62%; right: 12%; animation-delay: 0.6s; }
.f222bw-result__coins .c3 { bottom: 12%; left: 24%; animation-delay: 1.1s; }
.f222bw-result__coins .b {
	width: 12%; height: 7%; border-radius: 3px;
	background: linear-gradient(135deg, #8de08a, #4caf50);
	animation: f222bw-float 4s ease-in-out infinite;
}
.f222bw-result__coins .b1 { top: 22%; right: 16%; transform: rotate(18deg); }
.f222bw-result__coins .b2 { bottom: 18%; right: 22%; transform: rotate(-12deg); animation-delay: 0.8s; }
@keyframes f222bw-float { 50% { transform: translateY(-8px) rotate(6deg); } }

/* Inline title */
.f222bw-inline-title { text-align: center; margin: 0 0 14px; }

/* ---------- Sticky bottom bar ---------- */
.f222bw-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999980;
	display: flex;
	gap: 0;
	padding: 8px;
	background: linear-gradient(180deg, #12131c, #05060b);
	box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
	box-sizing: border-box;
}
.f222bw-bar__btn {
	--f222bw-btn: #444;
	flex: 1 1 0;
	min-width: 0;
	margin: 0 4px;
	padding: 13px 6px;
	border: 0;
	border-radius: 8px;
	background: var(--f222bw-btn);
	color: #fff;
	font-size: clamp(12px, 3.4vw, 15px);
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
	transition: transform 0.12s ease, filter 0.15s ease;
}
.f222bw-bar__btn:hover { filter: brightness(1.08); }
.f222bw-bar__btn:active { transform: translateY(1px); }

/* Mobile-only by default: hide the bar on wide screens unless is-desktop */
@media (min-width: 900px) {
	.f222bw-bar:not(.is-desktop) { display: none; }
}

/* Keep the bar from covering page content.
   Fallback (older browsers): pad on mobile whenever the plugin is present. */
@media (max-width: 899px) {
	body { padding-bottom: 64px; }
}
/* Precise: only pad when a bar actually renders (supported browsers). */
@supports selector(body:has(*)) {
	@media (max-width: 899px) {
		body { padding-bottom: 0; }
		body:has(.f222bw-bar) { padding-bottom: 64px; }
	}
	@media (min-width: 900px) {
		body:has(.f222bw-bar.is-desktop) { padding-bottom: 64px; }
	}
}
/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.f222bw-bulb { animation: none; }
	.f222bw-modal__inner { animation: none; }
	.f222bw-result { animation: none; }
	.f222bw-result__coins i { animation: none; }
}
