:root { color-scheme: light dark; font: 16px/1.5 system-ui, sans-serif; --ink: #1a2823; --quiet: #4b5e55; --surface: #fff; --border: #cad9d0; --paper: #f4f8f5; --accent: #176849; }
@media (prefers-color-scheme: dark) { :root { --ink: #edf5ef; --quiet: #b1c6b9; --surface: #1c2b23; --border: #495c50; --paper: #122018; --accent: #8be0ae; } }
body { margin: 0; color: var(--ink); background: var(--paper); }
main { max-width: 66rem; margin: auto; padding: clamp(.75rem, 4vw, 2rem); }
h1 { font-size: clamp(1.65rem, 5vw, 2.6rem); line-height: 1.16; letter-spacing: -.04em; margin: 0; }
h2 { font-size: 1.12rem; margin: 0; }
p { margin: .4rem 0; }
header p, #coverage, .hint, #coverage-note { color: var(--quiet); }
.workspace { display: grid; grid-template-columns: minmax(0, 19.5rem) minmax(0, 1fr); gap: .9rem; margin-top: .8rem; }
#board { width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: .53rem; overflow: hidden; }
#board > div { display: grid; position: relative; place-items: center; }
#board .light { background: #dfe6ca; }
#board .dark { background: #748d75; }
#board .piece { font-size: clamp(.96rem, 6vw, 1.9rem); line-height: 1; font-family: 'Segoe UI Symbol', 'DejaVu Sans', serif; }
.piece.white { color: #fff; text-shadow: 0 0 2px #16261c, 0 1px 1px #15271d; }
.piece.black { color: #17271d; }
#board small { color: #14291e; position: absolute; font-size: clamp(.45rem, 1.6vw, .64rem); font-weight: 700; line-height: 1; }
#board .rank { top: .15rem; left: .15rem; }
#board .file { bottom: .14rem; right: .17rem; }
#entry, #result { background: var(--surface); border: 1px solid var(--border); border-radius: .65rem; padding: .8rem; min-width: 0; }
label { font-weight: 650; display: block; margin: 0 0 .55rem; }
label small { font-weight: 400; }
textarea, input, button { color: inherit; font: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: .42rem; padding: .44rem .61rem; }
textarea { display: block; margin: .24rem 0 .45rem; width: 100%; box-sizing: border-box; resize: vertical; }
input { width: 4.4rem; display: block; }
button { font-weight: 650; cursor: pointer; }
button:disabled { cursor: default; opacity: .63; }
.primary, .move { color: var(--accent); border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions, .board-caption, footer { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: .45rem 0; }
.board-caption { justify-content: space-between; font-size: .86rem; }
#history { color: var(--quiet); font-size: .8rem; overflow-wrap: anywhere; }
.hint, footer, #coverage-note, #coverage { font-size: .86rem; }
#status:empty, #coverage-note:empty { display: none; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
tr { border-bottom: 1px solid var(--border); }
td, th { text-align: left; padding: .41rem .22rem; vertical-align: top; }
td.count { font-variant-numeric: tabular-nums; }
td small { display: block; font-size: .76rem; color: var(--quiet); }
thead th { white-space: normal; font-size: .84rem; }
.results-bar { height: .49rem; min-width: 5rem; display: flex; border: 1px solid var(--border); border-radius: .28rem; overflow: hidden; }
.results-bar span { flex-basis: 0; }
.white-wins { background: #e5eedd; }
.draws { background: #91b1a0; }
.black-wins { background: #293d37; }
details { font-size: .82rem; min-width: 7rem; }
summary { cursor: pointer; }
details ul { margin: .2rem 0; padding-left: .95rem; overflow-wrap: anywhere; }
details li { margin-bottom: .36rem; }
.archive-game { font-size: .76rem; }
a { color: var(--accent); text-underline-offset: .15em; }
@media (max-width: 640px) { .workspace { grid-template-columns: minmax(0, 1fr); } #board { max-width: 19rem; } }
