/* board.css - Styling for 2D board and common board elements */

.board-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(245, 158, 11, 0.15);
  background: #0f172a;
}

@media (orientation: portrait) {
  .board-container {
    aspect-ratio: 1 / 1;
    max-width: min(98vw, calc(100vh - 150px), 640px);
    max-height: calc(100vh - 150px);
  }
}

/* 2D Board Grid */
.chess-board-2d {
  width: 100%;
  height: 100%;
  position: relative;
}

.board-grid-2d {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

.board-square-2d {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

/* Classic Warm Wood Colors */
.square-light {
  background-color: #edd8b7;
}

.square-dark {
  background-color: #b58863;
}

/* Square Highlight States */
.square-selected {
  background-color: rgba(16, 185, 129, 0.75) !important;
}

.square-bot-hover {
  background-color: rgba(168, 85, 247, 0.7) !important;
  animation: pulseBotHover 1.4s infinite alternate ease-in-out;
}

@keyframes pulseBotHover {
  0% { box-shadow: inset 0 0 8px rgba(168, 85, 247, 0.6); }
  100% { box-shadow: inset 0 0 20px rgba(192, 132, 252, 0.95); }
}

.square-last-move {
  background-color: rgba(245, 158, 11, 0.5) !important;
}

.square-check {
  background-color: rgba(239, 68, 68, 0.8) !important;
  animation: pulseCheck 1.2s infinite ease-in-out;
}

@keyframes pulseCheck {
  0%, 100% {
    box-shadow: inset 0 0 15px rgba(220, 38, 38, 0.9);
  }
  50% {
    box-shadow: inset 0 0 30px rgba(239, 68, 68, 1);
  }
}

/* Legal Move Hints */
.move-hint-dot {
  position: absolute;
  width: 26%;
  height: 26%;
  border-radius: 50%;
  background-color: rgba(56, 189, 248, 0.75);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.move-hint-capture {
  position: absolute;
  width: 82%;
  height: 82%;
  border-radius: 50%;
  border: 4px solid rgba(239, 68, 68, 0.85);
  pointer-events: none;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* 2D Piece Rendering */
.chess-piece-2d {
  width: 88%;
  height: 88%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.12s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.chess-piece-2d svg {
  width: 100%;
  height: 100%;
}

.board-square-2d:active .chess-piece-2d {
  transform: scale(1.12);
}

/* 3D Board Canvas Container */
.chess-board-3d {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
  overflow: hidden;
}

.chess-board-3d canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
