@charset "UTF-8";
:root {
  --paper: #f3ede2;
  --card: #faf7f0;
  --sand: #d9c7a7;
  --ink: #2b2b2b;
  --muted: #665b4e;
  --brown: #5b4636;
  --green: #1f6b5b;
  --rule: #cdbfa9;
  --line: color-mix(in srgb, var(--brown) 24%, var(--paper));
  --serif:
    "Baskerville", "Baskerville Old Face", "Iowan Old Style",
    "Palatino Linotype", Georgia, serif;
  --sans: "DM Sans", "Segoe UI", Arial, sans-serif;
  --max: 1110px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
button:disabled {
  cursor: default;
}
button {
  touch-action: manipulation;
}
a {
  color: var(--green);
}
svg {
  display: block;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.top {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.top-inner {
  width: min(calc(100% - 84px), 1320px);
  height: 83px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
}
.brand-title {
  display: block;
  font: 600 27px/1.05 var(--serif);
  letter-spacing: -0.8px;
}
.brand-sub {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.045em;
}
.brand svg {
  flex: none;
}
nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbtn,
.tool,
.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: transparent;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 6px;
}
.navbtn:hover,
.tool:hover,
.text-btn:hover {
  background: #5b46360c;
}
.navbtn .icon,
.tool .icon {
  color: var(--brown);
}
.navbtn.active {
  color: var(--green);
  background: #1f6b5b0c;
}
.navbtn.active .icon {
  color: var(--green);
}
.nav-sep {
  height: 24px;
  width: 1px;
  background: var(--line);
  margin: 0 4px;
}
.icon {
  flex: none;
}
.workspace {
  width: min(calc(100% - 80px), var(--max));
  margin: 0 auto;
  padding: 34px 0 18px;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 24px;
}
.page-head h1 {
  margin: 0;
  font: 500 clamp(36px, 3.55vw, 54px) / 1.05 var(--serif);
  letter-spacing: -0.045em;
  color: #302b25;
}
.rule {
  height: 1px;
  background: var(--line);
  flex: 1;
  position: relative;
  margin-left: 1px;
}
.rule:before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--brown);
  transform: rotate(45deg);
}
.text-btn {
  color: var(--green);
  padding-right: 0;
}
.page-head .text-btn:hover {
  background: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr);
  align-items: start;
  gap: clamp(24px, 3vw, 46px);
}
#play-area {
  min-width: 0;
  position: relative;
}
#board {
  width: 100%;
  max-width: 720px;
  margin: auto;
  isolation: isolate;
  filter: drop-shadow(0 3px 0 #5b463630) drop-shadow(0 9px 14px #5b463611);
}
.stone {
  width: 100%;
  height: auto;
  user-select: none;
  overflow: visible;
  touch-action: manipulation;
}
.slab {
  fill: var(--sand);
  stroke: var(--brown);
  stroke-width: 1.6;
}
.engraving {
  stroke: var(--brown);
  stroke-width: 1.1;
  fill: none;
  opacity: 0.82;
}
.track {
  stroke: var(--brown);
  stroke-width: 2.8px;
  vector-effect: non-scaling-stroke;
  fill: none;
}
.coordinate {
  font: italic 14px var(--serif);
  fill: var(--brown);
  text-anchor: middle;
}
.hits rect {
  fill: transparent;
  cursor: pointer;
  outline: 0;
  touch-action: none;
}
.hits rect:focus-visible {
  stroke: var(--green);
  stroke-width: 2.6;
  stroke-dasharray: 4 5;
}
.hits rect:active {
  fill: #1f6b5b12;
}
.ray {
  stroke: var(--green);
  stroke-width: 3;
  opacity: 0.78;
}
.halo {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.6;
  animation: breathe 1.2s ease-in-out infinite alternate;
}
.halo-fill {
  fill: #1f6b5b12;
}
.last-line {
  stroke: var(--ink);
  stroke-width: 2.8;
  stroke-dasharray: 6 5;
  fill: none;
}
.last-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
}
.banned {
  fill: none;
  stroke: #5e5e5e;
  stroke-width: 2.5;
  stroke-dasharray: 4 3;
}
.capture-ring {
  stroke: #b23a2e;
  stroke-width: 2;
  fill: none;
}
.hint-arrow {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  marker-end: url(#arrow-tip);
}
@keyframes breathe {
  from {
    stroke-opacity: 0.65;
  }
  to {
    stroke-opacity: 1;
    stroke-width: 2.4;
  }
}
.board-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 46px;
}
.foot-orn {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--brown);
  opacity: 0.6;
}
.foot-orn i {
  width: 34px;
  height: 1px;
  background: currentColor;
}
.foot-orn b {
  font-size: 13px;
  line-height: 1;
}
#board-tools {
  display: flex;
  gap: 3px;
}
.tool {
  width: 44px;
  padding: 0;
  color: var(--brown);
}
.tool[aria-pressed="false"] {
  opacity: 0.65;
}
#feedback {
  min-height: 24px;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}
