:root {
  --pink: #ffa6e6;
  --lavender: #eac2ff;
  --sky: #c2e9fb;
  --peach: #ffd6a5;
  --cream: #fff8f0;
  --text: #6b5b95;
  --white: #ffffff;

  --wheel-scale: 1;
}

body {
  margin: 0;
  font-family: "Galindo", cursive;
  background: radial-gradient(circle at top, #2e356b, #1b1f3b);
  color: white;
  height: 100vh;
  overflow: hidden;
}

header {
  text-align: center;
  position: relative;
  font-size: 1.25rem;
  z-index: 999;
  margin: 0;
}

/* ================= LUCKY DRAW ================= */

* {
  box-sizing: border-box;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(
    to bottom,
    #ffa6e6 0%,
    #eac2e6 40%,
    #ed87e9 70%,
    #c2e9fb 100%
  );
  overflow: hidden;
}

.clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  /* important for seamless loop */
  height: 100%;

  background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTaOJ-rhYXNz1k20C4hobnvKoF9dX6kTpvAxA&s");

  animation-duration: 90s;
  opacity: 0.05;
  transform: scale(1.2);

  animation: moveClouds 60s linear infinite;
}

@keyframes moveClouds {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.section-container {
  width: 100vw;
  height: 100vh;
}

#luckyDrawSection {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  display: flex;
  align-items: center;
  justify-content: center;

  flex-direction: column;
  gap: 24px;
}

.lucky-grid-scale-box {
  width: calc(500px * var(--wheel-scale, 1));
  height: calc(500px * var(--wheel-scale, 1));

  display: flex;
  align-items: center;
  justify-content: center;
}

.lucky-grid {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  transform: scale(var(--wheel-scale, 1));
}

@media (max-width: 548px) {
  :root {
    --wheel-scale: 0.8;
  }
}

@media (max-width: 400px) {
  :root {
    --wheel-scale: 0.7;
  }
}

@media (max-width: 360px) {
  :root {
    --wheel-scale: 0.6;
  }
}

@media (max-height: 660px) {
  #luckyDrawSection {
    gap: 12px !important;
  }
}

@media (max-height: 600px) {
  #luckyDrawSection {
    gap: 6px !important;
  }
}

.btn-list {
  width: 90%;
  max-width: 500px;
  margin: 0 auto;

  display: flex;
  justify-content: center;
  gap: 12px;

  margin-top: 12px;
}

.btn-list button {
  width: 50%;
  padding: 10px 0;
  border-radius: 20px;

  border: none;

  color: #6b5b95;
  font-family: "Galindo", cursive;
  font-size: 14px;
  text-align: center;

  cursor: pointer;
  overflow: hidden;

  /* glass base */
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  transition: all 0.2s ease;
}

.rule-btn {
  position: absolute;
  top: 0;
  right: 0;

  padding: 2px 10px;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);

  border: 2px solid rgba(255, 255, 255, 0.4);

  color: white;
  font-family: "Galindo", cursive;
  font-size: 14px;
  text-align: center;

  cursor: pointer;

  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  transition: all 0.2s ease;
  z-index: 10;
}

.rule-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

.rule-page {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;

  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);

  z-index: 9998;
}

.rule-page.active {
  display: flex;
}

