/* ============================================================
   HOODIE, launchpad on Robinhood Chain
   Design system per BRAND.md. Bags-app chrome + CMC market table.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* brand */
  --lime:      #d8f018;
  --lime-deep: #aec70c;
  --grape:     #9c78d8;
  --grape-deep:#6b4fc0;
  --peri:      #c0cce4;
  /* ink + surfaces */
  --ink:       #0a0a0e;
  --bg:        #0a0a0e;
  --surface:   #121218;
  --surface-2: #17171f;
  --surface-3: #1e1e28;
  --hair:      rgba(255,255,255,0.07);
  --hair-2:    rgba(255,255,255,0.13);
  /* text */
  --text:      #f5f6fa;
  --dim:       #989ab2;
  --faint:     #62637a;
  /* semantic */
  --up:        #35d07f;
  --down:      #f0616d;
  --lime-soft: rgba(216,240,24,0.12);
  --grape-soft:rgba(156,120,216,0.16);
  --ui: 'Schibsted Grotesk', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 11px; --r-sm: 8px; --r-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: var(--ui);
  font-size: 14px; line-height: 1.5; min-height: 100vh; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 22px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60; height: 58px;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--ink); border-bottom: 1px solid var(--hair-2);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand img { height: 25px; }
.brand .wordmark { font-weight: 800; font-size: 17px; letter-spacing: 1.4px; text-transform: uppercase; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--dim); font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: var(--r-sm); transition: .14s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 7px 12px; width: 240px; color: var(--faint);
}
.search input { background: none; border: 0; outline: 0; color: var(--text); font-family: var(--ui); font-size: 13px; width: 100%; }
.search svg { flex-shrink: 0; }
.top-right { display: flex; align-items: center; gap: 9px; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--ui); font-weight: 600; font-size: 13.5px; border: 1px solid var(--hair-2);
  background: var(--surface-2); color: var(--text); padding: 8px 15px; border-radius: var(--r);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: .14s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--lime); color: #0b0d02; border-color: var(--lime); font-weight: 700; }
