:root {
  --night: #0b1913;
  --pine: #10291f;
  --pine-2: #173a2c;
  --line: rgba(245, 239, 226, 0.12);
  --line-2: rgba(245, 239, 226, 0.22);
  --cream: #f5efe2;
  --muted: #a3b5aa;
  --dim: #6f8578;
  --gold: #e6b85c;
  --gold-2: #f3d58f;
  --red: #e0584f;
  --green: #5ccf93;
  --card: rgba(255, 255, 255, 0.035);
  --radius: 18px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Manrope', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 184, 92, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(224, 88, 79, 0.08), transparent 60%),
    var(--night);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
header, main, footer { position: relative; z-index: 1; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.gold { color: var(--gold); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.mono { font-family: var(--mono); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px clamp(16px, 4vw, 40px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.01em; font-size: 18px; }
.brand img { border-radius: 9px; }
.brand em { font-family: var(--display); font-style: italic; font-weight: 700; color: var(--gold); }
.top nav { display: flex; align-items: center; gap: 18px; font-weight: 600; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover, .top nav a.active { color: var(--cream); }
.ticker { font-family: var(--mono); font-size: 13px; border: 1px solid var(--gold); color: var(--gold); padding: 4px 10px; border-radius: 99px; }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 60px; }

/* Hero */
.hero { padding: clamp(40px, 9vh, 110px) 0 40px; text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 18px; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(42px, 7.4vw, 88px); line-height: 1.0; letter-spacing: -0.025em; margin: 0 0 22px; }
.lede { max-width: 620px; margin: 0 auto 36px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); }
.wrap-form { max-width: 720px; margin: 0 auto; }
.field { display: flex; gap: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(230, 184, 92, 0.15); }
.field textarea { flex: 1; background: none; border: 0; color: var(--cream); font-family: var(--mono); font-size: 14px; padding: 12px 10px; resize: none; outline: none; min-height: 46px; line-height: 1.5; }
.field textarea::placeholder { color: var(--dim); font-family: var(--body); font-size: 15px; }
.btn { font-family: var(--body); font-weight: 800; font-size: 15px; border: 0; border-radius: 12px; padding: 12px 20px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d05; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--cream); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .6; cursor: default; }
.form-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--muted); padding: 0 4px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.safe { display: flex; align-items: center; gap: 6px; color: var(--green); }
.form-error { min-height: 1.5em; color: var(--red); font-weight: 600; margin: 10px 0 0; }
.hero-links { margin-top: 18px; }
.link-arrow { color: var(--gold); text-decoration: none; font-weight: 700; }
.link-arrow:hover { text-decoration: underline; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.features article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.features .num { font-family: var(--mono); color: var(--gold); font-size: 12px; }
.features h3 { font-family: var(--display); font-size: 21px; margin: 8px 0 6px; font-weight: 700; }
.features p { margin: 0; color: var(--muted); font-size: 14px; }

/* Loading */
.loading { text-align: center; padding: 80px 0; }
.gift { width: 150px; height: 150px; margin: 0 auto 26px; display: block; }
.gift .lid { transform-origin: 75px 52px; animation: lid 1.6s ease-in-out infinite; }
@keyframes lid { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(-4deg); } }
.loading h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px; }
.loading .sub { color: var(--muted); margin: 0 auto 26px; max-width: 520px; }
.bar { max-width: 460px; height: 10px; margin: 0 auto; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .5s ease;
  background: repeating-linear-gradient(135deg, var(--red) 0 12px, var(--cream) 12px 24px); background-size: 34px 34px; animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 34px 0; } }
.loading .stage { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-top: 14px; }
.loading .hint { font-size: 13px; color: var(--dim); margin-top: 26px; }

