/* JeffBase board grid + pieces. Square colors come from theme.css CSS variables so a board
   theme is one variable change. Piece shadows / glow inherit the PandaChess identity. */

.jb-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  aspect-ratio: 1 / 1;
  user-select: none;
  touch-action: none;                 /* let pointer-drag own the gesture */
  border-radius: 6px;
  overflow: hidden;
}

.jb-sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jb-sq.light { background: var(--board-light); }
.jb-sq.dark  { background: var(--board-dark); }

.jb-piece {
  width: 92%;
  height: 92%;
  pointer-events: none;               /* the square handles pointer events */
  cursor: grab;
}

/* Drag ghost: a piece that follows the pointer. */
.jb-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  cursor: grabbing;
}

/* Last move played, current selection, and legal destinations. */
.jb-sq.jb-last::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 213, 79, 0.45);
  pointer-events: none;
}
.jb-sq.jb-sel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(59, 130, 246, 0.4);
  pointer-events: none;
}
.jb-sq.jb-target::before {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  pointer-events: none;
}
/* A target square that holds an enemy piece gets a ring instead of a dot. */
.jb-sq.jb-target:has(img)::before {
  width: 84%;
  height: 84%;
  background: transparent;
  border: 5px solid rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}
