:root {
  --bg: #06070c; --panel: rgba(255,255,255,0.035); --panel-2: rgba(255,255,255,0.06); --solid: #0b0d15;
  --line: rgba(255,255,255,0.08); --fg: #eef0f6; --muted: #8b90a3; --dim: #5c6175;
  --violet: #8b5cf6; --cyan: #22d3ee; --green: #22c55e; --red: #f43f5e;
  --grad: linear-gradient(120deg, #a78bfa 0%, #22d3ee 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 15px/1.55 Inter, system-ui, sans-serif; min-height: 100vh;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(139,92,246,0.20), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(34,211,238,0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--cyan); text-decoration: none; } a:hover { text-decoration: underline; }
.num, .mono, code { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
code { font-size: .88em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* Top navigation */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: rgba(6,7,12,0.72); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1320px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); box-shadow: 0 0 28px rgba(139,92,246,0.5); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 8px; background: var(--bg); clip-path: polygon(0 100%, 50% 0, 100% 100%, 72% 100%, 50% 45%, 28% 100%); }
.word { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 4px; }
.tabs a { color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--fg); background: var(--panel); }
.tabs a.on { color: var(--fg); background: var(--panel-2); }
.nav .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--panel); white-space: nowrap; }
.pill b { color: var(--fg); font-weight: 600; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 720px) { .nav .right .pill { display: none; } .nav-in { gap: 12px; } .tabs a { padding: 6px 8px; } }

main { max-width: 1320px; margin: 0 auto; padding: 20px 16px 80px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.note { color: var(--muted); font-size: 13px; }
.bid { color: var(--green); } .ask { color: var(--red); }
.empty { color: var(--dim); text-align: center; padding: 16px; font-size: 14px; }

button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; color: #fff; background: var(--grad); transition: transform .08s, filter .15s, opacity .15s; }
button:hover { filter: brightness(1.1); } button:active { transform: translateY(1px); }
button:disabled { opacity: .35; cursor: default; filter: none; }
button.wide { width: 100%; }
button.ghost { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); }
button.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
.cu { display: inline-block; font: 600 13px "JetBrains Mono", monospace; padding: 2px 9px; border-radius: 999px; color: #d9ccff; background: rgba(139,92,246,0.16); border: 1px solid rgba(139,92,246,0.35); }
.ours td { background: rgba(139,92,246,0.08); }
.ours td:first-child { font-weight: 600; }
.table-wrap { overflow-x: auto; }
footer { margin-top: 40px; color: var(--dim); font-size: 13px; text-align: center; }

/* Wallet picker */
.modal-bg { position: fixed; inset: 0; background: rgba(3,4,8,0.72); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { width: 100%; max-width: 380px; background: #0d0f18; border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-x { float: right; background: none; color: var(--muted); padding: 2px 6px; font-size: 18px; }
.wallet-opt { display: flex; align-items: center; gap: 12px; width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--fg); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; text-align: left; font-weight: 600; text-decoration: none !important; }
.wallet-opt:hover { border-color: rgba(139,92,246,0.6); background: var(--panel-2); filter: none; }
.wallet-opt img, .wallet-opt .av { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.wallet-opt .av { display: grid; place-items: center; background: var(--panel-2); color: var(--muted); font-weight: 700; }
.wallet-opt .tag { margin-left: auto; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.wallet-opt .tag.ok { color: var(--green); background: rgba(34,197,94,0.12); }
.wallet-opt .tag.get { color: var(--muted); background: var(--panel-2); }
.modal .foot { color: var(--dim); font-size: 12px; margin-top: 10px; }
/* Connected chip */
.acct { position: relative; display: flex; flex-direction: column; align-items: flex-end; }
.acct .who { font-size: 11px; color: var(--muted); margin-top: 2px; min-height: 14px; }
.nav .acct button#connect { padding: 7px 14px; border-radius: 10px; font-size: 14px; }
.chip { display: flex; align-items: center; justify-content: center; gap: 8px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.menu { position: absolute; right: 0; min-width: 200px; top: calc(100% + 6px); background: #0d0f18; border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: none; z-index: 20; }
.menu.open { display: block; }
.menu button { display: block; width: 100%; text-align: left; background: none; color: var(--fg); font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.menu button:hover { background: var(--panel-2); filter: none; }
/* Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: #0d0f18; border: 1px solid var(--line); border-left: 3px solid var(--violet); border-radius: 10px; padding: 10px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--red); } .toast.ok { border-left-color: var(--green); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
