/*
 * ChessBooks.in interactive chess puzzle — scoped cb-pz-* component.
 * Ivory / forest green / antique gold to match the ChessBooks design tokens.
 */
.cb-puzzle {
  max-width: 560px;
  margin: 30px auto;
}
.cb-pz {
  background: #fdfbf4;
  border: 1px solid #e3dabf;
  border-radius: 12px;
  padding: 20px 20px 18px;
  box-shadow: 0 10px 30px rgba(16, 35, 26, 0.08);
}
.cb-pz__head {
  text-align: center;
  margin-bottom: 14px;
}
.cb-pz__title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 19px;
  color: #10231a;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.cb-pz__turn {
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6d1f;
  font-weight: 600;
}
.cb-pz__hint {
  font-size: 13.5px;
  color: #5d665f;
  margin: 8px 0 0;
  line-height: 1.5;
}
.cb-pz__boardwrap {
  display: flex;
  justify-content: center;
}
.cb-pz__board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-auto-rows: 1fr;
  width: 100%;
  max-width: 470px;
  aspect-ratio: 1 / 1;
  border: 2px solid #10231a;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(16, 35, 26, 0.18);
}
.cb-pz__sq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.cb-pz__sq--l { background: #f4eeda; }
.cb-pz__sq--d { background: #3a6148; }
.cb-pz__sq img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  pointer-events: none;
}
.cb-pz__sq--sel {
  background: #c9a54e !important;
  box-shadow: inset 0 0 0 2px #10231a;
}
.cb-pz__sq--target::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: rgba(176, 138, 46, 0.75);
  pointer-events: none;
}
.cb-pz__sq--target.cb-pz__sq--cap::after {
  width: 86%;
  height: 86%;
  border-radius: 50%;
  border: 4px solid rgba(176, 138, 46, 0.85);
  background: transparent;
}
.cb-pz__sq:focus-visible {
  outline: 3px solid #b08a2e;
  outline-offset: -3px;
}
.cb-pz__coord {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  font-family: inherit;
  pointer-events: none;
  opacity: 0.75;
}
.cb-pz__coord--file { right: 3px; bottom: 2px; color: #f4eeda; }
.cb-pz__sq--l .cb-pz__coord--file,
.cb-pz__sq--l .cb-pz__coord--rank { color: #3a6148; }
.cb-pz__coord--rank { left: 3px; top: 2px; color: #f4eeda; }

.cb-pz__status {
  min-height: 22px;
  margin: 14px 0 10px;
  text-align: center;
  font-size: 14.5px;
  color: #3c443e;
  line-height: 1.5;
}
.cb-pz__status--ok { color: #1e6f3c; font-weight: 600; }
.cb-pz__status--bad { color: #b3382c; font-weight: 600; }
.cb-pz__status--info { color: #10231a; }
.cb-pz__status .cb-pz__btn--sm { margin-top: 8px; }

.cb-pz__controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 12px;
}
.cb-pz__btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 9px 20px;
  border-radius: 6px;
  border: 1px solid #10231a;
  background: #10231a;
  color: #fbf8f1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.cb-pz__btn:hover { background: #1e4030; }
.cb-pz__btn:active { transform: translateY(1px); }
.cb-pz__btn--ghost {
  background: transparent;
  color: #10231a;
  border-color: #b8ad8d;
}
.cb-pz__btn--ghost:hover { background: #f1ead5; border-color: #10231a; }
.cb-pz__btn--sm { padding: 6px 14px; font-size: 12.5px; }

.cb-pz__moves {
  min-height: 20px;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  color: #3c443e;
}
.cb-pz__mvnum { color: #8a6d1f; margin-right: 5px; }
.cb-pz__mv { margin-right: 9px; }

.cb-pz__err { color: #b3382c; font-size: 13.5px; }

.cb-pz__ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 6px 12px rgba(16, 35, 26, 0.35));
}
.cb-pz__ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 480px) {
  .cb-pz { padding: 14px 12px 12px; }
  .cb-pz__title { font-size: 17px; }
}
