/* デバッガー用の報告口（2026-08-26 新設）。
   遊ぶ人が見る画面には出さない。デバッガーが画面から直接、
   「バグ／改善点／わからない」を送るためだけの物。

   置き場所は作品の見た目を邪魔しない所へ寄せる。対局中の実画面を実測して決めた:
     ・PC（横長）  … 右下が空いている（左下は城の絵）
     ・スマホ（縦）… 左下が空いている（右下は先手の時計）
   どちらも、ふだんは薄く小さくしておき、触れた時だけはっきりさせる。

   色は作品の正本（--sumi / --kinari / --kin）をそのまま使う。
   この帯だけ別の配色にすると、写した画面と並べた時に別のアプリに見える。 */

/* 字の指定に `font: 700 21px/1.3 inherit` の形を使わない。
   まとめ書きの font に family として `inherit` は書けず、**宣言ごと丸ごと無効**になる。
   この板は全部この書き方だったので、書いた大きさが一度も効いていなかった
   （2026-08-26 野田さん指摘「入力文字が小さい」の真因。実測 19px 指定→13.3px のまま）。
   大きさ・太さ・行間と family は分けて書く。 */
#fb-root {
  --fb-ink:    #251b15;
  --fb-paper:  #f4ead3;
  --fb-gold:   #c9a227;
  --fb-akane:  #9e2b1e;
  position: fixed;
  inset: 0;
  z-index: 90000;
  pointer-events: none;              /* 出ている物だけが押せる */
  font-family: var(--game-font, "Hiragino Mincho ProN", serif);
}
#fb-root > * { pointer-events: auto; }

/* ── 報告を書く板 ───────────────────────────────── */
/* 置き場所は JS が #stage（ゲーム画面）の実寸を測って直に書く。
   縦型では画面がまん中の細い柱にしか無く、窓いっぱいに置くとゲームの外へはみ出す
   （2026-08-26 野田さん指摘）。inset:0 は測れなかった時の逃げ道として残す。 */
#fb-sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 9, 7, .72);
  padding: 14px;
  overflow: auto;
}
#fb-card {
  width: min(560px, 100%);
  /* 高さは窓ではなく板の器（#fb-sheet＝ゲーム画面の実寸）に対して取る。
     100vh で取ると、縦型でゲーム画面より上下にはみ出す（2026-09-03 実測。ゆくえの板で 14px／51px 出た）。 */
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 18px 18px 16px;
  border: 2px solid var(--fb-gold);
  border-radius: 12px;
  background: var(--fb-paper);
  color: var(--fb-ink);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
#fb-card h2 {
  margin: 0 0 4px;
  font-weight: 700; font-size: 21px; line-height: 1.3; font-family: inherit;
  letter-spacing: .12em;
}
#fb-card .fb-lead { margin: 0 0 14px; font-weight: 400; font-size: 14px; line-height: 1.5; font-family: inherit; opacity: .75; }

#fb-card fieldset { margin: 0 0 14px; padding: 0; border: 0; }
#fb-card legend { padding: 0; margin: 0 0 8px; font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; letter-spacing: .08em; }
#fb-card legend .fb-req { margin-left: 8px; padding: 2px 7px; border-radius: 4px;
  background: var(--fb-akane); color: var(--fb-paper); font-weight: 700; font-size: 11px; line-height: 1; font-family: inherit; letter-spacing: .06em;
  vertical-align: 2px; }

/* 「かく」（赤の必須）と取り違えないよう、任意の欄の札は色を持たせず輪郭だけにする。 */
#fb-card legend .fb-any { margin-left: 8px; padding: 2px 7px; border-radius: 4px;
  border: 1px solid rgba(37, 27, 21, .45); color: var(--fb-ink);
  font-weight: 600; font-size: 11px; line-height: 1; font-family: inherit; letter-spacing: .06em;
  vertical-align: 2px; opacity: .7; }

/* 報告者の名前（任意）。書く所の字は #fb-text と同じ大きさにそろえる
   （小さくすると、同じ板の中で「ここは書かなくてよい所」に見えない）。 */
