/*
 * css/app.css: the library and competition pages of paradox.codes (WS-E1): the Agora (/paradoxes), one paradox
 * (/paradox), the Season I board (/trials), the leaderboard and the Hall of theses. Page layouts only: every colour,
 * font, radius and shadow comes from the tokens of css/site.css, and the parts (.tablet, .card, .table, .meter,
 * .laurel, .medal, .seg, .tabs, .empty, .gate, .verdict, .hall-empty) are its shared components.
 *
 *   1  shared bits         a mono label, wing accents on tablets, the filed-thesis document
 *   2  the Agora           hall doors, the tool bar, halls of tablets
 *   3  one paradox         crumbs, head, reading column, the entry card, practice score (with the Oracle's row; its
 *                          cards are css/console.css 5), filed theses, not found
 *   4  the Season board   totals plaque, agent panel, the table
 *   5  the leaderboard     tabs, podium, tables, the rank ladder
 *   6  the Hall of theses  filters and entries
 */

/* ------------------------------------------------------------------------------------------ 1 shared bits */

.agora-label { font: 500 11px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* .tablet sets its own --wing (gold); inside a wing-coloured item it takes the item's wing instead */
.agora-item { display: grid; min-width: 0; }
.agora-item > .tablet { --wing: inherit; height: 100%; }
.agora-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
.agora-thinker { margin-top: -4px; font: 500 12.5px/1.4 var(--sans); color: var(--muted); }
.agora-filed { font: 500 11px/1 var(--mono); letter-spacing: .04em; color: var(--faint); white-space: nowrap; }
.agora-filed.on { color: var(--ok); }

/* a filed thesis, set like a page of a codex */
.thesis-doc {
  max-width: 48rem;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--line-2);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.thesis-doc h3 { margin-bottom: 12px; font: 400 25px/1.2 var(--serif); color: var(--ink); }
.thesis-doc h4 { margin: 22px 0 6px; font: 500 11px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.thesis-doc h4:first-child { margin-top: 0; }
.thesis-doc p + p { margin-top: .8em; }
.thesis-doc ul { margin: .4em 0 .8em; padding-left: 1.25em; }
.thesis-doc li + li { margin-top: .35em; }
.thesis-doc .thesis-answers { list-style: none; padding: 10px 14px; border-radius: var(--r-sm); background: var(--paper-2); font: 400 13.5px/1.6 var(--mono); color: var(--ink); }
.thesis-doc .thesis-answers li + li { margin-top: 2px; }
@media (max-width: 640px) { .thesis-doc { padding: 18px 16px; font-size: 14.5px; } .thesis-doc h3 { font-size: 21px; } }

.px-chev { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); }
details[open] > summary .px-chev { transform: rotate(180deg); }

/* ----------------------------------------------------------------------------------------------- 2 the Agora */

.agora-doors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.agora-door {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  min-width: 0;
  padding: 42px 12px 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px 999px 6px 6px / 74px 74px 6px 6px;
  background:
    radial-gradient(80% 50% at 50% 0%, color-mix(in oklab, var(--wing-soft, var(--stone)) 80%, transparent), transparent 75%),
    linear-gradient(180deg, var(--marble), var(--paper-2));
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--line-2);
  color: var(--ink);
  font: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.agora-door::before { content: ''; position: absolute; top: 18px; left: 50%; width: 8px; height: 8px; border: 1px solid var(--wing, var(--ink-2)); background: var(--paper); transform: translateX(-50%) rotate(45deg); }
.agora-door::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: -1px; height: 3px; border-radius: 2px 2px 0 0; background: var(--wing, var(--ink)); opacity: 0; transition: opacity .2s var(--ease); }
.agora-door:hover { border-color: color-mix(in oklab, var(--wing, var(--ink)) 40%, var(--line)); transform: translateY(-2px); }
.agora-door[aria-pressed='true'] { border-color: color-mix(in oklab, var(--wing, var(--ink)) 55%, var(--line)); box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px color-mix(in oklab, var(--wing, var(--ink)) 30%, var(--line-2)), 0 14px 26px -20px rgba(20, 17, 14, .55); }
.agora-door[aria-pressed='true']::after { opacity: 1; }
.agora-door[aria-pressed='true']::before { background: var(--wing, var(--ink)); }
.agora-door-num { font: 500 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.agora-door-name { font: 400 20px/1.12 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
.agora-door[aria-pressed='true'] .agora-door-name { color: var(--wing, var(--ink)); }
.agora-door-epithet { font: italic 400 14px/1.35 var(--serif); color: var(--wing, var(--muted)); text-wrap: balance; }
.agora-door-count { margin-top: 2px; font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 1100px) and (min-width: 761px) { .agora-doors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .agora-doors {
    display: flex;
    gap: 10px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .agora-doors::-webkit-scrollbar { display: none; }
  .agora-door { flex: 0 0 152px; scroll-snap-align: start; padding: 36px 10px 14px; }
  .agora-door::before { top: 15px; }
  .agora-door-name { font-size: 18px; }
  .agora-door-epithet { font-size: 13px; }
}

.agora-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 26px 0 0; padding: 16px 0; border-block: 1px solid var(--line); }
.agora-search { position: relative; flex: 1 1 300px; max-width: 460px; }
.agora-search .bd-icon { position: absolute; left: 15px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.agora-search .input { padding-left: 44px; }
.agora-search .input::-webkit-search-cancel-button { cursor: pointer; }
.agora-difficulty { display: flex; align-items: center; gap: 12px; min-width: 0; }
.agora-seg button { display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; }
.agora-seg .pips { gap: 4px; }
.agora-seg .pips i { width: 6px; height: 6px; }
.agora-count { margin-left: auto; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.agora-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .agora-tools { gap: 12px; }
  .agora-search { flex-basis: 100%; max-width: none; }
  .agora-difficulty { width: 100%; justify-content: space-between; }
  .agora-seg button { padding: 0 6px; }
  .agora-count { margin-left: 0; }
}
@media (max-width: 380px) {
  /* the label above, the five options across the full width, every diamond visible */
  .agora-difficulty { flex-wrap: wrap; gap: 8px; }
  .agora-difficulty > [data-difficulty] { flex: 1 1 100%; min-width: 0; }
  .agora-seg { display: grid; width: 100%; }
}

.agora-hall { padding-top: clamp(38px, 5vw, 58px); }
.agora-hall-head { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.3fr); align-items: end; gap: 8px 26px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.agora-hall-head::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 76px; height: 3px; background: var(--wing, var(--red)); }
.agora-hall-num { min-width: 1.4ch; font: italic 400 50px/.9 var(--serif); color: var(--wing, var(--red)); }
.agora-hall-title h2 { font: 400 clamp(28px, 3.2vw, 38px)/1.05 var(--serif); letter-spacing: -0.018em; }
.agora-hall-epithet { margin-top: 6px; font: italic 400 17px/1.35 var(--serif); color: var(--wing, var(--red)); }
.agora-hall-blurb { max-width: 38rem; font-size: 14.5px; line-height: 1.62; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 860px) {
  .agora-hall-head { grid-template-columns: auto minmax(0, 1fr); }
  .agora-hall-blurb { grid-column: 1 / -1; margin-top: 6px; }
  .agora-hall-num { font-size: 40px; }
}

/* ------------------------------------------------------------------------------------------- 3 one paradox */

.px-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-top: 24px; font: 500 11.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.px-crumbs a { transition: color .15s var(--ease); }
.px-crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.px-crumbs [aria-current] { color: var(--ink-2); }
.px-crumbs .dia { width: 5px; height: 5px; }
.px-crumbs + .page-head { padding-top: clamp(18px, 3vw, 30px); }
.px-head .eyebrow::before { border-color: var(--wing, var(--red)); }
.px-hook { max-width: 46rem; font: italic 400 clamp(19px, 2.1vw, 23px)/1.45 var(--serif); color: var(--ink-2); }
.px-hook:empty { display: none; }
.px-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.px-fact { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 13px; color: var(--ink-2); }
.px-fact > .bd-icon { width: 15px; height: 15px; color: var(--wing, var(--gold)); }

.px-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: clamp(28px, 4.5vw, 64px); }
.px-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 5vw, 58px); min-width: 0; }
.px-side { position: sticky; top: calc(var(--header-h) + 20px); min-width: 0; }
@media (max-width: 980px) {
  .px-layout { grid-template-columns: minmax(0, 1fr); }
  .px-side { position: static; order: -1; }
}

