* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
h1 {
  margin-bottom: 10px;
  color: #333;
}
.status {
  margin: 15px 0;
  font-weight: bold;
  text-align: center;
}
.turn-indicator {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  color: #fff;
  background: #555;
}
.turn-white {
  background: #f0d9b5;
  color: #333;
}
.turn-black {
  background: #b58863;
  color: #fff;
}
button {
  margin: 5px;
  padding: 10px 20px;
  background: #8b5a2b;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  background: #a16a3a;
}
.chessboard {
  width: 480px;
  height: 600px;
  border: 15px solid #8b5a2b;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template: repeat(8, 1fr) / repeat(8, 1fr);
  margin: 0 auto;
}
.square {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  cursor: pointer;
  transition: 0.2s;
}
.light {
  background: #f0d9b5;
}
.dark {
  background: #b58863;
}
.square:hover {
  filter: brightness(1.1);
}
.selected {
  background: rgba(255, 255, 0, 0.5) !important;
}
.valid-move {
  background: rgba(0, 255, 0, 0.4) !important;
}
.capture-move {
  background: rgba(255, 0, 0, 0.4) !important;
}
.check {
  background: rgba(255, 0, 0, 0.6) !important;
}
.piece {
  user-select: none;
  cursor: grab;
  font-size: 42px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.piece:active {
  cursor: grabbing;
}
.coords {
  position: absolute;
  font-size: 12px;
  color: #555;
  font-weight: bold;
}
.file-label {
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
}
.rank-label {
  top: 50%;
  left: 2px;
  transform: translateY(-50%);
}
.move-history {
  margin-top: 20px;
  width: 480px;
  max-height: 150px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
}
.move-entry {
  cursor: pointer;
  padding: 2px 4px;
  margin: 2px 0;
  border-radius: 4px;
}
.move-entry:hover {
  background: #e0e0e0;
}
.move-entry.active {
  background: #a16a3a;
  color: #fff;
}
@media (max-width: 600px) {
  .chessboard {
    width: 320px;
    height: 320px;
  }
  .piece {
    font-size: 28px;
  }
  .move-history {
    width: 320px;
  }
}
