/* Prosper Rank — Prosper's own kit: ink black, mint green, gold-leaf numbers, cream text.
   Layout: one 1180px column; sticky slim header; hero (copy + search); stat strip; panels.
   Kept light on purpose: no backdrop blur, no noise filter, no images, one slow decorative SVG. */
:root {
  --bg: #010101;
  --surface: #0a0d0b;
  --surface-2: #0f1411;
  --line: rgba(0, 172, 114, 0.2);
  --line-strong: rgba(0, 172, 114, 0.5);
  --ink: #f7f1e3;
  --muted: #9aa79f;
  --mint: #00ac72;
  --mint-soft: rgba(0, 172, 114, 0.1);
  --gold: #e2bf78;
  --gold-grad: linear-gradient(180deg, #fff3d0 0%, #e9c982 40%, #c39a52 68%, #8a6230 100%);
  --silver: #d7d6cc;
  --bronze: #c98a58;
  --danger: #ef7a66;

  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 85% -120px, rgba(0, 172, 114, 0.13), transparent 70%),
    radial-gradient(700px 400px at 0% 0%, rgba(195, 154, 82, 0.07), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 400 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--mint); }
a:hover { color: #3ad39c; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

main { min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .empty { color: var(--muted); }
.gold { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.addr { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

h1, h2, h3, h4, h5 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.1; text-wrap: balance; }

/* Cormorant defaults to old-style figures; numbers here read as data, so line them up */
h1, h2, h3, h4, h5, .rank-num, .rules b, .search-pool strong, .season-million, .season-track-pool strong,
.round-card-id, .rank-badge, .brand-name {
  font-variant-numeric: lining-nums tabular-nums;
}

.eyebrow, .brand-kicker, .stats span, .search-card label, .search-pool > span, th,
.round-card-status, .season-badge, .season-track-num {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow { margin: 0 0 12px; color: var(--mint); }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(1, 1, 1, 0.92);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a1a14, #010101 70%);
  border: 1px solid rgba(195, 154, 82, 0.55);
  font: 600 26px/1 var(--display);
}
.brand-mark { color: #e9c982; }
.brand-text { display: flex; flex-direction: column; }
.brand-kicker { color: var(--muted); font-size: 10.5px; }
.brand-name { font: 600 24px/1.1 var(--display); }

.top-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.pill, .ghost, .round-picker {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}
.pill { color: var(--mint); font-variant-numeric: tabular-nums; }
.pill.countdown { color: var(--ink); border-color: rgba(195, 154, 82, 0.45); }
.pill.is-ended { color: var(--gold); }
.pill.is-upcoming { color: var(--muted); }
.pill.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }
.ghost { color: var(--ink); text-decoration: none; }
.ghost:hover { border-color: var(--line-strong); color: var(--ink); }

.round-picker { color: var(--muted); }
.round-picker select {
  appearance: none; border: 0; background: transparent;
  color: var(--ink); font: inherit; cursor: pointer; padding-right: 14px;
  background-image: linear-gradient(45deg, transparent 50%, var(--mint) 50%), linear-gradient(135deg, var(--mint) 50%, transparent 50%);
  background-position: right 4px center, right 0 center;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.round-picker select option { background: var(--surface); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  padding-block: 56px 36px;
}
.orb {
  position: absolute; right: -60px; top: -10px;
  width: 520px; height: 520px;
  color: var(--mint); opacity: 0.16;
  pointer-events: none; z-index: 0;
  animation: spin 160s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero > *:not(.orb) { position: relative; z-index: 1; }

.hero-copy h2 { font-size: clamp(40px, 5.4vw, 64px); letter-spacing: -0.015em; margin-bottom: 16px; }
.lead { margin: 0 0 24px; max-width: 54ch; color: #cfd6cf; font-size: 16px; }

.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.rules li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.rules b { font: 600 30px/1 var(--display); color: var(--gold); min-width: 2.2ch; text-align: center; }
.rules span { font-size: 12.5px; line-height: 1.35; color: var(--muted); }

.hero-round-hint {
  margin: 18px 0 0; padding: 10px 14px;
  border-left: 2px solid var(--mint);
  background: var(--mint-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px; color: #cfd6cf; max-width: 60ch;
}
.hero-round-hint:empty { display: none; }

.search-card {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 20, 17, 0.96), rgba(8, 11, 9, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.search-card label { display: block; margin-bottom: 10px; color: var(--mint); }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: 500 14px var(--mono);
}
.search-row input::placeholder { color: #56635b; }
.search-row input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }

button { font: inherit; cursor: pointer; }
.search-row button {
  height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius);
  background: var(--mint); color: #00150d; font-weight: 600;
  transition: background 0.15s ease;
}
.search-row button:hover { background: #12c487; }
.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.hint .addr { font-size: 11.5px; }

.search-pool {
  display: grid; gap: 6px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.search-pool > span:first-child { color: var(--muted); }
.search-pool strong { font: 600 40px/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 6px; background: var(--surface-2); }
.split-85 { width: 85%; background: var(--gold-grad); }
.split-15 { width: 15%; background: var(--mint); margin-left: 2px; }
.split-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.split-legend em { font-style: normal; }

/* ---------- stat strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stats article { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.stats article:first-child { border-left: 0; }
.stats span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10.5px; }
.stats strong { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- panels ---------- */
.panel {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  scroll-margin-top: 92px;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h3 { font-size: 30px; margin-bottom: 4px; }
.panel-head .muted { margin: 0; font-size: 13px; }
.board-note, .round-schedule-next { margin: 0; max-width: 52ch; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: right; }
.round-schedule-next .accent { color: var(--mint); font-weight: 600; }

/* ---------- rounds ---------- */
.round-schedule-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.round-card {
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0; padding: 16px;
  text-align: left; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.round-card:hover { border-color: var(--line-strong); }
.round-card--selected { border-color: var(--mint); background: linear-gradient(180deg, rgba(0, 172, 114, 0.1), var(--surface-2) 70%); }
.round-card--ended { opacity: 0.7; }
.round-card--settlement .round-card-status { color: var(--gold); }
.round-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.round-card-id { font: 600 24px/1 var(--display); }
.round-card-status { font-size: 10px; color: var(--muted); }
.round-card--live .round-card-status { color: var(--mint); }
.round-card--upcoming .round-card-status { color: var(--gold); }
.round-card-dates { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.round-card-dates em { display: inline-block; min-width: 3.4em; font-style: normal; color: var(--ink); }
.round-card-bar { height: 4px; border-radius: 2px; background: rgba(247, 241, 227, 0.08); overflow: hidden; }
.round-card-bar i { display: block; height: 100%; background: var(--mint); border-radius: 2px; }
.round-card--ended .round-card-bar i,
.round-card--settlement .round-card-bar i { background: var(--muted); }

/* ---------- season ---------- */
.season-hero h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 12px; }
.season-million { font-size: clamp(48px, 7vw, 76px); letter-spacing: -0.02em; }
.season-million-unit { font: 600 clamp(24px, 3.4vw, 34px) var(--display); color: var(--mint); }
.season-lead { margin: 0; max-width: 64ch; color: var(--muted); font-size: 14px; }
.season-lead strong { color: var(--ink); }

.season-tracks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.season-track {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0; padding: 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.season-track--active { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(0, 172, 114, 0.09), var(--surface-2) 60%); }
.season-track--soon { opacity: 0.78; }
.season-track-num { color: var(--mint); }
.season-track h4 { font-size: 22px; }
.season-track-pool { margin: 0; font-size: 13px; color: var(--muted); }
.season-track-pool strong { font: 600 34px/1 var(--display); margin-right: 4px; }
.season-track ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.season-track li + li { margin-top: 4px; }
.season-track li strong { color: var(--ink); font-weight: 600; }
.season-badge {
  align-self: flex-start;
  padding: 5px 10px; font-size: 10px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--mint);
}
.season-badge--live { border-color: rgba(195, 154, 82, 0.5); color: var(--gold); }
.season-badge--soon { border-color: var(--line); color: var(--muted); }

details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; float: right; color: var(--mint); font: 400 20px/1 var(--body); }
details[open] > summary::after { content: "−"; }

.season-faq { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.season-faq summary { font: 600 20px var(--display); }
.season-faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding-top: 16px; }
.season-faq h5 { font-size: 18px; margin-bottom: 6px; }
.season-faq p { margin: 0; font-size: 13px; color: var(--muted); }
.season-faq strong, .season-faq em { color: var(--ink); }

/* ---------- tables ---------- */
.tier-breakdown {
  margin-bottom: 16px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.tier-breakdown summary { font-size: 14px; font-weight: 600; }
.tier-breakdown-body { margin-top: 12px; font-size: 13px; }
.tier-foot { margin: 12px 0 0; font-size: 12px; max-width: 80ch; }

.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.tier-breakdown .table-wrap { border: 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid rgba(0, 172, 114, 0.1); font-size: 14px; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #0c110e; color: var(--muted); font-size: 10.5px; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--line); border-bottom: 0; }

.rank-table { width: max-content; min-width: 720px; }
.rank-table tbody tr { cursor: pointer; transition: background 0.12s ease; }
.rank-table tbody tr:not(.skeleton-row):hover td { background: rgba(0, 172, 114, 0.05); }
tr.active td { background: rgba(0, 172, 114, 0.12) !important; }

.rank-num { width: 64px; font: 600 14px/1 var(--body); color: var(--muted); }
.rank-num b {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  font: inherit; color: #1b1406;
}
tr.rank-gold .rank-num b { background: var(--gold-grad); }
tr.rank-silver .rank-num b { background: linear-gradient(180deg, #ffffff, #b9b8ad); }
tr.rank-bronze .rank-num b { background: linear-gradient(180deg, #f1c49f, #a86a3c); }
tr.rank-gold td, tr.rank-silver td, tr.rank-bronze td { background: rgba(195, 154, 82, 0.04); }

.vol { display: grid; gap: 5px; min-width: 150px; }
.vol-bar { height: 3px; border-radius: 2px; background: rgba(247, 241, 227, 0.07); overflow: hidden; }
.vol-bar i { display: block; height: 100%; background: var(--mint); border-radius: 2px; }

.reward-cell strong { font-weight: 600; }
.reward-cell .reward-pending { color: var(--gold); }
.reward-hint { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); white-space: normal; max-width: 16rem; }

.linkish {
  height: auto; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--mint); font-size: 12.5px;
}
.linkish:hover { border-color: var(--line-strong); background: var(--mint-soft); }

.skeleton-row td span {
  display: block; height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(154, 167, 159, 0.1), rgba(154, 167, 159, 0.22), rgba(154, 167, 159, 0.1));
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
.skeleton-row td:nth-child(2) span { width: 70%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.board-pool { margin-top: 0; }
.board-referral { margin-top: 0; }

/* ---------- wallet result ---------- */
.wallet-result {
  margin-bottom: 28px; padding: 24px;
  border: 1px solid var(--line-strong); border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 172, 114, 0.07), var(--surface) 40%);
  scroll-margin-top: 90px;
}
.wallet-result h3 { font-size: 24px; }
.wallet-result > p { margin: 0; }
.wallet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.wallet-top > div:first-child { min-width: 0; }
.wallet-top p { margin: 4px 0; }
.wallet-top h3.addr { font-size: 15px; margin: 2px 0 6px; }
.rank-badge {
  min-width: 84px; height: 84px; padding: 0 14px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%;
  font: 600 32px/1 var(--display);
}
.rank-badge.gold { color: #1b1406; background: var(--gold-grad); border: 0; }
.rank-badge.silver { color: #1b1406; background: linear-gradient(180deg, #ffffff, #b9b8ad); border: 0; }
.rank-badge.bronze { color: #1b1406; background: linear-gradient(180deg, #f1c49f, #a86a3c); border: 0; }
.rank-badge.out { color: var(--danger); border-color: rgba(239, 122, 102, 0.5); }

.wallet-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.wallet-metrics div, .asset {
  min-width: 0; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.wallet-metrics span, .asset span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.wallet-metrics strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.asset { display: flex; gap: 12px; align-items: center; }
.asset img { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); flex: none; }
.asset strong { display: block; }

.pnl-block { margin-top: 22px; }
.pnl-head h3 { margin-bottom: 6px; }
.pnl-note { margin: 0 0 12px; font-size: 12px; max-width: 80ch; }
.pnl-totals { margin-bottom: 12px; }
.pnl-table td { vertical-align: top; }
.pnl-table .block { display: block; margin-top: 2px; font-size: 12px; }
.pnl-up { color: var(--mint); }
.pnl-down { color: var(--danger); }

/* ---------- footer ---------- */
footer {
  display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  padding-block: 24px 40px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .season-tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .round-schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats article:nth-child(4) { border-left: 0; }
  .stats article:nth-child(n + 4) { border-top: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 36px 28px; }
  .orb { width: 360px; height: 360px; right: -120px; top: -40px; }
  .topbar-in { flex-wrap: wrap; }
  .top-meta { justify-content: flex-start; }
  .board-note, .round-schedule-next { text-align: left; }
  .season-faq-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .ghost, .pill.live { display: none; }
  .brand-kicker { display: none; }
  .topbar-in { gap: 10px; padding-block: 10px; }
  .brand-mark { width: 34px; height: 34px; font-size: 22px; }
  .brand-name { font-size: 21px; }
  .top-meta { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .pill, .round-picker { height: 32px; padding: 0 10px; font-size: 12px; }
  .round-picker > span { display: none; }
  .round-picker { flex: 1; min-width: 0; }
  .round-picker select { width: 100%; }
  .search-pool strong { font-size: 34px; }
  .panel, .search-card, .wallet-result { padding: 18px; }
  .panel-head h3 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats article { border-left: 0; border-top: 1px solid var(--line); }
  .stats article:nth-child(even) { border-left: 1px solid var(--line); }
  .stats article:first-child, .stats article:nth-child(2) { border-top: 0; }
  .stats article:last-child { grid-column: 1 / -1; border-left: 0; }
  .season-tracks, .round-schedule-grid, .wallet-metrics, .asset-grid { grid-template-columns: minmax(0, 1fr); }
  .rules li { flex: 1 1 100%; }
  th, td { padding: 10px; }
  .vol { min-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
