:root {
  --bg: #000;
  --bg-2: #0c0c0c;
  --line: #1c1c1c;
  --text: #fff;
  --muted: #8b8b8b;
  --dim: #5c5c5c;
  --grade: #ff9b3d;
  --timer: #ff4d4d;
  --price: #2fd176;
  --deal: #ff4d4d;
  --buy: #2fd176;
  --red: #e10600;
  --pill: #161616;
  --pill-on: #1a3d73;
  --sheet: #111;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}
body { max-width: 430px; margin: 0 auto; position: relative; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

.app { min-height: 100dvh; padding-bottom: calc(64px + var(--safe-bottom)); }

.top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px 6px;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: 0.12em; }
.live { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.08em; }

.banner {
  margin: 0 12px 8px; padding: 8px 10px; border: 1px solid #5a2200;
  background: #1a0d00; color: #ffb070; font-size: 11px; line-height: 1.35;
  border-radius: 8px; font-weight: 600;
}

.tabs {
  display: flex; align-items: center; gap: 18px;
  padding: 4px 16px 0; border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  position: relative; padding: 10px 0 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--dim); white-space: nowrap;
}
.tab .dot { color: inherit; margin-right: 4px; }
.tab.on { color: var(--text); }
.tab.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--red);
}
.tab.on .dot { color: var(--red); }
.tab-star { margin-left: auto; color: var(--dim); font-size: 16px; padding: 8px 0; }

.sorts {
  display: flex; gap: 8px; padding: 10px 12px 8px; align-items: center;
  overflow-x: auto;
}
.pill {
  background: var(--pill); color: var(--muted);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid #222;
}
.pill.on { background: var(--pill-on); color: #dbe8ff; border-color: #2a4d86; }
.gear {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px;
  background: #123a7a; color: #9dc0ff; font-size: 14px;
  display: grid; place-items: center; position: relative; flex: 0 0 auto;
}
.gear .badge {
  position: absolute; top: -4px; right: -4px;
  background: #3b82f6; color: #fff; font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px; border-radius: 99px;
  display: grid; place-items: center; padding: 0 3px;
}

/* .cols grid defined near file end (LISTED-aware) */

.list { }
.row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
  padding: 0;
}
.row:active { background: #0f0f0f; }
.cardcell { display: flex; gap: 10px; min-width: 0; align-items: center; }
.thumb {
  width: 40px; height: 56px; border-radius: 3px; object-fit: cover;
  background: #1a1a1a; flex: 0 0 auto;
}
.meta { min-width: 0; }
.name {
  font-size: 14px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.set {
  font-size: 11px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.grade { font-size: 12px; font-weight: 800; color: var(--grade); margin-top: 2px; }
.ends { text-align: right; font-size: 12px; font-weight: 700; color: var(--timer); }
.ends.gone { color: var(--dim); }
.bids { text-align: right; font-size: 12px; color: var(--muted); }
.pricecol { text-align: right; }
.price { font-size: 15px; font-weight: 800; color: var(--price); }
.deal { font-size: 11px; font-weight: 700; color: var(--deal); margin-top: 2px; }
.deal.na { color: var(--dim); font-weight: 600; }
.buychip {
  display: inline-block; margin-top: 3px; font-size: 9px; font-weight: 800;
  letter-spacing: 0.08em; color: #042; background: var(--buy);
  border-radius: 4px; padding: 1px 5px;
}

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }

.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(430px, 100%);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  background: #050505; border-top: 1px solid var(--line); z-index: 5;
}
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--dim); font-size: 10px; font-weight: 600; }
.nav button.on { color: var(--grade); }
.nav svg { width: 22px; height: 22px; }

