/* ============================================================
   Ravana Swap Mini App — design tokens + base styles
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-deep:    #050716;
  --bg-navy:    #090B19;
  --bg-panel:   #0C0F21;

  /* Surfaces */
  --surf-dark:    #131125;
  --surf-blue:    #1A2947;
  --surf-purple:  #22114D;
  --surf-lifted:  #2D233F;

  /* Purples */
  --purple-1: #7C3AED;
  --purple-2: #9B5CFF;
  --purple-3: #C084FC;

  /* Blues / cyan */
  --cyan:  #22D3EE;
  --eblue: #38BDF8;
  --dblue: #2563EB;

  /* Gold */
  --gold:  #F6C85F;
  --wgold: #DFA64A;

  /* Text */
  --text-1: #F5F7FB;
  --text-2: #A7B0C8;
  --text-3: #766783;

  /* Semantic */
  --success: #2EE6A6;
  --warning: #F6C85F;
  --error:   #FF5C7A;

  /* Accent — overridden by tweak */
  --accent-a: var(--purple-2);
  --accent-b: var(--cyan);

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* Type */
  --font-ui: "Inter Tight", "SF Pro Display", "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter Tight", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  background:
    radial-gradient(120% 80% at 50% 0%, #1a0d3a 0%, transparent 55%),
    radial-gradient(80% 60% at 100% 100%, #0b2440 0%, transparent 55%),
    var(--bg-deep);
  color: var(--text-1);
  overflow: hidden;
}

#phone-mount {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Hide scrollbars inside the phone */
.app-scroll::-webkit-scrollbar { width: 0; height: 0; }
.app-scroll { scrollbar-width: none; }

/* ============================================================
   App shell
   ============================================================ */
.app-root {
  width: 100%;
  height: 100%;
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, #1a0d3a 0%, transparent 55%),
    radial-gradient(80% 60% at 100% 100%, #0b2440 0%, transparent 55%),
    var(--bg-deep);
  color: var(--text-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(155, 92, 255, 0.08);
  background: linear-gradient(180deg, rgba(34,17,77,0.6), rgba(9,11,25,0));
  flex: none;
}
.app-topbar .brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
}
.app-topbar .brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: conic-gradient(from 180deg, var(--purple-2), var(--cyan), var(--purple-2));
  position: relative;
  box-shadow: 0 0 16px rgba(155,92,255,0.55);
}
.app-topbar .brand-mark::after {
  content: "";
  position: absolute; inset: 4px;
  background: var(--bg-deep);
  border-radius: 3px;
}
.app-topbar .brand-mark::before {
  content: "";
  position: absolute; inset: 7px;
  background: var(--gold);
  border-radius: 1px;
  transform: rotate(45deg);
  z-index: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.app-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.app-scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 12px;
}

/* Bottom navigation */
.bottomnav {
  height: 66px;
  flex: none;
  background: rgba(9, 11, 25, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(155, 92, 255, 0.12);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px 4px;
}
.bottomnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  background: none; border: 0;
  color: var(--text-3);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 2px 0;
  position: relative;
  font-family: var(--font-ui);
  transition: color 0.15s;
}
.bottomnav-item .nav-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.bottomnav-item.is-active { color: var(--text-1); }
.bottomnav-item.is-active .nav-icon svg { filter: drop-shadow(0 0 8px var(--purple-2)); color: var(--purple-2); }
.bottomnav-item.is-active::before {
  content: "";
  position: absolute; top: 0; left: 50%;
  width: 28px; height: 2px;
  transform: translateX(-50%);
  background: var(--purple-2);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 10px var(--purple-2);
}

/* ============================================================
   Reusable primitives
   ============================================================ */
.screen { padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 14px; }

.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 4px 2px 0;
}
.section-title h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.section-title .link {
  font-size: 12px; color: var(--accent-a);
  background: none; border: 0; padding: 0;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-ui);
}

