/* =====================================================================
   戦いの画面（第5弾：ターン制・シンプル）＋ 第2弾の演出（会話シーン・帯の文字）
   ・上に景色と敵（大きく）、下に味方（HP・MPの札）。その下に、ターンの帯・文の窓（2行）・コマンド（3×2）・小さなボタン
   ・画面の高さにぴったり（スマホは縦に、PCの幅では下の欄を左右に分ける。幅はコンテナクエリ bt で見る）
   ・押せるところは 44px 以上。「視差効果を減らす」設定では動きを止める（app.css の全体の決まり＋この下）
   色は app.css の言葉（--brass・--hp・--mp・--ember・--rose・--violet・--luck）に合わせる
   ===================================================================== */
.bt [hidden] { display: none !important; }
body.battle-on .credit { display: none; }

/* ---------------------------------------------------------------------
   全体：画面の高さいっぱい（上のバーとすき間をひいた分）
   --------------------------------------------------------------------- */
.quest.bt {
  container: bt / inline-size;
  position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0;
  min-height: calc(100vh - var(--tb-h) - 34px);
  min-height: calc(100svh - var(--tb-h) - 34px); /* 2px は、ふちの丸めで画面が少しだけ動かないように */
}
@media (min-width: 900px) {
  .quest.bt { min-height: calc(100vh - var(--tb-h) - 40px); min-height: calc(100svh - var(--tb-h) - 40px); }
}

/* ---------------------------------------------------------------------
   戦いの場：景色（ドット絵を整数倍で）・上の札・敵・味方
   --------------------------------------------------------------------- */
.b-stage {
  position: relative; isolation: isolate; overflow: hidden;
  flex: 1 1 auto; min-height: 280px; display: flex; flex-direction: column;
  border-radius: 16px; border: 1.5px solid var(--line-2);
  background: radial-gradient(120% 70% at 50% 100%, #24433a, #13241f 70%);
}
.b-stage .q-scenery {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-repeat: repeat-x; background-position: center bottom; background-size: cover;
  image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; image-rendering: pixelated;
}
.b-stage.has-scenery .q-scenery::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9, 16, 13, .3) 0%, rgba(9, 16, 13, .08) 32%, rgba(9, 16, 13, .14) 56%, rgba(9, 16, 13, .66) 100%);
}
.quest[data-world="ura"] .b-stage.has-scenery .q-scenery::after { background: linear-gradient(180deg, rgba(14, 6, 22, .38) 0%, rgba(14, 6, 22, .14) 32%, rgba(14, 6, 22, .2) 56%, rgba(14, 6, 22, .7) 100%); }
.quest[data-world="core"] .b-stage.has-scenery .q-scenery::after { background: linear-gradient(180deg, rgba(14, 3, 6, .42) 0%, rgba(14, 3, 6, .16) 32%, rgba(14, 3, 6, .24) 56%, rgba(14, 3, 6, .74) 100%); }

