/* シャンチー固有の見た目（将棋の style.css をもとに）（共通は ../common/base.css） */
#board { user-select: none; -webkit-user-select: none; touch-action: manipulation; display: block; width: 100%; height: auto; }
.board-wrap { max-width: 600px; margin: 0 auto; position: relative; }

/* 上下の帯（名前と取った駒） */
.strip { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.strip.on { stroke: var(--accent); stroke-width: 5; }
.strip-label { font: 700 24px var(--font); fill: var(--ink-sub); }
.name-tag rect { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.name-tag text { font: 700 30px var(--font); fill: var(--ink); }
.name-tag.on rect { fill: var(--ink); stroke: var(--ink); }
.name-tag.on text { fill: var(--surface); }
.side-dot { stroke: #FFF8EA; stroke-width: 3; }
.side-dot.red { fill: #B0301C; }
.side-dot.black { fill: #22201C; }
.name-tag.on .side-dot { stroke: var(--surface); }

.turn-frame { fill: none; stroke-width: 7; stroke: var(--accent); opacity: 0; pointer-events: none; transition: opacity var(--dur); }
.turn-frame.on { opacity: .85; }
.status .who { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); flex: none; margin-right: 2px; vertical-align: -3px; }
.status .who.red { background: #B0301C; }
.status .who.black { background: #22201C; }
.river { pointer-events: none; }

/* 駒（共通CSSの .piece は使わない） */
.koma { pointer-events: none; filter: var(--shadow-piece); transition: filter var(--dur); }
.koma.lifted { filter: var(--shadow-lift); translate: 0 -4px; }
.koma.doomed { animation: shake .32s ease-in-out 2; }
@keyframes shake { 0%, 100% { translate: 0 0; } 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
@media (prefers-reduced-motion: reduce) { .koma.doomed { animation: none; } }

/* 印: 動かせる駒・えらんだ駒・行き先・キーボードの枠・直前の手・王手・ねらわれている駒・ふさいでいる駒・×・炮の台 */
.mark { fill: none; pointer-events: none; }
.mark.movable { stroke: var(--accent); stroke-width: 4; }
.mark.picked { stroke: var(--accent); stroke-width: 6; fill: var(--accent); fill-opacity: .18; }
.mark.target { fill: var(--accent); stroke: #FFF8EA; stroke-width: 3; }
.mark.target.take { fill: none; stroke: var(--accent); stroke-width: 7; }
.mark.cursor { stroke: var(--warn); stroke-width: 5; stroke-dasharray: 8 6; }
.mark.last-to { fill: rgba(255, 233, 168, .75); }
.mark.last-from { stroke: rgba(40, 28, 16, .5); stroke-width: 3; stroke-dasharray: 5 6; }
.mark.check { stroke: var(--ng); stroke-width: 7; fill: var(--ng); fill-opacity: .16; }
.mark.threat { stroke: #B23A3A; stroke-width: 4; stroke-dasharray: 9 6; }
.mark.block { stroke: #9A6415; stroke-width: 6; stroke-dasharray: 3 7; stroke-linecap: round; }
.mark.screen { stroke: #2F5D8A; stroke-width: 4; stroke-dasharray: 2 8; stroke-linecap: round; }
.mark.nogo { stroke: #B23A3A; stroke-width: 7; stroke-linecap: round; }
.mark.cpu { stroke: #FFF8EA; stroke-width: 7; }
.mark.hint { stroke: var(--ok); stroke-width: 7; fill: var(--ok); fill-opacity: .16; }
:root[data-theme="dark"] .mark.movable, :root[data-theme="dark"] .mark.picked, :root[data-theme="dark"] .mark.target.take { stroke: #2F5D8A; }
:root[data-theme="dark"] .mark.target, :root[data-theme="dark"] .mark.picked { fill: #2F5D8A; }
:root[data-theme="dark"] .mark.check { stroke: #B23A3A; fill: #B23A3A; }
:root[data-theme="dark"] .mark.hint { stroke: #2E7D4F; fill: #2E7D4F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark.movable, :root:not([data-theme="light"]) .mark.picked, :root:not([data-theme="light"]) .mark.target.take { stroke: #2F5D8A; }
  :root:not([data-theme="light"]) .mark.target, :root:not([data-theme="light"]) .mark.picked { fill: #2F5D8A; }
  :root:not([data-theme="light"]) .mark.check { stroke: #B23A3A; fill: #B23A3A; }
  :root:not([data-theme="light"]) .mark.hint { stroke: #2E7D4F; fill: #2E7D4F; }
}
.hit { fill: transparent; cursor: pointer; }

/* 動きガイド・ヒント・CPUの手の矢印 */
.arrow { stroke-linecap: round; pointer-events: none; fill: none; }
.arrow.guide { stroke: #2F5D8A; stroke-width: 7; opacity: .85; }
.arrow.guide.blocked { opacity: .3; }
.arrow.guide.jump { stroke-dasharray: 2 12; stroke-width: 8; }
.arrow.hint { stroke: #2E7D4F; stroke-width: 9; }
.arrow.cpu { stroke: #8A5A2B; stroke-width: 8; opacity: .9; }
#guide, #fx { pointer-events: none; }

.board-wrap .callout { padding: 6px 18px; font-size: clamp(17px, 4vw, 24px); top: 44%; }
.stage { padding: 12px; }
.coord text { font: 700 26px var(--font); fill: #5A3B24; pointer-events: none; }
@media (max-width: 560px) {
  .stage { margin-left: -8px; margin-right: -8px; padding: 6px; } /* 盤だけ左右に広げる（ページの余白は共通の16px） */
  /* スマホ幅（盤が約0.4倍に縮む）: 名前・数字を画面で12px以上に */
  .name-tag text { font-size: 36px; }
  .strip-label { font-size: 34px; }
  .coord text { font-size: 34px; }
}

.result-box .score { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.result-box { inset: 20% 6% auto; padding: 16px 20px; }
.result-box h2 { font-size: 1.4rem; margin-bottom: 6px; }
@media (max-width: 520px) { .result-box { inset: 14% 0 auto; } .result-box .controls .btn { padding: 0 12px; } }

.howto img { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; }
.howto figcaption { text-align: center; }
.article h4 { margin: 1.2em 0 .4em; font-size: 1.02rem; }

/* 棋譜 */
.kifu { max-width: 600px; margin: 8px auto 0; max-height: 4.6em; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 8px; background: var(--surface); font-size: 15px; line-height: 1.5; }
.kifu-head { font-weight: 700; color: var(--ink-sub); margin-right: 8px; }
.kifu ol { display: inline; margin: 0; padding: 0; list-style: none; counter-reset: k; }
.kifu li { display: inline-block; margin-right: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kifu li.r { counter-increment: k; }
.kifu li.r::before { content: counter(k) ". "; color: var(--ink-sub); font-size: 14px; }
.kifu li::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; vertical-align: 2px; }
.kifu li.r::after { background: #B0301C; }
.kifu li.b::after { background: var(--ink); }
.kifu li.chk { font-weight: 700; }
.kifu.empty ol::after { content: "まだ指していません"; color: var(--ink-sub); }
:root:lang(en) .kifu.empty ol::after { content: "No moves yet"; }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