.rule-content {
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;

  padding: 24px;
  border-radius: 20px;

  background: linear-gradient(135deg, #ffffffcc, #ffe6f7cc);
  backdrop-filter: blur(12px);

  border: 2px solid rgba(255, 255, 255, 0.5);

  font-family: sans-serif;
  color: #5f5772;
  text-align: left;

  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

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

.rule-content h2 {
  text-align: center;
  margin-bottom: 16px;
}

.rule-section {
  margin-bottom: 16px;
}

.rule-section h3 {
  margin-bottom: 6px;
}

.rule-section ul {
  padding-left: 18px;
}

.rule-section li {
  margin-bottom: 6px;
}

.close-rules {
  width: 90%;
  max-width: 500px;
  padding: 16px;
  border-radius: 20px;

  border: none;
  cursor: pointer;

  background: linear-gradient(135deg, #ffa6e6, #c2e9fb);
  color: #6b5b95;
  font-weight: bold;

  transition: 0.2s;
}

.close-rules:hover {
  transform: scale(1.05);
}

.lucky-wheel-wrapper {
  width: 500px;
  height: 500px;
  box-sizing: border-box;
  position: relative;
}

.lucky-wheel-container {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;

  background: radial-gradient(circle at 30% 30%, #ffffff, #ffe6f7);

  border: 17.5px solid #ab80ff;

  transition: transform 4s cubic-bezier(0.33, 1, 0.68, 1);
}

/* outer light bulb ring */
.wheel-bulbs {
  position: absolute;
  inset: 0;

  animation: bulbGlow 2s infinite alternate;
  z-index: 1;
}

@keyframes bulbGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 3px #fff);
  }

  50% {
    filter: drop-shadow(0 0 10px #ffd166);
  }
}

.lucky-wheel-container.spinning {
  animation: glowPulse 0.6s infinite alternate;
}

@keyframes glowPulse {
  from {
    box-shadow:
      0 0 10px #fff,
      0 0 20px #ffd6f6,
      0 10px 30px rgba(255, 182, 193, 0.5);
  }

  to {
    box-shadow:
      0 0 20px #fff,
      0 0 40px #ffc8dd,
      0 15px 40px rgba(255, 182, 193, 0.7);
  }
}

.lucky-wheel-container div {
  height: 50%;
  width: 200px;
  position: absolute;
  clip-path: polygon(100% 0, 50% 100%, 0 0);
  transform: translateX(-50%);
  transform-origin: bottom;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  gap: 12px;

  font-size: 18px;
  font-weight: bold;
  font-family: sans-serif;
  left: 50%;
}

.lucky-wheel-container .active {
  animation: sparkle 0.4s ease infinite alternate;
}

@keyframes sparkle {
  from {
    filter: brightness(1.2) drop-shadow(0 0 10px #fff);
  }

  to {
    filter: brightness(1) drop-shadow(0 0 10px #fff);
  }
}

.lucky-wheel-container .one {
  left: 50%;
}

.lucky-wheel-container .two {
  transform: translateX(-50%) rotate(45deg);
}

.lucky-wheel-container .three {
  transform: translateX(-50%) rotate(90deg);
}

.lucky-wheel-container .four {
  transform: translateX(-50%) rotate(135deg);
}

.lucky-wheel-container .five {
  transform: translateX(-50%) rotate(180deg);
}

.lucky-wheel-container .six {
  transform: translateX(-50%) rotate(225deg);
}

.lucky-wheel-container .seven {
  transform: translateX(-50%) rotate(270deg);
}

.lucky-wheel-container .eight {
  transform: translateX(-50%) rotate(315deg);
}

.odd-wheel {
  background: linear-gradient(135deg, #ffe0f7, #ffd6a5);
  color: #6b5b95;
}

.even-wheel {
  background: linear-gradient(135deg, #c2e9fb, #eac2ff);
  color: #6b5b95 !important;
}

.wheel-gift-img {
  width: 70px;
  height: 70px;
}

#spin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  z-index: 10;

  width: 120px;
  height: 120px;

  background-image: url("https://drive.google.com/thumbnail?id=1TGRiKrKrz89QtfjBo_8hPhuYjcpd1LQY&sz=w1000");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;

  cursor: pointer;
  outline: none;

  border: none;
  background-color: unset;

  transition: all 0.15s ease;
}

#spin.active {
  pointer-events: none;
}

#spin:not(.active):hover {
  transform: translate(-50%, -55%) scale(1.08);
}

.spin-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;

  transition: all 0.3s ease;

  z-index: 50;
}

.spin-overlay p {
  width: 100%;
  text-align: center;

  font-size: 16px;
  font-family: "Galindo", cursive;
  color: #6b5b95;

  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.8);

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 0 20px rgba(255, 182, 193, 0.3);
}

/* active state */
.spin-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* ========================= SOCIAL FOOTER ========================= */

.social-footer {
  width: 90%;
  max-width: 500px;

  display: flex;
  justify-content: center;
  align-items: center;
}

.social-content {
  width: 100%;
  padding: 14px 18px 4px;
  border-radius: 20px;

  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);

  border: 2px solid rgba(255, 255, 255, 0.3);

  text-align: center;

  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.social-title {
  margin: 0;
  font-size: 14px;
  color: white;
  opacity: 0.9;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 18px;

  margin: 10px 0;
}

.social-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  /* background: linear-gradient(135deg, #ffa6e6, #c2e9fb); */

  transition: all 0.25s ease;

  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); */

  animation: floatSoft 4s ease-in-out infinite;
}