.card {
  background: var(--bg-panel);
  border: 1px solid rgba(155, 92, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 14px;
  position: relative;
}
.card-gold {
  background: linear-gradient(160deg, rgba(246,200,95,0.08), rgba(34,17,77,0.4));
  border-color: rgba(246, 200, 95, 0.25);
}
.card-premium {
  background: linear-gradient(160deg, rgba(124,58,237,0.18), rgba(12,15,33,0.6));
  border-color: rgba(155, 92, 255, 0.32);
}

/* Buttons */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, filter .15s;
  color: var(--text-1);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--purple-1), var(--purple-2));
  box-shadow: 0 6px 24px -8px var(--purple-2), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: rgba(155, 92, 255, 0.12);
  color: var(--text-1);
  border: 1px solid rgba(155, 92, 255, 0.28);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid rgba(167, 176, 200, 0.18);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--wgold));
  color: #2a1700;
  box-shadow: 0 6px 24px -10px var(--gold), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), var(--eblue));
  color: #04212c;
  box-shadow: 0 6px 24px -10px var(--cyan);
}
.btn-block { width: 100%; }
.btn-lg { padding: 14px 18px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* Chip / Badge */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(167, 176, 200, 0.1);
  color: var(--text-2);
  border: 1px solid rgba(167,176,200,0.12);
  white-space: nowrap;
}
.chip-gold { background: rgba(246,200,95,0.12); color: var(--gold); border-color: rgba(246,200,95,0.3); }
.chip-purple { background: rgba(155,92,255,0.14); color: var(--purple-3); border-color: rgba(155,92,255,0.32); }
.chip-cyan { background: rgba(34,211,238,0.14); color: var(--cyan); border-color: rgba(34,211,238,0.3); }
.chip-success { background: rgba(46,230,166,0.12); color: var(--success); border-color: rgba(46,230,166,0.3); }
.chip-error { background: rgba(255,92,122,0.12); color: var(--error); border-color: rgba(255,92,122,0.3); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mute { color: var(--text-2); font-size: 12px; }
.dim { color: var(--text-3); font-size: 11px; }
.hairline { height: 1px; background: rgba(167,176,200,0.1); margin: 4px 0; }

/* Headings */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
.h-hello { font-size: 14px; color: var(--text-2); font-weight: 500; font-family: var(--font-ui); }
.h-screen { font-size: 22px; font-weight: 600; line-height: 1.15; }
.h-card { font-size: 15px; font-weight: 600; }

/* Balance pill */
.balance-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.balance-pill {
  position: relative;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(155,92,255,0.18);
  background: linear-gradient(160deg, rgba(34,17,77,0.55), rgba(12,15,33,0.55));
  overflow: hidden;
}
.balance-pill .num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.balance-pill .lbl {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 1px;
}
.balance-pill .icn {
  position: absolute;
  top: 50%; right: 12px;
  width: 28px; height: 28px;
  transform: translateY(-50%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(155,92,255,0.16);
  color: var(--purple-3);
}
.balance-pill.video .icn { background: rgba(34,211,238,0.14); color: var(--cyan); }

/* CTA Feature card */
.feature-card {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.1);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform .08s, border-color .15s;
  font-family: var(--font-ui);
  color: var(--text-1);
}
.feature-card:active { transform: scale(0.98); }
.feature-card:hover { border-color: rgba(155,92,255,0.3); }
.feature-card .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(155,92,255,0.16);
  color: var(--purple-3);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.feature-card .ttl { font-size: 14px; font-weight: 600; }
.feature-card .sub { font-size: 11px; color: var(--text-2); line-height: 1.35; }
.feature-card.premium .ico { background: rgba(246,200,95,0.14); color: var(--gold); }
.feature-card .lock {
  position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(246,200,95,0.16); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}

/* Glow / orb */
.glow-ring {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
}

/* Fortune teaser */
.fortune-widget {
  border-radius: var(--r-lg);
  padding: 14px;
  position: relative;
  background:
    radial-gradient(80% 80% at 90% 30%, rgba(246,200,95,0.16), transparent 60%),
    linear-gradient(135deg, rgba(34,17,77,0.6), rgba(12,15,33,0.7));
  border: 1px solid rgba(246,200,95,0.22);
  overflow: hidden;
}
.fortune-widget .mini-wheel {
  position: absolute; right: -22px; top: 50%;
  transform: translateY(-50%);
  width: 80px; height: 80px;
}

/* Upload zone */
.dropzone {
  border-radius: var(--r-lg);
  border: 1.5px dashed rgba(155,92,255,0.35);
  background: rgba(34,17,77,0.18);
  padding: 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dropzone.has-file { padding: 0; border-style: solid; }
.dropzone .ph-art {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(155,92,255,0.4), transparent),
    rgba(155,92,255,0.08);
  border: 1px solid rgba(155,92,255,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-3);
}
.dropzone .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* Progress */
.progress-bar {
  height: 6px;
  background: rgba(167,176,200,0.1);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-2), var(--cyan));
  border-radius: 100px;
  transition: width 0.3s ease;
  position: relative;
}

