:root {
  --ink: #19191e;
  --grey: #78787f;
  --rule: #dee0e6;
  --paper: #ffffff;
  --panel: #f5f6f8;
  --heat-s: 62%;
  --heat-l: 80%;
  --heat-ink: #19191e;
  --up: #2f8f55;
  --down: #c4473f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e8ec;
    --grey: #9a9aa3;
    --rule: #34363d;
    --paper: #141519;
    --panel: #1d1f24;
    --heat-s: 45%;
    --heat-l: 32%;
    --heat-ink: #f2f2f5;
    --up: #6cc48a;
    --down: #e87a72;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 16px 48px;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header, #scores, #filters, .legend, #prompts { max-width: 1800px; margin: 0 auto; }

header { padding: 28px 0 8px; }
.title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 26px; letter-spacing: -0.01em; }
nav a { color: var(--ink); margin-right: 18px; font-weight: 600; }
.lead { max-width: 950px; color: var(--grey); margin: 8px 0 0; }
.lead a { color: inherit; }

.heat { background: hsl(var(--h) var(--heat-s) var(--heat-l)); color: var(--heat-ink); }

#scores { overflow-x: auto; padding: 16px 0 4px; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 10px; text-align: right; white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey); font-weight: 600; }
th.judge { text-align: center; color: var(--ink); border-bottom: 2px solid var(--rule); }
th.gap, td.gap { padding: 0 6px; }
td:first-child, th:first-child { text-align: left; padding-left: 0; }
#score-body td.heat { font-weight: 600; }
tbody tr { border-top: 1px solid var(--rule); }
.gain { font-weight: 700; }
.gain.up { color: var(--up); }
.gain.down { color: var(--down); }
.note { color: var(--grey); font-size: 13px; margin: 6px 0 0; max-width: 950px; }

#filters {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding: 12px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
#filters label { color: var(--grey); font-size: 13px; white-space: nowrap; }
select, input[type="search"] { margin-left: 4px; font: inherit; font-size: 14px; color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 6px; }
input[type="search"] { width: 200px; margin-left: 0; }
#count { margin-left: auto; color: var(--grey); font-size: 13px; }
@media (max-width: 700px) {  /* one row to swipe through, so the bar stays on top without covering the screen */
  #filters { flex-wrap: nowrap; overflow-x: auto; gap: 16px; padding: 8px 0; }
  #count { margin-left: 0; white-space: nowrap; }
}

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding: 10px 0; color: var(--grey); font-size: 13px; }
.legend b { color: var(--ink); }
.scale { display: inline-flex; align-items: center; gap: 4px; }
.scale i { display: inline-block; width: 18px; height: 12px; border-radius: 3px; background: hsl(var(--h) var(--heat-s) var(--heat-l)); }

.prompt { padding: 26px 0 18px; border-bottom: 1px solid var(--rule); }
.prompt-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.prompt-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.prompt-head span { color: var(--grey); font-size: 13px; }
.questions { margin: 6px 0 12px; color: var(--grey); font-size: 13px; }
.questions span { margin-right: 16px; }
.questions b { color: var(--ink); font-weight: 600; }

.grid { display: grid; grid-template-columns: 74px repeat(9, minmax(0, 1fr)); gap: 8px 10px; align-items: start; }
@media (max-width: 1400px) { .grid { grid-template-columns: 74px repeat(9, 150px); overflow-x: auto; padding-bottom: 6px; } }
@media (max-width: 700px) { .grid { grid-template-columns: 58px repeat(9, 130px); } }
.model-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: end; }
.row-name { font-size: 12px; color: var(--grey); align-self: center; }
.cell { min-width: 0; }
.picture { aspect-ratio: 1; width: 100%; border-radius: 6px; background: var(--panel); object-fit: cover; display: block; cursor: zoom-in; }
.empty { aspect-ratio: 1; border-radius: 6px; border: 1px dashed var(--rule); display: flex; align-items: center; justify-content: center; color: var(--grey); font-size: 12px; }
.badges { display: flex; gap: 3px; margin-top: 4px; }
.badge { flex: 1; text-align: center; border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 20px; font-variant-numeric: tabular-nums; }

details { margin-top: 12px; color: var(--grey); font-size: 13px; }
summary { cursor: pointer; }
details p { color: var(--ink); max-width: 1100px; margin: 6px 0; }

.status { color: var(--grey); padding: 40px 0; }
#more { height: 1px; }

#viewer { position: fixed; inset: 0; z-index: 10; background: rgba(10, 10, 14, 0.82); display: flex; align-items: center; justify-content: center; padding: 16px; }
#viewer[hidden] { display: none; }
.viewer-box { position: relative; width: min(1250px, 100%); max-height: 100%; background: var(--paper); border-radius: 10px; padding: 16px 20px; overflow: auto; }
.close, .viewer-nav button { font: inherit; font-size: 20px; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 12px; cursor: pointer; }
.close { position: absolute; top: 12px; right: 12px; }
.viewer-head h3 { margin: 0 50px 2px 0; font-size: 18px; }
.viewer-head p { margin: 0 50px 10px 0; color: var(--grey); font-size: 13px; }
.viewer-pictures { display: flex; justify-content: center; gap: 24px; }
.viewer-pictures figure { margin: 0; width: min(40vh, 48%); }  /* small enough that the question scores show without scrolling */
.viewer-pictures img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.viewer-pictures figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.viewer-pictures .badges { margin: 0; flex: 0 0 150px; }
.viewer-pictures .drew { font-weight: 400; color: var(--grey); font-size: 12px; margin-top: 4px; max-height: 5.4em; overflow-y: auto; }
.viewer-nav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 14px; font-weight: 600; }
.viewer-questions table { width: 100%; }
.viewer-questions td, .viewer-questions th { padding: 4px 6px; }
.viewer-questions td.q { text-align: left; white-space: normal; }
.viewer-questions td.heat { text-align: center; min-width: 52px; font-weight: 600; }
.viewer-questions th.side { text-align: center; color: var(--ink); border-bottom: 2px solid var(--rule); }
.viewer-questions tr.gm td { border-top: 2px solid var(--rule); font-weight: 700; }
.skill { color: var(--grey); font-size: 12px; }
.hint { color: var(--grey); font-size: 12px; margin-top: 10px; }
@media (max-width: 800px) { .viewer-pictures { flex-direction: column; align-items: center; } .viewer-pictures figure { width: 100%; } }
