/* The scoreboard (held Tab) and the end-of-match graph. */
.scores {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(46rem, calc(100% - 2 * var(--space-4)));
  max-height: calc(100% - 2 * var(--space-4));
  padding: var(--space-4);
  border-color: var(--accent-line);
  /* A look, not a place to click: the map keeps every click beneath it. */
  pointer-events: none;
  z-index: 5;
}

.scores[hidden] {
  display: none;
}

.scores__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.scores__head > :last-child {
  margin-left: auto;
}

/* How close a new node is: a quiet band between the head and the players. */
.scores__nodes {
  display: grid;
  gap: 0.15rem;
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--node);
  background: var(--bg-2);
  font-size: var(--text-sm);
  color: var(--text);
}

.scores__nodes:empty {
  display: none;
}

.scores__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.scores__table th {
  font: 600 var(--text-xs) / 1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: right;
  padding: 0 var(--space-2) var(--space-2);
}

.scores__table th:first-child,
.scores__table th:nth-child(2) {
  text-align: left;
}

.scores__table td {
  padding: 0.3rem var(--space-2);
  border-top: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scores__table td:first-child,
.scores__table td:nth-child(2) {
  text-align: left;
}

.scores__table tr[data-me='true'] td {
  background: var(--accent-soft);
}

.scores__table tr[data-out='true'] td {
  opacity: 0.55;
}

.scores__who {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.scores__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.scores__short {
  display: none;
}

/*
 * Phones: the results table fits inside the screen. The rows are already in
 * finishing order and the title names the winner, so the place column and
 * the Winner tag step aside; the rest get fixed widths and short headings,
 * and a long name is cut with an ellipsis.
 */
:root:is([data-phone='true'], [data-tight='true']) .results .scores__table {
  table-layout: fixed;
  font-size: var(--text-xs);
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table :is(th, td) {
  padding-inline: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table th {
  letter-spacing: 0.02em;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table :is(th, td):first-child,
:root:is([data-phone='true'], [data-tight='true']) .results .scores__who .tag {
  display: none;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table th:nth-child(n + 3) {
  width: 2.5rem;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table th:nth-child(4) {
  width: 2.9rem;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__table th:last-child {
  width: 2.7rem;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__long {
  display: none;
}

:root:is([data-phone='true'], [data-tight='true']) .results .scores__short {
  display: inline;
}

.scores__hint {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
}

/* End of match: everyone's energy through the match, one line each. */
.graph {
  display: block;
  width: 100%;
  height: 8.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-0);
}

.graph__caption {
  display: flex;
  justify-content: space-between;
  font: var(--text-xs) / 1.2 var(--font-mono);
  color: var(--text-dim);
}
