/* Once Upon a Card — "Bright playground" design system
   White canvas, teal/coral/sunny-yellow accents, confetti sparkles,
   rounded cards, friendly modern sans. Light and airy, never dark. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7fafc;
  --ink: #1c1c3c;            /* deep navy for headlines */
  --ink-soft: #4a5568;       /* body text */
  --ink-faint: #8a94a6;
  --teal: #2fb5a8;
  --teal-deep: #1e8f85;
  --teal-tint: #e3f6f4;
  --coral: #f4737f;
  --coral-deep: #d95562;
  --coral-tint: #fdecee;
  --sun: #ffc53d;
  --sun-deep: #e0a400;
  --sun-tint: #fff6dd;
  --green: #22a06b;
  --green-tint: #e4f6ec;
  --red: #e05252;
  --red-tint: #fdeaea;
  --purple: #8b7cf6;
  --purple-tint: #efeaff;
  --card: #ffffff;
  --line: #edf0f5;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(28, 28, 60, 0.08);
  --shadow-sm: 0 3px 12px rgba(28, 28, 60, 0.07);
  --font: "Nunito", "Segoe UI Rounded", ui-rounded, system-ui, -apple-system,
          "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-soft);
  background: var(--bg);
  line-height: 1.55;
  /* confetti sprinkle field */
  background-image:
    radial-gradient(circle, var(--coral) 2.2px, transparent 2.6px),
    radial-gradient(circle, var(--teal) 2.2px, transparent 2.6px),
    radial-gradient(circle, var(--sun) 2.6px, transparent 3px);
  background-size: 340px 340px, 460px 460px, 560px 560px;
  background-position: 12px 40px, 180px 220px, 60px 420px;
  background-repeat: repeat;
}
body::before { /* keep confetti whisper-quiet behind content */
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: rgba(255,255,255,0.72);
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: 1.7rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 1em; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; position: relative; }

/* ---------- header ---------- */
.site-header {
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900;
         font-size: 1.25rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; }