/* Modal */
.scrim {
  position: absolute; inset: 0;
  background: rgba(5,7,22,0.78);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%;
  background: var(--bg-navy);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border: 1px solid rgba(155,92,255,0.18);
  border-bottom: 0;
  padding: 18px 18px 22px;
  position: relative;
  animation: sheetUp .25s ease;
  max-height: 85%;
  overflow-y: auto;
}
.sheet::before {
  content: "";
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 42px; height: 4px;
  background: rgba(167,176,200,0.25);
  border-radius: 2px;
}
@keyframes sheetUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.dialog {
  width: calc(100% - 32px);
  background: var(--bg-navy);
  border-radius: 18px;
  border: 1px solid rgba(155,92,255,0.18);
  padding: 18px;
  align-self: center;
  margin: auto;
}

/* Animated active job glow */
@keyframes processingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,211,238, 0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(34,211,238, 0); }
}
.pulse-cyan { animation: processingPulse 1.6s infinite; }

/* AI banner */
.ai-banner {
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  height: 140px;
  background: linear-gradient(180deg, transparent 30%, rgba(5,7,22,0.85) 100%), var(--bg-navy);
  border: 1px solid rgba(155,92,255,0.16);
}
.ai-banner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.ai-banner .ai-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,7,22,0.05) 0%, rgba(5,7,22,0.85) 90%);
  z-index: 1;
}
.ai-banner .ai-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px;
  z-index: 2;
}

/* Selectable cards (aspect, quality) */
.segmented {
  display: grid;
  gap: 8px;
}
.seg-card {
  padding: 10px 12px;
  background: rgba(155,92,255,0.05);
  border: 1px solid rgba(155,92,255,0.16);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--text-1);
  font-family: var(--font-ui);
  transition: all .15s;
  display: flex; align-items: center; justify-content: space-between;
}
.seg-card.active {
  background: rgba(155,92,255,0.18);
  border-color: rgba(155,92,255,0.55);
  box-shadow: 0 0 0 1px rgba(155,92,255,0.18) inset;
}
.seg-card .seg-title { font-size: 13px; font-weight: 600; }
.seg-card .seg-sub { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.seg-card .seg-cost { font-size: 11px; color: var(--gold); font-weight: 600; }

/* Aspect ratio swatches */
.aspect-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.aspect-btn {
  background: transparent;
  border: 1px solid rgba(155,92,255,0.18);
  padding: 10px 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: all .15s;
}
.aspect-btn .ar-box {
  background: rgba(155,92,255,0.18);
  border-radius: 4px;
}
.aspect-btn.active {
  border-color: var(--purple-2);
  color: var(--text-1);
  background: rgba(155,92,255,0.08);
}
.aspect-btn.active .ar-box { background: var(--purple-2); }

/* Result preview */
.result-frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.16);
  aspect-ratio: 4 / 5;
  position: relative;
}
.placeholder-art {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(155,92,255,0.06) 0 6px, transparent 6px 14px),
    radial-gradient(70% 70% at 50% 40%, rgba(155,92,255,0.22), transparent 70%),
    var(--bg-panel);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.placeholder-art .mono { background: rgba(5,7,22,0.6); padding: 4px 10px; border-radius: 4px; }

/* Stepper */
.stepper {
  display: flex; gap: 6px; align-items: center;
}
.stepper .step {
  height: 4px; flex: 1;
  background: rgba(167,176,200,0.12);
  border-radius: 100px;
}
.stepper .step.done { background: var(--purple-2); }
.stepper .step.active { background: linear-gradient(90deg, var(--purple-2), var(--cyan)); }

/* ============================================================
   Onboarding overlay
   ============================================================ */
