@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&display=swap');

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

:root {
  --gold:   #FFD700;
  --orange: #FF6B35;
  --shopee: #EE4D2D;
  --bg:     #080018;
}

html { height: 100%; }

body {
  min-height: 100%;
  font-family: 'Outfit', sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #2a0060 0%, #120030 40%, var(--bg) 100%);
  color: #fff;
  overflow-x: hidden;
}

/* ── STARS BACKGROUND ── */
.stars {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.star {
  position: absolute; border-radius: 50%;
  background: #fff; opacity: 0;
  animation: twinkle linear infinite;
}
@keyframes twinkle {
  0%,100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 0.8; transform: scale(1); }
}

/* ── FLOATING ORBS ── */
.orb {
  position: fixed; border-radius: 50%;
  filter: blur(80px); pointer-events: none; z-index: 0;
  animation: orb-drift ease-in-out infinite alternate;
}
.orb-1 { width:300px; height:300px; background:rgba(147,0,255,0.18); top:-100px; left:-80px; animation-duration:12s; }
.orb-2 { width:250px; height:250px; background:rgba(255,107,53,0.15); bottom:-80px; right:-60px; animation-duration:15s; }
.orb-3 { width:200px; height:200px; background:rgba(255,0,110,0.12); top:40%; left:60%; animation-duration:18s; }
@keyframes orb-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.1); }
}

/* ── LAYOUT ── */
#app {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 50px;
}

/* ── HEADER ── */
.header { text-align: center; margin-bottom: 18px; animation: fadeDown .7s ease; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, rgba(255,107,53,.25), rgba(238,77,45,.15));
  border: 1px solid rgba(255,107,53,.4);
  border-radius: 999px; padding: 5px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  color: #ff9a6c; margin-bottom: 10px; text-transform: uppercase;
}

