/* Adobe Stock の UI キット（★開発用_RUTEN/ui-original/menu_ui.svg）から切り出した部品で HUD・画面を飾る。担当：UI キット */
/* ============================================================================
 * 紺地×金の縁取り（2026-11-26）
 * - 部品は image/ui/*.webp（キットの英字は外して枠だけ切り出し。元の SVG は公開フォルダに置かない）
 * - 切り出しの座標と書き出しは ★開発用_RUTEN/ui-tools/（parts.json・render.mjs）
 * - 枠は border-image の9スライス。border-width は元の太さに近いまま、
 *   border-image-width だけ広げて内側の余白に重ねる（並びの寸法を変えない）
 * - 状態の色（危険階・ガード中など）は border-color が見えなくなるので、
 *   外側の光（box-shadow）か outline で残す
 * - 01〜16 と src/ は触らず、ここで上書きする
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 色：石の灰色 → キットの紺。金はキットの金に寄せる
 * ------------------------------------------------------------------------- */
:root {
  --stone-ink: #090d15;
  --stone-base: #111827;
  --stone-deep: #0a101b;
  --stone-raised: #1a2539;
  --stone-edge: #2c3c55;
  --stone-bevel-top: rgba(240, 216, 131, 0.16);
  --stone-ledge: #04060b;

  --ink-muted: #a2a8b3;
  --ink-dim: #6d7482;

  --brass: #d9b05a;
  --brass-bright: #f0d883;
  --brass-dim: #8c713d;
  --brass-dark: #604e2b;

  --kit-navy: #0e1524;
  --kit-steel: #314157;
  --kit-gold: #b78a45;
  --kit-gold-hi: #f0d883;
  --kit-red: #d9524b;
  --kit-red-deep: #6e1b20;
  --kit-blue: #3a76c8;
  --kit-blue-deep: #12305a;
  --kit-sky: #67b9ea;
}

/* ---------------------------------------------------------------------------
 * HUD の札（ステータス・階・地図）：金と鋼の二重線＋四隅の青い菱
 * ------------------------------------------------------------------------- */
.hud-card {
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/frame-sigil.webp") 72 fill / 24px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* 元の左上の小さな金の角は、枠の鉤と重なるので消す */
.status-cluster::before,
.minimap-card::before,
.minimap-card::after {
  display: none;
}

/* 階の札：大景観は金、危険な階は赤の光で知らせる（元は上の線の色） */
.floor-cluster.is-signature-floor {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(240, 216, 131, 0.38);
}

.floor-cluster.is-danger-floor {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(217, 82, 75, 0.7), 0 0 14px rgba(217, 82, 75, 0.32);
}

/* 地図：たたんだら札だけ（枠は消す） */
.minimap-card.is-collapsed {
  border-image: none;
  border-color: transparent;
  box-shadow: none;
}

.minimap-card.is-collapsed .map-toggle {
  background: linear-gradient(180deg, #172238 0%, #0d1422 100%);
  border-color: var(--kit-steel);
}

#minimap-canvas {
  border-color: var(--kit-steel);
  background: #060a12;
}

.map-toggle {
  background: rgba(10, 16, 27, 0.9);
  border-color: var(--kit-steel);
}

/* ---------------------------------------------------------------------------
 * ボスの体力：重い金の枠（キットのミッション枠を小さく）
 * ------------------------------------------------------------------------- */
.boss-bar {
  background: transparent;
  border-style: solid;
  border-width: 3px;
  border-color: transparent;
  border-image: url("../image/ui/frame-ornate.webp") 132 fill / 30px / 0 stretch;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 16px rgba(204, 68, 68, 0.18);
}

.boss-bar.phase-2 {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(232, 72, 92, 0.42);
}

/* 紋章（キットの階級章）。第二形態は赤みを増す */
.boss-crest {
  width: 34px;
  height: 20px;
  margin: -4px -2px -4px -4px;
  background: url("../image/ui/emblem.webp") center / contain no-repeat;
  transform: none;
  transition: filter 220ms var(--ease-ui);
}

.boss-bar.phase-2 .boss-crest {
  background: url("../image/ui/emblem.webp") center / contain no-repeat;
  filter: saturate(1.6) brightness(1.15) drop-shadow(0 0 4px rgba(232, 72, 92, 0.75));
}

/* ---------------------------------------------------------------------------
 * ゲージ：キットのメーターの溝（紺の溝・鋼の縁）と、区切りと光沢のある中身
 * ------------------------------------------------------------------------- */
.hp-track,
.stamina-track,
.xp-track,
.mp-track,
.boss-track {
  border-radius: 1px;
  background: linear-gradient(180deg, #04070d 0%, #0b1220 100%);
  border: 1px solid #3a4b66;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(4, 6, 11, 0.85);
}

.hp-track {
  height: 11px;
}

.boss-track {
  height: 12px;
  border-color: #6a3a3c;
}

/* 中身の質感：上半分の光沢＋10px ごとの区切り。色は最後の1枚 */
.hp-fill,
.hp-fill.mid,
.hp-fill.low,
.stamina-fill,
.stamina-fill.low,
.stamina-fill.exhausted,
.mp-fill,
.mp-fill.is-ready,
.mp-fill.is-low,
.xp-fill,
.boss-fill,
.boss-bar.phase-2 .boss-fill {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.1) 46%, rgba(0, 0, 0, 0.12) 54%, rgba(0, 0, 0, 0.32) 100%),
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(4, 6, 11, 0.5) 9px 10px),
    linear-gradient(90deg, var(--g-from), var(--g-to));
  background-color: var(--g-to);
}