.onboard-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  background: linear-gradient(180deg, #050513 0%, #0c0a26 50%, #050716 100%);
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 22px 22px 24px;
}
.onboard-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.onboard-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: orbFloat 16s ease-in-out infinite;
}
.onboard-orb.purple { width: 280px; height: 280px; background: #7C3AED; top: -80px; left: -90px; }
.onboard-orb.cyan   { width: 240px; height: 240px; background: #22D3EE; top: 280px; right: -100px; animation-delay: -5s; opacity: 0.4; }
.onboard-orb.gold   { width: 200px; height: 200px; background: #F6C85F; bottom: -60px; left: -50px; animation-delay: -10s; opacity: 0.3; }
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(20px, -30px); }
}

.onboard-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  position: relative; z-index: 2;
  margin-bottom: 14px;
}
.onboard-progress {
  display: flex; gap: 6px; flex: 1; align-items: center;
}
.onboard-pill {
  height: 4px; flex: 1;
  background: rgba(167,176,200,0.18);
  border-radius: 100px;
  transition: background .3s;
}
.onboard-pill.active {
  background: linear-gradient(90deg, var(--purple-2), var(--cyan));
}
.onboard-pill.done {
  background: var(--purple-2);
}
.onboard-skip {
  font-family: var(--font-ui);
  background: none; border: 0;
  color: var(--text-3);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
}

.onboard-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
  min-height: 0;
}

.onboard-content {
  position: relative; z-index: 2;
  text-align: center;
  margin-bottom: 18px;
  animation: onboardContentIn 0.4s cubic-bezier(.18, .78, .18, 1) both;
}
@keyframes onboardContentIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboard-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  white-space: pre-line;
  color: #F5F7FB;
  text-shadow: 0 2px 24px rgba(155,92,255,0.4);
}
.onboard-sub {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 300px;
  margin: 0 auto;
  text-wrap: pretty;
}
.onboard-bottom {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.onboard-step-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

/* Welcome visual */
.ov-welcome {
  position: relative;
  width: 220px; height: 220px;
  display: flex; align-items: center; justify-content: center;
}
.ov-brand-mark {
  position: relative;
  width: 100px; height: 100px;
  border-radius: 24px;
  background: conic-gradient(from 180deg, var(--purple-2), var(--cyan), var(--gold), var(--purple-2));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 60px -10px var(--purple-2), 0 30px 60px -20px rgba(155,92,255,0.6);
  animation: brandRotate 12s linear infinite;
  z-index: 3;
}
.ov-brand-inner {
  position: absolute; inset: 6px;
  background: #050716;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
}
.ov-brand-diamond {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #FFE9A8, #F6C85F);
  transform: rotate(45deg);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(246,200,95,0.6);
}
.ov-brand-glow {
  position: absolute; inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155,92,255,0.3), transparent 70%);
  filter: blur(20px);
}
@keyframes brandRotate {
  to { transform: rotate(360deg); }
}
.ov-rings {
  position: absolute; inset: 0;
}
.ov-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(155,92,255,0.4);
  transform: translate(-50%, -50%);
  animation: ringFloat 8s linear infinite;
}
.ov-ring.r1 { width: 160px; height: 160px; }
.ov-ring.r2 { width: 200px; height: 200px; animation-direction: reverse; animation-duration: 12s; opacity: 0.6; }
.ov-ring.r3 { width: 240px; height: 240px; animation-duration: 18s; opacity: 0.35; border-color: rgba(34,211,238,0.4); }
@keyframes ringFloat {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Swap visual */
.ov-swap {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 18px;
  position: relative;
}
.ov-face {
  width: 96px; height: 96px;
  border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.ov-face.source {
  background: linear-gradient(135deg, rgba(155,92,255,0.32), rgba(155,92,255,0.08));
  border: 1.5px solid rgba(155,92,255,0.55);
  color: var(--purple-3);
  box-shadow: 0 0 40px -10px var(--purple-2);
}
.ov-face.target {
  background: linear-gradient(135deg, rgba(34,211,238,0.24), rgba(34,211,238,0.06));
  border: 1.5px solid rgba(34,211,238,0.55);
  color: var(--cyan);
  box-shadow: 0 0 40px -10px var(--cyan);
}
.ov-arrow {
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(246,200,95,0.6));
  animation: arrowPulse 1.6s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50%      { transform: translateX(4px); opacity: 1; }
}
.ov-result {
  position: absolute;
  top: -8px; right: -8px;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold), var(--wgold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #2a1700;
  box-shadow: 0 0 24px rgba(246,200,95,0.6);
  border: 2px solid #050716;
}

/* Premium visual */
.ov-premium {
  position: relative;
  width: 240px; height: 200px;
}
.ov-tile {
  position: absolute;
  border-radius: 22px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  width: 116px; height: 116px;
}
.ov-tile.multiface {
  background: linear-gradient(140deg, rgba(155,92,255,0.3), rgba(155,92,255,0.08));
  border: 1.5px solid rgba(155,92,255,0.5);
  color: var(--purple-3);
  top: 0; left: 0;
  transform: rotate(-6deg);
  box-shadow: 0 16px 40px -16px rgba(155,92,255,0.5);
}
.ov-tile.imagegen {
  background: linear-gradient(140deg, rgba(34,211,238,0.24), rgba(34,211,238,0.06));
  border: 1.5px solid rgba(34,211,238,0.55);
  color: var(--cyan);
  bottom: 0; right: 0;
  transform: rotate(6deg);
  box-shadow: 0 16px 40px -16px rgba(34,211,238,0.5);
}
.ov-tile.crown {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--gold), var(--wgold));
  color: #2a1700;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 50px rgba(246,200,95,0.5), inset 0 1px 4px rgba(255,255,255,0.4);
  border: 2px solid #050716;
  padding: 0;
}
.ov-tile-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-1);
}

