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

.eval-wrap {
  position: relative;
  /* .board-area is a max-height:85vh column flex; without this the thin bar is the
     first thing squashed when a tall board overflows (board-wrap is flex-shrink:0). */
  flex-shrink: 0;
  margin-inline-start: var(--board-label-width, 16px);
  margin-top: 4px;
  margin-bottom: 4px;
}

.eval-bar-h {
  position: relative;
  box-sizing: border-box;
  width: calc(var(--board-size, 16) * var(--cell-size));
  max-width: 100%;
  height: var(--eval-bar-h);
  border-radius: 7px;
  overflow: hidden;
  background: var(--eval-right-color, var(--p2-color));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  cursor: help;
}

.eval-bar-h .eval-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--eval-left-color, var(--p1-color));
  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; }
}