/* 名前の欄の注意書き（2026-09-16）。見出しと欄の間に置き、案内文と同じ調子で目立たせすぎない */
#fb-card .fb-name-note { margin: 0 0 8px; font-weight: 400; font-size: 13px; line-height: 1.5; font-family: inherit; opacity: .8; }

#fb-who {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid var(--fb-ink);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--fb-ink);
  font-weight: 400; font-size: 19px; line-height: 1.4; font-family: inherit;
}
#fb-who::placeholder { font-size: 14px; opacity: .5; }
#fb-who:focus-visible { outline: 3px solid var(--fb-gold); outline-offset: 1px; }

/* 種類の3択。押されている物だけ面ごと反転させる（どれを選んだか一目で分かる） */
.fb-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fb-kinds button {
  min-height: 56px;
  padding: 8px 4px;
  border: 2px solid var(--fb-ink);
  border-radius: 8px;
  background: transparent;
  color: var(--fb-ink);
  font-weight: 700; font-size: 16px; line-height: 1.25; font-family: inherit;
  cursor: pointer;
}
.fb-kinds button small { display: block; margin-top: 3px;
  font-weight: 400; font-size: 11px; line-height: 1.25; font-family: inherit; letter-spacing: -.02em; opacity: .72; white-space: nowrap; }
.fb-kinds button[aria-pressed="true"] {
  background: var(--fb-ink);
  color: var(--fb-paper);
  box-shadow: inset 0 0 0 3px var(--fb-gold);
}
.fb-kinds button[aria-pressed="true"] small { opacity: .85; }

#fb-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 124px;
  padding: 12px;
  border: 2px solid var(--fb-ink);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--fb-ink);
  /* 書く所の字は大きく（2026-08-26 野田さん指摘「入力文字が小さい」）。
     16px はスマホが勝手に拡大しない下限であって、読みやすい大きさではない。
     板の見出し(21px)と本文の間に置く。あて名の書き方は placeholder も一緒に効く。 */
  font-weight: 400; font-size: 19px; line-height: 1.7; font-family: inherit;
  resize: vertical;
}
#fb-text::placeholder { font-size: 17px; opacity: .5; }
#fb-text:focus-visible { outline: 3px solid var(--fb-gold); outline-offset: 1px; }

/* 写した画面 */
#fb-shot-box { display: grid; gap: 8px; }
#fb-shot-view {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 2px solid var(--fb-ink);
  border-radius: 8px;
  background: #0b0906;
}
#fb-shot-note { font-weight: 400; font-size: 13px; line-height: 1.5; font-family: inherit; opacity: .75; margin: 0; }
#fb-shot-drop {
  min-height: 40px; padding: 0 12px; justify-self: start;
  border: 2px dashed var(--fb-ink); border-radius: 8px;
  background: transparent; color: var(--fb-ink); font-weight: 600; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer;
}

/* 自動で付く情報 */
#fb-meta { margin: 0 0 14px; border: 1px solid rgba(37, 27, 21, .3); border-radius: 8px; }
#fb-meta summary { padding: 9px 12px; font-weight: 600; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer; }
#fb-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px;
  margin: 0; padding: 0 12px 12px; font-weight: 400; font-size: 13px; line-height: 1.5; font-family: inherit; }
#fb-meta dt { opacity: .65; white-space: nowrap; }
#fb-meta dd { margin: 0; word-break: break-all; }

.fb-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.fb-actions button { min-height: 48px; padding: 0 22px; border-radius: 8px;
  font-weight: 700; font-size: 16px; line-height: 1; font-family: inherit; letter-spacing: .1em; cursor: pointer; }
#fb-send  { border: 2px solid var(--fb-ink); background: var(--fb-ink); color: var(--fb-paper); }
#fb-send[disabled] { opacity: .38; cursor: not-allowed; }
#fb-quit  { border: 2px solid var(--fb-ink); background: transparent; color: var(--fb-ink); }
.fb-say { flex: 1 1 100%; margin: 0; font-weight: 600; font-size: 14px; line-height: 1.5; font-family: inherit; }
.fb-say.fb-ng { color: var(--fb-akane); }

/* 写している間・送っている間 */
#fb-busy {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(12, 9, 7, .55);
  color: var(--fb-paper);
  font-weight: 700; font-size: 17px; line-height: 1; font-family: inherit; letter-spacing: .16em;
}

/* ── 送った報告のゆくえ・報告の多い人（2026-09-03）──────────────
   報告を書く板と同じ紙・同じ字。別の見た目にすると別のアプリに見える。 */
/* 「ゆくえ」「報告を書く」は文字の下線ではなく、「やめる」と同じ形の押す物として並べる
   （2026-09-03 野田さん指摘「『やめる』の横にUIとして作成しろ」）。
   作品側の button の指定（灰色の面）に負けないよう、#fb-quit と同じく id で書く。 */
#fb-trace-open.fb-link { border: 2px solid var(--fb-ink); background: transparent; color: var(--fb-ink); }
#fb-card.fb-trace h2.fb-h2-rank { margin-top: 18px; }
.fb-trace-top { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.fb-trace-top h2 { flex: 1 1 auto; margin: 0; }
.fb-trace-top .fb-actions { flex: 0 0 auto; }
.fb-trace-top .fb-actions button { min-height: 40px; padding: 0 14px; font-size: 15px; }
#fb-card.fb-trace ol { list-style: none; margin: 0 0 6px; padding: 0; }
#fb-trace-list li {
  padding: 10px 12px; margin: 0 0 8px;
  border: 1px solid rgba(37, 27, 21, .35); border-radius: 8px; background: #fffaf0;
}
.fb-trace-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-weight: 700; font-size: 15px; line-height: 1.3; font-family: inherit; }
.fb-trace-kind { padding: 1px 7px; border-radius: 4px; border: 1px solid rgba(37, 27, 21, .45);
  font-weight: 600; font-size: 14px; line-height: 1.3; }
.fb-trace-day { margin-left: auto; font-weight: 400; font-size: 14px; opacity: .7; }
.fb-trace-text { margin: 6px 0 8px; font-weight: 400; font-size: 15px; line-height: 1.5; font-family: inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-trace-state { padding: 6px 10px; border-radius: 6px; font-weight: 700; font-size: 15px; line-height: 1.3;
  font-family: inherit; letter-spacing: .04em; }
/* 段階ごとの色。文字は必ず読める濃さにする（背景と同系色にしない）。 */
.fb-stage-9 { background: rgba(37, 27, 21, .08); color: var(--fb-ink); opacity: .8; }
.fb-stage-0 { background: rgba(37, 27, 21, .08); color: var(--fb-ink); }
.fb-stage-1 { background: #e9e2cf; color: var(--fb-ink); }
.fb-stage-2 { background: #e2d6a8; color: var(--fb-ink); }
.fb-stage-3 { background: #d7b64a; color: var(--fb-ink); }
.fb-stage-4 { background: var(--fb-ink); color: var(--fb-paper); box-shadow: inset 0 0 0 2px var(--fb-gold); }
.fb-stage-5 { background: #cbbfae; color: var(--fb-ink); }
#fb-rank-list li { border-bottom: 1px solid rgba(37, 27, 21, .18); }
/* 1行がそのまま押す物。押すとその人の改善の中身が下に開く（2026-09-03 野田さん指示）。 */
.fb-rank-row { display: grid; grid-template-columns: 3.4em 1fr auto; gap: 10px; align-items: baseline; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--fb-ink); text-align: left;
  font-weight: 400; font-size: 16px; line-height: 1.4; font-family: inherit; cursor: pointer; }
.fb-rank-row:hover, .fb-rank-row[aria-expanded="true"] { background: rgba(37, 27, 21, .08); }
#fb-rank-list li:first-child .fb-rank-row { font-weight: 700; font-size: 18px; }
#fb-rank-list li.fb-me .fb-rank-row { background: rgba(201, 162, 39, .28); font-weight: 700; }
.fb-rank-detail { padding: 2px 10px 8px 3.4em; }
.fb-rank-detail .fb-item { border-top: 1px dashed rgba(37, 27, 21, .18); }
/* 上位5位と、圏外にいる自分の行の間の区切り（2026-09-05 野田さん指示）。 */
.fb-rank-gap { border-bottom: 0; padding: 2px 10px; text-align: center; letter-spacing: .3em; opacity: .5; }
.fb-rank-no { font-weight: 700; }
.fb-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-rank-n { font-variant-numeric: tabular-nums; }
/* verごとの年表。新しい2つの版は開いた状態、古い版は畳む。 */
#fb-log details { margin: 0 0 6px; border: 1px solid rgba(37, 27, 21, .3); border-radius: 8px; background: #fffaf0; }
#fb-log summary { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; cursor: pointer;
  font-weight: 700; font-size: 16px; line-height: 1.3; font-family: inherit; }
#fb-log summary strong { font-size: 17px; }
.fb-log-day { font-weight: 400; font-size: 14px; opacity: .75; }
.fb-log-n { margin-left: auto; font-weight: 400; font-size: 14px; opacity: .75; }
.fb-log-more { margin: 0 0 10px 28px; min-height: 36px; padding: 0 12px; border: 1px dashed var(--fb-ink); border-radius: 6px;
  background: transparent; color: var(--fb-ink); font-weight: 600; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer; }
#fb-log ul { list-style: none; margin: 0; padding: 0 12px 10px; font-weight: 400; font-size: 15px; line-height: 1.55; font-family: inherit; }
#fb-log li { margin: 0 0 8px; padding: 0 0 8px; border-bottom: 1px solid rgba(37, 27, 21, .14); }
#fb-log li:last-child { border-bottom: 0; }
/* 解決した1件の見せ方。札や色は付けない（2026-09-03 野田さん指摘「ごちゃごちゃしすぎている」）。 */
.fb-item { padding: 10px 0 12px; }
.fb-item-q { font-weight: 700; font-size: 16px; line-height: 1.6; }
.fb-item-ver { display: block; margin-bottom: 2px; font-weight: 400; font-size: 13px; opacity: .7; }
.fb-item-a { margin-top: 6px; padding-left: 0; font-weight: 400; font-size: 15px; line-height: 1.7; }
.fb-item-who { margin-top: 6px; font-size: 13px; opacity: .7; }
#fb-log li { margin: 0 0 6px; padding: 0 0 6px; }
#fb-card.fb-trace h2 small { margin-left: 10px; font-weight: 400; font-size: 13px; letter-spacing: 0; opacity: .7; }
/* 報告を書く板の一番上、真ん中の押す物（2026-09-03 野田さん指示）。
   横いっぱいに広げると見出しに見える。幅は字ぶんに留めて真ん中に置き、
   下に厚みの影を付けて「押せる」形にする。押すと沈む。 */
.fb-top { display: flex; justify-content: center; margin: 0 0 10px; }
.fb-top-note { margin: 0 0 16px; text-align: center; font-weight: 400; font-size: 14px; line-height: 1.7; font-family: inherit; opacity: .85; }
.fb-top-button { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px 0 30px;
  border: 2px solid var(--fb-gold); border-radius: 999px; background: var(--fb-ink); color: var(--fb-paper);
  font-weight: 700; font-size: 18px; line-height: 1; font-family: inherit; letter-spacing: .14em; cursor: pointer;
  box-shadow: 0 4px 0 #0b0806, 0 8px 14px rgba(0, 0, 0, .35); transform: translateY(0); transition: transform .08s, box-shadow .08s; }
.fb-top-button:hover { box-shadow: 0 4px 0 #0b0806, 0 10px 18px rgba(201, 162, 39, .35); }
.fb-top-button:active { transform: translateY(4px); box-shadow: 0 0 0 #0b0806, 0 2px 6px rgba(0, 0, 0, .3); }
.fb-top-button:focus-visible { outline: 3px solid var(--fb-gold); outline-offset: 3px; }
.fb-top-arrow { font-size: 26px; line-height: 1; margin-top: -3px; color: var(--fb-gold); }
/* デバッグ一覧の見出しの下の一言（指定の文そのまま） */
.fb-note { margin: -4px 0 14px; font-weight: 400; font-size: 14px; line-height: 1.6; font-family: inherit; opacity: .8; }