/* Fortune visual */
.ov-fortune {
  position: relative;
  width: 200px; height: 200px;
}
.ov-wheel-mini {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from -90deg,
    #7C3AED 0 45deg, #22D3EE 45deg 90deg, #F6C85F 90deg 135deg,
    #9B5CFF 135deg 180deg, #38BDF8 180deg 225deg, #C084FC 225deg 270deg,
    #DFA64A 270deg 315deg, #2563EB 315deg 360deg);
  box-shadow:
    0 0 0 4px #050716,
    0 0 0 6px var(--gold),
    0 24px 60px -10px rgba(155,92,255,0.4),
    0 0 80px -10px rgba(246,200,95,0.4);
  animation: brandRotate 22s linear infinite;
}
.ov-wheel-mini::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1a1b3a, #050716);
  border: 2px solid var(--gold);
}
.ov-spark {
  position: absolute;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  background: rgba(246,200,95,0.16);
  border: 1px solid rgba(246,200,95,0.4);
  box-shadow: 0 0 16px rgba(246,200,95,0.4);
  animation: sparkFloat 3s ease-in-out infinite;
}
.ov-spark.s1 { top: -10px; right: -10px; animation-delay: 0s; }
.ov-spark.s2 { bottom: 20px; left: -16px; color: var(--cyan); background: rgba(34,211,238,0.14); border-color: rgba(34,211,238,0.4); box-shadow: 0 0 16px rgba(34,211,238,0.4); animation-delay: -1s; }
.ov-spark.s3 { bottom: -8px; right: 10px; animation-delay: -2s; }
@keyframes sparkFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Invite visual */
.ov-invite {
  position: relative;
  width: 240px; height: 200px;
}
.ov-friend {
  position: absolute;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, rgba(155,92,255,0.25), rgba(155,92,255,0.05));
  border: 1.5px solid rgba(155,92,255,0.4);
  color: var(--purple-3);
}
.ov-friend.me {
  width: 80px; height: 80px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(140deg, var(--purple-2), var(--purple-1));
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 0 40px rgba(155,92,255,0.5);
  z-index: 2;
}
.ov-friend.f1 { width: 56px; height: 56px; top: 6px; left: 30px; }
.ov-friend.f3 { width: 56px; height: 56px; bottom: 12px; left: 18px; color: var(--cyan); background: linear-gradient(140deg, rgba(34,211,238,0.25), rgba(34,211,238,0.05)); border-color: rgba(34,211,238,0.4); }
.ov-friend.f4 { width: 56px; height: 56px; top: 30px; right: 16px; }
.ov-credit-pop {
  position: absolute;
  bottom: 10px; right: 6px;
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  color: #2a1700;
  background: linear-gradient(135deg, var(--gold), var(--wgold));
  padding: 6px 10px;
  border-radius: 100px;
  display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 8px 24px -8px rgba(246,200,95,0.6);
  animation: creditPop 2s ease-in-out infinite;
}
@keyframes creditPop {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-6px) scale(1.05); }
}

/* CTA visual */
.ov-cta {
  position: relative;
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.ov-cta-ring {
  position: relative;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-2), var(--purple-1));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 0 80px rgba(155,92,255,0.5), inset 0 2px 8px rgba(255,255,255,0.2);
  animation: ctaPulse 2s ease-in-out infinite;
}
.ov-cta-glow {
  position: absolute; inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246,200,95,0.4), transparent 70%);
  filter: blur(20px);
  animation: ctaGlow 2.4s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}
