/* ============================================
   MVVTHWPSD — The Case
   Fake CS:GO-style case opener
   ============================================ */

:root {
  --bg:             #0a0a0a;
  --bg-elev:        #141414;
  --bg-elev-2:      #1a1a1a;
  --accent:         #b8ff4a;
  --accent-dim:     rgba(184, 255, 74, 0.08);
  --accent-soft:    rgba(184, 255, 74, 0.18);
  --accent-glow:    rgba(184, 255, 74, 0.4);
  --text:           #f4f4f4;
  --text-soft:      rgba(244, 244, 244, 0.72);
  --text-dim:       rgba(244, 244, 244, 0.48);
  --text-faint:     rgba(244, 244, 244, 0.28);
  --border:         rgba(244, 244, 244, 0.08);
  --border-strong:  rgba(244, 244, 244, 0.15);

  /* Rarity colors — adapted to brand palette */
  --rarity-common:    rgba(244, 244, 244, 0.32);
  --rarity-rare:      rgba(244, 244, 244, 0.85);
  --rarity-epic:      rgba(184, 255, 74, 0.55);
  --rarity-legendary: #b8ff4a;
  --rarity-free:      #b8ff4a;

  /* Rarity tints (used as upward gradient on reel cards) */
  --tint-common:      rgba(244, 244, 244, 0.05);
  --tint-rare:        rgba(244, 244, 244, 0.13);
  --tint-epic:        rgba(184, 255, 74, 0.16);
  --tint-legendary:   rgba(184, 255, 74, 0.26);
  --tint-free:        rgba(184, 255, 74, 0.32);

  /* Rarity glows (drop-shadow behind result image) */
  --glow-common:      rgba(244, 244, 244, 0.18);
  --glow-rare:        rgba(244, 244, 244, 0.4);
  --glow-epic:        rgba(184, 255, 74, 0.42);
  --glow-legendary:   rgba(184, 255, 74, 0.6);
  --glow-free:        rgba(184, 255, 74, 0.72);

  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, Monaco, monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "cv11" 1;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;            /* respects iOS browser chrome */
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ============ BG EFFECTS ============ */
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(184,255,74,0.05), transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(184,255,74,0.025), transparent 70%);
}
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(244,244,244,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,244,244,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

/* ============ TOPBAR (glass) ============ */
.topbar {
  position: relative; z-index: 90;
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)) ,
    rgba(10,10,10,0.36);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 0 rgba(0,0,0,0.4);
  /* GPU-promote so sticky + blur don't repaint the page on scroll */
  transform: translateZ(0);
  will-change: transform;
  contain: layout paint;
}
/* fallback if backdrop-filter unsupported */
@supports not ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .topbar { background: rgba(10,10,10,0.92); }
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 24px; height: auto; fill: var(--text); }
.brand-wordmark { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.balance {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.03);
  font-family: var(--font-mono);
}
.balance-icon {
  width: 13px; height: 13px;
  color: var(--accent);
  opacity: 0.85;
  flex-shrink: 0;
}
.balance-value {
  font-size: 13px; font-weight: 600; color: var(--accent);
  min-width: 38px; text-align: right;
  transition: color 0.18s ease, transform 0.18s ease;
}
.balance-value.flash { color: #fff; transform: scale(1.06); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-soft);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,0.03); }
.icon-btn .icon-off { display: none; }
.icon-btn.muted .icon-on { display: none; }
.icon-btn.muted .icon-off { display: block; color: var(--text-dim); }

/* ============ MARQUEE RIBBON ============ */
.marquee {
  position: relative;
  z-index: 1;
  height: 32px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.018);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.marquee-track {
  display: flex; align-items: center;
  height: 100%;
  width: max-content;
  white-space: nowrap;
  animation: marquee-scroll 50s linear infinite;
  will-change: transform;
}
.marquee-item {
  display: inline-flex; align-items: center;
  gap: 9px;
  /* trailing space lives ON each item (not as flex-gap) so total width is
     exactly N × itemWidth — translate(-50%) lands perfectly */
  padding-right: 36px;
  position: relative;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: var(--text-soft);
}
.marquee-item svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.85;
}
.marquee-item[data-accent="true"] {
  color: var(--accent);
}
.marquee-item[data-accent="true"] svg { opacity: 1; }
/* Divider between items, centered in the trailing padding */
.marquee-item::after {
  content: "";
  position: absolute;
  right: 18px; /* half of padding-right */
  top: 50%; transform: translateY(-50%);
  width: 1px; height: 11px;
  background: rgba(244,244,244,0.18);
}
@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ============ STAGE ============ */
.stage {
  position: relative; z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 32px 18px;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  overflow: hidden;
}

