/* =====================
   GLOBAL
===================== */
body {
	min-height: 100vh;
	margin: 0;
	background:
		radial-gradient(circle at center, rgba(120, 40, 10, 0.35), transparent 60%),
		radial-gradient(circle at top, rgba(255, 140, 0, 0.15), transparent 50%),
		linear-gradient(to bottom, #060302, #120600, #060302);
	background-color: #050200;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 2;
	box-shadow:
		inset 0 0 120px rgba(255, 180, 60, 0.12),
		inset 0 0 260px rgba(255, 140, 0, 0.08);
}
body::after {
	content: "";
	position: fixed;
	inset: 0;
	background: url("../wheels/castle-silhouette.webp") no-repeat center bottom;
	background-size: cover;
	opacity: 0.18;
	pointer-events: none;
	z-index: 1;
}

/* =====================
   FULL SCREEN LAYOUT
===================== */
.wheel-screen {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 16px;
}

/* =====================
   TITLE
===================== */
.title {
	color: #facc15;
	font-size: clamp(18px, 5vw, 26px);
	font-weight: 700;
}

/* =====================
   WHEEL WRAPPER (RESPONSIVE)
===================== */
.wheel-wrapper {
	position: relative;
	width: min(90vw, 420px);
	aspect-ratio: 1 / 1;
}

/* =====================
   CANVAS
===================== */
#wheel {
	width: 100%;
	height: 100%;
}

/* =====================
   BORDER
===================== */
.wheel-border {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wheel-border img {
	width: 820px !important;
	height: 820px !important;
	padding-bottom: 40px;
	object-fit: cover;
}

@media (max-width: 768px) {
	.wheel-border img {
		width: 420px !important;
		height: auto;
		padding-bottom: 0;
	}
}

/* =====================
   POINTER
===================== */
.pointer {
	position: absolute;
	top: -8%;
	left: 50%;
	transform: translateX(-50%);
	z-index: 30;
}

.pointer img {
	width: min(22vw, 90px);
	height: auto;
}

/* =====================
   BUTTON
===================== */
.spin-btn {
	margin-top: 50px;
	width: min(90vw, 260px);
	padding: 14px;
	font-size: 18px;
	font-weight: 700;
	color: #000;
	background: linear-gradient(to right, #facc15, #eab308);
	border: none;
	border-radius: 12px;
	cursor: pointer;
}

.spin-btn:active {
	transform: scale(0.97);
}

/* =====================
   RESULT
===================== */
.result {
	color: #fff;
	text-align: center;
	display: none;
}

#resultText {
	color: #facc15;
	font-size: 20px;
	font-weight: 700;
}

.wheel-wrapper {
	position: relative;
	width: min(90vw, 420px);
	aspect-ratio: 1 / 1;
}

/* =====================
   BORDER (BELAKANG BANGET)
===================== */
.wheel-border {
	position: absolute;
	inset: -6%;
	/* sedikit lebih besar dari wheel */
	z-index: 1;
	pointer-events: none;
}

.wheel-border img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* =====================
   CANVAS (DI DEPAN BORDER)
===================== */
#wheel {
	position: relative;
	z-index: 5;
	width: 100%;
	height: 100%;
}

/* =====================
   POINTER (PALING ATAS)
===================== */
.pointer {
	position: absolute;
	top: -8%;
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
}

.pointer img {
	width: min(22vw, 90px);
	height: auto;
}

.spin-btn {
	position: relative;
	z-index: 50;
}

.wheel-container {
	position: relative;
	z-index: 10;
}

.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999;
}

.modal.hidden {
	display: none;
}

