/*
 * Move list (<monolith-move-list>, web/src/ui/move-list.js): a pure list
 * (WP04); stepping and 'Start from here on' are the board controls'.
 * Tokens only.
 *
 * Desktop (moves column, layout.css): numbered turns that fill the column and
 * scroll inside it (--move-list-max-height, set by the layout).
 * Phone (below 720 px): a compact horizontal strip that scrolls on its own,
 * with the current move centred; the page itself never scrolls sideways
 * (FR-021). The current move is a selection, not a second primary action:
 * an accent-tinted background, an accent bar on its left, bold text and a
 * triangle, so it does not rely on colour alone (NFR-008).
 */

monolith-move-list,
.move-list {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.move-list__turns {
  display: grid;
  gap: var(--space-1);
  max-height: var(--move-list-max-height, 24rem);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.move-list__turn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.move-list__number {
  min-width: 3ch;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.move-list__entry {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1 1 0;
  min-width: 0;
}

.move-list__move {
  min-height: var(--touch-target);
  padding: var(--space-1) var(--space-2);
  border-color: transparent;
  background: transparent;
  font-family: var(--font-mono);
}

.move-list__move[aria-current] {
  border-color: transparent;
  box-shadow: inset 4px 0 0 var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 14%, var(--color-surface));
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
}

.move-list__move[aria-current]:hover {
  background: color-mix(in srgb, var(--color-accent) 22%, var(--color-surface));
}

/* The marker's room is kept on every move, so selecting one does not push
   its annotation out of line with the others. */
.move-list__move::before {
  content: "\25B8";
  visibility: hidden;
}

.move-list__move[aria-current]::before {
  visibility: visible;
}

.move-list__extras:empty {
  display: none;
}

/* The narrow moves column of the three-column layout: slightly tighter
   annotation columns ("Inaccuracy" still fits; depth is at most "d16"). */
@media (min-width: 1100px) {
  .move-list .move-extras {
    grid-template-columns: 2.5ch 10ch 4ch 4.5ch;
  }

  .move-list__move {
    padding-inline: var(--space-1);
  }
}

@media (max-width: 719.98px) {
  .move-list__turns {
    display: flex;
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .move-list__turn,
  .move-list__entry {
    flex: 0 0 auto;
  }

  .move-list__turn {
    scroll-snap-align: center;
  }
}

/*
 * Players line and deviation marks (computer-opponent mission WP10). A mark
 * is its own badge after the move's annotation, outlined and with an icon
 * and the words "2nd" / "3rd": the meaning is in the text, not the colour.
 * The legend and the "cannot be reproduced" notice sit under the list. The
 * detail panel's sentence for a marked move shares the icon.
 */
.move-list__players {
  margin: 0;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.move-list__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.25ch;
  flex: 0 0 auto;
  padding: 0 var(--space-1);
  border: 1px solid var(--color-info);
  border-radius: var(--radius-sm);
  color: var(--color-info);
  background: var(--color-info-surface);
  font-size: 0.875em;
  white-space: nowrap;
}

.move-list__legend,
.move-list__notice {
  margin: 0;
  font-size: 0.875em;
}

.move-list__legend {
  color: var(--color-text-muted);
}

.move-list__notice {
  padding: var(--space-1) var(--space-2);
  border-left: 4px solid var(--color-warning);
  background: var(--color-warning-surface);
  color: var(--color-text);
}

.detail-panel__level-choice {
  display: flex;
  gap: var(--space-1);
  align-items: baseline;
  margin: 0;
  color: var(--color-info);
}
