:root {
  --bg: #0a0e16;
  --bg-soft: #111726;
  --panel: #0f1422;
  --border: #1f2840;
  --text: #e7ecf5;
  --muted: #93a0b8;
  --accent: #5cc8ff;
  --steal: #ffb24d;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 70% -10%, #16203a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 22, 0.6);
  backdrop-filter: blur(6px);
}
.top-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 14px;
}
.top h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.3px;
}
.top .sub { margin: 0; color: var(--muted); }
.gh {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.gh:hover { text-decoration: underline; }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 20px 60px;
}

.intro { font-size: 18px; margin: 0 0 12px; }
.intro strong { color: var(--accent); }
.honest {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14.5px;
  border-left: 2px solid var(--border);
  padding-left: 14px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.btn {
  background: #15203a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; }
.speed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.speed input { accent-color: var(--accent); }
#speedVal { min-width: 36px; color: var(--text); }
.scrub {
  flex: 1 1 200px;
  min-width: 160px;
  accent-color: var(--accent);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 2px 22px;
  color: var(--muted);
  font-size: 14px;
}
.stats b { color: var(--text); font-variant-numeric: tabular-nums; }
#statTime { font-variant-numeric: tabular-nums; }

.panels {
  display: grid;
  grid-template-columns: minmax(0, 512px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 880px) {
  .panels { grid-template-columns: 1fr; }
}

.panel {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.panel.grow { display: flex; flex-direction: column; }

#fractal {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
  image-rendering: auto;
}
#lanes {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #0b101c;
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.key {
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.key-steal { background: rgba(255, 178, 77, 0.18); color: var(--steal); }

.chart-panel { margin-top: 22px; }
.chart-panel h2 { margin: 2px 0 6px; font-size: 19px; }
.chart-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; max-width: 70ch; }
#chart {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
}

.foot {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.foot p { max-width: 1040px; margin: 0 auto; padding: 18px 20px; }