@keyframes floatSoft {
  0%,
  100% {
    transform: translateY(0);
  }

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

.social-icon img {
  width: 100%;
  height: 100%;

  border-radius: 50%;
}

/* hover glow effect */
.social-icon:hover {
  transform: translateY(-4px) scale(1.1);

  box-shadow:
    0 0 10px #fff,
    0 0 20px #ffc8dd,
    0 6px 20px rgba(0, 0, 0, 0.3);
}

.social-tagline {
  font-size: 12px;
  margin: 0;
  opacity: 0.8;
}

/* ========================= WIN PAGE ========================= */

.win-page {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);

  z-index: 9999;
}

.win-page.active {
  display: flex;
}

.win-page-overlay {
  position: fixed;
  inset: 0;
}

.win-content {
  width: 90%;
  max-width: 420px;

  padding: 28px;
  border-radius: 24px;

  text-align: center;

  background: linear-gradient(135deg, #ffffffcc, #ffe6f7cc);
  backdrop-filter: blur(12px);

  border: 2px solid rgba(255, 255, 255, 0.5);

  color: #6b5b95;

  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);

  animation: popWin 0.4s ease;
}

.win-content h2 {
  margin-top: 0;
}

@keyframes popWin {
  from {
    transform: scale(0.7) translateY(40px);
    opacity: 0;
  }

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

.coupon-card {
  margin: 20px 0;
  padding: 20px;

  border-radius: 16px;

  background: linear-gradient(135deg, #ff6cd6, #8adaff);
  color: white;

  box-shadow:
    0 0 15px #fff,
    0 0 30px #ffc8dd,
    0 10px 30px rgba(0, 0, 0, 0.25);

  position: relative;
  overflow: hidden;
}

/* dashed ticket edge */
.coupon-card::before,
.coupon-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;

  background: repeating-linear-gradient(
    90deg,
    white 0px,
    white 6px,
    transparent 6px,
    transparent 12px
  );

  opacity: 0.6;
}

.coupon-card::before {
  top: 0;
}

.coupon-card::after {
  bottom: 0;
}

.coupon-title {
  font-size: 28px;
  font-weight: bold;
}

.coupon-desc {
  font-size: 14px;
  opacity: 0.9;
}

.coupon-valid {
  font-size: 12px;
}

.coupon-actions {
  display: flex;
  gap: 10px;
}

.primary-btn,
.secondary-btn {
  flex: 1;
  padding: 12px;

  border-radius: 20px;
  border: none;

  font-family: "Galindo", cursive;
  cursor: pointer;

  transition: 0.2s;
}

.primary-btn {
  background: linear-gradient(135deg, #ffa6e6, #ff8fab);
  color: white;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #6b5b95;
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: scale(1.05);
}

.coupon-redeem-date {
  display: none;
}

.coupon-redeem-date.active {
  display: block;
  padding: 12px 0;
  font-size: 12px;
}

/* ========================= CONFETTI ========================= */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ========================= UTIL ========================= */
.textSelectDisable {
  -webkit-touch-callout: none;
  /* iOS Safari */
  -webkit-user-select: none;
  /* Safari */
  -khtml-user-select: none;
  /* Konqueror HTML */
  -moz-user-select: none;
  /* Old versions of Firefox */
  -ms-user-select: none;
  /* Internet Explorer/Edge */
  user-select: none;
  /* Non-prefixed version, currently */
}
