/* ═══════════════════════════════════════════════
   INCOME GRIMOIRE — Dark Fantasy / Retro VHS
   ═══════════════════════════════════════════════ */

/* Base */
* { box-sizing: border-box; }
body {
  -webkit-font-smoothing: antialiased;
  background: #070510;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(91, 33, 182, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(109, 40, 217, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 10, 62, 0.4) 0%, transparent 80%);
  position: relative;
}

/* ── Snapshot Banner ── */
.snapshot-banner {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #c4b5fd;
  background: rgba(91, 33, 182, 0.15);
  border: 1px solid rgba(109, 40, 217, 0.25);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.snapshot-banner.hidden { display: none; }

/* ── CRT Scanlines ── */
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  mix-blend-mode: multiply;
}

/* ── VHS Noise ── */
.vhs-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: vhsFlicker 0.15s infinite alternate;
}

@keyframes vhsFlicker {
  0% { opacity: 0.02; }
  50% { opacity: 0.04; }
  100% { opacity: 0.025; }
}

/* ── Chromatic Aberration on key elements ── */
.chromatic {
  text-shadow:
    -1px 0 rgba(255, 50, 50, 0.3),
    1px 0 rgba(50, 50, 255, 0.3);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(109, 40, 217, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(167, 139, 250, 0.4); }

/* ── Wizard Icon ── */
.wizard-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.4), rgba(30, 10, 62, 0.8));
  border: 1px solid rgba(167, 139, 250, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15), inset 0 0 12px rgba(167, 139, 250, 0.05);
}

/* ── Arcane Button ── */
.arcane-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: #c4b5fd;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.25), rgba(91, 33, 182, 0.15));
  border: 1px solid rgba(167, 139, 250, 0.2);
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
  letter-spacing: 0.03em;
}
.arcane-btn:hover {
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.4), rgba(91, 33, 182, 0.25));
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}
.arcane-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Cards ── */
.card {
  background: linear-gradient(145deg, rgba(21, 14, 40, 0.85), rgba(13, 10, 26, 0.95));
  border: 1px solid rgba(109, 40, 217, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 30px rgba(91, 33, 182, 0.04),
    inset 0 1px 0 rgba(167, 139, 250, 0.04);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.15), transparent);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

/* ── Stat Cards ── */
.stat-card {
  background: linear-gradient(145deg, rgba(21, 14, 40, 0.8), rgba(13, 10, 26, 0.9));
  border: 1px solid rgba(109, 40, 217, 0.1);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s;
}
.stat-card:hover {
  border-color: rgba(167, 139, 250, 0.2);
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.08), transparent);
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c6da8;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #e2d9f3;
  text-shadow: 0 0 6px rgba(167, 139, 250, 0.15);
}

.stat-sub {
  font-size: 0.7rem;
  color: #5a4d7a;
  margin-top: 0.15rem;
}

/* ── Table ── */
#main-table tbody tr {
  border-bottom: 1px solid rgba(109, 40, 217, 0.06);
  transition: all 0.2s;
}

#main-table tbody tr:hover {
  background: rgba(109, 40, 217, 0.06);
  box-shadow: inset 0 0 30px rgba(124, 58, 237, 0.03);
}

/* ── Filter Buttons ── */
.filter-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 0.5rem;
  color: #7c6da8;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  letter-spacing: 0.02em;
}
.filter-btn:hover { color: #c4b5fd; }
.filter-btn.active {
  background: rgba(109, 40, 217, 0.2);
  color: #c084fc;
  text-shadow: 0 0 8px rgba(192, 132, 252, 0.3);
}

/* ── Status Badges (Arcane) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-diamond {
  background: rgba(124, 58, 237, 0.15);
  color: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.1);
}
.badge-partial {
  background: rgba(245, 158, 11, 0.1);
  color: #d4a24c;
}
.badge-sold {
  background: rgba(180, 30, 30, 0.12);
  color: #c05050;
}
.badge-unknown {
  background: rgba(90, 77, 122, 0.15);
  color: #7c6da8;
}

/* ── Holding Bar ── */
.hold-bar {
  width: 55px;
  height: 5px;
  border-radius: 3px;
  background: rgba(180, 30, 30, 0.15);
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.5rem;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}
.hold-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Pagination ── */
.page-btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.72rem;
  border-radius: 0.375rem;
  color: #7c6da8;
  background: rgba(21, 14, 40, 0.8);
  border: 1px solid rgba(109, 40, 217, 0.12);
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover {
  color: #c4b5fd;
  border-color: rgba(109, 40, 217, 0.25);
}
.page-btn.active {
  background: rgba(109, 40, 217, 0.2);
  color: #c084fc;
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.15);
}

/* ── Timeline in Modal ── */
.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1rem;
  border-left: 2px solid rgba(109, 40, 217, 0.15);
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot {
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}
.timeline-dot-green { background: #a78bfa; color: rgba(167, 139, 250, 0.5); }
.timeline-dot-red { background: #c05050; color: rgba(192, 80, 80, 0.4); }
.timeline-dot-yellow { background: #d4a24c; color: rgba(212, 162, 76, 0.4); }
.timeline-dot-gray { background: #5a4d7a; color: rgba(90, 77, 122, 0.3); }

/* ── Modal Slide ── */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0.5; }
  to { transform: translateX(0); opacity: 1; }
}
#wallet-modal > div:last-child {
  animation: slideIn 0.3s ease-out;
}

/* ── Colors ── */
.text-positive { color: #a78bfa; }
.text-negative { color: #c05050; }

/* ── Solscan Link — Arcane Style ── */
.solscan-link {
  color: #a78bfa;
  text-decoration: none;
  font-family: 'Fira Code', monospace;
  font-size: 0.78rem;
  transition: all 0.2s;
  text-shadow: 0 0 6px rgba(167, 139, 250, 0.15);
}
.solscan-link:hover {
  color: #c084fc;
  text-decoration: underline;
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

/* ── Ambient glow pulse for key values ── */
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(167, 139, 250, 0.2); }
  50% { text-shadow: 0 0 16px rgba(167, 139, 250, 0.4); }
}
.glow-pulse {
  animation: glowPulse 4s ease-in-out infinite;
}
