/* ---------- board frame ---------- */
.chess-board {
  --sq-light: #eef2f8;
  --sq-dark: #8aa4c6;
  display: grid;
  grid-template: repeat(8, 1fr) / repeat(8, 1fr);
  aspect-ratio: 1;
  container-type: inline-size;
  overflow: hidden;
  border: 10px solid;
  outline: 2px solid rgba(212, 168, 83, 0.6);
  outline-offset: -12px;
  border-color: #dbe3ee #c3cedd #b0bdd0 #c3cedd;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(31, 42, 58, 0.12),
    0 2px 0 #fff,
    0 24px 34px -16px rgba(31, 42, 58, 0.55);
}

/* ---------- squares ---------- */
.chess-board .square {
  --c: var(--sq-dark);
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  background-color: var(--sq-light);
  filter: none;
  transform: none;
}
.chess-board .square.dark {
  --c: var(--sq-light);
  background-color: var(--sq-dark);
}
.chess-board .square[data-rank]::before,
.chess-board .square[data-file]::after {
  position: absolute;
  font-size: clamp(8px, 2.2cqw, 13px);
  font-weight: 700;
  color: var(--c);
  opacity: 0.9;
  pointer-events: none;
}
.chess-board .square[data-rank]::before {
  content: attr(data-rank);
  top: 3px;
  left: 4px;
}
.chess-board .square[data-file]::after {
  content: attr(data-file);
  bottom: 2px;
  right: 4px;
}

/* ---------- pieces ---------- */
.chess-board .piece {
  font-family: var(--symbols);
  font-size: clamp(26px, 9vw, 60px);
  font-size: 10.5cqw;
  line-height: 1;
  pointer-events: none;
  transition: transform 0.15s ease;
}
.chess-board .wp .piece {
  color: #fff;
  text-shadow:
    -2px -2px 0 #1b2230,
    2px -2px 0 #1b2230,
    -2px 2px 0 #1b2230,
    2px 2px 0 #1b2230,
    0 -2px 0 #1b2230,
    0 2px 0 #1b2230,
    -2px 0 0 #1b2230,
    2px 0 0 #1b2230,
    0 4px 6px rgba(0, 0, 0, 0.3);
}
.chess-board .bp .piece {
  color: #1b2233;
  text-shadow: 0 2px 3px rgba(255, 255, 255, 0.35);
}

/* ---------- highlights ---------- */
.chess-board .last {
  background-image: linear-gradient(
    rgba(47, 125, 246, 0.3),
    rgba(47, 125, 246, 0.3)
  );
}
.chess-board .check {
  background-image: radial-gradient(
    circle,
    rgba(235, 64, 64, 0.85),
    rgba(235, 64, 64, 0) 70%
  );
}
.chess-board .dot {
  position: absolute;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: rgba(27, 34, 51, 0.28);
  pointer-events: none;
}
.chess-board .dot.ring {
  width: 88%;
  height: 88%;
  background: none;
  border: 5px solid rgba(27, 34, 51, 0.28);
}

/* ---------- hover and focus (no glow) ---------- */
@media (hover: hover) {
  .chess-board .square:hover {
    filter: none;
    transform: none;
    box-shadow: none;
  }
  .chess-board .square:hover .piece {
    transform: translateY(-3px);
  }
}
.chess-board .square.selected {
  box-shadow: inset 0 0 0 4px rgba(47, 125, 246, 0.9);
}
.chess-board .square:focus-visible {
  outline: 3px solid rgba(47, 125, 246, 0.7);
  outline-offset: -3px;
}
