/* =============================================================
   武将の顔（44_顔・萌え武将 1024² のバストアップ・透過）を画面に合わせる（v0.3.5）
   ・顔が無い間（索引なし）は img.顔・会話肖像 が出ないので、何も変わらない
   ============================================================= */
/* 小さい顔（一覧・城主）: 絵の全身だと顔が点になるので、上の中央（顔のある所）を切り出す。効かないブラウザは全体を縮めて出す */
img.顔 { object-view-box: inset(2% 22% 42% 22%); }
/* 会話の立ち絵: 上の立ち絵の枠が本文（左の余白 27cqw＋25px）に掛からないよう、幅を 25cqw までにする */
#会話 .会話肖像.垂直_上 { max-width: 25cqw; }
/* 下の立ち絵も同じ大きさに（下だけ 28cqw まで広がって、上の人より大きく出ていた。2026-10-12 本人「すとろー、サイズ間違ってます」） */
#会話 .会話肖像.垂直_下 { max-width: 25cqw; }

/* 顔選び（システム変更の武将の登録・右側）: 上に大きな見本、区分のタブ、絵の並び（DG1 のキャラ作成にならう） */
.顔選び { display: flex; flex-direction: column; gap: 8px; }
.顔選び.空 { color: var(--淡); padding: 20px; text-align: center; }
.顔見本 { display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto 1fr; gap: 4px 10px; align-items: start; }
.顔見本 img { grid-row: 1 / 3; width: 150px; height: 150px; object-fit: cover; object-position: top; border: 2px solid #b88cf0; border-radius: 8px; background: #0c0f14; }
.顔見本 img[hidden] { display: block; visibility: hidden; }
.顔見本名 { color: var(--淡); font-size: .85em; }
.顔見本ボタン { display: flex; gap: 6px; align-self: end; }
.顔見本ボタン .行ボタン { width: auto; padding: 6px 14px; }
.顔区分 { display: flex; flex-wrap: wrap; gap: 4px; }
.顔区分 button { padding: 4px 10px; font-size: .85em; border-radius: 4px; background: #1e242d; color: var(--字); border: 1px solid var(--線); }
.顔区分 button.今 { border-color: var(--金); background: #3a3420; }
.顔区分 small { color: var(--淡); }
/* 2026-10-12 本人: 武将の編集で絵の行が潰れて重なる（窓の高さが足りない時、aspect-ratio だけでは行の高さが 0 まで縮む）→ 升の幅と高さを決め打ちにし、並びは縮ませない */
.顔並び { display: grid; grid-template-columns: repeat(auto-fill, 68px); grid-auto-rows: 68px; justify-content: space-between; align-content: start; gap: 5px;
    flex: 0 0 auto; height: min(420px, 50vh); max-height: min(420px, 50vh); overflow-y: auto; padding: 4px; background: #0c0f14; border-radius: 6px; }
.顔札 { padding: 0; width: 68px; height: 68px; min-height: 68px; border: 2px solid #333b47; border-radius: 6px; overflow: hidden; background: #1e242d; }
.顔札 img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.顔札.選択 { border-color: #b88cf0; box-shadow: 0 0 0 2px #b88cf066; }
.顔札.使用 { opacity: .55; }

/* 城の絵（城の情報の上。img/城絵/）: 横長の絵を帯にして、下を窓の色へ溶かす */
#情報窓 .城絵 { height: 92px; margin: -10px -12px 6px; background-size: cover; background-position: center 40%; border-radius: 8px 8px 0 0;
    -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }

/* 城の絵の帯に城主の立ち絵（透過）を重ねる（2026-10-08）。帯は窓の上端いっぱい、立ち絵は右下に立つ */
#情報窓 .城絵枠 { position: relative; height: 120px; margin: -10px -12px 4px; overflow: hidden; border-radius: 8px 8px 0 0; }
#情報窓 .城絵枠.絵なし { height: 110px; }
#情報窓 .城絵枠 .城絵 { position: absolute; inset: 0; height: auto; margin: 0; }
#情報窓 .城主絵 { position: absolute; right: 4px; bottom: -6px; height: 140px; width: auto; object-fit: contain; filter: drop-shadow(0 2px 6px #000a); pointer-events: none; }
/* 会話: 立ち絵をフキダシより前に（2026-10-08 本人指摘: キャラが吹き出しの下にいた） */
#会話 .Go吹出 { z-index: 1; }
#会話 .会話肖像 { z-index: 2; }
/* 武将の札（武将の窓の行を押すと出る小さな詳細の窓）。2026-10-08 本人の見本: 大きな立ち絵を左、右に適性など、列伝は下いっぱい */
#武将札 { position: fixed; z-index: 45; width: 370px; padding: 10px 12px 10px; background: var(--面); border: 1px solid var(--線); border-radius: 8px; box-shadow: 0 6px 20px #0008; overflow: hidden; }
#武将札[hidden] { display: none; }
/* 会話の間は札を会話の下に隠す（2026-10-13 本人「会話が上、武将データは下」。フキダシが半透明で札が透けて上に見えていた）。会話が終わると札はそのまま戻る */
#会話:not([hidden]) ~ #武将札 { visibility: hidden; }
#武将札 > .丸 { position: absolute; right: 8px; top: 8px; z-index: 3; }
#武将札 .札頭 { display: flex; align-items: baseline; gap: 14px; padding-right: 32px; position: relative; z-index: 2; }
#武将札 .札名 { font-size: 1.15em; font-weight: 700; }
#武将札 .札頭 small { color: var(--淡); }
#武将札 .札能 { display: flex; gap: 4px 6px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: 1.05em; position: relative; z-index: 2; margin-bottom: 2px; }
#武将札 .札能 b { color: var(--淡); font-weight: 400; font-size: .85em; margin-left: 6px; }
#武将札 .札能 b:first-child { margin-left: 0; }
#武将札 .札体 { display: grid; grid-template-columns: 1fr 104px; gap: 8px; align-items: start; }
#武将札 .札絵 { width: calc(100% + 20px); height: 270px; margin: -4px -8px -30px -12px; object-fit: cover; object-position: center 6%; }
#武将札 .札絵.無 { height: 80px; transform: none; }
#武将札 .札右 { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 2px; font-size: .88em; }
#武将札 .札小見出し { color: var(--淡); font-size: .9em; margin-top: 4px; }
#武将札 .札適 { display: flex; gap: 6px; font-weight: 700; }
#武将札 .札適 b { color: var(--字); }
#武将札 .札右 .表 { grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 1em; }
#武将札 .札ボタン { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
#武将札 .札ボタン .行ボタン { justify-content: center; padding: 7px 4px; white-space: nowrap; }
#武将札 .札伝 { position: relative; z-index: 2; margin: 0 -12px -10px; padding: 8px 12px 10px; font-size: .88em; line-height: 1.6; background: #0c0f14e6; border-top: 1px solid var(--線); }
#武将札 .札伝 b { display: block; color: var(--金); font-size: .9em; margin-bottom: 2px; }

#武将札 .札頭, #武将札 .札能, #武将札 .札右 { text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 2px #000; }
#武将札 .札右 { background: linear-gradient(90deg, transparent, #14181fcc 18%); margin-right: -12px; padding: 0 12px 4px 10px; border-radius: 6px 0 0 6px; }#武将札 .札肩書 { color: var(--金); font-size: .8em; }
#武将札 { cursor: grab; touch-action: none; }
#武将札.掴み中 { cursor: grabbing; box-shadow: 0 10px 28px #000a; }
#武将札 button { cursor: pointer; }
