:root {
  --bg0: #040c1c;
  --bg1: #071428;
  --blue: #1d9bf0;
  --cyan: #38bdf8;
  --ice: #e0f2fe;
  --pink: #60a5fa;
  --heart: #7dd3fc;
  --text: #f0f9ff;
  --muted: #8ba4c7;
  --line: rgba(56, 189, 248, 0.35);
  --glass: rgba(8, 24, 48, 0.78);
  --ok: #34d399;
  --bad: #fb7185;
  --rail: 86px;
  --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: "Sora", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body {
  background:
    radial-gradient(100% 70% at 0% 0%, rgba(29, 155, 240, 0.35), transparent 55%),
    radial-gradient(90% 60% at 100% 10%, rgba(96, 165, 250, 0.22), transparent 50%),
    radial-gradient(80% 50% at 50% 100%, rgba(14, 165, 233, 0.18), transparent 55%),
    linear-gradient(165deg, #040c1c 0%, #071428 50%, #030914 100%);
  background-attachment: fixed;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  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: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.75));
}
.brand em {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-style: normal;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(90deg, #e0f2fe, #38bdf8, #60a5fa);
  -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(8px); }
  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: "Unbounded", sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.15;
}
.lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(29, 155, 240, 0.32), rgba(14, 165, 233, 0.14), rgba(96, 165, 250, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 28px rgba(29, 155, 240, 0.25);
  margin-bottom: 14px;
}
.hero-coin {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.hero small { color: var(--muted); font-size: 0.75rem; }
.hero b {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-size: 1.7rem;
  margin: 2px 0 4px;
}
.hint { font-size: 0.8rem; color: var(--muted); }

.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 small { color: var(--muted); font-size: 0.72rem; }
.stat b {
  display: block;
  margin-top: 4px;
  font-family: "Unbounded", sans-serif;
  font-size: 1.1rem;
}
.glow-a { box-shadow: inset 0 0 18px rgba(56, 189, 248, 0.16); }
.glow-b { box-shadow: inset 0 0 18px rgba(96, 165, 250, 0.18); border-color: rgba(96, 165, 250, 0.4); }
.glow-c { box-shadow: inset 0 0 18px rgba(125, 211, 252, 0.14); }
.glow-d { box-shadow: inset 0 0 18px rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); }

.neon-btn, .ghost, .back {
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 16px;
}
.neon-btn {
  border: 0;
  color: #04101f;
  font-weight: 700;
  background: linear-gradient(120deg, #e0f2fe, #38bdf8, #1d9bf0);
  background-size: 180% 180%;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  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: 8px; }
.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(4, 14, 28, 0.9);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
}
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.row-actions .neon-btn { margin-bottom: 0; }

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  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 .title { font-weight: 600; }
.card .meta { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.card .amt { font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 0.92rem; }
.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, #1d9bf0, #38bdf8, #93c5fd);
}
.card .bar > i.hot {
  background: linear-gradient(90deg, #fb7185, #f472b6, #38bdf8);
}

.bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 70px;
  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, #1d4ed8, #38bdf8, #93c5fd);
}

.settings-card {
  margin-top: 10px;
  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: 10px; }

.stock-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line);
}

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

/* Unique: Chip Rail */
.chip-rail {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 20px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(10, 28, 52, 0.95), rgba(4, 12, 28, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow:
    0 0 28px rgba(29, 155, 240, 0.35),
    inset 0 0 20px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(12px);
}
.chip {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 6px 2px;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: grayscale(0.2) brightness(0.95);
}
.chip.active {
  color: var(--ice);
  background: rgba(56, 189, 248, 0.16);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}
.chip.active img { filter: none; drop-shadow: 0 0 6px rgba(56, 189, 248, 0.8); }
.chip.fab-slot {
  transform: translateY(-14px);
  background: radial-gradient(circle at 40% 30%, #e0f2fe, #38bdf8 45%, #1d4ed8 100%);
  color: #04101f;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.7);
  border: 2px solid rgba(224, 242, 254, 0.55);
}
.chip.fab-slot img {
  width: 32px;
  height: 32px;
  filter: none;
}
.chip.fab-slot span { font-weight: 700; }
.chip:active { transform: scale(0.94); }
.chip.fab-slot:active { transform: translateY(-14px) scale(0.94); }

@media (max-width: 380px) {
  h1 { font-size: 1.35rem; }
  .chip span { font-size: 0.55rem; }
}
