:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #25352d;
  background: #f4f3ee;
  font-synthesis: none;
  --muted: #7c827b;
  --green: #325b45;
  --line: #e5e7df;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #63896c; outline-offset: 4px; }
[hidden] { display: none !important; }
.site-header, main, footer { max-width: 1220px; margin: 0 auto; padding-inline: 42px; }
.site-header { display: flex; align-items: center; justify-content: space-between; height: 104px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.brand small { display: block; font-size: 9px; letter-spacing: 3px; color: var(--muted); margin-top: 2px; }
.brand-icon { width: 39px; height: 39px; border-radius: 12px; background: #253b2f; position: relative; }
.brand-icon i { width: 15px; height: 15px; background: #f4f3ee; border-radius: 50%; position: absolute; top: 7px; left: 7px; }
.brand-icon i + i { top: 18px; left: 18px; background: #cfaa6c; border: 2px solid #253b2f; }
.local-badge { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #667362; }
.local-badge > span { width: 6px; height: 6px; background: #71916b; border-radius: 50%; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; padding: 39px 0 29px; gap: 20px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin: 0 0 12px; font-weight: 500; }
h1 { margin: 0; font-weight: 600; font-size: clamp(25px, 3.1vw, 37px); letter-spacing: -1px; line-height: 1.4; }
h1 em { font-style: normal; color: #7c8e72; }
.intro-note { color: var(--muted); font-size: 12px; line-height: 1.9; margin: 0 0 3px; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 24px; align-items: start; max-width: max(740px, 100svh); margin-inline: auto; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 21px 23px 16px; box-shadow: 0 7px 24px #24392a04; }
.board-toolbar { display: flex; justify-content: space-between; font-size: 12px; color: #777f73; margin-bottom: 18px; }
#move-number { font-variant-numeric: tabular-nums; color: #394b3f; }
.board-surface { background: #e7eae2; border: 1px solid #d3d9cb; border-radius: 9px; padding: 13px 17px 20px 10px; box-shadow: inset 0 1px 1px #ffffff66; }
.board-layout { display: grid; grid-template-columns: 23px minmax(0, 1fr) 32px; grid-template-rows: 23px auto; }
.evaluation-bar { grid-column: 3; grid-row: 2; position: relative; margin-left: 10px; border: 1px solid #87927d; border-radius: 5px; overflow: hidden; background: #a3a8a3; }
.evaluation-bar.active { background: #faf9f4; }
.evaluation-black { height: var(--black-share, 50%); background: #202722; transition: height .3s; visibility: hidden; }
.evaluation-bar.active .evaluation-black { visibility: visible; }
.evaluation-label { position: absolute; left: 0; width: 100%; text-align: center; font-size: 10px; line-height: 20px; color: #fff; text-shadow: 0 1px 2px #000; }
.evaluation-label-black { top: 2px; }
.evaluation-label-white { bottom: 2px; }
#evaluation-score { font-variant-numeric: tabular-nums; }
.column-labels { display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); grid-column: 2; text-align: center; }
.row-labels { display: grid; grid-template-rows: repeat(var(--size), minmax(0, 1fr)); grid-row: 2; text-align: center; }
.column-labels, .row-labels { font-size: 9px; color: #76816f; font-variant-numeric: tabular-nums; align-items: center; }
.board { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); aspect-ratio: 1; border: 1px solid #87927d; }
.point { --square: #f1f1ee; min-width: 0; min-height: 0; position: relative; padding: 0; border: 0; border-radius: 0; background: var(--square); display: grid; place-items: center; touch-action: manipulation; }
.point.dark-square { --square: #969b97; }
.point:focus-visible { z-index: 4; outline: 2px solid var(--green); outline-offset: -2px; border-radius: 50%; }
.stone { position: relative; width: 81%; height: 81%; border-radius: 50%; z-index: 2; }
.stone.black, .turn-stone.black, .mini-stone.black { background: radial-gradient(circle at 35% 28%, #565a55, #292e2b 42%, #141b17); box-shadow: 0 2px 3px #3025154a, inset 0 0 0 1px #10181366; }
.stone.white, .turn-stone.white, .mini-stone.white { background: radial-gradient(circle at 35% 28%, #fff, #f4f3ed 55%, #d6d5cc); box-shadow: 0 2px 3px #30251533, inset 0 0 0 1px #c9c9bf; }
.point.empty:not(:disabled):hover { box-shadow: inset 0 0 0 2px #325b4570; }
.point.guide .hint { position: absolute; width: 20%; height: 20%; background: #a5c8eb; box-shadow: 0 0 0 1px #6c9dc844; border-radius: 50%; pointer-events: none; }
.point.selected .stone { outline: 2px solid #377451; outline-offset: 3px; }
.point.target .hint { position: absolute; width: 29%; height: 29%; background: #326b46; box-shadow: 0 0 0 2px #e1ecd7; border-radius: 50%; z-index: 2; }
.point.last .stone::after { content: ""; position: absolute; width: 18%; height: 18%; border: 1px solid #c78f57; left: 41%; top: 41%; border-radius: 50%; background: #c78f57; }
.point.pushed .stone::after { content: ""; position: absolute; width: 18%; height: 18%; border: 1px solid #c78f57; left: 41%; top: 41%; border-radius: 50%; background: #c78f57; opacity: .45; }
.board-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 10px; color: #8a8f84; margin-top: 16px; }
.board-legend > span:not(:last-child) { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; background: #638966; border-radius: 50%; }
.legend-dot.guide-dot { background: #a5c8eb; box-shadow: 0 0 0 1px #6c9dc844; }
.sidebar { display: grid; gap: 14px; }
.turn-card, .record-card, .rules-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 22px; }
.turn-title { display: flex; align-items: center; gap: 12px; }
.turn-title h2 { font-size: 22px; line-height: 1.4; font-weight: 600; margin: 0; }
.turn-stone { display: inline-block; width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0; }
.status-message { font-size: 12px; line-height: 1.9; color: #7c8378; min-height: 46px; margin: 16px 0; }
.status-message.error { color: #ae523e; }
.turn-card.finished { border-color: #94ad8b; background: #fcfefb; }
.cancel-button { border: 1px solid #dbe5d7; border-radius: 6px; color: var(--green); padding: 8px 10px; background: #f5f8f1; width: 100%; font-size: 11px; text-align: left; margin-bottom: 12px; }
.cancel-button span { float: right; color: #91a08d; }
.players { border-block: 1px solid #eef0e9; padding-block: 7px; }
.player-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 12px; color: #8c9186; }
.player-row > span:first-child { display: flex; align-items: center; gap: 9px; }
.mini-stone { display: inline-block; width: 16px; height: 16px; border-radius: 50%; }
.player-row small { font-size: 10px; color: #9b9f95; }
.player-status { font-size: 10px; }
.player-row.current { color: #314e39; }
.player-row.current .player-status { background: #edf3e8; color: #51764b; border-radius: 4px; padding: 4px 7px; }
.restart-button { color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 7px; width: 100%; padding: 11px; margin-top: 18px; font-size: 12px; transition: background .15s; }
.restart-button span { font-size: 17px; vertical-align: -1px; margin-right: 5px; }
.restart-button:hover:not(:disabled) { background: #254b37; }
.restart-button:disabled { opacity: .45; }
.search-controls { margin-top: 16px; font-size: 11px; color: #65775d; }
.search-controls label { display: block; margin-bottom: 7px; }
.search-controls input, .search-controls select { width: 100%; padding: 7px 9px; border: 1px solid #dfe5d8; border-radius: 6px; font: inherit; color: inherit; background: #fff; }
.search-controls input + label, .search-controls select + label { margin-top: 10px; }
.search-controls p { margin: 9px 0 0; font-size: 10px; line-height: 1.8; color: #7c8378; }
.record-card { padding: 17px 16px 13px; }
.record-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 5px 10px; }
.record-heading h3 { font-size: 12px; font-weight: 600; margin: 0; }
#record-count { color: #8c9385; font-size: 10px; font-weight: 400; margin-left: 5px; }
.record-button { padding: 4px 7px; background: transparent; border: 1px solid #e2e7dc; border-radius: 5px; color: var(--green); font-size: 10px; }
.record-button:disabled { color: #a4aa9e; }
.record-scroll { max-height: 230px; overflow-y: auto; scrollbar-width: thin; }
.record-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 11px; font-variant-numeric: tabular-nums; }
.record-table th { position: sticky; top: 0; background: #fff; color: #87917f; text-align: left; font-size: 10px; font-weight: 400; padding: 6px; }
.record-table th:first-child { width: 29px; }
.record-table td { padding: 7px 6px; color: #53624d; font-family: "Cascadia Code", Consolas, monospace; overflow-wrap: anywhere; }
.record-table td:first-child { color: #969e90; font-size: 10px; }
.record-table tbody tr:nth-child(odd) { background: #f4f6ef; }
.record-table td.latest { color: #274c32; background: #e4eddd; font-weight: 600; }
.record-move { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; overflow-wrap: anywhere; }
.record-move:hover { text-decoration: underline; }
.replay-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: #65775d; font-size: 11px; font-variant-numeric: tabular-nums; }
.replay-controls button { width: 44px; padding: 6px; border: 1px solid #dfe5d8; border-radius: 6px; background: #f8faf5; color: var(--green); font-size: 18px; }
.replay-controls button:disabled { opacity: .4; }
dialog { width: min(480px, calc(100% - 32px)); max-height: 90svh; overflow: auto; border: 1px solid var(--line); border-radius: 15px; padding: 24px; color: inherit; }
dialog::backdrop { background: #25352d66; }
dialog h2 { margin: 0; font-size: 20px; }
dialog p { font-size: 12px; line-height: 1.8; color: var(--muted); }
dialog label { display: block; font-size: 12px; margin: 14px 0 7px; }
dialog input, dialog textarea, dialog select { width: 100%; font: inherit; font-size: 12px; }
dialog textarea, dialog select { border: 1px solid var(--line); border-radius: 6px; padding: 9px; }
dialog textarea { resize: vertical; }
dialog .error { color: #ae523e; }
.import-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.import-actions button { border: 1px solid #dfe5d8; border-radius: 6px; background: #f8faf5; padding: 8px 18px; color: var(--green); font-size: 12px; }
.import-actions button[type="submit"] { background: var(--green); color: #fff; }
.record-empty { text-align: center; font-size: 12px; color: #a3ac9b; padding: 5px 0; }
.position-button { display: block; margin-top: 12px; padding: 8px; width: 100%; border: 1px solid #dfe5d8; border-radius: 6px; color: #65775d; background: #f8faf5; font-size: 10px; }
.position-button:disabled { opacity: .5; }
.rules-card { padding: 19px 22px; background: #f0f1e9; }
.rules-card summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; }
.rules-card summary::-webkit-details-marker { display: none; }
.rules-card[open] summary > span { transform: rotate(45deg); }
.rules-card ol { margin: 20px 0 0; padding-left: 18px; font-size: 11px; color: #78856e; }
.rules-card li { padding-left: 4px; margin-bottom: 15px; }
.rules-card strong { color: #53614a; font-weight: 500; }
.rules-card li p { color: #7f8677; line-height: 1.9; margin: 5px 0 0; }
.rule-footnote { font-size: 10px; line-height: 1.9; color: #8c9383; border-top: 1px solid #dfe3d6; padding-top: 13px; margin: 4px 0 0; }
footer { padding-block: 25px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 10px; color: #9b9f92; }
footer p { margin: 0; }
footer .source-credit { margin-top: 6px; font-size: 11px; line-height: 1.8; color: var(--muted); }
.source-credit a { color: inherit; text-underline-offset: 3px; }
.noscript { padding: 20px; text-align: center; color: #ae523e; }
@media (min-width: 1200px) { .game-layout { grid-template-columns: minmax(0, 1fr) 304px; gap: 28px; } }
@media (max-width: 760px) {
  .site-header, main, footer { padding-inline: 20px; }
  .site-header { height: 82px; }
  .intro { padding: 27px 0 23px; }
  .intro-note { display: none; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: none; }
  .board-card { padding: 16px 12px 13px; border-radius: 12px; }
  .board-surface { padding: 7px 9px 12px 3px; }
  .board-layout { grid-template-columns: 20px minmax(0, 1fr) 32px; grid-template-rows: 20px auto; }
  .board-toolbar { margin: 0 3px 13px; }
  .board-legend { margin: 13px 3px 0; font-size: 9px; }
  .sidebar { gap: 12px; }
  .turn-card, .record-card, .rules-card { padding: 19px; }
  .players { display: flex; gap: 25px; }
  .player-row { flex: 1; }
  .status-message { min-height: 0; }
  .turn-title h2 { font-size: 20px; }
  footer { padding-block: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
