/* ── Winner Wheel Picker — prime-time game show stage ───────────────
   Royal-purple curtain, spotlight sweep, marquee-bulb brass bezel,
   jewel-tone segments, gold slab-serif show title. */

:root {
  --purple: #3b1d5e;
  --purple-deep: #241040;
  --curtain: #4b2775;
  --gold: #f2c14e;
  --gold-deep: #c8952a;
  --brass: #8a6a24;
  --ruby: #c22f4d;
  --sapphire: #2456b8;
  --emerald: #1d9e6e;
  --amber: #e8912e;
  --cream: #fdf7ea;
  --ink: #2b1c3d;
  --err: #ff7a7a;
  --font-display: 'Alfa Slab One', serif;
  --font-body: 'Figtree', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 26px, transparent 26px 52px),
    linear-gradient(180deg, var(--curtain) 0%, var(--purple) 45%, var(--purple-deep) 100%);
  background-attachment: fixed;
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 42% at 50% 16%, rgba(253, 247, 234, 0.14), transparent 70%);
  animation: sweep 9s ease-in-out infinite alternate;
}

@keyframes sweep {
  from { background-position: -80px 0; }
  to { background-position: 80px 0; }
}

.wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px; z-index: 1; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 46px 0 20px; }

.kicker {
  display: inline-block;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--purple-deep);
  background: var(--gold);
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 8.5vw, 3rem);
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.hero .sub { margin-top: 10px; color: rgba(253, 247, 234, 0.75); font-weight: 600; }

/* ── Stage / wheel ────────────────────────────────────────────────── */
.stage { text-align: center; }

.wheel-rig { position: relative; width: min(82vw, 380px); margin: 8px auto 24px; }

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--gold);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  z-index: 3;
}

.bezel {
  position: relative;
  border-radius: 50%;
  padding: 14px;
  background:
    radial-gradient(circle at 30% 25%, #b08d3d, var(--brass) 60%, #5d461a);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 2px 6px rgba(255, 255, 255, 0.35);
}

/* marquee bulbs */
.bezel::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 234, 168, 0.95) 2.6px, transparent 3.4px);
  background-size: 34px 34px;
  background-position: center;
  -webkit-mask-image: radial-gradient(circle, transparent 92%, #000 93%);
  mask-image: radial-gradient(circle, transparent 92%, #000 93%);
  animation: twinkle 1.4s steps(2) infinite;
  pointer-events: none;
}

@keyframes twinkle { 50% { opacity: 0.45; } }

#wheel {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  background: var(--purple-deep);
}

.count-line { margin-top: 12px; color: rgba(253, 247, 234, 0.65); font-size: 0.9rem; font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--gold), var(--gold-deep));
  color: var(--purple-deep);
  box-shadow: 0 8px 0 var(--brass), 0 16px 34px rgba(0, 0, 0, 0.45);
}

.btn-big { font-size: 1.2rem; padding: 17px 44px; text-transform: uppercase; letter-spacing: 0.08em; }

.btn-ghost {
  background: rgba(253, 247, 234, 0.1);
  color: var(--cream);
  border: 2px solid rgba(253, 247, 234, 0.35);
  font-size: 0.9rem;
  padding: 11px 22px;
}

.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }

/* ── Winner card ──────────────────────────────────────────────────── */
.winner-card {
  position: relative;
  margin: 26px 0 8px;
  padding: 30px 26px 28px;
  text-align: center;
  background: linear-gradient(160deg, var(--cream), #f4e8ce);
  color: var(--ink);
  border-radius: 16px;
  border: 3px solid var(--gold);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 40px rgba(242, 193, 78, 0.35);
  animation: winnerpop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes winnerpop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.sparkle span {
  position: absolute;
  color: var(--gold-deep);
  font-size: 1.4rem;
  animation: spark 1.6s ease-in-out infinite;
}

.sparkle span:nth-child(1) { top: 12px; left: 18px; }
.sparkle span:nth-child(2) { top: 20px; right: 24px; animation-delay: 0.5s; }
.sparkle span:nth-child(3) { bottom: 16px; left: 42px; animation-delay: 1s; }

@keyframes spark {
  0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

.winner-kicker {
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 6px;
}

.winner-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 8vw, 2.6rem);
  line-height: 1.1;
  word-break: break-word;
}

.prize-line { margin-top: 8px; color: #6d5c44; font-weight: 600; }

.winner-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.winner-actions .btn-ghost {
  background: rgba(43, 28, 61, 0.06);
  color: var(--ink);
  border-color: rgba(43, 28, 61, 0.3);
}

.winner-actions .btn-ghost:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--gold-deep); }

/* ── Name manager ─────────────────────────────────────────────────── */
.manager { margin-top: 26px; }

.manager-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(253, 247, 234, 0.2);
  border-radius: 12px;
  padding: 16px 18px;
}

.manager-box summary {
  cursor: pointer;
  font-weight: 700;
  color: rgba(253, 247, 234, 0.85);
}

.manager-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(253, 247, 234, 0.6);
}

textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(253, 247, 234, 0.25);
  border-radius: 10px;
  resize: vertical;
  margin-bottom: 12px;
}

textarea:focus { outline: none; border-color: var(--gold); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: rgba(253, 247, 234, 0.5);
  font-size: 0.85rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .spotlight, .bezel::before { animation: none; }
}
