/* The pace panel (js/pace-panel.js): a castaway's climb against the clock.
 *
 * Shared by the exhibit's castaway and /catan's, so it leans on nothing
 * either page's sheet has that the other lacks: the hairlines, the inks, the
 * gold and the ladder of type sizes, which both define.
 */

.climb-top {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.climb-now { font-size: var(--fs-1); font-weight: 700; line-height: 1; color: var(--ink); }
.climb-of { font-size: var(--fs-n4); color: var(--ink-3); letter-spacing: 0.04em; flex: 1; }
.climb-pct { font-size: var(--fs-n3); font-weight: 700; color: var(--gold); }

/* The chart and par's dots over it (pace-panel.js). The dots' layer is the
   chart's own 64px, so a percent down it is a percent down the chart. */
.climb-plot { position: relative; margin-top: 8px; }
.climb-dots {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 64px;
  pointer-events: none;
}
.climb-dots i {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;      /* whole pixels, or the dot is drawn soft */
  border-radius: 50%;
  background: var(--gold);
}

.climb-chart {
  display: block;
  width: 100%;
  height: 64px;
  overflow: visible;
  background:
    linear-gradient(180deg, transparent calc(50% - 0.5px), var(--hair) calc(50% - 0.5px),
      var(--hair) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  border-bottom: 1px solid var(--hair-strong);
}
/* The rolls chart's vocabulary: solid is what happened, the gold dash is
   the expectation, which here is par. The target is the chart's ceiling, a
   plain hairline; the best run is the same solid line as this one, dimmed,
   in the color of whoever ran it. */
.climb-goal { stroke: var(--hair-strong); stroke-width: 1; }
.climb-par { fill: none; stroke: var(--gold-line, rgba(245, 197, 66, 0.5)); stroke-width: 1; stroke-dasharray: 3 3; }
.climb-best { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.42; }
.climb-run { fill: none; stroke-width: 2; stroke-linejoin: round; }

.climb-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: var(--fs-n5);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* The ground's worth against the target, by resource. */
.climb-track {
  display: flex;
  height: 9px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.32);
}
.climb-track span {
  display: block;
  height: 100%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.climb-key {
  margin-top: 6px;
  font-size: var(--fs-n5);
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

/* The splits, under the chart in the same panel. */
.splits {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--hair);
}

.split-row {
  display: grid;
  grid-template-columns: 3.4em 1fr 1fr 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-n3);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.split-row > span:not(.split-line) { text-align: right; }
.split-head {
  font-size: var(--fs-n5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  border-bottom: 1px solid var(--hair);
  border-radius: 0;
  margin-bottom: 2px;
}
.split-line { font-weight: 700; }
.split-row.is-done { color: var(--ink-2); }
.split-row.is-done .split-turn { color: var(--ink); font-weight: 700; }
.split-row.is-next { background: rgba(245, 197, 66, 0.08); color: var(--ink-2); }
.split-row.is-next .split-line { color: var(--gold); }
.split-par { color: var(--ink-4); }
/* Against the best run: green ahead of it (the grow lens's green, which
   means the same good thing there), red behind it, and the accent level with
   it. One weight for all three. */
.split-delta { font-weight: 700; }
.split-delta.is-ahead { color: #3FD27A; }
.split-delta.is-even { color: var(--gold); }
.split-delta.is-behind { color: var(--robber-lit, #ff9b7a); }

@media (prefers-reduced-motion: reduce) {
  .climb-track span { transition: none; }
}