.header h1 {
  font-size: clamp(30px, 9vw, 56px); font-weight: 900; line-height: 1.05;
  background: linear-gradient(135deg, #FFD700 0%, #FF6B35 45%, #FF006E 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
  filter: drop-shadow(0 0 25px rgba(255,215,0,.35));
}

.header-sub {
  color: rgba(255,255,255,.6); font-size: 13px; line-height: 1.7; max-width: 360px; margin: 0 auto;
}

/* ── STATS ── */
.stats {
  display: flex; align-items: center; width: 100%; max-width: 480px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 12px 0; margin-bottom: 22px;
  backdrop-filter: blur(12px); animation: fadeDown .8s ease;
}
.stat { flex: 1; text-align: center; }
.stat-num { display: block; font-size: 20px; font-weight: 700; }
.stat-lbl { font-size: 9px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: 1px; }
.stat-div { width: 1px; height: 32px; background: rgba(255,255,255,.12); }

/* ── WHEEL SECTION ── */
.wheel-section { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* Pointer */
.pointer {
  font-size: 38px; color: var(--gold); line-height: 1;
  margin-bottom: -4px; position: relative; z-index: 10;
  filter: drop-shadow(0 0 12px rgba(255,215,0,.9));
  animation: ptr-bounce 1.2s ease-in-out infinite;
}
@keyframes ptr-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* Wheel glow ring */
.wheel-ring {
  padding: 10px; border-radius: 50%;
  background: conic-gradient(from 0deg, #FFD700, #FF6B35, #FF006E, #9B59B6, #00E5FF, #FFD700);
  animation: ring-spin 8s linear infinite;
  box-shadow: 0 0 50px rgba(255,215,0,.4), 0 0 100px rgba(255,107,53,.25);
}
@keyframes ring-spin { to { transform: rotate(360deg); } }

.wheel-inner { border-radius: 50%; overflow: hidden; background: #000; }

#wheel-canvas { display: block; border-radius: 50%; }

/* ── SPIN BUTTON ── */
.btn-spin {
  margin-top: 26px;
  width: min(300px, 88%);
  padding: 18px 28px 14px;
  border: none; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #FF6B35, #EE4D2D, #B71C1C);
  color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 10px 40px rgba(238,77,45,.55), 0 0 0 3px rgba(255,215,0,.5), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .15s, box-shadow .25s;
  animation: btn-glow 2s ease-in-out infinite;
}
@keyframes btn-glow {
  0%,100% { box-shadow: 0 10px 40px rgba(238,77,45,.55), 0 0 0 3px rgba(255,215,0,.5); }
  50%      { box-shadow: 0 14px 60px rgba(238,77,45,.75), 0 0 0 6px rgba(255,215,0,.7); }
}
.btn-spin:hover  { transform: translateY(-4px); animation: none; box-shadow: 0 18px 60px rgba(238,77,45,.75), 0 0 0 5px rgba(255,215,0,.8); }
.btn-spin:active { transform: translateY(-1px); }
.btn-spin:disabled { opacity: .6; cursor: not-allowed; animation: none; transform: none; }

.btn-icon { font-size: 30px; }
.btn-text { font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.btn-sub  { font-size: 11px; opacity: .8; }

/* ── NOTICE ── */
.notice { margin-top: 18px; font-size: 11px; color: rgba(255,255,255,.35); text-align: center; max-width: 340px; line-height: 1.7; }

/* ── RESULT OVERLAY ── */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 0, 16, .9); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.overlay.show { display: flex; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Confetti layer */
#confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cp {
  position: absolute; border-radius: 3px;
  animation: cp-fall linear forwards;
}
@keyframes cp-fall {
  0%   { transform: translateY(-30px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(600deg); opacity: 0; }
}

/* Result card */
.result-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(35,10,70,.97) 0%, rgba(12,4,28,.97) 100%);
  border: 2px solid rgba(255,215,0,.35); border-radius: 26px;
  padding: 32px 24px 24px; max-width: 390px; width: 100%; text-align: center;
  box-shadow: 0 0 80px rgba(255,215,0,.2), 0 0 160px rgba(255,107,53,.12);
  animation: slide-up .4s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes slide-up { from { transform: translateY(50px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

/* Shimmer stripe */
.result-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #FFD700, #FF6B35, #FF006E, #9B59B6, #FFD700);
  background-size: 200%; animation: shimmer 2s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.res-emoji { font-size: 76px; line-height: 1; margin-bottom: 10px; animation: pop .5s cubic-bezier(.175,.885,.32,1.275) .2s both; }
@keyframes pop { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

.res-congrats {
  font-size: 26px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(135deg, #FFD700, #FF6B35);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 4px;
}
.res-got { font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 5px; }
.res-prize {
  font-size: 30px; font-weight: 900; color: #fff; margin-bottom: 14px;
  text-shadow: 0 0 25px rgba(255,215,0,.6);
}

.res-desc { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.7; margin-bottom: 18px; }

/* Countdown */
.cd-bar { background: rgba(255,255,255,.1); border-radius: 999px; height: 5px; margin-bottom: 6px; overflow: hidden; }
.cd-fill { height: 100%; background: linear-gradient(90deg, #FFD700, #FF6B35); border-radius: 999px; width: 100%; transition: width 1s linear; }
.cd-text { font-size: 12px; color: rgba(255,255,255,.45); margin-bottom: 20px; }
.cd-text b { color: #FF6B35; }

/* CTA */
.btn-cta {
  display: block; padding: 18px 20px 13px; border-radius: 16px;
  background: linear-gradient(135deg, #FF6B35, #EE4D2D);
  color: #fff; text-decoration: none; font-weight: 700; font-size: 17px;
  margin-bottom: 12px;
  box-shadow: 0 10px 35px rgba(238,77,45,.5);
  transition: transform .15s, box-shadow .2s;
  animation: btn-glow 1.8s ease-in-out infinite;
}
.btn-cta:hover { transform: translateY(-3px); box-shadow: 0 16px 50px rgba(238,77,45,.7); animation: none; }
.btn-cta small { display: block; font-size: 11px; font-weight: 400; opacity: .85; margin-top: 3px; }

.btn-again {
  width: 100%; padding: 12px; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.45); font-family: 'Outfit', sans-serif; font-size: 13px;
  transition: all .2s;
}
.btn-again:hover { border-color: rgba(255,215,0,.5); color: var(--gold); }

/* Animations */
@keyframes fadeDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:none; } }

/* Mobile */
@media (max-width: 400px) {
  .header h1 { font-size: 28px; }
  .btn-text { font-size: 20px; }
  .res-prize { font-size: 26px; }
}
