.xadrez-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  width: min(560px, 100%);
  margin: 8px auto 16px;
  border: 1px solid var(--line);
  background: #111;
}
.xadrez-board .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  border: 0;
  padding: 0;
}
.xadrez-board .cell.light { background: #d8c3a5; }
.xadrez-board .cell.dark { background: #6b4a32; }
.xadrez-board .cell.selected { box-shadow: inset 0 0 0 3px #e10600; }
.xadrez-board .cell.last-from { box-shadow: inset 0 0 0 3px rgba(225, 6, 0, 0.35); }
.xadrez-board .cell.last-to.light { background: #e3c07a; }
.xadrez-board .cell.last-to.dark { background: #8a6230; }
.xadrez-board .cell.in-check { box-shadow: inset 0 0 0 3px #e10600, inset 0 0 18px rgba(225, 6, 0, 0.55); }
.xadrez-board .cell.valid-move::after {
  content: "";
  width: 22%;
  height: 22%;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.85);
}
.xadrez-board .cell.valid-capture::after {
  content: "";
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: transparent;
  border: 3px solid rgba(225, 6, 0, 0.75);
}

.xadrez-piece {
  font-size: clamp(1.35rem, 6vw, 2.4rem);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}
.xadrez-piece.W { color: #f7f7f7; }
.xadrez-piece.B { color: #111; }

.legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.legend b.w { color: #f7f7f7; }
.legend b.b { color: #888; }

.xadrez-caps {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.1rem;
  min-height: 1.4em;
  margin: 0 auto 8px;
  width: min(560px, 100%);
  color: var(--muted);
}
.xadrez-caps span { letter-spacing: 0.04em; }

.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 40;
  align-items: center;
  justify-content: center;
}
.promo-overlay.open { display: flex; }
.promo-box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px;
  display: grid;
  gap: 14px;
  text-align: center;
}
.promo-box strong {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-style: italic;
}
.promo-box .play-actions { justify-content: center; }
.promo-box button {
  min-width: 56px;
  font-size: 1.6rem;
}