.btn-primary:hover { background: var(--lime-deep); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- global stat ribbon ---------- */
.ribbon {
  display: flex; align-items: center; gap: 0; flex-wrap: wrap; border-bottom: 1px solid var(--hair);
  background: var(--surface); font-size: 13px;
}
.ribbon .wrap { display: flex; align-items: center; gap: 26px; padding: 9px 22px; flex-wrap: wrap; }
.ribbon .r { display: flex; align-items: center; gap: 7px; color: var(--dim); }
.ribbon .r b { color: var(--text); font-weight: 700; }
.ribbon .r .up { color: var(--up); font-weight: 700; }
.ribbon .tag { color: var(--faint); font-family: var(--mono); font-size: 11px; margin-left: auto; }

/* ---------- promo banner (Bags-style launch strip) ---------- */
.promo {
  display: flex; align-items: center; gap: 22px; margin: 22px 0;
  background: linear-gradient(100deg, var(--grape-soft), transparent 62%), var(--surface);
  border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 26px 28px; overflow: hidden;
}
.promo img { height: 92px; width: 92px; object-fit: cover; border-radius: 16px; border: 1px solid var(--hair-2); background: var(--grape-soft); flex-shrink: 0; }
.promo .txt { flex: 1; min-width: 0; }
.promo .txt h3 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.promo .txt p { color: var(--dim); font-size: 15px; margin-top: 4px; }
.promo .txt b { color: var(--lime); }
.promo .btn-primary { padding: 12px 22px; font-size: 14.5px; }

/* ---------- trending cards ---------- */
.trend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.tcard { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 14px 16px; }
.tcard h4 { font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.tcard h4 .ic { color: var(--lime); }
.trow { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.trow .rk { color: var(--faint); font-size: 12px; width: 12px; }
.trow .av { width: 24px; height: 24px; border-radius: 7px; background: var(--grape-soft); border: 1px solid var(--hair); display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--grape); }
.trow .s { font-weight: 700; font-size: 13px; }
.trow .n { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .chg { margin-left: auto; font-size: 12.5px; font-weight: 700; }
.chg.up { color: var(--up); } .chg.dn { color: var(--down); }

/* ---------- section head + tabs ---------- */
.sec-head { display: flex; align-items: center; gap: 14px; margin: 26px 0 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.sec-head .sub { color: var(--faint); font-size: 13px; }
.tabs { display: flex; gap: 5px; margin-left: auto; }
.tabs button { font-family: var(--ui); font-weight: 600; font-size: 13px; color: var(--dim); background: transparent; border: 1px solid var(--hair); padding: 6px 13px; border-radius: var(--r-sm); cursor: pointer; transition: .14s; }
.tabs button:hover { color: var(--text); border-color: var(--hair-2); }
.tabs button.on { color: #0b0d02; background: var(--lime); border-color: var(--lime); }

/* ---------- market table (CMC-style) ---------- */
.market { border: 1px solid var(--hair); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.mkt-scroll { overflow-x: auto; }
table.mkt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
table.mkt thead th {
  background: var(--surface-3); color: var(--faint);
  font-weight: 600; font-size: 12px; text-align: left; padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--hair); cursor: default;
}
table.mkt thead th.r { text-align: right; }
table.mkt thead th.sortable { cursor: pointer; user-select: none; }
table.mkt thead th.sortable:hover { color: var(--dim); }
table.mkt thead th .car { color: var(--lime); font-size: 10px; margin-left: 3px; }
table.mkt tbody td { padding: 12px 14px; border-bottom: 1px solid var(--hair); vertical-align: middle; white-space: nowrap; }
table.mkt tbody tr { transition: background .12s; }
table.mkt tbody tr:hover { background: var(--surface-2); }
table.mkt tbody tr:last-child td { border-bottom: 0; }
.mkt .star { width: 34px; text-align: center; }
.mkt .star button { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; transition: .14s; }
.mkt .star button.on, .mkt .star button:hover { color: var(--lime); }
.mkt .num { color: var(--faint); width: 30px; }
.mkt td.r { text-align: right; }
.mkt .coincell { display: flex; align-items: center; gap: 11px; }
.mkt .coincell .av { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--grape-soft); border: 1px solid var(--hair-2); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: var(--grape); flex-shrink: 0; }
.trow img.av, .mkt .coincell img.av { object-fit: cover; }
.mkt .coincell .s { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.mkt .coincell .n { color: var(--faint); font-size: 12px; }
.mkt .price { font-weight: 600; }
.mkt .chg { font-weight: 700; }
.mkt .curvecell { min-width: 120px; }
.mkt .curvebar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 4px; }
.mkt .curvebar > span { display: block; height: 100%; background: var(--lime); }
.mkt .curvecell .lab { font-size: 11px; color: var(--faint); }
.mkt .creatorcell { display: flex; flex-direction: column; gap: 2px; }
.mkt .creatorcell .who { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); }
.mkt .creatorcell .fees { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.mkt .sparkcell svg { display: block; }
.chip { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: .4px; }
.chip.grad { color: var(--up); background: rgba(53,208,127,.13); }
.chip.prev { color: var(--faint); background: var(--surface-3); }
.chip.x { color: var(--grape); background: var(--grape-soft); }
.chip.new { color: var(--lime); background: var(--lime-soft); }

/* ---------- panels / forms (launch/claim/coin) ---------- */
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 24px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
label.fld { display: block; margin-bottom: 17px; }
label.fld .lbl { font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 7px; display: block; }
label.fld .hint { color: var(--faint); font-size: 12px; margin-top: 6px; display: block; }
input[type=text], input[type=number], textarea, select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--hair-2); color: var(--text);
  font-family: var(--ui); font-size: 15px; padding: 11px 14px; border-radius: var(--r); outline: none; transition: .14s;
}
input:focus, textarea:focus, select:focus { border-color: var(--lime); }
input::placeholder { color: var(--faint); }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; background: var(--surface-2); border: 1px solid var(--hair-2); color: var(--dim); font-family: var(--ui); font-weight: 600; font-size: 14px; padding: 10px; cursor: pointer; transition: .14s; border-radius: var(--r); }
.seg button.on { background: var(--lime); color: #0b0d02; border-color: var(--lime); }
.seg button:not(.on):hover { color: var(--text); border-color: var(--hair-2); }
.dropzone { position: relative; border: 1.5px dashed var(--hair-2); border-radius: var(--r); background: var(--surface-2);
  min-height: 118px; display: grid; place-items: center; cursor: pointer; transition: .14s; overflow: hidden; text-align: center; padding: 14px; }
.dropzone:hover, .dropzone.over { border-color: var(--lime); background: var(--lime-soft); }
.dropzone img { max-height: 96px; max-width: 100%; border-radius: 10px; display: block; }
.dz-empty { color: var(--dim); display: grid; place-items: center; gap: 6px; }
.dz-empty .dz-text { font-size: 14px; } .dz-empty .dz-text b { color: var(--lime); }
.dz-empty .dz-sub { font-size: 11.5px; color: var(--faint); }
.dz-status { position: absolute; bottom: 6px; right: 10px; font-size: 11px; color: var(--dim); font-family: var(--mono); }
.how-title { font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
ol.how { font-size: 14px; line-height: 1.85; color: var(--dim); padding-left: 18px; }
ol.how b, ol.how .lime { color: var(--lime); font-weight: 600; }

/* ---------- trade page ---------- */
.trade-head { display: flex; gap: 15px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.trade-head .coin-img { width: 58px; height: 58px; border-radius: 14px; background: var(--grape-soft); border: 1px solid var(--hair-2); display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--grape); }
.trade-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.trade-head .nm { color: var(--dim); }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.metric { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 14px; }
.metric .n { font-weight: 700; font-size: 19px; }
.metric .l { font-size: 12px; color: var(--dim); margin-top: 3px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--hair); }
.progress > span { display: block; height: 100%; background: var(--lime); }
.curve-note { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--dim); margin-top: 9px; }
.feed { font-size: 13px; }
.feed .row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); align-items: center; }
.feed .row .tag { font-family: var(--mono); font-weight: 700; font-size: 11px; padding: 2px 7px; border-radius: 6px; }
.feed .row .buy { background: rgba(53,208,127,.13); color: var(--up); } .feed .row .sell { background: rgba(240,97,109,.13); color: var(--down); }
.feed .row .addr { color: var(--dim); font-family: var(--mono); font-size: 12px; } .feed .row .amt { margin-left: auto; font-family: var(--mono); font-weight: 600; }

