:root {
  --bg0: #080416;
  --bg1: #12082a;
  --bg2: #1a0b3a;
  --violet: #a855f7;
  --pink: #ff2bd6;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --text: #f4f0ff;
  --muted: #a89bc8;
  --line: rgba(168, 85, 247, 0.35);
  --glass: rgba(24, 10, 48, 0.72);
  --ok: #34d399;
  --bad: #fb7185;
  --shelf: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: "Outfit", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body {
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(168, 85, 247, 0.35), transparent 55%),
    radial-gradient(90% 70% at 100% 0%, rgba(255, 43, 214, 0.22), transparent 50%),
    radial-gradient(80% 60% at 50% 100%, rgba(59, 130, 246, 0.2), transparent 55%),
    linear-gradient(165deg, #080416 0%, #12082a 48%, #0a0618 100%);
  background-attachment: fixed;
}

#vault {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-t)) calc(14px + var(--shelf)) calc(96px + var(--safe-b));
  position: relative;
}

.shelf {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(30, 12, 60, 0.9), rgba(12, 6, 28, 0.85));
  border: 1px solid var(--line);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.25), inset 0 0 18px rgba(59, 130, 246, 0.12);
}
.shelf.left { left: max(6px, calc(50% - 240px + 6px)); }
.shelf.right { right: max(6px, calc(50% - 240px + 6px)); }

.shelf-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.shelf-btn img { width: 100%; height: 100%; object-fit: contain; display: block; }
.shelf-btn:active { transform: scale(0.94); }
.shelf-btn.active {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.45), rgba(255, 43, 214, 0.25));
  box-shadow: 0 0 16px rgba(255, 43, 214, 0.45);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7));
}
.brand em {
  display: block;
  font-family: "Syne", sans-serif;
  font-style: normal;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(90deg, #c4b5fd, #22d3ee, #ff2bd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand strong {
  display: block;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
}
.gear {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  padding: 7px;
  cursor: pointer;
}
.gear img { width: 100%; height: 100%; object-fit: contain; }

.pane { animation: rise 0.28s ease; }
.pane.off { display: none; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
}
h1 {
  margin: 0 0 8px;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1.15;
}
.lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pulse-hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(59, 130, 246, 0.18), rgba(255, 43, 214, 0.16));
  border: 1px solid rgba(255, 43, 214, 0.35);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
  margin-bottom: 14px;
}
.pulse-coin {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.55));
  animation: floaty 3.2s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.pulse-hero small { color: var(--muted); font-size: 0.75rem; }
.pulse-hero b {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: 1.85rem;
  margin: 2px 0 4px;
}
.delta { font-size: 0.8rem; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
}
.stat.wide { grid-column: span 1; }
.stat small { color: var(--muted); font-size: 0.72rem; }
.stat b {
  display: block;
  margin-top: 4px;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
}
.neon-blue { box-shadow: inset 0 0 18px rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.45); }
.neon-pink { box-shadow: inset 0 0 18px rgba(255, 43, 214, 0.16); border-color: rgba(255, 43, 214, 0.4); }
.neon-violet { box-shadow: inset 0 0 18px rgba(168, 85, 247, 0.2); }
.neon-cyan { box-shadow: inset 0 0 18px rgba(34, 211, 238, 0.16); border-color: rgba(34, 211, 238, 0.35); }

.neon-btn, .ghost, .back {
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 16px;
}
.neon-btn {
  border: 0;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(120deg, #7c3aed, #2563eb, #db2777);
  background-size: 180% 180%;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.45);
  margin-bottom: 14px;
  animation: sheen 6s ease infinite;
}
@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.ghost.danger { border-color: rgba(251, 113, 133, 0.5); color: var(--bad); margin-top: 12px; }
.back {
  border: 0;
  background: transparent;
  color: var(--cyan);
  padding: 0 0 12px;
}

.field {
  display: block;
  margin-bottom: 12px;
}
.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.field em { font-style: normal; opacity: 0.7; }
.field input, .field select, .field textarea, .filter-row select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 24, 0.85);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(255, 43, 214, 0.2);
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.row-actions .neon-btn { margin-bottom: 0; }

.filter-row { margin-bottom: 12px; }

.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.card:active { transform: scale(0.99); }
.card .title { font-weight: 600; }
.card .meta { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.card .amt { font-family: "Syne", sans-serif; font-weight: 700; }
.card .amt.in { color: var(--ok); }
.card .amt.out { color: var(--bad); }
.card .bar {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.card .bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--pink));
}

.bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}
.bar-row .track {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar-row .track > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #a855f7, #ff2bd6);
}

.settings-card {
  margin-top: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--glass);
}
.settings-card p { margin: 0 0 6px; font-weight: 600; }
.settings-card small { color: var(--muted); display: block; margin-bottom: 8px; }

.empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.pulse-orb {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 2rem;
  font-weight: 500;
  background: radial-gradient(circle at 35% 30%, #ff7af0, #7c3aed 45%, #1d4ed8 100%);
  box-shadow:
    0 0 0 4px rgba(8, 4, 22, 0.85),
    0 0 28px rgba(255, 43, 214, 0.65),
    0 0 48px rgba(59, 130, 246, 0.45);
  animation: orb 2.8s ease-in-out infinite;
}
.pulse-orb span { display: block; line-height: 1; margin-top: -2px; }
@keyframes orb {
  0%, 100% { box-shadow: 0 0 0 4px rgba(8, 4, 22, 0.85), 0 0 28px rgba(255, 43, 214, 0.65), 0 0 48px rgba(59, 130, 246, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(8, 4, 22, 0.85), 0 0 36px rgba(168, 85, 247, 0.85), 0 0 60px rgba(34, 211, 238, 0.5); }
}

@media (max-width: 380px) {
  #vault { padding-left: calc(10px + var(--shelf)); padding-right: calc(10px + var(--shelf)); }
  .shelf-btn { width: 40px; height: 40px; }
  h1 { font-size: 1.45rem; }
}
