.chess-page {
  min-height: 100vh;
}
.chess-header {
  min-height: 80px;
}
.chess-header > a:last-child {
  font-size: 13px;
  color: var(--muted);
}
.chess-layout {
  display: grid;
  grid-template-columns: minmax(280px, 590px) minmax(240px, 340px);
  justify-content: center;
  gap: 50px;
  padding-block: 45px 65px;
}
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font: 11px var(--mono);
  color: var(--muted);
}
.board-header span:first-child {
  color: var(--accent);
}
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border: 5px solid #3d4835;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 12px 45px #0003;
}
.square {
  border: 0;
  padding: 0;
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #dce2ce;
  color: #171e17;
  font-family: Georgia, "Segoe UI Symbol", serif;
  font-size: clamp(25px, 4.2vw, 51px);
  line-height: 1;
}
.square.dark {
  background: #718264;
}
.square.white-piece {
  color: #fffdf0;
  text-shadow:
    0 1px 2px #000,
    1px 0 #23321e,
    -1px 0 #23321e,
    0 -1px #23321e;
}
.square.selected {
  background: #d4ef71;
}
.square.last-move {
  box-shadow: inset 0 0 0 4px #c3f36b88;
}
.square.legal:after {
  content: "";
  position: absolute;
  width: 23%;
  height: 23%;
  background: #16251566;
  border-radius: 50%;
  pointer-events: none;
}
.square.occupied.legal:after {
  width: 85%;
  height: 85%;
  background: none;
  border: 4px solid #25332099;
}
.square:focus-visible {
  outline: 3px solid #eea24d;
  outline-offset: -4px;
  z-index: 1;
}
.square .coordinate {
  position: absolute;
  left: 3px;
  top: 3px;
  font: 9px var(--mono);
  color: #253320;
  text-shadow: none;
}
.board-help {
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}
.chess-sidebar .eyebrow {
  margin-bottom: 16px;
}
.chess-sidebar h1 {
  font-size: 44px;
  letter-spacing: -2px;
}
.chess-sidebar > p {
  font-size: 14px;
  color: var(--muted);
}
.game-status {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
  margin-block: 25px;
  color: var(--accent);
  font-size: 15px;
}
.game-settings {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.game-settings label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font: 10px var(--mono);
  color: var(--muted);
  flex: 1;
}
.game-settings select {
  width: 100%;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font: 12px var(--sans);
  border-radius: 3px;
}
.game-settings select:focus-visible {
  outline: 2px solid var(--accent);
}
.chess-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.chess-actions button {
  font-size: 12px;
  min-height: 44px;
}
.secondary {
  background: none;
  border-color: var(--line);
}
.move-heading {
  font: 11px var(--mono);
  letter-spacing: 1px;
  margin-top: 30px;
  color: var(--muted);
}
.move-list {
  max-height: 190px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  font: 12px/1.8 var(--mono);
}
.move-list li {
  display: grid;
  grid-template-columns: 30px 1fr 1fr;
  padding: 7px 10px;
}
.move-list li:nth-child(odd) {
  background: var(--surface);
}
.move-list li span:first-child {
  color: var(--muted);
}
.empty-history {
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 800px) {
  .chess-layout {
    grid-template-columns: minmax(0, 520px);
    gap: 24px;
    padding-block: 25px;
  }
  .square {
    font-size: clamp(26px, 8vw, 48px);
  }
  .chess-sidebar h1 {
    font-size: 36px;
  }
  .chess-sidebar {
    padding-bottom: 15px;
  }
  .chess-header {
    flex-wrap: nowrap;
  }
  .chess-header > a:last-child {
    font-size: 11px;
  }
  .game-status {
    margin-block: 18px;
  }
  .chess-board {
    border-width: 3px;
  }
}
