:root {
  --pitch-dark: #0a1f14;
  --pitch: #0f2e1c;
  --pitch-line: #1c4a2e;
  --card-bg: #12291c;
  --card-border: #234a32;
  --text: #eef7ef;
  --text-dim: #9fc2ab;
  --gold: #f2c94c;
  --gold-dim: #c9a53e;
  --accent: #4ade80;
  --red-card: #e05252;
  --radius: 14px;
  --max-width: 760px;
  --mono: "Courier New", ui-monospace, monospace;
  --overlay-1: rgba(255, 255, 255, 0.02);
  --overlay-2: rgba(255, 255, 255, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--pitch-dark);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

.pitch-lines {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 0%, var(--pitch) 0%, var(--pitch-dark) 60%),
    repeating-linear-gradient(180deg, var(--pitch) 0 80px, var(--pitch-line) 80px 82px);
  opacity: 0.9;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.hero {
  text-align: center;
  padding: 32px 12px 8px;
}

.hero-badge {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(28px, 7vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 24px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px 22px;
  min-width: 130px;
}

.hero-stat .num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.hero-stat .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-top: 20px;
}

.card h2 {
  margin: 0 0 4px;
  font-size: 19px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 16px;
}

/* Leaderboard */
.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--overlay-1);
}

.leaderboard-row .rank {
  font-family: var(--mono);
  font-weight: 800;
  color: var(--gold);
  width: 32px;
  flex-shrink: 0;
  text-align: right;
}

.leaderboard-row img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pitch-line);
}

.leaderboard-row .who {
  flex: 1;
  min-width: 0;
}

.leaderboard-row .display-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-row .username {
  color: var(--text-dim);
  font-size: 12px;
}

.leaderboard-row .cast-count {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}

.leaderboard-row a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Cast list (most-liked) */
.cast-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cast-row {
  padding: 12px;
  border-radius: 10px;
  background: var(--overlay-1);
}

/* .who-link — a small author identity link (avatar + display name +
   @username), reused by most-liked casts and callouts; profile-linked, not
   cast-linked. Distinct from .leaderboard-row's own internal .who div. */
.who-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: inherit;
  text-decoration: none;
}

.who-link img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pitch-line);
  flex-shrink: 0;
}

.who-link .display-name {
  font-weight: 600;
  font-size: 13px;
}

.who-link .username {
  color: var(--text-dim);
  font-size: 12px;
}

.cast-body {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cast-row .text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
  overflow-wrap: break-word;
}

.cast-row .likes {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}

/* Timeline */
.timeline-wrap {
  overflow-x: auto;
}

.timeline-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  min-width: 560px;
}

.timeline-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.timeline-bar {
  width: 100%;
  background: var(--pitch-line);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.timeline-bar.has-match {
  background: var(--accent);
}

.timeline-labels {
  display: flex;
  gap: 3px;
  min-width: 560px;
  margin-top: 6px;
}

.timeline-label-col {
  flex: 1;
  text-align: center;
}

.match-tag {
  display: inline-block;
  font-size: 9px;
  color: var(--gold);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  min-width: 560px;
}

/* Two column (words/emoji) */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.word-list, .emoji-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  background: var(--overlay-2);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
}

.word-chip .count {
  color: var(--gold);
  font-weight: 700;
  margin-left: 4px;
}

.emoji-chip {
  background: var(--overlay-2);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.emoji-chip .count {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* New vs returning */
.stat-pair {
  display: flex;
  gap: 12px;
}

.stat-pair .box {
  flex: 1;
  text-align: center;
  padding: 18px 10px;
  border-radius: 10px;
  background: var(--overlay-1);
}

.stat-pair .box .num {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  display: block;
}

.stat-pair .box.new .num { color: var(--gold); }

.stat-pair .box .label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Callouts */
.callouts-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.callout {
  padding: 14px;
  border-radius: 10px;
  background: var(--overlay-1);
}

.callout .callout-label {
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.callout .callout-body {
  font-size: 14px;
  line-height: 1.4;
  display: block;
}

.callout .callout-body[href] {
  color: var(--accent);
  text-decoration: none;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 32px;
  line-height: 1.6;
}

.footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
  .two-col {
    grid-template-columns: 1fr;
  }
  .stat-pair {
    flex-direction: column;
  }
}
