:root {
  --bg: #12121a;
  --panel: #1c1c28;
  --panel-2: #232333;
  --line: #34344a;
  --text: #e8e8f4;
  --dim: #9a9ab4;
  --accent: #d9a94a;
  --hp: #6dd06d;
  --mp: #6da6d0;
  --scout: #d9a94a;
  --warn: #e88a6a;
  --win: #8ed88e;
  --lose: #e07070;

  --t-ooze: #7ec8b0;
  --t-dragon: #d97a6a;
  --t-flora: #8ec46a;
  --t-beast: #d0a86a;
  --t-construct: #9a9ab4;
  --t-fiend: #b57ad0;
  --t-undead: #7a8cc4;
  --t-outer: #d07ab0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

#app {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}

#fps {
  position: fixed;
  top: 4px;
  right: 6px;
  z-index: 50;
  padding: 2px 6px;
  background: #000c;
  color: #8f8;
  font: 12px/1.3 ui-monospace, monospace;
  border-radius: 4px;
}

h1, h2, h3, h4 { margin: 0.4em 0 0.3em; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; color: var(--dim); }
p { margin: 0.35em 0; }

.dim { color: var(--dim); font-size: 0.88rem; }
.warn { color: var(--warn); }
.win { color: var(--win); }
.lose { color: var(--lose); }

/* ── ボタン */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  min-height: 40px;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); color: #24180a; border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 0.85rem; }

/* ── タイトル */
.title { text-align: center; padding-top: 8vh; }
.title-main { font-size: 2.4rem; letter-spacing: 0.16em; }
.title-sub { color: var(--dim); margin-bottom: 2rem; }
.title-menu { display: flex; flex-direction: column; gap: 10px; max-width: 260px; margin: 0 auto; }
.title-help { max-width: 520px; margin: 1.5rem auto; text-align: left; background: var(--panel); padding: 14px; border-radius: 10px; }
.title-help p { font-size: 0.9rem; }
.credit { margin-top: 3rem; color: var(--dim); font-size: 0.72rem; }

/* ── パネル共通 */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.notice { min-height: 1.4em; color: var(--accent); font-size: 0.9rem; }

/* ── 拠点 */
.hub-title { letter-spacing: 0.08em; }
.hub-info { color: var(--dim); font-size: 0.9rem; margin-bottom: 10px; }
.hub-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

/* ── 目標（1件だけ出す。達成率や合計は出さない） */
.goal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.goal-label { font-size: 0.68rem; color: var(--dim); letter-spacing: 0.1em; }
.goal-text { font-weight: 700; font-size: 1.02rem; }
.goal-why { font-size: 0.8rem; color: var(--dim); }
.goal-progress { font-size: 0.78rem; color: var(--accent); font-variant-numeric: tabular-nums; }

.challenge {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: baseline;
}
.challenge strong { font-weight: 700; }
.challenge-easy strong { color: var(--dim); }
.challenge-good strong { color: var(--hp); }
.challenge-tough strong { color: var(--accent); }
.challenge-danger strong { color: var(--lose); }

/* ── 配合の試算（判断の直前にだけ出す） */
.preview {
  width: 100%;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--line);
}
.preview-head { font-size: 0.66rem; color: var(--dim); margin-bottom: 3px; }
.preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.pv { font-size: 0.62rem; text-align: center; background: var(--panel-2); border-radius: 4px; padding: 2px 1px; }
.pv .lbl { display: block; color: var(--dim); font-size: 0.58rem; }
.pv .val { font-variant-numeric: tabular-nums; color: var(--dim); }
.pv.up .val { color: var(--hp); }
.pv.down .val { color: var(--lose); }
.preview-meta { font-size: 0.64rem; color: var(--dim); margin-top: 3px; }