.hp-fill { --g-from: #2f9a5a; --g-to: #62d890; }
.hp-fill.mid { --g-from: #b5701f; --g-to: #ecaa4e; }
.hp-fill.low { --g-from: #9c2229; --g-to: #ec5b55; }

.stamina-fill { --g-from: #a07a2f; --g-to: #f0d883; }
.stamina-fill.low { --g-from: #9a5a1c; --g-to: #e09a44; }
.stamina-fill.exhausted { --g-from: #8e1f26; --g-to: #e0524c; }

.mp-fill { --g-from: #1f5fa8; --g-to: #5cb6f0; }
.mp-fill.is-ready { --g-from: #1c8fb0; --g-to: #6ff0ff; }
.mp-fill.is-low { --g-from: #26354d; --g-to: #3e5474; }

.xp-fill { --g-from: #5a43a8; --g-to: #ad93f5; }

.boss-fill { --g-from: #8e1c27; --g-to: #e65750; }
.boss-bar.phase-2 .boss-fill { --g-from: #a3173a; --g-to: #ff5f7e; }

/* 細いゲージは区切りを出さない（線だけになるため） */
.xp-fill,
.stamina-fill,
.stamina-fill.low,
.stamina-fill.exhausted,
.mp-fill,
.mp-fill.is-ready,
.mp-fill.is-low {
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(0, 0, 0, 0.28) 100%),
    linear-gradient(90deg, var(--g-from), var(--g-to));
}

.boss-trail {
  background: linear-gradient(90deg, rgba(183, 138, 69, 0.5), rgba(240, 216, 131, 0.62));
}

.boss-phase-notch {
  background: var(--kit-gold-hi);
  box-shadow: 0 0 0 1px rgba(4, 6, 11, 0.7);
}

/* ---------------------------------------------------------------------------
 * Lv の札：キットの金のタブ（左右の斜めの縁だけ伸ばさない）
 * ------------------------------------------------------------------------- */
.level-badge,
.boss-level-badge {
  padding: 2px 3px 1px;
  border-radius: 0;
  border-style: solid;
  border-width: 0 10px;
  border-color: transparent;
  border-image: url("../image/ui/tab-gold.webp") 0 30 fill / 0 10px / 0 stretch;
  background: transparent;
  color: var(--kit-gold-hi);
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(4, 6, 11, 0.9);
}

/* ---------------------------------------------------------------------------
 * 四面図の台とスロット：台は HUD の枠、スロットはキットの升目
 * ------------------------------------------------------------------------- */
.blueprint-dock {
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/frame-sigil.webp") 72 fill / 22px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.blueprint-dock.guard-active {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--soul-cyan), 0 0 18px rgba(59, 216, 236, 0.36);
}

.slot-card {
  background: transparent;
  border-style: solid;
  border-width: 1px;
  border-color: transparent;
  border-image: url("../image/ui/cell.webp") 30 fill / 10px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
}

@media (hover: hover) {
  .slot-card:hover {
    border-image-source: url("../image/ui/cell-gold.webp");
  }
}

/* 状態の色は内側の細い線で残す */
.slot-card.guard-active {
  outline: 1px solid var(--soul-cyan);
  outline-offset: -4px;
  box-shadow: 0 0 10px rgba(59, 216, 236, 0.28);
}

.slot-card.is-swap-target {
  border-image-source: url("../image/ui/cell-gold.webp");
  outline: 1px solid var(--soul-cyan);
  outline-offset: -4px;
  box-shadow: 0 3px 0 var(--stone-ledge), 0 0 10px rgba(59, 216, 236, 0.3);
}

.slot-card[data-variant="gold"]    { outline: 1px solid rgba(240, 216, 131, 0.38); outline-offset: -4px; }
.slot-card[data-variant="crimson"] { outline: 1px solid rgba(217, 82, 75, 0.45); outline-offset: -4px; }
.slot-card[data-variant="frost"]   { outline: 1px solid rgba(103, 185, 234, 0.45); outline-offset: -4px; }
.slot-card[data-variant="venom"]   { outline: 1px solid rgba(120, 200, 90, 0.42); outline-offset: -4px; }

/* 操作の案内の帯 */
.key-hint-strip {
  background: rgba(10, 16, 27, 0.88);
  border-color: var(--kit-steel);
}

/* ---------------------------------------------------------------------------
 * ボタン：主はキットの赤い大ボタン、副は紺の帯、デイリーは青い大ボタン
 * ------------------------------------------------------------------------- */
/* 大ボタンの画像は、尖りの先が上から44%にあり、下の12%は影。
 * 上下に分けると先がずれるので、左右だけ分けて縦はそのまま伸ばす。影は outset で枠の外へ出し、文字を本体の真ん中に置く */
.primary-btn {
  border-style: solid;
  border-width: 2px 20px;
  border-color: transparent;
  border-image: url("../image/ui/btn-red.webp") 0 64 fill / 0 22px / 0 0 7px stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff3e4;
  text-shadow: 0 1px 0 rgba(70, 10, 14, 0.85);
  transition: transform 150ms var(--ease-ui), filter 140ms var(--ease-ui);
}

.primary-btn .btn-kbd,
.stairs-btn.primary-btn kbd {
  background: rgba(70, 10, 14, 0.38);
  border-color: rgba(255, 230, 210, 0.38);
  color: #fff3e4;
}

/* 水色だったボタン（中断の再開・無窮層へ）は青い大ボタン */
.primary-btn.resume-run-btn,
.primary-btn.continue-endless-btn,
.primary-btn.ending-endless-btn {
  border-image-source: url("../image/ui/btn-blue.webp");
  background: transparent;
  color: #eef7ff;
  text-shadow: 0 1px 0 rgba(8, 24, 48, 0.9);
}

.secondary-btn {
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/row-steel.webp") 26 fill / 10px / 0 stretch;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 150ms var(--ease-ui), filter 140ms var(--ease-ui);
}

.checkpoint-btn {
  border-image: url("../image/ui/row-gold.webp") 30 fill / 11px / 0 stretch;
}

/* デイリー迷宮：青い大ボタン */
.secondary-btn.daily-btn {
  border-width: 2px 20px;
  border-image: url("../image/ui/btn-blue.webp") 0 64 fill / 0 22px / 0 0 7px stretch;
  color: #eef7ff;
  text-shadow: 0 1px 0 rgba(8, 24, 48, 0.9);
}

.daily-btn-sub {
  color: #bfe2ff;
}

/* タイトルの2つは大きいので、尖りも大きく */
.title-start-btn,
.secondary-btn.daily-btn {
  border-width: 2px 26px;
  border-image-width: 0 28px;
}

.title-btn-sub {
  color: rgba(255, 232, 214, 0.86);
}

@media (hover: hover) {
  .primary-btn:hover {
    background: transparent;
    filter: brightness(1.1) saturate(1.05);
  }
  .secondary-btn:hover {
    background: transparent;
    border-image: url("../image/ui/row-gold.webp") 30 fill / 11px / 0 stretch;
  }
  .secondary-btn.daily-btn:hover {
    border-image: url("../image/ui/btn-blue.webp") 0 64 fill / 0 28px / 0 0 7px stretch;
    filter: brightness(1.12);
  }
  .continue-endless-btn:hover,
  .revive-btn:hover,
  .resume-run-btn:hover {
    background: transparent;
  }
  .checkpoint-btn:hover {
    background: transparent;
  }
}

/* フォーカスは四角い線でなく、ボタンの形に沿った金の光で */
.primary-btn:focus-visible,
.secondary-btn:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 1px var(--kit-gold-hi)) drop-shadow(0 0 5px rgba(240, 216, 131, 0.7));
}

.pause-sheet .primary-btn:focus-visible,
.pause-sheet .secondary-btn:focus-visible,
.title-stage .primary-btn:focus-visible,
.title-stage .secondary-btn:focus-visible {
  outline: none;
}

/* 右上の小さなボタン：紺の札 */
.icon-btn {
  background: linear-gradient(180deg, #18233a 0%, #0d1422 100%);
  border-color: var(--kit-steel);
  border-top-color: #4a5d7c;
  border-bottom-color: #05070c;
  box-shadow: 0 3px 0 #05070c;
}

@media (hover: hover) {
  .icon-btn:hover {
    background: linear-gradient(180deg, #1f2d48 0%, #111a2b 100%);
    border-color: var(--brass-dim);
  }
}

/* ---------------------------------------------------------------------------
 * 大きな画面：一時停止・操作方法・結果・エンディングは金の重い枠、
 * 刻印・図録・階段は青い菱の枠
 * ------------------------------------------------------------------------- */
.pause-sheet,
.controls-sheet-inner,
#result-overlay .modal-sheet,
.ending-sheet {
  background: transparent;
  border-style: solid;
  border-width: 8px;
  border-color: transparent;
  border-image: url("../image/ui/frame-ornate.webp") 132 fill / 52px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

.blessing-sheet,
.codex-sheet {
  background: transparent;
  border-style: solid;
  border-width: 8px;
  border-color: transparent;
  border-image: url("../image/ui/frame-sigil.webp") 72 fill / 36px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

/* 枠の太さのぶん、内側の余白を減らして中身の幅を元に近づける */
.pause-sheet { padding: 16px 16px 14px; }
.controls-sheet-inner { padding: 12px 14px 12px; }
#result-overlay .modal-sheet { padding: 16px 18px; }
.ending-sheet { padding: 18px 20px 16px; }
.blessing-sheet { padding: 16px 18px 18px; }

@media (max-width: 760px) {
  .ending-sheet { padding: 14px 10px 12px; }
}

/* 図録は中の帯が枠の内側に重ならないよう、枠の幅だけ内へ */
.codex-sheet {
  border-width: 12px;
}

.stairs-confirm {
  background: transparent;
  border-style: solid;
  border-width: 3px;
  border-color: transparent;
  border-image: url("../image/ui/frame-sigil.webp") 72 fill / 28px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 14px rgba(59, 216, 236, 0.22);
}

.stairs-emblem {
  border-color: var(--kit-steel);
  background: #070c15;
}

/* 一時停止の見出し：キットの帯。枠の下の真ん中に赤い宝石 */
.pause-sheet {
  position: relative;
}

.pause-sheet h2,
.controls-sheet-head h2 {
  width: fit-content;
  max-width: 100%;
  /* 枠の上は中央が山形に、下は内側に線がある。文字がその間の真ん中に来る余白 */
  padding: 13px 8px 14px;
  line-height: 1.2;
  border-style: solid;
  border-width: 0 34px;
  border-color: transparent;
  border-image: url("../image/ui/band.webp") 0 48 fill / 0 34px / 0 stretch;
  color: var(--kit-gold-hi);
  text-shadow: 0 1px 0 rgba(4, 6, 11, 0.9);
}

.pause-sheet h2 {
  margin: 0 auto;
}

.controls-sheet-head h2 {
  border-width: 0 28px;
  border-image-width: 0 28px;
  padding: 10px 6px 11px;
}

.pause-sheet::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 92px;
  height: 23px;
  margin-left: -46px;
  background: url("../image/ui/gem.webp") center / contain no-repeat;
  pointer-events: none;
}

/* 区切り線：キットの金の線（真ん中に小さな紋） */
.result-brass-rule,
.ending-brass-rule {
  width: 176px;
  max-width: 100%;
  height: 13px;
  background: url("../image/ui/sep-gold.webp") center / 100% 100% no-repeat;
}

.ending-brass-rule::after {
  display: none;
}

/* 結果の数値：キットの升目 */
.result-stats div {
  background: transparent;
  border-style: solid;
  border-width: 1px;
  border-color: transparent;
  border-image: url("../image/ui/cell.webp") 30 fill / 9px / 0 stretch;
  border-radius: 0;
}

/* 結果の札（ボス練習など）：左だけの太線をやめて四辺の細枠に */
.result-run-tag {
  border: 1px solid var(--brass-dim);
  background: #161a24;
}

/* 刻印のカード：升目の枠。色の合図は上の短い線で残す */
.blessing-card {
  position: relative;
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/cell.webp") 30 fill / 12px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.blessing-card::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--blessing-accent);
  pointer-events: none;
}

@media (hover: hover) {
  .blessing-card:hover {
    background: transparent;
    border-image-source: url("../image/ui/cell-gold.webp");
  }
}

.blessing-card:focus-visible {
  outline: 2px solid var(--kit-gold-hi);
  outline-offset: 2px;
}

/* 図録の中の帯は紺に */
.codex-tabs {
  background: #0a101b;
}

/* ---------------------------------------------------------------------------
 * タッチ操作：攻撃は金の輪に赤、回避・盾は青い計器の縁、ほかは紺
 * 状態（is-active など）の背景の上書きに負けないよう、背景だけ id で指定し、
 * 中の色は変数で切り替える
 * ------------------------------------------------------------------------- */
.touch-btn {
  --tb-hi: #233150;
  --tb-core: #121b2d;
  --tb-edge: #070b13;
  --tb-ring: url("../image/ui/ring-blue.webp");
  border: 1px solid rgba(4, 6, 11, 0.9);
  box-shadow: 0 3px 0 rgba(4, 6, 11, 0.85);
}

#touch-controls .touch-btn {
  background:
    var(--tb-ring) center / 100% 100% no-repeat,
    radial-gradient(circle closest-side at 50% 42%, var(--tb-hi) 0%, var(--tb-core) 62%, var(--tb-edge) 100%);
}

.touch-btn-dash,
.touch-btn-guard {
  --tb-hi: #4f8fe0;
  --tb-core: #23559c;
  --tb-edge: #0d2547;
}

.touch-btn-dash .touch-btn-kanji,
.touch-btn-guard .touch-btn-kanji {
  color: #eef7ff;
}

.touch-btn-dash .touch-btn-sub,
.touch-btn-guard .touch-btn-sub {
  color: #bcdcff;
}

.touch-btn-attack {
  --tb-hi: #f07068;
  --tb-core: #b8343a;
  --tb-edge: #5a1418;
  --tb-ring: url("../image/ui/ring-gold.webp");
  border: 1px solid rgba(4, 6, 11, 0.9);
}

.touch-btn-attack .touch-btn-kanji {
  color: #fff3e0;
  text-shadow: 0 1px 0 rgba(70, 10, 14, 0.9);
}

.touch-btn-attack .touch-btn-sub {
  color: #ffd9c9;
}

.touch-btn-attack.is-charge-ready {
  --tb-hi: #ff9a8a;
  --tb-core: #d24a48;
}

.touch-btn-guard.is-active {
  --tb-hi: #6fe8f7;
  --tb-core: #1d7f98;
  --tb-edge: #0b3340;
}

.touch-btn-lock.is-active {
  --tb-hi: #3aa8c0;
  --tb-core: #164a5c;
}

.touch-btn-lock.is-staggered {
  --tb-hi: #8a6a2c;
  --tb-core: #3e3016;
}

.touch-btn-interact.is-ready,
.touch-btn-interact.is-available {
  --tb-hi: #8a6a2c;
  --tb-core: #3e3016;
  --tb-ring: url("../image/ui/ring-gold.webp");
}

.touch-btn-magic.is-ready {
  --tb-hi: #3aa8c0;
  --tb-core: #135066;
}

/* スティック：キットの照準の輪＋金の摘み */
.touch-stick-base {
  background: rgba(8, 12, 20, 0.5);
  border-color: rgba(103, 185, 234, 0.32);
}

.touch-stick-base.is-active {
  background: rgba(8, 12, 20, 0.7);
  border-color: rgba(240, 216, 131, 0.6);
}

.touch-stick-ring {
  inset: 2px;
  border: 0;
  background: url("../image/ui/reticle.webp") center / 100% 100% no-repeat;
  opacity: 0.9;
}

.touch-stick-knob {
  position: relative;
  background: radial-gradient(circle at 40% 34%, #f6e39c 0%, #c99a4c 46%, #7a5a26 100%);
  border: 2px solid #2a1f0e;
  box-shadow: 0 3px 0 rgba(4, 6, 11, 0.85), 0 0 0 1px rgba(240, 216, 131, 0.35);
}

/* ---------------------------------------------------------------------------
 * 動きを減らす設定：ボタンの明るさの変化も止める
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .primary-btn,
  .secondary-btn,
  .boss-crest {
    transition: none;
  }
}

/* ---------------------------------------------------------------------------
 * 2026-11-27 残りの部品（知らせ・ログ・図面の比較・仕掛けの案内・会話・階の幕・刻門・図録の札）
 * ------------------------------------------------------------------------- */
/* 小さな札：キットの計器パネルの枠 */
.hud-toast,
.morph-preview,
.gimmick-hint {
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/frame-hud.webp") 46 fill / 16px / 0 stretch;
  border-radius: 0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.morph-preview { padding: 10px 12px; }
.gimmick-hint { padding: 9px 12px; }

/* ログ：左だけの色線をやめ、四辺の細枠＋行頭の小さな菱で色を伝える */
.log-entry {
  position: relative;
  padding-left: 18px;
  background: rgba(10, 16, 27, 0.88);
  border: 1px solid var(--kit-steel);
  border-left: 1px solid var(--kit-steel);
  border-radius: 0;
}

.log-entry::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0.95em;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  transform: rotate(45deg);
  background: var(--ink-dim);
}

.log-entry.tone-info::before { background: #7c97c4; }
.log-entry.tone-good::before { background: var(--soul-cyan); }
.log-entry.tone-warn::before { background: var(--brass); }
.log-entry.tone-danger::before { background: var(--trap-rust); }
.log-entry.tone-boss::before { background: var(--crimson-enrage); }

/* 会話の窓：金の重い枠、名前はキットの金のタブ
 * 19-story.css（後から読みこむ）の border に枠を消されないよう、指定を強める */
.story-dialog .story-box {
  background: transparent;
  border-style: solid;
  border-width: 6px;
  border-color: transparent;
  border-image: url("../image/ui/frame-ornate.webp") 132 fill / 40px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
  padding: 16px 20px 18px;
}

.story-dialog .story-text {
  white-space: pre-line;
}

.story-dialog .story-next {
  right: 22px;
  bottom: 12px;
}

.story-name {
  padding: 3px 18px;
  color: #161108;
  background: transparent;
  border-style: solid;
  border-width: 0 10px;
  border-color: transparent;
  border-image: url("../image/ui/tab-gold.webp") 0 40 fill / 0 14px / 0 stretch;
}

/* 結末の一文：上下にキットの金の線 */
.story-epilogue p {
  position: relative;
  padding: 26px 0;
}

.story-epilogue p::before,
.story-epilogue p::after {
  content: "";
  position: absolute;
  left: 50%;
  width: min(360px, 70vw);
  height: 14px;
  transform: translateX(-50%);
  background: url("../image/ui/sep-gold.webp") center / contain no-repeat;
}

.story-epilogue p::before { top: 0; }
.story-epilogue p::after { bottom: 0; transform: translateX(-50%) scaleY(-1); }

/* 階の幕：紋章と金の線 */
.ft-emblem-ornament {
  width: 64px;
  height: 64px;
  border: 0;
  background: url("../image/ui/emblem.webp") center / contain no-repeat;
  transform: none;
}

.ft-divider {
  height: 14px;
  background: url("../image/ui/sep-gold.webp") center / contain no-repeat;
}

/* 刻門の選択：鋼の帯 */
.checkpoint-picker {
  background: transparent;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  border-image: url("../image/ui/row-steel.webp") 14 fill / 10px / 0 stretch;
  border-radius: 0;
  box-shadow: none;
}

/* 図録のタブ：選んでいる札はキットの金のタブ */
.codex-tab.is-active {
  color: #161108;
  background: transparent;
  border-style: solid;
  border-width: 0 10px;
  border-color: transparent;
  border-image: url("../image/ui/tab-gold.webp") 0 40 fill / 0 14px / 0 stretch;
}

/* 文字が暗い地に沈まないよう、金のタブの上の文字は明るい金に */
.story-name,
.codex-tab.is-active {
  color: var(--kit-gold-hi);
  text-shadow: 0 1px 0 #000;
}
/* 19-story.css（後から読みこむ）の金地・黒字に負けないよう、名前札だけ指定を強める */
.story-dialog .story-name {
  color: var(--kit-gold-hi);
  background: transparent;
}

/* 図録の生息地の札：左だけの色線をやめ、行頭の菱で色を伝える */
.codex-arch-habitat {
  position: relative;
  padding-left: 16px;
  border-left: 1px solid var(--stone-edge) !important;
}

.codex-arch-habitat::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  transform: rotate(45deg);
  background: var(--stone-edge);
}

.codex-arch-habitat[data-habitat="stone"]::before { background: #6ea87e; }
.codex-arch-habitat[data-habitat="forge"]::before { background: #de8a42; }
.codex-arch-habitat[data-habitat="mire"]::before { background: #54b898; }
.codex-arch-habitat[data-habitat="frost"]::before { background: #56c8eb; }
.codex-arch-habitat[data-habitat="desert"]::before { background: #d4a24e; }
.codex-arch-habitat[data-habitat="reef"]::before { background: #3daec4; }
.codex-arch-habitat[data-habitat="sky"]::before { background: #8ab6eb; }
.codex-arch-habitat[data-habitat="clockwork"]::before { background: #c97b42; }
.codex-arch-habitat[data-habitat="throne"]::before { background: var(--brass); }
.codex-arch-habitat[data-habitat="anomaly"]::before { background: var(--brass); }
.codex-arch-habitat[data-habitat="endless"]::before { background: var(--brass); }
.codex-arch-habitat[data-habitat="apex"]::before { background: var(--brass); }
