/* BackgammonX v0.2.23 — 19-x23-saves.css
   Owns: the look of the save/resume tools built by js/34-x23-saves.js — the
   saves row under the Turn & Dice panel (Save Game…, Resume / Load…, Clear
   Autosave and the autosave status line) and the Saved games dialog (the
   list of saves with Load / Export / Delete, the Import box and the text box
   that shows an exported save when the clipboard is not available).

   PRESENTATION ONLY, and override-only: this file sits after css/18 and never
   edits css/01-18. Every rule's SUBJECT (the right-most compound selector) is
   one of this file's own classes (.bgx-saves-*, .bgx-saved-*) and nothing
   here sizes, positions or transforms the board, the checkers, the rails, the
   hit targets, the dice layers or the rotation stage. The saves row is an
   ordinary block inside the side column that css/16 already places (order 3,
   below the Players panel); this file only gives it the same panel look as
   the Players panel and the Board size row. Its colours come from the --x-*
   tokens of css/16, so Light and Dark both follow without a second set of
   rules.

   Colour is never the only cue: a saved game the app cannot open says so in
   words (the red edge is a second cue), the autosave row is tagged
   "Autosave" in text (the gold edge is a second cue), and a disabled button
   is disabled for assistive technology as well as dimmed. */

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

/* ── The saves row ──────────────────────────────────────────────────── */
.bgx-saves-row {
  box-sizing: border-box;
  padding: 8px 10px 10px;
  border: 1px solid var(--x-line-soft);
  border-radius: var(--x-radius);
  background-color: var(--x-panel);
  color: var(--text);
  box-shadow: var(--x-raised);
}
.bgx-saves-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.bgx-saves-btn { flex: 1 1 auto; min-width: 0; padding: 0 12px; font-size: 12.5px; }
.bgx-saves-status { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); overflow-wrap: anywhere; }

/* ── The Saved games dialog ─────────────────────────────────────────── */
.bgx-saved-list {
  box-sizing: border-box;
  max-height: min(48vh, 420px);
  margin: 0 0 10px;
  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-saved-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--x-line-soft);
  border-left: 4px solid transparent;
}
.bgx-saved-row:last-child { border-bottom: 0; }
.bgx-saved-row[data-kind="autosave"] { border-left-color: var(--x-gold); }
.bgx-saved-row[data-state="damaged"] { border-left-color: var(--x-danger); }
.bgx-saved-main { display: flex; flex: 1 1 220px; flex-direction: column; gap: 2px; min-width: 0; }
.bgx-saved-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.bgx-saved-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; color: var(--x-text); }
.bgx-saved-tag {
  padding: 0 7px;
  border: 1px solid var(--x-line);
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.bgx-saved-meta { min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }
.bgx-saved-problem { color: var(--x-text); }
.bgx-saved-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 6px; }
.bgx-saved-btn { min-width: 44px; padding: 0 12px; font-size: 12.5px; }
.bgx-saved-empty { margin: 0 0 10px; padding: 12px; font-size: 13.5px; color: var(--text-muted); border: 1px dashed var(--x-line); border-radius: var(--x-radius-sm); }
.bgx-saved-hint { margin: 0 0 10px; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }
/* A name can be one long word: the questions that quote it wrap anywhere instead of spilling out of the card. */
.bgx-saved-confirm { overflow-wrap: anywhere; }
.bgx-saved-text {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 180px;
  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-saved-text:focus-visible { outline: 2px solid var(--x-focus); outline-offset: 2px; }
.bgx-saved-list:focus-visible { outline: 2px solid var(--x-focus); outline-offset: 2px; }
@media (max-width: 479px) {
  .bgx-saved-actions { flex: 1 1 100%; }
  .bgx-saved-btn { flex: 1 1 auto; }
}
