/* ========== CSS Variables ========== */
:root {
  --bg: #080812;
  --s1: #0e0e20;
  --s2: #15152e;
  --s3: #1c1c3a;
  --bd: rgba(255, 255, 255, .06);
  --tx: #fff;
  --t1: #c0c0d8;
  --t2: #7678a0;
  --t3: #4a4c70;
  --a1: #7c3aed;
  --a2: #a855f7;
  --g1: #10b981;
  --r1: #ef4444;
  --y1: #f59e0b;
  --rd: 16px;
  --rd2: 12px;
  --rd3: 8px;
}

/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ========== Particles Canvas ========== */
#pc {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ========== Container ========== */
.ct {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* ========== Header ========== */
.hdr {
  text-align: center;
  padding: 24px 0 12px;
}

.hdr .icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--a1), #6366f1);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
  box-shadow: 0 8px 32px rgba(124, 58, 237, .3);
}

.hdr h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 4px 0;
}

.hdr h1 .grd {
  background: linear-gradient(135deg, #fff 30%, var(--a2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hdr p {
  font-size: 12px;
  color: var(--t2);
}

/* ========== Stats Bar ========== */
.stbar {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.stbar > div {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--rd3);
  font-size: 10px;
}

.stbar .sv {
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.stbar .sv.g { color: var(--g1); }
.stbar .sv.a { color: var(--a2); }
.stbar .sv.y { color: var(--y1); }

/* ========== Card ========== */
.card {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--rd);
  padding: 20px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent);
}

.ch {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ch .dot {
  width: 6px;
  height: 6px;
  background: var(--g1);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  background: var(--s2);
  border-radius: var(--rd3);
  padding: 3px;
}

.tb {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  color: var(--t2);
  border: none;
  background: transparent;
  font-family: inherit;
}

.tb.on {
  background: var(--a1);
  color: #fff;
}

/* ========== Wallet List ========== */
.wl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: var(--rd2);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.wi:active {
  border-color: var(--a1);
  background: var(--s3);
}

.wi.ok {
  border-color: rgba(16, 185, 129, .3);
  background: rgba(16, 185, 129, .04);
}

.wi .ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.wi .wn {
  font-size: 13px;
  font-weight: 600;
}

.wi .ws {
  font-size: 10px;
  color: var(--t3);
}

.wi.ok::after {
  content: 'detected';
  font-size: 10px;
  color: var(--g1);
  font-weight: 600;
  margin-left: auto;
  padding: 3px 10px;
  background: rgba(16, 185, 129, .1);
  border-radius: 100px;
  flex-shrink: 0;
}

/* ========== Connected Card ========== */
.ci-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}

.ci-row .lbl {
  color: var(--t2);
  min-width: 56px;
}

.ci-row .val {
  font-family: monospace;
  color: var(--a2);
  word-break: break-all;
  font-size: 11px;
}

.bal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.bc {
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: var(--rd2);
  padding: 14px;
}

.bc .bl {
  font-size: 10px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.bc .ba {
  font-size: 22px;
  font-weight: 800;
  font-family: monospace;
  margin: 4px 0;
}

.bc .bs {
  font-size: 10px;
  color: var(--t2);
}

/* ========== TX History (Fake) ========== */
.tx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
  font-size: 12px;
}

.tx-dir {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.tx-dir.in {
  background: rgba(16, 185, 129, .12);
  color: var(--g1);
}

.tx-dir.out {
  background: rgba(239, 68, 68, .1);
  color: var(--r1);
}

.tx-info { flex: 1; }
.tx-a { font-family: monospace; font-weight: 600; }
.tx-age { font-size: 10px; color: var(--t3); }
.tx-amt { font-weight: 700; font-family: monospace; }
.tx-amt.p { color: var(--g1); }
.tx-amt.n { color: var(--r1); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.btn-v {
  width: 100%;
  padding: 16px;
  font-size: 15px;
  border-radius: 14px;
}

.btn-v.p {
  background: linear-gradient(135deg, var(--a1), #6366f1);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 58, 237, .4);
}

.btn-v.g {
  background: linear-gradient(135deg, var(--g1), #059669);
  color: #fff;
}

.btn-v:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ========== Spinner ========== */
.sp {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading .sp { display: block; }
.loading .bt { opacity: .7; }

/* ========== Progress ========== */
.prog {
  margin-top: 14px;
  display: none;
}

.pb {
  height: 3px;
  background: var(--s2);
  border-radius: 2px;
  overflow: hidden;
}

.pf {
  height: 100%;
  background: linear-gradient(90deg, var(--a1), var(--g1));
  border-radius: 2px;
  width: 0;
}

.pt {
  font-size: 11px;
  color: var(--t2);
  text-align: center;
  margin-top: 6px;
}

/* ========== Status Card ========== */
.stcard {
  text-align: center;
  padding: 32px 20px;
}

.stcard .si { font-size: 48px; margin-bottom: 12px; }
.stcard .st { font-size: 18px; font-weight: 700; }
.stcard .sd { font-size: 12px; color: var(--t2); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--rd2);
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 200;
  display: none;
  backdrop-filter: blur(10px);
}

.toast.show { display: block; }
.toast.ok { border-color: rgba(16, 185, 129, .35); color: var(--g1); }
.toast.err { border-color: rgba(239, 68, 68, .35); color: var(--r1); }

/* ========== Footer ========== */
.ft {
  text-align: center;
  padding: 20px 0 40px;
  font-size: 10px;
  color: var(--t3);
}

.ft span { margin: 0 8px; }

/* ========== Live Popups ========== */
.lp {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 100;
  max-width: 260px;
}

.lp .li {
  background: rgba(10, 10, 25, .95);
  border: 1px solid rgba(124, 58, 237, .2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 11px;
  color: #c0c0d8;
  backdrop-filter: blur(10px);
  animation: si .4s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
}

@keyframes si {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.li .ad { color: var(--a2); font-family: monospace; font-weight: 600; }
.li .ck { color: var(--g1); }
.li .tm { color: #555; font-size: 10px; }

/* ========== Mobile ========== */
@media (max-width: 480px) {
  .ct { padding: 10px; }
  .card { padding: 16px 14px; }
  .hdr h1 { font-size: 19px; }
  .wi { padding: 12px; }
}