/* ============ HERO (case-as-hero) ============ */
.hero {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  width: 100%; max-width: 540px;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.03);
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.24em; color: var(--text-soft);
  margin-bottom: 8px;
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.italic-accent {
  font-weight: 200; font-style: italic;
  color: rgba(244,244,244,0.62);
}

/* ============ CASE DISPLAY (the hero) ============ */
.case-display {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 24px auto 32px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 24px 40px rgba(184,255,74,0.2));
  animation: case-float 5s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}
.case-display img,
.case-display svg {
  width: 100%;
  height: auto;
  max-height: clamp(180px, 36vh, 360px);
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.case-display img.missing { display: none; }
.case-display img.missing ~ .case-fallback { display: block; }
.case-fallback { display: none; width: 100%; }
.case-glow {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 110%; height: 130%;
  background:
    radial-gradient(ellipse at center, rgba(184,255,74,0.22), transparent 55%);
  pointer-events: none;
  z-index: 0;
  animation: case-glow-pulse 3.4s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes case-glow-pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.05); }
}
@keyframes case-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ============ HUD (button stacked above chips) ============ */
.hud-stack {
  display: flex; flex-direction: column;
  gap: 12px;
  width: 100%; max-width: 540px;
  margin-bottom: 8px;
}
.hud-stack .cta-btn { width: 100%; }
.hud-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.hud-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.025);
  text-align: center;
}
.hud-chip .hud-label {
  font-family: var(--font-mono);
  font-size: 8.5px; letter-spacing: 0.22em;
  color: var(--text-dim);
  white-space: nowrap;
}
.hud-chip .hud-value {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.case-img-wrap img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(184,255,74,0.18)); }
.case-img-wrap img.missing { display: none; }
.case-img-wrap img.missing + .case-fallback { display: block; }
.case-fallback { display: none; width: 100%; height: 100%; }
.case-img-wrap:not(:has(img.missing)) .case-fallback { display: none; }
.case-img-wrap img:not([src]) ~ .case-fallback { display: block; }
.case-img-wrap img:not([src]) { display: none; }

.case-meta {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 20px;
  position: relative;
}
.case-name {
  font-size: 16px; font-weight: 700; letter-spacing: 0.18em;
}
.case-price {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
}
.price-label {
  font-size: 8.5px; letter-spacing: 0.22em; color: var(--text-dim);
}
.price-value {
  font-size: 16px; font-weight: 600; color: var(--accent);
}

/* ============ CTA ============ */
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 15px 22px;
  background: var(--accent);
  color: #0a0a0a;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 28px -8px rgba(184,255,74,0.55);
}
.cta-btn:hover { filter: brightness(1.08); box-shadow: 0 10px 28px -6px rgba(184,255,74,0.7); }
.cta-btn:active { transform: translateY(1px); }
.cta-btn:disabled { opacity: 0.6; cursor: not-allowed; filter: saturate(0.5); }
.cta-btn.cooldown {
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  box-shadow: none;
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12.5px; letter-spacing: 0.08em;
  filter: none; opacity: 1;
}
.cta-btn.cooldown .cta-arrow { display: none; }
.cta-btn .cta-arrow { transition: transform 0.2s ease; }
.cta-btn:hover .cta-arrow { transform: translateX(3px); }
.cta-btn-large { padding: 15px 24px; font-size: 14px; }

.ghost-btn {
  padding: 11px 18px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  border-radius: var(--r-md);
  font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--text-soft); background: rgba(255,255,255,0.03); }

