:root {
  color-scheme: light;
  --paper: #f2efe5;
  --panel: #fffdf6;
  --ink: #27443d;
  --muted: #819080;
  --line: #d9dfd0;
  --green: #3e7865;
  --orange: #c58a55;
  --serif: ui-serif, "Songti SC", "STSong", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.75 var(--sans); }
button, input { font: inherit; }
button { min-width: 44px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; line-height: 1.45; cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
button:not(:disabled):hover { filter: brightness(.95); }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #bb763d; outline-offset: 4px; }
h1, h2, h3, p, ol { margin: 0; }
h2 { font-size: 21px; line-height: 1.4; letter-spacing: -.4px; }
a { color: inherit; }
.site-header, main, footer { width: min(1180px, calc(100% - 56px)); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 23px 0 20px; border-bottom: 1px solid var(--line); font-size: 11px; }
.back { font-weight: 650; text-decoration: none; }
.back:hover { text-decoration: underline; }
.site-header > span { color: #899584; }
.site-header i { font-style: normal; color: #a9b2a0; padding-inline: 11px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; padding: 35px 0 30px; }
.eyebrow { color: #80927e; font-size: 10px; letter-spacing: 1.7px; font-weight: 750; line-height: 1.5; margin-bottom: 9px; }
h1 { font: 650 clamp(39px, 4.4vw, 54px)/1.25 var(--serif); letter-spacing: 1px; }
.intro-copy { color: #70856e; max-width: 445px; line-height: 1.95; padding-bottom: 2px; }
.session-note { color: #8c9981; font-size: 11px; margin-top: 12px; }
.notice { background: #e4ebd8; color: #53714b; border: 1px solid #bbcea9; border-radius: 9px; padding: 12px 16px; margin-bottom: 18px; font-size: 12px; overflow-wrap: anywhere; }
.confirmation { display: flex; justify-content: space-between; align-items: center; gap: 26px; padding: 23px; border: 1px solid #d1ab75; border-radius: 13px; background: #fff0d8; margin-bottom: 20px; }
.confirmation .eyebrow { color: #9a7b4d; }
.confirmation p:not(.eyebrow) { margin-top: 8px; color: #816b4c; font-size: 12px; line-height: 1.9; max-width: 690px; }
.confirmation-actions { display: flex; gap: 10px; flex-shrink: 0; }
.primary { background: #3e7865; border-color: #3e7865; color: #fffced; }
.secondary { background: #fffdf5; border-color: #b4c8ac; color: #527848; }
.text-button { background: transparent; padding: 8px 0; color: #7b9369; font-size: 11px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.full { width: 100%; }
.table-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.board-panel, .turn-panel, .starter-panel, .history-panel, .rule-panel, .share-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.board-panel { background: #284c41; border-color: #284c41; color: #e4ebd6; }
.board-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.board-panel .eyebrow { color: #9db494; }
.board-panel h2 { font-size: 22px; font-weight: 550; }
.board-size { border: 1px solid #6b8667; border-radius: 20px; padding: 5px 11px; font: 11px var(--serif); color: #bed0a7; white-space: nowrap; }
.board-wrap { position: relative; width: min(100%, 476px); min-width: 308px; aspect-ratio: 1 / 1; margin: 24px auto 20px; border-radius: 10px; background: #f7f7ec; }
#board-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#dot-layer circle { fill: #64836b; }
.box-label { font: 500 31px var(--serif); text-anchor: middle; dominant-baseline: middle; }
.box-coordinate { font: 17px var(--sans); text-anchor: middle; }
.edge-controls { position: absolute; inset: 0; display: grid; grid-template: repeat(7, minmax(0, 1fr)) / repeat(7, minmax(0, 1fr)); }
.edge-choice { width: 100%; height: 100%; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #859c7c; display: grid; place-items: center; }
.edge-choice:disabled { opacity: 1; }
.edge-choice:focus-visible { outline-offset: -2px; }
.edge-label { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #cedac3; border-radius: 50%; background: #fdfdf3; font: 10px/1 var(--sans); }
.edge-choice[data-owner="1"] .edge-label { border-color: var(--green); background: var(--green); color: #f9f8e8; }
.edge-choice[data-owner="2"] .edge-label { border-color: var(--orange); background: var(--orange); color: #fff8e9; }
.edge-choice:not(:disabled):hover .edge-label { color: #466f4e; border-color: #8aa57a; box-shadow: 0 0 0 4px #94af7822; }
.board-legend { display: flex; gap: 17px; align-items: center; color: #b3c6a1; font-size: 10px; }
.board-legend > span { display: flex; align-items: center; gap: 6px; }
.board-legend > span:last-child { margin-left: auto; color: #92ac85; font-size: 9px; }
.board-legend i { width: 9px; height: 9px; border-radius: 2px; }
.one-swatch { background: #78a98b; }
.two-swatch { background: #dda474; }
.board-progress { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-top: 1px solid #527153; margin-top: 20px; padding-top: 17px; color: #abc29a; font-size: 11px; }
.board-progress strong { color: #e4e8c9; font: 29px/1.1 var(--serif); margin-inline: 5px; }
.board-note { margin-top: 13px; color: #90ac83; font-size: 10px; line-height: 1.9; }
.side-panels { display: grid; gap: 20px; }
.turn-panel > h2 { font-size: 24px; }
.turn-detail { color: #7d9274; font-size: 12px; margin-top: 9px; min-height: 42px; line-height: 1.8; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 19px; }
.score-card { position: relative; padding: 16px 17px; border: 1px solid #d8dfcf; border-radius: 10px; background: #f4f5e9; min-width: 0; }
.score-card > span { display: block; color: #8b9a7e; font-size: 11px; }
.score-card > strong { color: #68875b; font: 40px/1.2 var(--serif); display: inline-block; margin-top: 6px; }
.score-card > small { color: #9aa88b; margin-left: 7px; font-size: 10px; }
.player-one[data-active="true"] { background: #e5eedb; border-color: #a0bd8d; }
.player-two[data-active="true"] { background: #f7e8d3; border-color: #d7b17e; }
.player-two > strong { color: #b27d4f; }
.score-card[data-active="true"]::after { content: '行动中'; position: absolute; right: 12px; top: 17px; font-size: 9px; color: #7d946c; }
.player-two[data-active="true"]::after { color: #b18b5e; }
.result { background: #e7eed8; border: 1px solid #b4c99b; border-radius: 9px; padding: 16px; margin-top: 18px; }
.result h3 { font: 600 24px/1.5 var(--serif); color: #60804a; }
.result p { color: #879c70; font-size: 11px; line-height: 1.9; margin-top: 4px; }
.game-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 19px; }
.game-actions .secondary { flex: 1; font-size: 12px; }
.game-actions .text-button { margin-left: 12px; }
.small-note { margin-top: 10px; color: #9ba88c; font-size: 10px; }
.starter-panel h2 { font-size: 19px; }
.starter-controls { display: flex; gap: 10px; margin-top: 17px; }
.starter-controls button { flex: 1; min-width: 0; border-color: #d2dcc7; background: transparent; color: #8e9f80; font-size: 12px; padding-inline: 7px; }
.starter-controls [aria-pressed="true"] { background: #e8efdc; border-color: #a8c091; color: #5e7d4d; }
.starter-panel > p:not(.eyebrow) { color: #98a58a; font-size: 10px; margin-top: 11px; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.history-heading h2 { font-size: 19px; }
.history-heading > span { color: #a0ab91; font-size: 10px; white-space: nowrap; }
.history-heading strong { color: #80966c; font-weight: 500; }
.empty-log { font-size: 11px; color: #9aa88a; padding-top: 18px; }
.log-scroll { max-height: 262px; overflow: auto; border-radius: 5px; }
#move-log { list-style: none; padding: 0; }
#move-log li { display: flex; gap: 11px; padding: 13px 0 11px; border-bottom: 1px dashed #dce3cf; }
#move-log li:last-child { border-bottom: 0; }
.move-number { color: #9daf8c; font: 14px/1.5 var(--serif); flex: 0 0 19px; padding-top: 2px; }
.move-title { color: #70885f; font-size: 11px; }
.move-description { color: #9aa88b; font-size: 10px; line-height: 1.9; margin-top: 3px; }
.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.rule-panel, .share-panel { background: #fffdf680; }
.bottom-grid h2 { font: 600 26px/1.5 var(--serif); }
.bottom-grid p:not(.eyebrow) { color: #8a9c7b; font-size: 12px; line-height: 1.95; margin-top: 13px; }
.share-panel strong { font-weight: 600; color: #718d5b; }
.share-panel > .secondary { margin-top: 18px; font-size: 12px; }
#share-result { margin-top: 18px; }
#share-result label { display: block; color: #819975; font-size: 11px; margin-bottom: 6px; }
#share-link { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #b6cca3; border-radius: 7px; color: #668754; background: #fffef7; font-size: 11px; padding: 10px; }
.bottom-grid .copy-note { font-size: 10px !important; margin-top: 0 !important; color: #9ba98b !important; }
footer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 27px 0 34px; color: #9ba88c; font-size: 10px; text-align: center; }
footer > span { font-size: 24px; color: #a3b28d; line-height: 1; }
[hidden] { display: none !important; }
@media (max-width: 1060px) {
  .site-header, main, footer { width: calc(100% - 44px); }
  .table-grid, .bottom-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; }
  .board-panel { padding: 23px 12px; }
  .turn-panel, .starter-panel, .history-panel, .rule-panel, .share-panel { padding: 21px; }
  .board-heading { padding-inline: 8px; }
  .intro-copy { font-size: 13px; max-width: 370px; }
  .confirmation { flex-direction: column; align-items: flex-start; gap: 17px; }
  .board-legend, .board-progress, .board-note { margin-inline: 8px; }
  .board-legend { gap: 12px; }
  .board-legend > span:last-child { font-size: 8px; }
  .score-card { padding: 14px 12px; }
  .score-card[data-active="true"]::after { right: 8px; top: 15px; font-size: 8px; }
  .game-actions { gap: 10px; }
  .game-actions .text-button { margin-left: 0; }
}
@media (max-width: 850px) {
  .intro { gap: 26px; }
  h1 { font-size: 40px; }
  .intro-copy { max-width: 335px; font-size: 12px; }
  .table-grid, .bottom-grid { grid-template-columns: 1fr; }
  .board-panel { padding-inline: 24px; }
  .board-wrap { width: min(100%, 476px); }
  .side-panels { grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; }
  .history-panel { grid-column: 1 / -1; }
  #move-log { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .log-scroll { max-height: 235px; }
}
@media (max-width: 720px) {
  .site-header, main, footer { width: calc(100% - 28px); }
  .site-header { font-size: 10px; padding: 18px 0 16px; }
  .site-header > span { font-size: 9px; max-width: 152px; text-align: right; line-height: 1.8; }
  .site-header i { padding-inline: 4px; }
  .intro { display: block; padding: 27px 0 24px; }
  h1 { font-size: 42px; }
  .intro .eyebrow { font-size: 9px; }
  .intro-copy { max-width: none; font-size: 12px; margin-top: 18px; line-height: 1.9; }
  .intro-copy > p:first-child br { display: none; }
  .session-note { font-size: 10px; margin-top: 12px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.3px; }
  .table-grid, .bottom-grid { gap: 18px; }
  .board-panel { padding: 23px 10px 22px; }
  .board-heading { padding-inline: 9px; gap: 10px; }
  .board-panel h2 { font-size: 21px; }
  .board-wrap { margin-top: 21px; margin-bottom: 17px; }
  .edge-label { width: 22px; height: 22px; font-size: 9px; }
  .board-legend { font-size: 9px; gap: 12px; }
  .board-legend > span:last-child { font-size: 8px; }
  .board-progress { font-size: 10px; margin-top: 18px; padding-top: 15px; }
  .board-progress strong { font-size: 27px; }
  .board-note { font-size: 10px; }
  .side-panels { grid-template-columns: 1fr; gap: 18px; }
  .turn-panel, .starter-panel, .history-panel, .rule-panel, .share-panel { padding: 23px 21px; }
  .turn-panel > h2 { font-size: 24px; }
  .turn-detail { min-height: 0; margin-top: 10px; font-size: 12px; }
  .score-card { padding: 16px; }
  .score-card[data-active="true"]::after { top: 17px; right: 12px; font-size: 9px; }
  .game-actions { gap: 19px; margin-top: 18px; }
  .game-actions .text-button { margin-left: 3px; }
  .small-note, .starter-panel > p:not(.eyebrow) { font-size: 10px; }
  .starter-controls button { font-size: 12px; }
  #move-log { display: block; }
  .log-scroll { max-height: 240px; }
  .history-panel h2 { font-size: 20px; }
  .move-title { font-size: 12px; }
  .move-description { font-size: 11px; }
  .bottom-grid { margin-top: 18px; }
  .bottom-grid h2 { font-size: 25px; }
  .bottom-grid p:not(.eyebrow) { font-size: 12px; }
  .confirmation { padding: 20px; gap: 18px; }
  .confirmation h2 { font-size: 20px; }
  .confirmation p:not(.eyebrow) { font-size: 11px; }
  .confirmation-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .confirmation-actions button { font-size: 12px; padding-inline: 8px; }
  .notice { font-size: 11px; padding: 12px 14px; }
  footer { font-size: 9px; padding: 25px 0 31px; }
}
@media (max-width: 385px) {
  h1 { font-size: 39px; }
  .board-legend { gap: 10px; }
  .board-legend > span:last-child { font-size: 7px; }
  .turn-panel, .starter-panel, .history-panel, .rule-panel, .share-panel { padding-inline: 18px; }
  .score-card { padding: 16px 13px; }
  .score-card[data-active="true"]::after { right: 8px; }
  .game-actions { gap: 12px; }
}