/* ── 勲章（獲得した瞬間だけ。数秒で消える） */
.medal-layer {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 24px));
}
.medal {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #2a2114;
  border: 1px solid var(--accent);
  border-radius: 9px;
  padding: 9px 12px;
  animation: medal-in 0.4s ease-out;
}
.medal-mark { color: var(--accent); font-size: 1.3rem; }
.medal-name { font-weight: 700; }
.medal-desc { font-size: 0.76rem; color: var(--dim); }
@keyframes medal-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .medal { animation: none; }
}

/* ── カード */
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover, .card.clickable:focus-visible { border-color: var(--accent); outline: none; }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card-head { display: flex; gap: 9px; align-items: center; }
.card-title { min-width: 0; flex: 1; }
.card-title .name { font-weight: 700; display: flex; gap: 6px; align-items: baseline; }
.card-title .meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.78rem; color: var(--dim); margin-top: 1px; }
.card-body { margin-top: 8px; }

.sprite { image-rendering: pixelated; flex: none; }

.badge { font-size: 0.7rem; background: var(--accent); color: #24180a; padding: 0 5px; border-radius: 6px; }

.rank {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0 5px;
  border-radius: 4px;
  background: #3a3a52;
  color: var(--text);
}
.rank-S, .rank-SS { background: var(--accent); color: #24180a; }
.rank-A { background: #b57ad0; color: #1a0f22; }

.tribe-ooze { color: var(--t-ooze); }
.tribe-dragon { color: var(--t-dragon); }
.tribe-flora { color: var(--t-flora); }
.tribe-beast { color: var(--t-beast); }
.tribe-construct { color: var(--t-construct); }
.tribe-fiend { color: var(--t-fiend); }
.tribe-undead { color: var(--t-undead); }
.tribe-outer { color: var(--t-outer); }

/* ── ゲージ */
.bar { height: 7px; background: #0f0f16; border-radius: 4px; overflow: hidden; flex: 1; min-width: 40px; }
.bar-fill { height: 100%; background: var(--dim); transition: width 0.2s; }
.bar.hp .bar-fill { background: var(--hp); }
.bar.mp .bar-fill { background: var(--mp); }
.bar.scout .bar-fill { background: var(--scout); }

.gauges { display: flex; flex-direction: column; gap: 4px; }
.gauge { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; }
.gauge .lbl { width: 2.2em; color: var(--dim); }
.gauge .num { width: 5.5em; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.stat { background: var(--panel-2); border-radius: 6px; padding: 3px 5px; font-size: 0.72rem; }
.stat .lbl { display: block; color: var(--dim); font-size: 0.66rem; }
.stat .val { font-variant-numeric: tabular-nums; }

.traits, .skills { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; align-items: baseline; }
.traits .lbl, .skills .lbl { color: var(--dim); font-size: 0.7rem; }
.chip {
  font-size: 0.7rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px 7px;
}
.chip.sp { border-color: var(--accent); color: var(--accent); }

.with-actions { display: flex; flex-direction: column; gap: 5px; }
.actions { display: flex; gap: 5px; }

/* ── 詳細 */
.detail-extra { display: flex; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 0.85rem; margin: 8px 0; }
.sp-list { display: flex; flex-direction: column; gap: 6px; }
.sp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--panel); padding: 7px; border-radius: 8px; font-size: 0.85rem; }
.sp-row > span:first-child { flex: 1; min-width: 160px; }

/* ── ダンジョン */
.dungeon-status { font-size: 0.85rem; color: var(--dim); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.canvas-wrap { position: relative; display: inline-block; touch-action: none; }
.dungeon-canvas {
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 100%;
  height: auto;
  display: block;
  background: #0b0b12;
}
.dungeon-message { min-height: 1.5em; color: var(--accent); margin: 6px 0; font-size: 0.9rem; }
.dungeon-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.hints { margin-top: 10px; color: var(--dim); font-size: 0.78rem; }

.stick {
  position: absolute;
  width: 0; height: 0;
  pointer-events: none;
}
.stick-knob {
  position: absolute;
  left: -22px; top: -22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #ffffff22;
  border: 2px solid #ffffff55;
}

/* ── 戦闘 */
.battle-field { display: flex; flex-direction: column; gap: 10px; padding-top: 38px; }
.battle-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 96px; }
.battle-row.enemies { align-items: flex-end; }
.unit {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px;
  min-width: 96px;
  max-width: 140px;
  text-align: center;
  transition: opacity 0.2s;
}
.unit.down { opacity: 0.3; }
.unit.recruited { border-color: var(--accent); opacity: 0.65; }
.unit-name { font-size: 0.78rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-bars { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
/* .bar は flex:1 を持つ。縦並びのここでは「高さ」に効いて height 指定を潰すので戻す */
.unit-bars .bar, .scout-gauge .bar { flex: 0 0 auto; width: 100%; height: 8px; }
.unit-num { font-size: 0.68rem; color: var(--dim); font-variant-numeric: tabular-nums; }
.unit-status { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.st { font-size: 0.62rem; padding: 0 4px; border-radius: 4px; background: #4a3a5a; }
.unit-tension { color: var(--accent); font-size: 0.7rem; letter-spacing: 0.1em; }
/* 横並びだと数値が枠外にはみ出したので縦に積む */
.scout-gauge { margin-top: 3px; }
.scout-num { display: block; font-size: 0.62rem; color: var(--scout); font-variant-numeric: tabular-nums; text-align: right; }

.strategy-label { margin: 8px 0 4px; font-size: 0.85rem; color: var(--accent); }
.round-label { text-align: center; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

.battle-log {
  background: #0e0e15;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  height: 150px;
  overflow-y: auto;
  font-size: 0.85rem;
}
.log-line { padding: 1px 0; }
.log-line.crit, .log-line.win { color: var(--win); }
.log-line.lose { color: var(--lose); }
.log-line.dim { color: var(--dim); font-size: 0.8rem; }
.log-line.scout { color: var(--scout); }
.log-line.start { color: var(--accent); font-weight: 700; }

.battle-commands { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── 配合 */
.picker { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.breed-parents { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-top: 12px; }
.breed-parents .cross { color: var(--accent); font-size: 1.2rem; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 9px; }
.option {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.option.special { border-color: var(--accent); background: #2a2114; }
.option-name { font-weight: 700; }
.option-meta { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; font-size: 0.75rem; }
.option-kind { font-size: 0.72rem; color: var(--dim); }
.option-capped { font-size: 0.7rem; color: var(--warn); }

/* ── 大会 */
.league-list { display: flex; flex-direction: column; gap: 8px; }
.league {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  flex-wrap: wrap;
}
.league.won { border-color: var(--win); }
.league-name { font-weight: 700; min-width: 8em; }
.league-meta { flex: 1; color: var(--dim); font-size: 0.8rem; min-width: 180px; }

/* ── 図鑑 */
.dex-grid {
  display: grid;
  grid-template-columns: 5.5em repeat(16, 1fr);
  gap: 2px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.dex-corner { }
.dex-head { text-align: center; font-size: 0.62rem; color: var(--dim); }
.dex-row-head { font-size: 0.72rem; display: flex; align-items: center; }
.dex-cell {
  aspect-ratio: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  min-width: 26px;
}
.dex-cell img { image-rendering: pixelated; width: 100%; height: auto; }
.dex-cell:not(.unknown) { cursor: pointer; }
.dex-cell:not(.unknown):hover { border-color: var(--accent); }
.dex-cell.unknown { background: #16161f; }
.qmark { color: #3a3a52; font-size: 0.8rem; }
.dex-detail { margin-top: 14px; }
.dex-detail-head { display: flex; gap: 10px; align-items: center; }
.dex-detail-head .name { font-weight: 700; font-size: 1.05rem; }
.dex-detail-head .meta { display: flex; gap: 6px; font-size: 0.8rem; }
.recipe { background: var(--panel); padding: 7px 10px; border-radius: 7px; font-size: 0.85rem; }

/* ── 図鑑の勲章一覧（見返す用。拠点には出さない） */
.medal-head { margin-top: 18px; }
.medal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 7px; }
.medal-row {
  display: flex;
  gap: 9px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
}

/* ── エンディング */
.ending { text-align: center; padding-top: 12vh; }
.ending h1 { font-size: 1.8rem; letter-spacing: 0.1em; }
.ending p { color: var(--dim); }
.ending .btn { margin-top: 2rem; }

/* ── スマホ */
@media (max-width: 560px) {
  #app { padding: 8px 8px 32px; }
  .title-main { font-size: 1.9rem; }
  .card-list { grid-template-columns: 1fr; }
  .hub-menu { grid-template-columns: 1fr 1fr; }
  .battle-log { height: 118px; }
  .unit { min-width: 84px; padding: 4px; }
  .battle-commands .btn { flex: 1 1 44%; }
  .dex-grid { grid-template-columns: 4.2em repeat(16, 22px); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══ 戦闘の演出 ══
   js/fx.js から当てる。既存スプライトの位置・回転・明度と数値テキストだけで作る。
   新しい図像は持たない（素材調達の規定）。 */

.battle { position: relative; }
.unit { position: relative; }

/* ── 踏み込み。敵は下へ、味方は上へ出る */
@keyframes fx-lunge-up {
  0% { transform: translateY(0); }
  35% { transform: translateY(-13px); }
  100% { transform: translateY(0); }
}
@keyframes fx-lunge-down {
  0% { transform: translateY(0); }
  35% { transform: translateY(13px); }
  100% { transform: translateY(0); }
}
.fx-lunge-up { animation: fx-lunge-up 0.34s cubic-bezier(0.3, 0, 0.2, 1); }
.fx-lunge-down { animation: fx-lunge-down 0.34s cubic-bezier(0.3, 0, 0.2, 1); }

/* ── 被弾。会心は揺れ幅も回数も上げる */
@keyframes fx-hit {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}
@keyframes fx-hit-crit {
  0%, 100% { transform: translateX(0) scale(1); }
  10% { transform: translateX(-11px) scale(1.04); }
  28% { transform: translateX(10px) scale(1.04); }
  46% { transform: translateX(-8px) scale(1.02); }
  64% { transform: translateX(6px) scale(1.01); }
  82% { transform: translateX(-3px) scale(1); }
}
.fx-hit { animation: fx-hit 0.3s ease-out; }
.fx-hit-crit { animation: fx-hit-crit 0.52s ease-out; }

/* 当たった瞬間だけ白く飛ばす。輪郭が消えるので短く切る */
@keyframes fx-flash {
  0% { filter: brightness(3.2) saturate(0); }
  100% { filter: none; }
}
@keyframes fx-flash-crit {
  0% { filter: brightness(4) saturate(0); }
  40% { filter: brightness(1.6) saturate(1.4); }
  100% { filter: none; }
}
.fx-flash { animation: fx-flash 0.22s ease-out; }
.fx-flash-crit { animation: fx-flash-crit 0.42s ease-out; }

/* ── 回復・強化・弱体。色で意味を分ける */
@keyframes fx-glow-heal {
  0%, 100% { filter: none; }
  40% { filter: brightness(1.5) drop-shadow(0 0 7px var(--hp)); }
}
@keyframes fx-glow-buff {
  0%, 100% { filter: none; }
  40% { filter: brightness(1.4) drop-shadow(0 0 7px var(--accent)); }
}
@keyframes fx-glow-bad {
  0%, 100% { filter: none; }
  40% { filter: brightness(0.8) drop-shadow(0 0 7px var(--t-fiend)); }
}
.fx-glow-heal { animation: fx-glow-heal 0.6s ease-out; }
.fx-glow-buff { animation: fx-glow-buff 0.6s ease-out; }
.fx-glow-bad { animation: fx-glow-bad 0.6s ease-out; }

/* ── ためる。1回ふくらんで戻る */
@keyframes fx-charge {
  0%, 100% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.07); box-shadow: 0 0 14px -2px var(--accent); }
}
.fx-charge { animation: fx-charge 0.55s ease-in-out; }

/* ── 撃破。傾いて落ちる。.down の opacity より前に見せたいので長めに取る */
@keyframes fx-faint {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  30% { transform: translateY(-5px) rotate(-7deg); opacity: 1; }
  100% { transform: translateY(17px) rotate(-24deg); opacity: 0.25; }
}
.fx-faint { animation: fx-faint 0.62s cubic-bezier(0.4, 0, 0.7, 1) forwards; }

/* ── 吹き上がる数値。ダメージが「入った」ことを数で見せる */
.fx-pop {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translateX(-50%);
  margin-left: var(--fx-offset, 0);
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  text-shadow:
    -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000,
    -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 2px 5px #000, 0 0 10px rgba(0, 0, 0, 0.9);
  animation: fx-pop 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  z-index: 5;
}
@keyframes fx-pop {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.7); }
  18% { opacity: 1; transform: translateX(-50%) translateY(-6px) scale(1.12); }
  32% { transform: translateX(-50%) translateY(-9px) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.95); }
}

.fx-pop-damage { color: #fff; }
.fx-pop-poison { color: var(--t-fiend); }
.fx-pop-miss { color: var(--dim); font-size: 0.9rem; font-weight: 700; }
.fx-pop-heal { color: var(--hp); }
.fx-pop-buff { color: var(--accent); }
.fx-pop-debuff { color: var(--warn); }
.fx-pop-status { color: var(--t-fiend); font-size: 0.88rem; }
.fx-pop-tension { color: var(--accent); font-size: 0.88rem; }
.fx-pop-scout { color: var(--scout); font-size: 0.95rem; }

/* 会心だけ別格に見せる。ここで手を抜くと通常攻撃と混ざる */
.fx-pop-crit {
  color: var(--accent);
  font-size: 1.75rem;
  animation: fx-pop-crit 1.05s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes fx-pop-crit {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.5); }
  15% { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.5); }
  30% { transform: translateX(-50%) translateY(-13px) scale(1.15); }
  45% { transform: translateX(-50%) translateY(-13px) scale(1.28); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-38px) scale(1); }
}

/* ── 画面の光。会心と弱点のときだけ。多用すると効かなくなるので2種に絞る */
.fx-flash-screen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  animation: fx-flash-screen 0.3s ease-out forwards;
}
.fx-flash-screen-crit { background: radial-gradient(circle at 50% 38%, rgba(217, 169, 74, 0.42), transparent 62%); }
.fx-flash-screen-weak { background: radial-gradient(circle at 50% 38%, rgba(142, 216, 142, 0.32), transparent 62%); }
@keyframes fx-flash-screen {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

/* HPバーは遅れて減らす。減っていく途中が見えるほうが「効いた」と分かる */
.unit .bar-fill { transition: width 0.42s cubic-bezier(0.2, 0.7, 0.3, 1); }

/* ログの読み分け。会心と撃破が通常行と同じ見た目だと流れて消える */
.log-line.act { color: var(--text); }
.log-line.damage { color: var(--dim); }
.log-line.crit { color: var(--accent); font-weight: 700; }
.log-line.faint { color: var(--lose); }
.log-line.miss { color: var(--dim); }
.log-line.heal, .log-line.revive, .log-line.regen { color: var(--hp); }
.log-line.weak { color: var(--win); font-weight: 700; }
.log-line.resisted { color: var(--dim); }
.log-line.recruited { color: var(--scout); font-weight: 700; }
.log-line.tension { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .fx-lunge-up, .fx-lunge-down, .fx-hit, .fx-hit-crit,
  .fx-flash, .fx-flash-crit, .fx-charge, .fx-faint,
  .fx-glow-heal, .fx-glow-buff, .fx-glow-bad { animation: none; }
  .fx-pop, .fx-pop-crit { animation: none; opacity: 1; }
  .unit .bar-fill { transition: none; }
}