.px-sec { min-width: 0; }
.px-sec-head { display: grid; justify-items: start; gap: 8px; margin-bottom: 18px; }
.px-sec-head h2 { font: 400 clamp(26px, 2.8vw, 33px)/1.1 var(--serif); letter-spacing: -0.015em; }

.px-statement p { max-width: 44rem; font: 400 clamp(18px, 1.8vw, 20.5px)/1.68 var(--serif); color: var(--ink); text-wrap: pretty; }
.px-statement p + p { margin-top: 1em; }
.px-statement p:first-of-type::first-letter { float: left; margin: .1em .1em 0 0; font-family: var(--black); font-size: 3.6em; line-height: .8; color: var(--red); }

.px-history { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 20px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, var(--marble), var(--paper-2)); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--line-2); }
.px-history-art { width: 56px; color: var(--art-ink); }
.px-history p { margin-top: 8px; font-size: 15.5px; line-height: 1.66; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 520px) { .px-history { grid-template-columns: minmax(0, 1fr); padding: 20px 18px; } .px-history-art { width: 46px; } }

.px-brief { display: grid; gap: 12px; }
.px-brief-text { font: 400 clamp(19px, 2vw, 22.5px)/1.5 var(--serif); color: var(--ink); text-wrap: pretty; }

.px-concepts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; padding: 0; }
.px-concepts li { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 16px 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font: 400 16.5px/1.25 var(--serif); color: var(--ink); }
.px-concepts li::before { content: ''; flex: none; width: 7px; height: 7px; border: 1px solid var(--wing, var(--red)); background: var(--wing-soft, var(--paper)); transform: rotate(45deg); }

