/* Qwaix. Same family as the Qwai logo: one hot pink, near-black, hard squares. */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-500.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --bg: #09090c;
  --panel: #131318;
  --raised: #1c1c23;
  --line: #2b2b35;
  --ink: #f5f4f2;
  --muted: #a5a7b2;
  --brand: #ff2d55;
  --brand-deep: #c9143a;
  --up: #2fce8f;
  --down: #ff6b6b;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 16px; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 34px; padding: 14px 24px; background: rgba(9, 9, 12, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.brand img { display: block; }
nav { display: flex; flex-wrap: wrap; gap: 4px 26px; flex: 1; }
nav a { font-weight: 600; font-size: 18px; padding: 12px 0; color: var(--muted); border-bottom: 3px solid transparent; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.actions { display: flex; gap: 12px; }

.btn, button { font: inherit; font-weight: 700; min-height: 50px; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--brand); border-radius: 0; background: var(--brand); color: #fff; cursor: pointer; position: relative; overflow: hidden; transition: transform 0.12s ease, background 0.2s ease; }
.btn::after, button::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%); transform: translateX(-120%); transition: transform 0.6s ease; pointer-events: none; }
.btn:hover::after, button:hover::after { transform: translateX(120%); }
.btn:active, button:active { transform: translateY(1px); }
.btn.line, button.line { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.line:hover, button.line:hover { border-color: var(--ink); }
button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
button:disabled { opacity: 0.45; cursor: default; }
button.wide { width: 100%; min-height: 58px; font-size: 19px; }
button.sellbtn { background: var(--raised); border-color: var(--down); color: var(--down); }
input, select, textarea { font: inherit; min-height: 54px; width: 100%; padding: 10px 16px; background: var(--bg); color: var(--ink); border: 2px solid var(--line); border-radius: 0; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; }
label { display: block; font-weight: 600; margin: 18px 0 8px; }

main { max-width: 1320px; margin: 0 auto; padding: 28px 24px 90px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 22px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { min-height: 46px; padding: 0 18px; background: transparent; border-color: var(--line); color: var(--ink); }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 26px; }
.hero div { background: var(--panel); padding: 20px 22px; }
.hero b { display: block; font-size: 30px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero span { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 20px; }
.card { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 16px; background: var(--panel); border: 1px solid var(--line); transition: transform 0.16s ease, border-color 0.16s ease; animation: rise 0.35s ease both; }
.card:hover { transform: translateY(-3px); border-color: var(--brand); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.pic { width: 84px; height: 84px; background: var(--raised); display: grid; place-items: center; font-weight: 700; font-size: 30px; color: var(--brand); overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic.big { width: 96px; height: 96px; }
.card h3 { margin: 0; font-size: 20px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .row { flex-wrap: nowrap; margin-top: 6px; white-space: nowrap; }
.card .sym { color: var(--muted); font-weight: 600; }
.card .cap { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 2px 10px; border: 1px solid var(--line); font-size: 16px; font-weight: 600; color: var(--muted); }
.tag.open { border-color: var(--up); color: var(--up); }
.bar { height: 8px; background: var(--raised); margin-top: 10px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-deep), var(--brand)); transition: width 0.5s ease; }

.token { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 20px; }
.head .links { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.head .links a, .head .links button { min-height: 46px; padding: 0 16px; display: inline-flex; align-items: center; border: 2px solid var(--line); font-weight: 600; background: transparent; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.stats div { padding: 14px 18px; box-shadow: 0 0 0 1px var(--line); }
.stats b { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); }
.stack > * + * { margin-top: 20px; }
.chart { position: relative; height: 420px; }
.chart canvas { width: 100%; height: 100%; display: block; }
.readout { min-height: 26px; font-variant-numeric: tabular-nums; color: var(--muted); }
.field { position: relative; }
.field input { font-size: 26px; font-weight: 700; padding-right: 96px; min-height: 68px; }
.field span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 16px; }
.quick button { min-height: 46px; padding: 0 6px; background: transparent; border-color: var(--line); color: var(--ink); }
.lines { margin: 16px 0; }
.lines div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.lines div b { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 18px; }
.two button { background: transparent; border-color: var(--line); color: var(--muted); }
.two button.on.buy { background: var(--brand); border-color: var(--brand); color: #fff; }
.two button.on.sell { background: var(--down); border-color: var(--down); color: #1a0606; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--raised); }
.scroll { overflow-x: auto; }
.form { max-width: 720px; }
.form h1 { margin-bottom: 22px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pick { display: flex; align-items: center; gap: 18px; }
.empty { padding: 60px 0; text-align: center; color: var(--muted); font-size: 20px; }
.error { color: var(--down); min-height: 24px; margin: 12px 0 0; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 9; max-width: min(440px, calc(100vw - 40px)); }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 4px solid var(--up); padding: 16px 18px; font-weight: 600; animation: slide 0.3s ease both; }
.toast.bad { border-left-color: var(--down); }
.toast a { text-decoration: underline; text-underline-offset: 3px; }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }

@media (max-width: 1000px) {
  .token { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr 1fr; }
  .chart { height: 320px; }
}
@media (max-width: 560px) {
  main { padding: 20px 14px 80px; }
  .top { padding: 12px 14px; }
  .three { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