.beta-pill {
  font-size: 0.7rem; font-weight: 800; color: var(--coral-deep);
  background: var(--coral-tint); border-radius: 999px; padding: 3px 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink); font-weight: 700; padding: 8px 16px; border-radius: 999px;
}
.nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav a.active { background: var(--teal-tint); color: var(--teal-deep); }
.btn {
  display: inline-block; font-weight: 800; border-radius: 999px;
  padding: 10px 22px; border: 0; cursor: pointer;
}
.btn-coral { background: var(--coral); color: #fff; box-shadow: var(--shadow-sm); }
.btn-coral:hover { background: var(--coral-deep); text-decoration: none; color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-deep); text-decoration: none; color: #fff; }
.btn-ghost { background: var(--bg-soft); color: var(--ink); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 24px 8px; position: relative; }
.hero .kicker {
  display: inline-block; font-weight: 800; font-size: 0.85rem;
  color: var(--teal-deep); background: var(--teal-tint);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero .sub { font-size: 1.25rem; color: var(--ink-soft); max-width: 640px; margin: 0 auto 26px; }
.stat-pills { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
/* ---------- story-led hero card ---------- */
.story-card {
  display: block; max-width: 640px; margin: 0 auto 26px; text-align: left;
  background: #fff; border: 2px solid var(--sun); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.story-kicker { display: inline-block; font-size: 0.78rem; font-weight: 800; color: var(--sun-deep);
  background: var(--sun-tint); padding: 4px 12px; border-radius: 999px; margin-bottom: 10px; }
.story-card strong { display: block; font-size: 1.5rem; color: var(--ink); margin-bottom: 6px; }
.story-body { display: block; color: var(--ink-soft); margin-bottom: 8px; }
.story-link { font-weight: 800; color: var(--teal-deep); }
/* ---------- just-sold ticker ---------- */
.ticker-band { background: var(--ink); margin: 0 0 8px; overflow: hidden; }
.ticker-track { display: flex; gap: 28px; align-items: center; padding: 12px 24px;
  overflow-x: auto; white-space: nowrap; }
.ticker-label { font-weight: 900; color: #fff; flex-shrink: 0; }
.ticker-item { color: #dfe6f2; font-size: 0.92rem; flex-shrink: 0; }
.ticker-item em { color: var(--sun); font-style: normal; font-weight: 700; }
.ticker-item strong { color: #fff; }
.ticker-ago { color: #8a94a6; font-size: 0.8rem; }
/* ---------- featured battle ---------- */
.battle-section { padding-bottom: 8px; }
.battle-card {
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
  background: linear-gradient(120deg, var(--teal-tint) 0%, #ffffff 42%, #ffffff 58%, var(--coral-tint) 100%);
  border: 2px solid var(--line); position: relative;
}
.battle-head { text-align: center; margin-bottom: 20px; }
.battle-kicker {
  display: inline-block; font-weight: 900; font-size: 1.05rem; color: var(--ink);
  background: #fff; border-radius: 999px; padding: 6px 22px; box-shadow: var(--shadow-sm);
}
.battle-cohort { font-size: 0.85rem; color: var(--ink-soft); margin: 10px 0 0; }
.battle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; position: relative; }
.battle-side {
  display: flex; gap: 20px; align-items: center; color: inherit;
  background: rgba(255,255,255,0.88); border-radius: var(--radius-sm);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.battle-side:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s ease; }
.battle-slab {
  width: 118px; flex-shrink: 0; border-radius: 12px; overflow: hidden; text-align: center;
  background: #fff; border: 3px solid var(--ink); box-shadow: var(--shadow-sm);
}
.slab-label {
  display: block; font-size: 0.58rem; font-weight: 900; color: #fff; background: var(--ink);
  padding: 5px 6px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.4;
}
.slab-art {
  display: flex; align-items: center; justify-content: center; height: 92px;
  font-size: 2.8rem; font-weight: 900; color: #fff;
}
.battle-side.teal .slab-art { background: linear-gradient(135deg, var(--teal), #7adcd2); }
.battle-side.coral .slab-art { background: linear-gradient(135deg, var(--coral), #f7a8b0); }
.slab-name { display: block; font-weight: 900; color: var(--ink); padding: 8px 6px; font-size: 0.88rem; }
.battle-stats { display: flex; flex-direction: column; gap: 6px; }
.battle-vol { font-size: 1.55rem; font-weight: 900; color: var(--teal-deep); font-variant-numeric: tabular-nums; }
.battle-vol span { display: block; font-size: 0.7rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.battle-med { font-size: 0.95rem; color: var(--ink-soft); }
.battle-med strong { color: var(--ink); }
.battle-trend { font-weight: 900; font-size: 1.05rem; }
.battle-trend.up { color: var(--green); }
.battle-trend.down { color: var(--red); }
.vs-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg);
  background: var(--ink); color: #fff; font-weight: 900; font-size: 1.25rem;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid #fff; box-shadow: var(--shadow); z-index: 2;
}
.battle-note { text-align: center; margin: 18px 0 0; }
.stat-pill {
  font-weight: 800; padding: 10px 20px; border-radius: 999px; border: 2px solid;
  background: #fff;
}
.stat-pill.teal { color: var(--teal-deep); border-color: var(--teal); }
.stat-pill.coral { color: var(--coral-deep); border-color: var(--coral); }
.stat-pill.sun { color: var(--sun-deep); border-color: var(--sun); }

/* ---------- cards & grids ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; position: relative;
}
.card h2 { display: flex; align-items: center; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.section { padding: 28px 0; position: relative; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.view-all { font-weight: 800; white-space: nowrap; }

/* ---------- leaderboard ---------- */
.leader-row {
  display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 14px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid var(--line);
}
.leader-row:last-child { border-bottom: 0; }
.rank {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 900; color: var(--ink);
  background: var(--bg-soft); font-size: 0.95rem;
}
.rank.r1 { background: var(--sun); color: #5c4300; }
.rank.r2 { background: #e8edf3; }
.rank.r3 { background: #f3e2c7; }
.char-name { font-weight: 800; color: var(--ink); }
.char-sub { font-size: 0.82rem; color: var(--ink-faint); }
.leader-stats { display: flex; gap: 22px; align-items: center; }
.lstat { display: flex; flex-direction: column; align-items: flex-end; }
.lstat-v { font-weight: 900; font-size: 1.02rem; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.lstat-v.lstat-gmv { color: var(--teal-deep); font-size: 1.15rem; }
.lstat-l { font-size: 0.68rem; font-weight: 800; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.05em; }
.mover { font-weight: 800; }
.mover.up { color: var(--green); }
.mover.down { color: var(--red); }
.lstat.mover svg { display: block; margin-top: 4px; }
.data-note { font-size: 0.85rem; color: var(--ink-faint); margin-top: 14px; }

/* ---------- mover tiles ---------- */
.mover-tile { border-radius: var(--radius); padding: 22px; color: var(--ink); box-shadow: var(--shadow-sm); }
.mover-tile.hot { background: #ffdfe3; }
.mover-tile.new { background: #cdeeed; }
.mover-tile.drop { background: #ffefc2; }
.mover-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.08em;
  background: rgba(255,255,255,0.75); border-radius: 999px; padding: 3px 12px; margin-bottom: 10px;
}
.mover-tile h3 { font-size: 1.05rem; margin-bottom: 2px; }
.mover-price { font-size: 1.7rem; font-weight: 900; }
.mover-delta { font-weight: 800; }
.mover-delta.up { color: var(--green); } .mover-delta.down { color: var(--red); }
.mover-vol { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- best buys ---------- */
.buys-band { background: var(--sun-tint); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.buys-band h2 { text-align: center; }
.buy-card {
  background: #fff; border-radius: var(--radius-sm); padding: 18px;
  border: 2px solid var(--line); box-shadow: var(--shadow-sm);
}
.buy-card h3 { font-size: 1.02rem; margin-bottom: 4px; }
.buy-line { font-size: 0.92rem; }
.buy-badge {
  display: inline-block; margin-top: 8px; font-size: 0.8rem; font-weight: 800;
  background: var(--green-tint); color: var(--green); border-radius: 999px; padding: 3px 12px;
}
.gate-note { text-align: center; margin-top: 16px; font-size: 0.92rem; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th {
  text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); padding: 10px 12px; border-bottom: 2px solid var(--line);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; }
td .grade-raw { font-weight: 800; color: var(--teal-deep); }
.ladder-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 120px; }
.ladder-bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--sun)); }
/* ---------- grade ladder bars (homepage spotlight) ---------- */
.ladder { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 6px; }
.ladder-row { display: grid; grid-template-columns: 78px 1fr auto auto; gap: 12px; align-items: center; }
.ladder-grade { font-weight: 900; color: var(--ink); font-size: 0.95rem; }
.ladder-grade.raw { color: var(--teal-deep); }
.ladder-track { height: 16px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ladder-track i { display: block; height: 100%; border-radius: 999px; }
.ladder-row:nth-child(1) .ladder-track i { background: linear-gradient(90deg, var(--teal), #7adcd2); }
.ladder-row:nth-child(2) .ladder-track i { background: linear-gradient(90deg, var(--purple), #b3a8fa); }
.ladder-row:nth-child(3) .ladder-track i { background: linear-gradient(90deg, var(--coral), #f7a8b0); }
.ladder-row:nth-child(4) .ladder-track i { background: linear-gradient(90deg, var(--sun), var(--coral)); }
.ladder-val { font-weight: 900; color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ladder-n { font-size: 0.82rem; color: var(--ink-faint); white-space: nowrap; }

/* ---------- chart ---------- */
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; font-size: 0.85rem; color: var(--ink-faint); margin-top: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }

/* ---------- tools ---------- */
.tool-card { text-align: center; padding: 28px 20px; }
.tool-emoji { font-size: 2.2rem; }
.tool-card h3 { margin: 10px 0 6px; }
.tool-card p { font-size: 0.92rem; }
.soon { display: inline-block; font-size: 0.72rem; font-weight: 800; color: var(--sun-deep);
  background: var(--sun-tint); border-radius: 999px; padding: 3px 12px; text-transform: uppercase; }

/* ---------- rollup / article ---------- */
.rollup-teaser { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: 2.2rem; }
.article .byline { color: var(--ink-faint); font-size: 0.92rem; margin-bottom: 24px; }
.article h2 { margin-top: 2em; }
.article table.data { margin: 1em 0 1.5em; }
.callout {
  border-radius: var(--radius-sm); padding: 18px 22px; margin: 1.5em 0;
  background: var(--teal-tint); border-left: 6px solid var(--teal);
}
.callout.sun { background: var(--sun-tint); border-left-color: var(--sun); }
.callout.coral { background: var(--coral-tint); border-left-color: var(--coral); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 800; color: var(--ink); cursor: pointer; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px;
  background: rgba(255,255,255,0.9); position: relative; }
.site-footer .wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.site-footer .links { display: flex; gap: 20px; margin-left: auto; }
.site-footer small { color: var(--ink-faint); }

.asof {
  display: inline-block; font-size: 0.8rem; font-weight: 700; color: var(--ink-faint);
  background: var(--bg-soft); border-radius: 999px; padding: 4px 14px;
}

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { display: none; }
  h1 { font-size: 2rem; }
  /* leaderboard: stats stack below the name row */
  .leader-row { grid-template-columns: 34px 1fr; }
  .leader-stats {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 4px;
  }
  .lstat { align-items: flex-start; background: var(--bg-soft);
    border-radius: var(--radius-sm); padding: 8px 12px; }
  .lstat.mover { grid-column: span 2; flex-direction: row; align-items: center; gap: 10px; }
  .lstat.mover svg { margin-top: 0; width: 90px; height: auto; }
  /* battle: stack the two sides */
  .battle-grid { grid-template-columns: 1fr; }
  .vs-badge { width: 52px; height: 52px; font-size: 1rem; }
  .battle-side { gap: 16px; }
  .battle-slab { width: 96px; }
  .slab-art { height: 76px; font-size: 2.2rem; }
}
@media (max-width: 480px) {
  .ladder-n { display: none; }
  .ladder-row { grid-template-columns: 70px 1fr auto; }
}
