/* ════════════════════════════════════════════════════
   NEURO-WALLET — Gamification Theme Layer
   Applied via body.wallet-gamify
   ════════════════════════════════════════════════════ */

body.wallet-gamify {
  --bg-void: #0f0a1f;
  --bg-neural: #16102e;
  --bg-synapse: #1f1640;
  --border: rgba(255, 255, 255, 0.10);
  --border-bright: rgba(255, 217, 61, 0.35);

  --green: #6bff4d;
  --green-dim: rgba(107, 255, 77, 0.16);
  --teal: #4dfff0;
  --teal-dim: rgba(77, 255, 240, 0.14);
  --gold: #ffd93d;
  --gold-dim: rgba(255, 217, 61, 0.18);
  --pink: #ff6bcb;
  --pink-dim: rgba(255, 107, 203, 0.16);
  --blue: #6eb5ff;
  --blue-dim: rgba(110, 181, 255, 0.16);

  --shadow-neon-green: 0 0 24px rgba(107, 255, 77, 0.35);
  --shadow-neon-teal: 0 0 24px rgba(77, 255, 240, 0.3);
  --wg-quest: linear-gradient(135deg, #6bff4d 0%, #4dfff0 55%, #ffd93d 100%);
  --wg-card: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
}

body.wallet-gamify::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(255, 217, 61, 0.08), transparent 50%),
    radial-gradient(circle at 20% 30%, rgba(77, 255, 240, 0.06), transparent 35%);
}

body.wallet-gamify::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 80% 40%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 65% 15%, rgba(255, 255, 255, 0.3), transparent);
  background-size: 100% 100%;
}

body.wallet-gamify #app,
body.wallet-gamify #landing-page,
body.wallet-gamify #boot-screen {
  position: relative;
  z-index: 1;
}

/* ── Game HUD ───────────────────────────────────────── */
.wallet-gamify-hud {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(31, 22, 64, 0.95), rgba(22, 16, 46, 0.9));
  border-bottom: 2px solid rgba(255, 217, 61, 0.25);
  flex-shrink: 0;
}

.wgh-xp {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.wgh-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wgh-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1040;
  background: var(--wg-quest);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.wgh-xp-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.wgh-xp-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.wgh-xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd93d, #6bff4d, #4dfff0);
  background-size: 200% 100%;
  animation: wgh-xp-shimmer 2.5s linear infinite;
  transition: width 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 0 12px rgba(107, 255, 77, 0.45);
}

@keyframes wgh-xp-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.wgh-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wgh-pill-icon {
  font-size: 16px;
  line-height: 1;
}

.wgh-pill-value {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.wgh-pill-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ghost);
}

.wgh-streak .wgh-pill-value { color: #ff9f43; }
.wgh-neuro .wgh-pill-value { color: var(--teal); }

/* ── Top nav + level badge ──────────────────────────── */
body.wallet-gamify .top-nav {
  background: linear-gradient(180deg, #1f1640, #16102e);
  border-bottom: 1px solid rgba(255, 217, 61, 0.15);
}

body.wallet-gamify .nav-brand {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px rgba(77, 255, 240, 0.25);
}

body.wallet-gamify .nav-level-badge {
  display: none;
}

body.wallet-gamify .month-bar {
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px dashed rgba(255, 217, 61, 0.2);
}

body.wallet-gamify .month-mission {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-dim);
  border: 1px solid rgba(107, 255, 77, 0.35);
  color: var(--green);
  font-weight: 700;
  font-size: 11px;
}

/* ── Quest hero card ────────────────────────────────── */
body.wallet-gamify .today-hero-card {
  background:
    linear-gradient(160deg, rgba(107, 255, 77, 0.08), rgba(77, 255, 240, 0.05)),
    var(--bg-synapse);
  border: 2px solid rgba(255, 217, 61, 0.35);
  border-left-width: 6px;
  border-left-color: var(--gold);
}

body.wallet-gamify .today-chapter {
  background: var(--gold-dim);
  border-color: rgba(255, 217, 61, 0.4);
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
}

body.wallet-gamify .today-title {
  background: var(--wg-quest);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: none;
}

body.wallet-gamify .today-story-step {
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
}

body.wallet-gamify .today-story-step.active {
  border-color: var(--green);
  background: var(--green-dim);
  box-shadow: 0 0 20px rgba(107, 255, 77, 0.2);
}

body.wallet-gamify .today-story-step-order {
  background: var(--wg-quest);
  color: #1a1040;
  font-weight: 800;
}

body.wallet-gamify .btn-today-primary {
  background: linear-gradient(180deg, #7aff55 0%, #3dd628 100%);
  border: 2px solid #2aab1a;
  color: #0a1f08;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow:
    0 4px 0 #1f7a14,
    0 8px 24px rgba(107, 255, 77, 0.35);
  transform: translateY(0);
  transition: transform 0.1s, box-shadow 0.1s;
}

body.wallet-gamify .btn-today-primary:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #1f7a14,
    0 4px 12px rgba(107, 255, 77, 0.25);
}

/* ── Mission board = quest log ──────────────────────── */
body.wallet-gamify .today-mission-board {
  display: grid;
  gap: 8px;
}

body.wallet-gamify .mission-board-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--wg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--teal);
}

body.wallet-gamify .mission-board-item:nth-child(1) { border-left-color: var(--gold); }
body.wallet-gamify .mission-board-item:nth-child(2) { border-left-color: var(--green); }
body.wallet-gamify .mission-board-item:nth-child(3) { border-left-color: var(--pink); }

