:root {
  color-scheme: dark;
  font: 16px/1.45 system-ui, sans-serif;
  background: #131d26;
  color: #f1f5f7;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 990px; margin: auto; padding: clamp(16px, 4vw, 48px); }
header span { color: #8ee3c3; font-size: .875rem; letter-spacing: .15em; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); line-height: 1; margin: .25em 0 .45em; }
.game { display: grid; grid-template-columns: minmax(0, 620px) minmax(200px, 1fr); gap: 24px; align-items: start; }
.player { display: flex; justify-content: space-between; padding: .75rem 0; }
.player span { color: #becbd3; }
.board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  container-type: inline-size;
}
button { font: inherit; cursor: pointer; }
.square { display: grid; place-items: center; position: relative; border: 0; padding: 0; min-width: 0; color: #10232b; }
.light { background: #d6e8dd; }
.dark { background: #70a596; }
.square.selected, .square.last { box-shadow: inset 0 0 0 4px #ca923e; }
.square.selected { background: #f3cb70; }
.square.target::after { content: ''; position: absolute; width: 24%; aspect-ratio: 1; border-radius: 50%; background: #193f49a6; pointer-events: none; }
.square.occupied.target::after { width: 89%; background: transparent; border: 3px solid #193f49; }
.square:focus-visible { z-index: 1; outline: 3px solid #f99626; outline-offset: -3px; }
.piece { font: 8.6cqw/1 'DejaVu Sans', 'Arial Unicode MS', sans-serif; }
.piece.white { color: #fff8e7; -webkit-text-stroke: 1px #11232a; }
.coord { position: absolute; font-size: clamp(9px, 2.1cqw, 14px); font-weight: 700; }
.rank { top: 2px; left: 4px; }
.file { bottom: 1px; right: 4px; }
aside, dialog { border: 1px solid #405562; border-radius: 12px; padding: 20px; background: #20303b; color: inherit; }
h2, h3 { margin: 0 0 .5em; }
#status { color: #8ee3c3; min-height: 2.9em; }
#history { min-height: 6em; max-height: 16em; overflow: auto; padding-left: 2em; font-variant-numeric: tabular-nums; }
#history li { white-space: pre; }
#reset, .choices button { border: 0; border-radius: 6px; background: #8ee3c3; color: #10232b; padding: .6em .9em; font-weight: 700; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
dialog::backdrop { background: #101920aa; }
@media (max-width: 680px) { .game { grid-template-columns: 1fr; gap: 12px; } }
.difficulty { display: grid; gap: .4rem; margin: 0 0 .9rem; font-size: .9rem; }
.difficulty select { width: 100%; border: 1px solid #718996; border-radius: 6px; padding: .45rem; background: #131d26; color: inherit; font: inherit; }