.panel-area {
  min-width: 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 3px 0 #5b463609;
}
.valley {
  width: 100%;
  display: block;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  aspect-ratio: 520/178;
  object-fit: cover;
}
.card-body {
  padding: clamp(20px, 2.1vw, 31px);
}
.step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--green);
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 750;
}
.step-pips {
  display: flex;
  gap: 4px;
}
.step-pips i {
  width: 14px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
}
.step-pips i.lit {
  background: var(--green);
}
.lesson-title,
.card h2,
.dialog-title {
  font: 500 clamp(27px, 2.45vw, 37px) / 1.07 var(--serif);
  letter-spacing: -0.035em;
  margin: 17px 0 10px;
  color: #302b25;
}
.lesson-copy,
.desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}
.lesson-text {
  min-height: 109px;
}
.lesson-actions,
.buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 21px;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 17px;
  font-size: 14px;
  font-weight: 650;
  transition:
    background 0.14s,
    border-color 0.14s;
}
.btn:hover {
  background: #5b46360b;
  border-color: var(--brown);
}
.btn.primary {
  color: var(--card);
  background: var(--green);
  border-color: var(--green);
}
.btn.primary:hover {
  background: #19594c;
}
.btn:disabled {
  opacity: 0.43;
}
.lesson-actions .primary {
  flex: 1;
  justify-content: space-between;
  padding-inline: 20px;
}
.lesson-actions .btn:not(.primary) {
  padding-inline: 17px;
}
.statbox {
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-top: 17px;
  padding: 3px 18px;
  background: #faf7f060;
}
.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}
.stat + .stat {
  border-top: 1px solid var(--line);
}
.stat-label {
  color: var(--muted);
  font-size: 14px;
}
.stat-values {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-number {
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.capture-pips {
  display: flex;
  gap: 4px;
}
.capture-pips i {
  width: 8px;
  height: 8px;
  border: 1.3px solid var(--brown);
  border-radius: 50%;
}
.capture-pips i.lit {
  background: var(--brown);
}
.stat.highlight {
  color: var(--green);
}
.stat.highlight .stat-number {
  color: var(--green);
}
.card h2 {
  margin-top: 0;
}
.stack {
  display: grid;
  gap: 9px;
}
.menu-option {
  font-size: 15px;
  min-height: 48px;
  justify-content: flex-start;
  width: 100%;
}
.menu-option > .icon:last-child {
  margin-left: auto;
}
.secondary-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.subhead {
  font-size: 13px;
  color: var(--brown);
  font-weight: 700;
  margin: 17px 0 8px;
}
.subhead:first-child {
  margin-top: 0;
}
.choices {
  display: flex;
  gap: 6px;
}
.choice {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}
.choice[aria-pressed="true"] {
  border-color: var(--green);
  background: #1f6b5b0c;
  color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.side-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 0;
}
.wide {
  width: 100%;
}
.game-turn {
  display: flex;
  align-items: center;
  gap: 13px;
}
.game-turn h2 {
  margin: 0;
}
.game-turn .desc {
  font-size: 14px;
  margin-top: 4px;
}
.phase-box {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 18px;
}
.phase {
  display: inline-block;
  color: var(--green);
  font-weight: 650;
  font-size: 14px;
}
.game-last,
.draw-left {
  font-size: 14px;
  margin: 7px 0 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.game-last {
  min-height: 21px;
}
.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 17px;
}
.status {
  font-size: 14px;
  color: var(--green);
  min-height: 1.4em;
  margin: 8px 0;
}
.link-field {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  padding: 10px;
  font-size: 13px;
}
.turn-art {
  max-height: 114px;
}
.result.card .valley {
  max-height: 150px;
}
dialog {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  width: min(460px, calc(100% - 32px));
  max-height: 85dvh;
  padding: 0;
  box-shadow: 0 18px 65px #2b1d1430;
}
dialog::backdrop {
  background: #2b1d145c;
}
#dialog-inner {
  padding: 26px 30px;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dialog-title {
  margin: 0;
  font-size: 32px;
}
.dialog-body {
  margin: 12px 0;
}
.dialog-body p {
  color: var(--muted);
  line-height: 1.55;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  min-height: 58px;
}
.switch {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 22px;
  min-width: 74px;
  padding: 5px 9px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
}
.switch:before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 100%;
  background: var(--muted);
}
.switch[aria-checked="true"] {
  color: var(--card);
  background: var(--green);
  border-color: var(--green);
}
.switch[aria-checked="true"]:before {
  background: var(--card);
}
.dialog-body .buttons {
  flex-wrap: wrap;
}
.reduced *,
.reduced *:before {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (min-width: 920px) {
  .workspace {
    --max: min(1110px, calc(100vh + 222px));
  }
}
@media (min-width: 1180px) {
  .workspace {
    padding-top: 40px;
  }
  .page-head {
    margin-bottom: 28px;
  }
}
@media (max-width: 850px) and (min-width: 701px) {
  .workspace {
    width: calc(100% - 36px);
  }
  .layout {
    grid-template-columns: 1.18fr 1fr;
    gap: 18px;
  }
  .top-inner {
    width: calc(100% - 36px);
  }
  .card-body {
    padding: 17px;
  }
  .lesson-title {
    font-size: 28px;
  }
  .statbox {
    padding-inline: 12px;
  }
  .capture-pips {
    display: none;
  }
}
@media (max-width: 700px) {
  .top-inner {
    width: calc(100% - 28px);
    height: 64px;
    gap: 10px;
  }
  .brand {
    gap: 8px;
  }
  .brand > svg {
    width: 35px;
    height: 35px;
  }
  .brand-title {
    font-size: 22px;
  }
  .brand-sub {
    font-size: 9px;
    margin-top: 2px;
  }
  .navbtn {
    width: 40px;
    padding: 0;
  }
  .navbtn span,
  .nav-sep {
    display: none;
  }
  nav {
    gap: 0;
  }
  .workspace {
    width: min(calc(100% - 30px), 480px);
    padding: 18px 0 16px;
  }
  .page-head {
    gap: 13px;
    margin-bottom: 13px;
  }
  .page-head h1 {
    font-size: 33px;
  }
  .page-head .text-btn {
    font-size: 12px;
    min-height: 36px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .panel-area {
    display: contents;
  }
  #play-area,
  #panel,
  #stats {
    width: 100%;
  }
  #play-area {
    order: 1;
  }
  #panel {
    order: 2;
  }
  #stats {
    order: 0;
  }
  #stats:empty {
    display: none;
  }
  .statbox {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    border: 0;
    background: none;
    margin: 0 0 6px;
    padding: 0;
    border-radius: 0;
  }
  .stat {
    min-height: 28px;
    gap: 5px;
  }
  .stat + .stat {
    border: 0;
  }
  .stat-label {
    font-size: 11.5px;
  }
  .stat-number {
    font-size: 13px;
  }
  .stat svg {
    width: 23px;
    height: 23px;
  }
  .stat-values {
    gap: 4px;
    margin-left: 0;
  }
  .capture-pips {
    gap: 2px;
  }
  .capture-pips i {
    width: 5px;
    height: 5px;
  }
  .board-foot {
    position: absolute;
    bottom: 0;
    right: 0;
    min-height: 36px;
  }
  .board-foot .foot-orn {
    display: none;
  }
  .board-foot .tool {
    width: 34px;
    min-height: 34px;
  }
  .board-foot .icon {
    width: 16px;
  }
  #feedback {
    min-height: 36px;
    padding: 5px 72px 0 0;
    font-size: 12px;
  }
  .card-body {
    padding: 16px 18px;
  }
  .valley {
    max-height: 86px;
    object-position: 50% 64%;
  }
  .lesson-text {
    min-height: 0;
  }
  .lesson-title {
    font-size: 26px;
    margin: 10px 0 4px;
  }
  .lesson-copy {
    font-size: 14px;
  }
  .lesson-actions {
    margin-top: 13px;
  }
  .statbox .highlight {
    outline: none;
  }
  .game-actions {
    margin-top: 13px;
  }
  .card:has(.game-turn) .valley,
  .setup-card .valley {
    display: none;
  }
  .game-turn h2 {
    font-size: 28px;
  }
  .phase-box {
    padding-top: 10px;
    margin-top: 12px;
  }
  .top-inner .navbtn {
    min-width: 34px;
  }
  .board-foot {
    opacity: 0.9;
  }
  .eyebrow {
    font-size: 10px;
  }
  .menu-card .valley {
    max-height: 88px;
  }
}
@media (max-width: 365px) {
  .brand-sub {
    display: none;
  }
  .workspace {
    width: calc(100% - 20px);
  }
  .top-inner {
    width: calc(100% - 16px);
  }
  .capture-pips {
    display: none;
  }
  .navbtn {
    width: 34px;
  }
}

.mobile-turn {
  display: none;
}
@media (max-width: 700px) {
  .mobile-turn {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--green);
    font-size: 13px;
    margin-bottom: 4px;
  }
  .mobile-turn span {
    font-size: 12px;
    color: var(--muted);
    margin-left: auto;
  }
  .game-card .game-turn {
    display: none;
  }
  .game-card .phase-box {
    margin-top: 0;
    padding-top: 0;
    border: 0;
  }
}
.draw-left {
  min-height: 21px;
}
.mobile-phase,
.mobile-limit {
  display: none;
}
.result {
  animation: appear 0.25s ease-out;
}
@keyframes appear {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 700px) {
  .mobile-phase {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    font-size: 12px;
  }
  .mobile-phase strong {
    color: var(--green);
  }
  .mobile-phase span,
  .mobile-limit {
    color: var(--muted);
  }
  .mobile-limit {
    display: block;
    min-height: 18px;
    font-size: 12px;
  }
  .game-card .phase-box {
    display: none;
  }
  .game-card .game-actions {
    margin-top: 0;
  }
}