/* Story */
.story { position: fixed; inset: 0; z-index: 20; background: var(--night); display: flex; flex-direction: column; }
.story-bars { display: flex; gap: 5px; padding: 14px clamp(14px, 4vw, 40px) 0; }
.story-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.18); overflow: hidden; }
.story-bars span i { display: block; height: 100%; width: 0; background: var(--gold); }
.story-bars span.done i { width: 100%; }
.story-bars span.on i { animation: fill var(--dur, 6.5s) linear forwards; }
.story.paused .story-bars span.on i { animation-play-state: paused; }
@keyframes fill { to { width: 100%; } }
.story-top { display: flex; justify-content: space-between; align-items: center; padding: 12px clamp(14px, 4vw, 40px); font-size: 14px; color: var(--muted); }
.story-top button { background: none; border: 0; color: var(--cream); font: inherit; font-weight: 700; cursor: pointer; }
.slide { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px clamp(18px, 6vw, 80px) 40px; overflow: hidden; position: relative; }
.slide > * { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.slide > *:nth-child(2) { animation-delay: .12s; } .slide > *:nth-child(3) { animation-delay: .24s; }
.slide > *:nth-child(4) { animation-delay: .36s; } .slide > *:nth-child(5) { animation-delay: .48s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.slide .kicker { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 800; color: var(--gold); margin-bottom: 18px; }
.slide .big { font-family: var(--display); font-weight: 800; font-size: clamp(54px, 11vw, 132px); line-height: .95; letter-spacing: -0.03em; }
.slide .mid { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4.6vw, 52px); line-height: 1.08; max-width: 900px; }
.slide .say { color: var(--muted); font-size: clamp(16px, 2vw, 21px); max-width: 640px; margin-top: 18px; }
.slide .row { display: flex; gap: clamp(18px, 5vw, 60px); justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.slide .row div { min-width: 120px; }
.slide .row b { display: block; font-family: var(--mono); font-size: clamp(20px, 3vw, 30px); }
.slide .row small { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.slide .chart-wrap { width: min(860px, 100%); height: clamp(200px, 34vh, 340px); margin-top: 22px; }
.slide .actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tap { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 2; cursor: pointer; background: none; border: 0; }
.tap.l { left: 0; } .tap.r { right: 0; width: 70%; }
.slide .actions, .slide .chart-wrap { position: relative; z-index: 3; }
.title-badge { display: inline-block; padding: 26px 34px; border: 1.5px solid var(--gold); border-radius: 22px; background: rgba(230,184,92,.06); }

/* Summary */
.sum-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 30px 0 22px; }
.sum-head h1 { font-size: clamp(34px, 5vw, 56px); margin: 6px 0 0; }
.sum-head .who { font-family: var(--mono); color: var(--muted); font-size: 14px; word-break: break-all; margin-top: 10px; }
.sum-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.card .v { font-family: var(--mono); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; margin-top: 6px; }
.card .s { color: var(--muted); font-size: 14px; margin-top: 4px; }
.card.hero-card { grid-column: span 2; background: linear-gradient(160deg, rgba(230,184,92,.12), rgba(255,255,255,.03) 60%); border-color: rgba(230,184,92,.35); }
.card.hero-card .v { font-size: clamp(38px, 5vw, 58px); }
.section-title { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); margin: 44px 0 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-title small { font-family: var(--body); font-size: 14px; color: var(--muted); font-weight: 500; }
.trade { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.trade:first-of-type { border-top: 0; }
.trade:hover .sym { color: var(--gold); }
.coin { width: 40px; height: 40px; border-radius: 50%; background: var(--pine-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; color: var(--gold); }
.coin img { width: 100%; height: 100%; object-fit: cover; }
.sym { font-weight: 800; }
.trade .meta { color: var(--muted); font-size: 13px; }
.trade .pnl { text-align: right; font-family: var(--mono); font-weight: 700; }
.trade .pnl small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.chart-card { padding: 18px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.chart-head select { background: var(--pine); color: var(--cream); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; max-width: 100%; }
.chart-box { height: 340px; position: relative; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-note { color: var(--dim); font-size: 12px; margin-top: 6px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bars-box { height: 180px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; background: rgba(255,255,255,.02); position: sticky; top: 0; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--cream); }
th.sorted { color: var(--gold); }
td { font-family: var(--mono); font-size: 13px; }
td.l { font-family: var(--body); font-size: 14px; }
tbody tr:hover { background: rgba(255,255,255,.03); }
tbody tr:last-child td { border-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.share-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.share-card canvas { width: 100%; display: block; aspect-ratio: 16 / 9; background: var(--pine); }
.share-card .acts { display: flex; gap: 8px; padding: 12px; }
.share-card .acts .btn { flex: 1; }
details.how { margin-top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
details.how summary { cursor: pointer; font-weight: 800; }
details.how ul { color: var(--muted); font-size: 14px; padding-left: 20px; margin-bottom: 0; }
details.how li { margin: 6px 0; }
.warn { background: rgba(230,184,92,.08); border: 1px solid rgba(230,184,92,.35); border-radius: 14px; padding: 12px 16px; font-size: 14px; color: var(--gold-2); margin-bottom: 16px; }
.empty { text-align: center; padding: 90px 0; }
.empty h2 { font-family: var(--display); font-size: clamp(30px, 4vw, 44px); margin: 0 0 10px; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 24px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--muted); }

/* Leaderboard */
.lb-head { padding: 34px 0 18px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.lb-head h1 { font-size: clamp(36px, 5vw, 60px); margin: 0; }
.lb-head p { color: var(--muted); margin: 6px 0 0; }
.rank { font-family: var(--display); font-weight: 800; color: var(--gold); font-size: 16px; }
.addr-link { font-family: var(--mono); text-decoration: none; }
.addr-link:hover { color: var(--gold); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 22px clamp(16px, 4vw, 40px) 30px; color: var(--dim); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }
.foot .ca { font-family: var(--mono); }

@media (max-width: 900px) {
  .features, .g4 { grid-template-columns: repeat(2, 1fr); }
  .cards, .g3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .field { flex-direction: column; }
  .features, .g3, .g2, .cards { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .g4 .card { padding: 14px; }
  .g4 .card .v { font-size: 20px; }
  .card.hero-card { grid-column: span 2; }
  .brand { font-size: 16px; white-space: nowrap; }
  .brand img { width: 28px; height: 28px; }
  .top { padding: 14px 16px; }
  .sum-head .tools .btn { padding: 10px 14px; font-size: 14px; }
  .top nav { gap: 12px; }
  .chart-box { height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition: none !important; }
}

/* story polish */
.slide .chart-wrap canvas { width: 100%; height: 100%; display: block; }
.story { background: radial-gradient(900px 600px at 50% 0%, rgba(230,184,92,.12), transparent 65%), radial-gradient(700px 500px at 0% 100%, rgba(224,88,79,.08), transparent 60%), var(--night); }
body.story-open #snow { z-index: 21; }

.top nav .ico { display: none; font-size: 18px; }
@media (max-width: 460px) { .top nav .lbl { display: none; } .top nav .ico { display: inline; } }
.tip { color: var(--dim); font-size: 13px; margin: 4px 0 0; }
.chart-note a, .slide .attr a { color: var(--muted); }
.slide .attr { font-size: 12px; color: var(--dim); margin-top: 6px; position: relative; z-index: 3; }