.text-btn {
  background: none; padding: 0; color: var(--accent);
  font-size: inherit; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: rgba(184,255,74,0.4);
}
.text-btn:hover { text-decoration-color: var(--accent); }

.cta-meta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.1em; color: var(--text-dim);
}

/* ============ RARITY LEGEND ============ */
.rarity-legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
}
.legend-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.025);
  border-radius: var(--r-full);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.legend-item:hover { background: rgba(255,255,255,0.04); border-color: rgba(244,244,244,0.18); }
.legend-bar {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rarity-common);
  flex-shrink: 0;
}
.legend-item[data-rarity="rare"] .legend-bar { background: var(--rarity-rare); }
.legend-item[data-rarity="epic"] .legend-bar { background: var(--rarity-epic); }
.legend-item[data-rarity="legendary"] {
  border-color: rgba(184,255,74,0.32);
  background: rgba(184,255,74,0.05);
}
.legend-item[data-rarity="legendary"] .legend-bar {
  background: var(--rarity-legendary);
  box-shadow: 0 0 8px var(--accent), 0 0 14px var(--accent-glow);
}
.legend-item[data-rarity="free"] {
  border-color: var(--accent);
  background: rgba(184,255,74,0.08);
}
.legend-item[data-rarity="free"] .legend-bar {
  background: radial-gradient(circle, #fff5a8 0%, #b8ff4a 70%);
  box-shadow: 0 0 10px var(--accent), 0 0 18px var(--accent-glow);
  animation: rarity-pulse 2s ease-in-out infinite;
}
@keyframes rarity-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px var(--accent), 0 0 18px var(--accent-glow); }
  50%      { transform: scale(1.15); box-shadow: 0 0 14px var(--accent), 0 0 24px var(--accent); }
}
.legend-label {
  font-size: 9px; letter-spacing: 0.2em; color: var(--text-soft);
  font-weight: 500;
}
.legend-item[data-rarity="legendary"] .legend-label,
.legend-item[data-rarity="free"] .legend-label { color: var(--accent); }

/* ============ REEL TAKEOVER ============ */
.reel-section {
  position: fixed;
  top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  /* animation moved to .takeover-inner so the dark bg shows from frame 1
     (otherwise opacity 0 reveals the hero menu underneath as a flash) */
}
.reel-section .takeover-inner {
  animation: takeover-in 0.32s cubic-bezier(0.2,0.8,0.2,1) both;
}
.reel-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 50%, rgba(184,255,74,0.07), transparent 70%),
    linear-gradient(rgba(244,244,244,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,244,244,0.025) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}
@keyframes takeover-in {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}

.takeover-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 1080px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}