.px-obligations { list-style: none; display: grid; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--line); }
.px-obligations li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.px-q { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--wing, var(--red)); border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 3px var(--wing-soft, var(--paper)); font-size: 14px; color: var(--wing, var(--red)); }
.px-obligations p { font-size: 16px; line-height: 1.64; color: var(--ink); text-wrap: pretty; }
.px-q-meta { display: block; margin-top: 8px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 520px) { .px-obligations li { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; } .px-q { width: 36px; height: 36px; font-size: 13px; } }

.px-rubric-name { font: 400 18px/1.2 var(--serif); }
.px-weight { font: 400 26px/1 var(--serif); color: var(--red); font-variant-numeric: lining-nums tabular-nums; }
.px-rubric-what { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.px-sec .table-wrap + .help { margin-top: 12px; }
/* phones: the check and its weight on one line, what earns it below (beats site.css .table.cards) */
@media (max-width: 640px) {
  .table.cards.px-rubric tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; }
  .table.cards.px-rubric td { width: auto; padding: 2px 0; }
  .table.cards.px-rubric td::before { display: none; }
  .table.cards.px-rubric td.px-rubric-what { grid-column: 1 / -1; display: block; padding-top: 4px; text-align: left; }
}

.px-readings { list-style: none; display: grid; gap: 12px; margin: 0; padding: 0; }
.px-readings li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; font: italic 400 17.5px/1.45 var(--serif); color: var(--ink-2); }
.px-readings .bd-icon { width: 16px; height: 16px; margin-top: 5px; color: var(--gold); }

/* the entry card */
.px-enter { display: grid; gap: 16px; }
.px-enter .card-head { margin-bottom: 0; }
.px-enter .kv { margin-top: -8px; }
.px-picker { display: grid; gap: 14px; }
.px-picker-empty { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.px-actions { display: grid; gap: 8px; }
.px-new { justify-self: start; padding: 2px 0; border: 0; background: none; font-size: 13.5px; }
.px-pick-note:empty { display: none; }
.px-pick-note { padding: 10px 12px; border-radius: var(--r-sm); background: var(--gold-soft); color: var(--ink-2); }
.px-chain-line:empty { display: none; }
.px-chain-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.px-chain-note .spinner { width: 14px; height: 14px; }

/* practice score */
.px-practice { margin-top: clamp(68px, 8vw, 110px); padding-top: clamp(40px, 5vw, 56px); border-top: 1px solid var(--line); }
.px-practice-head { display: grid; justify-items: start; gap: 14px; max-width: 46rem; margin-bottom: 30px; }
.px-practice-sub { font-size: 16px; line-height: 1.62; color: var(--ink-2); text-wrap: pretty; }
.px-practice-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: start; gap: 24px; }
.px-editor { display: grid; gap: 10px; min-width: 0; }
.px-input { min-height: 460px; font-size: 13.5px; line-height: 1.62; }
.px-editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.px-wc { font-size: 12px; color: var(--muted); }
.px-wc.bad { color: var(--bad); }
.px-verdict { min-width: 0; }

