.playisland-wheel {
	--wheel-border: #fff;
	--wheel-shadow: rgba(40, 54, 117, 0.28);
	background: #fff;
	border: 1px solid #e1e8f8;
	border-radius: 24px;
	box-shadow: 0 18px 55px rgba(42, 59, 116, 0.13);
	margin: 30px auto;
	max-width: 620px;
	padding: clamp(22px, 5vw, 42px);
	text-align: center;
}

.playisland-wheel.has-background {
	background-image: var(--playisland-wheel-background);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

.playisland-wheel.has-disc-image .playisland-wheel__disc {
	border: 0;
	box-shadow: none;
}

.playisland-wheel--neon {
	--wheel-border: #5dffef;
	--wheel-shadow: rgba(93, 255, 239, 0.5);
	background: #12152c;
	color: #fff;
}

.playisland-wheel--candy {
	--wheel-border: #ffb9dc;
	--wheel-shadow: rgba(255, 126, 193, 0.34);
	background: #fff4fa;
}

.playisland-wheel--minimal {
	--wheel-border: #27365f;
	--wheel-shadow: rgba(30, 44, 79, 0.2);
	border-radius: 8px;
}

.playisland-wheel__stage {
	aspect-ratio: 1;
	margin: 28px auto;
	max-width: 460px;
	position: relative;
}

.playisland-wheel__disc {
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	border: 10px solid var(--wheel-border);
	border-radius: 50%;
	box-shadow: 0 18px 45px var(--wheel-shadow);
	height: 100%;
	overflow: hidden;
	position: relative;
	transition: transform 4s cubic-bezier(0.12, 0.66, 0.14, 1);
	width: 100%;
}

.playisland-wheel.is-spinning .playisland-wheel__disc {
	filter: saturate(1.12);
}

.playisland-wheel__frame,
.playisland-wheel__sparkles {
	height: var(--playisland-wheel-frame-scale, 106%);
	left: calc((100% - var(--playisland-wheel-frame-scale, 106%)) / 2);
	object-fit: contain;
	pointer-events: none;
	position: absolute;
	top: calc((100% - var(--playisland-wheel-frame-scale, 106%)) / 2);
	width: var(--playisland-wheel-frame-scale, 106%);
}

/* A custom skin's frame supplies the rim, so drop the disc's own border/shadow. */
.playisland-wheel--custom .playisland-wheel__disc {
	border: 0;
	box-shadow: none;
}

.playisland-wheel__frame {
	z-index: 3;
}

.playisland-wheel__sparkles {
	animation: playisland-wheel-sparkles 2.8s ease-in-out infinite;
	z-index: 4;
}

@keyframes playisland-wheel-sparkles {
	0%,
	100% {
		opacity: 0.25;
		transform: scale(0.98);
	}

	50% {
		opacity: 1;
		transform: scale(1.02);
	}
}

.playisland-wheel__disc > .playisland-wheel__segment {
	align-items: center;
	color: var(--playisland-wheel-label-color, #172451);
	display: flex;
	flex-direction: column;
	font-size: clamp(0.58rem, 2.2vw, 0.82rem);
	font-weight: 1000;
	gap: 4px;
	left: 50%;
	max-width: 34%;
	position: absolute;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.65), 0 0 5px rgba(8, 12, 32, 0.35);
	top: 50%;
	transform:
		rotate(calc((360deg / var(--segment-count)) * var(--segment-index) + (180deg / var(--segment-count))))
		translateY(calc(-1 * var(--playisland-wheel-label-radius, min(19vw, 185px))))
		rotate(90deg);
	transform-origin: 0 0;
}

/* Custom skins put a frame over the rim, so pull labels into the open center. */
.playisland-wheel--custom {
	--playisland-wheel-label-radius: min(13vw, 128px);
}

.playisland-wheel__segment > span {
	color: var(--playisland-wheel-label-color, #172451);
}

.playisland-wheel__segment img {
	display: block;
	height: clamp(24px, 6vw, 52px);
	object-fit: contain;
	width: clamp(24px, 6vw, 52px);
}

.playisland-wheel__segment > span {
	display: block;
}

.playisland-wheel__pointer {
	border-left: 16px solid transparent;
	border-right: 16px solid transparent;
	border-top: 34px solid #fc4d71;
	filter: drop-shadow(0 4px 5px rgba(30, 35, 70, 0.25));
	left: 50%;
	position: absolute;
	top: -8px;
	transform: translateX(-50%);
	z-index: 5;
}

.playisland-wheel__pointer--image {
	border: 0;
	height: auto;
	max-height: 80px;
	max-width: 90px;
	top: -24px;
	width: auto;
}

.playisland-wheel__spin {
	background: #684cff;
	border: 7px solid #fff;
	border-radius: 50%;
	box-shadow: 0 5px 18px rgba(33, 45, 100, 0.3);
	color: #fff;
	font-weight: 1000;
	height: 86px;
	left: 50%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 86px;
	z-index: 6;
}

.playisland-wheel__spin:disabled {
	cursor: not-allowed;
	filter: grayscale(0.35);
	opacity: 0.72;
}

.playisland-wheel.is-spinning .playisland-wheel__spin {
	box-shadow: 0 0 0 10px rgba(104, 76, 255, 0.14), 0 5px 18px rgba(33, 45, 100, 0.3);
}

.playisland-wheel__spin--image {
	background-color: transparent;
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	height: 110px;
	width: 110px;
}

.playisland-wheel__spin--image span {
	border: 0;
	clip: rect(0 0 0 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.playisland-wheel__result {
	color: #334f96;
	font-size: 1.1rem;
	font-weight: 900;
	min-height: 1.5em;
}

.playisland-wheel__spins {
	color: var(--playisland-wheel-title-color, #334f96);
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	margin: 4px 0 0;
	opacity: 0.9;
	text-align: center;
}

.playisland-wheel__head {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: center;
	position: relative;
}

.playisland-wheel__head h2 {
	color: var(--playisland-wheel-title-color, inherit);
	margin: 0;
}

.playisland-wheel__mute {
	background: rgba(104, 76, 255, 0.12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	height: 34px;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
}

.playisland-wheel__mute::before {
	content: "\1F50A";
	font-size: 15px;
	line-height: 1;
}

.playisland-wheel__mute.is-muted::before {
	content: "\1F507";
	opacity: 0.7;
}

/* Idle bob when the wheel is ready to spin. */
.playisland-wheel__stage {
	animation: playisland-wheel-bob 4s ease-in-out infinite;
}

.playisland-wheel.is-spinning .playisland-wheel__stage,
.playisland-wheel.is-cooldown .playisland-wheel__stage,
.playisland-wheel.is-celebrating .playisland-wheel__stage {
	animation: none;
}

@keyframes playisland-wheel-bob {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-6px);
	}
}

/* Winning-segment highlight after the disc settles. */
.playisland-wheel__segment.is-won {
	animation: playisland-wheel-won 1.1s ease-in-out 3;
	z-index: 2;
}

.playisland-wheel__segment.is-won > span:last-child {
	color: #1c1042;
	text-shadow: 0 0 8px rgba(255, 230, 120, 0.95), 0 1px 2px rgba(255, 255, 255, 0.8);
}

@keyframes playisland-wheel-won {
	0%,
	100% {
		filter: none;
		transform:
			rotate(calc((360deg / var(--segment-count)) * var(--segment-index) + (180deg / var(--segment-count))))
			translateY(calc(-1 * min(19vw, 185px)))
			rotate(90deg)
			scale(1);
	}

	50% {
		filter: brightness(1.25);
		transform:
			rotate(calc((360deg / var(--segment-count)) * var(--segment-index) + (180deg / var(--segment-count))))
			translateY(calc(-1 * min(19vw, 185px)))
			rotate(90deg)
			scale(1.12);
	}
}

.playisland-wheel.is-cooldown .playisland-wheel__spin {
	filter: grayscale(0.35);
	opacity: 0.72;
}

/* Win celebration modal. */
.playisland-wheel__modal {
	--playisland-wheel-modal-accent: var(--playisland-accent, #ffb020);
	--playisland-wheel-modal-card: #151d2e;
	--playisland-wheel-modal-heading: #ffffff;
	--playisland-wheel-modal-text: #d7def2;
	align-items: center;
	background: rgba(12, 16, 38, 0.66);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 20px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100000;
}

.playisland-wheel__modal[hidden] {
	display: none;
}

.playisland-wheel__modal-card {
	animation: playisland-wheel-pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
	background: var(--playisland-wheel-modal-card);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 22px;
	box-shadow: 0 30px 80px rgba(15, 23, 60, 0.4);
	color: var(--playisland-wheel-modal-text);
	max-width: 360px;
	outline: 0;
	overflow: hidden;
	padding: 34px 28px 28px;
	position: relative;
	text-align: center;
	width: 100%;
}

.playisland-wheel__confetti {
	height: 100%;
	left: 0;
	pointer-events: none;
	position: absolute;
	top: 0;
	width: 100%;
}

.playisland-wheel__modal-eyebrow {
	color: var(--playisland-wheel-modal-accent);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.playisland-wheel__modal-card h3 {
	color: var(--playisland-wheel-modal-color, var(--playisland-wheel-modal-heading));
	font-size: 1.6rem;
	margin: 0 0 6px;
}

.playisland-wheel__modal-amount {
	color: var(--playisland-wheel-modal-color, var(--playisland-wheel-modal-accent));
	font-size: 1.05rem;
	font-weight: 800;
	margin: 0 0 22px;
	min-height: 1.2em;
}

.playisland-wheel__modal-close {
	background: linear-gradient(135deg, #7c5cff, #a14cff);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 800;
	padding: 12px 30px;
	position: relative;
	z-index: 1;
}

@keyframes playisland-wheel-pop {
	from {
		opacity: 0;
		transform: scale(0.8);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.playisland-wheel__sparkles {
		animation: none;
		opacity: 1;
	}

	.playisland-wheel__stage,
	.playisland-wheel__segment.is-won,
	.playisland-wheel__modal-card {
		animation: none;
	}
}
