/* BackgammonX v0.2.23 — 18-x23-session.css
   Owns: the look of the three session sections built by js/33-x23-session.js —
   Game History, Game Stats & Report and Game Clock — and the little text box
   that shows a report or the move list when the clipboard is not available.

   PRESENTATION ONLY, and override-only: this file sits after css/17 and never
   edits css/01-17. Every rule's SUBJECT (the right-most compound selector) is
   one of this file's own classes (.bgx-history*, .bgx-stats*, .bgx-clock*,
   .bgx-session-*) and nothing here sizes, positions or transforms the board,
   the checkers, the rails, the hit targets, the dice layers or the rotation
   stage. The sections are ordinary page content inside the section stack that
   js/28 already owns; their colours come from the --x-* tokens of css/16, so
   Light and Dark both follow without a second set of rules except where a
   Light value has to be restated for contrast.

   Colour is never the only cue: every history row carries the player's NAME
   as text (the coloured edge is a second cue), the active clock is also the
   one the status line names, and a paused or stopped clock says so in words. */

:root { --bgx-css-18: 1; }

/* A rule that sets `display` must not defeat the hidden attribute. */
.bgx-history-list[hidden],
.bgx-history-empty[hidden],
.bgx-session-note[hidden] { display: none; }

.bgx-history, .bgx-stats, .bgx-clock { color: var(--text); }

.bgx-session-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bgx-session-note { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }

/* ── Game History ───────────────────────────────────────────────────── */
.bgx-history-empty { margin: 0; padding: 12px; font-size: 13.5px; color: var(--text-muted); border: 1px dashed var(--x-line); border-radius: var(--x-radius-sm); }
.bgx-history-list {
  box-sizing: border-box;
  max-height: 340px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--x-line-soft);
  border-radius: var(--x-radius-sm);
  background-color: var(--x-panel-2);
}
.bgx-history-list:focus-visible { outline: 2px solid var(--x-focus); outline-offset: 2px; }
.bgx-history-row {
  display: grid;
  grid-template-columns: 2.2em minmax(4.5em, 9em) 3.4em minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--x-line-soft);
  border-left: 4px solid var(--bgx-p1-mid, #62b5ff);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.bgx-history-row[data-side="P2"] { border-left-color: var(--bgx-p2-mid, #ff6675); }
.bgx-history-n { text-align: right; color: var(--text-muted); }
.bgx-history-who { min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: var(--x-text); }
.bgx-history-dice { font-weight: 700; color: var(--x-gold-bright); }
.bgx-history-move { min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; color: var(--x-text); }
.bgx-history-row[data-no-move="true"] .bgx-history-move { font-family: inherit; font-style: italic; color: var(--text-muted); }
.bgx-history-tag { margin-left: 8px; font-family: Arial, Helvetica, sans-serif; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.bgx-history-result { padding: 10px 12px; font-weight: 700; color: var(--x-gold-bright); border-left: 4px solid var(--x-gold); }
@media (max-width: 479px) {
  .bgx-history-row { grid-template-columns: 2em minmax(0, 1fr) 3em; }
  .bgx-history-move { grid-column: 2 / -1; }
}

/* ── Game Stats & Report ────────────────────────────────────────────── */
.bgx-stats-scroll { overflow-x: auto; }
.bgx-stats-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bgx-stats-caption { padding: 0 0 6px; text-align: left; font-size: 12px; color: var(--text-muted); }
.bgx-stats-table th, .bgx-stats-table td { padding: 6px 8px; border-bottom: 1px solid var(--x-line-soft); }
.bgx-stats-table thead th { text-align: right; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); overflow-wrap: anywhere; }
.bgx-stats-table thead th:first-child { text-align: left; }
.bgx-stats-table tbody th { text-align: left; font-weight: 600; color: var(--x-text-dim); }
.bgx-stats-table td { text-align: right; font-weight: 700; color: var(--x-text); }

/* ── Game Clock ─────────────────────────────────────────────────────── */
.bgx-clock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bgx-clock-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--x-line-soft);
  border-radius: var(--x-radius-sm);
  background-color: var(--x-panel-2);
}
.bgx-clock-cell[data-active="true"] { border-color: var(--x-gold); box-shadow: 0 0 0 1px var(--x-gold-dim); }
.bgx-clock-name { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); overflow-wrap: anywhere; }
.bgx-clock-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: calc(1.5rem * var(--text-scale, 1));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--x-text);
}
.bgx-clock-status { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); }
@media (max-width: 479px) {
  .bgx-clock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bgx-clock-total { grid-column: 1 / -1; }
}

/* ── The text box that shows a report or the moves ──────────────────── */
.bgx-session-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 220px;
  padding: 8px;
  border: 1px solid var(--x-line);
  border-radius: var(--x-radius-sm);
  background-color: var(--x-panel-2);
  color: var(--x-text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  resize: vertical;
}
.bgx-session-text:focus-visible { outline: 2px solid var(--x-focus); outline-offset: 2px; }
