/* ============================================================
   DESIGN TOKENS - locked from the approved art + ui-ux-pro-max
   dark-dashboard consult (App Store / OLED-dark family, adapted
   for the underworld-villain fanfare bit rather than a fintech look)
   ------------------------------------------------------------
   palette   : void #0B0616, panel #1C1030, villain purple #6E4FA6 /
               #3B2160, cave teal-flame #34E4C0, badge gold #F5A83C,
               fire orange #FF6A3D, cream ribbon #FFF3D6
   type      : Cinzel Decorative (engraved villain-fanfare display,
               for CONGRATULATIONS / badge headline copy) +
               Manrope (clean sans, numbers & UI) +
               JetBrains Mono (CA / canary digits)
   spacing   : 8px base scale (8/12/16/24/32/48/64)
   radius    : 18px cards, 999px pills
   motion    : confetti burst on claim + a flame-pulse glow on the
               streak badge; dollar total never animates hard, it
               only ever nudges - that flatness IS the joke
   ============================================================ */

:root {
  --void: #0B0616;
  --void-deep: #050309;
  --panel: #1C1030;
  --panel-edge: #2C1A4A;
  --purple: #6E4FA6;
  --purple-deep: #3B2160;
  --teal: #34E4C0;
  --gold: #F5A83C;
  --flame: #FF6A3D;
  --flame-red: #E2432B;
  --cream: #FFF3D6;
  --text: #F3EAFF;
  --text-dim: #B39ED0;

  --font-display: "Cinzel Decorative", Georgia, serif;
  --font-sans: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;

  --radius-card: 18px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100%;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------------- stage ---------------- */

.stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

.stage__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  filter: saturate(1.05) brightness(0.55);
  z-index: -2;
}

.stage__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 78% 15%, rgba(11, 6, 22, 0.15) 0%, rgba(11, 6, 22, 0.72) 45%, rgba(6, 3, 12, 0.94) 100%),
    linear-gradient(180deg, rgba(6, 3, 12, 0.55) 0%, rgba(6, 3, 12, 0.88) 100%);
  z-index: -1;
}

/* ---------------- header chrome ---------------- */

.chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.chrome__ticker {
  font-family: var(--font-mono);
  font-size: clamp(10px, 1.6vw, 13px);
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chrome__tick { color: var(--teal); font-weight: 600; }
.chrome__dot { color: var(--purple); }

.chrome__x {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(28, 16, 48, 0.7);
  border: 1px solid var(--panel-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.chrome__x:hover { transform: translateY(-2px); border-color: var(--teal); }

/* ---------------- main panel ---------------- */

.panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 56px);
  padding: 0 var(--space-4) var(--space-5);
  flex-wrap: wrap;
}

.panel__portrait {
  width: clamp(200px, 34vw, 420px);
  flex: 0 0 auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(139, 95, 191, 0.35);
}

.panel__card {
  width: min(440px, 92vw);
  background: linear-gradient(160deg, rgba(28, 16, 48, 0.92), rgba(20, 10, 36, 0.92));
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---------------- streak badge ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(160deg, var(--gold), var(--flame));
  color: #2A1400;
  padding: 10px 20px;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(15px, 3.2vw, 19px);
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 3px rgba(245, 168, 60, 0.18), 0 10px 24px rgba(255, 106, 61, 0.25);
  animation: flamepulse 2.6s ease-in-out infinite;
}

.badge__flame { font-size: 1.3em; line-height: 1; }

@keyframes flamepulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 168, 60, 0.18), 0 10px 24px rgba(255, 106, 61, 0.25); }
  50% { box-shadow: 0 0 0 6px rgba(245, 168, 60, 0.28), 0 14px 32px rgba(255, 106, 61, 0.4); }
}

.ribbon {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 4.4vw, 26px);
  letter-spacing: 0.05em;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 22px rgba(52, 228, 192, 0.25);
  margin: 4px 0 2px;
}

/* ---------------- dollar total: deliberately unglamorous ---------------- */

.total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--void-deep);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 10px 18px;
  width: 100%;
  justify-content: center;
}

.total__amount {
  font-family: var(--font-mono);
  font-size: clamp(20px, 4.4vw, 26px);
  font-weight: 600;
  color: #9CFFE4;
}

.total__label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.ca {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: clamp(9px, 2.2vw, 11px);
  color: var(--text-dim);
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

.ca__label { color: var(--purple); font-weight: 600; }
.ca__value { word-break: break-all; }

.ca__copy {
  background: none;
  border: 1px solid var(--panel-edge);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ca__copy:hover { border-color: var(--teal); color: var(--teal); }

/* ---------------- actions ---------------- */

.claim {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--purple), var(--purple-deep));
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 26px rgba(110, 79, 166, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.claim:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(110, 79, 166, 0.5); }
.claim:active { transform: translateY(0); }

.claim__noscript {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: 4px 0 0;
}

.buy {
  width: 100%;
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--teal), #1E9A82);
  color: #04231C;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(52, 228, 192, 0.28);
  transition: transform 0.15s ease;
}

.buy:hover { transform: translateY(-2px); }

.canary {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(179, 158, 208, 0.6);
}

/* ---------------- confetti ---------------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  opacity: 0.95;
  will-change: transform, opacity;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1);
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift, 40px), 78vh) rotate(540deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .badge { animation: none; }
  .claim, .buy, .chrome__x { transition: none; }
  .confetti-piece { animation-duration: 0.01ms !important; }
}

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  .panel {
    flex-direction: column;
    padding-top: var(--space-2);
    gap: var(--space-3);
  }
  .panel__portrait { width: min(280px, 62vw); }
  .chrome__ticker { font-size: 10px; }
}

@media (max-width: 400px) {
  .panel__card { padding: var(--space-3); }
  .panel__portrait { width: min(220px, 56vw); }
}

@media (min-width: 1200px) {
  .panel { gap: 72px; }
  .panel__portrait { width: 420px; }
}
