/* Leaderboard site styles. Colors, fonts and shared parts come from buddhistai.css
   (BuddhistAI design system, https://github.com/BuddhistAI/design). Use its variables here, never new hex colors. */
:root {
  --text: var(--ink); --surface-2: var(--sunk); --border: var(--line);
  --accent: var(--lapis); --accent-soft: var(--lapis-soft);
  --bar: var(--lapis); --bar-bg: var(--sunk); --radius: var(--r-md);
}
* { box-sizing: border-box; }
body { font-size: 15px; }
a { color: var(--accent); text-underline-offset: 2px; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.code { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 8px; padding-bottom: 32px; }
main > h1, h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; margin: 32px 0 10px; }
h2 { font-size: 1.3rem; font-weight: 700; margin: 32px 0 10px; }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 70ch; margin: 0 0 8px; }
.links { margin: 8px 0 0; }
.crumb { margin: 18px 0 0; font-size: 0.9rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.sub { font-size: 0.82rem; color: var(--muted); }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.board { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.board th, .board td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.board thead th { background: var(--surface-2); font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.board tbody tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix td.cell { min-width: 150px; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.score .pm { font-weight: 400; color: var(--muted); font-size: 0.85em; }
.best .score { color: var(--good); }
.bar { height: 6px; border-radius: 3px; background: var(--bar-bg); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--bar); }
.best .bar > i { background: var(--good); }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: 2px; margin-left: 4px; white-space: nowrap; }
.badge.promoted { background: var(--accent-soft); color: var(--accent); }
.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 24px 0 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.controls label, .controls legend { font-size: 0.88rem; color: var(--muted); }
.controls select { margin-left: 6px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; }
.controls fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.controls legend { float: left; margin-right: 6px; }
.controls .check, .controls fieldset label { color: var(--text); }
.note { margin: 20px 0 0; padding: 4px 16px; background: var(--accent-soft); border-radius: var(--r-sm); font-size: inherit; color: var(--ink); }
.note ul { padding-left: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card h2, .card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 6px 0; }
.card.empty { margin-top: 24px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 24px; }
.flow { padding-left: 20px; margin: 6px 0 0; }
.flow li { margin: 4px 0; }
.planned { padding-left: 18px; }
.planned li { margin: 4px 0; }
.splits dt { font-weight: 600; margin-top: 8px; }
.splits dd { margin: 2px 0 0; color: var(--muted); }
.permodel h3 { font-size: 1rem; margin: 20px 0 8px; }
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .board th, .board td { padding: 8px 9px; }
  .matrix td.cell { min-width: 120px; }
}
.nowrap { white-space: nowrap; }
.benchmark { margin-top: 20px; }
.benchmark h2 { margin: 0 0 4px; font-size: 1.1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 20px; margin: 10px 0; }
.facts dt { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 2px 0 0; }
a.plain { color: var(--text); text-decoration: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; } a.plain:hover { text-decoration: underline; }

/* Overview: arena-style cards */
.stats { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 16px 0 0; }
.stats li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; color: var(--muted); font-size: 0.9rem; }
.stats b { color: var(--text); font-size: 1.05rem; margin-right: 4px; font-variant-numeric: tabular-nums; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-top: 24px; }
.lb-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 16px 12px; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.lb-card header h2 { margin: 2px 0 2px; font-size: 1.2rem; }
.lb-card header h2 a { color: var(--text); text-decoration: none; }
.lb-card header h2 a:hover { color: var(--accent); }
.lb-card header .sub { margin: 0; }
.kicker { margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.kicker code { text-transform: none; letter-spacing: 0; }
.tabs { display: flex; gap: 4px; margin: 14px 0 6px; padding: 3px; background: var(--surface-2); border-radius: 9px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { font: inherit; font-size: 0.82rem; border: 0; background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
ol.rank { list-style: none; margin: 4px 0 8px; padding: 0; }
ol.rank li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
ol.rank li:last-child { border-bottom: 0; }
ol.rank .pos { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.82rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
ol.rank .who { min-width: 0; }
ol.rank .name { font-weight: 600; overflow-wrap: anywhere; }
ol.rank .bar { display: block; margin-top: 5px; }
ol.rank li.r1 .bar > i { background: var(--good); }
ol.rank .val { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }
ol.rank li.ref .name, ol.rank li.ref .val { color: var(--muted); }
ol.rank li.ref .bar > i { background: var(--border); }
.lb-card footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.more { font-weight: 600; text-decoration: none; font-size: 0.9rem; }
.lb-card.soon { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px); }
.soon-body { flex: 1; display: grid; place-items: center; min-height: 140px; font-size: 1.1rem; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { border: 1px dashed var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.88rem; color: var(--muted); background: var(--surface); }
.card.how { margin-top: 28px; }
.card.how h2 { margin-top: 0; }
@media (max-width: 640px) { .lb-grid { grid-template-columns: 1fr; } }

/* Task page: arena-style ranked table */
.lb-card.wide { margin-top: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-bottom: 10px; }
.toolbar > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .tabs { margin: 0; }
.tlabel { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toolbar label { font-size: 0.88rem; }
.toolbar select { margin-left: 6px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.table-scroll.flat { border: 0; border-radius: 0; background: transparent; }
table.arena thead th { background: transparent; border-bottom: 1px solid var(--border); }
table.arena td { vertical-align: middle; }
table.arena .pos { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 0.85rem; }
table.arena .skill { font-weight: 600; color: var(--text); text-decoration: none; }
table.arena .skill:hover { color: var(--accent); }
table.arena .scorecell { min-width: 170px; }
table.arena .big { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
table.arena .scorecell .bar { display: block; margin-top: 5px; }
table.arena tr.r1 .bar > i { background: var(--good); }
table.arena tr.ref td { color: var(--muted); }
table.arena tr.ref .skill { color: var(--muted); }
table.arena tr.ref .bar > i { background: var(--border); }
table.arena tbody tr:hover td { background: var(--surface-2); }
.benchmark .kicker { margin-bottom: 2px; }
.more-details { margin-top: 24px; }
.more-details summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; padding: 6px 0; }
.more-details h3 { font-size: 1rem; margin: 18px 0 8px; }
.toolbar > div { min-width: 0; max-width: 100%; }
.toolbar .tabs { min-width: 0; }
.tabs-note { margin: 12px 0 4px; }
.lb-card.ext .badge { font-weight: 500; }
ol.rank a.name { color: var(--text); text-decoration: none; }
ol.rank a.name:hover { color: var(--accent); text-decoration: underline; }
ol.rank li.ref a.name { color: var(--muted); }
table.arena a.skill:hover { text-decoration: underline; }
a.open { text-decoration: none; color: var(--muted); font-size: 0.9em; margin-left: 2px; }
a.btn { display: inline-block; padding: 3px 10px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; font-weight: 600; margin-right: 8px; }
a.btn:hover { background: var(--accent-soft); }
ol.rank a.name::after, table.arena a.skill[href^="http"]::after { content: " ↗"; font-size: 0.8em; color: var(--muted); font-weight: 400; }
.gain { display: block; font-size: 0.75rem; font-weight: 600; text-align: right; color: var(--muted); }
.gain.up { color: var(--good); }
table.arena .gain { display: inline; font-size: 0.9rem; }
ol.rank li.base, table.arena tr.base td { background: var(--surface-2); }
ol.rank li.base { border-radius: 8px; border-bottom: 0; margin-top: 4px; }
ol.rank li.base .name, table.arena tr.base .skill { color: var(--muted); font-style: italic; }
ol.rank li.base .bar > i, table.arena tr.base .bar > i { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
/* Best overall / best value picks */
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.picks.compact { gap: 8px; margin: 4px 0 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pick { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.picks.compact .pick { background: var(--surface-2); border: 0; padding: 8px 10px; }
.pick.overall { border-left: 4px solid var(--accent); }
.pick.value { border-left: 4px solid var(--good); }
.picks.compact .pick.overall { border-left: 3px solid var(--accent); }
.picks.compact .pick.value { border-left: 3px solid var(--good); }
.pick .kicker { margin: 0; }
.pick-name { margin: 2px 0; font-weight: 600; overflow-wrap: anywhere; }
.picks.compact .pick-name { font-size: 0.9rem; }
.pick-nums { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pick-nums > b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.picks.compact .pick-nums > b { font-size: 1.05rem; }
.pick-nums span { font-size: 0.85rem; color: var(--muted); }
.pick-nums span b { color: var(--text); }

/* ---- BuddhistAI design system alignment (homepage look) ---- */
.bar { display: block; }
.tabs { border-bottom: 0; }
.card { display: block; }
.lb-card { border-radius: var(--r-md); box-shadow: none; }
.lb-card:hover { border-color: var(--lapis); }
.lb-card header h2, .lb-card header h2 a { font-family: var(--f-display); }
.kicker, .tlabel { font-weight: 600; color: var(--muted); }
ol.rank .val, table.arena .big, .pick-nums > b, .stats b { font-family: var(--f-display); }
.score { font-family: var(--f-display); }
/* Top performance and Best value picks: same colors as the homepage */
.pick { display: block; border: 0; }
.pick.overall, .picks.compact .pick.overall { background: var(--lapis-soft); border: 0; }
.pick.value, .picks.compact .pick.value { background: var(--saffron-soft); border: 0; }
.pick.overall .kicker { color: var(--lapis); }
.pick.value .kicker { color: var(--saffron); }
.badge.promoted { background: var(--good-soft); color: var(--good); }
a.btn { padding: 8px 14px; border-radius: var(--r-pill); border-color: var(--line); background: var(--surface); color: var(--ink); }
a.btn:hover { border-color: var(--lapis); background: var(--surface); }
ol.rank li.r1 .pos, table.arena tr.r1 .pos { background: var(--medal-gold); color: var(--medal-gold-on); }
ol.rank li.r2 .pos, table.arena tr.r2 .pos { background: var(--medal-silver); color: var(--medal-silver-on); }
ol.rank li.r3 .pos, table.arena tr.r3 .pos { background: var(--medal-bronze); color: var(--medal-bronze-on); }
.gain.down { color: var(--bad); }
.stats li { border-radius: var(--r-pill); }