@keyframes ctaGlow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}
.ov-cta-tag {
  position: absolute;
  top: -10px; right: -10px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #2a1700;
  background: linear-gradient(135deg, var(--gold), var(--wgold));
  padding: 5px 10px;
  border-radius: 100px;
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 8px 16px -4px rgba(246,200,95,0.5);
}

/* ============================================================
   Help sheet
   ============================================================ */
.help-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.18);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  font-family: inherit;
}
.help-btn:hover {
  background: rgba(34,211,238,0.14);
  border-color: rgba(34,211,238,0.32);
}

.help-sheet {
  display: flex; flex-direction: column; gap: 14px;
}
.help-head {
  display: flex; align-items: center; gap: 12px;
}
.help-ico {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(34,211,238,0.14);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.help-tips {
  display: flex; flex-direction: column; gap: 12px;
}
.help-tip {
  display: flex; gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(155,92,255,0.04);
  border: 1px solid rgba(155,92,255,0.08);
}
.help-tip-num {
  width: 24px; height: 24px;
  flex: none;
  border-radius: 7px;
  background: rgba(155,92,255,0.18);
  color: var(--purple-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
}
.help-tip-body { flex: 1; min-width: 0; }
.help-tip-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-1);
}
.help-tip-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  text-wrap: pretty;
}
.filter-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid rgba(167,176,200,0.18);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active {
  background: rgba(155,92,255,0.18);
  border-color: rgba(155,92,255,0.55);
  color: var(--text-1);
}

/* Package card */
.pkg-card {
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.12);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  text-align: left;
  font-family: var(--font-ui);
  color: var(--text-1);
}
.pkg-card:hover { border-color: rgba(155,92,255,0.28); }
.pkg-card.selected { border-color: var(--purple-2); background: rgba(155,92,255,0.06); }
.pkg-card.hot {
  border-color: rgba(246,200,95,0.35);
  background: linear-gradient(160deg, rgba(246,200,95,0.08), rgba(12,15,33,0.7));
}
.pkg-tag {
  position: absolute; top: -7px; right: 14px;
  font-size: 9px; letter-spacing: 0.1em; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  background: linear-gradient(135deg, var(--gold), var(--wgold));
  color: #2a1700;
  text-transform: uppercase;
}
.pkg-tag.purple { background: linear-gradient(135deg, var(--purple-1), var(--purple-2)); color: white; }

/* Wheel */
.wheel-shell {
  width: 300px;
  height: 300px;
  position: relative;
  margin: 6px auto 0;
}
.wheel-svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 16px 32px rgba(155,92,255,0.35)) drop-shadow(0 0 36px rgba(246,200,95,0.18));
}
.wheel-pin-svg {
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  filter: drop-shadow(0 4px 10px rgba(246,200,95,0.6));
}
.wheel-hub-static {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a1f5a, #050716);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 10px rgba(246,200,95,0.35), 0 0 20px -4px rgba(246,200,95,0.6);
  z-index: 3;
  pointer-events: none;
}

