:root {
  --bg: #0a0f0d;
  --bg-2: #111816;
  --panel: #101715;
  --panel-2: #0d1311;
  --ink: #d4f7df;
  --muted: #7aa18a;
  --line: rgba(112, 182, 132, 0.18);
  --accent: #7ef0a3;
  --accent-2: #38c8ff;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas", monospace;
  background:
    radial-gradient(circle at top left, rgba(56, 200, 255, 0.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(126, 240, 163, 0.08), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

.benchmark-layout {
  width: min(1360px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 12px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow-y: auto;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.8rem;
  line-height: 1;
  max-width: 12ch;
  margin-bottom: 10px;
  text-transform: lowercase;
}

.lede {
  max-width: 28ch;
  font-size: 0.88rem;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 14px;
}

.benchmark-main {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 320px;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.benchmark-side {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.terminal {
  background:
    linear-gradient(180deg, rgba(126, 240, 163, 0.04), transparent 18%),
    var(--panel-2);
}

.benchmark-side .panel,
.benchmark-main > .panel {
  min-height: 0;
}

.benchmark-side .panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: lowercase;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.section-label {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.compact-text p {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-name {
  margin: 0;
}

.author-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--accent-2);
  border: 1px solid var(--line);
  background: rgba(56, 200, 255, 0.06);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.icon-link:hover,
.icon-link:focus {
  color: var(--accent);
  border-color: rgba(126, 240, 163, 0.32);
  background: rgba(126, 240, 163, 0.1);
  transform: translateY(-1px);
}

.icon-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.button {
  border: 0;
  border-radius: 0;
  padding: 8px 10px;
  background: linear-gradient(180deg, #183227, #11241c);
  color: var(--ink);
  font: inherit;
  text-transform: lowercase;
  cursor: pointer;
  border: 1px solid var(--line);
}

.button.secondary {
  background: #0b110f;
}

.button.accent {
  background: linear-gradient(180deg, #103425, #0f2a20);
  color: var(--accent);
}

.sidebar-link {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus {
  text-decoration: underline;
}

#simulate-board-button {
  width: auto;
  justify-self: start;
  padding-inline: 12px;
}

#benchmark-play-button,
#benchmark-pause-button {
  min-width: 70px;
}

.slider-label {
  text-transform: lowercase;
  font-size: 0.74rem;
}

input[type="range"] {
  width: 100%;
}

pre {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.8rem/1.45 "SFMono-Regular", "Menlo", monospace;
  color: var(--ink);
  padding-right: 8px;
}

.leaderboard-table {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 240, 163, 0.38) transparent;
  padding-bottom: 4px;
}

.leaderboard-table::-webkit-scrollbar {
  height: 10px;
}

.leaderboard-table::-webkit-scrollbar-track {
  background: transparent;
}

.leaderboard-table::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(56, 200, 255, 0.22), rgba(126, 240, 163, 0.42));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.leaderboard-table::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, rgba(56, 200, 255, 0.3), rgba(126, 240, 163, 0.54));
  border: 2px solid transparent;
  background-clip: padding-box;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

th[data-sort-key] {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(126, 240, 163, 0.06);
}

.viewer-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  margin-bottom: 8px;
}

#benchmark-view-canvas {
  width: min(100%, 220px);
  height: auto;
  display: block;
  margin: 0 auto 12px;
  border-radius: 0;
  background: #050908;
  border: 1px solid var(--line);
}

.viewer-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.viewer-slider {
  margin-bottom: 12px;
}

.empty-state {
  color: var(--muted);
}

.panel-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 920px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .benchmark-layout {
    grid-template-columns: 1fr;
    width: calc(100vw - 16px);
    height: auto;
    margin: 8px auto;
  }

  .benchmark-main {
    grid-template-columns: 1fr;
  }
}
