/* Échecs — plateau family (design/Jeu - Échecs). An 8×8 marquetry board on the warm
   leather surface (the same band the arcade games use, in leather brown), the same
   in light and dark. Ivory vs ebony glyphs, rank/file engraved in the squares, a
   side panel keeps the pieces captured by each camp. Scoped under .ech-root. */

.ech-root { display: flex; flex-direction: column; align-items: stretch; inline-size: 100%; color: var(--color-text); --ech-board: 460px; }

.ech-surface {
  inline-size: 100%; box-sizing: border-box;
  background: #43302b; border-block: 1px solid #2c1f1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: var(--space-6) 0; color: #f4ece5;
}
.ech-inner { max-inline-size: 1060px; margin-inline: auto; padding-inline: var(--space-4); box-sizing: border-box; display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: center; }

.ech-planche {
  flex: none; padding: 22px; border-radius: 3px; box-sizing: border-box;
  background: linear-gradient(152deg, #7b5638 0%, #603f2e 38%, #4c3427 72%, #5d3f2d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.45), 0 22px 44px rgba(0, 0, 0, 0.40);
}
.ech-boardwrap { position: relative; inline-size: var(--ech-board); max-inline-size: 100%; }
.ech-board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  inline-size: var(--ech-board); max-inline-size: 100%; aspect-ratio: 1; box-sizing: border-box; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(198, 160, 102, 0.55), 0 0 0 5px rgba(0, 0, 0, 0.30), 0 0 0 6px rgba(198, 160, 102, 0.28), 0 8px 18px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.ech-cell { position: relative; display: flex; align-items: center; justify-content: center; cursor: default; }
.ech-cell.light { background: #d8c09a; }
.ech-cell.dark { background: #3f2a20; cursor: pointer; }

/* Rank on the left column, file on the bottom row, engraved into the square. */
.ech-cell[data-rank]::before, .ech-cell[data-file]::after {
  position: absolute; font-size: clamp(8px, calc(var(--ech-board) / 44), 11px); font-weight: 600; line-height: 1; opacity: 0.86; pointer-events: none;
}
.ech-cell[data-rank]::before { content: attr(data-rank); inset-block-start: 3px; inset-inline-start: 4px; }
.ech-cell[data-file]::after { content: attr(data-file); inset-block-end: 2px; inset-inline-end: 4px; }
.ech-cell.light::before, .ech-cell.light::after { color: rgba(74, 50, 26, 0.86); }
.ech-cell.dark::before, .ech-cell.dark::after { color: rgba(252, 244, 232, 0.86); }

/* Turned-token glyphs: ivory or ebony, a fine outline so they stay crisp. */
.ech-piece { font-size: calc(var(--ech-board) / 8 * 0.82); line-height: 1; pointer-events: none; }
.ech-piece.white { color: #fbf6ec; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 0 1px rgba(60, 40, 20, 0.85), 0 0 2px rgba(60, 40, 20, 0.5); }
.ech-piece.black { color: #231c19; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.24); }

/* Markers. */
.ech-cell.sel { box-shadow: inset 0 0 0 3px var(--color-accent-400); }
.ech-cell.hint { box-shadow: inset 0 0 0 3px var(--color-accent-400); }
.ech-cell.last { background-image: linear-gradient(rgba(198, 160, 102, 0.30), rgba(198, 160, 102, 0.30)); }
.ech-cell.move-dot { background-image: radial-gradient(circle at 50% 50%, rgba(255, 244, 224, 0.42) 0 15%, transparent 17%); }
.ech-cell.light.move-dot { background-image: radial-gradient(circle at 50% 50%, rgba(60, 40, 20, 0.34) 0 15%, transparent 17%); }
.ech-cell.capture { background-image: radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(217, 180, 120, 0.55) 60% 72%, transparent 74%); }
.ech-cell.check { background-image: radial-gradient(circle at 50% 50%, rgba(210, 60, 45, 0.85), rgba(210, 60, 45, 0.12) 70%); }

/* Side panel: graveyards + turn note. */
.ech-side { flex: 0 1 240px; display: flex; flex-direction: column; gap: var(--space-3); color: #f4ece5; }
.ech-side-k { font-size: 12px; color: rgba(244, 236, 229, 0.78); }
.ech-side-k.you { color: var(--color-accent-300); }
.ech-grave { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-block-size: 26px; }
.ech-grave-p { font-size: 22px; line-height: 1; }
.ech-grave-p.white { color: #fbf6ec; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 0 1px rgba(60, 40, 20, 0.9); }
.ech-grave-p.black { color: #231c19; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45), 0 0 1px rgba(255, 255, 255, 0.30); }
.ech-turn { font-size: 13px; line-height: 1.5; color: var(--color-accent-300); border-block: 1px solid rgba(244, 236, 229, 0.2); padding-block: var(--space-3); }
.ech-turn.over { font-family: var(--font-heading); font-weight: 600; }
.ech-turn.check { color: #e79a8c; }

/* Promotion chooser (over the board). */
.ech-promo { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; transform: translate(-50%, -50%); background: #55392c; border: 1px solid rgba(0, 0, 0, 0.4); border-radius: var(--radius-md); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); padding: var(--space-3); z-index: 5; text-align: center; }
.ech-promo-title { font-family: var(--font-heading); font-size: 15px; margin-block-end: var(--space-2); color: #f4ece5; }
.ech-promo-row { display: flex; gap: var(--space-2); }
.ech-promo-btn { inline-size: 52px; block-size: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(198, 160, 102, 0.5); border-radius: var(--radius-sm); background: #3f2a20; cursor: pointer; }
.ech-promo-btn:hover { border-color: var(--color-accent-400); }
.ech-promo-btn .ech-piece { font-size: 34px; }

.ech-hint { text-align: center; font-size: 12px; color: var(--color-neutral-600); max-inline-size: 560px; margin-inline: auto; padding-block-start: var(--space-3); }
.lz-variants.ech-inline-chips { margin: 0; }

@media (max-width: 620px) { .ech-planche { padding: 12px; } }
