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

:root {
  --bg: #0f0e17;
  --surface: rgba(255, 255, 255, 0.06);
  --text: #fffffe;
  --muted: rgba(255, 255, 255, 0.65);
  --accent: #7f5af0;
  --accent-2: #2cb67d;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  font-family: 'Manrope', system-ui, sans-serif;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

.shape-1 {
  width: 420px;
  height: 420px;
  background: #7f5af0;
  top: -120px;
  right: -80px;
}

.shape-2 {
  width: 360px;
  height: 360px;
  background: #ff8906;
  bottom: -100px;
  left: -60px;
}

.shape-3 {
  width: 280px;
  height: 280px;
  background: #2cb67d;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(127, 90, 240, 0.2);
  border: 1px solid rgba(127, 90, 240, 0.45);
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.title {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 28ch;
  margin-inline: auto;
}

.wheel-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.wheel-wrap {
  position: relative;
  width: min(92vw, 420px);
  aspect-ratio: 1;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.08),
    0 0 0 12px rgba(127, 90, 240, 0.15),
    var(--shadow);
  transition: filter 0.3s ease;
}

.wheel-wrap.is-spinning #wheel {
  filter: brightness(1.05);
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 38px;
  z-index: 3;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.pointer svg {
  width: 100%;
  height: 100%;
  display: block;
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 88px;
  height: 88px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(145deg, #2cb67d, #1a8f5f);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow:
    0 4px 0 #157a4f,
    0 12px 32px rgba(44, 182, 125, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.spin-btn:hover:not(:disabled) {
  transform: translate(-50%, -52%);
  box-shadow:
    0 6px 0 #157a4f,
    0 16px 40px rgba(44, 182, 125, 0.55);
}

.spin-btn:active:not(:disabled) {
  transform: translate(-50%, -48%);
  box-shadow:
    0 2px 0 #157a4f,
    0 8px 24px rgba(44, 182, 125, 0.4);
}

.spin-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: linear-gradient(145deg, #6b7280, #4b5563);
  box-shadow: 0 4px 0 #374151, 0 8px 20px rgba(0, 0, 0, 0.25);
}

.spin-btn__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.spin-btn__text {
  position: relative;
  z-index: 1;
}

.hint {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

/* Overlay & result */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 14, 23, 0.72);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.35s ease;
}

.overlay[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-card {
  position: relative;
  width: min(100%, 400px);
  padding: 2.25rem 1.75rem 1.75rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  text-align: center;
  animation: slideUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-card__glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--prize-glow, rgba(127, 90, 240, 0.25));
  filter: blur(40px);
  opacity: 0.6;
  z-index: -1;
}

.result-card__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 2.25rem;
  background: var(--prize-bg, rgba(127, 90, 240, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.result-card__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.result-card__title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--prize-color, #fff);
}

.result-card__desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.result-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--prize-color, #7f5af0), color-mix(in srgb, var(--prize-color, #7f5af0) 70%, #000));
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--prize-color, #7f5af0) 40%, transparent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--prize-color, #7f5af0) 50%, transparent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

@media (max-width: 480px) {
  .app {
    padding-top: 1.75rem;
  }

  .spin-btn {
    width: 76px;
    height: 76px;
    font-size: 0.85rem;
  }

  .result-card {
    padding: 1.75rem 1.25rem 1.25rem;
  }
}