.modal-box {
	width: 90%;
	max-width: 440px;
	background: radial-gradient(circle at top, #3a1305, #140500);
	border: 2px solid #facc15;
	border-radius: 20px;
	padding: 34px 30px 36px;
	text-align: center;
	color: #fff;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
}

/* ===== HEADER ===== */
.modal-header {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 2px;
	color: #facc15;
	margin-bottom: 24px;
}

/* ===== PRIZE (FOKUS UTAMA) ===== */
.modal-prize {
	font-size: 34px;
	font-weight: 900;
	color: #ffd700;
	letter-spacing: 2px;
	margin: 10px 0 26px;
	text-shadow:
		0 0 8px rgba(255, 215, 0, 0.6),
		0 0 16px rgba(255, 215, 0, 0.4);
}

/* ANIMASI KEDIP + NAFAS */
.animate-prize {
	animation: prizePulse 1.2s ease-in-out infinite;
}

@keyframes prizePulse {
	0% {
		transform: scale(1);
		opacity: 1;
	}

	50% {
		transform: scale(1.08);
		opacity: 0.85;
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ===== NOTE ===== */
.modal-note {
	font-size: 14px;
	line-height: 1.7;
	opacity: 0.85;
	margin-bottom: 26px;
}

/* ===== BUTTON ===== */
.modal-btn {
	background: linear-gradient(to right, #facc15, #eab308);
	color: #000;
	font-weight: bold;
	padding: 12px 42px;
	border-radius: 16px;
	cursor: pointer;
	border: none;
	font-size: 15px;
	transition:
		transform 0.15s ease,
		box-shadow 0.15s ease;
}

.modal-btn:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 22px rgba(250, 204, 21, 0.6);
}

.smoke-layer {
	position: fixed;
	inset: -20%;
	background: url("<?= base_url('assets/bg/smoke.png') ?>") center / cover
		repeat;
	opacity: 0.18;
	animation: smokeMove 120s linear infinite;
	pointer-events: none;
	z-index: 1;
}

@keyframes smokeMove {
	0% {
		transform: translateX(0) translateY(0) scale(1);
	}

	50% {
		transform: translateX(-5%) translateY(-3%) scale(1.05);
	}

	100% {
		transform: translateX(0) translateY(0) scale(1);
	}
}

.fire-particles {
	position: fixed;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}

.fire-particles span {
	position: absolute;
	bottom: -60px;
	width: 12px;
	height: 12px;
	background: radial-gradient(circle, #ffd700, #ff6a00, transparent 70%);
	border-radius: 50%;
	filter: blur(1px);
	animation: fireRise linear infinite;
	opacity: 0.8;
}

/* POSISI ACAK + SPEED BEDA */
.fire-particles span:nth-child(1) {
	left: 10%;
	animation-duration: 6s;
}

.fire-particles span:nth-child(2) {
	left: 20%;
	animation-duration: 8s;
	width: 16px;
	height: 16px;
}

.fire-particles span:nth-child(3) {
	left: 30%;
	animation-duration: 5s;
}

.fire-particles span:nth-child(4) {
	left: 40%;
	animation-duration: 9s;
	width: 18px;
	height: 18px;
}

.fire-particles span:nth-child(5) {
	left: 50%;
	animation-duration: 7s;
}

.fire-particles span:nth-child(6) {
	left: 60%;
	animation-duration: 6s;
}

.fire-particles span:nth-child(7) {
	left: 70%;
	animation-duration: 10s;
	width: 20px;
	height: 20px;
}

.fire-particles span:nth-child(8) {
	left: 80%;
	animation-duration: 7s;
}

.fire-particles span:nth-child(9) {
	left: 90%;
	animation-duration: 9s;
}

.fire-particles span:nth-child(10) {
	left: 95%;
	animation-duration: 6s;
}

/* ANIMASI API */
@keyframes fireRise {
	0% {
		transform: translateY(0) scale(0.6);
		opacity: 0;
	}

	10% {
		opacity: 0.8;
	}

	50% {
		opacity: 1;
	}

	100% {
		transform: translateY(-110vh) scale(1.4);
		opacity: 0;
	}
}

.dragon-btn {
	position: relative;
	font-family: "Poppins", sans-serif;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 2px;
	color: #3b1d00;

	padding: 16px 60px;
	border-radius: 999px;
	border: none;
	cursor: pointer;

	background: linear-gradient(
		to bottom,
		#fff6cc 0%,
		#facc15 30%,
		#eab308 60%,
		#b45309 100%
	);

	box-shadow:
		inset 0 2px 4px rgba(255, 255, 255, 0.6),
		inset 0 -4px 6px rgba(0, 0, 0, 0.25),
		0 10px 24px rgba(250, 204, 21, 0.45),
		0 0 20px rgba(255, 215, 0, 0.5);

	transition:
		transform 0.12s ease,
		box-shadow 0.12s ease;
}

/* GLOW HALUS */
.dragon-btn::before {
	content: "";
	position: absolute;
	inset: -6px;
	border-radius: 999px;
	background: radial-gradient(circle, rgba(255, 215, 0, 0.6), transparent 70%);
	opacity: 0.6;
	filter: blur(10px);
	z-index: -1;
}

/* HOVER */
.dragon-btn:hover {
	transform: translateY(-2px);
	box-shadow:
		inset 0 2px 4px rgba(255, 255, 255, 0.6),
		inset 0 -4px 6px rgba(0, 0, 0, 0.25),
		0 16px 30px rgba(250, 204, 21, 0.65),
		0 0 30px rgba(255, 215, 0, 0.8);
}

/* PRESS */
.dragon-btn:active {
	transform: translateY(2px) scale(0.98);
	box-shadow:
		inset 0 4px 6px rgba(0, 0, 0, 0.4),
		0 4px 10px rgba(0, 0, 0, 0.4);
}
.modal.hidden {
	display: none;
}

.modal-input {
	padding: 12px;
	margin-top: 15px;
	border-radius: 8px;
	border: none;
	font-size: 14px;
}

.modal-error {
	margin: 10px;
	color: #ff4d4d;
	font-size: 13px;
}
.winner-popup {
	position: fixed;
	top: -100px;
	left: 50%;
	transform: translateX(-50%);
	background: linear-gradient(90deg, #facc15, #f97316);
	color: #000;
	padding: 12px 20px;
	border-radius: 50px;
	font-weight: bold;
	z-index: 9999;
	transition: top 0.6s ease;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.winner-popup.show {
	top: 20px;
}



.hidden {
	display: none;
}
.spin-cloud {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100%;
	pointer-events: none;
	z-index: 9999;
}

.cloud-left,
.cloud-right {
	position: absolute;
	bottom: -280px;
	width: 45%;
	opacity: 0.55;
	filter: brightness(0.6) contrast(1.1) blur(2px);
	mix-blend-mode: multiply;

	animation: smokeFloat 12s ease-in-out infinite;
}

.cloud-left {
	left: -120px;
}

.cloud-right {
	right: -130px;
	transform: scaleX(-1);
	animation-delay: 2s; /* biar gak barengan */
}
.cloud-right {
	right: -130px;
	animation: smokeFloatRight 12s ease-in-out infinite;
}
.fire-lightning {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 60%;
	pointer-events: none;
	z-index: -1;

	background:
		radial-gradient(circle at 30% 70%, rgba(255,120,0,0.6), transparent 40%),
		radial-gradient(circle at 70% 60%, rgba(255,80,0,0.6), transparent 45%),
		radial-gradient(circle at 50% 80%, rgba(255,150,0,0.5), transparent 50%);

	animation: fireFlash 3s infinite ease-in-out;
	filter: blur(20px);
}
@keyframes fireFlash {
	0% {
		opacity: 0.3;
		transform: scale(1);
	}
	20% {
		opacity: 0.8;
		transform: scale(1.05);
	}
	40% {
		opacity: 0.4;
		transform: scale(1);
	}
	60% {
		opacity: 0.9;
		transform: scale(1.1);
	}
	100% {
		opacity: 0.3;
		transform: scale(1);
	}
}

@keyframes smokeFloat {
	0% {
		transform: translateY(0px) translateX(0px) scale(1);
	}
	25% {
		transform: translateY(-15px) translateX(8px) scale(1.02);
	}
	50% {
		transform: translateY(-25px) translateX(-8px) scale(1.03);
	}
	75% {
		transform: translateY(-15px) translateX(5px) scale(1.02);
	}
	100% {
		transform: translateY(0px) translateX(0px) scale(1);
	}
}

@keyframes smokeFloatRight {
	0% {
		transform: scaleX(-1) translateY(0px) translateX(0px) scale(1);
	}
	25% {
		transform: scaleX(-1) translateY(-15px) translateX(-8px) scale(1.02);
	}
	50% {
		transform: scaleX(-1) translateY(-25px) translateX(8px) scale(1.03);
	}
	75% {
		transform: scaleX(-1) translateY(-15px) translateX(-5px) scale(1.02);
	}
	100% {
		transform: scaleX(-1) translateY(0px) translateX(0px) scale(1);
	}
}

.cloud-left {
	left: -600px;
}

.cloud-right {
	right: -600px;
	transform: scaleX(-1);
}
.spin-cloud.show .cloud-left {
	animation: cloudInLeft 1.2s ease-out forwards,
	           smokeFloat 12s ease-in-out infinite 1.2s;
}

.spin-cloud.show .cloud-right {
	animation: cloudInRight 1.2s ease-out forwards,
	           smokeFloatRight 12s ease-in-out infinite 1.2s;
}

@keyframes cloudInLeft {
	0% {
		left: -600px;
		opacity: 0;
	}
	60% {
		opacity: 0.8;
	}
	100% {
		left: -120px;
		opacity: 0.9;
	}
}

@keyframes cloudInRight {
	0% {
		right: -600px;
		opacity: 0;
		transform: scaleX(-1);
	}
	60% {
		opacity: 0.8;
	}
	100% {
		right: -130px; 
		transform: scaleX(-1);
		opacity: 0.9;
	}
}

