:root {
  --bg-0: #05060a;
  --bg-1: #0b0f1c;
  --bg-2: #131a2e;
  --ink: #f6f7fb;
  --ink-soft: #b6bcd0;
  --ink-mute: #6a708a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --primary: #ff00bf;
  --primary-soft: #ff5cd6;
  --accent: #11d3ff;
  --gold: #ffd166;
  --gold-deep: #c79200;
  --silver: #d8dee9;
  --silver-deep: #8a93a8;
  --bronze: #d49364;
  --bronze-deep: #8b4f24;
  --jackpot-a: #ff00bf;
  --jackpot-b: #ffd166;
  --jackpot-c: #11d3ff;

  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(255, 0, 191, 0.45);

  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --font-display: 'Bebas Neue', 'Impact', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: radial-gradient(ellipse at top, #1a1230 0%, var(--bg-0) 55%, #000 100%);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }

.app {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.bg-orbs::before, .bg-orbs::after {
  content: '';
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg-orbs::before { background: radial-gradient(circle, var(--primary) 0%, transparent 60%); top: -20vmax; left: -20vmax; }
.bg-orbs::after  { background: radial-gradient(circle, var(--accent)  0%, transparent 60%); bottom: -25vmax; right: -25vmax; animation-delay: -11s; }
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(8vmax,4vmax,0) scale(1.15); }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; opacity: 1; }
.screen.fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.brand-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  font-size: 14px;
  color: var(--ink-soft);
  width: 100%;
  justify-content: center;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.title-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.title {
  font-family: var(--font-display);
  font-size: clamp(54px, 14vw, 120px);
  line-height: 0.92;
  letter-spacing: 0.04em;
  margin: 0;
  background: linear-gradient(180deg, #fff 0%, #cfd5ea 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 8px 40px rgba(255, 0, 191, 0.25);
}
.title .amp {
  display: inline-block;
  background: linear-gradient(180deg, var(--primary) 0%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  margin: 0 8px;
  transform: translateY(-4px);
}
.subtitle {
  font-size: clamp(13px, 3.4vw, 16px);
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}

.thanks {
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 28ch;
  margin: 0 auto;
}
.thanks strong { color: var(--ink); font-weight: 600; }

/* ---- Home screen layout ---- */
#screen-home { padding: 0; }

.home-header {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: 0; right: 0;
}
.home-footer {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0; right: 0;
}
.home-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 3vh, 32px);
  padding: 0 20px;
  /* Ensure the centered content doesn't overflow under header/footer */
  margin-top: clamp(54px, 8vh, 80px);
  margin-bottom: clamp(50px, 8vh, 72px);
}

.spin-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.spin-label {
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  font-size: clamp(16px, 4vw, 22px);
  color: var(--ink);
  text-transform: uppercase;
}

/* ---- Spin button ---- */
.spin-cta {
  position: relative;
  width: clamp(200px, 42vmin, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.16), transparent 52%),
    radial-gradient(circle at 70% 75%, rgba(100, 0, 80, 0.45), transparent 55%),
    conic-gradient(from 0deg, #160d2a, #271040, #160d2a);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    inset 0 0 50px rgba(0, 0, 0, 0.55),
    0 24px 70px rgba(0, 0, 0, 0.50),
    var(--shadow-glow);
  outline: none;
  border: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
  isolation: isolate;
}
.spin-cta::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), var(--accent), var(--gold), var(--primary));
  filter: blur(12px);
  opacity: 0.5;
  z-index: -1;
  animation: spinHalo 8s linear infinite;
}
.spin-cta:active { transform: scale(0.96); box-shadow: none; }
.spin-cta .pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 0, 191, 0.5);
  animation: pulseRing 2.6s ease-out infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(1);    opacity: 0.85; }
  100% { transform: scale(1.22); opacity: 0; }
}
@keyframes spinHalo {
  to { transform: rotate(360deg); }
}

.steering-svg { width: 65%; height: 65%; }

.footer-tag {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--ink-mute);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.footer-tag .lyft-strip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 0, 191, 0.12);
  color: var(--primary-soft);
  letter-spacing: 0.2em;
}