/* ---------- claim ---------- */
.claim-hero { text-align: center; padding: 20px 0; }
.claim-hero .x-handle { color: var(--lime); }
.owed { font-family: var(--mono); font-weight: 700; font-size: 46px; color: var(--lime); letter-spacing: -2px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; translate: -50% 20px; background: var(--surface-3); border: 1px solid var(--hair-2); color: var(--text); font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: var(--r); box-shadow: 0 14px 40px -12px rgba(0,0,0,.85); opacity: 0; pointer-events: none; transition: .3s; z-index: 90; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast.err { border-color: var(--down); }
.banner { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 13px 16px; font-size: 13.5px; color: var(--dim); display: flex; gap: 11px; align-items: flex-start; margin: 16px 0; }
.banner b { color: var(--lime); font-weight: 700; flex-shrink: 0; }
.empty { text-align: center; color: var(--faint); padding: 44px 0; font-size: 14px; }
.empty a { color: var(--lime); }
footer { border-top: 1px solid var(--hair); margin-top: 46px; padding: 24px 0 44px; color: var(--faint); font-size: 13px; }
footer .frow { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
footer .frow img { height: 20px; } footer .frow .wordmark { font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; font-size: 14px; color: var(--dim); }
footer a { color: var(--dim); } footer a:hover { color: var(--text); }
.mono { font-family: var(--mono); } .lime { color: var(--lime); } .grape { color: var(--grape); } .muted { color: var(--dim); }
.reveal { opacity: 0; transform: translateY(10px); animation: rise .5s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- mobile bottom nav (app-style) ---------- */
.mobnav { display: none; }

@media (max-width: 920px) {
  .trend { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav, .search { display: none; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  body { padding-bottom: 66px; } /* room for the bottom nav */

  /* topbar: logo + connect only; launch lives in the bottom nav */
  .topbar { gap: 12px; padding: 0 16px; }
  .top-right .btn:not(.btn-primary) { display: none; }

  /* stat ribbon -> single scrolling line */
  .ribbon .wrap { flex-wrap: nowrap; overflow-x: auto; gap: 16px; padding: 9px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .ribbon .wrap::-webkit-scrollbar { display: none; }
  .ribbon .r { white-space: nowrap; flex: none; }
  .ribbon .tag { display: none; }

  /* promo hero -> stack */
  .promo { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
  .promo img { height: 60px; width: 60px; }
  .promo .txt h3 { font-size: 18px; line-height: 1.25; }
  .promo .txt p { font-size: 13.5px; }
  .promo .btn-primary { width: 100%; justify-content: center; }

  /* section head + tabs stack cleanly, tabs scroll */
  .sec-head { gap: 8px; }
  .sec-head .tabs { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sec-head .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; }

  /* market table: drop secondary columns so it fits with no horizontal scroll */
  table.mkt { min-width: 0; }
  .market .mkt-scroll { overflow-x: visible; }
  .mkt thead th:nth-child(1), .mkt tbody td:nth-child(1),   /* star */
  .mkt thead th:nth-child(2), .mkt tbody td:nth-child(2),   /* rank */
  .mkt thead th:nth-child(4), .mkt tbody td:nth-child(4),   /* price (noise on mobile) */
  .mkt thead th:nth-child(5), .mkt tbody td:nth-child(5),   /* 1h */
  .mkt thead th:nth-child(7), .mkt tbody td:nth-child(7),   /* mcap */
  .mkt thead th:nth-child(8), .mkt tbody td:nth-child(8),   /* volume */
  .mkt thead th:nth-child(9), .mkt tbody td:nth-child(9),   /* curve */
  .mkt thead th:nth-child(10), .mkt tbody td:nth-child(10), /* creator */
  .mkt thead th:nth-child(11), .mkt tbody td:nth-child(11)  /* sparkline */
    { display: none; }
  .mkt tbody td, .mkt thead th { padding: 12px 10px; }
  .mkt .coincell { gap: 9px; max-width: 62vw; }
  .mkt .coincell .av { width: 32px; height: 32px; }
  .mkt .coincell > div { min-width: 0; }
  .mkt .coincell .s, .mkt .coincell .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mkt td:last-child { width: 1%; }

  /* coin page metrics -> 3 tight columns instead of 3 tall stacked cards */
  .metric-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .metric { padding: 11px 10px; }
  .metric .n { font-size: 15px; }
  .metric .l { font-size: 10.5px; }
  .trade-head h1 { font-size: 24px; }
  .panel { padding: 18px; }

  /* bottom nav */
  .mobnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
    background: rgba(10,10,14,0.96); backdrop-filter: blur(12px); border-top: 1px solid var(--hair-2);
  }
  .mobnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 0 12px; color: var(--faint); font-size: 11px; font-weight: 600; text-decoration: none;
  }
  .mobnav a.active { color: var(--lime); }
  .mobnav svg { width: 21px; height: 21px; }
}