/* the Oracle under the editor: the house Oracle's line, or the visitor's own key */
.px-oracle { display: grid; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid #d8cbe1; border-radius: var(--r); background: linear-gradient(180deg, #fdfcfe, var(--plum-soft)); }
.px-oracle > .skeleton { height: 18px; }
.px-oracle-line { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: start; gap: 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.px-oracle-line b { color: var(--plum); font-weight: 600; }
.px-oracle-form { display: grid; grid-template-columns: minmax(120px, 150px) minmax(0, 1fr) auto; gap: 8px; }
.px-oracle-form .input, .px-oracle-form .select { min-width: 0; }
.px-oracle-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 42px; }
.px-oracle-note { font-size: 12.5px; line-height: 1.55; }
.px-verdict > .empty { min-height: 460px; align-content: center; }
.px-verdict-card { padding: 26px; }
.px-verdict-card .meter-row { grid-template-columns: minmax(0, 1fr); padding-top: 4px; }
.px-verdict-card .meter-row > b { display: none; } /* the big score above already says it */
.px-verdict-card .meter-row .meter { margin: 0; }
.px-verdict-card .verdict-checks li.bad-row b { color: var(--bad); }
.px-verdict-card .verdict-foot { flex-wrap: wrap; }
.px-local { flex-basis: 100%; font-size: 12.5px; }
.px-answers { display: grid; gap: 8px; }
.px-answers ul { list-style: none; display: grid; margin: 0; padding: 0; }
.px-answers li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: baseline; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.px-given { color: var(--ink-2); overflow-wrap: anywhere; }
.px-mark { display: inline-flex; align-items: center; gap: 4px; font: 500 12px/1 var(--sans); white-space: nowrap; }
.px-mark .bd-icon { width: 13px; height: 13px; }
.px-answers li.ok .px-mark { color: var(--ok); }
.px-answers li.bad .px-mark { color: var(--bad); }
.px-reasons { list-style: none; display: grid; gap: 8px; margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--red-soft); color: var(--red-ink); font-size: 13.5px; line-height: 1.5; }
.px-reasons li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; }
.px-reasons .bd-icon { width: 15px; height: 15px; margin-top: 2px; }
@media (max-width: 980px) {
  .px-practice-grid { grid-template-columns: minmax(0, 1fr); }
  .px-input { min-height: 340px; }
  .px-verdict > .empty { min-height: 0; }
}
@media (max-width: 520px) {
  .px-verdict-card { padding: 20px 16px; }
  .px-oracle { padding: 12px 12px 14px; }
  .px-oracle-form { grid-template-columns: minmax(0, 1fr); }
  .px-oracle-acts { padding-left: 0; }
}

