@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;700;900&family=Bebas+Neue&family=Open+Sans:wght@400;700&display=swap');

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}



/* ─── Wheel Wrapper ─── */
#wheel-wrapper {
  position: relative;
  width: 100%;
  max-width: 874px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  background: url('../img/wheel-wrapper-1.webp') no-repeat center / contain;
}

#wheel-figure {
  position: absolute;
  top: 60%;
  left: 50%;
  width: 76%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 2;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.2));
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: url('../img/wheel-canvas.webp') no-repeat center / contain;
  will-change: transform;
  transform-origin: center center;
}

/* ─── Pointer ─── */
#pointer {
  position: absolute;
  top: 27%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 52px;
  height: 80px;
  background: url('../img/pointer.webp') no-repeat center / contain;
}

/* ─── Spin Button ─── */
#spin-btn {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: url('../img/spin-btn.webp') no-repeat center / contain;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s, opacity 0.3s;
}

#spin-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
}

#spin-btn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

#spin-btn:disabled {
  cursor: not-allowed;
}

@keyframes lever-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  15%      { transform: translate(-50%, -50%) rotate(-4deg); }
  30%      { transform: translate(-50%, -50%) rotate(3deg); }
  45%      { transform: translate(-50%, -50%) rotate(-3deg); }
  60%      { transform: translate(-50%, -50%) rotate(2deg); }
  75%      { transform: translate(-50%, -50%) rotate(-2deg); }
  90%      { transform: translate(-50%, -50%) rotate(1deg); }
}
#spin-btn.spinning {
  animation: lever-shake 0.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pointer-shake {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  15%      { transform: translateX(-50%) rotate(-4deg); }
  30%      { transform: translateX(-50%) rotate(3deg); }
  45%      { transform: translateX(-50%) rotate(-3deg); }
  60%      { transform: translateX(-50%) rotate(2deg); }
  75%      { transform: translateX(-50%) rotate(-2deg); }
  90%      { transform: translateX(-50%) rotate(1deg); }
}
#pointer.spinning {
  animation: pointer-shake 0.6s ease-in-out infinite;
  pointer-events: none;
}

/* ─── Popup Overlay ─── */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

#popup-card {
  position: relative;
  width: 480px;
  background: transparent;
  border: none;
  border-radius: 20px;
  box-shadow: none;
  padding: 0;
  line-height: 0;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#popup-card.mode-html {
  background: linear-gradient(180deg, #1a1a3e 0%, #0d0d2b 100%);
  border: 2px solid rgba(255, 215, 0, 0.4);
  padding: 40px 36px 36px;
  line-height: normal;
  box-shadow:
    0 0 60px rgba(255, 215, 0, 0.15),
    0 20px 60px rgba(0, 0, 0, 0.5);
}

#popup-card img {
  display: block;
  width: 100%;
}

#popup-card .popup-btn {
  z-index: 2;
}

#popup-overlay.active #popup-card {
  transform: scale(1) translateY(0);
}

/* ─── Popup Close X ─── */
.popup-x {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.popup-x:hover {
  background: rgba(220, 20, 60, 0.8);
}

/* ─── Popup Body ─── */
#popup-body {
  color: #ffffff;
}

#popup-body .popup-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

#popup-body .popup-title {
  font-family: 'Bebas Neue', 'Arial Black', Impact, sans-serif;
  font-size: 24px;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  line-height: 1.3;
}

#popup-body .popup-title span {
  display: block;
  font-size: 20px;
}

#popup-body .popup-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
  line-height: 1.5;
}

#popup-body .popup-amount {
  font-family: 'Bebas Neue', 'Arial Black', Impact, sans-serif;
  font-size: 48px;
  color: #FFD700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  margin: 16px 0;
  letter-spacing: 2px;
}

#popup-body .popup-number {
  font-family: 'Bebas Neue', 'Arial Black', Impact, sans-serif;
  font-size: 56px;
  color: #FFD700;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  margin: 16px 0;
  letter-spacing: 4px;
}

#popup-body .popup-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 20px;
}

#popup-body .popup-message strong {
  color: #FFD700;
}

/* ─── Steps ─── */
.popup-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.popup-steps .step {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-steps .step-arrow {
  color: rgba(255, 215, 0, 0.5);
  font-size: 18px;
  font-weight: 700;
}

/* ─── Popup Buttons ─── */
.popup-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 14px 48px;
  border: none;
  border-radius: 8px;
  font-family: 'Bebas Neue', 'Arial Black', Impact, sans-serif;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 2px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-transform: uppercase;
}

.popup-btn:hover {
  transform: scale(1.03);
}

.popup-btn:active {
  transform: scale(0.97);
}

.popup-btn-primary {
  background: linear-gradient(135deg, #DC143C, #8B0000);
  color: #FFD700;
  box-shadow: 0 4px 20px rgba(220, 20, 60, 0.4);
}

.popup-btn-primary:hover {
  box-shadow: 0 6px 30px rgba(220, 20, 60, 0.6);
}

.popup-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Hidden ─── */
.hidden {
  display: none !important;
}

/* ─── Decorative gold bar ─── */
.popup-gold-bar {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FFD700, transparent);
  margin: 0 auto 16px;
  border-radius: 2px;
}

/* ─── Confetti / celebration lines ─── */
.popup-celebration {
  font-size: 13px;
  color: rgba(255, 215, 0, 0.6);
  margin-bottom: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── Lose Notification ─── */
#lose-notification {
  position: absolute;
  top: 93%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  border-radius: 40px;
  padding-top: 28px;
  padding-right: 20px;
  padding-bottom: 28px;
  padding-left: 20px;
  background: #FFFFFF;
  box-shadow: 0px 0px 30px 0px #FFE357;
  z-index: 1000;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
#lose-notification.hidden {
  opacity: 0;
  visibility: hidden;
  display: block !important;
}
#lose-notification:not(.hidden) {
  opacity: 1;
  visibility: visible;
}
.lose-noti-title {
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 700;
  font-size: 24px;
  text-align: center;
  background: linear-gradient(94deg, #FC9603 0.48%, #DE290C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.3;
}
.lose-noti-message {
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 24px;
  text-align: center;
  color: #1F1F1F;
}

/*************** CSS for Tablet ***************/
@media (max-width: 1023px) and (orientation: landscape) {
  #pointer {
	  width: 26px;
	  height: 40px;
  }
  #spin-btn {
	  width: 50px;
	  height: 50px;
  }
}

@media (orientation: portrait) {
  #wheel-wrapper {
    background-image: url('../img/wheel-wrapper-mb.webp');
    aspect-ratio: 1 / 1.43;
  }
  #wheel-figure {
    top: 55%;
    width: 113%;
  }
  #pointer {
    top: 20%;
  }
  #spin-btn {
    top: 55%;
  }
  #lose-notification {
    width: 90%;
  }
}