/* Cryptle — always dark, Clear Sans, Wordle-ish tiles (same family as Day Tradle) with a violet accent */
:root {
  --bg: #121213; --panel: #1a1a1b; --line: #3a3a3c; --line2: #565758; --text: #f8f8f8; --muted: #818384;
  --green: #538d4e; --yellow: #b59f3b; --red: #c9483f; --up: #6aaa64; --down: #e0645c; --violet: #7c5cd6; --violet2: #a58cf0;
  --gold: #c9a227; --silver: #9ea3a8; --bronze: #a8672f; --liberty: #4e9f8f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; height: 64px; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 18px; }
.logo { font-weight: 700; font-size: 30px; letter-spacing: .02em; white-space: nowrap; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.beta { font-size: 11px; letter-spacing: .1em; background: var(--yellow); color: #121213; border-radius: 4px; padding: 3px 6px 2px; }
.right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; position: relative; }
.ind { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.ind small { font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.ind b { font-size: 16px; }
.ib { width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; background: none; border: 0; }
.ib svg { width: 24px; height: 24px; fill: currentColor; }
.ib:hover, .ib.on { background: #2a2a2c; }
.badge { min-width: 46px; height: 30px; padding: 0 9px; border-radius: 5px; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px;
  color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); border: 0; }
.badge.g1 { background: var(--gold); } .badge.g2 { background: var(--silver); } .badge.g3 { background: var(--bronze); } .badge.gx { background: var(--liberty); }
.strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 34px 0; font-size: 12px; color: var(--muted);
  letter-spacing: .05em; text-transform: uppercase; font-weight: 700; }
.strip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 6px; vertical-align: 1px; }

/* pages */
.page { padding: 18px 34px 48px; max-width: 1280px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.h:first-child { margin-top: 6px; }
.h h2 { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.h span { font-size: 13px; color: var(--muted); }
.sumrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.sum { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.sum small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.sum b { font-size: 24px; }
.note { border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 6px; padding: 10px 14px; font-size: 14px; margin: 14px 0 0; }

/* tiles */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tile { aspect-ratio: 1; border: 2px solid var(--line); display: flex; flex-direction: column; padding: 9px 8px 7px; text-align: center; text-decoration: none; min-width: 0; background: var(--bg); }
.tile:hover { border-color: var(--line2); }
.tile.g { border-color: var(--green); } .tile.r { border-color: var(--red); }
.tile .tk { font-weight: 700; font-size: 22px; letter-spacing: .03em; }
.tile .nm { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile svg { flex: 1; width: 100%; min-height: 0; margin: 4px 0; }
.tile .px { font-size: 14px; font-weight: 700; }
.tile .ch { font-size: 12px; font-weight: 700; }

/* player coin rows */
.coins { display: grid; gap: 8px; }
.coin { display: grid; grid-template-columns: 74px minmax(0, 1fr) 110px 90px 150px; gap: 14px; align-items: center; border: 2px solid var(--line); border-radius: 6px;
  padding: 10px 14px; text-decoration: none; }
.coin:hover { border-color: var(--line2); }
.coin .sym { font-weight: 700; font-size: 18px; letter-spacing: .03em; display: grid; place-items: center; height: 44px; border-radius: 4px; background: var(--violet); color: #fff; }
.coin .who { min-width: 0; }
.coin .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin .who small, .coin .k small { color: var(--muted); font-size: 12px; }
.coin .k { text-align: right; } .coin .k b { display: block; }
.tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 2px; }
.tag.new { background: var(--violet); color: #fff; } .tag.bot { background: #2f4f6f; color: #cfe3f7; } .tag.vet { background: var(--yellow); color: #121213; } .tag.you { background: var(--line); color: #d0d1d4; }
.meter { height: 6px; border-radius: 3px; background: #2a2a2c; overflow: hidden; margin-top: 5px; }
.meter i { display: block; height: 100%; background: var(--red); }
.meter i.ok { background: var(--green); }
.empty { border: 2px dashed var(--line); border-radius: 6px; padding: 26px; text-align: center; color: var(--muted); }

/* buttons & inputs */
.btn { height: 40px; padding: 0 16px; border-radius: 6px; border: 0; background: var(--text); color: var(--bg); font-weight: 700; letter-spacing: .02em; }
.btn.violet { background: var(--violet); color: #fff; }
.btn.ghost { background: none; color: var(--text); border: 2px solid var(--line); }
.btn:disabled { opacity: .45; cursor: default; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 32px; padding: 0 11px; border-radius: 5px; border: 1px solid var(--line); background: none; font-size: 13px; font-weight: 700; }
.chips button:hover { border-color: var(--line2); }
.field { display: flex; align-items: center; gap: 8px; height: 44px; border: 2px solid var(--line); border-radius: 6px; padding: 0 12px; }
.field:focus-within { border-color: var(--line2); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 17px; }
label.lb { display: block; font-size: 12px; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; font-weight: 700; margin: 14px 0 6px; }

/* coin page */
.back { font-size: 13px; color: var(--muted); text-decoration: none; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.coinhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 14px 0 10px; flex-wrap: wrap; }
.coinhead h1 { margin: 0; font-size: 34px; letter-spacing: .02em; }
.coinhead h1 small { font-size: 18px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.coinhead .big { font-size: 30px; font-weight: 700; text-align: right; }
.chart { border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.chart svg { width: 100%; height: 240px; display: block; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.tabs button { height: 38px; border-radius: 5px; border: 2px solid var(--line); background: none; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; }
.tabs button.on.buy { background: var(--green); border-color: var(--green); }
.tabs button.on.sell { background: var(--red); border-color: var(--red); }
.preview { font-size: 13px; color: var(--muted); min-height: 38px; margin: 10px 0; line-height: 1.45; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #262628; font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list li.me { font-weight: 700; }
.feed li { display: block; }
.feed time { color: var(--muted); font-size: 12px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.feed a { font-weight: 700; text-decoration: none; }

/* popovers, modal, toasts */
#popover > div { position: absolute; right: 0; top: 52px; width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.lbtabs { display: flex; gap: 4px; justify-content: center; margin-bottom: 10px; }
.lbtabs button { padding: 5px 12px; border-radius: 4px; border: 1px solid var(--line); background: none; font-size: 13px; font-weight: 700; }
.lbtabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.lbrow { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; padding: 6px 4px; font-size: 14px; border-bottom: 1px solid #262628; }
.lbrow.me { background: #232325; font-weight: 700; }
#modal:empty { display: none; }
#modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; }
.dialog h2 { margin: 0 0 6px; font-size: 22px; }
.dialog p, .dialog li { font-size: 15px; line-height: 1.5; color: #d6d6d8; }
.dialog ul { padding-left: 20px; }
.dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }

@media (max-width: 1000px) {
  .cols { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 8px; } .logo { font-size: 22px; gap: 6px; } .hide-sm { display: none; }
  .strip { padding: 10px 16px 0; font-size: 11px; }
  .page { padding: 14px 16px 40px; }
  .sumrow { grid-template-columns: 1fr 1fr; } .sum b { font-size: 20px; }
  .coin { grid-template-columns: 62px minmax(0, 1fr) 96px; } .coin .k.opt { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  #popover > div { position: fixed; left: 12px; right: 12px; width: auto; top: 60px; }
}
