/* <Board> (crates/board): the board's own styles. Everything is under .mcl-board, and the
   colours are --mcl-* custom properties a host page may override. */
.mcl-board {
  --mcl-light: #ece4d0; --mcl-dark: #a88a62; --mcl-last: rgba(212, 186, 70, .55);
  --mcl-sel: rgba(90, 140, 70, .55); --mcl-hint: rgba(20, 60, 20, .35); --mcl-coord: #1d1d1b;
  position: relative; width: 100%; aspect-ratio: 1;
}
.mcl-board .board { width: 100%; height: 100%; display: block; touch-action: none; user-select: none;
  -webkit-user-select: none; border-radius: 4px; }
.mcl-board .sq.light { fill: var(--mcl-light); } .mcl-board .sq.dark { fill: var(--mcl-dark); }
.mcl-board .mark.last { fill: var(--mcl-last); } .mcl-board .mark.sel { fill: var(--mcl-sel); }
.mcl-board .mark.hover { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: .06; }
.mcl-board .mark, .mcl-board .sq { transition: fill .12s; }
.mcl-board .check { fill: url(#mcl-check-glow); pointer-events: none; }
.mcl-board .hint { fill: var(--mcl-hint); pointer-events: none; }
.mcl-board .hint.cap { fill: none; stroke: var(--mcl-hint); stroke-width: .08; }
.mcl-board .coord { font-size: .16px; fill: var(--mcl-coord); opacity: .55; pointer-events: none;
  font-family: system-ui, sans-serif; }
.mcl-board .coord.f { text-anchor: end; }

/* Pieces: one <g> per piece, placed by a transform, so moves slide (chessground-like timing). */
.mcl-board .pc { cursor: grab; paint-order: stroke; transition: transform .2s cubic-bezier(.25, .8, .35, 1);
  font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif; }
.mcl-board .pc text { font-size: .82px; text-anchor: middle; dominant-baseline: middle; }
.mcl-board .pc.white { fill: #fbfaf6; stroke: #2a2723; stroke-width: .035; }
.mcl-board .pc.black { fill: #1f1c19; stroke: #1f1c19; stroke-width: .01; }
.mcl-board .pc.snap { transition: none; }
.mcl-board .pc.ghost { opacity: .3; }
.mcl-board .pc.fade { animation: mcl-fade .2s ease-out forwards; pointer-events: none; }
@keyframes mcl-fade { to { opacity: 0; } }
.mcl-board .pc.lifted { pointer-events: none; transition: none;
  filter: drop-shadow(0 .05px .05px rgba(0, 0, 0, .4)); }
/* <Board>'s pieces are HTML above the squares' SVG (D-PS.4): one square each, placed by a
   percentage transform from the top-left corner, each its own compositor layer. The SVG on top
   (shapes) takes the pointer. */
.mcl-board .pcs { position: absolute; inset: 0; pointer-events: none; }
.mcl-board .pcs .pc { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  transform-origin: 0 0; will-change: transform; }
.mcl-board .pcs .sqmark { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%;
  transform-origin: 0 0; will-change: transform; box-sizing: border-box; }
.mcl-board .pcs .sqmark.last { background: var(--mcl-last); }
.mcl-board .pcs .sqmark.sel { background: var(--mcl-sel); }
.mcl-board .pcs .sqmark.hover { border: max(2px, 0.75%) solid rgba(255, 255, 255, .7); }
.mcl-board .pcs .pc > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mcl-board .pcs .pc.lifted { z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.mcl-board .board-top { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.mcl-board .board-top.grab { cursor: grab; }
@media (prefers-reduced-motion: reduce) {
  .mcl-board .pc { transition: none; }
  .mcl-board .pc.fade { animation: none; opacity: 0; }
}

/* Shapes. */
.mcl-board .shape { fill: none; stroke-width: .16; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; opacity: .8; }
.mcl-board circle.shape { stroke-width: .07; }
.mcl-board .shape.green { stroke: #15781b; } .mcl-board .head.green { fill: #15781b; }
.mcl-board .shape.red { stroke: #882020; } .mcl-board .head.red { fill: #882020; }
.mcl-board .shape.blue { stroke: #003088; } .mcl-board .head.blue { fill: #003088; }
.mcl-board .shape.yellow { stroke: #e68f00; } .mcl-board .head.yellow { fill: #e68f00; }
.mcl-board .shape.preview { stroke: #15781b; opacity: .5; } .mcl-board .head.preview { fill: #15781b; }
.mcl-board .shape.engine { stroke: #003088; opacity: .45; } .mcl-board .head.engine { fill: #003088; }

/* Promotion picker. */
.mcl-board .promo { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); display: flex;
  align-items: center; justify-content: center; gap: 8px; border-radius: 4px; }
.mcl-board .promo button { font-size: 44px; width: 64px; height: 64px; margin: 0; padding: 0; border-radius: 8px;
  border: 0; background: var(--mcl-light); cursor: pointer; line-height: 1;
  font-family: "DejaVu Sans", "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif; }
.mcl-board .promo button img { width: 56px; height: 56px; display: block; margin: auto; }
.mcl-board .promo button.white { color: #fbfaf6; -webkit-text-stroke: 1px #2a2723; }
.mcl-board .promo button.black { color: #1f1c19; }
.mcl-board .promo .cancel { font-size: 20px; width: 40px; height: 40px; color: #1d1d1b; }

/* <SetupBoard>: a piece or the eraser is picked, so a press places rather than drags. */
.mcl-board .board.placing, .mcl-board .board.placing .pc { cursor: crosshair; }
