/* BEAM evolution history and the single-robot page. Two or three columns on one screen, as the lab. */

.evolution {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  padding: 12px 14px;
  flex: 1;
  min-height: 0;
}
.evolution > * { min-width: 0; min-height: 0; overflow-y: auto; }

@media (max-width: 1100px) {
  .evolution { grid-template-columns: minmax(0, 1fr); }
  .evolution > * { overflow: visible; }
}

.slider { margin-top: 14px; }
.slider input { width: 100%; accent-color: var(--accent); }

.evolution .map { grid-template-columns: 150px repeat(4, minmax(0, 1fr)); margin-top: 8px; }
.evolution .map .cell { aspect-ratio: 1.7; }
.evolution .map .cell.fresh-here { border-color: var(--accent3); }
.evolution .map .cell .id { position: absolute; right: 3px; bottom: 0; color: var(--dim); }

.epochs-list { list-style: none; margin: 0; padding: 0; }
.epochs-list > li { border-top: 1px solid var(--line); padding: 8px 0; }
.epochs-list .head { display: flex; justify-content: space-between; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.epochs-list .head span:last-child { color: var(--dim); }
.epochs-list .new { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 4px; margin-top: 6px; }
.thumb {
  display: block;
  position: relative;
  border: 1px solid var(--line);
  aspect-ratio: 1.4;
  color: var(--fg);
  text-decoration: none;
}
.thumb:hover { border-color: var(--fg); text-decoration: none; }
.thumb svg { position: absolute; inset: 2px 2px 13px; width: calc(100% - 4px); height: calc(100% - 15px); }
.thumb span { position: absolute; left: 3px; bottom: 0; font-variant-numeric: tabular-nums; }
.thumb span.r { left: auto; right: 3px; color: var(--dim); }

/* robot.html */
.robot-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px) minmax(280px, 340px);
  gap: 14px;
  padding: 12px 14px;
  flex: 1;
  min-height: 0;
}
.robot-page > * { min-width: 0; min-height: 0; overflow-y: auto; }
.robot-page .viewer { overflow: hidden; }
@media (max-width: 1100px) {
  .robot-page { grid-template-columns: minmax(0, 1fr); }
  .robot-page > * { overflow: visible; }
  .robot-page .stage { height: 70vh; }
}
.film { display: block; margin-bottom: 12px; }
.film img { display: block; width: 100%; height: auto; }
.lineage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lineage-list li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; align-items: center; }
.lineage-list .what { color: var(--dim); text-transform: uppercase; }
.lineage-list .what b { color: var(--fg); font-weight: normal; }
.actions { display: grid; gap: 6px; margin: 4px 0 14px; text-transform: uppercase; }
.actions button, .actions a { text-align: left; }
.scores { display: grid; grid-template-columns: auto 1fr; gap: 1px 14px; margin: 0 0 14px; text-transform: uppercase; }
.scores dt { color: var(--dim); }
.scores dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* The best robots, first: the current champions by merit. */
.best { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 4px; }
.best .thumb { aspect-ratio: 1.15; }
.best .thumb svg { inset: 4px 4px 34px; height: calc(100% - 38px); }
.best .thumb .rank { position: absolute; left: 6px; top: 4px; font-size: 18px; color: var(--accent); }
.best .thumb .merit { position: absolute; left: 6px; bottom: 17px; font-size: 14px; }
.best .thumb .r { top: 6px; bottom: auto; }
.best .thumb .kind { position: absolute; left: 6px; right: 6px; bottom: 2px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }

/* board.html: one robot's boards in KiCanvas, filling the page below the bar */
.board-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-page > h2, .board-page > p { padding: 0 14px; }
.board-page kicanvas-embed { flex: 1; width: 100%; height: 100%; min-height: 70vh; }
.bar .boards a.on { color: var(--fg); text-decoration: underline; }
.board-credit { padding: 6px 14px; border-top: 1px solid var(--line); color: var(--dim); text-transform: uppercase; }

/* print.html: the print bed beside the list of parts */
.print-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 14px; padding: 12px 14px; flex: 1; min-height: 0; }
.print-page > * { min-width: 0; min-height: 0; overflow-y: auto; }
.print-page .viewer { overflow: hidden; }
.print-page table.parts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.print-page table.parts td { border-top: 1px solid var(--line); padding: 3px 6px 3px 0; vertical-align: top; }
.print-page table.parts td:nth-child(2) { color: var(--dim); white-space: nowrap; }
.print-page table.parts td:nth-child(3) { color: var(--accent); }
@media (max-width: 1100px) {
  .print-page { grid-template-columns: minmax(0, 1fr); }
  .print-page > * { overflow: visible; }
  .print-page .stage { height: 70vh; }
}

/* archive.html: filters, then a grid of robot cards */
.archive-page { padding: 12px 14px 40px; display: grid; gap: 12px; }
.archive-page .filters { display: grid; gap: 4px; text-transform: uppercase; }
.archive-page .row { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.archive-page .label { color: var(--dim); width: 60px; }
.archive-page .filters button { color: var(--dim); }
.archive-page .filters button.on { color: var(--fg); text-decoration: underline; }
.archive-page .find { font: inherit; letter-spacing: inherit; color: var(--fg); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 1px 0; width: 14ch; }
.archive-page .legend { margin: 0; }
.archive-page .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.archive-page .card { display: grid; gap: 2px; border: 1px solid var(--line); padding: 4px 6px 6px; color: var(--fg); text-decoration: none; }
.archive-page .card:hover { border-color: var(--fg); text-decoration: none; }
.archive-page .card .drawing { aspect-ratio: 1.6; display: grid; place-items: center; color: var(--dim); }
.archive-page .card .drawing svg { width: 100%; height: 100%; }
.archive-page .card .top { display: flex; gap: 6px; font-variant-numeric: tabular-nums; }
.archive-page .card .merit { margin-left: auto; color: var(--accent); }
.archive-page .card .meta { color: var(--dim); font-size: 10px; min-height: 1.4em; }
.archive-page .more { justify-self: start; }
.archive-page .tag { color: var(--accent); }

/* A version's premise (<line>/premise.md), at the top of its page. */
.premise { max-width: 72ch; margin-bottom: 26px; }
.premise p { text-transform: none; margin: 8px 0; }
.premise ul { margin: 8px 0; padding-left: 1.2em; text-transform: none; }
.premise li { margin: 3px 0; }
