:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #f1f0e3;
  background: #141b19;
}
* { box-sizing: border-box; }
body { margin: 0; }
main {
  max-width: 1090px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 52px);
  align-items: center;
}
.player, .player span, .current { display: flex; align-items: center; }
.player, .current { justify-content: space-between; }
.player { margin: 10px 2px; font-size: 15px; }
.player span { gap: 8px; }
.player i { width: 11px; height: 11px; border-radius: 50%; }
i.black { background: #17251e; border: 1px solid #9aaa97; }
i.white { background: #f1eacc; border: 1px solid #e1e0cf; }
.player small, .current small, .eyebrow { font: 600 10px/1.4 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.player small, .current small { color: #bdc6b9; }
.eyebrow { color: #e3c583; }
h1 { margin: .18em 0 .22em; font: 500 clamp(38px, 4.5vw, 59px)/1.01 Georgia, serif; letter-spacing: -.045em; }
.context { font-size: 15px; line-height: 1.55; color: #c7d0c4; margin: 0 0 18px; }
.board { display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); aspect-ratio: 1; border: 5px solid #344239; container-type: inline-size; box-shadow: 0 13px 35px #0a100c60; }
.sq { position: relative; display: grid; place-items: center; min-height: 0; background: #dbdac0; }
.sq.dark { background: #79947c; }
.sq.last { background: #e7c66d; }
.sq.dark.last { background: #ba9d50; }
.sq.check { box-shadow: inset 0 0 0 4px #b34f3c; }
.glyph { font: normal 10.4cqw/1 "Arial Unicode MS", "DejaVu Sans", "Apple Symbols", serif; color: #22332b; }
.glyph.white { color: #fcf9e9; -webkit-text-stroke: 1.2px #34473c; }
.rank, .file { position: absolute; color: #294237; font: 600 clamp(7px, 2.1cqw, 10px)/1 system-ui; }
.rank { left: 2px; top: 2px; }
.file { right: 2px; bottom: 2px; }
.current { margin: 0 0 9px; }
#status { font: 500 23px/1.15 Georgia, serif; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #efd291; outline-offset: 2px; }
button:disabled { opacity: .4; cursor: default; }
.controls { display: flex; gap: 8px; }
.controls button { padding: 8px 16px; min-height: 39px; font-size: 14px; border: 1px solid #536354; border-radius: 5px; background: #28372e; }
#play { color: #18231b; border-color: #dfc481; background: #dfc481; min-width: 83px; }
.moves { overflow: auto; height: clamp(130px, 25vh, 195px); margin: 15px 0 6px; padding: 5px 3px 5px 1px; display: grid; grid-template-columns: 2.4em 1fr 1fr; gap: 2px 5px; border-block: 1px solid #415045; position: relative; scrollbar-color: #667868 #233028; font: 14px/1.4 ui-monospace, monospace; }
.num { color: #a2b09f; align-self: center; }
.mv, .jumps button { background: none; border: 0; text-align: left; }
.mv { padding: 3px 7px; border-radius: 3px; }
.mv[aria-current="step"] { background: #d6bb77; color: #17241b; }
.jumps { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.jumps button { font: 12px/1.4 ui-monospace, monospace; padding: 5px 0; color: #ddc88b; text-decoration: underline; text-underline-offset: 3px; }
.credit { font-size: 12px; line-height: 1.5; color: #b4c0b3; margin: 12px 0 0; }
@media(max-width: 680px) {
  main { max-width: 500px; grid-template-columns: 1fr; gap: 7px; }
  .player { margin: 6px 2px; font-size: 13px; }
  .moves { height: 122px; }
  .controls button { min-height: 44px; }
  .context { margin-bottom: 12px; }
  h1 { font-size: 37px; }
}

.directory-link {
  display: inline-block;
  margin-top: 12px;
  color: #ddc88b;
  font-size: 14px;
  text-underline-offset: 3px;
}