/* 上の小さな札：場所の名前・強敵・ボス・宝箱 */
.b-hud { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 8px 10px 0; pointer-events: none; }
.b-pill {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 30px; padding: 2px 12px; border-radius: 999px;
  background: rgba(6, 13, 10, .8); border: 1px solid rgba(226, 238, 228, .24); color: #f3f6f0;
  font-size: var(--fs-min); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-place b { margin-left: 3px; font-family: var(--font-dot); font-weight: 400; color: var(--brass-hi); }
.b-kind { font-family: var(--font-dot); font-size: var(--fs-min); letter-spacing: .08em; }
.b-kind.t-elite { color: #fff; background: linear-gradient(180deg, #d9434f, #9c1f2c); border-color: #ff9aa2; }
.b-kind.t-boss { color: #2a1404; background: linear-gradient(180deg, #ffc56b, #e0913a); border-color: #ffdca0; }
.b-kind.t-treasure { color: var(--brass-ink); background: linear-gradient(180deg, #ffe08a, var(--brass)); border-color: #fff0b8; }
/* 第6弾：特別な戦いの見出し（q.field.label）。ぬし・ライバル・ダンジョンの階・めずらしい魔物（きらきら） */
.b-label { position: relative; gap: 6px; padding: 2px 13px 2px 6px; font-family: var(--font-dot); font-size: calc(15px * var(--fs-k)); letter-spacing: .04em; overflow: visible; }
.b-label b { min-width: 0; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.b-lmark { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; font-style: normal; font-family: var(--font-body); font-size: var(--fs-min); font-weight: 700; line-height: 1; }
.b-label.t-nushi { color: #f4ffe0; background: linear-gradient(180deg, #3f7a3a, #20461f); border-color: #b9e58c; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 12px rgba(185, 229, 140, .35); }
.b-label.t-nushi .b-lmark { background: #f1cc6c; color: #2a1e04; }
.b-label.t-rival { color: #fff; background: linear-gradient(100deg, #b8233b 0 48%, #2c4fb3 52% 100%); border-color: #ffd2da; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 0 12px rgba(255, 120, 140, .35); }
.b-label.t-rival .b-lmark { background: #fff; color: #9b1730; font-size: var(--fs-min); letter-spacing: -.04em; }
.b-label.t-dungeon { color: #eef0ff; background: linear-gradient(180deg, #4a4e63, #23252f); border-color: #a9b0d6; }
.b-label.t-dungeon .b-lmark { background: #a9b0d6; color: #1c1f2a; }
.b-label.t-dungeon.boss { color: #fff3c8; background: linear-gradient(180deg, #4a3f63, #241c33); border-color: #f1cc6c; box-shadow: 0 0 12px rgba(241, 204, 108, .3); }
.b-label.t-dungeon.boss .b-lmark { background: #f1cc6c; color: #2a1e04; }
.b-label.t-tag { color: #f3f6f0; }
.b-label.t-tag .b-lmark { background: rgba(226, 238, 228, .2); }
/* 第7弾：審問騎士の見回り（はがね色に、見つかった「！」の黄色）・審問官ローデン（紅と銀） */
.b-label.t-patrol { color: #eef4ff; background: linear-gradient(180deg, #3e4e66, #1e2838); border-color: #b8c8e0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 0 12px rgba(160, 190, 230, .3); }
.b-label.t-patrol .b-lmark { background: #ffcf4a; color: #2a1e04; font-size: calc(15px * var(--fs-k)); }
.b-label.t-rodin { color: #fff; background: linear-gradient(100deg, #6e1e2a 0%, #4a2a3a 46%, #34465e 100%); border-color: #dfe6f0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 0 14px rgba(220, 120, 130, .35); }
.b-label.t-rodin .b-lmark { background: #dfe6f0; color: #6e1e2a; }
.b-label.rare { color: #3a2604; background: linear-gradient(110deg, #ffe9a0 0%, #fff8d8 22%, #f5c64f 45%, #fff3c2 62%, #e9b23c 100%); background-size: 220% 100%; border-color: #fff6cf; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 0 16px rgba(255, 220, 110, .65); animation: rareSheen 2.6s linear infinite; }
.b-label.rare .b-lmark { background: #fff; color: #c98a10; }
.b-spark { position: absolute; inset: -6px; pointer-events: none; }
.b-spark i { position: absolute; width: 7px; height: 7px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: rareTwinkle 1.6s ease-in-out infinite; }
.b-spark i:nth-child(1) { left: 2px; top: 0; }
.b-spark i:nth-child(2) { right: 8px; top: -2px; animation-delay: -.55s; width: 9px; height: 9px; }
.b-spark i:nth-child(3) { right: 0; bottom: 0; animation-delay: -1.1s; }
@keyframes rareSheen { to { background-position: -220% 0; } }
@keyframes rareTwinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }
/* 特別な戦いの場のふち：めずらしい魔物は金色のきらめき、ライバルは赤と青、ぬしは若草 */
.quest[data-special~="rare"] .b-stage { border-color: #f1cc6c; box-shadow: 0 0 0 1px rgba(255, 233, 160, .35), 0 0 22px rgba(255, 210, 90, .3); }
.quest[data-special~="rare"] .b-stage::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 78% 14%, #fff6c8 50%, transparent 51%),
    radial-gradient(3px 3px at 64% 38%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 30% 48%, #ffe9a0 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 44%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 46% 12%, #fff6c8 50%, transparent 51%);
  animation: rareField 2.2s steps(2, jump-none) infinite;
}
@keyframes rareField { 50% { opacity: .25; } }
.quest[data-special~="rival"] .b-stage { border-width: 2px; border-color: #ff7d8e #6f8dff #6f8dff #ff7d8e; box-shadow: 0 0 18px rgba(255, 110, 130, .18); }
.quest[data-special~="nushi"] .b-stage { border-color: #9fd27a; box-shadow: 0 0 18px rgba(159, 210, 122, .22); }
/* 第7弾：審問騎士の見回り（はがね色）・審問官ローデン（紅と銀） */
.quest[data-special~="patrol"] .b-stage { border-color: #b8c8e0; box-shadow: 0 0 16px rgba(160, 190, 230, .2); }
.quest[data-special~="rodin"] .b-stage { border-width: 2px; border-color: #d0606a #9fb4cc #9fb4cc #d0606a; box-shadow: 0 0 18px rgba(208, 96, 106, .2); }
/* ダンジョンの中では、見出しの札にダンジョンの名前があるので、地方の名前の札は出さない（せまい画面で2行にならないように） */
.quest[data-special~="dungeon"] .b-hud .b-place { display: none; }

/* ---------------------------------------------------------------------
   敵：景色の地面に立つ大きな絵と、名前・HPの札
   --------------------------------------------------------------------- */
.b-foes {
  position: relative; flex: 1 1 0; min-height: 0;
  display: flex; flex-wrap: wrap; align-items: flex-end; align-content: flex-end; justify-content: center;
  gap: 4px 10px; padding: 22px 8px 12px;
}
.b-foe {
  position: relative; display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 0;
  border: 0; border-radius: 10px; background: none; color: var(--text);
  transition: transform .15s, opacity .6s, filter .5s;
}
.b-foe .u-em { position: relative; display: grid; place-items: end center; min-height: 32px; line-height: 0; }
.b-foe .u-em::after { /* 足もとの影（ポケモンの台のように） */
  content: ''; position: absolute; z-index: -1; left: 6%; right: 6%; bottom: -6px; height: 14px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}
.b-foe .u-em .em-fb { font-size: calc(var(--box, 64px) * .62); line-height: 1; }
.b-plate {
  display: grid; gap: 2px; width: var(--plate, 96px); padding: 3px 8px 5px; border-radius: 9px;
  background: rgba(6, 13, 10, .86); border: 1.5px solid rgba(255, 134, 179, .34); box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  transition: border-color .15s, box-shadow .15s, opacity .4s, width .32s ease;
}
/* たおれた敵の札：うすくなったあと、幅をちぢめて消す（のこった敵の札は、あいたところへゆっくり広がる。JS で幅を 0 に） */
.b-foe.collapse { min-width: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: width .32s ease, margin-left .32s ease; }
.b-fn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1px 4px; min-width: 0; } /* 入らなければ、ボス・お供の印は名前の下に */
/* 名前は入らなければ2行に（「〇〇A」の A・B… が「…」で切れないように。広い札でも、文字が大きいと入らないことがある） */
.b-fname { min-width: 0; font-size: var(--fs-min); font-weight: 700; line-height: 1.35; color: #ff9cc1; text-align: center; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.b-fbadge { display: inline-flex; flex: none; }
.b-foe.narrow .b-plate { padding: 3px 5px 5px; }
.b-foe.narrow .b-fn { flex-wrap: wrap; gap: 1px 3px; }
.b-foe.narrow .b-fname { white-space: normal; font-size: var(--fs-min); line-height: 1.2; text-align: center; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.b-fbadge:empty { display: none; }
.b-fbadge i { font-style: normal; font-size: var(--fs-min); font-weight: 700; line-height: 1.1; padding: 1px 5px; border-radius: 6px; }
.b-fbadge i.boss { background: var(--brass); color: var(--brass-ink); }
.b-fbadge i.escort { color: var(--brass-hi); background: rgba(227, 179, 65, .14); }
/* せまい札のお供は「お供」の印を出さない（名前とHPを先に。ボスには「ボス」の印と金色の札、上の「ボス」の札がある） */
.b-foe.boss:not(.lead).narrow .b-fbadge { display: none; }
/* ぬし（第6弾）：若草色の札と「ぬし」の印。名前は短い名前（長い名前は上の見出しの札） */
.b-fbadge i.nushi { background: #4f8a3e; color: #f4ffe0; }
/* ボス・ぬしの名前と印が1行に入らないとき（文字が大きい・せまい画面）：印は ♛ だけ */
.b-foe.tight .b-fbadge i.boss, .b-foe.tight .b-fbadge i.nushi { font-size: 0; padding: 1px 5px; }
.b-foe.tight .b-fbadge i.boss::before, .b-foe.tight .b-fbadge i.nushi::before { content: '♛'; font-size: var(--fs-min); }
.b-fbadge i.elite { background: #c93a46; color: #fff; }
/* HP：バーと、のこりの数字（色だけにたよらない） */
.b-hprow { display: flex; align-items: center; gap: 5px; min-width: 0; }
.b-foe .b-hprow .bar { flex: 1; min-width: 16px; height: 6px; }
.b-foe .hpn { flex: none; font-size: var(--fs-min); font-weight: 700; line-height: 1.1; color: #e9f6ef; font-variant-numeric: tabular-nums; }
.hpn[data-lv="mid"] { color: #ffe08a; }
.hpn[data-lv="lo"] { color: #ffb0a4; }
.b-hint { font-size: var(--fs-min); font-weight: 700; color: var(--brass-hi); }

/* 第6弾：動く絵（コマを重ねて、on の1枚だけ見せる）・主人公の顔（data-ex の表情だけ見せる） */
.fa, .fc { display: grid; place-items: end center; line-height: 0; }
.fa > img, .fc > img { grid-area: 1 / 1; visibility: hidden; }
.fa > img.on { visibility: visible; }
.fc[data-ex="normal"] > .ex-normal, .fc[data-ex="smile"] > .ex-smile, .fc[data-ex="surprised"] > .ex-surprised,
.fc[data-ex="worried"] > .ex-worried, .fc[data-ex="down"] > .ex-down, .fc[data-ex="blink"] > .ex-blink { visibility: visible; }
/* 敵が動く（とびかかる）。ボスは少し大きく長く */
.b-foe.lunge .u-em { animation: foeLunge calc(.26s * var(--pace-k, 1)) cubic-bezier(.3, .7, .4, 1); }
.b-foe.lead.lunge .u-em, .b-foe.wboss.lunge .u-em, .b-foe.nushi.lunge .u-em { animation: foeLungeBig calc(.42s * var(--pace-k, 1)) cubic-bezier(.3, .7, .4, 1); }
@keyframes foeLunge { 40% { transform: translateY(8px) scale(1.08); filter: brightness(1.25); } }
@keyframes foeLungeBig { 30% { transform: translateY(-6px) scale(.97); } 60% { transform: translateY(12px) scale(1.1); filter: brightness(1.3) drop-shadow(0 0 10px rgba(255, 90, 90, .7)); } }
/* 力をためるボス：赤い光がゆらめく */
.b-foe.charge .u-em > .fa, .b-foe.charge .u-em > img.px { filter: drop-shadow(0 0 6px rgba(255, 77, 94, .85)) drop-shadow(0 0 14px rgba(255, 140, 60, .5)); animation: chargeAura .7s ease-in-out infinite alternate; }
@keyframes chargeAura { to { filter: drop-shadow(0 0 10px rgba(255, 77, 94, 1)) drop-shadow(0 0 22px rgba(255, 170, 60, .7)); } }
/* たおれた：ぽふっと消える（絵はちぢんで白く光り、けむりがはじける）。札はうすく残る */
.b-foe.ko .u-em > :not(.poof) { animation: koOut calc(.4s * var(--pace-k, 1)) ease-in forwards; }
.b-foe.lead.ko .u-em > :not(.poof), .b-foe.wboss.ko .u-em > :not(.poof), .b-foe.nushi.ko .u-em > :not(.poof) { animation-duration: calc(.68s * var(--pace-k, 1)); }
@keyframes koOut { 0% { filter: brightness(2.4) saturate(.3); transform: scale(1.06); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(.35) translateY(10%); filter: brightness(3) saturate(0); } }
.b-foe.dead .u-em > :not(.poof) { visibility: hidden; }
.b-foe.dead .u-em::after { opacity: .25; }
.b-foe.dead .b-plate { opacity: .5; }
.b-foe.dead .b-fname { text-decoration: line-through; text-decoration-color: rgba(255, 156, 193, .6); }
.poof { position: absolute; left: 50%; bottom: 18%; width: 0; height: 0; z-index: 3; pointer-events: none; }
.poof i {
  position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffffff 0 22%, #e4e8f2 45%, #a9b2c8 100%);
  box-shadow: 0 0 0 2px rgba(24, 28, 44, .5), 0 3px 0 rgba(24, 28, 44, .25);
  animation: poofOut calc(.5s * var(--pace-k, 1)) ease-out forwards;
}
.poof i:nth-child(1) { --dx: -30px; --dy: -14px; }
.poof i:nth-child(2) { --dx: 28px; --dy: -20px; animation-delay: .03s; }
.poof i:nth-child(3) { --dx: -4px; --dy: -34px; width: 30px; height: 30px; left: -15px; top: -15px; }
.poof i:nth-child(4) { --dx: 34px; --dy: 8px; animation-delay: .05s; }
.poof i:nth-child(5) { --dx: -34px; --dy: 10px; animation-delay: .02s; }
.poof i:nth-child(6) { --dx: 6px; --dy: 18px; width: 20px; height: 20px; left: -10px; top: -10px; }
.poof i:nth-child(7), .poof i:nth-child(8) {
  width: 12px; height: 12px; left: -6px; top: -6px; border-radius: 0; background: #ffe680; box-shadow: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.poof i:nth-child(7) { --dx: -22px; --dy: -42px; }
.poof i:nth-child(8) { --dx: 24px; --dy: -40px; animation-delay: .06s; }
.poof.big i { animation-duration: calc(.8s * var(--pace-k, 1)); }
.poof.big i:nth-child(n) { --s: 2.2; }
@keyframes poofOut {
  0% { transform: translate(0, 0) scale(.3); opacity: 1; }
  60% { opacity: .95; }
  100% { transform: translate(calc(var(--dx) * var(--s, 1)), calc(var(--dy) * var(--s, 1))) scale(calc(1.3 * var(--s, 1))); opacity: 0; }
}
/* ねらい（▼）・選んでいるねらい（点線）・ねらいを選ぶあいだ（緑） */
.b-cur {
  position: absolute; top: -20px; left: 50%; z-index: 2; transform: translateX(-50%);
  color: var(--brass-hi); font-size: calc(17px * var(--fs-k)); line-height: 1; text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, .6);
  opacity: 0; pointer-events: none;
}
.b-foe.target .b-cur, .b-foe.pickable:hover .b-cur, .b-foe.pickable:focus-visible .b-cur, .b-foe.pickable.hl .b-cur, .b-foe.chest:not([disabled]):hover .b-cur { opacity: 1; animation: bCur .8s steps(2, end) infinite; }
.b-foe.pickable.hl .b-plate { border-color: var(--brass-hi); box-shadow: 0 0 0 3px rgba(241, 204, 108, .45), 0 2px 0 rgba(0, 0, 0, .35); }
.b-ally.pickable.hl { border-color: var(--brass-hi); box-shadow: 0 0 0 3px rgba(241, 204, 108, .45); }
.b-foe.pickable .b-cur { color: #9ff0d6; }
@keyframes bCur { 50% { transform: translate(-50%, 4px); } }
.b-foe.target .b-plate { border-color: var(--brass-hi); box-shadow: 0 0 0 2px rgba(227, 179, 65, .4), 0 2px 0 rgba(0, 0, 0, .35); }
.b-foe.aimed .b-plate { border-style: dashed; border-color: rgba(92, 200, 168, .9); }
.b-foe.pickable { cursor: pointer; }
.b-foe.pickable .b-plate { border-color: var(--hp); box-shadow: 0 0 0 3px rgba(92, 200, 168, .35), 0 2px 0 rgba(0, 0, 0, .35); }
.b-foe:focus-visible { outline: none; }
.b-foe:focus-visible .b-plate { outline: 3px solid var(--brass); outline-offset: 2px; }
.b-foe.gone { opacity: 0; transform: translateY(6px) scale(.94); filter: grayscale(1) brightness(1.5); transition: opacity .5s .2s, transform .5s .2s, filter .3s; pointer-events: none; }
.b-foe.leaving { pointer-events: none; }
/* 文の速さ：演出の長さ（はやいでも気持ちよく見えるように、少しだけ短く） */
.quest.bt { --pace-k: 1; --pop-dur: .9s; }
.quest.bt[data-pace="fast"] { --pace-k: .8; --pop-dur: .65s; }
.quest.bt[data-pace="slow"] { --pace-k: 1.2; --pop-dur: 1.15s; }
/* ボス（本当のボスは名前も大きく）・強敵・ワールドボス */
.b-foe.lead .b-plate { border-color: rgba(227, 179, 65, .75); background: linear-gradient(180deg, rgba(60, 40, 6, .82), rgba(6, 13, 10, .8)); }
.b-foe.lead .b-fname { font-family: var(--font-dot); font-weight: 400; font-size: calc(14px * var(--fs-k)); color: #ffe3a6; }
.b-foe.nushi .b-plate { border-color: rgba(185, 229, 140, .85); background: linear-gradient(180deg, rgba(34, 66, 26, .86), rgba(6, 13, 10, .8)); }
.b-foe.nushi .b-fname { font-family: var(--font-dot); font-weight: 400; font-size: calc(14px * var(--fs-k)); color: #eaffcf; }
.b-foe.elite .b-plate { border-color: rgba(232, 67, 79, .8); background: linear-gradient(180deg, rgba(70, 8, 16, .85), rgba(6, 13, 10, .8)); }
.b-foe.wboss .b-plate { display: none; } /* 名前とHPは上の大きなバー */
.b-foe.wboss .b-cur { display: none; }
.quest.is-wb .b-foes { padding-bottom: 6px; }
/* ワールドボス：上の大きなバーに名前があるので、場所の札は出さない（敵の場所を広く） */
.quest.is-wb .b-hud { display: none; }
/* 大技の予告 */
.b-warn { display: none; }
.b-foe.charge .b-warn {
  position: absolute; top: -10px; left: 50%; z-index: 3; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px 1px 5px; border-radius: 7px; white-space: nowrap;
  background: linear-gradient(180deg, #ff5d6c, #c91f3a); color: #fff; font-size: var(--fs-min); line-height: 1.5;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 10px rgba(255, 77, 94, .7); cursor: help; animation: warnPulse .9s ease-in-out infinite;
}
.b-foe.charge .b-warn::after { content: ''; position: absolute; inset: -10px -4px; }
.b-foe.charge .b-warn b { font-family: var(--font-dot); font-weight: 400; }
.b-foe.charge .b-cur { display: none; }
.b-foe.charge .b-plate { border-color: #ff5d6c; animation: chargeGlow 1s ease-in-out infinite alternate; }
@keyframes warnPulse { 50% { transform: translateX(-50%) scale(1.1); filter: brightness(1.25); } }
@keyframes chargeGlow { from { box-shadow: 0 0 0 2px rgba(255, 77, 94, .25), 0 0 8px rgba(255, 77, 94, .25); } to { box-shadow: 0 0 0 4px rgba(255, 77, 94, .45), 0 0 20px rgba(255, 77, 94, .55); } }
/* くちやみに冒された敵 */
.b-foe.bl1 .u-em img.px { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)) drop-shadow(0 0 5px rgba(190, 110, 255, .75)); }
.b-foe.bl2 .u-em img.px { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)) drop-shadow(0 0 7px rgba(255, 59, 107, .9)); }
/* 宝箱 */
.b-foe.chest { cursor: pointer; }
.b-foe.chest .b-plate { border-color: rgba(227, 179, 65, .65); }
.b-foe.chest .b-fname { color: #ffe9a8; }
.b-foe.chest.opened { opacity: .5; filter: grayscale(.6); }
.b-foe.chest.opened .b-hint { visibility: hidden; }
.b-foe.chest.pickable .b-plate { border-color: var(--hp); }
.b-foe.chest[disabled] { cursor: default; }

/* 札の言葉（状態・弱点・耐性・くちやみ・テンション）。タップすると意味が出る */
.b-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-width: 0; }
.b-tags:empty { display: none; }
.b-tags span { position: relative; font-size: var(--fs-min); padding: 0 4px; border-radius: 5px; background: rgba(0, 0, 0, .45); line-height: 1.5; white-space: nowrap; }
.b-tags [data-act] { cursor: help; }
.b-tags [data-act]::after { content: ''; position: absolute; inset: -15px -8px; }
.b-tags .st { color: #ffb5c9; }
.b-tags .tm { color: #a9cbff; }
.b-tags .tn { color: var(--brass-hi); }
.b-tags .el { display: inline-flex; align-items: center; gap: 1px; padding: 0 4px 0 2px; }
.b-tags .el .px { width: 12px; height: 12px; }
.b-tags .el .em-fb { font-size: var(--fs-min); }
.b-tags .el small { font-size: var(--fs-min); font-weight: 700; }
.b-tags .el.weak { color: #ffe066; background: rgba(255, 224, 102, .13); box-shadow: inset 0 0 0 1px rgba(255, 224, 102, .4); }
.b-tags .el.resist { color: var(--muted); }
.b-tags .bl { color: #d7b8ff; background: rgba(120, 60, 180, .3); }
.b-tags .bl.l2 { color: #ffb3c2; background: rgba(160, 24, 72, .4); }
.b-tags .pk { color: var(--text); background: rgba(92, 200, 168, .16); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.b-tags .pk.combo { color: var(--brass-ink); background: var(--brass); font-weight: 700; }
.b-tags .pk .el-ic { margin-right: 2px; }
.b-tags .ow { padding: 0; background: none; color: var(--muted); }
.b-tags .ow b { color: var(--text); }

/* 数字のポップアップ・当たったときのゆれ（.pop は app.css）。短く、気持ちよく（ボスは少しだけ大きく長く） */
.b-unit.hit { animation: shake .26s; }
.quest.bt .pop { animation-duration: var(--pop-dur, .9s); }
.b-foe .pop { top: 10%; font-size: calc(28px * var(--fs-k)); }
.b-foe.lead .pop, .b-foe.wboss .pop { font-size: calc(34px * var(--fs-k)); animation-duration: calc(var(--pop-dur, .9s) + .2s); }
.b-ally .pop { top: 4px; font-size: calc(22px * var(--fs-k)); }
.pop.crit { color: #ffe066; text-shadow: 0 2px 0 #000, 0 0 10px rgba(255, 170, 40, .9); }
.b-foe .pop.crit { font-size: calc(36px * var(--fs-k)); }
.pop.weak { top: -10px; font-size: calc(15px * var(--fs-k)); color: #ffe066; letter-spacing: .04em; text-shadow: 0 2px 0 rgba(0, 0, 0, .8), 0 0 8px rgba(255, 200, 40, .8); z-index: 4; }

/* ---------------------------------------------------------------------
   味方：下に HP・MP の小さな札（選んだ ✓・オート・切断中）
   --------------------------------------------------------------------- */
.b-front { position: relative; flex: none; }
.b-allies {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px;
  background: linear-gradient(180deg, rgba(5, 12, 9, 0), rgba(5, 12, 9, .5) 40%);
}
.b-ally {
  position: relative; flex: 1 1 160px; max-width: 240px; min-width: 0; min-height: 66px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; padding: 4px 8px 4px 4px;
  border-radius: 12px; border: 1.5px solid rgba(226, 238, 228, .24); background: rgba(6, 13, 10, .86); color: var(--text); text-align: left;
  transition: border-color .15s, box-shadow .15s, opacity .5s, filter .5s, transform .15s;
}
.b-ally .u-em { width: 48px; height: 48px; display: grid; place-items: center; line-height: 0; }
.b-ally .u-em .em-fb { font-size: 30px; line-height: 1; }
/* 第6弾：主人公の顔（32×32 を 2 倍）。丸い窓に、胸から上 */
.b-ally.has-face .u-em { width: 64px; height: 64px; overflow: hidden; border-radius: 10px; place-items: end center; background: radial-gradient(circle at 50% 38%, rgba(92, 200, 168, .16), rgba(0, 0, 0, .25) 72%); box-shadow: inset 0 0 0 1.5px rgba(226, 238, 228, .14); }
.b-ally.me.has-face .u-em { background: radial-gradient(circle at 50% 38%, rgba(241, 204, 108, .22), rgba(0, 0, 0, .25) 72%); }
.b-ally.dead.has-face .u-em { background: rgba(0, 0, 0, .35); }
/* 動いた人の札が光る（行と同じ間） */
.b-ally.acting { border-color: var(--brass-hi); box-shadow: 0 0 0 2px rgba(241, 204, 108, .45), 0 0 16px rgba(241, 204, 108, .35); transform: translateY(-3px); }
.b-ai { min-width: 0; display: grid; gap: 2px; }
.b-an { display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 20px; }
.b-name { min-width: 0; font-size: calc(15px * var(--fs-k)); font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-marks { display: inline-flex; flex: none; gap: 3px; margin-left: auto; }
.b-marks:empty { display: none; }
.mk { font-style: normal; font-size: var(--fs-min); font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 6px; background: rgba(0, 0, 0, .5); color: var(--muted); white-space: nowrap; }
.mk.ok { background: var(--hp); color: #04241a; font-size: var(--fs-min); padding: 2px 5px; }
.mk.auto { color: var(--hp); box-shadow: inset 0 0 0 1px rgba(92, 200, 168, .5); }
.mk.off { color: #ffb398; box-shadow: inset 0 0 0 1px rgba(240, 116, 74, .5); }
.mk.combo { background: var(--brass); color: var(--brass-ink); }
.b-meter { display: flex; align-items: center; gap: 6px; min-width: 0; }
.b-meter .bar { flex: 1; min-width: 0; height: 7px; margin: 0; }
.b-meter.mp .bar { height: 5px; }
.b-meter .num { flex: none; min-width: 3.4em; font-size: var(--fs-min); font-weight: 700; line-height: 1.15; color: #e4ece2; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.b-meter.mp .num { color: #b9d3ff; font-weight: 400; }
.b-ally .b-tags { justify-content: flex-start; flex-wrap: nowrap; overflow: hidden; }
.b-ally.me { border-color: rgba(227, 179, 65, .8); box-shadow: inset 0 0 0 1px rgba(227, 179, 65, .25); }
.b-ally.chosen { border-color: rgba(92, 200, 168, .6); }
.b-ally.me.chosen { border-color: rgba(227, 179, 65, .8); }
.b-ally.combo { border-color: var(--brass-hi); box-shadow: 0 0 0 2px rgba(241, 204, 108, .3), 0 0 14px rgba(241, 204, 108, .3); }
.b-ally.partner { border-style: dashed; border-color: rgba(169, 226, 124, .45); }
.b-ally.off { opacity: .78; }
.b-ally.dead { opacity: .78; filter: grayscale(.7); border-style: dashed; }
.b-ally.pickable { cursor: pointer; border-color: var(--hp); box-shadow: 0 0 0 3px rgba(92, 200, 168, .35); opacity: 1; filter: none; }
.b-ally.gone { opacity: .15; filter: grayscale(1); pointer-events: none; }
.b-ally:not(.pickable) { cursor: default; }
@container bt (min-width: 640px) { .b-ally { flex-basis: 132px; } }
/* 人が多いとき（ワールドボスなど）：小さな札。自分が先 */
.b-allies.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 4px; max-height: 148px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.b-ally.mini { max-width: none; min-height: 44px; grid-template-columns: auto minmax(0, 1fr); gap: 5px; padding: 3px 5px; border-radius: 9px; }
.b-ally.mini .u-em { width: 24px; height: 24px; }
.b-ally.mini.has-face .u-em { width: 32px; height: 32px; border-radius: 7px; }
.b-ally.mini .u-em .em-fb { font-size: calc(17px * var(--fs-k)); }
.b-ally.mini .b-ai { gap: 1px; }
.b-ally.mini .b-an { min-height: 14px; }
.b-ally.mini .b-name { font-size: var(--fs-min); }
.b-ally.mini .b-meter .bar { height: 4px; }
.b-ally.mini .b-meter.mp .bar { height: 3px; }
.b-ally.mini .b-meter .num { min-width: 2.4em; font-size: var(--fs-min); }
/* 小さな札は2行（名前／HP）。MP は細いバーだけ（自分の MP は上の帯にも出ている） */
.b-ally.mini .b-meter.mp .num { display: none; }
.b-ally.mini .b-meter.mp { margin-top: 1px; }
.b-ally.mini .mk { font-size: var(--fs-min); padding: 1px 3px; }
.b-ally.mini .pop { font-size: calc(16px * var(--fs-k)); top: 0; }

/* 大技の予告の帯（下の欄のいちばん上。ぼうぎょのそば）・飛び入りの帯（味方の札の上） */
.b-alert {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 8px; padding: 5px 12px; border-radius: 10px;
  background: rgba(60, 6, 14, .92); border: 1.5px solid rgba(255, 93, 108, .85); box-shadow: 0 0 14px rgba(255, 59, 107, .3);
  font-size: var(--fs-min); line-height: 1.45; text-align: center; animation: bAlert .9s ease-in-out infinite alternate;
}
.b-alert b { color: #ffb3bb; }
.b-alert small { color: #ffd0d4; font-size: var(--fs-min); }
@keyframes bAlert { to { border-color: #ff8a96; box-shadow: 0 0 18px rgba(255, 59, 107, .5); } }
.q-banner { position: absolute; left: 0; right: 0; top: 0; z-index: 6; height: 0; pointer-events: none; }
.qb {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 16px);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
  background: rgba(13, 23, 19, .95); border: 1.5px solid var(--brass); color: var(--brass-hi); box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
  animation: qbIn .38s cubic-bezier(.2, .9, .3, 1.3);
}
.qb b { font-family: var(--font-dot); font-weight: 400; font-size: calc(15.5px * var(--fs-k)); overflow-wrap: anywhere; }
.qb-ic { font-size: calc(16px * var(--fs-k)); }
.qb.out { animation: qbOut .38s ease-in forwards; }
/* 戦いの最中に手に入れた称号（金色の短い帯。めずらしい称号はむらさき） */
.qb.qb-title { border-color: var(--brass-hi); background: linear-gradient(120deg, #3a2a07, #6e5012 48%, #3a2a07); color: #fff6dc; box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 18px rgba(227, 179, 65, .35); }
.qb.qb-title.rare { border-color: var(--violet); background: linear-gradient(120deg, #2b1745, #6a3f9e 48%, #2b1745); }
.qb.qb-title b { font-family: var(--font-body); font-weight: 700; font-size: calc(14.5px * var(--fs-k)); }
/* 称号の帯は、戦いの場のいちばん上（場所の札の上。敵の絵とHPの札にはかからない） */
.b-stage > .qb.qb-top { top: 5px; z-index: 7; transform: translateX(-50%); animation: qbTopIn .38s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; }
.b-stage > .qb.qb-top.out { animation: qbTopOut .38s ease-in forwards; }
@keyframes qbTopIn { from { transform: translate(-50%, -10px) scale(.9); opacity: 0; } }
@keyframes qbTopOut { to { transform: translate(-50%, -12px); opacity: 0; } }
@keyframes qbIn { from { transform: translate(-50%, -50%) scale(.8); opacity: 0; } }
@keyframes qbOut { to { transform: translate(-50%, -90%); opacity: 0; } }

/* ---------------------------------------------------------------------
   ワールドボス：上の大きなHPのバーと、戦っている人数
   --------------------------------------------------------------------- */
.wb-bar { flex: none; margin: 6px 8px 0; padding: 6px 10px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(70, 10, 24, .86), rgba(24, 6, 12, .76)); border: 1px solid rgba(255, 93, 108, .45); }
.wb-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wb-id { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.wb-kicker { font-size: var(--fs-min); font-weight: 700; letter-spacing: .16em; color: #ff9aa5; }
.wb-name { font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); color: #fff4f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-tags { flex: none; justify-content: flex-end; max-width: 40%; }
.wb-crew { flex: none; display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .42); font-size: var(--fs-min); color: #ffd0d4; }
.wb-crew b { font-family: var(--font-dot); font-weight: 400; font-size: calc(17px * var(--fs-k)); color: #fff; }
.wb-time { margin-left: 8px; font-size: var(--fs-min); font-weight: 400; letter-spacing: 0; color: #ffd0d4; white-space: nowrap; }
.wb-time:empty { display: none; }
.wb-hp { position: relative; height: 18px; margin-top: 6px; border-radius: 9px; background: rgba(0, 0, 0, .62); overflow: hidden; box-shadow: inset 0 0 0 1.5px rgba(255, 154, 165, .5); }
.wb-hp .wb-lag { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: rgba(255, 236, 238, .9); transition: width .7s ease .35s; }
.wb-hp .wb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(180deg, #ff8c99, #d6264a 55%, #a5112f); transition: width .2s ease-out; }
.wb-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, .4) calc(10% - 1px) 10%); }
.wb-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-min); font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; font-variant-numeric: tabular-nums; }
.wb-bar.low .wb-fill { animation: wbLow .8s ease-in-out infinite alternate; }
.wb-bar.charge { box-shadow: inset 0 -3px 0 #ff3b6b; }
@keyframes wbLow { to { filter: brightness(1.45); } }
@container bt (max-width: 520px) {
  .wb-bar { margin: 5px 6px 0; padding: 4px 9px 6px; }
  .wb-kicker { font-size: var(--fs-min); letter-spacing: .1em; }
  .wb-name { font-size: calc(15.5px * var(--fs-k)); }
  .wb-hp { height: 15px; margin-top: 4px; }
  .wb-num { font-size: var(--fs-min); }
}

/* ---------------------------------------------------------------------
   くちやみゲージ（50で強くなる・100であふれる）：上に細く
   --------------------------------------------------------------------- */
.q-blight { flex: none; align-self: flex-start; width: min(280px, calc(100% - 20px)); margin: 6px 10px 0; padding: 4px 12px; border-radius: 999px; background: rgba(20, 8, 30, .74); border: 1px solid rgba(199, 173, 255, .28); }
.blight { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 8px; }
.bl-label { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-dot); font-size: var(--fs-min); color: #d7b8ff; white-space: nowrap; }
.bl-label b { font-weight: 400; }
.bl-track { position: relative; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 1px rgba(199, 173, 255, .28); }
.bl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px; background: linear-gradient(90deg, #6a3fc2, #b46cff); box-shadow: 0 0 8px rgba(180, 108, 255, .5); transition: width .6s ease; }
.bl-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .6); border-radius: 1px; }
.bl-tick.t50 { left: 50%; }
.bl-num { min-width: 2em; text-align: right; font-family: var(--font-dot); font-size: calc(15px * var(--fs-k)); line-height: 1; color: #e6d4ff; }
.blight.lv1 .bl-fill { background: linear-gradient(90deg, #8a3fc2, #ff4fa8); box-shadow: 0 0 10px rgba(255, 79, 168, .6); }
.blight.lv1 .bl-label, .blight.lv1 .bl-num { color: #ff9ad0; }
.blight.lv2 .bl-fill { background: linear-gradient(90deg, #a01848, #ff3b6b); box-shadow: 0 0 14px rgba(255, 59, 107, .85); animation: blPulse 1.1s ease-in-out infinite; }
.blight.lv2 .bl-label, .blight.lv2 .bl-num { color: #ff7a95; }
.q-blight:has(.blight.lv2) { background: rgba(60, 6, 22, .8); border-color: rgba(255, 59, 107, .5); }
.blight.flash .bl-track { animation: blFlash .9s ease-out; }
@keyframes blPulse { 50% { box-shadow: 0 0 22px rgba(255, 59, 107, 1); filter: brightness(1.25); } }
@keyframes blFlash { 0% { filter: brightness(2); box-shadow: inset 0 0 0 1px rgba(199, 173, 255, .28), 0 0 0 0 rgba(255, 255, 255, .9); } 100% { filter: none; box-shadow: inset 0 0 0 1px rgba(199, 173, 255, .28), 0 0 0 8px rgba(255, 255, 255, 0); } }

/* ---------------------------------------------------------------------
   下の欄：ターンの帯・文の窓・コマンド・小さなボタン
   （PCの幅では、左にターンの帯と文の窓、右にコマンド）
   --------------------------------------------------------------------- */
.b-panel {
  position: relative; flex: none; display: grid; gap: 7px; min-width: 0; padding: 8px;
  border-radius: 16px; border: 1.5px solid var(--line-2); background: rgba(24, 40, 34, .97); box-shadow: 0 -6px 24px rgba(0, 0, 0, .22);
}
.b-left { display: grid; align-content: start; gap: 7px; min-width: 0; }
@container bt (min-width: 700px) {
  .b-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "left cmds" "foot foot"; align-items: start; gap: 8px 12px; padding: 10px 12px; }
  .b-left { grid-area: left; }
  .b-cmds { grid-area: cmds; align-self: stretch; }
  .b-foot { grid-area: foot; }
}

/* はじめての戦いのふきだし（第6弾。1回だけ。コマンドの欄の上に出て、下を指す） */
.b-tip {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% + 10px); z-index: 25;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px;
  background: #fff8e6; color: #2a2210; border: 2px solid var(--brass); box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  animation: bTipIn .25s ease-out; pointer-events: none; /* 下の札は、そのまま押せる（どこかを押すと、しまう） */
}
.b-tip-ok { pointer-events: auto; }
.b-tip p { flex: 1; min-width: 0; margin: 0; font-size: calc(15px * var(--fs-k)); line-height: 1.55; }
.b-tip p b { display: block; color: #8a5a00; }
.b-tip-ok { flex: none; min-width: 56px; min-height: 44px; border-radius: 10px; border: 0; background: var(--brass); color: var(--brass-ink); font-weight: 700; font-size: calc(15px * var(--fs-k)); box-shadow: 0 3px 0 var(--brass-deep); }
.b-tip-tail { position: absolute; left: 50%; top: 100%; width: 16px; height: 10px; margin-left: -8px; background: var(--brass); clip-path: polygon(0 0, 100% 0, 50% 100%); }
@keyframes bTipIn { from { opacity: 0; transform: translateY(8px); } }
@container bt (min-width: 700px) { .b-tip { left: auto; right: 12px; width: min(460px, 52%); } }

/* ターンの帯：1行目 ターン・残り時間、2行目 自分が選んだもの（選び直す・取り消す） */
.b-turn { display: grid; gap: 1px; min-width: 0; padding: 3px 5px 3px 10px; border-radius: 12px; background: rgba(5, 12, 9, .5); border: 1px solid var(--line); }
.b-tr1 { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: var(--fs-min); }
.b-tno { flex: none; font-family: var(--font-dot); color: var(--muted); white-space: nowrap; }
.b-tno b { margin-left: 2px; font-weight: 400; font-size: calc(17px * var(--fs-k)); color: var(--text); }
.b-cd { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 1px rgba(226, 238, 228, .1); }
.b-cd > i { display: block; width: 100%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brass-deep), var(--brass-hi)); transform-origin: left center; transition: transform .12s linear; }
.b-cdt { flex: none; min-width: 4.6em; text-align: right; color: var(--text); white-space: nowrap; }
.b-turn.idle .b-cd { display: none; }
.b-turn.idle .b-cdt { flex: 1; min-width: 0; text-align: left; color: var(--brass-hi); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.b-turn.hurry .b-cd > i { background: linear-gradient(90deg, #a8452c, var(--ember)); }
.b-turn.hurry .b-cdt { color: #ffb398; font-weight: 700; }
.b-tr2 { display: flex; align-items: center; gap: 6px; min-height: 48px; min-width: 0; }
.b-mrow { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.b-mrow b { font-size: calc(15px * var(--fs-k)); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-mrow small { font-size: var(--fs-min); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-mrow.mine b { font-family: var(--font-dot); font-weight: 400; font-size: calc(15.5px * var(--fs-k)); color: var(--brass-hi); }
.b-mrow.picking b { font-family: var(--font-dot); font-weight: 400; font-size: calc(15.5px * var(--fs-k)); color: #9ff0d6; }
.b-mrow.dead b { color: #ffb398; }
.b-check { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 50%; background: var(--hp); color: #04241a; font-family: var(--font-body); font-size: var(--fs-min); font-weight: 700; vertical-align: 1px; }
.b-arrow { margin: 0 5px; color: var(--faint); }
.b-tbtn {
  flex: none; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--brass); background: rgba(227, 179, 65, .14);
  color: var(--brass-hi); font-weight: 700; font-size: var(--fs-min); white-space: nowrap;
}
.b-tbtn:hover { background: rgba(227, 179, 65, .26); }
.b-tbtn.ghost { border-color: var(--line-2); background: transparent; color: var(--muted); }
.b-tbtn.ghost:hover { color: var(--text); background: var(--panel-2); }
.b-tbtn.nudge { animation: bNudge .5s; }
/* 第6弾：前と同じ（前のターンのコマンド・技・ねらいを1回で） */
.b-same { display: inline-flex; align-items: center; gap: 6px; max-width: 54%; min-height: 48px; padding: 2px 12px 2px 8px; border-color: var(--hp); background: linear-gradient(180deg, rgba(92, 200, 168, .22), rgba(92, 200, 168, .1)); color: #c8f5e7; text-align: left; }
.b-same:hover { background: rgba(92, 200, 168, .3); }
.b-same-ic { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--hp); color: #04241a; font-size: calc(17px * var(--fs-k)); line-height: 1; }
.b-same-t { min-width: 0; display: grid; line-height: 1.2; }
.b-same-t b { font-family: var(--font-dot); font-weight: 400; font-size: calc(15.5px * var(--fs-k)); color: #e8fff7; white-space: nowrap; }
.b-same-t small { font-size: var(--fs-min); font-weight: 700; color: #9fe8d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes bNudge { 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

/* 文の窓（ふだん2行。長い行は4行までのびる：行の途中からは見せない）。文の途中はタップで残りをすぐに全部（右下の ▼）。出しきったらタップで全部の記録 */
.b-msg {
  position: relative; min-width: 0; padding: 7px 12px 8px; border-radius: 10px; cursor: pointer;
  background: #0c1814; border: 2px solid #cdc5aa; box-shadow: 0 0 0 2px #07100c, inset 0 0 0 2px #07100c;
}
.b-msg:hover { border-color: #efe8d6; }
.b-msg-lines {
  min-height: 3.2em; max-height: 6.4em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: calc(15px * var(--fs-k)); line-height: 1.6; color: #f6f1e4;
}
/* 4行に入らない1行：頭から見せて、窓の中をスクロールして読める（下にまだ文があるあいだ、右下に ▼。全部の文は「記録」でも） */
.b-msg-lines.long { justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.b-msg-lines.long::-webkit-scrollbar { display: none; }
.b-msg.long-more::after {
  content: '▼'; position: absolute; right: 10px; bottom: 2px; color: var(--brass-hi); font-size: var(--fs-min); line-height: 1;
  animation: msgMore .8s steps(2, jump-none) infinite; pointer-events: none;
}
/* 文の途中：上のふちに「▼ タップで全部」（文にかぶらない） */
.b-msg-more {
  position: absolute; left: 10px; top: -13px; display: none; align-items: center; gap: 5px; min-height: 24px; padding: 0 10px 0 8px; border-radius: 999px;
  border: 1.5px solid var(--brass); background: #0c1814; color: var(--brass-hi); font-size: var(--fs-min); line-height: 1; pointer-events: none;
}
.b-msg-more small { font-size: var(--fs-min); font-weight: 700; color: #f6e7b8; }
.b-msg.more { border-color: var(--brass-hi); }
.b-msg.more .b-msg-more { display: inline-flex; }
.b-more-ic { font-style: normal; animation: msgMore .8s steps(2, jump-none) infinite; }
@keyframes msgMore { 50% { transform: translateY(2px); } }
.b-ln { display: block; flex: none; overflow-wrap: anywhere; }
.b-ln.new { animation: bLnIn .22s ease-out; }
@keyframes bLnIn { from { opacity: 0; transform: translateY(8px); } }
.b-ln .lic { display: inline-grid; place-items: center; margin-right: 4px; line-height: 0; vertical-align: -2px; }
.b-ln .lic .px { max-height: 16px; width: auto; }
.b-ln .lic .em-fb { font-size: var(--fs-min); line-height: 1; }
.b-ln .nP { font-weight: 700; }
.b-ln .nE { font-weight: 700; color: var(--rose); }
.b-ln .d { color: #ffcdb9; font-weight: 700; }
.b-ln .h { color: #7fe6c8; font-weight: 700; }
.b-ln .m { color: #9cc4ff; font-weight: 700; }
.b-ln .s { color: var(--violet); }
.b-ln .k { color: #ff9a74; font-weight: 700; }
.b-ln .g, .b-ln .c { color: var(--brass-hi); }
.b-ln .y { color: #d3dbd0; }
.b-ln .w { color: #ffe066; font-weight: 700; }
.b-ln .r { color: var(--faint); }
.b-ln .q { color: var(--text); }
.b-ln.k-wipe .y, .b-ln.tell .k { color: #ff9aa5; }
.b-ln.k-clear .y, .b-ln.k-floorclear .y, .b-ln.k-boss .y { color: var(--brass-hi); font-weight: 700; }
.b-msg-open {
  position: absolute; right: 10px; top: -13px; min-height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1.5px solid #cdc5aa; background: #0c1814; color: #f1ead4; font-size: var(--fs-min); font-weight: 700; line-height: 1;
}
.b-msg-open::after { content: ''; position: absolute; inset: -10px -10px; } /* 押しやすく */
.b-msg-open:hover { color: #fff; border-color: #efe8d6; }

/* コマンド：大きく5つ＋その他（3×2）。こうげきは真鍮色。選んだら ✓ */
.b-cmds { min-width: 0; min-height: 112px; }
.b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; transition: filter .15s; }
.b-cmd {
  --c: transparent;
  position: relative; min-width: 0; min-height: 56px; padding: 5px 4px 5px;
  display: grid; align-content: center; justify-items: center; gap: 1px;
  border-radius: 12px; border: 1.5px solid var(--line-2); background: linear-gradient(180deg, #284339, #1d332c);
  color: var(--text); text-align: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.b-cmd::before { content: ''; position: absolute; left: 14px; right: 14px; top: -1.5px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.b-cmd:hover { border-color: rgba(226, 238, 228, .42); background: linear-gradient(180deg, #2e4b41, #213a32); }
.b-cmd:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.b-cmd[disabled] { opacity: .36; cursor: not-allowed; transform: none; }
.b-cl { max-width: 100%; font-family: var(--font-dot); font-size: calc(17px * var(--fs-k)); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.b-cs { display: block; max-width: 100%; font-size: var(--fs-min); line-height: 1.25; color: #d5ddd2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-cmd.c-atk { background: linear-gradient(180deg, #f2c75f, var(--brass)); border-color: #f7da8e; color: var(--brass-ink); box-shadow: 0 3px 0 var(--brass-deep); }
.b-cmd.c-atk:hover { background: linear-gradient(180deg, #f8d77c, var(--brass-hi)); }
.b-cmd.c-atk .b-cs { color: #3a2a06; }
.b-cs .s { display: none; }
@container bt (max-width: 560px) { .b-cs .l { display: none; } .b-cs .s { display: inline; } }
.b-cmd.c-sk { --c: #8fb6ff; }
.b-cmd.c-it { --c: var(--hp); }
.b-cmd.c-gd { --c: #7fe0ee; }
.b-cmd.c-fl { --c: var(--ember); }
.b-cmd.c-fl .b-cl { color: #ffd0bf; }
.b-cmd.c-mo { --c: var(--faint); }
.b-cmd.chosen { border-color: var(--hp); box-shadow: 0 0 0 2px rgba(92, 200, 168, .55), 0 3px 0 rgba(0, 0, 0, .4); }
.b-cmd.chosen::after { content: '✓'; position: absolute; top: 3px; right: 7px; font-size: var(--fs-min); font-weight: 700; color: var(--hp); }
.b-cmd.c-atk.chosen::after { color: #0b3b2c; }
.b-cmd.brace { border-color: rgba(127, 224, 238, .9); box-shadow: 0 0 0 2px rgba(127, 224, 238, .35), 0 3px 0 rgba(0, 0, 0, .4); }
.b-cmd.combo { border-color: var(--brass-hi); box-shadow: 0 0 0 2px rgba(241, 204, 108, .35), 0 0 14px rgba(241, 204, 108, .3), 0 3px 0 rgba(0, 0, 0, .4); }
.b-combo {
  position: absolute; top: -9px; right: 6px; display: inline-flex; align-items: center; gap: 2px; padding: 0 6px 0 3px; border-radius: 999px;
  background: var(--brass); color: var(--brass-ink); font-size: var(--fs-min); font-weight: 700; line-height: 1.6; box-shadow: 0 2px 0 var(--brass-deep);
}
.b-key {
  position: absolute; top: 4px; left: 6px; display: none; min-width: 16px; padding: 0 3px; border-radius: 4px;
  border: 1px solid rgba(226, 238, 228, .25); background: rgba(0, 0, 0, .25); color: var(--faint); font: 700 12px/1.3 var(--font-body);
}
.b-cmd.c-atk .b-key { color: rgba(42, 30, 4, .72); border-color: rgba(42, 30, 4, .35); background: rgba(255, 255, 255, .22); }
@media (hover: hover) and (pointer: fine) { .b-key { display: block; } }
/* 選んだあと（選び直すまで止まる）・文を出しているあいだ（少し休む） */
.b-grid.locked, .b-grid.busy { pointer-events: none; }
.b-grid.locked .b-cmd:not(.chosen) { opacity: .42; filter: grayscale(.4); box-shadow: none; }
.b-grid.busy { filter: saturate(.75) brightness(.9); }
@container bt (min-width: 700px) {
  .b-cmds { min-height: 0; }
  .b-grid { height: 100%; grid-auto-rows: minmax(58px, 1fr); }
  .b-cl { font-size: calc(19px * var(--fs-k)); }
  .b-cs { font-size: var(--fs-min); }
}

/* ねらいを選ぶあいだ：相手の一覧 */
.b-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; max-height: 172px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.b-pk {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 7px; row-gap: 3px;
  min-height: 53px; padding: 5px 9px; border-radius: 12px; border: 1.5px solid var(--hp); background: rgba(92, 200, 168, .1); color: var(--text); text-align: left;
}
.b-pk:hover { background: rgba(92, 200, 168, .2); }
.b-pk.foe { border-color: rgba(255, 134, 179, .75); background: rgba(255, 134, 179, .08); }
.b-pk.foe:hover { background: rgba(255, 134, 179, .18); }
.b-pk-art { grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; line-height: 0; }
.b-pk-art .em-fb { font-size: calc(20px * var(--fs-k)); line-height: 1; }
.b-pk-name { min-width: 0; font-size: var(--fs-min); font-weight: 700; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.b-pk.foe .b-pk-name { color: var(--rose); }
.b-pk .bar { height: 6px; }
.b-pk-hp { display: flex; align-items: center; gap: 5px; min-width: 0; }
.b-pk-hp .bar { flex: 1; min-width: 0; }
.b-pk-hp .num { flex: none; font-size: var(--fs-min); font-weight: 700; line-height: 1.1; color: #e9f6ef; }
.b-pk-hp .num[data-lv="mid"] { color: #ffe08a; }
.b-pk-hp .num[data-lv="lo"] { color: #ffb0a4; }

/* 勝った・たおれた・宝箱・全滅 */
.b-state, .b-win { min-height: 112px; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 10px; border-radius: 12px; text-align: center; }
.b-state > b, .b-win > b { font-family: var(--font-dot); font-weight: 400; font-size: calc(20px * var(--fs-k)); line-height: 1.3; color: var(--brass-hi); }
.b-state > small, .b-win > small { font-size: var(--fs-min); line-height: 1.5; color: var(--muted); }
.b-state.dead > b, .b-state.wiped > b { color: #ffb398; }
.b-win { background: radial-gradient(80% 140% at 50% 0%, rgba(227, 179, 65, .26), transparent 70%); border: 1.5px solid rgba(227, 179, 65, .6); }
.b-win > b { font-size: calc(24px * var(--fs-k)); text-shadow: 0 0 14px rgba(241, 204, 108, .55); animation: bWin .5s cubic-bezier(.2, .9, .3, 1.4); }
.b-win.boss { border-color: rgba(255, 179, 152, .7); }
.b-win.wb { border-color: #ff8a9a; background: radial-gradient(80% 140% at 50% 0%, rgba(255, 120, 140, .26), transparent 70%); }
.b-win.wb > b { color: #ffe3e7; text-shadow: 0 0 16px rgba(255, 90, 110, .8); }
.b-win.wiped { border-color: rgba(240, 116, 74, .6); background: radial-gradient(80% 140% at 50% 0%, rgba(240, 116, 74, .16), transparent 70%); }
.b-win.wiped > b { color: #ffb398; text-shadow: none; }
/* 第7弾：全滅したあとの相手の一言（ローデン・ライバル）。たおれた味方の札の上に、上の相手から出る吹き出し（長くても切れない）。
   全滅の暗い幕（.fx-layer z-index 45）より上に出すので、画面に固定した箱（battle.js が戦いの場の下に合わせて left・top を決める） */
.b-lose {
  position: fixed; left: 50%; top: 60%; z-index: 46; transform: translate(-50%, -100%);
  width: max-content; max-width: min(560px, calc(100% - 20px)); padding: 8px 14px 10px; border-radius: 14px;
  background: #0a110f; border: 2px solid #cdc5aa; box-shadow: 0 0 0 2px #07100c, 0 10px 26px rgba(0, 0, 0, .6);
  color: #f6f1e4; text-align: left; pointer-events: none; animation: bLoseIn .34s cubic-bezier(.2, .9, .3, 1.25);
}
.b-lose[hidden] { display: none; }
/* しっぽ：話した相手の絵の真下（--tail。わからなければ真ん中） */
.b-lose::before {
  content: ''; position: absolute; left: var(--tail, 50%); top: -11px; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg);
  background: #0a110f; border-left: 2px solid #cdc5aa; border-top: 2px solid #cdc5aa;
}
.b-lose-who { position: relative; display: block; font-family: var(--font-dot); font-weight: 400; font-size: calc(15px * var(--fs-k)); line-height: 1.3; color: var(--rose); letter-spacing: .04em; }
.b-lose-t { position: relative; margin: 2px 0 0; font-size: calc(15px * var(--fs-k)); line-height: 1.6; overflow-wrap: anywhere; }
@keyframes bLoseIn { from { opacity: 0; transform: translate(-50%, calc(-100% + 10px)) scale(.96); } }
@keyframes bWin { 0% { transform: scale(.6); opacity: .3; } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.b-big {
  width: 100%; min-height: 54px; display: grid; place-content: center; gap: 1px; padding: 4px 12px; border-radius: 12px;
  border: 1.5px solid var(--line-2); background: var(--panel-2); color: var(--text); font-family: var(--font-dot); font-size: calc(18px * var(--fs-k)); box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.b-big small { font-family: var(--font-body); font-size: var(--fs-min); color: inherit; opacity: .8; }
.b-big.go { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); box-shadow: 0 3px 0 var(--brass-deep); }
.b-big.go:hover { background: var(--brass-hi); }
.b-big:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.b-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.b-small {
  flex: 1 1 96px; min-height: 44px; display: grid; place-content: center; padding: 3px 10px; border-radius: 10px;
  border: 1.5px solid var(--line-2); background: var(--panel-2); color: var(--text); font-family: var(--font-dot); font-size: calc(15px * var(--fs-k)); line-height: 1.2;
}
.b-small small { font-family: var(--font-body); font-size: var(--fs-min); color: var(--muted); }
.b-small.fl { color: #ffc0a8; }

/* 小さなボタン：会話中・オート・作戦・助けを呼ぶ */
.b-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.b-foot-l { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.b-foot-l:empty { display: none; }
.b-sosbox { display: flex; margin-left: auto; }
.b-sosbox:empty { display: none; }
.b-autobox { display: inline-flex; align-items: stretch; min-width: 0; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line-2); overflow: hidden; }
.b-autobox.on { border-color: var(--hp); background: rgba(92, 200, 168, .08); }
.b-auto {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-weight: 700; font-size: var(--fs-min); white-space: nowrap;
}
.b-auto:hover { background: rgba(226, 238, 228, .06); }
.b-sw { position: relative; flex: none; width: 30px; height: 18px; border-radius: 9px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.b-sw i { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: transform .15s, background .15s; }
.b-autobox.on .b-auto { color: var(--hp); }
.b-autobox.on .b-sw { background: rgba(92, 200, 168, .3); }
.b-autobox.on .b-sw i { transform: translateX(12px); background: var(--hp); }
.b-plan { display: inline-flex; align-items: center; min-width: 0; border-left: 1.5px solid var(--line-2); }
.b-autobox.on .b-plan { border-left-color: rgba(92, 200, 168, .45); }
.b-plan select { min-width: 0; max-width: 170px; min-height: 44px; padding: 0 8px 0 10px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-weight: 700; font-size: var(--fs-min); cursor: pointer; }
.b-plan option { background: var(--panel); color: var(--text); }
.b-auto:focus-visible, .b-plan select:focus-visible { outline: 3px solid var(--brass); outline-offset: -3px; }
.b-sos {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid rgba(240, 116, 74, .85); background: rgba(240, 116, 74, .14); color: #ffd2c2; font-weight: 700; font-size: var(--fs-min);
}
.b-sos:hover { background: rgba(240, 116, 74, .26); }
.b-sos.done { border-color: var(--line-2); background: transparent; color: var(--muted); cursor: default; }
.b-sos small { margin-left: 2px; font-size: var(--fs-min); font-weight: 400; color: var(--faint); }
@container bt (max-width: 420px) {
  .b-plan select { max-width: 128px; padding: 0 4px 0 8px; }
  .b-sos { padding: 0 12px; }
  .b-foot .scene-chip small { display: none; }
}
.b-sos .s { display: none; }
/* 大きい文字のせまい画面：作戦の名前が切れないように、助けを呼ぶは短く */
@container bt (max-width: 420px) {
  :root.big-text .b-plan select { max-width: 168px; }
  :root.big-text .b-sos { padding: 0 10px; }
  :root.big-text .b-sos .l { display: none; }
  :root.big-text .b-sos .s { display: inline; }
  :root.big-text .b-auto { padding: 0 8px; gap: 5px; }
}

/* 縦が短い画面（小さなスマホ・横向き）：ぜんぶが1画面に入るように、すき間をつめる */
@media (max-height: 720px) {
  .quest.bt { gap: 6px; }
  .b-stage { min-height: 180px; }
  /* 上の札（場所・ボス・見出し）は1行にして、敵の上の決まった場所に（敵の絵にはかからない） */
  .b-hud { flex-wrap: nowrap; min-height: 0; padding: 5px 6px 0; gap: 5px; }
  .b-hud .b-pill { min-height: 26px; padding-top: 1px; padding-bottom: 1px; }
  .b-hud .b-lmark { min-width: 20px; height: 20px; }
  .b-foes { padding-top: 4px; padding-bottom: 4px; }
  .b-cur { top: -6px; } /* ねらいの ▼ は絵の上のはしに（上の札にかからない） */
  .b-allies { padding: 5px 6px 6px; gap: 5px; }
  .b-ally { min-height: 54px; padding: 3px 7px 3px 4px; }
  /* 顔は頭から肩まで（胸から下を少しかくして、札を低く） */
  .b-ally.has-face .u-em { width: 54px; height: 50px; place-items: start center; }
  .b-panel { gap: 6px; padding: 7px; }
  .b-tr1 { min-height: 20px; }
  .b-tr2 { min-height: 44px; }
  .b-msg { padding: 5px 10px 6px; }
  .b-msg-lines { font-size: var(--fs-min); }
  .b-cmds { min-height: 98px; }
  .b-cmd { min-height: 46px; padding: 4px 4px 3px; }
  .b-cl { font-size: calc(16px * var(--fs-k)); }
  .b-cs { font-size: var(--fs-min); }
  .b-state, .b-win { min-height: 98px; padding: 6px; gap: 4px; }
  .b-big { min-height: 48px; }
}
/* 背の低いスマホ（375×667 など）の戦い：上のバーは名前・お金・会話だけ（HP・MPは味方の札にある）。まわりのすき間も小さく、敵を大きく */
@media (max-width: 899px) and (max-height: 720px) {
  body.battle-on { --tb-h: 60px; }
  /* 第8弾 QA：上のバーの右は 時間と天気・手帳・メニュー（room.css の5つの列と同じ並び。2行目の HP・MP は出さない） */
  body.battle-on .topbar { grid-template-areas: "who money sky journal menu"; padding-top: 7px; padding-bottom: 7px; }
  body.battle-on .topbar .tb-stats { display: none; }
  body.battle-on .app-main { padding: 6px 8px 8px; }
  body.battle-on .quest.bt { min-height: calc(100vh - var(--tb-h) - 16px); min-height: calc(100svh - var(--tb-h) - 16px); }
}
@media (min-width: 600px) and (max-width: 899px) and (max-height: 720px) {
  body.battle-on .topbar { grid-template-areas: "brand who money sky journal menu"; }
}
/* スマホの幅：見出しの札（ぬし・ライバルなど）があるときは、場所の札は出さない（2行になって敵にかからないように）。見出しは1行で、長ければ「…」 */
@media (max-width: 560px) {
  .b-hud { flex-wrap: nowrap; }
  .b-hud.has-label .b-place { display: none; }
  .b-hud .b-label { flex: 0 1 auto; min-width: 0; }
  .b-hud .b-kind { flex: none; }
}

/* ---------------------------------------------------------------------
   一覧（とくぎ・どうぐ・その他）と全部の記録：下から出る（PCの幅では右に）
   --------------------------------------------------------------------- */
.b-sheet { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; border-radius: 16px; background: rgba(4, 9, 7, .46); }
.b-sheet-box {
  position: relative; width: 100%; max-height: 76%; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--panel); box-shadow: 0 -10px 30px rgba(0, 0, 0, .45);
  animation: sheetUp .2s ease-out;
}
@container bt (min-width: 700px) {
  .b-sheet { justify-content: flex-end; }
  .b-sheet-box { width: min(540px, 56%); max-height: 88%; }
}
.b-sh-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.b-sh-head b { font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); }
.b-sh-sub { color: var(--mp); font-size: var(--fs-min); font-weight: 700; }
.b-sh-sub small { font-size: var(--fs-min); color: var(--muted); }
.b-x { flex: none; width: 44px; height: 44px; margin-left: auto; border-radius: 10px; border: 1.5px solid var(--line-2); background: transparent; color: var(--text); font-size: calc(16px * var(--fs-k)); }
.b-x:hover { background: var(--panel-2); }
.b-sh-note { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 14px 0; font-size: var(--fs-min); color: var(--muted); }
.b-sh-note b { color: var(--rose); }
.b-sh-foot { flex: none; margin: 0; padding: 4px 14px 12px; font-size: var(--fs-min); line-height: 1.5; color: var(--faint); }
.b-sh-foot:empty { display: none; }
.b-opts { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 6px; padding: 10px; }
.b-opt {
  display: grid; gap: 3px; min-height: 52px; padding: 9px 12px; border-radius: 12px; text-align: left;
  border: 1.5px solid var(--line-2); background: var(--panel-2); color: var(--text);
}
.b-opt:hover, .b-opt:focus-visible { border-color: var(--brass); }
.b-opt b { font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); }
.b-opt small { font-size: var(--fs-min); line-height: 1.45; color: var(--muted); }
.b-opt[disabled] { opacity: .45; cursor: not-allowed; }
.b-opt.chosen { border-color: var(--hp); box-shadow: inset 0 0 0 1px rgba(92, 200, 168, .4); }
.b-opt.combo { border-color: var(--brass); background: linear-gradient(180deg, rgba(227, 179, 65, .14), transparent 70%), var(--panel-2); }
.b-opt.use { justify-items: center; text-align: center; background: var(--brass); border-color: var(--brass); color: var(--brass-ink); box-shadow: 0 3px 0 var(--brass-deep); }
.b-opt.use small { color: rgba(42, 30, 4, .78); }
.b-opt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.b-opt-top b .el-ic { margin-right: 3px; }
.b-mp { color: var(--mp); font-size: var(--fs-min); font-weight: 700; white-space: nowrap; }
.b-desc { color: var(--muted); }
.b-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.b-meta:empty { display: none; }
.b-meta i { font-style: normal; font-size: var(--fs-min); padding: 0 6px; border-radius: 6px; background: rgba(0, 0, 0, .3); color: var(--faint); }
.b-meta .weak { color: #ffe066; box-shadow: inset 0 0 0 1px rgba(255, 224, 102, .5); }
.b-meta .resist { color: var(--faint); }
.b-meta .qd { color: #04241a; background: var(--hp); font-weight: 700; }
.sk-combo { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: var(--fs-min); color: var(--brass-hi); }
.sk-combo b { font-family: var(--font-body); font-weight: 700; font-size: var(--fs-min); }
.sk-combo small { color: var(--muted); font-size: var(--fs-min); }
.el-ic { display: inline-grid; place-items: center; line-height: 0; vertical-align: -2px; }
.el-ic .em-fb { font-size: var(--fs-min); line-height: 1; }
.el-note { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-min); }
.el-note.weak { color: #ffe066; }
.b-item { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px 2px; }
.b-item-art { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 12px; background: rgba(5, 12, 9, .5); line-height: 0; }
.b-item-art .em-fb { font-size: 32px; line-height: 1; }
.b-item-text { min-width: 0; display: grid; gap: 2px; }
.b-item-text b { font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); }
.b-item-text .b-hint { font-size: var(--fs-min); color: var(--hp); }
.b-item-text small { font-size: var(--fs-min); line-height: 1.5; color: var(--muted); }
/* 全部の記録とパーティーの会話 */
.b-logsheet .b-sheet-box { height: 82%; max-height: none; }
.b-logsheet .q-log { flex: 1 1 auto; height: auto; min-height: 0; }
.b-logsheet .q-say { flex: none; }

/* ---------------------------------------------------------------------
   説明の吹き出しの色・全部の記録の行・集合中の仲間
   --------------------------------------------------------------------- */
.tip-pop.tip-charge b { color: #ff9aa5; }
.tip-pop.tip-elite b { color: #ff9aa2; }
.tip-pop.tip-weak b { color: #ffe066; }
.tip-pop.tip-blight b { color: #d7b8ff; }

/* ---------------------------------------------------------------------
   戦いの記録
   --------------------------------------------------------------------- */
.q-log .lic { display: inline-grid; place-items: center; margin-right: 5px; line-height: 0; vertical-align: -3px; }
.q-log .lic .em-fb { font-size: var(--fs-min); line-height: 1; }
.q-log .w { color: #ffe066; font-weight: 700; padding: 0 3px; margin-right: 2px; border-radius: 4px; background: rgba(255, 224, 102, .14); }
.q-log .r { color: var(--faint); font-size: .92em; }
.q-log .k-floor .y { color: var(--text); font-family: var(--font-dot); }
.q-log .k-floor { margin-top: 6px; }
.q-log .k-event { margin: 6px 0; padding: 6px 10px; border-radius: 8px; background: rgba(165, 133, 240, .1); border-left: 3px solid #a585f0; }
.q-log .k-event .c { color: #e2d0ff; font-weight: 700; }
.q-log .k-event.ev-good { background: rgba(92, 200, 168, .1); border-left-color: var(--hp); }
.q-log .k-event.ev-good::before { content: '✨'; margin-right: 4px; }
.q-log .k-event.ev-bad { background: rgba(240, 116, 74, .08); border-left-color: var(--ember); }
.q-log .k-event.ev-bad::before { content: '💦'; margin-right: 4px; }
.q-log .k-combo { margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: linear-gradient(90deg, rgba(227, 179, 65, .26), rgba(227, 179, 65, .04)); border-left: 3px solid var(--brass-hi); }
.q-log .k-combo .c { color: #ffe9a8; font-weight: 700; font-family: var(--font-dot); }
.q-log .tell { margin: 4px 0; padding: 4px 10px; border-radius: 8px; background: rgba(255, 77, 94, .12); border-left: 3px solid #ff5d6c; }
.q-log .tell .k { color: #ff9aa5; }
.q-log .k-charge.cancel { padding: 3px 10px; border-radius: 8px; background: rgba(127, 224, 238, .1); border-left: 3px solid #7fe0ee; }
.q-log .k-charge.cancel .h { color: #a8eef6; }
.q-log .k-blight { color: #d7b8ff; }
.q-log .k-blight .s, .q-log .k-blight .h { color: #e2c8ff; }
.q-log .k-drop { font-size: var(--fs-min); }
.q-log .k-drop .g { color: #e6d6a8; }
.q-log .k-map { padding: 3px 10px; border-radius: 8px; background: rgba(227, 179, 65, .12); border: 1px dashed rgba(227, 179, 65, .55); }
.q-log .k-map .g { color: #ffe9a8; font-weight: 700; }
.q-log .k-partner { font-size: var(--fs-min); color: #cfe9b4; }
.q-log .k-partner .y, .q-log .k-partner .t { color: #cfe9b4; }
.q-log .k-partner .g { color: var(--luck); }

/* 集合中（試練の塔の入口）：見出しに行き先の景色をうっすら・連れている仲間 */
.q-head.has-scenery { position: relative; isolation: isolate; overflow: hidden; min-height: 64px; }
.q-head-scenery {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-size: cover; background-position: center 70%; image-rendering: pixelated;
  opacity: .55; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.lobby-members li.ally-row { margin-left: 20px; padding: 6px 10px; background: rgba(169, 226, 124, .06); border: 1px dashed rgba(169, 226, 124, .32); }
.ally-art { width: 42px; height: 42px; flex: none; display: grid; place-items: center; line-height: 0; }
.ally-art .em-fb { font-size: calc(20px * var(--fs-k)); line-height: 1; }
.chip.pt { background: rgba(169, 226, 124, .16); color: var(--luck); }


/* ---------------------------------------------------------------------
   会話シーン（下の窓に顔・名前・文。戦いは止まらない）
   --------------------------------------------------------------------- */
.scene-ov, .scene-ov-leave {
  position: fixed; inset: 0; z-index: 52; display: grid; align-items: end; justify-items: center;
  padding: 12px 12px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(4, 8, 6, .2) 0%, rgba(4, 8, 6, .55) 45%, rgba(4, 8, 6, .86) 100%);
  cursor: pointer; -webkit-user-select: none; user-select: none;
}
.scene-ov[hidden], .scene-ov [hidden], .scene-ov-leave [hidden] { display: none !important; }
/* 第7弾：暗い背景の会話（台本の bg: 'dark'。序章・世界が裏返る・真相など）：深い夜の色と、うすい周辺の暗がりで、
   地図・上の札・矢印をすっかりかくす（会話だけを読む）。閉じるときは、すっと消える */
.scene-ov.dark, .scene-ov-leave.dark {
  background:
    radial-gradient(120% 85% at 50% 36%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .3) 58%, rgba(0, 0, 0, .78) 100%),
    radial-gradient(60% 40% at 50% 30%, rgba(70, 86, 140, .16), rgba(70, 86, 140, 0) 70%),
    linear-gradient(180deg, #0b1022 0%, #0f1530 34%, #0a0d1c 70%, #05060b 100%);
}
.scene-ov.dark.enter { animation: scFade .45s ease-out; }
/* 暗い会話の思い出の絵（台本の art。scene.js が倍率 --k・1枚の幅 --tile・top・height を決める）。
   横いっぱいに、整数倍で、にじませず。暗く少し青く。上はうすく、下のはしは闇にとける（窓は闇の上）。ゆっくり横に流れる */
:is(.scene-ov, .scene-ov-leave) .sc-art {
  position: absolute; left: 0; right: 0; top: 0; height: 288px; z-index: 0; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 14%, #000 52%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 14%, #000 52%, rgba(0, 0, 0, 0) 100%);
}
:is(.scene-ov, .scene-ov-leave) .sc-art-in {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% + var(--tile, 576px));
  background-repeat: repeat-x; background-position: left bottom; background-size: var(--tile, 576px) calc(96px * var(--k, 3));
  image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; image-rendering: pixelated;
  filter: brightness(.58) saturate(.55) contrast(.92);
  /* 1ドット（--k px）ずつ、とても ゆっくり（192ドットで1まわり） */
  animation: scArtDrift 150s steps(192) infinite;
}
/* 夜の青さ（絵の上に、うすい青をかさねる） */
:is(.scene-ov, .scene-ov-leave) .sc-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(36, 52, 120, .34), rgba(14, 20, 52, .42)); }
:is(.scene-ov, .scene-ov-leave) .sc-art.in { animation: scArtIn 1.4s ease-out; }
/* 行の art で場所が変わる：新しい絵を上にかさねて、約0.6秒で入れかえる（scene.js の ART_SWAP_MS） */
:is(.scene-ov, .scene-ov-leave) .sc-art-in.swap { animation: scArtDrift 150s steps(192) infinite, scArtSwap .6s ease-out both; }
@keyframes scArtSwap { from { opacity: 0; } to { opacity: 1; } }
@keyframes scArtDrift { to { transform: translateX(calc(-1 * var(--tile, 576px))); } }
@keyframes scArtIn { from { opacity: 0; } }
/* PC の幅：絵の左右のはしも、闇にとかす */
@media (min-width: 900px) {
  :is(.scene-ov, .scene-ov-leave) .sc-art {
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 16%, #000 56%, rgba(0, 0, 0, 0) 100%), linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #000 14%, #000 86%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 16%, #000 56%, rgba(0, 0, 0, 0) 100%), linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, #000 14%, #000 86%, rgba(0, 0, 0, 0) 100%);
    mask-composite: intersect;
  }
}
:is(.scene-ov, .scene-ov-leave) .sc-box { z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  :is(.scene-ov, .scene-ov-leave) .sc-art-in, :is(.scene-ov, .scene-ov-leave) .sc-art-in.swap, :is(.scene-ov, .scene-ov-leave) .sc-art.in { animation: none; }
}
.scene-ov-leave { pointer-events: none; animation: scFadeOut .28s ease-in forwards; }
@keyframes scFadeOut { to { opacity: 0; } }
.scene-ov.enter { animation: scFade .3s ease-out; }
.scene-ov.enter .sc-box { animation: scRise .32s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes scFade { from { opacity: 0; } }
@keyframes scRise { from { opacity: 0; transform: translateY(24px); } }
.sc-box {
  --sc-line: #c9a24a;
  position: relative; width: min(780px, 100%); display: grid; gap: 8px; padding: 12px 16px 12px;
  background: linear-gradient(180deg, #1b302a, #0f1d18 70%); color: var(--text);
  box-shadow: 0 -3px 0 var(--sc-line), 0 3px 0 var(--sc-line), -3px 0 0 var(--sc-line), 3px 0 0 var(--sc-line), 0 0 0 6px rgba(5, 10, 8, .9), 0 18px 40px rgba(0, 0, 0, .6);
  margin: 6px;
}
.sc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sc-title { font-size: var(--fs-min); font-weight: 700; letter-spacing: .2em; color: var(--brass-hi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-title::before { content: '◆ '; color: var(--brass-deep); }
.sc-step { font-size: var(--fs-min); color: var(--faint); flex: none; }
.sc-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.sc-face {
  width: 96px; height: 96px; display: grid; place-items: center; line-height: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #2f4d43, #12211c 72%);
  box-shadow: 0 -2px 0 var(--sc-line), 0 2px 0 var(--sc-line), -2px 0 0 var(--sc-line), 2px 0 0 var(--sc-line), inset 0 0 0 2px rgba(0, 0, 0, .4);
}
.sc-face .em-fb { font-size: 46px; line-height: 1; }
.sc-face.in { animation: scFace .28s ease-out; }
@keyframes scFace { from { opacity: 0; transform: translateX(-10px) scale(.94); } }
.sc-talk { min-width: 0; display: grid; align-content: start; gap: 2px; }
.sc-name { font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); line-height: 1.3; color: var(--brass-hi); }
.sc-text { margin: 0; min-height: 5.25em; font-size: calc(16px * var(--fs-k)); line-height: 1.75; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.sc-text:not(.typing)::after { content: '▼'; display: inline-block; margin-left: 6px; font-size: var(--fs-min); color: var(--brass-hi); animation: scCaret 1s steps(2, end) infinite; vertical-align: 2px; }
@keyframes scCaret { 50% { opacity: 0; } }
.sc-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.sc-btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1.5px solid var(--line-2); background: rgba(5, 12, 9, .5); color: var(--muted); font-weight: 700; font-size: var(--fs-min); }
.sc-btn:hover { color: var(--text); background: var(--panel-2); }
.sc-next { min-width: 128px; border-color: var(--brass); background: var(--brass); color: var(--brass-ink); font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); box-shadow: 0 3px 0 var(--brass-deep); }
.sc-next:hover { background: var(--brass-hi); color: var(--brass-ink); }
.sc-next:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brass-deep); }
/* 話す人ごとの色 */
.sc-box.who-narr .sc-body { grid-template-columns: minmax(0, 1fr); }
.sc-box.who-narr .sc-text { text-align: center; color: #d9e2d6; letter-spacing: .04em; padding: 6px 4px 0; }
.sc-box.who-boss { --sc-line: #c9454f; background: linear-gradient(180deg, #2c1a1d, #160e10 70%); }
.sc-box.who-boss .sc-name { color: #ff9aa2; }
.sc-box.who-boss .sc-face { background: radial-gradient(circle at 50% 38%, #4a2228, #1a0c0f 72%); }
.sc-box.who-me .sc-face { background: radial-gradient(circle at 50% 38%, #2c3f5a, #121a26 72%); }
.sc-box.who-lumina { --sc-line: #f1cc6c; }
.sc-box.who-lumina .sc-name { color: #ffe9a8; }
.sc-box.who-lumina .sc-face { background: radial-gradient(circle at 50% 38%, #6a5a2a, #241e0c 72%); }
.sc-box.who-kage { --sc-line: #8f5bd0; background: linear-gradient(180deg, #221630, #0f0a16 70%); }
.sc-box.who-kage .sc-name { color: #ff8a8a; }
.sc-box.who-kage .sc-face { background: radial-gradient(circle at 50% 38%, #3a2054, #0c0612 72%); }
/* 第7弾：審問官ローデン（銀のよろい・はがね色）・大司祭キヨラ（白と金。こわい顔のときは冷たい灰色）・館のじいや（半透明のゆうれい）・
   ルミナ姫の朽ちかけた姿（face: sick）。表情は .sc-box の data-face */
.sc-box.who-rodin { --sc-line: #9fb4cc; background: linear-gradient(180deg, #1c2430, #10151d 70%); }
.sc-box.who-rodin .sc-name { color: #d4e2f2; }
.sc-box.who-rodin .sc-face { background: radial-gradient(circle at 50% 38%, #34465c, #121a24 72%); }
.sc-box.who-rodin[data-face="angry"] { --sc-line: #d0606a; }
.sc-box.who-rodin[data-face="sad"] { --sc-line: #7d8ea6; }
.sc-box.who-kiyora { --sc-line: #f0e2b0; background: linear-gradient(180deg, #2a2620, #15130f 70%); }
.sc-box.who-kiyora .sc-name { color: #fff2c8; }
.sc-box.who-kiyora .sc-face { background: radial-gradient(circle at 50% 36%, #e8dcb8 0, #8a7a54 40%, #1e1a12 76%); }
.sc-box.who-kiyora[data-face="cold"] { --sc-line: #a8a4b4; background: linear-gradient(180deg, #1e1d24, #0d0c12 70%); }
.sc-box.who-kiyora[data-face="cold"] .sc-name { color: #d8d4e8; }
.sc-box.who-kiyora[data-face="cold"] .sc-face { background: radial-gradient(circle at 50% 38%, #3a3846, #0b0a10 74%); }
.sc-box.who-jiiya { --sc-line: #8fc4cc; background: linear-gradient(180deg, #16262a, #0b1517 70%); }
.sc-box.who-jiiya .sc-name { color: #bfe8ee; }
.sc-box.who-jiiya .sc-face { background: radial-gradient(circle at 50% 40%, #2a4a50, #0a1416 74%); }
.sc-box.who-jiiya .sc-face img { opacity: .82; animation: scGhost 3.2s ease-in-out infinite; }
@keyframes scGhost { 50% { transform: translateY(-2px); opacity: .6; } }
.sc-box.who-lumina[data-face="sick"] { --sc-line: #9a86b8; }
.sc-box.who-lumina[data-face="sick"] .sc-name { color: #e2d6f4; }
.sc-box.who-lumina[data-face="sick"] .sc-face { background: radial-gradient(circle at 50% 38%, #3a3048, #120e18 72%); }
/* 第7弾：長い会話（序章など）を、スマホで読みやすく
   ・上の細い線：どこまで読んだか（10行以上の会話だけ）
   ・長い文：ナレーションも左ぞろえ。文が窓より長いときは、文のところだけスクロール（窓が画面からはみ出さない）
   ・はじめて見る長い会話のスキップは2回押す（1回目は「本当にスキップ？」） */
.sc-prog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(0, 0, 0, .35); pointer-events: none; }
.sc-prog i { display: block; width: 0; height: 100%; background: var(--sc-line); opacity: .85; transition: width .25s ease-out; }
.sc-box:not(.long) .sc-prog { display: none; }
.sc-text { max-height: calc(1.75em * 6); overflow-y: auto; overscroll-behavior: contain; }
.sc-box.who-narr .sc-text.long { text-align: left; letter-spacing: .02em; }
.sc-skip.armed { border-color: var(--ember); color: #ffd2c2; background: rgba(60, 20, 12, .7); }
@media (max-height: 700px) { .sc-text { max-height: calc(1.75em * 5); } }
@media (prefers-reduced-motion: reduce) { .sc-box.who-jiiya .sc-face img { animation: none; } .sc-prog i { transition: none; } }
/* 自分の番を待っているもの（会話シーンの上） */
.sc-wait {
  position: absolute; bottom: calc(100% + 12px); left: 0; right: 0; z-index: 1; margin: 0 auto; width: max-content; max-width: 100%;
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; cursor: default;
  background: rgba(40, 14, 10, .95); border: 1.5px solid rgba(240, 116, 74, .8); box-shadow: 0 8px 20px rgba(0, 0, 0, .5); color: #ffd2c2; font-size: var(--fs-min);
}
.sc-wait-ic { font-size: calc(15px * var(--fs-k)); flex: none; }
.sc-wait-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.sc-wait-text b { display: inline-flex; align-items: baseline; gap: 6px; color: #ffb398; white-space: nowrap; }
.sc-wait-tag { padding: 0 6px; border-radius: 6px; background: rgba(255, 179, 152, .16); color: #ffd2c2; font-size: var(--fs-min); font-weight: 700; }
.sc-wait-text .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-wait.hurry { border-color: var(--ember); animation: scHurry .8s ease-in-out infinite; }
@keyframes scHurry { 50% { box-shadow: 0 8px 20px rgba(0, 0, 0, .5), 0 0 0 4px rgba(240, 116, 74, .35); } }
.sc-wait-btn { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--ember); color: #2a0d03; font-weight: 700; font-size: var(--fs-min); white-space: nowrap; }
/* 広い画面（PC）：会話の窓の下の段の左に（窓の上だと、戦いの場の主人公の札にかかるので）。せまい画面は窓の上（うすぐらいコマンドの欄の上） */
@media (min-width: 720px) {
  .sc-foot { align-items: center; }
  .sc-foot .sc-wait { position: static; margin: 0 auto 0 0; width: auto; max-width: 100%; box-shadow: none; }
}
/* コマンドの欄の「会話中」の札（しまった会話の続き） */
.scene-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px; border: 1.5px solid var(--brass); background: rgba(227, 179, 65, .12); color: var(--text); white-space: nowrap; }
.scene-chip b { font-family: var(--font-dot); font-weight: 400; font-size: calc(14px * var(--fs-k)); color: var(--brass-hi); }
.scene-chip small { font-size: var(--fs-min); color: var(--muted); }
.b-foot .scene-chip { flex: none; }
/* しまったときの「会話中」の札 */
.scene-pill {
  position: fixed; right: 12px; top: calc(var(--tb-h) + 10px); z-index: 52;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 16px 4px 10px; border-radius: 999px;
  background: rgba(20, 34, 29, .96); border: 1.5px solid var(--brass); color: var(--text); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); text-align: left;
}
.scene-pill .sp-ic { font-size: calc(20px * var(--fs-k)); line-height: 1; }
.scene-pill .sp-text { display: grid; line-height: 1.3; }
.scene-pill b { font-family: var(--font-dot); font-weight: 400; font-size: calc(15px * var(--fs-k)); color: var(--brass-hi); }
.scene-pill small { font-size: var(--fs-min); color: var(--muted); }
.scene-pill.waiting { border-color: rgba(240, 116, 74, .7); }
@media (min-width: 900px) {
  .scene-ov { padding-bottom: calc(28px + var(--safe-b)); }
  .sc-box { padding: 16px 20px 14px; gap: 10px; }
  .sc-face { width: 136px; height: 136px; }
  .sc-face .em-fb { font-size: 64px; }
  .sc-name { font-size: calc(20px * var(--fs-k)); }
  .sc-text { font-size: calc(17px * var(--fs-k)); }
}
@media (max-width: 400px) {
  .sc-box { padding: 10px 12px; }
  .sc-body { gap: 10px; }
  .sc-face { width: 72px; height: 72px; }
  .sc-text { font-size: calc(15px * var(--fs-k)); }
  .sc-btn { padding: 0 12px; }
  .sc-next { min-width: 104px; }
}

/* ---------------------------------------------------------------------
   帯の演出：連携技・大技の予告・大技をふせいだ（fx.js）
   --------------------------------------------------------------------- */
.fx-path { --pc: var(--brass-hi); gap: 4px; padding-top: 12px; border-image: linear-gradient(90deg, transparent, var(--pc), transparent) 1; }
.fx-path .fx-text { color: var(--pc); text-shadow: 0 3px 0 rgba(0, 0, 0, .65), 0 0 18px color-mix(in srgb, var(--pc) 60%, transparent); }
.fx-path .fx-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; color: #f0ead8; font-size: calc(14px * var(--fs-k)); letter-spacing: .06em; text-align: center; }
.fx-where { color: var(--muted); font-size: var(--fs-min); }
.fx-path-ic { line-height: 0; animation: tbnMedal .7s ease-out; }
.fx-path-ic .em-fb { font-size: 40px; line-height: 1; }
.fx-path.t-elite { --pc: #ff8f8f; background: linear-gradient(90deg, transparent, rgba(40, 6, 10, .9) 16%, rgba(40, 6, 10, .9) 84%, transparent); }
.fx-path.t-treasure { --pc: #ffd36e; }
.fx-path.t-spring { --pc: #8fe8f4; }
.fx-path.t-event { --pc: #d7b8ff; }
.fx-path.t-merchant { --pc: #c4ee9a; }
.fx-path.t-secret { --pc: #fff2a0; }

.fx-combo {
  top: 36%; gap: 2px; padding: 18px 12px 16px; overflow: hidden;
  background:
    radial-gradient(42% 90% at 50% 50%, rgba(255, 196, 64, .42), transparent 72%),
    linear-gradient(90deg, transparent, rgba(46, 28, 2, .96) 12%, rgba(58, 36, 4, .98) 50%, rgba(46, 28, 2, .96) 88%, transparent);
  border-image: linear-gradient(90deg, transparent, #ffd36e, #fff2a0, #ffd36e, transparent) 1;
  animation: fxCombo var(--dur, 1.7s) ease-out forwards;
}
/* 光のすじ（くるりと回る） */
.fx-combo::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 120, .2) 0 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 62%); mask-image: radial-gradient(closest-side, #000 18%, transparent 62%);
  animation: fxRays var(--dur, 1.7s) linear forwards;
}
@keyframes fxRays { from { transform: rotate(0deg) scale(.6); } to { transform: rotate(40deg) scale(1.1); } }
.fx-combo > * { position: relative; }
.fx-combo .fx-kicker { display: inline-flex; align-items: center; gap: 6px; color: #fff2a0; font-size: calc(14px * var(--fs-k)); letter-spacing: .3em; }
.fx-spark { line-height: 0; animation: tbnMedal .6s ease-out; }
.fx-spark .em-fb { font-size: calc(22px * var(--fs-k)); line-height: 1; }
.fx-combo .fx-text { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; white-space: normal; text-align: center; font-size: clamp(30px, 8.6vw, 56px); color: #fff4c2; text-shadow: 0 3px 0 rgba(0, 0, 0, .7), 0 0 22px rgba(255, 190, 60, .95), 0 0 2px #000; }
.fx-els { display: inline-flex; gap: 4px; line-height: 0; }
.fx-el .em-fb { font-size: calc(26px * var(--fs-k)); line-height: 1; }
.fx-pair { display: inline-flex; align-items: center; gap: 8px; color: #fbe9c0; font-size: calc(15px * var(--fs-k)); letter-spacing: .04em; }
.fx-pair b { font-weight: 700; }
.fx-pair i { font-style: normal; color: #ffd36e; }
.fx-combo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 250, 220, .4) 50%, transparent 65%); transform: translateX(-110%); animation: tbnSheen .9s .15s ease-out forwards; pointer-events: none; }
@keyframes fxCombo {
  0% { opacity: 0; transform: translateY(-50%) scale(1.5); }
  10% { opacity: 1; transform: translateY(-50%) scale(.96); }
  18% { transform: translateY(-50%) scale(1.02); }
  26% { transform: translateY(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

.fx-charge {
  top: 28%; gap: 4px; padding: 14px 12px 14px;
  background:
    repeating-linear-gradient(-45deg, #ff3b4e 0 10px, #1a0507 10px 20px) top / 100% 6px no-repeat,
    repeating-linear-gradient(-45deg, #ff3b4e 0 10px, #1a0507 10px 20px) bottom / 100% 6px no-repeat,
    linear-gradient(90deg, rgba(40, 4, 8, .55), rgba(40, 4, 8, .95) 14%, rgba(40, 4, 8, .95) 86%, rgba(40, 4, 8, .55));
  border: 0;
  animation: fxBand var(--dur, 2.1s) ease-out forwards, fxAlarm .5s steps(2, end) 3;
}
.fx-charge .fx-kicker { display: inline-flex; align-items: center; gap: 6px; color: #ffb3bb; letter-spacing: .14em; font-size: var(--fs-min); }
.fx-warn-ic { line-height: 0; }
.fx-warn-ic .em-fb { font-size: calc(20px * var(--fs-k)); line-height: 1; }
.fx-charge .fx-text { color: #fff; font-size: clamp(34px, 9.4vw, 60px); text-shadow: 0 3px 0 #000, 0 0 20px rgba(255, 59, 78, 1), 0 0 2px #000; }
.fx-charge .fx-sub { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; color: #ffe0e3; font-size: calc(15px * var(--fs-k)); letter-spacing: .04em; text-align: center; }
.fx-move { color: #ffe066; font-weight: 700; }
@keyframes fxAlarm { 50% { filter: brightness(1.35) saturate(1.2); } }

.fx-guard { top: 32%; border-image: linear-gradient(90deg, transparent, #7fe0ee, transparent) 1; background: linear-gradient(90deg, transparent, rgba(4, 30, 34, .9) 16%, rgba(4, 30, 34, .9) 84%, transparent); }
.fx-guard .fx-text { color: #a8eef6; font-size: clamp(28px, 7.8vw, 48px); text-shadow: 0 3px 0 rgba(0, 0, 0, .7), 0 0 18px rgba(127, 224, 238, .85); }
.fx-guard .fx-sub { color: #d6f6fa; font-size: var(--fs-min); }

/* 「視差効果を減らす」設定：動きは止める（app.css の全体の決まり）。光は動かさずに残す */
@media (prefers-reduced-motion: reduce) {
  .fx-combo, .fx-charge { transform: translateY(-50%); }
  .b-foe.gone { opacity: 0; transform: none; }
  .b-foe.charge .b-plate { box-shadow: 0 0 0 3px rgba(255, 77, 94, .45), 0 0 14px rgba(255, 77, 94, .45); }
  .qb.out { opacity: 0; }
}

/* =====================================================================
   第8弾：原作の部屋の形の冒険（ui/advbar.js・ui/floor.js・ui/manor.js と battle.js の集合・けんがく）
   ・階の進み（#b-floors）と、戦いの場の中の分かれ道・出来事・行商人・階の札（#q-adv）
   ・けんがく（.b-watchbar・body.quest-watching）・集合の「しゅっぱつ」
   ・酒場の「冒険のパーティー」（#adv-bar の .ab-*）と「冒険をつくる」（.adv-make）
   ・ひいらぎ館の部屋の冒険（room.js の部屋の枠に .manor-room。枠が無いときの .mn-*）
   ===================================================================== */

/* ---- 階の進み（1〜9階・ボス・宝）：上の札の下に小さく ---- */
.b-floors {
  flex: none; align-self: center; max-width: calc(100% - 16px); margin: 6px 8px 0; padding: 3px;
  border-radius: 9px; background: rgba(6, 13, 10, .62); box-shadow: inset 0 0 0 1px rgba(226, 238, 228, .12);
  overflow-x: auto; scrollbar-width: none;
}
.b-floors::-webkit-scrollbar { display: none; }
.b-floors li { flex: none; background: rgba(0, 0, 0, .28); }
.b-floors li.ic { padding: 0 2px; line-height: 0; }
.b-floors li.ic .em-fb { font-size: 14px; line-height: 1; }
.b-floors li.ic.done:not(.now) { background: rgba(227, 179, 65, .16); }
.b-floors li.ic.t-secret:not(.now) { box-shadow: 0 0 6px rgba(255, 242, 160, .45); }
.b-floors li.ic.t-eerie:not(.now) { box-shadow: 0 0 6px rgba(199, 173, 255, .45); }

/* ---- 戦いの場の中（#q-adv）：道を選ぶ・出来事のあいだは、敵の列をたたんでカードを場の中に。戦いのあいだは札だけ上に ---- */
.q-adv:empty { display: none; }
.q-adv { position: relative; z-index: 5; display: grid; gap: 10px; min-width: 0; padding: 4px 10px 10px; }
.b-stage.adv-calm .b-foes { display: none; }
.b-stage.adv-calm .q-adv { order: 1; flex: 1 1 auto; align-content: start; }
.b-stage.adv-calm .b-front { order: 2; }
.b-stage.adv-calm .q-scenery::after { background: linear-gradient(180deg, rgba(9, 16, 13, .58), rgba(9, 16, 13, .44) 50%, rgba(9, 16, 13, .74)); }
.b-stage.adv-over .q-adv { position: absolute; left: 0; right: 0; top: 78px; z-index: 8; padding: 0 10px; justify-items: center; pointer-events: none; }
.b-stage.adv-over .q-adv > * { width: min(440px, 100%); pointer-events: auto; }
@container bt (min-width: 700px) {
  .b-stage.adv-calm .q-adv { padding: 6px 16px 12px; }
  .b-stage.adv-calm .q-adv > * { width: min(860px, 100%); justify-self: center; }
}

/* 道・出来事・行商人の札（第2弾の形） */
.adv-card { position: relative; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line-2); background: rgba(10, 19, 16, .9); box-shadow: 0 8px 22px rgba(0, 0, 0, .38); min-width: 0; }
.adv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.adv-title { flex: 1 1 auto; min-width: 0; margin: 0; font-family: var(--font-dot); font-weight: 400; font-size: calc(19px * var(--fs-k)); line-height: 1.35; overflow-wrap: anywhere; }
.af-floor { color: var(--brass-hi); font-size: calc(23px * var(--fs-k)); margin-right: 2px; }
.adv-sub { margin: 2px 0 10px; font-size: var(--fs-min); color: var(--muted); line-height: 1.5; }
.adv-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.adv-foot .adv-sub { margin: 0; flex: 1 1 200px; }
.vote-cd { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; font-size: var(--fs-min); color: var(--brass-hi); white-space: nowrap; font-weight: 700; }
.vc-bar { display: block; width: 64px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.vc-bar > i { display: block; height: 100%; width: 100%; background: var(--brass); border-radius: 3px; transition: width .2s linear; }
.vote-cd.idle { color: var(--faint); font-weight: 400; white-space: normal; }
.vote-cd.idle .vc-bar { opacity: .35; }
.vote-cd.hurry { color: #ffb398; }
.vote-cd.hurry .vc-bar > i { background: var(--ember); }
.vchip { --vc: #ffffff; display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-min); font-weight: 700; line-height: 1.5; color: var(--vc); background: rgba(0, 0, 0, .4); border: 1px solid color-mix(in srgb, var(--vc) 45%, transparent); white-space: nowrap; }
.vchip.me { background: rgba(227, 179, 65, .22); border-color: var(--brass); color: var(--brass-hi); }

/* 分かれ道：道のカード（左に道の色の帯。自分の票は金色のふち。PCの幅では横に並べる） */
.fork-cards { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.fork-card {
  --pc: #f0744a; --pc-hi: #ffc0a8;
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "ic body" "ic votes";
  align-items: center; column-gap: 12px; min-height: 68px; padding: 10px 12px 10px 10px; border-radius: 12px; text-align: left; color: var(--text);
  border: 1.5px solid color-mix(in srgb, var(--pc) 40%, var(--line-2)); border-left: 6px solid var(--pc);
  background: linear-gradient(95deg, color-mix(in srgb, var(--pc) 20%, transparent), rgba(5, 12, 9, .5) 72%), rgba(12, 22, 18, .92);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4); transition: transform .1s, box-shadow .15s, border-color .15s; cursor: pointer;
}
.fork-card:hover:not([disabled]) { border-color: color-mix(in srgb, var(--pc) 75%, transparent); box-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 0 16px color-mix(in srgb, var(--pc) 30%, transparent); }
.fork-card:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.fork-card:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.fork-card[disabled] { opacity: .55; cursor: not-allowed; }
.fc-icon { grid-area: ic; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pc) 55%, transparent); line-height: 0; }
.fc-icon .em-fb { font-size: 24px; line-height: 1; }
.fc-body { grid-area: body; display: grid; gap: 1px; min-width: 0; }
.fc-label { font-family: var(--font-dot); font-weight: 400; font-size: calc(17.5px * var(--fs-k)); line-height: 1.3; color: var(--pc-hi); overflow-wrap: anywhere; }
.fc-hint { font-size: var(--fs-min); line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.fc-votes { grid-area: votes; display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.fork-card.mine { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(227, 179, 65, .32), 0 3px 0 rgba(0, 0, 0, .4); }
.fork-card.mine::after { content: '✓ あなたの票'; position: absolute; top: -10px; right: 10px; padding: 1px 8px; border-radius: 999px; background: var(--brass); color: var(--brass-ink); font-size: var(--fs-min); font-weight: 700; line-height: 1.45; }
.fork-cards.n1 .fork-card.mine::after { content: '✓ この道へ'; }
.fork-card.t-battle { --pc: #f0744a; --pc-hi: #ffc0a8; }
.fork-card.t-elite { --pc: #e8434f; --pc-hi: #ff9aa2; }
.fork-card.t-treasure { --pc: #e3b341; --pc-hi: #ffe39a; }
.fork-card.t-spring { --pc: #45c7d8; --pc-hi: #a8eef6; }
.fork-card.t-event { --pc: #a585f0; --pc-hi: #e2d0ff; }
.fork-card.t-merchant { --pc: #86c95a; --pc-hi: #cdf1a8; }
.fork-card.t-secret { --pc: #fff2a0; --pc-hi: #fffbe0; background: linear-gradient(110deg, rgba(255, 242, 160, .08) 20%, rgba(255, 255, 255, .26) 32%, rgba(255, 242, 160, .08) 44%), linear-gradient(95deg, rgba(255, 242, 160, .2), rgba(5, 12, 9, .5) 72%), rgba(22, 22, 14, .92); background-size: 300% 100%, auto, auto; animation: secretSheen 2.6s linear infinite; }
.fork-card.t-secret .fc-icon { box-shadow: inset 0 0 0 1.5px rgba(255, 242, 160, .8), 0 0 14px rgba(255, 242, 160, .45); }
/* 第8弾の道：見回りの気配（はがね）・ぶきみ（くすんだ紫）・ぬし（若草）・ほこら（朱）・光る地面（青緑の光）・ローデン（紅と銀）・ライバル（赤と青） */
.fork-card.t-patrol { --pc: #9fb4cc; --pc-hi: #e2ebf6; }
.fork-card.t-eerie { --pc: #8f7fb8; --pc-hi: #ddd2f7; background: linear-gradient(95deg, rgba(60, 46, 96, .5), rgba(5, 6, 12, .6) 72%), rgba(14, 12, 22, .94); }
.fork-card.t-eerie .fc-label { letter-spacing: .06em; }
.fork-card.t-nushi { --pc: #9fd27a; --pc-hi: #e0f6c8; }
.fork-card.t-nushi .fc-icon { box-shadow: inset 0 0 0 1.5px rgba(241, 204, 108, .8), 0 0 12px rgba(159, 210, 122, .4); }
.fork-card.t-shrine { --pc: #e0705a; --pc-hi: #ffd3c8; }
.fork-card.t-dig { --pc: #6fd8c0; --pc-hi: #d2fff2; }
.fork-card.t-dig .fc-icon { box-shadow: inset 0 0 0 1.5px rgba(111, 216, 192, .75), 0 0 14px rgba(111, 216, 192, .45); }
.fork-card.t-rodin { --pc: #d0606a; --pc-hi: #ffd0d5; border-left-color: #d0606a; box-shadow: 0 3px 0 rgba(0, 0, 0, .4), inset -3px 0 0 #9fb4cc; }
.fork-card.t-rival { --pc: #ff7d8e; --pc-hi: #ffd2da; box-shadow: 0 3px 0 rgba(0, 0, 0, .4), inset -3px 0 0 #6f8dff; }
@keyframes secretSheen { from { background-position: 120% 0, 0 0, 0 0; } to { background-position: -120% 0, 0 0, 0 0; } }
@container bt (min-width: 700px) {
  .fork-cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .fork-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ic" "body" "votes"; justify-items: center; text-align: center; row-gap: 6px; padding: 16px 10px 12px; border-left-width: 1.5px; border-top: 6px solid var(--pc); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 20%, transparent), rgba(5, 12, 9, .5) 70%), rgba(12, 22, 18, .92); }
  .fork-card.t-secret { background: linear-gradient(110deg, rgba(255, 242, 160, .08) 20%, rgba(255, 255, 255, .26) 32%, rgba(255, 242, 160, .08) 44%), linear-gradient(180deg, rgba(255, 242, 160, .2), rgba(5, 12, 9, .5) 70%), rgba(22, 22, 14, .92); background-size: 300% 100%, auto, auto; }
  .fork-card.t-eerie { background: linear-gradient(180deg, rgba(60, 46, 96, .5), rgba(5, 6, 12, .6) 70%), rgba(14, 12, 22, .94); }
  .fork-card.t-rodin, .fork-card.t-rival { box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
  .fc-icon { width: 56px; height: 56px; }
  .fc-votes { justify-content: center; margin-top: 2px; }
}

/* 出来事（なぞ・ひみつ・見回り・ほこら・光る地面） */
.adv-event { border-color: rgba(199, 173, 255, .5); background: linear-gradient(180deg, rgba(42, 28, 66, .95), rgba(13, 20, 18, .95)); }
.adv-event.secret, .adv-event.k-secret { border-color: rgba(255, 242, 160, .75); background: linear-gradient(180deg, rgba(58, 52, 22, .95), rgba(13, 20, 18, .95)); box-shadow: 0 8px 22px rgba(0, 0, 0, .38), 0 0 18px rgba(255, 242, 160, .2); }
.adv-event.k-patrol { border-color: rgba(184, 200, 224, .6); background: linear-gradient(180deg, rgba(38, 50, 70, .95), rgba(12, 16, 22, .95)); }
.adv-event.k-shrine { border-color: rgba(224, 112, 90, .55); background: linear-gradient(180deg, rgba(66, 30, 24, .95), rgba(16, 14, 12, .95)); }
.adv-event.k-dig { border-color: rgba(111, 216, 192, .55); background: linear-gradient(180deg, rgba(18, 54, 48, .95), rgba(10, 18, 16, .95)); }
.ev-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.ev-face, .mc-face { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 12px; background: radial-gradient(circle at 50% 35%, var(--raise), var(--panel)); box-shadow: inset 0 0 0 2px rgba(227, 179, 65, .5); line-height: 0; overflow: hidden; }
.ev-face .em-fb, .mc-face .em-fb { font-size: 34px; line-height: 1; }
.ev-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1.5px rgba(199, 173, 255, .55); line-height: 0; }
.adv-event.secret .ev-icon { box-shadow: inset 0 0 0 1.5px rgba(255, 242, 160, .8), 0 0 14px rgba(255, 242, 160, .35); }
.adv-event.k-patrol .ev-icon { box-shadow: inset 0 0 0 1.5px rgba(184, 200, 224, .7); }
.adv-event.k-shrine .ev-icon { box-shadow: inset 0 0 0 1.5px rgba(224, 112, 90, .7); }
.adv-event.k-dig .ev-icon { box-shadow: inset 0 0 0 1.5px rgba(111, 216, 192, .7), 0 0 12px rgba(111, 216, 192, .35); }
.ev-icon .em-fb { font-size: 26px; line-height: 1; }
.ev-say { min-width: 0; }
.ev-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 2px; font-size: var(--fs-min); font-weight: 700; letter-spacing: .14em; color: #d7b8ff; }
.adv-event.secret .ev-kicker { color: #fff2a0; }
.adv-event.k-patrol .ev-kicker { color: #cddbee; }
.adv-event.k-shrine .ev-kicker { color: #ffc4b6; }
.adv-event.k-dig .ev-kicker { color: #aef0e0; }
.ev-who { letter-spacing: .02em; color: var(--brass-hi); font-size: calc(14px * var(--fs-k)); }
.ev-text { margin: 6px 0 0; font-size: calc(15px * var(--fs-k)); line-height: 1.75; color: var(--text); overflow-wrap: anywhere; white-space: pre-line; }
.ev-choices { display: grid; gap: 7px; margin-top: 12px; }
@container bt (min-width: 700px) { .ev-choices { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.ev-choice {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label votes" "need need";
  align-items: center; gap: 3px 8px; min-height: 52px; padding: 8px 12px 8px 14px; border-radius: 12px; text-align: left;
  border: 1.5px solid var(--line-2); background: var(--panel-2); color: var(--text); box-shadow: 0 3px 0 rgba(0, 0, 0, .38);
  transition: transform .1s, border-color .15s, background .15s; cursor: pointer;
}
.ev-choice:hover:not([disabled]) { border-color: rgba(199, 173, 255, .7); background: #283f37; }
.ev-choice:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .38); }
.ev-choice:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.ec-label { grid-area: label; font-family: var(--font-dot); font-size: calc(17px * var(--fs-k)); line-height: 1.35; overflow-wrap: anywhere; }
.ec-label::before { content: '▸'; margin-right: 6px; color: #b89cf0; }
.ev-choice.c-fight .ec-label::before { color: var(--ember); }
.ev-choice.c-sneak .ec-label::before { color: #9fb4cc; }
.ev-choice.c-pray .ec-label::before { color: #ffc4b6; }
.ev-choice.c-dig .ec-label::before { color: #6fd8c0; }
.ec-need { grid-area: need; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: var(--fs-min); line-height: 1.45; }
.ec-need.ok { color: var(--hp); }
.ec-need.ng { color: #ffb398; }
.ec-need.ec-hint { color: var(--muted); }
.fam { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-style: normal; font-weight: 700; font-size: var(--fs-min); line-height: 1; background: rgba(92, 200, 168, .18); box-shadow: inset 0 0 0 1px rgba(92, 200, 168, .55); color: var(--hp); }
.ec-need.ng .fam { background: rgba(240, 116, 74, .14); box-shadow: inset 0 0 0 1px rgba(240, 116, 74, .5); color: #ffb398; }
.ec-votes { grid-area: votes; display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; }
.ev-choice.has-need:not(.ng) { border-color: rgba(92, 200, 168, .45); }
.ev-choice.mine { border-color: var(--brass); background: rgba(227, 179, 65, .14); box-shadow: 0 0 0 3px rgba(227, 179, 65, .28), 0 3px 0 rgba(0, 0, 0, .38); }
.ev-choice.mine .ec-label::after { content: '　✓'; color: var(--brass-hi); font-family: var(--font-body); font-weight: 700; font-size: calc(14px * var(--fs-k)); }
.ev-choice[disabled] { cursor: not-allowed; opacity: .62; box-shadow: none; }
.ev-choice.ng { background: rgba(5, 12, 9, .45); border-style: dashed; }
.ev-choice.ng .ec-label { color: var(--muted); }

/* 行商人 */
.adv-merchant { border-color: rgba(169, 226, 124, .5); background: linear-gradient(180deg, rgba(30, 48, 24, .95), rgba(13, 20, 18, .95)); }
.mc-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.mc-face { box-shadow: inset 0 0 0 2px rgba(169, 226, 124, .55); }
.mc-say { min-width: 0; }
.mc-say .ev-kicker { color: #cdf1a8; }
.mc-name { font-size: calc(15px * var(--fs-k)); letter-spacing: .02em; color: var(--luck); }
.mc-line { position: relative; margin: 4px 0 0; padding: 8px 12px 9px; border-radius: 4px 14px 14px 14px; background: rgba(226, 238, 228, .08); border: 1px solid var(--line-2); font-size: calc(14px * var(--fs-k)); line-height: 1.65; overflow-wrap: anywhere; }
.mc-offers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.mc-offer { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; min-height: 52px; padding: 5px 6px; border-radius: 10px; background: rgba(5, 12, 9, .5); border: 1px solid var(--line); }
.mo-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: rgba(0, 0, 0, .32); font-size: 19px; line-height: 1; }
.mo-body { display: grid; min-width: 0; line-height: 1.35; }
.mo-body b { font-size: calc(14px * var(--fs-k)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-body small { font-size: var(--fs-min); color: var(--muted); }
.mo-price { font-family: var(--font-dot); font-size: calc(16px * var(--fs-k)); color: var(--brass-hi); white-space: nowrap; text-align: right; }
.mo-price small { font-size: var(--fs-min); margin-left: 1px; }
.mo-price.short { color: #ffb398; }
.mo-buy { min-width: 68px; min-height: 44px; }
.mo-buy.short { color: #ffc0a8; border-color: rgba(240, 116, 74, .5); background: rgba(240, 116, 74, .08); }
.mo-done { min-width: 68px; text-align: center; font-size: var(--fs-min); font-weight: 700; color: var(--hp); }
.mc-offer.bought { opacity: .62; }
.mc-offer.bought .mo-body b { text-decoration: line-through; text-decoration-color: rgba(226, 238, 228, .4); }
.mc-offer.map { border: 1.5px solid var(--brass); background: linear-gradient(100deg, rgba(227, 179, 65, .22), rgba(5, 12, 9, .5) 64%); box-shadow: 0 0 14px rgba(227, 179, 65, .18); }
.mc-offer.map .mo-ic { background: rgba(227, 179, 65, .18); box-shadow: inset 0 0 0 1px rgba(227, 179, 65, .6); }
.mc-offer.map .mo-body b { color: #ffe9a8; }
.mc-wallet { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 10px 0 0; font-size: var(--fs-min); color: var(--muted); }
.mc-wallet b { font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); color: var(--brass-hi); }
.mc-wallet small { flex-basis: 100%; font-size: var(--fs-min); color: var(--faint); }
@container bt (max-width: 380px) {
  .mc-offer { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "ic body body" "ic price buy"; }
  .mo-ic { grid-area: ic; width: 32px; height: 32px; }
  .mo-body { grid-area: body; }
  .mo-price { grid-area: price; text-align: left; }
  .mc-offer > .mo-buy, .mc-offer > .mo-done { grid-area: buy; }
}

/* 階の札：ぶきみなできごと（しずかに、ゆっくり出る）・手がかりを見つけた（手帳の紙の色） */
.fl-card { padding: 12px 48px 12px 14px; }
.fl-x {
  position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: inherit; opacity: .75; font-size: 16px; cursor: pointer;
}
.fl-x:hover, .fl-x:focus-visible { opacity: 1; background: rgba(0, 0, 0, .18); }
.fl-ic { display: inline-grid; place-items: center; margin-right: 6px; line-height: 0; vertical-align: -3px; }
.fl-ic .em-fb { font-size: 15px; line-height: 1; }
.fl-text { margin: 6px 0 0; font-size: calc(15px * var(--fs-k)); line-height: 1.8; overflow-wrap: anywhere; white-space: pre-line; }
.fl-title { margin-top: 4px; font-size: calc(18px * var(--fs-k)); }
.fl-open { margin-top: 10px; min-height: 44px; }
.fl-eerie { border-color: rgba(143, 127, 184, .45); background: linear-gradient(180deg, rgba(20, 16, 32, .94), rgba(6, 6, 12, .94)); color: #d8d2e8; box-shadow: 0 8px 26px rgba(0, 0, 0, .5), 0 0 22px rgba(90, 70, 140, .18); animation: flEerie 1.6s ease-out; }
.fl-eerie .ev-kicker { color: #a99cc8; letter-spacing: .2em; }
.fl-eerie .fl-text { color: #e4def2; letter-spacing: .04em; }
.fl-clue { border-color: #6a5236; background: linear-gradient(180deg, #f1e6c9, #e3d3ad); color: #33261a; box-shadow: 0 8px 22px rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 246, 220, .25) inset; animation: flClue .45s ease-out; }
.fl-clue .ev-kicker { color: #7a4e14; }
.fl-clue .fl-title { color: #4a2f12; }
.fl-clue .fl-text { color: #3a2c1c; }
.fl-clue .fl-x { color: #4a3420; }
.fl-who { margin: 6px 0 0; font-size: var(--fs-min); color: #6a5236; line-height: 1.5; }
.fl-clue .fl-open { background: #6a5236; border-color: #6a5236; color: #fff6e0; }
/* 戦いのあいだ・宝の部屋の、1行の小さな札 */
.fl-card.mini { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 2px 2px 2px 12px; border-radius: 12px; }
.fl-card.mini .fl-ic { margin: 0; flex: none; }
.fl-line { flex: 1 1 auto; min-width: 0; font-size: var(--fs-min); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-line b { margin-right: 4px; }
.fl-card.mini .fl-open { flex: none; margin: 0; min-height: 44px; padding: 0 12px; }
.fl-card.mini .fl-x { position: static; flex: none; }
@keyframes flEerie { from { opacity: 0; filter: blur(3px); } 60% { opacity: .8; filter: blur(.5px); } to { opacity: 1; filter: none; } }
@keyframes flClue { from { opacity: 0; transform: translateY(-8px) rotate(-.6deg); } to { opacity: 1; transform: none; } }

/* 下の欄：道を選ぶ・出来事のあいだのようす */
.adv-dock { min-height: 96px; }
.adv-dock .vote-cd { justify-content: center; }
.b-state.watch > b { color: #bfe3ff; }

/* ---- けんがく：上の帯（パーティーの名前と「けんがくをやめる」）。見ている人は話せない ---- */
.b-watchbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px 6px 10px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(111, 168, 245, .2), rgba(111, 168, 245, .06)); border: 1.5px solid rgba(111, 168, 245, .5);
}
@container bt (min-width: 700px) {
  .b-panel:has(> .b-watchbar:not([hidden])) { grid-template-areas: "watch watch" "left cmds" "foot foot"; }
  .b-watchbar { grid-area: watch; }
}
.bw-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #6fa8f5; color: #0b1a30; font-weight: 700; font-size: var(--fs-min); white-space: nowrap; }
.bw-name { flex: 1 1 160px; min-width: 0; display: grid; line-height: 1.35; }
.bw-name b { font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-name small { color: var(--muted); font-size: var(--fs-min); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-watchbar .btn { min-height: 44px; }
body.quest-watching .q-say, body.quest-watching .b-logsheet .q-say { display: none; }
body.quest-watching .b-stage { border-color: rgba(111, 168, 245, .45); }

/* ---- 集合（0階）：しゅっぱつ。出発前の準備とオートのボタンも 44px 以上 ---- */
.lobby-go { width: 100%; min-height: 56px; white-space: normal; line-height: 1.35; }
.lobby-solo { margin: -6px 0 0; text-align: center; }
.lobby-comp { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.lobby-comp b { color: var(--brass-hi); }
.lobby-comp .lc-face { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(5, 12, 9, .45); line-height: 0; }
.lobby-comp .btn { min-height: 44px; margin-left: auto; }
.quest.lobby .prep-btn, .quest.lobby .auto-toggle { min-height: 44px; }
.quest.lobby .auto-seg span { min-height: 44px; }

/* ---- 酒場の「冒険のパーティー」（#adv-bar） ---- */
.ab-wrap { display: grid; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid rgba(227, 179, 65, .35); background: linear-gradient(180deg, rgba(227, 179, 65, .08), rgba(5, 12, 9, .3) 60%); min-width: 0; }
.ab-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ab-title { flex: 1 1 auto; margin: 0; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); color: var(--brass-hi); }
.ab-make { min-height: 48px; }
.ab-why { margin: 0; }
.ab-sec { display: grid; gap: 6px; min-width: 0; }
.ab-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-size: var(--fs-min); color: var(--muted); font-weight: 700; }
.ab-sub .num { color: var(--brass-hi); }
.ab-subhint { font-weight: 400; color: var(--faint); }
.ab-empty { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px dashed var(--line-2); color: var(--faint); font-size: var(--fs-min); line-height: 1.6; }
.ab-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ab-party { display: grid; gap: 6px; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: rgba(10, 19, 16, .72); }
.ab-party.lobby { border-color: rgba(92, 200, 168, .5); }
.ab-party.going { border-style: dashed; }
.ab-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.ab-name { flex: 1 1 auto; min-width: 0; font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-dest { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: var(--fs-min); line-height: 1.5; }
.ab-dest b { color: var(--text); }
.ab-dest .q-region { margin-left: 0; }
.ab-kind { padding: 0 8px; border-radius: 6px; background: rgba(226, 238, 228, .1); color: var(--muted); font-weight: 700; }
.ab-kind.k-dungeon { background: rgba(169, 176, 214, .18); color: #cdd2ee; }
.ab-kind.k-manor { background: rgba(199, 173, 255, .18); color: #e2d6ff; }
.ab-speed { color: var(--faint); }
.ab-mem { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ab-mem li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ab-mem li > .avatar { flex: none; }
.ab-mem li > span:not(.chip):not(.avatar) { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; line-height: 1.35; }
.ab-mem b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-mem small { color: var(--muted); font-size: var(--fs-min); }
.ab-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ab-btns:empty { display: none; }
.ab-btns .btn { min-height: 44px; min-width: 104px; }

/* ---- ワールドボスの札：冒険の受付からの「戦いに向かう」の下の一言（social.js の wbossCardHtml） ---- */
.wb-card .wbc-hint { display: block; margin-top: 4px; font-size: var(--fs-min); color: var(--faint); line-height: 1.5; }
.tower-card .tc-make { margin-top: 8px; min-height: 48px; }

/* ---- 「冒険をつくる」（スマホは下から出るシート） ---- */
.modal.adv-make-modal { width: min(720px, 100%); }
.adv-make { display: grid; gap: 14px; min-width: 0; }
/* 見出し（✕）と行き先の種類のタブ：シートの中をスクロールしても上に止まる（開いたとき、選んでいるステージまでスクロールしても見える）。第8弾 QA
   .modal の上のすき間（18px）と左右（16px）までおおう */
.am-top { position: sticky; top: -18px; z-index: 3; display: grid; gap: 10px; margin: -18px -16px 0; padding: 18px 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.am-head { display: flex; align-items: center; gap: 8px; }
.am-head h2 { flex: 1; margin: 0; }
.am-kinds { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(5, 12, 9, .45); }
.am-kind { flex: 1 1 0; min-height: 44px; padding: 4px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.am-kind.on { background: var(--brass); color: var(--brass-ink); box-shadow: 0 2px 0 var(--brass-deep); }
.am-kind:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.am-pick { min-width: 0; }
.am-stages, .am-dungeons { display: grid; gap: 10px; min-width: 0; }
.am-world { display: grid; gap: 8px; min-width: 0; }
.am-wname { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); color: var(--muted); }
.am-teaser { margin: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px dashed rgba(199, 150, 255, .4); color: #d7b8ff; font-size: var(--fs-min); line-height: 1.6; }
.am-teaser.am-maps { border-color: rgba(227, 179, 65, .45); color: var(--brass-hi); }
.am-hidden .stage-pick label > span { border-color: rgba(227, 179, 65, .5); background: linear-gradient(100deg, rgba(227, 179, 65, .14), rgba(5, 12, 9, .35) 70%); }
.am-hidden .stage-pick input:checked + span { border-color: var(--brass); background: rgba(227, 179, 65, .26); color: var(--brass-hi); }
details.am-region > summary { list-style: none; cursor: pointer; min-height: 40px; }
details.am-region > summary::-webkit-details-marker { display: none; }
details.am-region > summary::after { content: '▾'; margin-left: 4px; color: var(--faint); transition: transform .15s; }
details.am-region:not([open]) > summary::after { transform: rotate(-90deg); }
details.am-region[open] > summary { margin-bottom: 8px; }
details.am-region > summary:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 8px; }
.am-region.w-ura { border-color: rgba(199, 150, 255, .3); }
.am-region.w-core { border-color: rgba(255, 90, 90, .3); }
.am-region .stage-pick label > span { min-height: 52px; align-content: center; }
.st-tile b { min-width: 0; overflow-wrap: anywhere; }
.st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-left: auto; font-size: var(--fs-min); }
.st-meta:empty { display: none; }
.stage-pick .st-meta .st-clear, .stage-pick .st-meta .st-next { margin-left: 0; }
.st-rec { color: var(--faint); white-space: nowrap; }
.st-rec.hard { color: #ffb398; font-weight: 700; }
.st-why { flex-basis: 100%; color: var(--faint); font-size: var(--fs-min); line-height: 1.45; }
.st-tile.won > span { border-color: rgba(92, 200, 168, .35); }
.dg-pick { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.dg-tile { position: relative; display: block; min-width: 0; }
.dg-tile input { position: absolute; opacity: 0; pointer-events: none; }
.dg-tile > span { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 10px 6px 6px; border-radius: var(--r-btn); border: 1.5px solid var(--line-2); background: rgba(5, 12, 9, .35); cursor: pointer; }
.dg-tile input:checked + span { border-color: var(--brass); background: rgba(227, 179, 65, .14); }
.dg-tile input:focus-visible + span { outline: 3px solid var(--brass); outline-offset: 2px; }
.dg-tile.locked > span { cursor: default; border-style: dashed; background: transparent; color: var(--faint); }
.dg-art { flex: none; width: 64px; height: 48px; border-radius: 8px; background-color: #1b2a24; background-size: auto 48px; background-position: center bottom; background-repeat: repeat-x; image-rendering: pixelated; box-shadow: inset 0 0 0 1px rgba(226, 238, 228, .14); }
.dg-tile.locked .dg-art { filter: grayscale(.8) brightness(.6); }
.dg-body { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; line-height: 1.4; }
.dg-body b { font-family: var(--font-dot); font-weight: 400; font-size: calc(16px * var(--fs-k)); overflow-wrap: anywhere; }
.dg-body small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; color: var(--muted); font-size: var(--fs-min); }
.am-manor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 12px; border: 1.5px solid rgba(199, 173, 255, .45); background: linear-gradient(180deg, rgba(42, 28, 66, .6), rgba(5, 12, 9, .4)); }
.am-manor.locked { border-style: dashed; }
.am-manor-art { display: block; height: 96px; border-radius: 10px; background-color: #1b1626; background-size: auto 96px; background-position: center bottom; background-repeat: repeat-x; image-rendering: pixelated; }
.am-manor.locked .am-manor-art { filter: grayscale(.7) brightness(.55); }
.am-manor-body h3 { margin: 0; font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); color: #e2d6ff; }
.am-manor-body p { margin: 6px 0 0; line-height: 1.7; }
.am-go { position: sticky; bottom: calc(-12px - var(--safe-b)); z-index: 2; margin: 0 -4px; padding: 8px 4px calc(4px + var(--safe-b)); background: linear-gradient(180deg, transparent, var(--panel) 30%); }
.am-go .btn { min-height: 52px; white-space: normal; line-height: 1.35; }

/* ---- ひいらぎ館の部屋の冒険（room.js の部屋の枠に .manor-room） ---- */
/* .quest は grid（列は中身の幅）なので、長い説明の1行で画面より広がらないように1列に */
.quest.manor { display: block; min-width: 0; max-width: 100%; }
.room.manor-room .rm-scene .rm-tint { background: linear-gradient(180deg, rgba(24, 18, 48, .44), rgba(8, 6, 18, .3)); mix-blend-mode: multiply; }
.room.manor-room.lit .rm-scene .rm-tint { background: radial-gradient(70% 90% at 50% 30%, rgba(255, 196, 110, .22), rgba(60, 30, 10, .1)); mix-blend-mode: normal; }
.room.manor-room .rm-title b { color: #e2d6ff; }
.mn-memo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 8px; color: #e2d6ff; font-size: var(--fs-min); }
.mn-memo b { font-family: var(--font-dot); font-weight: 400; font-size: calc(18px * var(--fs-k)); color: #fff2c8; }
.mn-memo small { flex-basis: 100%; color: var(--muted); font-size: var(--fs-min); }
.mn-map { display: flex; flex-wrap: wrap; gap: 6px; }
.mn-room { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(5, 12, 9, .4); color: var(--muted); font-size: var(--fs-min); }
.mn-room.here { border-color: #c7adff; background: rgba(199, 173, 255, .16); color: #efe6ff; font-weight: 700; }
.mn-room.locked { border-style: dashed; color: var(--faint); }
.mn-here { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #c7adff; color: #1d1238; font-size: var(--fs-min); }
.mn-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid rgba(111, 168, 245, .5); background: rgba(111, 168, 245, .1); }
.mn-watch b { color: #bfe3ff; }
.mn-watch small { flex: 1 1 160px; color: var(--muted); font-size: var(--fs-min); }
.mn-watch .btn { min-height: 44px; }
/* 部屋の枠がまだ無いときの、かんたんな館の画面 */
.mn-frame { display: grid; gap: 10px; }
.mn-scene { position: relative; height: 192px; border-radius: 14px; background-color: #1b1626; background-size: auto 192px; background-position: center bottom; background-repeat: repeat-x; image-rendering: pixelated; }
.mn-host { position: absolute; right: 16px; bottom: 12px; line-height: 0; }
.mn-title { margin: 0; font-family: var(--font-dot); font-weight: 400; color: #e2d6ff; }
.mn-desc { margin: 0; color: var(--muted); }
.mn-people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mn-people li { display: inline-flex; align-items: center; gap: 4px; }
.mn-log { list-style: none; margin: 0; padding: 10px 12px; max-height: 240px; overflow-y: auto; border-radius: 12px; background: rgba(5, 12, 9, .5); border: 1px solid var(--line); font-size: var(--fs-min); line-height: 1.7; }
.mn-log .k-amb { color: #c9bfe6; }
.mn-log .k-sys { color: var(--muted); }
.mn-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.mn-btns .btn { min-height: 48px; }

/* ---- 集合の欄（第8弾 QA：集合は酒場〔試練の塔は冒険の受付〕の部屋の中。部屋の部品：ui/lobby.js） ----
   見出し（名前・人数・行き先・しゅっぱつ・ぬける）は、部品の中をスクロールしても上に止まる */
.lb-wrap { display: grid; gap: 8px; min-width: 0; padding: 0 10px 10px; border-radius: 14px; border: 1.5px solid rgba(92, 200, 168, .55); background: linear-gradient(180deg, rgba(92, 200, 168, .1), rgba(5, 12, 9, .3) 70%); }
.lb-wrap.k-manor { border-color: rgba(199, 173, 255, .55); }
.lb-wrap.k-dungeon { border-color: rgba(169, 176, 214, .55); }
.lb-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px 10px; margin: 0 -10px; padding: 8px 10px;
  border-radius: 12px 12px 0 0; background: rgba(16, 33, 28, .97); border-bottom: 1px solid rgba(92, 200, 168, .3);
}
.lb-title { flex: 1 1 auto; min-width: 0; display: grid; line-height: 1.35; }
.lb-title b { font-family: var(--font-dot); font-weight: 400; font-size: calc(17px * var(--fs-k)); color: #c4f3e1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta { color: var(--muted); font-size: var(--fs-min); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta .num { color: var(--brass-hi); font-weight: 700; }
.lb-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.lb-go { min-height: 48px; padding: 0 14px; white-space: nowrap; }
.lb-to { margin-left: 4px; font-size: var(--fs-min); }
.lb-leave { min-height: 48px; padding: 0 12px; }
.lb-wait { margin: 0; color: var(--muted); font-size: var(--fs-min); line-height: 1.5; }
.lb-dest { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin: 0; font-size: var(--fs-min); line-height: 1.5; }
.lb-dest .lb-k { padding: 0 8px; border-radius: 6px; background: rgba(226, 238, 228, .1); color: var(--muted); font-weight: 700; }
.lb-dest small { color: var(--faint); }
.lb-dest .q-region { margin-left: 0; }
.lb-hint { margin: 0; color: var(--faint); font-size: var(--fs-min); line-height: 1.55; }
.lb-wrap .lobby-members li { padding: 6px 8px; }
.lb-wrap .prep { padding: 10px; }
.lb-wrap .prep-btn, .lb-wrap .auto-toggle, .lb-wrap .auto-seg span { min-height: 44px; }
.lb-wrap .lobby-comp .btn { min-height: 44px; }
@media (max-width: 899px) {
  .lb-wrap { gap: 6px; padding: 0 8px 8px; }
  .lb-head { margin: 0 -8px; padding: 6px 8px; }
  .lb-to { display: none; } /* スマホ：「しゅっぱつ ▶」だけ（行き先は見出しの1行にある） */
  .lb-go { padding: 0 12px; }
  /* 酒場の「冒険のパーティー」：部品の中で読みやすく小さく（1枚を低く） */
  .room .ab-wrap { gap: 6px; padding: 8px; }
  .room .ab-title { font-size: calc(16px * var(--fs-k)); }
  .room .ab-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  /* 1枚：名前の行・行き先の行・仲間（左）と さんか（右） */
  .room .ab-party { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 6px 8px; }
  .room .ab-top, .room .ab-dest { grid-column: 1 / -1; }
  .room .ab-mem { grid-column: 1; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 2px 8px; }
  .room .ab-mem small { display: none; }
  .room .ab-mem .chip { display: none; }
  .room .ab-btns { grid-column: 2; align-self: end; }
  .room .ab-btns .btn { min-width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  .fork-card.t-secret { animation: none; }
  .fl-eerie, .fl-clue { animation: none; }
}
