/* NAIQ Exchange — liquid glass, light */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --ink: #1c1c2e;
  --ink-soft: #6e6e87;
  --accent-1: #5e5ce6;
  --accent-2: #0a84ff;
  --green: #1db954;
  --red: #ff453a;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.85);
  --shadow: 0 20px 50px rgba(94, 92, 230, 0.12);
  --radius: 24px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #eef1fb 0%, #f6f0fa 45%, #eaf4ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
.hidden { display: none !important; }

/* ambient blobs */
.bg-blob { position: fixed; border-radius: 50%; filter: blur(90px); opacity: 0.5; z-index: -1; }
.blob-1 { width: 480px; height: 480px; background: #c8c6ff; top: -140px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: #bfe0ff; bottom: -120px; right: -100px; }
.blob-3 { width: 340px; height: 340px; background: #ffd6ec; top: 40%; left: 55%; opacity: 0.35; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* top bar */
.topbar {
  position: sticky; top: 12px; z-index: 10;
  margin: 12px auto 0; max-width: 1200px; width: calc(100% - 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; border-radius: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 14px; color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 20px rgba(94, 92, 230, 0.35);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-name span { font-weight: 500; color: var(--ink-soft); }
.brand-sub { font-size: 11px; color: var(--ink-soft); }
.ticker { display: flex; align-items: baseline; gap: 8px; }
.ticker-price { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.ticker-change { font-size: 13px; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); }
.account { display: flex; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; }
.user-chip span { font-weight: 600; font-size: 14px; }

/* buttons */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 14px; padding: 10px 18px; font-size: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 10px 24px rgba(94, 92, 230, 0.35);
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(94, 92, 230, 0.45); }
.btn-ghost { background: rgba(255,255,255,0.7); color: var(--ink); border: 1px solid rgba(28,28,46,0.08); }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 16px; width: 100%; }
.btn-buy { color: #fff; background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 10px 24px rgba(34,197,94,0.35); }
.btn-sell { color: #fff; background: linear-gradient(135deg, #dc2626, #f43f5e); box-shadow: 0 10px 24px rgba(244,63,94,0.35); }

/* landing */
.landing { display: grid; place-items: center; padding: 48px 16px; }
.hero {
  max-width: 760px; text-align: center; padding: 56px 40px; border-radius: 32px;
}
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent-1);
  background: rgba(94,92,230,0.1); border-radius: 999px; padding: 6px 14px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.03em; line-height: 1.1; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--ink-soft); font-size: 17px; line-height: 1.6; margin: 18px auto 28px; max-width: 540px; }
.hero-note { font-size: 12px; color: var(--ink-soft); margin-top: 14px; }
.hero .btn-lg { width: auto; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 36px;
}
.hero-stats div { display: flex; flex-direction: column; gap: 4px; }
.hero-stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 12px; color: var(--ink-soft); }

/* app grid */
.app { max-width: 1200px; margin: 24px auto; padding: 0 16px; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}
.card { border-radius: var(--radius); padding: 22px; }
.card-chart { grid-column: span 8; }
.card-portfolio { grid-column: span 4; }
.card-trade { grid-column: span 4; }
.card-transfer { grid-column: span 4; }
.card-activity { grid-column: span 4; }
.card-leaderboard { grid-column: span 4; }
.card-ledger { grid-column: span 8; }
@media (max-width: 900px) {
  .grid > .card { grid-column: span 12; }
  .topbar { flex-wrap: wrap; }
}

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.tiny { font-size: 11px; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.price-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.price-change { font-size: 14px; font-weight: 700; }
.pool-info { text-align: right; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#chart { width: 100%; margin-top: 10px; }

/* portfolio */
.balance-row { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 10px 0; font-variant-numeric: tabular-nums; }
.coin-dot { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-1), var(--accent-2)); }
.coin-dot.credit { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.divider { height: 1px; background: rgba(28,28,46,0.08); margin: 14px 0; }
.portfolio-value { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* trade */
.tabs { display: flex; gap: 8px; background: rgba(28,28,46,0.05); padding: 5px; border-radius: 14px; margin-bottom: 16px; }
.tab { flex: 1; border: none; background: transparent; font-family: inherit; font-weight: 700; font-size: 14px; padding: 9px; border-radius: 10px; cursor: pointer; color: var(--ink-soft); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 4px 12px rgba(28,28,46,0.08); }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.input-wrap { position: relative; margin: 8px 0 14px; }
input {
  width: 100%; font-family: inherit; font-size: 17px; font-weight: 600;
  padding: 13px 16px; border-radius: 14px; border: 1px solid rgba(28,28,46,0.1);
  background: rgba(255,255,255,0.8); color: var(--ink); outline: none;
  font-variant-numeric: tabular-nums;
}
input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(10,132,255,0.15); }
.btn-max { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 5px 10px; font-size: 12px; }
.quote { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13px; }
.quote div { display: flex; justify-content: space-between; }
.quote span { color: var(--ink-soft); }
.quote b { font-variant-numeric: tabular-nums; }
.card-transfer input { margin-bottom: 10px; }
.card-transfer .tiny { margin-top: 8px; }

/* feed + leaderboard */
.feed { list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.feed li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.5); }
.feed .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { color: var(--ink-soft); font-size: 11px; flex-shrink: 0; }
.leaderboard { list-style: none; counter-reset: rank; display: flex; flex-direction: column; gap: 8px; }
.leaderboard li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,0.5); }
.leaderboard li::before { counter-increment: rank; content: counter(rank); font-weight: 800; color: var(--ink-soft); width: 18px; }
.leaderboard img { width: 26px; height: 26px; border-radius: 50%; }
.leaderboard .lb-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .lb-val { font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* ledger */
.table-wrap { overflow-x: auto; }
.ledger-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.ledger-table th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid rgba(28,28,46,0.08); }
.ledger-table td { padding: 7px 8px; border-bottom: 1px solid rgba(28,28,46,0.05); white-space: nowrap; }
.ledger-table .hash { font-family: ui-monospace, monospace; color: var(--ink-soft); }
.type-pill { font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px; }
.type-BUY { background: rgba(34,197,94,0.15); color: #15803d; }
.type-SELL { background: rgba(244,63,94,0.15); color: #be123c; }
.type-TRANSFER { background: rgba(10,132,255,0.12); color: #0a6bcc; }
.type-GRANT { background: rgba(245,158,11,0.15); color: #b45309; }
.verify-result { margin: 8px 0; font-size: 13px; font-weight: 700; padding: 10px 14px; border-radius: 12px; }
.verify-ok { background: rgba(34,197,94,0.12); color: #15803d; }
.verify-bad { background: rgba(244,63,94,0.12); color: #be123c; }

/* toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(28,28,46,0.92); color: #fff; font-weight: 600; font-size: 14px;
  padding: 13px 22px; border-radius: 14px; z-index: 100; max-width: 90vw;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.toast.error { background: rgba(190,18,60,0.95); }

.footer { text-align: center; font-size: 11px; color: var(--ink-soft); padding: 30px 16px 40px; max-width: 700px; margin: 0 auto; line-height: 1.7; }
