/* Scoreboard rows (shared with results), robot integrity meter, auto-advance ring. */

.panel.scores-dock { max-height: 50%; padding-bottom: calc(var(--reactions-h) + 10px + var(--safe-b)); }
.scores-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.advance { position: relative; width: 44px; height: 44px; flex: none; }
.advance svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.advance-track { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 4; }
.advance-fill {
  fill: none;
  stroke: var(--c-yellow);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 4px var(--c-yellow));
  animation: advance-drain 8s linear both;
}
.advance.is-paused .advance-fill { animation-play-state: paused; stroke: var(--c-faint); filter: none; }
.advance-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--c-yellow);
}
@keyframes advance-drain { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }

.core-meter {
  --core: var(--c-pink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--field);
  border: 1px solid color-mix(in srgb, var(--core) 45%, transparent);
}
.core-meter[data-state="mid"] { --core: var(--c-yellow); }
.core-meter[data-state="low"], .core-meter[data-state="dead"] { --core: var(--c-green); }
.core-meter-label {
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-dim);
}
.core-meter-bar { flex: 1; min-width: 40px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.core-meter-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, var(--core) 0 10px, color-mix(in srgb, var(--core) 60%, #000) 10px 12px);
  box-shadow: 0 0 12px var(--core);
  transform-origin: 0 50%;
}
.core-meter-value { font-family: var(--font-display); font-size: 0.66rem; font-weight: 700; color: var(--core); white-space: nowrap; }

.score-table { display: flex; flex-direction: column; gap: 6px; }
.score-row {
  --seat: var(--c-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 6px 12px 6px 8px;
  border-radius: 14px;
  background: var(--field);
  border-left: 4px solid var(--seat);
  animation: row-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  animation-delay: calc(var(--i) * 0.07s);
}
.score-row.is-me { background: color-mix(in srgb, var(--seat) 13%, transparent); }
.score-row.is-top { box-shadow: inset 0 0 0 1px rgba(255, 204, 0, 0.5); }
.score-rank {
  width: 26px;
  flex: none;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.95rem;
  text-align: center;
  color: var(--c-faint);
}
.score-row.is-top .score-rank { color: var(--c-yellow); text-shadow: 0 0 12px rgba(255, 204, 0, 0.7); }
.score-avatar { flex: none; font-size: 1.5rem; line-height: 1; }
.score-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.score-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-pips { display: flex; gap: 3px; flex-wrap: wrap; }
.pip {
  width: 15px; height: 15px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}
.pip-ok { background: rgba(0, 255, 136, 0.2); color: var(--c-green); }
.pip-dead { background: rgba(255, 51, 85, 0.2); color: var(--c-red); }
.score-award {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 204, 0, 0.14);
  color: var(--c-yellow);
  font-size: 0.72rem;
  font-weight: 700;
}
.score-delta { font-family: var(--font-display); font-size: 0.68rem; font-weight: 700; color: var(--c-green); white-space: nowrap; }
.score-calls { font-family: var(--font-display); font-size: 0.62rem; font-weight: 700; color: var(--c-yellow); white-space: nowrap; }
.score-likes { font-size: 0.74rem; font-weight: 700; color: var(--c-pink); white-space: nowrap; }
.score-points {
  min-width: 52px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  text-align: right;
  color: var(--c-text);
}
@keyframes row-in { from { opacity: 0; transform: translateX(24px); } }

.scores-foot { flex-direction: row; align-items: center; }
.scores-foot .btn-primary { flex: 1; min-height: 58px; }
.scores-wait {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-dim);
  text-align: center;
}

/* Phones in portrait: the top bar already carries the robot meter, the rows get the room. */
@media (orientation: portrait) {
  .scores-core { display: none; }
  .score-row { min-height: 48px; padding-top: 4px; padding-bottom: 4px; }
}

@media (orientation: landscape) and (min-width: 700px) {
  .panel.scores-dock { max-height: none; padding-bottom: calc(20px + var(--safe-b)); }
}
