/* ミニ将棋固有の見た目（共通は ../common/base.css） */
#board { user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.board-wrap { max-width: 520px; margin: 0 auto; }

/* 上下の帯（駒台: 名前と持ち駒） */
.strip { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.strip.on { stroke: var(--accent); stroke-width: 5; }
.strip-label { font: 700 15px var(--font); fill: var(--ink-sub); }
.name-tag rect { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.name-tag text { font: 700 24px var(--font); fill: var(--ink); }
.name-tag.on rect { fill: var(--ink); stroke: var(--ink); }
.name-tag.on text { fill: var(--surface); }
.hand-count { font: 800 22px var(--font); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; pointer-events: none; }

/* 成れる段（相手のいちばん奥の段）と手番の枠 */
.zone { fill: #B0301C; opacity: .07; pointer-events: none; }
.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-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 5px; font-weight: 700; font-size: 15px; background: #E8C98F; color: #1F2328; border: 2px solid #1F2328; flex: none; }

/* 駒 */
.piece { pointer-events: none; transition: filter var(--dur); }
.piece.lifted { filter: var(--shadow-lift); translate: 0 -4px; }
.piece.doomed { animation: shake .32s ease-in-out 2; }
@keyframes shake { 0%, 100% { translate: 0 0; } 25% { translate: -2px 0; } 75% { translate: 2px 0; } }
@media (prefers-reduced-motion: reduce) { .piece.doomed { animation: none; } }

/* 印: 動かせる駒・えらんだ駒・行き先・キーボードの枠・直前の手・王手・ねらわれている駒 */
.mark { fill: none; pointer-events: none; }
.mark.movable { stroke: var(--accent); stroke-width: 3.5; }
.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: 6; }
.mark.cursor { stroke: var(--warn); stroke-width: 4; stroke-dasharray: 8 6; }
.mark.last-to { fill: rgba(255, 233, 168, .6); }
.mark.last-from { stroke: rgba(40, 28, 16, .45); stroke-width: 2.5; stroke-dasharray: 5 6; }
.mark.check { stroke: var(--ng); stroke-width: 6; fill: var(--ng); fill-opacity: .14; }
.mark.threat { stroke: var(--ng); stroke-width: 3.5; stroke-dasharray: 9 6; }
.mark.hand-pick { stroke: var(--accent); stroke-width: 5; fill: var(--accent); fill-opacity: .15; }
.mark.hand-movable { stroke: var(--accent); stroke-width: 3; }
.mark.cpu { stroke: #FFF8EA; stroke-width: 6; }
.mark.hint { stroke: var(--ok); stroke-width: 6; fill: var(--ok); fill-opacity: .16; }
:root[data-theme="dark"] .mark.movable, :root[data-theme="dark"] .mark.picked, :root[data-theme="dark"] .mark.hand-pick, :root[data-theme="dark"] .mark.hand-movable, :root[data-theme="dark"] .mark.target.take { stroke: #2F5D8A; }
:root[data-theme="dark"] .mark.target, :root[data-theme="dark"] .mark.picked { fill: #2F5D8A; }
@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.hand-pick, :root:not([data-theme="light"]) .mark.hand-movable, :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; }
}
.hit { fill: transparent; cursor: pointer; }

/* 動きガイド・ヒント・直前の手の矢印 */
.arrow { stroke-linecap: round; pointer-events: none; fill: none; }
.arrow.guide { stroke: #2F5D8A; stroke-width: 7; opacity: .85; }
.arrow.guide.blocked { opacity: .28; }
.arrow.hint { stroke: #2E7D4F; stroke-width: 9; }
.arrow.last { stroke: #8A5A2B; stroke-width: 5; opacity: .55; stroke-dasharray: 2 10; }
.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; }
@media (max-width: 560px) {
  .stage { margin-left: -8px; margin-right: -8px; } /* 盤だけ左右に広げる（ページの余白は共通の16px。D1） */
  .stage { padding: 6px; }
  .name-tag text { font-size: 26px; }
}

/* 成る・成らない */
.promo-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 12px 16px; text-align: center; z-index: 5; min-width: 240px; }
.promo-box p { margin: 0 0 8px; font-weight: 700; font-size: 1.1rem; }
.promo-box .controls { justify-content: center; margin: 0; }
.promo-box .btn { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 56px; }
.promo-box img { display: block; }

.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: 440px; height: auto; margin: 0 auto; }
.howto figcaption { text-align: center; }
/* 上のバーの高さを一定に（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: 3; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 3; --tb-st-lines: 2; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
