:root {
  --bg: #0a0b09;
  --panel: #10120e;
  --panel-2: #151812;
  --line: rgba(235, 240, 225, 0.08);
  --line-strong: rgba(235, 240, 225, 0.14);
  --text: #eef0e9;
  --muted: #878d80;
  --dim: #5b6055;
  --accent: #c4f549;
  --accent-ink: #131804;
  --up: #9fe870;
  --down: #ff6b6b;
  --radius: 14px;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 9, 0.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; gap: 28px;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.02em;
}
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font-family: var(--mono); font-size: 13px; font-weight: 800;
}
.brand .tld { color: var(--dim); font-weight: 500; }
.nav-links { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text);
  font-size: 14px; font-weight: 600;
  padding: 9px 16px;
  transition: border-color .15s, background .15s, transform .1s;
}
.btn:hover { border-color: rgba(235,240,225,.3); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.btn.primary:hover { background: #d3ff5c; border-color: #d3ff5c; }
.btn.big { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.wallet-connected {
  font-family: var(--mono); font-size: 13px;
}
.wallet-connected .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--up); display: inline-block;
}

/* ---------- hero ---------- */
.hero {
  margin: 32px 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(900px 300px at 85% 20%, rgba(196, 245, 73, 0.07), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 56px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 480px) 1fr;
  gap: 40px;
  align-items: center;
}
.hero h1 {
  font-size: 44px; line-height: 1.06; letter-spacing: -0.035em; font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); margin: 18px 0 26px; max-width: 420px; }
.hero-chart { position: relative; height: 220px; min-width: 0; }
.hero-chart canvas { width: 100%; height: 100%; display: block; }
.hero-tickers {
  position: absolute; bottom: -18px; right: 0;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px 4px 5px; background: rgba(10,11,9,.6);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip img { width: 16px; height: 16px; border-radius: 50%; }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; gap: 16px; align-items: center; margin: 8px 0 24px;
  flex-wrap: wrap;
}
.search {
  flex: 1; min-width: 260px; position: relative;
}
.search input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px 12px 40px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.search input:focus { border-color: rgba(196,245,73,.4); }
.search input::placeholder { color: var(--dim); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.sorts { display: flex; gap: 4px; align-items: center; }
.sorts span { color: var(--dim); font-size: 13px; margin-right: 8px; }
.sort-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px;
}
.sort-btn.active { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); }

/* ---------- token grid ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { font-size: 18px; letter-spacing: -0.01em; }
.section-head .count { color: var(--dim); font-size: 13px; font-family: var(--mono); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-bottom: 64px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
  display: block;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.coin-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; font-family: var(--mono);
  color: #0b0c0a;
  object-fit: cover;
}
img.coin-avatar { border: 1px solid var(--line-strong); }
.upload-box {
  display: flex; align-items: center; gap: 10px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: var(--bg); color: var(--muted);
  padding: 11px 13px; font-size: 13.5px; cursor: pointer;
  transition: border-color .12s, color .12s;
}
.upload-box:hover { border-color: rgba(196,245,73,.45); color: var(--text); }
.pair-badge {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 10px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.pair-badge .sq { width: 8px; height: 8px; border-radius: 2px; }
.s-logo { width: 16px; height: 16px; border-radius: 50%; display: block; }
.s-logo.lg { width: 22px; height: 22px; }
.card .ticker { margin-top: 14px; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.card .name { color: var(--muted); font-size: 13px; margin-top: 1px; }
.card .mcap { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 10px; font-family: var(--mono); }
.card-stats {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; font-family: var(--mono);
}
.card-stats .vol { color: var(--dim); }
.up { color: var(--up); }
.down { color: var(--down); }
.spark { position: absolute; right: 0; bottom: 42px; width: 130px; height: 44px; opacity: .8; }

/* ---------- create page ---------- */
.page-title { margin: 40px 0 6px; font-size: 30px; letter-spacing: -0.03em; }
.page-sub { color: var(--muted); margin-bottom: 32px; }