body.wallet-gamify .mission-board-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--teal);
  min-width: 72px;
}

body.wallet-gamify .mission-board-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Outcome cards = stat orbs ──────────────────────── */
body.wallet-gamify .today-outcome-card {
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: var(--wg-card);
  transition: transform 0.15s, border-color 0.15s;
}

body.wallet-gamify .today-outcome-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 217, 61, 0.35);
}

body.wallet-gamify .today-outcome-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 217, 61, 0.3);
}

/* ── XP card + achievements ─────────────────────────── */
body.wallet-gamify .xp-card {
  border: 2px solid rgba(255, 217, 61, 0.25);
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.08), rgba(107, 255, 77, 0.05));
  border-radius: 18px;
}

body.wallet-gamify .xp-bar-wrap {
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

body.wallet-gamify .xp-bar-fill {
  background: linear-gradient(90deg, #ffd93d, #6bff4d);
  box-shadow: 0 0 14px rgba(107, 255, 77, 0.4);
  border-radius: 999px;
}

body.wallet-gamify .achievement-card.earned {
  border: 2px solid var(--gold);
  background: linear-gradient(160deg, rgba(255, 217, 61, 0.15), rgba(255, 217, 61, 0.04));
  box-shadow: 0 0 24px rgba(255, 217, 61, 0.2);
  animation: wgh-badge-pop 0.5s ease;
}

body.wallet-gamify .achievement-card.locked {
  filter: grayscale(0.85) brightness(0.7);
  opacity: 0.65;
}

@keyframes wgh-badge-pop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── Event deck = card game ─────────────────────────── */
body.wallet-gamify .deck-area {
  border: 2px dashed rgba(77, 255, 240, 0.35);
  background:
    radial-gradient(ellipse at center, rgba(77, 255, 240, 0.08), transparent 70%),
    rgba(0, 0, 0, 0.25);
}

body.wallet-gamify .event-card {
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}

body.wallet-gamify .event-card:active {
  transform: scale(0.97) rotate(-1deg);
}

/* ── Bottom nav = game dock ─────────────────────────── */
body.wallet-gamify .bottom-nav {
  margin: 0 10px 10px;
  width: calc(100% - 20px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(31, 22, 64, 0.98), rgba(15, 10, 31, 0.98));
  box-shadow:
    0 -4px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 217, 61, 0.08);
  height: calc(var(--bottom-nav-h) + var(--safe-area-bottom) + 4px);
  padding-bottom: var(--safe-area-bottom);
}

body.wallet-gamify .bnav-btn.active {
  color: var(--gold);
  background: rgba(255, 217, 61, 0.1);
  border-radius: 14px;
  margin: 4px 2px;
}

body.wallet-gamify .bnav-btn.active .bnav-icon {
  filter: drop-shadow(0 0 8px rgba(255, 217, 61, 0.5));
  transform: scale(1.1);
}

body.wallet-gamify .bnav-lbl {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Modals: level up, amygdala battle ──────────────── */
body.wallet-gamify .levelup-box {
  border: 3px solid var(--gold);
  background: linear-gradient(160deg, #2a1a5e, #1a1040);
  box-shadow: 0 0 48px rgba(255, 217, 61, 0.35);
}

body.wallet-gamify .levelup-title {
  background: var(--wg-quest);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.wallet-gamify .amygdala-box {
  border: 2px solid var(--red);
  box-shadow: 0 0 40px rgba(255, 0, 64, 0.35);
}

body.wallet-gamify .modal-box {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ── Landing = game entry ───────────────────────────── */
body.wallet-gamify #landing-page {
  background: radial-gradient(ellipse at top, #2a1a5e, #0f0a1f 60%);
}

body.wallet-gamify .btn-lp-play {
  background: linear-gradient(180deg, #7aff55, #3dd628);
  border: 2px solid #2aab1a;
  color: #0a1f08;
  font-weight: 800;
  box-shadow: 0 5px 0 #1f7a14, 0 12px 32px rgba(107, 255, 77, 0.35);
  letter-spacing: 0.04em;
}

body.wallet-gamify .btn-lp-play:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #1f7a14;
}

body.wallet-gamify .lp-title {
  background: var(--wg-quest);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.wallet-gamify .lp-tagline {
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 217, 61, 0.35);
}

body.wallet-gamify .section-badge {
  background: var(--gold-dim);
  border: 1px solid rgba(255, 217, 61, 0.35);
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}

body.wallet-gamify .today-stage-chip {
  background: var(--pink-dim);
  border: 1px solid rgba(255, 107, 203, 0.4);
  color: var(--pink);
  font-weight: 800;
}

body.wallet-gamify .btn-primary {
  background: linear-gradient(180deg, #4dfff0, #00b4a8);
  border: 2px solid #009688;
  color: #042220;
  font-weight: 700;
  box-shadow: 0 4px 0 #00695c;
}

body.wallet-gamify .toast.success {
  background: rgba(107, 255, 77, 0.12);
  border-color: var(--green);
}

body.wallet-gamify .toast.xp {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── XP float animation hook ────────────────────────── */
.wgh-xp-burst {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: wgh-xp-float 1.1s ease forwards;
}

@keyframes wgh-xp-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-48px) scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  body.wallet-gamify .wgh-xp-fill,
  body.wallet-gamify .achievement-card.earned {
    animation: none;
  }

  body.wallet-gamify .btn-today-primary:active,
  body.wallet-gamify .btn-lp-play:active {
    transform: none;
  }
}
