/* board.css: styles for board.js */

.cb-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: min(90vw, 560px);
  aspect-ratio: 1 / 1;
  border: 2px solid #4a3b2a;
  user-select: none;
}

.cb-square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
}
.cb-light { background: #f0d9b5; }
.cb-dark  { background: #b58863; }

.cb-selected { background: #f6f669 !important; }
.cb-last.cb-light { background: #cdd26a; }
.cb-last.cb-dark  { background: #aaa23a; }
.cb-check { background: radial-gradient(circle, #ff3b3b 0%, #e02020 40%, transparent 75%) !important; }

/* Legal move markers */
.cb-target::after {
  content: '';
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
}
.cb-capture::after {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 5px solid rgba(0, 0, 0, 0.22);
}

.cb-piece {
  font-size: min(9vw, 56px);
  line-height: 1;
  cursor: grab;
  z-index: 1;
  font-family: "Segoe UI Symbol", "DejaVu Sans", "Arial Unicode MS", serif;
}
.cb-white { color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 1px #000; }
.cb-black { color: #111; text-shadow: 0 0 1px #fff; }

.cb-coord {
  position: absolute;
  font: 600 11px sans-serif;
  pointer-events: none;
}
.cb-rank { top: 2px; left: 3px; }
.cb-file { bottom: 1px; right: 3px; }
.cb-light .cb-coord { color: #b58863; }
.cb-dark .cb-coord  { color: #f0d9b5; }

/* Promotion picker */
.cb-promo {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.cb-promo-box {
  background: #fff;
  color: #222;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
}
.cb-promo-box p { margin: 0 0 6px; font: 600 14px sans-serif; }
.cb-promo-box button {
  background: #f0d9b5;
  border: 1px solid #b58863;
  border-radius: 6px;
  margin: 0 3px;
  width: 56px;
  height: 56px;
  font-size: 40px;
  cursor: pointer;
}
.cb-promo-box button:hover { background: #f6f669; }
