/* The replay page. The board is the subject, so it gets the space and the
   light; everything else is a quiet read-out beneath it. */

.stage {
  background:
    radial-gradient(120% 90% at 50% -20%, #23201a 0%, transparent 70%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}

/* --- scoreboard --- */

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.scoreboard .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.scoreboard .who.right { justify-content: flex-end; }
.scoreboard .swatch {
  width: 10px; height: 26px; border-radius: 3px; flex: none;
}
.scoreboard .name {
  font-family: var(--display);
  font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scoreboard .cash {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.scoreboard .middle { text-align: center; }
.scoreboard .vs {
  font-size: 11px; letter-spacing: .12em; color: var(--dimmer); text-transform: uppercase;
}
.scoreboard .meta { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.ahead { color: var(--leaf); }
.behind { color: var(--dim); }

/* --- boards --- */

.boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  justify-items: center;
}
@media (max-width: 820px) { .boards { grid-template-columns: 1fr; } }

.board { margin: 0; width: 100%; max-width: 500px; }
.board figcaption {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  margin-bottom: 7px;
}
.board canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border-radius: 10px;
  background: #2a2016;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 10px 26px rgba(0,0,0,.45);
  image-rendering: pixelated;
}

/* --- transport --- */

.transport {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px;
}
.play {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; padding: 0; flex: none;
}
.transport input[type=range] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}
.transport select { padding: 4px 8px; font-size: 12px; }
.clock {
  font-size: 12px; color: var(--dim);
  min-width: 152px; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A thin ribbon under the scrubber showing who led, moment to moment. */
.track {
  height: 5px; margin-top: 9px; border-radius: 3px;
  overflow: hidden; display: flex;
  background: var(--panel-2);
}
.track span { display: block; height: 100%; }

/* --- charts --- */

.chart { width: 100%; height: 210px; }
.chart.short { height: 130px; }
.u-legend { font-size: 11px; font-family: var(--mono); }
.uplot { width: 100% !important; }
.u-title { color: var(--fg); }

/* --- revenue bars --- */

.bars { display: grid; gap: 7px; }
.bar-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  align-items: center; gap: 10px;
  font-size: 12px;
}
.bar-row .label { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.bar-track { display: flex; gap: 3px; height: 15px; }
.bar-track i { display: block; border-radius: 2px; min-width: 1px; }
.bar-row .value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  color: var(--dim); font-size: 11px;
}

/* --- composition stacks --- */

.comp-pair { display: grid; gap: 14px; }
.side-label {
  font-family: var(--mono); font-size: 11px; color: var(--dim);
  margin: 0 0 6px; font-weight: 400;
}
.stack { display: flex; gap: 2px; align-items: flex-end; height: 92px; }
.stack .day {
  flex: 1; height: 100%;
  display: flex; flex-direction: column-reverse;
  border-radius: 2px; overflow: hidden;
}
.stack .day i { display: block; width: 100%; }

.legend {
  display: flex; gap: 11px; flex-wrap: wrap;
  margin-top: 12px; font-size: 11px; color: var(--dim);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* --- market --- */

.product-toggle { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.product-toggle button {
  background: transparent; color: var(--dimmer);
  border: 1px solid var(--line); padding: 2px 8px;
  font-size: 10px; font-family: var(--mono); font-weight: 400;
  letter-spacing: .03em;
}
.product-toggle button.on { color: var(--bg); border-color: transparent; }
.floor-note { margin-top: 10px; font-size: 12px; color: var(--dim); }
.floor-note b { color: var(--clay); }

/* --- sales heatmap --- */

.sales { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 2px; font-family: var(--mono); font-size: 10px; }
.heat th {
  color: var(--dimmer); font-weight: 400; font-size: 10px;
  padding: 0 4px; white-space: nowrap; text-align: right;
}
.heat th.day { text-align: center; padding: 0; }
.heat td { padding: 0; }
.heat td div { width: 13px; height: 13px; border-radius: 2px; background: var(--panel-2); }
