:root {
  font-family: system-ui, sans-serif;
  color: #182b24;
  background: #f1f5f0;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 68rem; margin: auto; padding: clamp(1rem, 4vw, 2.5rem); }
header { margin-bottom: 1.25rem; }
h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); margin: 0 0 1rem; }
h1 span { font-weight: 600; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.field { display: block; margin: 0 0 .3rem; font-weight: 600; }
.layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.panel { min-width: 0; background: white; border: 1px solid #cbd8cd; border-radius: .85rem; padding: 1rem; }
.muted { color: #43584d; margin: .65rem 0; font-size: .93rem; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
  border-radius: .5rem;
  border: 1px solid #98afa1;
  background: #fff;
}
button, input, select { min-height: 2.75rem; padding: .45rem .65rem; }
input { width: 100%; }
select { width: min(100%, 24rem); }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #0c65a0; outline-offset: 2px; }
.primary { background: #155541; border-color: #155541; color: white; font-weight: 700; }
textarea { width: 100%; resize: vertical; padding: .65rem; font-family: ui-monospace, monospace; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: .75rem; }
.editor-options { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.editor-options label { display: grid; gap: .2rem; font-size: .9rem; }
.editor-options select { width: auto; }
output { font-weight: 700; }
.ko-details { margin: .4rem 0 0; font-size: .88rem; color: #43584d; }
.ko-details div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45em; }
.ko-details dt { font-weight: 600; }
.ko-details dd { margin: 0; overflow-wrap: anywhere; }
.ko-note { margin-top: .35rem; }
.notice { min-height: 1.4rem; overflow-wrap: anywhere; margin-bottom: 0; }
.notice[data-error="true"] { color: #a42527; }
.fixture-results { margin-top: 1rem; scroll-margin-top: 1rem; }
.fixture-results table { width: 100%; border-collapse: collapse; text-align: left; }
.fixture-results th, .fixture-results td { padding: .55rem .35rem; border-bottom: 1px solid #cbd8cd; }
.fixture-results td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fixture-results th:last-child, .fixture-results td:last-child { text-align: right; }
.fixture-link { text-align: left; }
.fixture-meta { display: block; margin: .25rem 0 0; }
.trace { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid #cbd8cd; }
.trace h3 { font-size: 1rem; margin: 0; }
.trace-moves { display: flex; align-items: center; gap: .4rem; list-style: none; overflow-x: auto; margin: .6rem 0 0; padding: .2rem; }
.trace-moves li { flex: none; }
.trace-moves [aria-current="step"] { border-color: #155541; background: #e5f1ea; font-weight: 700; }

.board-scroll { overflow: auto; padding: .25rem; }
.board {
  --step: 2.65rem;
  display: inline-grid;
  grid-template-columns: repeat(var(--size), var(--step));
  background: #ddbd83;
  border-radius: .45rem;
  padding: .25rem;
}
.point { position: relative; min-height: var(--step); width: var(--step); border: 0; border-radius: 0; padding: 0; background: transparent; }
.point:disabled { opacity: 1; }
.point::before, .point::after { content: ""; position: absolute; background: #6b512a; pointer-events: none; }
.point::before { height: 1px; left: 0; right: 0; top: 50%; }
.point::after { width: 1px; top: 0; bottom: 0; left: 50%; }
.point.edge-left::before { left: 50%; }
.point.edge-right::before { right: 50%; }
.point.edge-top::after { top: 50%; }
.point.edge-bottom::after { bottom: 50%; }
.stone, .target, .move-point, .last-move { position: absolute; z-index: 1; pointer-events: none; }
.stone { inset: .25rem; border-radius: 50%; box-shadow: 0 2px 3px #654e30; }
.stone.black { background: #151c1a; }
.stone.white { background: #fafafa; border: 1px solid #c1c8c2; }
.stone.fixed { box-shadow: inset 0 0 0 3px #9f3b2b, 0 2px 3px #654e30; }
.target { inset: .12rem; border: 3px solid #0c65a0; border-radius: 50%; }
.move-point { inset: .12rem; border: 2px dashed #174e3a; border-radius: .3rem; box-shadow: 0 0 0 1px #fff; }
.last-move { inset: .37rem; border: 3px solid #f7c749; border-radius: 50%; }

@media (max-width: 44rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
}