@keyframes bulbPulse {
  0%, 100% { background: #5a4a20; box-shadow: 0 0 4px rgba(246,200,95,0.4); }
  50%      { background: #FFE08A; box-shadow: 0 0 10px rgba(255,224,138,0.9), 0 0 18px rgba(255,224,138,0.5); }
}

/* Slot machine cabinet */
.reel-cabinet {
  margin: 4px auto 0;
  width: 100%;
  position: relative;
  border-radius: 22px;
  padding: 12px;
  background:
    linear-gradient(180deg, #2a1655 0%, #0f0a2a 100%);
  border: 1px solid rgba(246,200,95,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 18px 40px -16px rgba(155,92,255,0.6),
    0 0 0 1px rgba(155,92,255,0.18);
}
.reel-cabinet::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  border: 1px solid rgba(246,200,95,0.18);
  pointer-events: none;
}

.reel-lights {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  height: 12px;
  align-items: center;
}
.reel-lights.top { margin-bottom: 6px; }
.reel-lights.bottom { margin-top: 6px; }
.reel-bulb {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #5a4a20;
  animation: bulbPulse 1.6s infinite;
}

.reel-frame {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-radius: 14px;
  background:
    radial-gradient(80% 70% at 50% 50%, rgba(155,92,255,0.18), transparent 70%),
    linear-gradient(180deg, #060410, #0c0826);
  border: 1px solid rgba(246,200,95,0.55);
  box-shadow:
    inset 0 0 20px rgba(155,92,255,0.22),
    inset 0 2px 6px rgba(0,0,0,0.5);
}
.reel-col-v2 {
  position: relative;
  height: 180px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1a1340 0%, #060410 100%);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: inset 0 4px 12px rgba(0,0,0,0.6);
}
.reel-strip-v2 {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  will-change: transform;
}
.reel-symbol {
  height: 60px;
  flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border-bottom: 1px solid rgba(155,92,255,0.06);
}
.reel-symbol-icn {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sym-color) 22%, transparent);
  color: var(--sym-color);
  box-shadow: 0 0 12px -2px var(--sym-color);
}
.reel-symbol-lbl {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 700;
  color: var(--sym-color);
  letter-spacing: 0.04em;
}
.reel-glare {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 16%, transparent 84%, rgba(0,0,0,0.55) 100%);
  border-radius: 10px;
}
.reel-win-line {
  position: absolute;
  top: 50%; left: 8px; right: 8px;
  height: 60px;
  transform: translateY(-50%);
  border-radius: 8px;
  border: 1.5px solid rgba(246,200,95,0.8);
  box-shadow:
    0 0 14px rgba(246,200,95,0.5),
    inset 0 0 16px rgba(246,200,95,0.18);
  pointer-events: none;
  z-index: 2;
}
.reel-arrow-l, .reel-arrow-r {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  color: var(--gold);
  font-size: 14px;
  text-shadow: 0 0 10px rgba(246,200,95,0.7);
  z-index: 3;
  pointer-events: none;
}
.reel-arrow-l { left: -2px; }
.reel-arrow-r { right: -2px; }

/* History card */
.history-card {
  display: flex; gap: 12px;
  padding: 10px;
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.08);
  border-radius: var(--r-lg);
  align-items: stretch;
}
.history-thumb {
  width: 64px; height: 64px;
  flex: none;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 70% at 40% 30%, rgba(155,92,255,0.45), transparent),
    var(--surf-dark);
  border: 1px solid rgba(155,92,255,0.18);
}
.history-thumb .badge-ix {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(5,7,22,0.7);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan);
}
.history-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.history-title { font-size: 13px; font-weight: 600; }
.history-meta { font-size: 11px; color: var(--text-3); }
.history-action {
  align-self: center;
  background: rgba(155,92,255,0.16);
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 0; cursor: pointer;
  color: var(--purple-3);
  display: flex; align-items: center; justify-content: center;
}

/* Leaderboard */
.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.08);
  border-radius: 12px;
}
.lb-row.me { border-color: rgba(155,92,255,0.4); background: rgba(155,92,255,0.06); }
.lb-rank {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  text-align: center;
  color: var(--text-2);
}
.lb-rank.gold { color: var(--gold); }
.lb-rank.silver { color: #C0C8DA; }
.lb-rank.bronze { color: #E08A4B; }
.lb-name { font-size: 13px; font-weight: 500; }
.lb-meta { font-size: 11px; color: var(--text-3); }
.lb-score { font-family: var(--font-display); font-weight: 600; color: var(--gold); font-size: 13px; }

/* Empty state */
.empty {
  text-align: center;
  padding: 30px 18px;
}
.empty .empty-art {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(155,92,255,0.35), transparent),
    rgba(155,92,255,0.06);
  border: 1px solid rgba(155,92,255,0.18);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
}

/* Notification banner */
.lowbal-banner {
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(255,92,122,0.12), rgba(155,92,255,0.06));
  border: 1px solid rgba(255,92,122,0.3);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}

.banner-info {
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: rgba(34,211,238,0.08);
  border: 1px solid rgba(34,211,238,0.25);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}

