:root {
  --teal-dark: #0a8770;
  --cream: #fff7e6;
  --dusty-pink: #d99a9a;
  --butter-yellow: #fae392;
  --teal-light: #16a085;
  --espresso: #3b2b20;
}

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

body {
  font-family: 'Outfit', sans-serif;
  color: var(--cream);
  background-color: var(--teal-dark);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.bg-wrapper {
  flex-grow: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

.bg-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 135, 112, 0.3) 0%, rgba(5, 74, 61, 0.8) 100%);
  z-index: 1;
}

.content-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-chip {
  background: var(--cream);
  color: var(--espresso);
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bean-dot {
  width: 12px; height: 12px;
  background: var(--espresso);
  border-radius: 50% 0 50% 50%;
  transform: rotate(45deg);
  margin-right: 8px;
}

h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  color: var(--cream);
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.wheel-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  margin-bottom: 40px;
}

.wheel-pointer {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 50px;
  background: var(--cream);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  z-index: 10;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

#wheel-canvas {
  width: 100%; height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 0 8px rgba(255, 247, 230, 0.15);
  transition: transform 5s cubic-bezier(0.2, 0.8, 0.1, 1);
  transform: rotate(0deg);
}

.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 110px; height: 110px;
  background: var(--cream);
  border-radius: 50%;
  z-index: 5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 -4px 10px rgba(0,0,0,0.1);
  display: flex; justify-content: center; align-items: center;
  padding: 8px;
}

.wheel-center .bean-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(250, 227, 146, 0.6);
}

.spin-form {
  display: flex;
  width: 100%;
  max-width: 440px;
  gap: 12px;
  margin-bottom: 24px;
}

.spin-form input {
  flex-grow: 1;
  padding: 18px 24px;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid rgba(255, 247, 230, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
  outline: none;
  transition: all 0.3s;
}

.spin-form input::placeholder { color: rgba(255, 247, 230, 0.6); }
.spin-form input:focus { border-color: var(--cream); background: rgba(255, 255, 255, 0.15); }

.spin-form button {
  padding: 18px 36px;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  background: var(--cream);
  color: var(--teal-dark);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 247, 230, 0.3);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.spin-form button::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
  transform: rotate(45deg) translate(-100%, -100%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: rotate(45deg) translate(-100%, -100%); }
  20% { transform: rotate(45deg) translate(100%, 100%); }
  100% { transform: rotate(45deg) translate(100%, 100%); }
}

.spin-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 247, 230, 0.5);
}

.spin-form button:disabled {
  opacity: 0.7; cursor: not-allowed; transform: none;
}

.footer-text {
  font-size: 0.95rem;
  color: rgba(255, 247, 230, 0.7);
  font-weight: 400;
}

/* Toast */
.toast {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 135, 112, 0.9);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex; justify-content: center; align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s forwards;
}

.toast-content {
  background: var(--cream);
  color: var(--espresso);
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  max-width: 400px; width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  transform: scale(0.9);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { to { transform: scale(1); } }

.toast h2 {
  font-family: 'Sora', sans-serif;
  font-size: 2.2rem; margin-bottom: 12px; color: var(--teal-dark);
}

#toast-prize { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; }

.code-box {
  background: rgba(0,0,0,0.05); padding: 16px; border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; border: 1px dashed rgba(0,0,0,0.2);
}
.code-box span { font-family: monospace; font-size: 1.3rem; font-weight: bold; }
.code-box button {
  background: var(--teal-dark); color: var(--cream); border: none;
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600;
}

.qr-box { margin-bottom: 20px; }
.qr-box img { width: 150px; height: 150px; margin: 0 auto 10px; display: block; border-radius: 8px; }
.qr-box p { font-size: 0.9rem; color: #666; }

.error-msg {
  color: #ffbaba; margin-top: 12px; font-size: 0.95rem; font-weight: 600;
}

#wbx-powered-by-slot {
  margin-top: 40px; width: 100%; display: flex; justify-content: center;
}

@media (max-width: 600px) {
  .spin-form { flex-direction: column; }
  .spin-form button { width: 100%; }
  h1 { font-size: 3rem; }
}