.takeover-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-full);
  background: rgba(184,255,74,0.06);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.28em; font-weight: 600;
  color: var(--accent);
}
.takeover-status .status-tick {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
.takeover-foot {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.22em;
  color: var(--text-faint);
}

.reel-frame {
  position: relative;
  width: 100%;
  height: clamp(220px, 32vh, 280px);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(184,255,74,0.05),
    0 30px 80px -20px rgba(184,255,74,0.18),
    0 -1px 0 rgba(255,255,255,0.04) inset;
}
.reel-track {
  position: absolute; top: 0; left: 0;
  height: 100%;
  display: flex; align-items: center;
  gap: 14px;
  padding: 0 14px;
  will-change: transform;
}
.reel-item {
  flex: 0 0 auto;
  width: clamp(160px, 22vh, 220px);
  height: clamp(160px, 22vh, 220px);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Per-rarity tint variable (used by the upward gradient below) */
.reel-item[data-rarity="common"]    { --rarity-tint: var(--tint-common); }
.reel-item[data-rarity="rare"]      { --rarity-tint: var(--tint-rare); }
.reel-item[data-rarity="epic"]      { --rarity-tint: var(--tint-epic); }
.reel-item[data-rarity="legendary"] { --rarity-tint: var(--tint-legendary); }
.reel-item[data-rarity="free"]      { --rarity-tint: var(--tint-free); }

/* Rarity tint that fades up from the bottom of the card */
.reel-item::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    var(--rarity-tint, transparent) 0%,
    transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.reel-item img,
.reel-item svg {
  width: 100%; height: 100%; object-fit: contain;
  padding: 12px;
  position: relative; z-index: 1;
}
/* Rarity bar at the bottom — thicker + with upward glow into the card */
.reel-item::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 5px;
  background: var(--rarity, var(--rarity-common));
  box-shadow:
    0 -2px 14px 1px var(--rarity, transparent),
    0 -8px 24px 0 var(--rarity, transparent);
  z-index: 2;
}
.reel-item[data-rarity="legendary"]::after,
.reel-item[data-rarity="free"]::after {
  box-shadow:
    0 -2px 18px 2px var(--accent),
    0 -10px 32px 0 var(--accent-glow);
}

.reel-pointer {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; z-index: 5;
  pointer-events: none;
}
.reel-pointer-top {
  top: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 11px solid var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.reel-pointer-bottom {
  bottom: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 11px solid var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.reel-fade {
  position: absolute; top: 0; bottom: 0; width: 100px;
  pointer-events: none; z-index: 3;
}
.reel-fade-left { left: 0; background: linear-gradient(90deg, var(--bg) 0%, transparent 100%); }
.reel-fade-right { right: 0; background: linear-gradient(-90deg, var(--bg) 0%, transparent 100%); }

/* ============ RESULT TAKEOVER ============ */
.result-section {
  position: fixed;
  top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px;
  /* solid bg from frame 1 to prevent flash of hero menu underneath */
}
.result-section .takeover-inner {
  animation: takeover-in 0.42s cubic-bezier(0.2,0.8,0.2,1) both;
}
.result-section::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, var(--rarity-bg, rgba(184,255,74,0.04)), transparent 70%),
    linear-gradient(rgba(244,244,244,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,244,244,0.025) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 95%);
}
.result-section[data-rarity="legendary"],
.result-section[data-rarity="free"] {
  --rarity-bg: rgba(184,255,74,0.18);
}
.result-section[data-rarity="epic"] { --rarity-bg: rgba(184,255,74,0.10); }

.result-card {
  position: relative;
  width: 100%; max-width: 540px;
  padding: 28px 28px 24px;
  background: transparent;
  border: 0;
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center;
  z-index: 1;
}
.result-rarity-pill {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.26em; font-weight: 700;
  padding: 7px 16px; border-radius: var(--r-full);
  border: 1px solid var(--rarity, var(--rarity-common));
  color: var(--rarity, var(--rarity-common));
  background: rgba(10,10,10,0.5);
  margin-bottom: 22px;
  text-transform: uppercase;
}
.result-section[data-rarity="legendary"] .result-rarity-pill,
.result-section[data-rarity="free"] .result-rarity-pill {
  box-shadow: 0 0 24px -2px var(--accent-glow);
}
.result-image-wrap {
  width: clamp(240px, 50vh, 420px);
  height: clamp(240px, 50vh, 420px);
  max-width: 100%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
  position: relative;
  border-radius: var(--r-md);
  /* Rarity glow follows the alpha of the transparent PNG */
  filter: drop-shadow(0 0 50px var(--rarity-glow, transparent));
  transition: filter 0.4s ease;
}
/* Per-rarity glow */
.result-section[data-rarity="common"]    { --rarity-glow: var(--glow-common); }
.result-section[data-rarity="rare"]      { --rarity-glow: var(--glow-rare); }
.result-section[data-rarity="epic"]      { --rarity-glow: var(--glow-epic); }
.result-section[data-rarity="legendary"] { --rarity-glow: var(--glow-legendary); }
.result-section[data-rarity="free"]      { --rarity-glow: var(--glow-free); }
/* Stronger pulse for legendary/free */
.result-section[data-rarity="legendary"] .result-image-wrap,
.result-section[data-rarity="free"] .result-image-wrap {
  animation: result-glow-pulse 2.4s ease-in-out infinite;
}
@keyframes result-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 50px var(--rarity-glow)); }
  50%      { filter: drop-shadow(0 0 75px var(--rarity-glow)); }
}
.result-image-wrap img,
.result-image-wrap svg {
  width: 100%; height: 100%; object-fit: contain;
}
.result-name {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800; letter-spacing: 0.04em;
  margin-bottom: 24px;
  text-align: center;
}
.result-actions {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 380px;
}
.result-actions-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* Cross-promo CTA: links to the waitlist site */
.waitlist-cta {
  margin-top: 10px;
  padding: 11px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-top: 1px dashed rgba(244,244,244,0.12);
  border-radius: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; font-weight: 500;
  text-align: center;
  transition: color 0.18s ease, transform 0.18s ease;
}
.waitlist-cta:hover { color: #fff; }
.waitlist-cta:hover .cta-arrow { transform: translateX(3px); }
.waitlist-cta .cta-arrow { transition: transform 0.18s ease; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 11px 18px;
  background: rgba(10,10,10,0.96);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; color: var(--accent);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 80;
  box-shadow: 0 12px 40px -8px rgba(184,255,74,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ FREE OVERLAY ============ */
.free-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: overlay-in 0.4s ease both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.free-shimmer {
  position: absolute;
  left: 50%; top: 50%;
  width: 110%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(184,255,74,0.22), rgba(184,255,74,0.06) 35%, transparent 65%);
  pointer-events: none;
  animation: free-glow-pulse 4.5s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes free-glow-pulse {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

.free-card {
  position: relative;
  max-width: 480px; width: 100%;
  padding: 32px 28px;
  background: rgba(20,20,20,0.95);
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  text-align: center;
  box-shadow: 0 30px 80px -10px rgba(184,255,74,0.45), 0 0 0 1px rgba(184,255,74,0.1);
  animation: free-pop 0.55s cubic-bezier(0.2,0.8,0.2,1) both;
}
@keyframes free-pop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.free-eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #0a0a0a;
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.22em; font-weight: 700;
  margin-bottom: 22px;
}
.free-title {
  font-size: clamp(34px, 7vw, 48px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 0.96;
  margin-bottom: 16px;
}
.free-sub {
  font-size: 14px; font-weight: 300; color: var(--text-soft);
  margin-bottom: 22px; line-height: 1.55;
}
.free-sub strong { color: var(--text); font-weight: 600; }
.free-actions { display: flex; flex-direction: column; gap: 8px; }
.free-fineprint {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.12em; color: var(--text-dim);
  line-height: 1.6;
}

/* ============ FOOTER ============ */
.foot {
  flex-shrink: 0;
  width: 100%; max-width: 1100px;
  padding-top: 8px;
  display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono);
  font-size: 8.5px; letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 540px) {
  .stage { padding: 16px 16px 14px; gap: 12px; }
  /* Cheaper backdrop on mobile — heavy blur kills scroll perf on iOS */
  .topbar {
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
      rgba(10,10,10,0.55);
  }
  .marquee { height: 28px; }
  .marquee-item { font-size: 9.5px; letter-spacing: 0.2em; padding-right: 28px; }
  .marquee-item svg { width: 11px; height: 11px; }
  .marquee-item::after { right: 14px; height: 9px; }
  /* Hero spacing on mobile */
  .status-pill { margin-bottom: 14px; }
  /* Bigger case + lighter shadow + more breathing room around it */
  .case-display {
    max-width: 360px;
    margin: 22px auto 28px;
    filter: drop-shadow(0 12px 18px rgba(184,255,74,0.18));
  }
  .case-display img,
  .case-display svg {
    max-height: clamp(140px, 26vh, 240px);
  }
  .hud-stack { gap: 10px; margin-bottom: 14px; }
  .hud-chips { gap: 8px; }
  .hud-chip { padding: 11px 12px; }
  .hud-chip .hud-label { font-size: 8px; }
  .hud-chip .hud-value { font-size: 13px; }
  .hud-stack .cta-btn { padding: 14px 16px; font-size: 13.5px; }
  .cta-meta { margin: 4px 0 12px; }
  .rarity-legend { margin-top: 14px; gap: 7px; }
  .reel-section { padding: 18px 12px; }
  .takeover-inner { gap: 16px; }
  .reel-item img, .reel-item svg { padding: 12px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .status-pill .dot, .case-display, .case-glow,
  .status-tick, .marquee-track, .free-shimmer {
    animation: none !important;
  }
}
