@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@700;800&display=swap');

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

:root {
  --bg: #06060f;
  --surface: #10101e;
  --border: #1e1e32;
  --gold: #f5c542;
  --gold-dim: #a88620;
  --magenta: #d63af9;
  --text: #f0f0f8;
  --muted: #7070a0;
  --success: #22c55e;
  --radius: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated background ─────────────────────────────────────────────────── */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #f5c542, transparent 70%);
  top: -200px; left: -200px;
  animation: drift1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #d63af9, transparent 70%);
  bottom: -150px; right: -150px;
  animation: drift2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  top: 40%; left: 55%;
  animation: drift3 15s ease-in-out infinite alternate;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

@keyframes drift1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes drift2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-60px, -80px) scale(1.2); }
}
@keyframes drift3 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-40px, 50px) scale(0.9); }
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 32px;
  gap: 32px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  max-width: 900px;
  width: 100%;
}

.hero-text {
  flex: 1;
  min-width: 260px;
  max-width: 420px;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column-reverse;
    gap: 28px;
    text-align: center;
  }
  .hero-text { max-width: 100%; }
  .prize-strip { justify-content: center; }
}

.empire-byline {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.empire-byline strong {
  color: var(--text);
  font-weight: 600;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(245,197,66,0.1);
  border: 1px solid rgba(245,197,66,0.25);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,197,66,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(245,197,66,0); }
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 14px;
}

.hero-highlight {
  color: var(--gold);
  position: relative;
  display: inline-block;
}

.hero-highlight::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--magenta));
  border-radius: 2px;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.spots-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.spots-remaining {
  font-size: 28px;
  font-weight: 900;
  color: #a855f7;
  line-height: 1;
}

.spots-label {
  font-size: 14px;
  color: var(--muted);
}

.spots-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.spots-fill {
  height: 100%;
  background: linear-gradient(90deg, #6c3ce1, #a855f7);
  border-radius: 99px;
  transition: width 0.6s ease;
  width: 100%;
}

.prize-strip {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 24px;
}

.prize-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.prize-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.prize-pill-max .prize-amount {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245,197,66,0.4);
}

.prize-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.prize-divider {
  color: var(--muted);
  display: flex;
  align-items: center;
}

/* ── Hero wheel ──────────────────────────────────────────────────────────── */
.hero-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hero-wheel-pointer {
  font-size: 1.1rem;
  color: var(--gold);
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(245,197,66,0.6));
  margin-bottom: -2px;
}

#hero-wheel {
  border-radius: 50%;
  display: block;
  box-shadow:
    0 0 40px rgba(245,197,66,0.12),
    0 0 80px rgba(214,58,249,0.08),
    0 16px 48px rgba(0,0,0,0.5);
}

.hero-wheel-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card-glow-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.card-glow-wrap::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, rgba(245,197,66,0.3), rgba(214,58,249,0.2), rgba(124,58,237,0.2));
  z-index: 0;
  opacity: 0.7;
}

.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 28px;
  text-align: center;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: logo-glow 3s ease-in-out infinite alternate;
}

.logo-icon {
  font-size: 22px;
  display: inline-block;
  animation: spin-slow 8s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes logo-glow {
  from { text-shadow: 0 0 10px rgba(245,197,66,0.2); }
  to   { text-shadow: 0 0 24px rgba(245,197,66,0.6); }
}

h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,66,0.1);
}

.field { margin-bottom: 16px; }

#card-element {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#card-element.StripeElement--focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,66,0.1);
}
#card-element.StripeElement--invalid { border-color: #ef4444; }

.hold-notice {
  background: rgba(245,197,66,0.07);
  border: 1px solid rgba(245,197,66,0.18);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: rgba(245,197,66,0.85);
  margin-bottom: 20px;
  line-height: 1.5;
}

.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-gold {
  background: var(--gold);
  color: #0a0a12;
  box-shadow: 0 4px 20px rgba(245,197,66,0.3);
}

.btn-gold:hover:not(:disabled) {
  opacity: 0.92;
  box-shadow: 0 6px 28px rgba(245,197,66,0.45);
}

.btn-spin {
  background: linear-gradient(135deg, var(--magenta), #7c3aed);
  color: #fff;
  font-size: 20px;
  letter-spacing: 0.2em;
  padding: 20px;
  margin-top: 24px;
  box-shadow: 0 4px 24px rgba(214,58,249,0.35);
}

.btn-spin:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 6px 32px rgba(214,58,249,0.5);
}

.error-msg {
  color: #ef4444;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* ── Step indicators ─────────────────────────────────────────────────────── */
.steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s, transform 0.3s;
}

.step-dot.active {
  background: var(--gold);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(245,197,66,0.5);
}
.step-dot.done { background: var(--gold-dim); }

/* ── Wheel ───────────────────────────────────────────────────────────────── */
#wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(245,197,66,0.2), 0 0 120px rgba(214,58,249,0.1);
  display: block;
}

.wheel-pointer {
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid var(--gold);
  margin-bottom: -4px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(245,197,66,0.6));
}

.spin-info {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Receipt ─────────────────────────────────────────────────────────────── */
.receipt {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.ticket-badge {
  text-align: center;
  margin-bottom: 24px;
}

.ticket-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 64px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 40px rgba(245,197,66,0.5);
}

.ticket-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
}

.receipt-row:last-child { border-bottom: none; }
.receipt-row.total {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  padding-top: 14px;
}

.receipt-row span:last-child { color: var(--text); }
.receipt-row.total span:last-child { color: var(--success); }

.success-icon {
  text-align: center;
  margin-bottom: 20px;
}

.check-circle {
  width: 56px; height: 56px;
  background: rgba(34,197,94,0.12);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px rgba(34,197,94,0.2);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer-note {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.6;
  letter-spacing: 0.04em;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.field-label { /* alias for admin */ }
.field-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }
