/* 間違いさがし 固有の見た目（共通は ../common/base.css）。絵の中の印の色は、明るい絵の上で見やすい色に固定（ダーク表示でも絵は明るい） */
[hidden] { display: none !important; }

/* 広い画面では、2枚の絵を大きく並べるためにゲームの画面だけ本文より広げる */
@media (min-width: 860px) {
  .stage.mc { width: min(1120px, calc(100vw - 48px)); margin-left: calc(50% - min(560px, 50vw - 24px)); }
}
.stage.mc .board-wrap { max-width: none; position: relative; }

/* 2枚の絵: 広い画面は横に、せまい画面（スマホ）は縦に */
.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 auto; max-width: min(1080px, calc((100vh - 190px) * 2.72)); }
@media (max-width: 620px) { .pics { grid-template-columns: 1fr; gap: 8px; max-width: min(100%, calc((100vh - 230px) * 0.67)); } }
.pic { position: relative; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line-strong); background: #FBFAF6; aspect-ratio: 4 / 3; }
.pic svg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: pan-y; }
.stage.mc:not(:has(#play[hidden])) .pic svg { cursor: crosshair; }
.pics.zoomed .pic svg { touch-action: none; cursor: grab; }
.pics.appear .pic { animation: fade-in .3s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; background: var(--surface); color: var(--ink-sub); padding: 16px; }
.cover p { margin: 0; font-weight: 700; }

/* 絵の上の印（線の太さは拡大しても変わらない） */
.marks { pointer-events: none; }
.mk-ok-under, .mk-reveal-under, .mk-hint-under { fill: none; stroke: #FFFFFF; stroke-width: 7; }
.mk-ok { fill: none; stroke: #2E7D4F; stroke-width: 3.5; }
.mk-reveal { fill: none; stroke: #B23A3A; stroke-width: 3.2; stroke-dasharray: 8 6; }
.mk-hint { fill: none; stroke: #B7791F; stroke-width: 3.5; stroke-dasharray: 10 7; }
.mk-miss path { fill: none; stroke: #B23A3A; stroke-width: 4; stroke-linecap: round; }
.mk-miss path.mk-miss-under { stroke: #FFFFFF; stroke-width: 8; }
.mk-miss { animation: miss-fade .9s ease-out forwards; }
@keyframes miss-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.mk-num circle { fill: #B23A3A; stroke: #FFFFFF; stroke-width: 2; }
.mk-num text { fill: #FFFFFF; font-weight: 700; font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif; text-anchor: middle; dominant-baseline: central; }
.mk-cursor circle, .mk-cursor path { fill: none; stroke: #2F5D8A; stroke-width: 3; }
.mk-ok { animation: ok-pop .3s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes ok-pop { from { transform: scale(1.3); opacity: .3; } to { transform: scale(1); opacity: 1; } }

/* 拡大中の小さなバー（絵の右上） */
.zoombar { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 4px 4px 10px; }
.zoombar .zoom-lv { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zbtn { min-height: 40px; padding: 0 10px; font-size: 15px; }
.zbtn svg { width: 20px; height: 20px; display: block; }

/* 道具 */
.tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px auto 0; max-width: 640px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; font-size: 16px; flex: 1 1 0; justify-content: center; white-space: nowrap; }
.tool svg { width: 20px; height: 20px; flex: none; }
#bar { margin-top: 10px; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }

/* 上のバー */
.status { justify-content: space-between; flex-wrap: wrap; row-gap: 0; }
.st-text { min-width: 0; }
.st-right { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }
.found { font-variant-numeric: tabular-nums; white-space: nowrap; }
.found b { color: var(--ok); font-size: 19px; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink-sub); display: inline-block; }
.dots i.ok { background: var(--ok); border-color: var(--ok); }
.lives { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ng); }
.timer { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 18px; min-width: 46px; text-align: right; }
.timer.low { color: var(--ng); }
.tag { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1.5px solid currentColor; margin-left: 6px; vertical-align: middle; color: var(--accent); }
.tag.best { color: var(--ok); }

/* 設定: 問題の番号 */
.qpick { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qpick select { font: inherit; font-size: 16px; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); }

/* 結果（絵を隠さないよう、絵の下に） */
.result-box { position: static; inset: auto; text-align: left; margin: 12px auto 0; padding: 14px 18px; max-width: 640px; border-width: 2px; }
.result-box h2 { font-size: 1.35rem; margin: 0 0 4px; }
.result-box h2.ok { color: var(--ok); }
.result-box .big { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
.result-box ol.dlist { display: block; list-style: decimal; margin: 0 0 8px; padding-left: 1.6em; }
.result-box .dlist li { display: list-item; margin: 2px 0; padding: 0; }
.dlist .mark { display: inline-block; min-width: 4.5em; font-size: 14px; font-weight: 700; margin-right: 6px; }
.dlist li.ok .mark { color: var(--ok); }
.dlist li.ng .mark { color: var(--ng); }
.result-box .note { margin: 0 0 10px; color: var(--ink); font-size: 16px; }
.result-box .hint { color: var(--ink-sub); font-size: 14px; }
.callout { z-index: 3; font-size: clamp(17px, 4vw, 22px); padding: 4px 20px; border-width: 2.5px; }

@media (max-width: 480px) {
  .stage { padding: 8px; }
  .tools { gap: 6px; }
  .tool { padding: 0 6px; font-size: 15px; gap: 4px; min-width: 0; }
  .tools svg { display: none; }
  .controls .btn.icon { padding: 0 9px; }
  .st-right { gap: 8px; }
  .dots { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pics.appear .pic, .mk-ok, .mk-miss { animation: none; }
}
.howto img.narrow { max-width: 560px; }

/* 英語のページ: スマホ幅では道具のボタンの文字（Show answers など）が長いので、左右の余白を詰める */
@media (max-width: 480px) { :root:lang(en) .tool { padding: 0 8px; } }
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; --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.25; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2.25; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