.sheet-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 20;
  display: none;
}
.sheet-bg.on { display: block; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(430px, 100%);
  max-height: 86dvh; overflow: auto;
  background: var(--sheet); border-radius: 16px 16px 0 0;
  z-index: 21; padding: 10px 16px calc(20px + var(--safe-bottom));
  display: none;
}
.sheet.on { display: block; }
.handle { width: 40px; height: 4px; background: #333; border-radius: 4px; margin: 6px auto 12px; }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; }
.sheet-head img { width: 72px; height: 100px; object-fit: cover; border-radius: 4px; background: #222; }
.sheet-head h2 { margin: 0 0 4px; font-size: 18px; }
.sheet-head .set { font-size: 13px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-top: 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 650; }
.kv .buy { color: var(--buy); }
.kv .no { color: var(--deal); }
.note { margin-top: 14px; font-size: 11px; color: var(--dim); line-height: 1.4; }
.sheet-close {
  margin-top: 14px; width: 100%; padding: 12px; border-radius: 10px;
  background: #1c1c1c; font-weight: 700;
}


.chasechip{display:inline-block;margin-top:2px;padding:1px 6px;border-radius:4px;background:#6c5ce7;color:#fff;font-size:10px;font-weight:700;letter-spacing:.02em}
.watchchip{display:inline-block;margin-top:2px;margin-left:4px;padding:1px 6px;border-radius:4px;background:#c9a227;color:#1a1400;font-size:10px;font-weight:700;letter-spacing:.02em}
.kv .watch{color:#e6c35c}
.spark-wrap{margin:10px 12px 4px;padding:8px 10px;background:#111;border-radius:10px;border:1px solid #222}
.spark-label{font-size:11px;color:#9aa;margin-bottom:4px}
.spark-scale{font-size:10px;color:#777;margin-top:2px}
.tabs{flex-wrap:wrap}

.row { display: flex; align-items: stretch; gap: 0; width: 100%; border-bottom: 1px solid var(--line); }
.row-main {
  flex: 1; display: grid;
  grid-template-columns: minmax(0,1.55fr) 64px 40px 84px;
  gap: 4px; align-items: center;
  padding: 8px 2px 8px 12px; text-align: left; width: 100%; min-width: 0;
}
.row-info {
  flex: 0 0 36px; color: var(--muted); font-size: 15px;
  border-left: 1px solid var(--line);
  display: grid; place-items: center;
}
.open-listing { display: block; }

/* LISTED: hide ENDS/BIDS — widen CARD + PRICE; align .cols */
body.tab-listed .cols {
  grid-template-columns: minmax(0,1fr) 108px;
  padding: 2px 14px 4px 12px;
}
body.tab-listed .cols .col-ends,
body.tab-listed .cols .col-bids { display: none; }
body.tab-listed .row-main {
  grid-template-columns: minmax(0,1fr) 108px;
  padding: 7px 2px 7px 12px;
}
body.tab-listed .row-main .ends,
body.tab-listed .row-main .bids { display: none; }
body.tab-listed .pricecol { min-width: 0; }

.cols {
  display: grid;
  grid-template-columns: minmax(0,1.55fr) 64px 40px 84px;
  gap: 4px;
  padding: 2px 14px 4px 12px;
  color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
}
.cols span:nth-child(2),
.cols span:nth-child(3),
.cols span:nth-child(4) { text-align: right; }

.thumb { width: 36px; height: 50px; border-radius: 3px; object-fit: cover; background: #1a1a1a; flex: 0 0 auto; }
.cardcell { display: flex; gap: 8px; min-width: 0; align-items: center; }
.name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.set { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0; }
.grade { font-size: 11px; font-weight: 800; color: var(--grade); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-size: 14px; font-weight: 800; color: var(--price); }
.deal { font-size: 10px; font-weight: 700; color: var(--deal); margin-top: 1px; }
.chiprow { display: flex; flex-wrap: nowrap; gap: 4px; justify-content: flex-end; margin-top: 3px; min-height: 0; }
.buychip, .chasechip, .watchchip {
  display: inline-block; margin: 0; padding: 1px 5px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.3;
}
.buychip { color: #042; background: var(--buy); }
.chasechip { color: #fff; background: #6c5ce7; }
.watchchip { color: #1a1400; background: #c9a227; }

/* Hide Netlify "Powered by" badge overlapping bottom nav */
iframe[src*="netlify"],
#netlify-badge,
.netlify-badge,
[class*="netlify-badge"],
a[href*="netlify.com/"]:is([style*="position"], [style*="fixed"], [style*="bottom"]),
body > div > a[href*="www.netlify.com"],
body > a[href*="netlify.com"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


.card-actions { display: flex; gap: 8px; margin: 10px 12px; }
.card-actions a { flex: 1; text-align: center; padding: 12px 8px; border-radius: 10px; font-weight: 700; text-decoration: none; color: #fff; font-size: 14px; }
.open-listing { background: #1a3d73; }
.open-pc { background: #2a2a2a; border: 1px solid #444; }


/* SEALED: PRODUCT | STORE | PRICE — no ENDS/BIDS clutter */
body.tab-sealed .cols {
  grid-template-columns: minmax(0,1.4fr) 72px 88px;
  padding: 2px 14px 4px 12px;
}
body.tab-sealed .cols .col-store,
body.tab-sealed .cols .col-price { text-align: right; }
body.tab-sealed .row-main {
  grid-template-columns: minmax(0,1.4fr) 72px 88px;
  padding: 7px 12px 7px 12px;
}
body.tab-sealed .row-info { display: none; }
body.tab-sealed .storecol {
  text-align: right; font-size: 11px; font-weight: 700; color: var(--muted);
  line-height: 1.25;
}
body.tab-sealed .pricecol { min-width: 0; }
body.tab-sealed .sorts .pill[data-sort="ending"],
body.tab-sealed .sorts .pill[data-sort="below"] { display: none; }
.thumb-sealed {
  width: 36px; height: 50px; border-radius: 3px;
  background: linear-gradient(145deg, #1a2a1a, #0d150d);
  border: 1px solid #243024; flex: 0 0 auto;
}
