:root {
  --bg: #ffffff;
  --card: #f7f8f8;
  --card-hover: #f1f3f3;
  --ink: #101418;
  --ink-2: #55606a;
  --ink-3: #8a949d;
  --line: #e8ebed;
  --green: #03ca96;
  --green-dark: #02a87d;
  --green-ink: #028765;
  --green-bg: #e5faf3;
  --red: #e0294a;
  --red-bg: #fdeaee;
  --navy: #072c21;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- top bar (white, Kalshi-style) ---------- */
.topbar { background: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 22px;
}
.logo { display: flex; align-items: center; flex: none; }
.logo img { height: 30px; border-radius: 7px; display: block; }
.topnav { display: flex; gap: 2px; }
.topnav a {
  padding: 7px 11px; border-radius: 8px; color: var(--ink); font-weight: 800;
  font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase;
}
.topnav a:hover { background: var(--card); }
.topnav a.active { color: var(--green-ink); }
.searchbox {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 99px; padding: 9px 16px;
}
.search-ic { color: var(--ink-3); font-size: 17px; line-height: 1; }
.searchbox input {
  border: none; background: none; outline: none; font: inherit; width: 100%;
  font-weight: 500; color: var(--ink);
}
.searchbox input::placeholder { color: var(--ink-3); }
.wallet { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.wallet-user { text-align: right; }
.wallet-name { display: block; color: var(--ink); font-weight: 700; font-size: 13px; }
.wallet-cash { display: block; color: var(--green-ink); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.btn-login {
  background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 700;
  font-size: 13.5px; padding: 9px 16px; border-radius: 99px; white-space: nowrap;
}
.btn-login:hover { border-color: #c9ced2; }
.btn-signup {
  background: var(--green); color: #04291e; border: none; font-weight: 800;
  font-size: 13.5px; padding: 10px 18px; border-radius: 99px; white-space: nowrap;
}
.btn-signup:hover { filter: brightness(1.06); }
.signout-btn {
  background: var(--card); color: var(--ink-3); border: none;
  font-size: 12px; font-weight: 700; padding: 8px 12px; border-radius: 99px; white-space: nowrap;
}
.signout-btn:hover { color: var(--ink); background: var(--line); }
.pro-badge {
  display: inline-block; background: linear-gradient(120deg, #f5c518, #f18f01);
  color: #3b2500; font-size: 9.5px; font-weight: 900; letter-spacing: .08em;
  padding: 2px 6px; border-radius: 5px; vertical-align: middle; transform: translateY(-1px);
}

/* ---------- ticker ---------- */
.ticker {
  background: var(--navy); color: #9fb8ac; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; padding: 6px 0; font-variant-numeric: tabular-nums;
}
.ticker-track { display: inline-block; padding-left: 100%; animation: tick 300s linear infinite; }
.ticker b { color: #fff; font-weight: 700; }
.ticker .up { color: var(--green); }
.ticker .down { color: #ff6b8a; }
.ticker span { margin-right: 34px; }
@keyframes tick { to { transform: translateX(-100%); } }

/* ---------- layout ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 18px 24px 80px; }
.tabs { display: flex; gap: 22px; padding: 4px 2px 14px; overflow-x: auto; }
.tab {
  background: none; border: none; color: var(--ink-3); font-weight: 700; font-size: 15px;
  padding: 2px 0; white-space: nowrap;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); font-weight: 800; }

.home-cols { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 1020px) { .home-cols { grid-template-columns: 1fr; } }

/* ---------- featured market ---------- */
.feat {
  background: var(--card); border-radius: var(--radius); padding: 26px 28px; display: block;
  margin-bottom: 22px;
}
.feat:hover { background: var(--card-hover); }
.feat-chip {
  display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 11.5px;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px;
}
.feat-icon {
  width: 30px; height: 30px; border-radius: 8px; background: var(--green-bg);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.feat h2 { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 16px; }
.feat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 760px) { .feat-cols { grid-template-columns: 1fr; } }
.feat-rows .fr-head { display: flex; color: var(--ink-3); font-size: 12px; font-weight: 700; padding-bottom: 8px; }
.fr { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.fr-name {
  flex: 1; font-weight: 700; font-size: 15px;
  border-bottom: 2px solid var(--green); padding-bottom: 2px; align-self: flex-start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: max-content;
}
.fr:nth-child(3) .fr-name { border-color: #4a90d9; }
.fr:nth-child(4) .fr-name { border-color: #f18f01; }
.fr:nth-child(5) .fr-name { border-color: #9b59b6; }
.fr-pay { color: var(--ink-2); font-weight: 600; font-size: 13.5px; width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.feat-foot { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; font-weight: 600; padding-top: 10px; }
.feat-news { color: var(--ink-2); font-size: 13.5px; margin-top: 14px; line-height: 1.55; }
.feat-news b { color: var(--ink); }
.feat-chart svg { width: 100%; height: 220px; display: block; }

/* ---------- tiles (no emojis) ---------- */
.ktile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; font-weight: 900; font-size: 10.5px;
  letter-spacing: .02em; flex: none;
}
.ktile.big { width: 54px; height: 54px; border-radius: 14px; font-size: 19px; }
.tile-skill { background: var(--green-bg); color: var(--green-ink); }
.tile-speed { background: #e6f0fd; color: #1b62c9; }
.tile-style { background: #f3e8fd; color: #7c3aed; }
.tile-prop { background: var(--navy); color: var(--green); }
.feat-chip .ktile { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }

/* ---------- interactive charts ---------- */
.chart-wrap { position: relative; }
.chart-wrap svg { cursor: crosshair; }
.chart-tip {
  position: absolute; top: 6px; background: var(--navy); color: #fff; font-size: 12px;
  font-weight: 700; padding: 5px 10px; border-radius: 8px; pointer-events: none;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chart-x {
  display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11.5px;
  font-weight: 600; padding-top: 6px; font-variant-numeric: tabular-nums;
}
.feat-chart .chart-x { display: none; }

/* odds pill (outlined, Kalshi-style) */
.kpill {
  border: 1.5px solid var(--green); background: #fff; color: var(--ink);
  font-weight: 800; font-size: 14px; padding: 7px 0; width: 74px; text-align: center;
  border-radius: 99px; font-variant-numeric: tabular-nums; flex: none;
}
.kpill:hover { background: var(--green); color: #04291e; }
.kpill.no { border-color: #d8b1bb; }
.kpill.no:hover { background: var(--red); border-color: var(--red); color: #fff; }
.kpill.sm { width: 64px; font-size: 13px; padding: 6px 0; }

/* ---------- sidebar ---------- */
.side-col { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.hub {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 14px; padding: 16px 18px; background: var(--card); cursor: pointer; border: none;
  text-align: left; width: 100%;
}
.hub:hover { filter: brightness(.98); }
.hub-title { font-weight: 800; font-size: 15px; }
.hub-sub { color: var(--ink-2); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.hub-arrow { color: var(--ink-3); font-size: 18px; font-weight: 700; }
.hub.g1 { background: linear-gradient(100deg, #e5faf3, #f7f8f8 60%); }
.hub.g2 { background: linear-gradient(100deg, #fdf3e5, #f7f8f8 60%); }
.hub.g3 { background: linear-gradient(100deg, #f3e8fd, #f7f8f8 60%); }
.side-card { background: var(--card); border-radius: 14px; padding: 16px 18px; }
.side-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.side-card h3 .hub-arrow { font-size: 15px; }
.trend-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trend-row:last-child { border-bottom: none; padding-bottom: 2px; }
.trend-main { flex: 1; min-width: 0; }
.trend-q { font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.trend-sub { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-top: 1px; }
.trend-val { text-align: right; flex: none; }
.trend-val b { font-size: 14.5px; }
.trend-val small { display: block; font-size: 11.5px; font-weight: 800; }
.trend-val .up { color: var(--green-ink); }
.trend-val .down { color: var(--red); }
.lb-mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.lb-mini-row:last-child { border-bottom: none; }
.lb-mini-rank { width: 22px; color: var(--ink-3); }
.lb-mini-net { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- sections + market cards ---------- */
.section-h { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 26px 0 14px; }
.section-h .hub-arrow { color: var(--green-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.kcard {
  background: var(--card); border-radius: var(--radius); padding: 18px 18px 14px;
  display: flex; flex-direction: column; min-height: 210px;
}
.kcard:hover { background: var(--card-hover); }
.kcard-chip { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.kcard-icon { width: 26px; height: 26px; border-radius: 7px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.kcard-q { font-weight: 800; font-size: 15.5px; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 12px; }
.krow { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.krow-name { flex: 1; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1.5px dashed #c9ced2; padding-bottom: 1px; max-width: max-content; }
.krow-pay { color: var(--ink-2); font-weight: 600; font-size: 12.5px; width: 46px; text-align: right; font-variant-numeric: tabular-nums; margin-left: auto; }
.kcard-foot { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; font-weight: 600; border-top: 1px solid var(--line); margin-top: auto; padding-top: 10px; }
.kcard-more { color: var(--ink-3); font-size: 12px; font-weight: 600; padding: 4px 0; }
.kcard-binary { display: flex; gap: 10px; padding: 6px 0 10px; }
.kcard-binary .kpill { flex: 1; width: auto; }

/* ---------- market page ---------- */
.crumb { color: var(--ink-3); font-size: 13px; font-weight: 700; margin-bottom: 14px; display: inline-block; }
.crumb:hover { color: var(--ink); }
.mkt-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 6px; }
.mkt-icon {
  width: 54px; height: 54px; border-radius: 14px; flex: none; font-size: 26px;
  display: flex; align-items: center; justify-content: center; background: var(--card);
}
.mkt-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.mkt-meta { color: var(--ink-3); font-size: 13px; font-weight: 600; margin-top: 5px; display: flex; gap: 16px; flex-wrap: wrap; }
.mkt-blurb { color: var(--ink-2); font-size: 14px; max-width: 760px; margin: 10px 0 20px; }
.mkt-cols { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .mkt-cols { grid-template-columns: 1fr; } }

.panel { background: var(--card); border-radius: var(--radius); }
.chart-panel { padding: 18px; margin-bottom: 16px; }
.chart-panel .chart-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-panel .chart-top b { font-size: 26px; letter-spacing: -.02em; }
.chart-panel .chart-top .delta { font-weight: 700; font-size: 13px; }
.chart-legend { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.delta.up { color: var(--green-ink); } .delta.down { color: var(--red); }
svg.chart { width: 100%; height: 180px; display: block; }

.outcome-list { overflow: hidden; }
.outcome-list .ol-head {
  display: flex; padding: 12px 18px; color: var(--ink-3); font-size: 11.5px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line);
}
.o-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.o-row:last-child { border-bottom: none; }
.o-row.dead { opacity: .45; }
.o-main { flex: 1; min-width: 0; }
.o-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.o-name a { border-bottom: 1.5px dashed #c9ced2; }
.o-name a:hover { color: var(--green-ink); border-color: var(--green); }
.tier {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 5px;
}
.tier-titan { background: #10141814; color: #101418; }
.tier-up { background: #e6f0fd; color: #1b62c9; }
.tier-hidden { background: #f3e8fd; color: #7c3aed; }
.tier-status { background: var(--red-bg); color: var(--red); }
.o-social { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-top: 2px; }
.o-social b { color: var(--ink-2); }
.o-social a:hover { color: var(--green-ink); }
.o-note { color: var(--ink-2); font-size: 12.5px; margin-top: 5px; max-width: 620px; display: none; }
.o-row.open .o-note { display: block; }
.o-toggle { background: none; border: none; color: var(--ink-3); font-size: 11px; font-weight: 700; padding: 2px 0; }
.o-toggle:hover { color: var(--ink); }
.o-price { font-weight: 800; font-size: 15px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.o-btns { display: flex; gap: 8px; }

.side { position: sticky; top: 76px; }
.side .panel { padding: 16px 18px; margin-bottom: 14px; }
.side h3 { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 10px; }
.rules p { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.stat-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 5px 0; font-weight: 600; }
.stat-row span:first-child { color: var(--ink-3); }

/* ---------- order panel ---------- */
.order-overlay {
  position: fixed; inset: 0; background: rgba(7, 44, 33, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.order-overlay[hidden], .toast[hidden] { display: none; }
.order-panel {
  background: #fff; border-radius: 18px; width: 100%; max-width: 380px;
  padding: 22px; box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.op-title { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.op-sub { color: var(--ink-3); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.op-side-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.op-side-tabs button {
  flex: 1; padding: 10px; border-radius: 99px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; color: var(--ink-3);
}
.op-side-tabs button.sel-yes { border-color: var(--green); background: var(--green-bg); color: var(--green-ink); }
.op-side-tabs button.sel-no { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.op-qty { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.op-qty button {
  width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--line); background: #fff;
  font-size: 19px; font-weight: 700; color: var(--ink-2);
}
.op-qty input {
  flex: 1; text-align: center; font: inherit; font-weight: 800; font-size: 19px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-variant-numeric: tabular-nums;
}
.op-lines { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 14px; }
.op-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; font-weight: 600; }
.op-line span:first-child { color: var(--ink-3); }
.op-line.payout b { color: var(--green-ink); }
.op-submit {
  width: 100%; padding: 13px; border: none; border-radius: 99px;
  font-weight: 800; font-size: 15px; color: #04291e; background: var(--green);
}
.op-submit.no { background: var(--red); color: #fff; }
.op-submit:hover { filter: brightness(1.06); }
.op-cancel { width: 100%; background: none; border: none; color: var(--ink-3); font-weight: 600; margin-top: 10px; }
.username-input {
  width: 100%; font: inherit; font-weight: 700; font-size: 16px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 10px; margin: 6px 0 4px;
}
.username-input:focus { outline: none; border-color: var(--green); }
.username-err { color: var(--red); font-size: 12.5px; font-weight: 600; min-height: 18px; margin-bottom: 8px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 22px; border-radius: 99px; box-shadow: 0 12px 32px rgba(0,0,0,.28); z-index: 200;
  border: 1px solid rgba(3,202,150,.4); max-width: 90vw; text-align: center;
}

/* ---------- portfolio / leaderboard / about ---------- */
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 16px; }
.pos-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.pos-row:last-child { border-bottom: none; }
.pos-main { flex: 1; min-width: 0; }
.pos-title { font-weight: 700; font-size: 14px; }
.pos-sub { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.pos-val { text-align: right; font-variant-numeric: tabular-nums; }
.pos-val b { font-size: 15px; }
.pos-val small { display: block; font-size: 12px; font-weight: 700; }
.empty { text-align: center; color: var(--ink-2); padding: 48px 20px; font-weight: 600; }
.lb-rank { width: 34px; text-align: center; font-weight: 800; font-size: 15px; color: var(--ink-2); flex: none; }
.me-row { background: var(--green-bg); }
.pro-cta { color: var(--green-ink); font-weight: 800; }
.pro-panel { padding: 16px 18px; margin-top: 14px; font-size: 14px; color: var(--ink-2); }
.pos-note { color: var(--ink-3); font-size: 12.5px; font-weight: 600; padding: 10px 4px 0; }
.about { max-width: 720px; }
.about .panel { padding: 26px; }
.about h2 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.about h2:first-child { margin-top: 0; }
.about p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 10px; }
.about a { color: var(--green-ink); font-weight: 700; }

.footer {
  max-width: 1280px; margin: 0 auto; padding: 26px 24px 44px; color: var(--ink-3);
  font-size: 12.5px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px;
}
.footer-logo { height: 22px; border-radius: 5px; width: fit-content; opacity: .85; }
.footer .foot { margin-top: 18px; font-size: 13px; opacity: .55; letter-spacing: .03em; }
.footer .foot a:hover { text-decoration: underline; }

.pool-banner {
  display: flex; align-items: center; gap: 22px; margin-bottom: 14px;
  background: linear-gradient(100deg, #072c21, #0d5138); color: #fff;
  border-radius: var(--radius); padding: 18px 22px;
}
.pool-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9fb8ac; }
.pool-amt { font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: var(--green); font-variant-numeric: tabular-nums; }
.pool-note { color: #b9d6c8; font-size: 12.5px; font-weight: 500; max-width: 520px; line-height: 1.5; }
@media (max-width: 640px) { .pool-banner { flex-direction: column; align-items: flex-start; gap: 8px; } }

@media (max-width: 820px) {
  .searchbox { display: none; }
  .nav-inner { gap: 12px; padding: 10px 14px; }
  .topnav a { padding: 6px 7px; font-size: 11.5px; }
  main { padding: 14px 14px 60px; }
  .feat { padding: 20px; }
  .feat h2 { font-size: 20px; }
}