/* ============ WHEEL SCREEN ============ */
.wheel-shell {
  position: relative;
  width: min(92vmin, 560px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px; height: 48px;
  z-index: 4;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}
.wheel-pointer svg { width: 100%; height: 100%; }
.wheel-svg-wrap {
  position: relative;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 70%);
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.03),
    0 0 0 14px rgba(255, 0, 191, 0.18),
    0 30px 90px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transition: filter 0.4s ease;
}
.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  transition: transform 4.6s cubic-bezier(0.17, 0.67, 0.21, 1);
}
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  width: 28%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #1a1230 0%, #05060a 80%);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.08),
    0 8px 30px rgba(0,0,0,0.6);
  display: grid;
  place-items: center;
  z-index: 3;
  pointer-events: none;
}
.wheel-hub svg { width: 70%; height: 70%; opacity: 0.92; }

.wheel-foot {
  margin-top: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.wheel-foot .hint {
  font-size: 13px; color: var(--ink-soft);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.wheel-foot .arm-btn {
  margin-top: 12px;
  padding: 16px 36px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.22em;
  background: linear-gradient(180deg, var(--primary) 0%, #c10090 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(255, 0, 191, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.wheel-foot .arm-btn:active { transform: scale(0.96); }
.wheel-foot .arm-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ============ RESULT SCREEN ============ */
.result-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.result-card {
  position: relative;
  z-index: 2;
  width: min(86vw, 440px);
  padding: 36px 28px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(20, 14, 36, 0.85) 0%, rgba(8, 6, 18, 0.92) 100%);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.tier-badge {
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  font-size: 14px;
  padding: 7px 18px;
  border-radius: 999px;
  text-transform: uppercase;
}
.tier-badge[data-tier="bronze"]  { background: rgba(212, 147, 100, 0.14); color: var(--bronze); border: 1px solid rgba(212, 147, 100, 0.4); }
.tier-badge[data-tier="silver"]  { background: rgba(216, 222, 233, 0.12); color: var(--silver); border: 1px solid rgba(216, 222, 233, 0.32); }
.tier-badge[data-tier="gold"]    { background: rgba(255, 209, 102, 0.14); color: var(--gold);   border: 1px solid rgba(255, 209, 102, 0.4); }
.tier-badge[data-tier="jackpot"] {
  background: linear-gradient(90deg, rgba(255,0,191,0.18), rgba(255,209,102,0.18), rgba(17,211,255,0.18));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.prize-name {
  font-family: var(--font-display);
  font-size: clamp(40px, 9vw, 64px);
  line-height: 1;
  margin: 4px 0 0;
  background: linear-gradient(180deg, #fff 0%, #d6dcef 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.prize-name[data-tier="gold"]    { background: linear-gradient(180deg, #fff5cf 0%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prize-name[data-tier="silver"]  { background: linear-gradient(180deg, #fff 0%, #c8d0e0 100%);      -webkit-background-clip: text; background-clip: text; color: transparent; }
.prize-name[data-tier="bronze"]  { background: linear-gradient(180deg, #ffd9b8 0%, var(--bronze) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.prize-name[data-tier="jackpot"] {
  background: linear-gradient(90deg, var(--jackpot-a) 0%, var(--jackpot-b) 50%, var(--jackpot-c) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: jackpotShift 4s ease-in-out infinite;
}
@keyframes jackpotShift {
  0%, 100% { filter: hue-rotate(0deg) brightness(1.05); }
  50%      { filter: hue-rotate(35deg) brightness(1.15); }
}

.prize-instructions {
  margin: 8px 4px 0;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}
.prize-instructions strong { color: var(--ink); }
.prize-meta {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-top: 2px;
}
.driver-greeting {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 30ch;
}

.replay-tag {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: -4px;
}

/* ============ COMMON UI ============ */
.linklike {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.linklike:hover { color: var(--ink-soft); border-color: var(--line-strong); }

.error-toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  background: #2b0f1d;
  border: 1px solid rgba(255, 99, 132, 0.4);
  color: #ffd2dc;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  z-index: 100;
  transition: transform 0.4s ease;
}
.error-toast.show { transform: translateX(-50%) translateY(0); }

/* ── Meet Driver Section (VINCI) ── */
.meet-driver-section {
  margin-top: 24px;
  text-align: center;
  animation: fadeUp .6s ease .8s both;
}
.meet-label {
  font-size: 10px;
  letter-spacing: .22em;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.meet-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: 14px;
  padding: 14px 24px 14px 18px;
  text-decoration: none;
  color: #e8d48b;
  transition: all .3s ease;
  max-width: 340px;
  backdrop-filter: blur(4px);
}
.meet-btn:hover {
  background: rgba(201,168,76,.22);
  border-color: rgba(201,168,76,.45);
  transform: translateY(-2px);
}
.meet-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a84c, #8c7a2e);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; color: #05060a;
  font-weight: 700; flex-shrink: 0;
}
.meet-text { text-align: left; font-size: 0.85rem; font-weight: 600; line-height: 1.3; letter-spacing: .03em; }
.meet-text small { display: block; font-weight: 400; font-size: 0.7rem; opacity: .65; letter-spacing: .05em; margin-top: 2px; }
.meet-arrow { font-size: 1.2rem; opacity: .5; transition: transform .3s; flex-shrink: 0; }
.meet-btn:hover .meet-arrow { transform: translateX(4px); }

/* ── Contact vCard Button ── */
.contact-vcf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 12px 20px 12px 16px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: all .3s ease;
  max-width: 280px;
}
.contact-vcf:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.vcf-icon { font-size: 1.5rem; flex-shrink: 0; }
.vcf-text { text-align: left; font-size: 0.8rem; font-weight: 500; line-height: 1.3; }
.vcf-text small { display: block; font-weight: 400; font-size: 0.65rem; opacity: .5; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ EFFECTS CANVAS ============ */
#fx-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ============ LOADING ============ */
.loader {
  width: 36px; aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ADMIN ============ */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-overlay.open { display: flex; }
.admin-panel {
  width: min(92vw, 420px);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 86vh;
  overflow-y: auto;
}
.admin-panel h2 {
  margin: 0; font-family: var(--font-display);
  letter-spacing: 0.2em; font-size: 26px;
}
.admin-row { display: flex; flex-direction: column; gap: 6px; }
.admin-row label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.admin-row input, .admin-row select {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}
.admin-row input:focus, .admin-row select:focus { outline: none; border-color: var(--primary); }
.admin-actions { display: flex; gap: 8px; margin-top: 6px; }
.admin-actions button {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: background 0.15s;
}
.admin-actions button.primary {
  background: var(--primary);
  border-color: var(--primary);
}
.admin-actions button:active { transform: scale(0.97); }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.admin-stats div {
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  text-align: center;
}
.admin-stats div b {
  display: block; font-family: var(--font-display);
  font-size: 24px; letter-spacing: 0.06em;
}
.admin-stats div span {
  font-size: 10px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.18em;
}

.hidden-tap-zone {
  position: fixed; top: 0; right: 0;
  width: 60px; height: 60px;
  z-index: 10;
}

/* ============ DEMO MODE ============ */
.demo-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding: 6px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #000;
  font-weight: 700;
  background: linear-gradient(90deg, var(--gold) 0%, var(--accent) 100%);
  animation: demoPulse 3s ease-in-out infinite;
}
@keyframes demoPulse {
  0%, 100% { opacity: 0.92; }
  50%      { opacity: 1; }
}
.spin-again-btn {
  margin-top: 10px;
  padding: 14px 32px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--primary) 0%, #c10090 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 28px rgba(255, 0, 191, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.spin-again-btn:active { transform: scale(0.96); box-shadow: 0 4px 14px rgba(255,0,191,0.3); }
.demo-badge-inline {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.22em;
  font-weight: 700;
  background: rgba(255, 209, 102, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.35);
}

/* ============ RESPONSIVE ============ */
@media (max-height: 620px) {
  .spin-cta { width: clamp(140px, 32vmin, 220px); }
  .home-center { gap: clamp(8px, 2vh, 18px); }
  .title { font-size: clamp(38px, 10vw, 70px); }
  .subtitle { font-size: 12px; }
  .spin-label { font-size: 14px; }
  .thanks { font-size: 12px; }
  .home-header { position: relative; top: auto; padding-top: max(12px, env(safe-area-inset-top)); }
  .home-footer { position: relative; bottom: auto; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  #screen-home { justify-content: space-between; padding: 0; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .title { font-size: clamp(40px, 10vh, 70px); }
  .subtitle { font-size: 12px; }
  .spin-cta { width: clamp(120px, 30vh, 200px); }
  .wheel-shell { width: min(78vmin, 420px); }
  .screen { padding: 12px; gap: 8px; }
  .home-header { position: relative; top: auto; }
  .home-footer { position: relative; bottom: auto; }
  #screen-home { justify-content: space-between; }
}
