/* Preview artwork is reused inside the live game without the workshop layout. */
.board[hidden], .board [hidden], .game-screen [hidden] { display:none !important; }
.board { --game-board-ratio:1; width:min(100%,800px,calc((100svh - 275px)*var(--game-board-ratio))); min-width:0; overflow:visible; }
.board.is-themed { aspect-ratio:auto; padding:0; border:0; border-radius:0; box-shadow:none; background:none; }
.board.is-themed::before, .board.is-themed::after { display:none; }
.classic-surface { position:absolute; inset:0; }
.classic-points { position:absolute; inset:0; }
.classic-surface .board-lines path { stroke:#52684b; stroke-width:2; fill:none; vector-effect:non-scaling-stroke; }
.classic-surface:not(.show-labels) .classic-label { visibility:hidden; }
.board-cell:disabled { opacity:1; }
.classic-surface .board-cell.is-moving { z-index:5; }
.classic-captured-ghost { position:absolute; width:17%; aspect-ratio:1; transform:translate(-50%,-50%); pointer-events:none; z-index:4; }
.game-board-surface { touch-action:pan-y; }
.game-board-surface:is(.go-board,.xq-board) { --point-size:17%; }
.game-board-surface:is(.go-board,.xq-board).is-spatial .go-point,
.game-board-surface:is(.go-board,.xq-board).is-spatial .xq-point { aspect-ratio:auto; }
.st-board, .sg-board { position:relative; width:100%; isolation:isolate; container-type:inline-size; }
.st-board { aspect-ratio:1.26; }
.st-board[data-view="low"] { aspect-ratio:1.38; }
.sg-board { aspect-ratio:1.42; }
.sg-board[data-view="low"] { aspect-ratio:1.39; }
.sg-board[data-type="floor"] { aspect-ratio:1.16; }
:is(.st-board,.sg-board)[data-view="top"] { aspect-ratio:1; }
.st-three-canvas, .sg-three-canvas { display:block; position:absolute; inset:0; width:100%; height:100%; touch-action:pan-y; }
.st-points, .sg-points { position:absolute; inset:0; pointer-events:none; overflow:hidden; z-index:2; }
.st-point, .sg-point { position:absolute; width:30px; height:30px; padding:0; transform:translate(-50%,-50%); background:none; border:0; pointer-events:none; }
:is(.st-point,.sg-point):focus-visible { outline:2px solid #b48a45; border-radius:4px; outline-offset:2px; }
.game-board-coordinates { position:absolute; inset:0; z-index:3; pointer-events:none; }
.game-board-coordinates span { position:absolute; transform:translate(-50%,-50%); color:#594831; font:600 clamp(9px,1.7cqi,12px) Georgia,"Yu Mincho",serif; line-height:1; text-shadow:0 1px 1px #fff7; }
.ch-board .game-board-coordinates span { color:#eadcc0; text-shadow:0 1px 1px #2d241d; }
.board.is-board-loading::after { content:'正在布置棋盘…'; display:grid; place-items:center; position:absolute; inset:0; z-index:5; pointer-events:none; background:#f4f6f3dd; color:#687168; font-size:13px; }
.board.is-board-loading { min-height:260px; }
.board-wrap { min-height:0; padding:4px 2px 10px; }
.board-wrap:has(:is(.go-board,.xq-board)[data-view="flat"][data-coordinates="true"]) { padding-bottom:24px; }
.game-board-toolbar { width:100%; max-width:800px; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; color:var(--muted); font-size:11px; margin:2px auto 8px; min-height:32px; }
.game-board-toolbar > span:first-child { margin-right:auto; }
.game-board-toolbar button, .record-tools button { color:#45664d; background:none; border:0; padding:5px 0; font:inherit; cursor:pointer; touch-action:manipulation; }
.game-board-toolbar button[aria-pressed="true"] { color:#b17b30; }
#game-touch-orbit { display:none; }
@media (any-pointer:coarse) { #game-touch-orbit { display:inline-block; }.game-board-toolbar button { min-width:44px; min-height:44px; } }
@media (pointer:coarse) { #board-rotation-hint { display:none; } }
.board-notice { color:#9e493a; font-size:12px; padding:8px 0; }
.board-mode-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
.board-details { margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.board-details summary { cursor:pointer; color:#31563b; font-size:13px; }
.board-details summary span { float:right; color:var(--muted); font-size:10px; margin-top:2px; }
.board-option { display:grid; grid-template-columns:84px minmax(0,1fr); align-items:center; gap:8px; margin-top:12px; font-size:12px; color:var(--muted); }
.board-option select { width:100%; min-width:0; min-height:35px; color:var(--ink); background:#fff; border:1px solid #c8d2c5; border-radius:6px; padding:4px 7px; font:inherit; }
.board-check { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:36px; font-size:12px; color:var(--muted); }
.board-check:first-of-type { margin-top:10px; }
.board-check input { width:17px; height:17px; accent-color:#24734f; cursor:pointer; }
.game-stats { max-width:800px; width:100%; gap:14px; }
.last-move-detail { margin:5px 0 12px; color:var(--muted); font-size:11px; line-height:1.6; text-align:center; }
.action-bar { width:100%; max-width:800px; }
.record-tools { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; padding:8px 0; }
.record-tools button:disabled { opacity:.45; cursor:default; }
.move-history button { display:flex; width:100%; align-items:center; gap:9px; border:0; background:none; color:inherit; padding:0; font:inherit; text-align:left; cursor:pointer; }
.move-history .move-actor { margin-left:auto; font-size:10px; color:var(--muted); }
.move-history li.is-reviewing { background:#e7f0e1; border-radius:4px; padding-inline:6px; }
.review-controls { border:1px solid #c8d2c5; border-radius:6px; padding:8px; background:#eef5ea; margin-bottom:8px; }
.review-controls > div { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.review-controls button { border:0; color:#31563b; background:none; padding:6px 12px; cursor:pointer; }
#review-live { width:100%; margin-top:4px; border-top:1px solid #d5dfd0; font-size:12px; }
.review-controls button:disabled { opacity:.4; cursor:default; }
.game-stage.is-focused { position:fixed; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:12px 24px; overflow:auto; background:radial-gradient(ellipse at 50% 40%,#faf8f1,#e9eee5); }
.game-stage.is-focused > * { flex-shrink:0; width:min(100%,1000px); }
.game-stage.is-focused .board { width:min(100%,1000px,calc((100svh - 285px)*var(--game-board-ratio))); }
.game-stage.is-focused .board-wrap { padding-bottom:5px; }
.game-stage.is-focused .turn-banner { margin-block:5px; min-height:40px; }
.game-stage.is-focused .versus-row { margin-bottom:2px; }
.game-stage.is-focused .game-stats { margin-top:0; }
.game-stage.is-focused .action-bar { margin-top:0; }
.game-stage.is-focused .last-move-detail { margin-block:0 5px; }
body.board-focused { overflow:hidden; }
@media(min-width:981px) { .play-shell { width:min(1440px,calc(100% - 48px)); grid-template-columns:minmax(0,1fr) 310px; column-gap:36px; margin-top:20px; }.game-stage { position:sticky; top:12px; align-self:start; } }
@media(max-width:980px) { .play-shell { width:min(800px,calc(100% - 28px)); grid-template-columns:minmax(0,1fr); }.board { width:100%; }.match-panel { padding:14px 0 0; border-left:0; border-top:1px solid var(--line); }.game-settings-panel { padding-right:0; } }
@media(max-width:540px) { .play-shell { width:calc(100% - 24px); }.game-board-toolbar { gap:6px 10px; font-size:10px; }.game-stats { gap:10px; }.game-stage.is-focused { padding:8px 12px; }.game-stage.is-focused .board { width:min(100%,calc((100svh - 260px)*var(--game-board-ratio))); }.board-option { grid-template-columns:92px minmax(0,1fr); } }

/* The classic board stays a simple flat grid with four considered palettes. */
.board.style-classic { --classic-bg:#e4e6d9; --classic-grid:#7c8976; --classic-edge:#b1b6a3; --classic-wolf:#35443a; --classic-wolf-line:#b6a67d; --classic-sheep:#fffdf5; --classic-sheep-line:#8e9785; --classic-ink:#40513f; border:1px solid var(--classic-edge); border-radius:12px; background:var(--classic-bg); box-shadow:0 12px 32px #263c2512; container-type:inline-size; }
.board.style-classic[data-theme="paper"] { --classic-bg:#f0e7d3; --classic-grid:#9b8869; --classic-edge:#c6b594; --classic-wolf:#504333; --classic-wolf-line:#bda27c; --classic-sheep:#fffcf4; --classic-sheep-line:#a38c67; --classic-ink:#665137; }
.board.style-classic[data-theme="blue"] { --classic-bg:#e5eaeb; --classic-grid:#8b9c9f; --classic-edge:#b4c0c0; --classic-wolf:#2f495a; --classic-wolf-line:#afc0c7; --classic-sheep:#f9fcfd; --classic-sheep-line:#7895a5; --classic-ink:#355366; }
.board.style-classic[data-theme="night"] { --classic-bg:#293631; --classic-grid:#6b7c70; --classic-edge:#637467; --classic-wolf:#141f1a; --classic-wolf-line:#bba578; --classic-sheep:#e8e6d7; --classic-sheep-line:#bfbda6; --classic-ink:#405347; }
.classic-surface { border-radius:inherit; background:linear-gradient(140deg,#ffffff0b,transparent 60%); }
.classic-surface::before { content:''; position:absolute; inset:4%; border:1px solid var(--classic-edge); opacity:.5; border-radius:4px; pointer-events:none; }
.classic-surface .board-lines path { stroke:var(--classic-grid); stroke-width:1.7; }
.classic-surface .piece { inset:10%; border:2px solid; font-family:"KaiTi","STKaiti",serif; font-size:clamp(16px,4.5cqi,34px); font-weight:600; box-shadow:0 2px 4px #25342518,inset 0 0 0 3px #ffffff0b; }
.classic-surface .piece.wolf { color:#f6f0df; background:var(--classic-wolf); border-color:var(--classic-wolf-line); }
.classic-surface .piece.sheep { color:var(--classic-ink); background:var(--classic-sheep); border-color:var(--classic-sheep-line); }
.classic-surface .board-cell.is-selected::before { inset:2%; border:2px solid #b28e4f; box-shadow:none; }
.classic-surface .board-cell.is-last::after { inset:0; border:1px solid #b28e4f99; }
.classic-surface .is-selected .piece, .classic-surface .is-selectable:hover .piece { transform:none; }
.classic-surface .game-board-coordinates span { color:var(--classic-grid); text-shadow:none; }
.classic-theme-options { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; }
.classic-theme-options button { display:grid; justify-items:center; gap:7px; padding:10px 3px; border:1px solid var(--line); border-radius:7px; background:#fff; color:#667067; font:inherit; font-size:11px; cursor:pointer; }
.classic-theme-options button::before { content:''; width:28px; height:28px; border-radius:50%; background:#e4e6d9; border:1px solid #b1b6a3; box-shadow:inset 0 0 0 6px #ffffff40; }
.classic-theme-options [data-classic-theme="paper"]::before { background:#f0e7d3; border-color:#c6b594; }
.classic-theme-options [data-classic-theme="blue"]::before { background:#e0e9ec; border-color:#a6bbc3; }
.classic-theme-options [data-classic-theme="night"]::before { background:#293631; border-color:#637467; }
.classic-theme-options button.is-selected { color:#284c37; border-color:#47745a; background:#edf4e9; }
.board-mode-options { grid-template-columns:repeat(2,1fr); }
.camera-options { grid-template-columns:repeat(3,1fr); }
.camera-options button { font-size:11px; padding:6px 2px; }
.settings-label small { float:right; color:#8b968c; font-size:10px; }
.game-board-surface.go-board { --grid-ink:#292118; }
.game-board-surface.go-board .go-grid path { stroke-width:2.5; }

/* Board choice belongs to the top right of the game table. */
.game-header { position:relative; z-index:10; }
.board-style-menu { position:relative; }
.board-style-menu summary { list-style:none; display:flex; align-items:center; gap:7px; min-height:38px; padding:0 11px; border:1px solid #c6d2c4; border-radius:7px; background:#f9fbf7; color:#2d4e3a; font-size:12px; cursor:pointer; user-select:none; }
.board-style-menu summary::-webkit-details-marker { display:none; }
.board-style-menu summary:focus-visible { outline:2px solid #a48a53; outline-offset:3px; }
.style-chevron { font-size:15px; transition:transform .18s; }
.board-style-menu[open] .style-chevron { transform:rotate(180deg); }
.board-style-popup { position:absolute; right:0; top:calc(100% + 10px); width:310px; max-width:calc(100vw - 24px); padding:17px; border:1px solid #ccd4c5; border-radius:12px; box-shadow:0 14px 40px #20372726; background:#fbfcf7; }
.style-popup-heading { display:flex; justify-content:space-between; gap:12px; margin-bottom:14px; color:#2d4432; font-size:13px; }
.style-popup-heading span { font-size:10px; color:#8b9485; }
.board-style-popup .settings-options { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.board-style-popup button { display:grid; justify-items:center; gap:8px; padding:12px 3px 9px; min-height:80px; font-size:11px; }
.style-mini { display:block; width:38px; height:34px; border:1px solid #85735055; border-radius:3px; background-color:#ead1a2; background-image:repeating-linear-gradient(0deg,transparent 0 7px,#77604488 7px 8px),repeating-linear-gradient(90deg,transparent 0 7px,#77604488 7px 8px); }
.mini-classic { background-color:#d5e0cd; }
.mini-go { background:radial-gradient(circle at 72% 70%,#f9f6ed 0 5px,transparent 5.5px),radial-gradient(circle at 28% 32%,#272a25 0 5px,transparent 5.5px),repeating-linear-gradient(0deg,transparent 0 7px,#77604488 7px 8px),repeating-linear-gradient(90deg,#ead1a200 0 7px,#77604488 7px 8px),#ead1a2; }
.mini-xiangqi { background:radial-gradient(circle at 30% 35%,#b95937 0 4px,#efe1bb 4px 6px,transparent 6.5px),radial-gradient(circle at 70% 65%,#454834 0 4px,#efe1bb 4px 6px,transparent 6.5px),#dcc092; }
.mini-rustic { border-radius:40% 28% 35% 26%; background:radial-gradient(ellipse at 70% 68%,#f1e9cf 0 6px,transparent 7px),radial-gradient(ellipse at 30% 30%,#4b5046 0 6px,transparent 7px),#ded1ae; }
.mini-chess { background:conic-gradient(#806043 25%,#edddba 0 50%,#806043 0 75%,#edddba 0) 0 0/16px 16px; }
.mini-shogi { background:repeating-linear-gradient(0deg,transparent 0 10px,#77604488 10px 11px),repeating-linear-gradient(90deg,transparent 0 10px,#77604488 10px 11px),#dcb976; }
.player-token { border-width:1px; font-size:0; flex-shrink:0; }
.player-token.wolf { border-color:#b49d68; background:#203a30 url('./assets/wolf-emblem.svg') center/108% no-repeat; }
.player-token.sheep { border-color:#b8aa88; background:#f7f0da url('./assets/sheep-emblem.svg') center/108% no-repeat; }
@media(max-width:540px) { .game-header { grid-template-columns:34px minmax(0,1fr) auto; gap:7px; }.game-header-actions { gap:7px; }.compact-logo strong { font-size:19px; }.compact-logo span { font-size:7px; letter-spacing:.06em; }.board-style-menu summary { padding:0 7px; gap:4px; font-size:11px; }.engine-state { font-size:0; gap:0; }.engine-dot { width:7px; height:7px; }.game-header .round-button { width:32px; height:32px; }.game-header-actions #game-sound-toggle { width:30px; height:30px; }.style-popup-heading { font-size:12px; } }

.board.style-classic[data-theme="paper"] .classic-surface { background:repeating-linear-gradient(0deg,#94734403 0 1px,transparent 1px 4px),linear-gradient(135deg,#ffffff22,transparent 60%); }
.board.style-classic[data-theme="blue"] .classic-surface::before { border-color:#f7fcfc; opacity:1; }
.board.style-classic[data-theme="night"] .classic-surface::before { border-color:#b4a37666; }
@media(max-width:540px) { .board-style-menu { position:static; }.board-style-popup { top:calc(100% - 1px);right:0; } }