/* Prize reveal modal */
.prize-reveal {
  position: relative;
  text-align: center;
  padding: 20px 4px 4px;
  overflow: hidden;
}
.prize-rays {
  position: absolute;
  top: 90px; left: 50%;
  width: 320px; height: 320px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: raySpin 12s linear infinite;
}
.prize-ray {
  position: absolute;
  top: 50%; left: 50%;
  width: 4px;
  height: 320px;
  transform: translate(-50%, -50%);
  background: linear-gradient(to top, transparent 35%, var(--ray-color, #F6C85F) 50%, transparent 65%);
  opacity: 0.22;
  filter: blur(0.5px);
}
@keyframes raySpin {
  from { transform: translate(-50%, -50%) rotate(0); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.prize-particles {
  position: absolute;
  top: 0; left: 0; right: 0; height: 220px;
  pointer-events: none;
}
.prize-particle {
  position: absolute;
  border-radius: 2px;
  opacity: 0;
  animation: confetti 1.6s ease-out forwards;
  transform: rotate(var(--rot, 0deg));
}
@keyframes confetti {
  0%   { opacity: 0; transform: scale(0) translate(0, -10px) rotate(var(--rot, 0deg)); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1) translate(0, 60px) rotate(calc(var(--rot, 0deg) + 540deg)); }
}
.prize-added {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  background: rgba(46,230,166,0.12);
  color: var(--success);
  border: 1px solid rgba(46,230,166,0.3);
  margin: 0 auto 18px;
  width: max-content;
}

.prize-medal-wrap {
  position: relative;
  width: 160px; height: 160px;
  margin: 0 auto 18px;
}
.prize-medal-bg {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ray-color, #F6C85F) 0%, transparent 65%);
  opacity: 0.45;
  filter: blur(20px);
  animation: medalPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes medalPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.95); }
  50%      { opacity: 0.6; transform: scale(1.08); }
}
.prize-medal {
  position: absolute;
  top: 50%; left: 50%;
  width: 140px; height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  border: 2.5px solid;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  animation: medalIn 0.55s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes medalIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.6); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes medalIn_orig_removed_v2 {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.prize-medal-glyph {
  margin-bottom: -2px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.prize-medal-amount {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.prize-title {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #FFE9A8 0%, #F6C85F 50%, #C18A2A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(246,200,95,0.25);
}
.prize-text {
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 18px;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}
.prize-actions {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
}
/* Sparkly stars */
@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.bg-stars {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0.7;
}
.bg-stars .star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

/* shimmer for processing */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(155,92,255,0.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

/* Active job */
.active-job {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(34,211,238,0.06);
  border: 1px solid rgba(34,211,238,0.22);
}
.active-job .thumb {
  width: 40px; height: 40px; border-radius: 8px;
  background: radial-gradient(60% 60% at 50% 40%, rgba(34,211,238,0.4), transparent), var(--surf-blue);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan);
}

/* Form input */
.input {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.18);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--purple-2); }
.textarea { min-height: 110px; resize: none; }

.kv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(167,176,200,0.1);
  font-size: 12px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--text-3); }
.kv-row .v { color: var(--text-1); font-weight: 500; }
.kv-row .v.gold { color: var(--gold); }
.kv-row .v.cyan { color: var(--cyan); }

/* Topbar balance chip */
.tb-balance {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 100px;
  background: rgba(155,92,255,0.12);
  border: 1px solid rgba(155,92,255,0.22);
  font-size: 11px; font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
}
.tb-balance .sep { width: 1px; height: 12px; background: rgba(167,176,200,0.18); }

/* Icon button (top right) */
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(167,176,200,0.06);
  border: 1px solid rgba(167,176,200,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer;
}

/* Face mapping grid */
.face-tile {
  background: var(--bg-panel);
  border: 1px solid rgba(155,92,255,0.16);
  border-radius: 12px;
  padding: 8px;
  position: relative;
}
.face-tile .ft-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    radial-gradient(70% 70% at 50% 40%, rgba(155,92,255,0.45), transparent),
    var(--surf-dark);
  display: flex; align-items: center; justify-content: center;
  color: var(--purple-3);
  position: relative;
  overflow: hidden;
}
.face-tile.mapped { border-color: rgba(46,230,166,0.4); }
.face-tile.skipped { opacity: 0.5; }
.face-tile .ft-arrow {
  position: absolute; top: 50%; right: -10px;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-panel);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.face-tile .ft-status {
  font-size: 10px; text-align: center; margin-top: 6px;
  color: var(--text-2);
}
.face-tile.mapped .ft-status { color: var(--success); }

/* Aspect mock box sizes */
.ar-1-1 { width: 22px; height: 22px; }
.ar-16-9 { width: 28px; height: 16px; }
.ar-9-16 { width: 16px; height: 28px; }
.ar-4-3 { width: 26px; height: 20px; }
.ar-3-4 { width: 20px; height: 26px; }
