/*
 * guide.css — aiChess board geometry (variant copy) on top of the shared _shared/base.css.
 * 2026-07 rebuild: every real chess piece in every figure is the REAL WS-14
 * piece bitmap (<img data-piece="pieces/chess/chess_wK.png">), never a glyph
 * tile — so the reader learns the pieces they will actually see on the board.
 *
 * Colours: square tints and markers are derived from the --gc-* theme, with ONE
 * deliberate exception — the three interface markers (selection / legal-move dot
 * / advisor hint) mirror the play surface's own fixed yellow, green and blue
 * (BoardView draws exactly those). Teaching "the square turns yellow" in a
 * theme colour would teach the wrong thing.
 */

/* ---- A real board: N columns of alternating squares --------------------- */
.cx-board {
  display: grid;
  gap: 0;
  width: 100%;
  margin-inline: auto;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gc-border);
  box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--gc-bg) 85%, transparent);
}
.cx-board.n8 { grid-template-columns: repeat(8, 1fr); max-width: 340px; }
.cx-board.n5 { grid-template-columns: repeat(5, 1fr); max-width: 240px; }
.cx-board.n4 { grid-template-columns: repeat(4, 1fr); max-width: 208px; }
.cx-board.n3 { grid-template-columns: repeat(3, 1fr); max-width: 168px; }

/* One square. `l` = light, `d` = dark (the app's warm wood pair, expressed
   through the theme so both appearances stay readable). */
.cx-sq {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.cx-sq.l { background: color-mix(in srgb, var(--gc-text) 11%, transparent); }
.cx-sq.d { background: color-mix(in srgb, var(--gc-text) 30%, transparent); }

/* A real piece sitting on a square. */
.cx-sq img { width: 88%; height: auto; display: block; }

/* A single rank shown on its own (a back-rank order) never needs square cells. */
.cx-rank .cx-sq { aspect-ratio: 4 / 5; }

/* ---- Markers ------------------------------------------------------------ */
/* Where a piece may go: the play surface's own green legal-move dot. */
.cx-sq.dot::after {
  content: "";
  position: absolute;
  width: 30%; aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.62);
}
/* The selected piece's square: the play surface's yellow. */
.cx-sq.sel { box-shadow: inset 0 0 0 999px rgba(255, 214, 10, 0.42); }
/* The advisor's suggestion: blue fill on the origin, blue ring on the target. */
.cx-sq.hint::after {
  content: "";
  position: absolute;
  width: 78%; aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(10, 132, 255, 0.8);
}
.cx-sq.from { box-shadow: inset 0 0 0 999px rgba(10, 132, 255, 0.26); }
/* A square under attack / about to be emptied, and a square to notice. */
.cx-sq.target { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--gc-error) 34%, transparent); }
.cx-sq.gold   { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--gc-accent) 30%, transparent); }
/* A path a sliding piece travels along. */
.cx-sq .cx-arrow {
  font-size: clamp(13px, 3.6vw, 19px);
  color: color-mix(in srgb, var(--gc-text) 55%, transparent);
}

/* ---- Before → after (castling, en passant, a promotion) ----------------- */
.cx-ba {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.cx-ba > .cx-board { flex: 1 1 140px; }
.cx-ba .cx-then {
  font-size: 22px;
  color: color-mix(in srgb, var(--gc-text) 55%, transparent);
}

/* ---- Piece icon inside a step row / chip -------------------------------- */
.cx-icon { width: 24px; height: auto; display: block; }
.gc-step-badge .cx-icon { width: 22px; }

/* ---- A row of pieces (the army) ----------------------------------------- */
.cx-army { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: flex-end; }
.cx-army img { width: 40px; height: auto; }

/* ---- The play-screen mock ----------------------------------------------- */
.cx-screen {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gc-text) 8%, transparent);
}
.cx-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  padding: 6px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--gc-text) 12%, transparent);
  font-size: 12px;
  color: color-mix(in srgb, var(--gc-text) 78%, transparent);
}
.cx-panel.is-turn { box-shadow: inset 0 0 0 2px var(--gc-accent); }
.cx-avatar { font-size: 20px; line-height: 1; }
.cx-grow { flex: 1 1 auto; }
.cx-taken { display: flex; gap: 2px; align-items: center; }
.cx-taken img { width: 16px; height: auto; }
.cx-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 18%, transparent);
}
.cx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--gc-text) 16%, transparent);
  color: color-mix(in srgb, var(--gc-text) 85%, transparent);
}
.cx-ticker { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.cx-move {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 14%, transparent);
  color: color-mix(in srgb, var(--gc-text) 80%, transparent);
}
.cx-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cx-btnchip {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gc-text) 16%, transparent);
  color: color-mix(in srgb, var(--gc-text) 88%, transparent);
}
.cx-btnchip.danger { background: color-mix(in srgb, var(--gc-error) 40%, transparent); }

/* ---- The promotion picker, as the app shows it -------------------------- */
.cx-picker {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gc-text) 14%, transparent);
}
.cx-pick { display: grid; place-items: center; gap: 4px; }
.cx-pick img { width: 38px; height: auto; }
.cx-pick.is-choice { box-shadow: 0 0 0 2px var(--gc-accent); border-radius: 10px; padding: 4px; }

/* ---- Worked example: a short move list ---------------------------------- */
.cx-moves { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
