.board-area { --eval-bar-h: 14px; }

.eval-wrap {
  position: relative;
  /* flex-shrink:0 or the thin bar is first squashed when a tall board overflows the 85vh column. */
  flex-shrink: 0;
  box-sizing: border-box;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-top: 0;
  border-bottom: 0;
}

/* Track offsets mirror .board-wrap's border+padding+gutter so it lines up with .board-grid. */
.eval-bar-h {
  position: relative;
  box-sizing: border-box;
  margin-left: calc(var(--board-label-width, 20px) + 14px);
  margin-right: 10px;
  height: var(--eval-bar-h);
  overflow: hidden;
  background: var(--eval-right-color, var(--p2-color));
}
/* Only where a hover card is actually rendered — evalBarHtml sets .has-tip. */
.eval-wrap.has-tip .eval-bar-h { cursor: help; }

.eval-bar-h .eval-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--eval-left-color, var(--p1-color));
  /* THE boundary. The two ends are matched in tone, so to a red-green dichromat the bar is
     one flat colour and the fill edge is the only thing that says who leads. Lightness,
     not hue, so it survives every palette and greyscale. */
  border-right: 2px solid var(--ink);
  transition: width 0.45s ease;
}

.eval-tick {
  position: absolute;
  top: 0; bottom: 0;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}
.eval-tick-25 { left: 25%; }
.eval-tick-75 { left: 75%; }
.eval-tick-25,
.eval-tick-75 {
  width: 1px;
  background: rgba(255, 255, 255, 0.5);
}
.eval-tick-50 {
  left: 50%;
  width: 3px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.eval-tip {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 60;
  min-width: 220px;
  padding: 11px 13px;
  background: rgba(22, 20, 17, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}
.eval-wrap:hover .eval-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.eval-tip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(22, 20, 17, 0.97);
}

.eval-tip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}
.eval-tip-title {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.eval-tip-verdict { font-size: 1rem; font-weight: 800; }

.eval-tip-gauge {
  position: relative;
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--eval-right-color, var(--p2-color));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  margin-bottom: 10px;
}
.eval-tip-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--eval-left-color, var(--p1-color));
}
.eval-tip-pct {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.64rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.eval-tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  font-size: 0.8rem;
}
.eval-tip-row + .eval-tip-row { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.eval-tip-label { color: var(--text-muted); }
.eval-tip-vals {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.eval-tip-vals i {
  font-style: normal;
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.eval-tip-gen { text-transform: capitalize; }
.eval-tip-gen.is-alive { color: var(--accent-green); }
.eval-tip-gen.is-dead  { color: var(--accent-red); }

@media (prefers-reduced-motion: reduce) {
  .eval-bar-h .eval-fill { transition: none; }
  .eval-tip { transition: none; }
}

/* Whose end is whose. The fill's direction shows WHO leads; these say WHO is which side,
   which the colours can no longer do now that either player may wear any livery. */
.eval-ends {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
  margin-left: calc(var(--board-label-width, 20px) + 14px);
  margin-right: 10px;
  margin-bottom: 3px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.eval-end { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Neutral, not the seat colour: --p1 is dark by design and fails AA as small text on this
   panel. The SIDE is carried by position — these sit directly over the half they name. */
.eval-end-l { color: var(--ink-2); text-align: left; }
.eval-end-r { color: var(--ink-2); text-align: right; }
