/* かさま栗・タクティクス — スタイル
 * FFT 風：羊皮紙色のウィンドウ + 濃紺の背景 + ドット調
 */

:root {
  --ink:        #2b1d10;
  --parch-1:    #f3e2bc;
  --parch-2:    #e2c98f;
  --parch-3:    #c9a962;
  --frame-1:    #6b4a1e;
  --frame-2:    #3a2610;
  --gold:       #f0c040;
  --gold-dk:    #a87818;
  --navy-1:     #101a2e;
  --navy-2:     #1c2c4a;
  --navy-3:     #2a3f66;
  --hp:         #4cd964;
  --hp-dk:      #1f7a34;
  --mp:         #4aa8f0;
  --mp-dk:      #1c5e94;
  --dmg:        #ff5544;
  --enemy:      #c94a3a;
  --ally:       #4a8ec9;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #06090f;
  color: var(--parch-1);
  font-family: "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", monospace;
  -webkit-font-smoothing: none;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, #1c2c4a 0%, #101a2e 45%, #06090f 100%);
}

.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; align-items: center; justify-content: center; }

/* ---------- 汎用ウィンドウ ---------- */
.panel {
  position: relative;
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 24px 22px;
  background: linear-gradient(180deg, var(--parch-1) 0%, var(--parch-2) 100%);
  color: var(--ink);
  border: 3px solid var(--frame-2);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px var(--frame-1),
    inset 0 0 0 4px var(--parch-3),
    0 10px 40px rgba(0,0,0,.7);
}
.panel-wide { width: min(920px, 96vw); }

.panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: .12em;
  color: var(--frame-2);
  border-bottom: 2px solid var(--parch-3);
  padding-bottom: 8px;
}
.panel h3 {
  margin: 14px 0 6px;
  font-size: 15px;
  color: var(--frame-1);
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-block;
  margin: 6px 6px 0 0;
  padding: 9px 20px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--parch-1);
  background: linear-gradient(180deg, var(--navy-3) 0%, var(--navy-1) 100%);
  border: 2px solid var(--frame-2);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #52709e, 0 2px 0 #000;
  cursor: pointer;
  transition: transform .06s, filter .12s;
}
.btn:hover { filter: brightness(1.25); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px #52709e; }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
.btn-main {
  display: block;
  width: 260px;
  margin: 10px auto;
  padding: 12px 20px;
  font-size: 16px;
}
.btn-sub { opacity: .8; font-size: 13px; padding: 7px 14px; }

/* ---------- タイトル ---------- */
#screen-title { position: relative; overflow: hidden; }
.title-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 120%, #6b4a1e 0%, transparent 55%),
    radial-gradient(ellipse at 50% -10%, #3a5a8a 0%, transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #16233c 55%, #241a10 100%);
}
.title-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.title-inner { position: relative; text-align: center; z-index: 1; }
.title-art {
  display: block;
  margin: 0 auto 6px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.65));
  max-width: 88vw;
  height: auto;
}
.game-title {
  margin: 0;
  font-size: clamp(30px, 5.6vw, 56px);
  letter-spacing: .12em;
  color: var(--gold);
  text-shadow:
    0 0 2px #fff6c0,
    2px 2px 0 var(--frame-2),
    4px 4px 0 #000,
    0 0 24px rgba(240,192,64,.45);
}
.game-subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  letter-spacing: .42em;
  color: var(--parch-2);
}
.game-ver {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: .28em;
  color: #9fb4d4;
  text-shadow: 1px 1px 0 #000;
}
.game-tag {
  margin: 14px 0 26px;
  font-size: 15px;
  letter-spacing: .2em;
  color: #d8b878;
}
.title-menu { margin-top: 10px; }
.credit { margin-top: 26px; font-size: 12px; color: #7f8ea8; letter-spacing: .1em; }

/* ---------- あそびかた ---------- */
.help-body { font-size: 13.5px; line-height: 1.85; }
.help-body p { margin: 4px 0; }
.help-table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.help-table td { border: 1px solid var(--parch-3); padding: 4px 10px; }
.help-table td:first-child { font-weight: bold; width: 84px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #0006; }
.t-soil     { background: #b08b4f; }
.t-forest   { background: #2f6b34; }
.t-mountain { background: #7d7468; }
.t-river    { background: #2f6ba8; }

/* ---------- ステージ選択 ---------- */
.gold-line { margin: 0 0 10px; font-size: 14px; }
.gold-num { color: var(--gold-dk); font-weight: bold; font-size: 19px; }

.stage-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}
.stage-card {
  position: relative;
  padding: 9px 11px;
  background: linear-gradient(180deg, #fff6dd, #ecd9ab);
  border: 2px solid var(--frame-1);
  border-radius: 3px;
  cursor: pointer;
  transition: transform .08s, filter .1s;
}
.stage-card:hover { transform: translateY(-2px); filter: brightness(1.06); }
.stage-card.locked { filter: grayscale(1) brightness(.72); cursor: not-allowed; }
.stage-card.cleared { border-color: var(--gold-dk); }
.stage-card.cleared::after {
  content: "クリア";
  position: absolute; top: 6px; right: 6px;
  font-size: 10px; padding: 1px 6px;
  background: var(--gold-dk); color: #fff; border-radius: 2px;
}
.sc-no { font-size: 10px; letter-spacing: .18em; color: #8a6a34; }
.sc-name { font-size: 17px; font-weight: bold; color: var(--frame-2); }
.sc-read { font-size: 11px; color: #7a5c30; }
.sc-sub { font-size: 11px; color: #6b533a; margin-top: 3px; }
.sc-meta { margin-top: 5px; font-size: 11px; color: #5d4a30; }
.row-btns { margin-top: 14px; }

/* ---------- なかま ---------- */
.party-list { display: flex; flex-wrap: wrap; gap: 10px; }
.party-card {
  flex: 1 1 240px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff6dd, #ecd9ab);
  border: 2px solid var(--frame-1);
  border-radius: 3px;
  display: flex; gap: 10px;
}
.party-card canvas { image-rendering: pixelated; align-self: flex-start; }
.pc-name { font-size: 16px; font-weight: bold; color: var(--frame-2); }
.pc-job { font-size: 11px; color: #7a5c30; }
.pc-stats { margin-top: 5px; font-size: 11.5px; line-height: 1.6; color: #4a3a24; }
.pc-stats b { color: var(--frame-2); }

/* ---------- ショップ ---------- */
.shop-lead { margin: 0 0 8px; font-size: 13px; color: #6b533a; }
.shop-cols { display: flex; gap: 14px; }
.shop-col { flex: 1; min-width: 0; }
.shop-list, .bag-list { max-height: 46vh; overflow-y: auto; }
.shop-item, .bag-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; margin-bottom: 5px;
  background: #fff6dd;
  border: 1px solid var(--parch-3);
  border-radius: 2px;
  font-size: 12.5px;
}
.shop-item .si-name, .bag-item .si-name {
  flex: 1 1 auto;
  min-width: 8.5em;          /* アイコンを 足しても 名前が たてがきに ならないように */
  font-weight: bold; color: var(--frame-2);
}
.item-icon { flex: 0 0 auto; image-rendering: pixelated; width: 20px; height: 20px; }
.shop-item { flex-wrap: wrap; }
.shop-item .si-price { flex: 0 0 auto; min-width: 3.4em; text-align: right; }
.shop-item .si-buy { flex: 0 0 auto; }
.si-price { color: var(--gold-dk); font-weight: bold; }
.si-desc { flex-basis: 100%; font-size: 11px; color: #6b533a; }
.si-buy {
  padding: 3px 10px; font-size: 11px; font-family: inherit;
  background: var(--navy-3); color: var(--parch-1);
  border: 1px solid var(--frame-2); border-radius: 2px; cursor: pointer;
}
.si-buy:disabled { filter: grayscale(1) brightness(.7); cursor: not-allowed; }
.si-count { color: var(--frame-1); }
.empty-note { font-size: 12px; color: #8a7050; padding: 8px 2px; }

/* ---------- ステージ導入 ---------- */
#screen-intro { background: radial-gradient(ellipse at 50% 40%, #22304e 0%, #080c14 75%); }
.intro-inner { text-align: center; max-width: 620px; padding: 20px; }
.intro-no { font-size: 12px; letter-spacing: .4em; color: #8fa6c8; }
.intro-name {
  margin: 4px 0 2px; font-size: 46px; letter-spacing: .16em; color: var(--gold);
  text-shadow: 2px 2px 0 var(--frame-2), 4px 4px 0 #000;
}
.intro-sub { margin: 0 0 18px; font-size: 13px; letter-spacing: .24em; color: #c2ad83; }
.intro-text {
  font-size: 14.5px; line-height: 2.1; color: var(--parch-1);
  border-top: 1px solid #3d5a86; border-bottom: 1px solid #3d5a86;
  padding: 16px 6px; margin-bottom: 14px;
  text-align: left;
}
.intro-enemy { font-size: 12.5px; color: #d8a898; margin-bottom: 18px; line-height: 1.8; }

/* ---------- バトル ---------- */
#screen-battle { align-items: center; justify-content: center; }
.battle-wrap {
  position: relative;
  width: 940px;
  height: 640px;
  max-width: 100vw;
  max-height: 100vh;
  transform-origin: center center;
}
#map-canvas {
  display: block;
  cursor: crosshair;
  width: 940px;
  height: 640px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a0f1a;
}

.hud {
  position: absolute;
  color: var(--parch-1);
  font-size: 12px;
  background: linear-gradient(180deg, rgba(20,32,56,.94) 0%, rgba(10,16,30,.96) 100%);
  border: 2px solid var(--frame-2);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #47638f, 0 3px 10px rgba(0,0,0,.6);
  padding: 6px 9px;
  user-select: none;
}

/* 時計 */
.hud-clock { top: 8px; left: 8px; width: 132px; text-align: center; }
.clock-day { font-size: 10px; letter-spacing: .18em; color: #9fb4d4; }
.clock-time {
  font-size: 27px; font-weight: bold; letter-spacing: .06em; color: var(--gold);
  text-shadow: 1px 1px 0 #000; line-height: 1.15;
}
.clock-meta { font-size: 10px; color: #b9c9e0; }
.clock-bar {
  margin-top: 4px; height: 5px; background: #0b1220;
  border: 1px solid #34496b; border-radius: 2px; overflow: hidden;
}
.clock-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffd76a, #ff9a3c);
  transition: width .25s;
}
.hud-clock.is-dusk .clock-time { color: #ff9a5a; }
.hud-clock.is-night .clock-time { color: #8fb0ff; }

/* ステージ情報 */
.hud-stage { top: 8px; right: 8px; width: 178px; }
.hud-stage-no { font-size: 9.5px; letter-spacing: .28em; color: #9fb4d4; }
.hud-stage-name { font-size: 18px; font-weight: bold; color: var(--gold); text-shadow: 1px 1px 0 #000; }
.boss-line { margin-top: 5px; }
.boss-label { font-size: 11px; color: #ffb0a0; }
.minibar {
  height: 7px; margin-top: 2px;
  background: #0b1220; border: 1px solid #34496b; border-radius: 2px; overflow: hidden;
}
.minibar-fill { height: 100%; width: 100%; transition: width .3s; }
.minibar-fill.boss { background: linear-gradient(90deg, #ff6a5a, #a02818); }
.hud-count { margin-top: 4px; font-size: 10.5px; color: #b9c9e0; }

/* ターンバナー */
.turn-banner {
  position: absolute; top: 50%; left: 0; right: 0;
  transform: translateY(-50%);
  text-align: center;
  font-size: 38px; font-weight: bold; letter-spacing: .22em;
  text-shadow: 3px 3px 0 #000, 0 0 24px rgba(0,0,0,.9);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.turn-banner.show { opacity: 1; }
.turn-banner.ally { color: #8fd0ff; }
.turn-banner.enemy { color: #ff8a7a; }

/* 味方リスト */
.hud-party { top: 126px; right: 8px; width: 178px; padding: 5px 6px; }
.pu {
  padding: 4px 5px; margin-bottom: 4px;
  background: rgba(40,60,96,.55);
  border: 1px solid #3a557f; border-radius: 2px;
  cursor: pointer;
}
.pu:last-child { margin-bottom: 0; }
.pu.sel { background: rgba(80,120,190,.7); border-color: var(--gold); }
.pu.acted { filter: grayscale(.7) brightness(.65); }
.pu.dead { filter: grayscale(1) brightness(.45); }
.pu-top { display: flex; justify-content: space-between; align-items: baseline; }
.pu-name { font-size: 11.5px; font-weight: bold; }
.pu-lv { font-size: 9px; color: #b9c9e0; }
.bar { height: 5px; margin-top: 2px; background: #0b1220; border: 1px solid #2b3d5c; border-radius: 1px; overflow: hidden; }
.bar > i { display: block; height: 100%; transition: width .25s; }
.bar.hp > i { background: linear-gradient(90deg, var(--hp), var(--hp-dk)); }
.bar.mp > i { background: linear-gradient(90deg, var(--mp), var(--mp-dk)); }
.pu-num { font-size: 9px; color: #cddaf0; text-align: right; }

/* 詳細 */
.hud-detail { bottom: 8px; left: 8px; width: 224px; display: none; }
.hud-detail.show { display: block; }
.hd-head { display: flex; gap: 8px; align-items: center; }
.hd-head canvas { image-rendering: pixelated; }
.hd-name { font-size: 15px; font-weight: bold; color: var(--gold); }
.hd-name.enemy { color: #ff9a8a; }
.hd-job { font-size: 10px; color: #b9c9e0; }
.hd-stats { margin-top: 5px; font-size: 10.5px; line-height: 1.55; color: #cddaf0; }
.hd-stats b { color: #fff; }
.hd-desc { margin-top: 4px; font-size: 10px; line-height: 1.5; color: #9fb4d4; border-top: 1px solid #2b3d5c; padding-top: 4px; }
.hd-terrain { margin-top: 3px; font-size: 10px; color: #9fd4a4; }

/* コマンド */
/* まほう一覧は 下端そろえで **上へ 伸びる**ので、`max-height` を つけても
   なかまHUD（.hud-party）に かぶるのは 止まらない（画面が 高いほど 重なる）。
   そこで **なかまHUD の 下端を 起点**に して 下へ 伸ばす。これで 構造的に かぶらない。
   （なかまHUD は top:126px ＋ 3人ぶんで 約240px。余裕を みて top:374px） */
.hud-cmd {
  top: 374px; bottom: 8px; right: 8px; width: 178px; padding: 5px; display: none;
  overflow-y: auto;
  /* 下に まだ 項目が ある ことを 示す ぼかし */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent 100%);
}
/* 全部 入りきって いる ときは ぼかさない */
.hud-cmd.nofade {
  -webkit-mask-image: none;
  mask-image: none;
}
/* あふれている ことを 示す 下向きの しるし */
.hud-cmd.more::after {
  content: '▼';
  position: sticky; bottom: -2px; left: 0;
  display: block; width: 100%;
  text-align: center; font-size: 10px; line-height: 12px;
  color: #ffd23c; text-shadow: 0 0 4px #000, 0 0 8px #000;
  pointer-events: none;
}
.hud-cmd.show { display: block; }
.cmd-title {
  font-size: 10px; letter-spacing: .18em; color: #9fb4d4;
  padding: 2px 4px 4px; border-bottom: 1px solid #2b3d5c; margin-bottom: 4px;
}
.cmd {
  display: block; width: 100%; text-align: left;
  padding: 6px 9px; margin-bottom: 3px;
  font-family: inherit; font-size: 13px;
  color: var(--parch-1);
  background: linear-gradient(180deg, rgba(56,82,128,.85), rgba(28,44,74,.9));
  border: 1px solid #47638f; border-radius: 2px;
  cursor: pointer;
}
.cmd:hover { background: linear-gradient(180deg, #5b82c8, #35547f); }
.cmd:disabled { filter: grayscale(1) brightness(.55); cursor: not-allowed; }
.cmd { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
/* コスト欄は nowrap なので、放っておくと 幅を 先取りして
   ラベル側が 「たた／く」のように **語中で 折り返す**。
   ラベルを nowrap に し、はみ出すのは コスト側に させる。 */
.cmd .cmd-label { flex: 1 1 auto; text-align: left; white-space: nowrap; }

.cmd .cmd-key {
  flex: 0 0 auto;
  display: inline-block;
  min-width: 15px;
  margin-right: 6px;
  padding: 1px 0;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
  color: #cddaf0;
  background: rgba(10, 16, 30, .75);
  border: 1px solid #47638f;
  border-radius: 2px;
}
.cmd:disabled .cmd-key { color: #8a94a8; border-color: #3a4560; }

.cmd .cmd-cost {
  flex: 0 1 auto;
  font-size: 9.5px; color: #8fd0ff; opacity: .95;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmd:disabled .cmd-cost { color: #c8a0a0; }
.cmd.back { background: linear-gradient(180deg, rgba(90,70,60,.85), rgba(50,38,32,.9)); border-color: #7a6250; }

/* しょうかんカットインの あいだ。
   カットインは canvas にしか 描けないので、DOM の HUD が 明るいままだと
   暗転が canvas の 中で 止まって しまい 演出が 締まらない。 */
#screen-battle.cutin .hud { opacity: .18; transition: opacity .18s linear; }
#screen-battle.cutin .hud-log { opacity: .18; }
#screen-battle .hud { transition: opacity .22s linear; }

/* しょうかんまほう: 見わけが つくよう 朱と 金で */
.cmd.summon {
  background: linear-gradient(180deg, rgba(126,58,52,.9), rgba(70,28,30,.92));
  border-color: #b0704a;
}
.cmd.summon:hover { background: linear-gradient(180deg, #a4544a, #6d3230); }
.cmd.summon .cmd-label { color: #ffdca0; }
.cmd.summon .cmd-cost { color: #ffc46a; }
.cmd .cmd-icon { flex: 0 0 auto; width: 16px; height: 16px; margin-right: 4px; image-rendering: pixelated; }
/* 味方を まきこむ まほうの 注意書き。ボタンの 下に 1行 折りかえして 出す */
.cmd { flex-wrap: wrap; }
.cmd .cmd-note {
  flex: 1 0 100%;
  margin-top: 2px;
  font-size: 9px; line-height: 1.2;
  color: #ffb27a;
}
.cmd:disabled .cmd-note { color: #b09080; }

/* ログ */
.hud-log {
  bottom: 8px; left: 44%; transform: translateX(-50%);
  width: 380px; min-height: 46px; max-height: 92px; overflow: hidden;
  font-size: 12.5px; line-height: 1.65;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hud-log div { opacity: .55; }
.hud-log div:last-child { opacity: 1; color: #fff3cf; }

/* ツール */
.hud-tools { top: 8px; left: 148px; background: none; border: none; box-shadow: none; padding: 0; }
.tool-btn {
  display: block; margin-bottom: 4px; padding: 5px 10px;
  font-family: inherit; font-size: 11px;
  color: var(--parch-1);
  background: linear-gradient(180deg, rgba(20,32,56,.94), rgba(10,16,30,.96));
  border: 2px solid var(--frame-2); border-radius: 3px;
  box-shadow: inset 0 0 0 1px #47638f;
  cursor: pointer;
}
.tool-btn:hover { filter: brightness(1.3); }
.tool-btn:disabled { filter: grayscale(1) brightness(.55); cursor: not-allowed; }

.zoom-bar {
  display: flex; align-items: center; gap: 3px;
  margin-top: 6px;
}
.zoom-bar .zoom-btn {
  margin-bottom: 0;
  padding: 4px 7px;
  font-size: 12px;
  line-height: 1;
}
.zoom-label {
  min-width: 40px;
  padding: 4px 2px;
  font-size: 10.5px;
  text-align: center;
  color: #cddaf0;
  background: linear-gradient(180deg, rgba(20,32,56,.94), rgba(10,16,30,.96));
  border: 2px solid var(--frame-2);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #47638f;
}

/* ダメージポップ */
.pop-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pop {
  position: absolute;
  font-size: 22px; font-weight: bold;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 8px rgba(0,0,0,.9);
  animation: popup 1s ease-out forwards;
  white-space: nowrap;
}
.pop.dmg  { color: #ff5a48; }
.pop.crit { color: #ffd23c; font-size: 27px; }
.pop.heal { color: #6cf07a; }
.pop.mp   { color: #6cc6ff; }
.pop.miss { color: #c8d6ea; font-size: 17px; }
.pop.info { color: #ffd9a0; font-size: 15px; }
@keyframes popup {
  0%   { transform: translate(-50%, 0)     scale(.5); opacity: 0; }
  18%  { transform: translate(-50%, -16px) scale(1.15); opacity: 1; }
  30%  { transform: translate(-50%, -20px) scale(1); opacity: 1; }
  75%  { transform: translate(-50%, -32px); opacity: 1; }
  100% { transform: translate(-50%, -48px); opacity: 0; }
}

/* オーバーレイ（野営） */
.overlay {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(4,7,14,.85);
  z-index: 20;
}
.overlay.show { display: flex; }
.camp-box {
  width: 320px; padding: 22px; text-align: center;
  background: linear-gradient(180deg, var(--parch-1), var(--parch-2));
  color: var(--ink);
  border: 3px solid var(--frame-2); border-radius: 4px;
  box-shadow: inset 0 0 0 2px var(--frame-1), 0 8px 30px #000;
}
.overlay-global { position: fixed; inset: 0; z-index: 50; }
.ask-box { width: 360px; }
.ask-text { font-size: 14px; line-height: 1.9; margin-bottom: 14px; white-space: pre-line; }
.ask-btns { display: flex; gap: 10px; justify-content: center; }
.ask-btns .btn { margin: 0; min-width: 110px; }

.camp-title { font-size: 22px; letter-spacing: .3em; color: var(--frame-2); }
.camp-icon { font-size: 46px; margin: 6px 0; filter: drop-shadow(0 0 12px #ff9a3c); }
.camp-text { font-size: 12.5px; line-height: 1.8; margin-bottom: 12px; }

/* ---------- リザルト ---------- */
.result-body { font-size: 14px; line-height: 2; }
.result-btns { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.result-btns .btn-main { width: auto; min-width: 180px; margin: 6px 0; }
.result-row { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--parch-3); padding: 3px 0; }
.result-row b { color: var(--gold-dk); }
.rank-badge {
  display: inline-block; margin-left: 8px; padding: 1px 12px;
  font-size: 20px; font-weight: bold; color: #fff;
  background: var(--gold-dk); border-radius: 3px;
  text-shadow: 1px 1px 0 #0008;
}
.lvup { color: #1f7a34; font-weight: bold; }

/* ---------- エンディング ---------- */
#screen-ending { background: radial-gradient(ellipse at 50% 40%, #3a2a14 0%, #080c14 78%); }
.ending-inner { text-align: center; max-width: 640px; padding: 20px; }
.ending-title {
  font-size: 44px; letter-spacing: .2em; color: var(--gold);
  text-shadow: 2px 2px 0 var(--frame-2), 4px 4px 0 #000;
}
.ending-text { font-size: 14.5px; line-height: 2.2; margin: 20px 0 26px; text-align: left; }

/* ---------- スクロールバー ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.25); }
::-webkit-scrollbar-thumb { background: var(--frame-1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dk); }

/* ---------- レスポンシブ ---------- */
@media (max-width: 800px), (max-height: 620px) {
  .battle-wrap { transform: scale(var(--battle-scale, 1)); }
}