.create-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; margin-bottom: 80px; }
@media (max-width: 900px) { .create-layout { grid-template-columns: 1fr; } .hero { grid-template-columns: 1fr; padding: 36px; } .hero-chart { display: none; } }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 26px;
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--text); padding: 11px 13px; font-size: 14px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(196,245,73,.45); }
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.stock-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.stock-opt {
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--bg); padding: 12px 13px; text-align: left;
  transition: border-color .12s, background .12s;
}
.stock-opt:hover { border-color: rgba(235,240,225,.3); }
.stock-opt.selected { border-color: var(--accent); background: rgba(196,245,73,.06); }
.stock-opt .s-tick { font-family: var(--mono); font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stock-opt .s-tick .sq { width: 10px; height: 10px; border-radius: 3px; }
.stock-opt .s-tick { font-size: 13.5px; }
.stock-opt .s-name { color: var(--dim); font-size: 11.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-opt .s-price { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.preview-card { position: sticky; top: 88px; }
.preview-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; }

/* ---------- coin page ---------- */
.coin-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin: 32px 0 80px; }
@media (max-width: 980px) { .coin-layout { grid-template-columns: 1fr; } }

.coin-head { display: flex; align-items: center; gap: 16px; margin: 32px 0 8px; flex-wrap: wrap; }
.coin-head .coin-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 15px; }
.coin-head h1 { font-size: 24px; letter-spacing: -0.02em; }
.coin-head .name { color: var(--muted); font-size: 14px; }
.coin-head .pair-badge { margin-left: auto; }

.price-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.price-row .price { font-size: 34px; font-weight: 700; font-family: var(--mono); letter-spacing: -0.02em; }
.price-row .chg { font-family: var(--mono); font-size: 15px; font-weight: 600; }

.chart-panel { padding: 18px; }
.chart-toolbar { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 10px; }
.tf-btn {
  background: transparent; border: 1px solid transparent; color: var(--dim);
  font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px;
}
.tf-btn.active { background: var(--panel-2); border-color: var(--line-strong); color: var(--text); }
#chart { width: 100%; height: 380px; display: block; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px;
}
.stat {
  border: 1px solid var(--line); border-radius: 11px; background: var(--panel);
  padding: 13px 15px;
}
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.stat .v { font-family: var(--mono); font-size: 15px; font-weight: 600; margin-top: 4px; }
@media (max-width: 700px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }

.trade-panel .tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab-btn {
  flex: 1; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
}
.tab-btn.buy.active { background: rgba(159,232,112,.12); border-color: rgba(159,232,112,.5); color: var(--up); }
.tab-btn.sell.active { background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.45); color: var(--down); }
.amount-row { position: relative; margin-bottom: 12px; }
.amount-row input {
  width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--text); padding: 13px 90px 13px 14px; font-size: 16px; font-family: var(--mono); outline: none;
}
.amount-row .unit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.quick-row { display: flex; gap: 6px; margin-bottom: 16px; }
.quick-row button {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 12px; padding: 7px 0; border-radius: 8px;
}
.quick-row button:hover { color: var(--text); border-color: var(--line-strong); }
.receive-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 16px; font-family: var(--mono); }

.trades-panel { margin-top: 24px; padding: 0; overflow: hidden; }
.trades-panel h3 { font-size: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.trade-row {
  display: grid; grid-template-columns: 60px 1fr 1fr 1fr; gap: 10px;
  padding: 10px 20px; font-family: var(--mono); font-size: 12.5px;
  border-bottom: 1px solid var(--line); color: var(--muted);
}
.trade-row:last-child { border-bottom: 0; }
.trade-row .addr { color: var(--dim); }

.bonding {
  margin-top: 24px;
}
.bonding .bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bonding .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bonding .k { font-size: 13px; font-weight: 600; }
.bonding .pct { font-family: var(--mono); font-size: 13px; color: var(--accent); float: right; }
.bonding p { font-size: 12px; color: var(--dim); margin-top: 10px; }

/* ---------- footer / toast ---------- */
footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--dim); font-size: 13px;
}
footer .wrap { display: flex; gap: 24px; align-items: center; }
.f-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.f-brand .mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  display: grid; place-items: center; color: var(--accent-ink);
  font-family: var(--mono); font-size: 11px; font-weight: 800;
}
footer a:hover { color: var(--text); }
footer .right { margin-left: auto; font-family: var(--mono); font-size: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 12px 20px; font-size: 14px; z-index: 100;
  transition: transform .25s ease; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }

.empty { color: var(--dim); text-align: center; padding: 60px 0; grid-column: 1 / -1; }
