:root {
  --bg: #0d0f12; --panel: #15181d; --ink: #ece4cf; --dim: #9c937e; --gold: #e0b357; --red: #e4836f; --green: #7fd18b;
  --paper: #efe2c2; --line: rgba(224, 179, 87, 0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, "Helvetica Neue", Arial, sans-serif; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
h1, h2 { font-family: "Libre Baskerville", Georgia, serif; font-weight: 400; }
.top { border-bottom: 1px solid var(--line); padding: 28px 0 18px; background: radial-gradient(ellipse at 80% 0, rgba(255, 185, 90, 0.12), transparent 60%); }
.top h1 { margin: 0; font-size: 40px; letter-spacing: 2px; }
.lede { color: var(--dim); max-width: 760px; margin: 8px 0 12px; }
.links a { color: var(--gold); margin-right: 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.picker { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 18px 0 8px; }
.kinds button, .play, select {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; font: inherit; cursor: pointer;
}
.kinds button[aria-selected="true"] { border-color: var(--gold); color: var(--gold); }
/* secondary: a quiet segmented filter on its own row under the case-type tabs */
.filters { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13px; }
.filters::before { content: "Show"; color: var(--dim); margin-right: 8px; }
.filters button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); padding: 3px 8px; font: inherit; cursor: pointer; }
.filters button:hover { color: var(--ink); }
.filters button.on { color: var(--ink); border-bottom-color: var(--gold); }
.hint { color: var(--dim); font-size: 12px; margin-left: 4px; }
.sel { display: flex; gap: 8px; align-items: center; color: var(--dim); }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 6px 0; }
.case-title { font-family: "Libre Baskerville", Georgia, serif; font-size: 20px; }
.truth { color: var(--green); font-size: 14px; }
.controls { display: flex; align-items: center; gap: 12px; padding: 8px 0 14px; }
.controls input[type=range] { flex: 1; accent-color: var(--gold); }
.clock { font-variant-numeric: tabular-nums; min-width: 70px; color: var(--gold); }
.speed { color: var(--dim); }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .panels { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.panel h2 { font-size: 17px; margin: 0 0 8px; }
.panel h2 span { display: block; font-family: Inter, sans-serif; font-size: 12px; color: var(--dim); margin-top: 2px; }
.panel canvas { width: 100%; height: auto; display: block; border-radius: 4px; background: var(--paper); }
.status { display: flex; justify-content: space-between; margin: 8px 0 4px; font-size: 13px; color: var(--dim); }
.status b.solved { color: var(--gold); } .status b.unsolved { color: var(--red); }
.tray { display: flex; gap: 14px; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.tray span.on { color: var(--ink); }
.log { list-style: none; margin: 0; padding: 0; height: 190px; overflow-y: auto; font-size: 13px; border-top: 1px solid var(--line); }
.log li { padding: 6px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.log li .t { color: var(--gold); font-variant-numeric: tabular-nums; margin-right: 6px; }
.log li.future { opacity: 0.25; }
.results { margin: 30px 0; }
.results table { border-collapse: collapse; width: 100%; max-width: 900px; font-size: 14px; }
.results th, .results td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: right; }
.results th:first-child, .results td:first-child { text-align: left; }
.results tr.best td { color: var(--gold); }
.note { color: var(--dim); font-size: 13px; max-width: 900px; }
.foot { color: var(--dim); font-size: 12px; padding: 20px 16px 40px; }
.tbl { margin: 22px 0; max-width: 1100px; } .tbl img { width: 100%; border-radius: 6px; background: #fff; display: block; }
.tbl figcaption { color: var(--dim); font-size: 13px; margin-top: 6px; }