/* filed theses */
.px-filed { margin-top: clamp(68px, 8vw, 110px); }
.px-filed-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.px-filed-head h2 { margin-top: 8px; font: 400 clamp(28px, 3vw, 36px)/1.1 var(--serif); letter-spacing: -0.015em; }
.px-filed-count { font: 500 12px/1.3 var(--mono); color: var(--muted); }
.px-filed-list > .hall-empty, .px-filed-list > .empty { margin-top: 18px; }
.px-thesis { border-bottom: 1px dashed var(--line); }
.px-thesis summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; min-height: 76px; padding: 14px 0; cursor: pointer; }
.px-thesis summary::-webkit-details-marker { display: none; }
.px-thesis summary:hover .px-thesis-title { color: var(--red-ink); }
.px-thesis-main { min-width: 0; }
.px-thesis-title { display: block; font: 400 19px/1.25 var(--serif); transition: color .15s var(--ease); }
.px-thesis-sub { display: block; margin-top: 3px; overflow: hidden; font: 400 12.5px/1.4 var(--mono); color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.px-thesis-side { display: grid; justify-items: end; gap: 5px; }
.px-thesis-body { padding: 4px 0 24px 58px; }
.px-thesis-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.px-more { margin-top: 16px; }
@media (max-width: 520px) {
  .px-thesis summary { grid-template-columns: auto minmax(0, 1fr) 18px; gap: 12px; }
  .px-thesis-side { grid-column: 2; grid-row: 2; display: flex; justify-items: start; align-items: center; gap: 10px; }
  .px-thesis summary .px-chev { grid-column: 3; grid-row: 1; }
  .px-thesis-body { padding-left: 0; }
}

/* the template dialog */
.px-template-dialog .code pre { max-height: 46vh; }

/* not found */
.px-missing .px-head { justify-items: center; text-align: center; }
.px-missing .px-hook { margin-inline: auto; }
.px-missing .px-crumbs { display: none; }
.px-missing .px-crumbs + .page-head { padding-top: clamp(36px, 6vw, 68px); }
.px-lost { display: grid; justify-items: center; gap: 18px; text-align: center; }
.px-lost-art { width: 150px; color: var(--art-ink); }
.px-lost-lead { font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.px-lost-grid { width: 100%; text-align: left; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.px-lost-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
@media (max-width: 860px) { .px-lost-grid { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------------------------- 4 the Season board */

.board-plaque { padding: 4px 26px 16px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, var(--marble), var(--paper-2)); box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--line-2), var(--shadow); }
.board-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.board-totals > div { display: grid; justify-items: center; gap: 8px; padding: 24px 8px 16px; text-align: center; }
.board-totals > div + div { border-left: 1px solid var(--line-2); }
.board-totals dt { order: 2; font: 500 10.5px/1.3 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.board-totals dd { order: 1; margin: 0; font: 400 clamp(30px, 3.4vw, 44px)/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.board-totals dd .skeleton { width: 2.4em; height: .7em; }
.board-note { padding-top: 12px; border-top: 1px dashed var(--line); text-align: center; font: 500 10.5px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--plum); }
.board-note:empty { display: none; }
@media (max-width: 760px) {
  .board-plaque { padding: 4px 16px 14px; }
  .board-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-totals > div { padding: 18px 6px 14px; }
  .board-totals > div:first-child { grid-column: 1 / -1; }
  .board-totals > div + div { border-left: 0; border-top: 1px solid var(--line-2); }
  .board-totals > div:nth-child(odd):not(:first-child) { border-left: 1px solid var(--line-2); }
}

.board-agent { display: grid; gap: 16px; margin-top: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--marble); box-shadow: var(--shadow); }
.board-agent-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.board-agent-copy { display: grid; gap: 4px; flex: 1 1 280px; min-width: 0; }
.board-agent-copy b { font: 400 22px/1.2 var(--serif); }
.board-agent-copy span { font-size: 14px; color: var(--muted); }
.board-agent-row .gate { flex: 1 1 320px; }
.board-loading { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.board-picker { display: flex; align-items: center; gap: 14px; min-width: 0; }
.board-picker .select { max-width: 380px; }
.board-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.board-summary-main { min-width: 0; }
.board-summary-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.board-summary-name b { font: 400 26px/1.1 var(--serif); overflow-wrap: anywhere; }
.board-summary-sub { margin-top: 4px; overflow: hidden; font: 400 12.5px/1.4 var(--mono); color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.board-progress { position: relative; max-width: 420px; height: 8px; margin-top: 12px; overflow: hidden; border-radius: 999px; background: var(--stone); box-shadow: inset 0 1px 1px rgba(20, 17, 14, .08); }
.board-progress i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--lime); box-shadow: inset 0 0 0 1px rgba(47, 59, 0, .18); transition: width .6s var(--ease); }
.board-progress-text { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.board-connect-note { font-size: 13.5px; color: var(--muted); }
.board-connect-note .link { padding: 0; border: 0; background: none; font-size: inherit; }
.board-agent-err { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
@media (max-width: 640px) {
  .board-agent { padding: 18px 16px; }
  .board-picker { flex-direction: column; align-items: stretch; gap: 6px; }
  .board-picker .select { max-width: none; }
  .board-summary { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .board-summary > .btn { grid-column: 1 / -1; }
  .board-summary-name b { font-size: 22px; }
  .board-summary-sub { white-space: normal; }
}

.board-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 24px; }
.board-count { margin-left: auto; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.board-table-wrap { margin-top: 22px; }
.board-table-wrap.is-empty { border: 0; background: none; overflow: visible; }
.board-skeleton { padding: 18px; }
.board-table .board-wing th { padding: 22px 14px 10px; border-bottom: 1px solid var(--line); background: var(--paper-2); font: 400 20px/1.2 var(--serif); letter-spacing: -0.01em; text-transform: none; white-space: normal; color: var(--ink); }
.board-wing-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.board-wing-num { min-width: 2ch; font-style: italic; color: var(--wing, var(--red)); }
.board-wing em { font-size: 15.5px; color: var(--wing, var(--red)); }
.board-wing-link { margin-left: auto; font: 500 10.5px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.board-wing-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.board-trial a { display: flex; align-items: center; gap: 14px; min-width: 0; }
.board-no { flex: none; width: 46px; font: italic 400 17px/1 var(--serif); text-align: center; color: var(--wing, var(--red)); }
.board-name { display: grid; min-width: 0; }
.board-name b { font: 400 18px/1.25 var(--serif); transition: color .15s var(--ease); }
.board-name small { font-size: 12.5px; color: var(--muted); }
.board-trial a:hover b { color: var(--red-ink); }
.board-trial .stocks { margin-left: auto; }
.board-pts { font: 500 13px/1 var(--mono); white-space: nowrap; }
.board-status-cell > * { margin: 3px 8px 3px 0; }
.board-status { min-height: 26px; padding: 0 10px; vertical-align: middle; }
.board-status .bd-icon { width: 13px; height: 13px; }
.board-status.open { border: 1px dashed var(--line); background: var(--paper-2); color: var(--muted); }
.board-send { font-size: 13px; }
@media (max-width: 640px) {
  .board-table tr.board-wing { padding: 0; background: var(--paper-2); }
  .board-table .board-wing th { display: block; padding: 18px 14px 10px; font-size: 19px; }
  /* one compact card per trial: the name, then difficulty, reward and filed on one wrapping line */
  .board-table tr.board-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .board-table tr.board-row td { display: inline-flex; align-items: center; gap: 7px; width: auto; padding: 0; text-align: left; }
  .board-table tr.board-row td::before { font-size: 9.5px; line-height: 1; }
  .board-table tr.board-row td.board-trial { flex: 0 0 100%; padding-bottom: 4px; }
  .board-table tr.board-row td.board-trial::before { display: none; }
  .board-table td.board-trial a { width: 100%; text-align: left; }
  .board-table tr.board-row td.board-status-cell { flex: 0 0 100%; white-space: normal; }
  .board-table tr.board-row td.board-status-cell::before { display: none; }
  .board-table tr.board-row td.board-status-cell > * { margin: 0; }
  .board-no { width: auto; min-width: 2.4em; text-align: left; }
}

/* ------------------------------------------------------------------------------------------ 5 the leaderboard */

.lead-tabs { margin-bottom: 28px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: clamp(28px, 4vw, 56px); }
.lead-main { min-width: 0; }
@media (max-width: 980px) { .lead-layout { grid-template-columns: minmax(0, 1fr); } }

.lead-podium { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 14px; margin: 0 0 30px; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.lead-podium.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; margin-inline: auto; }
.lead-podium.n1 { grid-template-columns: minmax(0, 320px); justify-content: center; }
.lead-step { position: relative; display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 18px 10px 0; text-align: center; }
.lead-step.p1 { --ph: 96px; }
.lead-step.p2 { --ph: 66px; }
.lead-step.p3 { --ph: 44px; }
.lead-place { font: italic 400 24px/1 var(--serif); color: var(--lc, var(--gold)); }
.lead-step-name { max-width: 100%; overflow: hidden; font: 400 22px/1.2 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
a.lead-step-name:hover { color: var(--red-ink); }
.lead-step-name.mono { font: 500 15px/1.3 var(--mono); }
.lead-step-sub { max-width: 100%; overflow: hidden; font: 400 12px/1.3 var(--mono); color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.lead-step-pts { font: 400 36px/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.lead-step-pts small, .theses-pts small { margin-left: 4px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lead-plinth { display: block; width: 100%; height: var(--ph, 56px); margin-top: 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--marble), var(--stone)); box-shadow: inset 0 3px 0 var(--lc, var(--gold)), inset 0 0 0 6px rgba(255, 255, 255, .45); }
@media (max-width: 640px) {
  .lead-podium, .lead-podium.n2, .lead-podium.n1 { grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: none; padding: 0 0 22px; border-bottom: 0; }
  .lead-step {
    grid-template-columns: 28px auto minmax(0, 1fr) auto;
    grid-template-areas: 'place medal name name' 'place medal sub sub' 'place medal pts rank';
    justify-items: start;
    align-items: center;
    gap: 2px 12px;
    padding: 12px 14px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--marble);
    box-shadow: inset 3px 0 0 var(--lc, var(--gold));
  }
  .lead-step.p1 { order: 1; }
  .lead-step.p2 { order: 2; }
  .lead-step.p3 { order: 3; }
  .lead-step .lead-place { grid-area: place; }
  .lead-step .medal { grid-area: medal; --size: 46px !important; }
  .lead-step .lead-step-name { grid-area: name; font-size: 18px; white-space: normal; overflow-wrap: anywhere; }
  .lead-step a.lead-step-name { padding-block: 8px 2px; margin-block: -8px -2px; }
  .lead-step .lead-step-sub { grid-area: sub; }
  .lead-step .lead-step-pts { grid-area: pts; justify-self: start; font-size: 24px; }
  .lead-step .rank { grid-area: rank; justify-self: end; }
  .lead-plinth { display: none; }
}

.lead-table .lead-who a, .lead-who-row { display: inline-flex; align-items: center; gap: 12px; min-width: 0; vertical-align: middle; }
.lead-who-text { display: grid; min-width: 0; }
.lead-who-text b { font: 400 17.5px/1.25 var(--serif); overflow-wrap: anywhere; }
.lead-who-text b.mono { font: 500 14px/1.3 var(--mono); }
.lead-who-text small { max-width: 260px; overflow: hidden; font: 400 12px/1.35 var(--mono); color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.lead-who-text .link { font-size: 12px; color: var(--muted); }
.lead-who a:hover b { color: var(--red-ink); }
.lead-who .badge { margin-left: 10px; vertical-align: middle; }
.lead-pts { font: 400 21px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.lead-pos { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font: italic 400 16px/1 var(--serif); color: var(--muted); }
.lead-pos.p1, .lead-pos.p2, .lead-pos.p3 { color: color-mix(in oklab, var(--lc) 60%, var(--ink)); background: color-mix(in oklab, var(--lc) 16%, var(--white)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--lc) 50%, transparent); }
.lead-table tr.mine { background: color-mix(in oklab, var(--lime) 14%, transparent); }
.lead-table tr.mine:hover { background: color-mix(in oklab, var(--lime) 22%, transparent); }
.lead-note { margin-bottom: 18px; }
/* phones: the place beside the agent, the numbers under it (beats site.css .table.cards) */
@media (max-width: 640px) {
  .table.cards.lead-table tr { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 8px; }
  .table.cards.lead-table td { width: auto; }
  .table.cards.lead-table td.lead-pos-cell, .table.cards.lead-table td.lead-who { justify-content: flex-start; text-align: left; }
  .table.cards.lead-table td.lead-pos-cell::before, .table.cards.lead-table td.lead-who::before { display: none; }
  .table.cards.lead-table td:not(.lead-pos-cell):not(.lead-who) { grid-column: 2; }
  .table.cards.lead-table td.lead-who { flex-wrap: wrap; align-items: center; gap: 6px; }
  .lead-who .badge { margin-left: 0; }
  .lead-who-text small { max-width: 200px; }
}

.lead-empty { display: grid; gap: 14px; }
.lead-empty-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.lead-empty-cta .btn { margin-top: 0; }

.lead-ladder { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 10px; padding: 24px 22px 14px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, var(--marble), var(--paper-2)); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--line-2); }
.lead-ladder h2 { font: 400 26px/1.1 var(--serif); }
.lead-ladder p { font-size: 13.5px; line-height: 1.58; color: var(--ink-2); }
.lead-ranks { list-style: none; display: grid; margin: 6px 0 0; padding: 0; }
.lead-ranks li { display: grid; grid-template-columns: 30px minmax(min-content, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px dashed var(--line); }
.lead-ring { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 3px solid var(--ring); border-radius: 50%; background: var(--marble); box-shadow: 0 0 0 1px rgba(20, 17, 14, .12); font: 500 11px/1 var(--mono); color: var(--ink-2); }
.lead-ranks b { font: 400 18px/1.2 var(--serif); }
.lead-ranks .num { font: 500 11.5px/1 var(--mono); color: var(--muted); white-space: nowrap; }
@media (max-width: 980px) { .lead-ladder { position: static; } }

/* --------------------------------------------------------------------------------------- 6 the Hall of theses */

.theses-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.theses-field { flex: 0 1 280px; }
.theses-agent-filter { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.theses-agent-filter { min-width: 0; }
.theses-agent-filter .chip { cursor: pointer; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.theses-count { align-self: center; margin-left: auto; font: 500 12px/1.3 var(--mono); color: var(--muted); }
.theses-list { display: grid; gap: 24px; margin-top: 26px; }
.theses-empty { display: grid; gap: 14px; max-width: 660px; margin: 0 auto; }
.theses-more { display: flex; justify-content: center; margin-top: 28px; }
.theses-more:empty { display: none; }
@media (max-width: 640px) { .theses-field { flex: 1 1 100%; } .theses-count { margin-left: 0; } }

.theses-entry { position: relative; display: grid; gap: 12px; min-width: 0; padding: 26px 28px 20px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, var(--marble) 0%, var(--paper-2) 100%); box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .7), inset 0 0 0 6px var(--line-2), var(--shadow); }
.theses-entry::before { content: ''; position: absolute; left: 16px; right: 16px; top: -1px; height: 3px; border-radius: 0 0 2px 2px; background: var(--wing, var(--gold)); }
.theses-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.theses-agent { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.theses-agent-text { display: grid; min-width: 0; }
.theses-agent-text b { font: 400 19px/1.2 var(--serif); overflow-wrap: anywhere; transition: color .15s var(--ease); }
.theses-agent-text small { overflow: hidden; font: 400 12px/1.35 var(--mono); color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.theses-agent:hover b { color: var(--red-ink); }
.theses-score { display: grid; justify-items: end; gap: 6px; flex: none; }
.theses-pts { font: 400 32px/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.theses-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 500 10.5px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.theses-meta > * + *::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 14px; border: 1px solid currentColor; transform: rotate(45deg); vertical-align: 1px; opacity: .55; }
.theses-meta a { color: var(--wing, var(--red)); }
.theses-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.theses-title { font: 400 clamp(23px, 2.4vw, 29px)/1.18 var(--serif); letter-spacing: -0.012em; text-wrap: balance; }
.theses-excerpt { max-width: 52rem; font: 400 16.5px/1.62 var(--serif); color: var(--ink-2); text-wrap: pretty; }
.theses-full summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; min-height: 42px; cursor: pointer; font: 500 14px/1 var(--sans); color: var(--ink); }
.theses-full summary::-webkit-details-marker { display: none; }
.theses-full summary small { font-size: 11.5px; color: var(--muted); }
.theses-full summary:hover > span { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.theses-full .thesis-doc { margin-top: 8px; }
.theses-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.theses-foot > .link { margin-left: auto; }
@media (max-width: 640px) {
  .theses-entry { padding: 22px 16px 16px; }
  .theses-pts { font-size: 26px; }
  .theses-foot > .link { margin-left: 0; }
}
/* the trial link's bigger phone target (css/site.css) needs 8px between wrapped meta lines */
@media (max-width: 820px) { .theses-meta { row-gap: 8px; } }
@media (max-width: 520px) {
  /* the agent keeps a readable column; the points and laurel move under it when they would squeeze it */
  .theses-entry-head { flex-wrap: wrap; row-gap: 10px; }
  .theses-agent { flex: 1 1 14rem; }
  .theses-score { margin-left: auto; grid-auto-flow: column; align-items: center; }
}
