/* ネファタフル固有の見た目（共通は ../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; }

/* 盤の上の帯: 攻め手と守り手の名札（だれ・残りの駒）。手番の側を濃く */
.score-tag .tag-bg { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.score-tag .tag-name { font: 700 22px var(--font); fill: var(--ink); }
.score-tag .tag-sub { font: 600 22px var(--font); fill: var(--ink-sub); }
.score-tag.on .tag-bg { fill: var(--surface); stroke: var(--accent); stroke-width: 5; }

/* マスの線・逃げ先・王座と角 */
.ink-line { stroke: #4A2E18; stroke-width: 2; opacity: .55; }
.ink-frame { fill: none; stroke: #4A2E18; stroke-width: 3.5; opacity: .85; }
.goal-cell { fill: #E2B866; opacity: .45; }
.special-cell { fill: #F0D7A4; opacity: .18; }
.knot path { fill: none; stroke: #F3E3BE; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }

/* 手番の側の色を盤のふちに（攻め手＝焦げ茶／守り手＝藍） */
.turn-frame { fill: none; stroke-width: 6; opacity: 0; pointer-events: none; transition: opacity var(--dur); }
.turn-frame.c0 { stroke: #3A2618; opacity: .85; }
.turn-frame.c1 { stroke: #2F5D8A; opacity: .9; }
.status .piece-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid var(--ink-sub); display: inline-block; vertical-align: -5px; margin-right: 6px; }
.status .piece-dot.c0 { background: #3A2A20; }
.status .piece-dot.c1 { background: #F3E6C8; }

/* 駒: 平らな丸い木の駒に、薄い影を1段 */
.tpiece { pointer-events: none; }
.pc-shadow { fill: rgba(40, 20, 5, .35); }
.pc-disc.atk { fill: #3A2A20; stroke: #1E140D; stroke-width: 2.5; }
.pc-inner.atk { fill: none; stroke: #C9A877; stroke-width: 2.5; }
.pc-disc.def, .pc-disc.king { fill: #F3E6C8; stroke: #4A2E18; stroke-width: 2.5; }
.pc-inner.def { fill: none; stroke: #8A6A45; stroke-width: 2.5; }
.pc-inner.king { fill: none; stroke: none; }
.pc-disc.king { stroke-width: 3.5; }
.crown { fill: #D9A632; stroke: #5A3A12; stroke-width: 1.8; stroke-linejoin: round; }
.tpiece.up { filter: drop-shadow(0 6px 0 rgba(0,0,0,.3)); }

/* 印: 動ける線・動かせる駒・選んだ駒・行き先・取られる危険・王の逃げ道・ヒント・キーボードの枠・直前の手・CPUの手 */
.mark { pointer-events: none; }
.lane { fill: #FFF6DC; opacity: .55; }
.mark.movable { fill: none; stroke: #4F8FD8; stroke-width: 3.5; }
.mark.sel { fill: none; stroke: #FFF8EA; stroke-width: 5; }
.mark.dest { fill: #2F5D8A; opacity: .9; stroke: #FFF8EA; stroke-width: 2.5; }
.mark.dest.cap { fill: #C8453B; }
.mark.dest.win { fill: #D9A632; }
.mark.danger { fill: none; stroke: #C8453B; stroke-width: 3.5; stroke-dasharray: 7 4; }
.mark.cross path { stroke: #B23A3A; stroke-width: 4.5; stroke-linecap: round; fill: none; }
.mark.route { stroke: #D9A632; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 10; fill: none; }
.mark.route-end { fill: none; stroke: #D9A632; stroke-width: 4; }
.mark.hint { fill: none; stroke: #4F8FD8; stroke-width: 4.5; stroke-dasharray: 8 5; animation: hint 1.2s ease-in-out infinite; }
.mark.hintpath { stroke: #4F8FD8; stroke-width: 4.5; stroke-dasharray: 8 7; stroke-linecap: round; fill: none; }
@keyframes hint { 50% { opacity: .45; } }
.mark.cursor { fill: none; stroke: #E0A800; stroke-width: 3.5; stroke-dasharray: 6 4; }
.mark.cpu { fill: rgba(255, 248, 234, .35); stroke: #FFF8EA; stroke-width: 4; }
.mark.trap { fill: none; stroke: #C8453B; stroke-width: 5; }
.trail { stroke: rgba(120, 60, 20, .5); stroke-width: 5; stroke-dasharray: 2 9; stroke-linecap: round; pointer-events: none; fill: none; }
.last { fill: none; stroke: rgba(120, 60, 20, .6); stroke-width: 3; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .mark.hint { animation: none; } }
.hit { fill: transparent; cursor: pointer; }
#fx, #over, #lanes { pointer-events: none; }

.board-wrap .callout { padding: 6px 18px; font-size: clamp(16px, 3.8vw, 22px); }
.stage { padding: 12px; }
@media (max-width: 560px) {
  .stage { margin-left: -8px; margin-right: -8px; padding: 6px; }
}

.result-box .score { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; }
.result-box { inset: 18% 8% auto; padding: 16px 20px; }
.result-box h2 { font-size: 1.4rem; margin-bottom: 6px; }
.result-box.low { inset: auto 8% 4%; }
@media (max-width: 520px) { .result-box { inset: 12% 0 auto; } .result-box.low { inset: auto 0 2%; } .result-box .controls .btn { padding: 0 12px; } }

.howto img { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.howto figcaption { text-align: center; }
.turnbar { min-height: 112px; }
.turnbar .status { min-height:2.6em; }
.turnbar .message { height:5.25em; min-height:0; overflow-y:auto; }
.setup-open .turnbar .message:empty { height:0; }
.article table { width:100%; table-layout:fixed; }
.article th,.article td { overflow-wrap:anywhere; }
.lang-switch { text-align:right; font-size:14px; margin:8px 0; }

/* Reserve the measured longest JA/EN message at 360/390px. */
.turnbar { --tb-msg-lines: 4; }
:root:lang(en) .turnbar { --tb-msg-lines: 5; }

/* Static gold frames identify the existing escape rule, independent of hint marks. */
.goal-cell{fill:#FFE4A0;opacity:.65;stroke:#805e20;stroke-width:2}
.corner-goal{fill:none;stroke:#FFE3A0;stroke-width:5;pointer-events:none}
.goal-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px auto;max-width:600px;min-height:54px;font-size:14px;line-height:1.4}
.goal-summary span{display:flex;align-items:center;padding:6px 8px;border:1px solid var(--line-strong);border-radius:6px;background:var(--surface);color:var(--ink)}
.king-goal{border-left:5px solid #b98a28!important}.attack-goal{border-left:5px solid #58402c!important}
#play .btn{font-size:17px;min-height:44px}#play .controls{gap:8px}
.choice,.check,.rules-more>summary{min-height:44px}.choice{font-size:16px}.check{display:flex;align-items:center;gap:8px}
.howto-shot{position:relative;max-width:440px;margin-inline:auto}.howto-shot img{display:block;width:100%;height:auto}.howto-shot svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;filter:none!important}.howto figcaption{font-size:16px;text-align:left;max-width:440px;margin:8px auto}
