/* ============================================================
   百鬼ノ塔 — 様式: 浮世絵×闇
   墨色の地に朱と金。明朝の見出し、ゴシックの本文。
   ============================================================ */

:root {
  --font-display: 'Shippori Mincho', serif;
  --font-body: 'Zen Kaku Gothic New', sans-serif;
  --font-num: 'Oswald', sans-serif;

  --bg: #14111c;
  --bg2: #1d1828;
  --panel: #241d33;
  --panel-edge: #3a3050;
  --ink: #ede4d3;
  --muted: #a89e8e;
  --accent: #e8472b;
  --accent-soft: #f06a4f;
  --gold: #d9a441;
  --good: #8fbc7f;

  --c-attack: #e8472b;
  --c-skill: #3f9ab5;
  --c-power: #a865c9;
  --c-hp: #d8504a;
  --c-block: #6db3d6;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-4xl: 2.75rem;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;

  --radius: 12px;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a2140 0%, transparent 60%),
    radial-gradient(900px 500px at 85% 110%, #2c1620 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 和紙の粒子 */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(237, 228, 211, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
#overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#overlay > * { pointer-events: auto; }
#fx-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  color: inherit;
  background: none;
  font-size: var(--text-base);
}
button:disabled { cursor: not-allowed; opacity: 0.45; }

/* ---------- 汎用ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px;
  padding: 0.65em 1.6em;
  border-radius: 10px;
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: 0.06em;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.btn-primary {
  background: linear-gradient(160deg, var(--accent) 0%, #b8311c 100%);
  border-color: #f4795f;
  box-shadow: 0 4px 16px rgba(232, 71, 43, 0.35);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(232, 71, 43, 0.5); border-color: #ffa28b; }
.btn-gold { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   HUD（上部バー）
   ============================================================ */
.hud {
  display: flex; align-items: center; gap: var(--space-lg);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(20, 17, 28, 0.92);
  border-bottom: 1px solid var(--panel-edge);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.hud .stat { display: inline-flex; align-items: center; gap: 0.4em; font-weight: 700; }
.hud .stat .num { font-family: var(--font-num); font-size: var(--text-lg); letter-spacing: 0.02em; }
.hud .hp .num { color: var(--c-hp); }
.hud .gold .num { color: var(--gold); }
.hud .floor-label { font-family: var(--font-display); color: var(--muted); font-size: var(--text-sm); letter-spacing: 0.15em; }
.hud .spacer { flex: 1; }
.hud .relic-strip { display: flex; gap: 0.35em; flex-wrap: wrap; }
.hud .relic-chip {
  font-size: 1.25rem; line-height: 1;
  padding: 0.3em 0.32em;
  min-width: 44px; min-height: 40px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s;
}
.hud .relic-chip:hover { border-color: var(--gold); }
.hud .seed { color: var(--muted); font-size: var(--text-sm); }
.hud .icon-btn {
  min-width: 44px; min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--panel-edge);
  background: var(--panel);
  font-size: 1.15rem;
  transition: border-color .18s;
}
.hud .icon-btn:hover { border-color: var(--gold); }

/* HPバー */
.hpbar { position: relative; width: 130px; height: 10px; background: #0d0b12; border-radius: 6px; overflow: hidden; border: 1px solid var(--panel-edge); }
.hpbar > i { position: absolute; inset: 0; background: linear-gradient(90deg, #a83a32, var(--c-hp)); border-radius: 6px; transition: width 0.4s ease; }

/* ============================================================
   タイトル画面
   ============================================================ */
.title-screen {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-xl);
  gap: var(--space-xl);
}
.title-tate {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 11vw, 8.5rem);
  letter-spacing: 0.18em;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(232, 71, 43, 0.35);
  margin: 0 auto;
  user-select: none;
  animation: title-in 1.1s ease both;
}
.title-tate .red { color: var(--accent); }
@keyframes title-in { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.title-side {
  display: flex; flex-direction: column; gap: var(--space-md);
  max-width: 380px;
  animation: title-in 1.1s 0.25s ease both;
}
.title-side.left { justify-self: end; text-align: right; align-items: flex-end; }
.title-side.right { justify-self: start; }
.title-sub { color: var(--muted); font-size: var(--text-lg); letter-spacing: 0.2em; font-family: var(--font-display); }
.title-menu { display: flex; flex-direction: column; gap: var(--space-md); width: 100%; max-width: 320px; }
.title-menu .btn { width: 100%; font-size: var(--text-lg); min-height: 56px; justify-content: space-between; }
.title-stats {
  border-left: 3px solid var(--gold);
  padding: var(--space-sm) var(--space-md);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 2;
}
.title-stats b { color: var(--ink); font-family: var(--font-num); font-size: var(--text-base); }

.asc-picker { display: flex; align-items: center; gap: var(--space-md); }
.asc-picker .asc-num { font-family: var(--font-num); font-size: var(--text-2xl); color: var(--gold); min-width: 2ch; text-align: center; }
.asc-picker .icon-btn { min-width: 48px; min-height: 48px; border-radius: 10px; border: 1px solid var(--panel-edge); background: var(--panel); font-size: var(--text-xl); }
.asc-desc { color: var(--muted); font-size: var(--text-sm); min-height: 3em; }

/* ============================================================
   マップ（塔）
   ============================================================ */
.map-screen { flex: 1; display: flex; flex-direction: column; align-items: center; padding-bottom: var(--space-xl); }
.act-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: 0.3em;
  margin: var(--space-lg) 0 var(--space-xs);
  color: var(--gold);
}
.act-title small { display: block; text-align: center; color: var(--muted); font-size: var(--text-sm); letter-spacing: 0.2em; }
.tower {
  position: relative;
  width: min(620px, 94vw);
  margin-top: var(--space-md);
}
.tower svg.paths { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tower svg.paths path { stroke: #463a5e; stroke-width: 2.5; fill: none; stroke-dasharray: 5 7; }
.tower svg.paths path.lit { stroke: var(--gold); stroke-dasharray: none; opacity: 0.85; }
.tower-rows { position: relative; display: flex; flex-direction: column-reverse; gap: 44px; padding: var(--space-lg) 0; }
.tower-row { display: flex; justify-content: space-around; align-items: center; min-height: 64px; }
.map-node {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.map-node .node-label {
  position: absolute; bottom: -1.45em; left: 50%; transform: translateX(-50%);
  font-size: var(--text-sm); color: var(--muted); white-space: nowrap; font-weight: 500;
}
.map-node.selectable { border-color: var(--accent-soft); cursor: pointer; box-shadow: 0 0 0 0 rgba(232,71,43,0.5); animation: node-pulse 1.6s infinite; }
.map-node.selectable:hover { transform: scale(1.14); border-color: var(--gold); }
.map-node.current { border-color: var(--gold); background: #3a2d18; }
.map-node.visited { opacity: 0.45; }
.map-node.future { opacity: 0.8; }
.map-node.boss-node { width: 84px; height: 84px; font-size: 2.2rem; border-width: 3px; }
@keyframes node-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 71, 43, 0.45); }
  70% { box-shadow: 0 0 0 14px rgba(232, 71, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 71, 43, 0); }
}

/* ============================================================
   戦闘画面
   ============================================================ */
.battle-screen { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 64px); }
.enemy-area {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1rem, 4vw, 3.5rem);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  flex-wrap: wrap;
}
.enemy {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
  padding: var(--space-md);
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  min-width: 150px;
  position: relative;
}
.enemy.targetable { border-color: var(--accent-soft); background: rgba(232, 71, 43, 0.08); cursor: pointer; }
.enemy.targetable:hover { border-color: var(--gold); transform: scale(1.04); }
.enemy.dead { opacity: 0.18; filter: grayscale(1); pointer-events: none; }
.enemy .sprite {
  font-size: clamp(3.2rem, 7vw, 4.8rem); line-height: 1;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.5));
  animation: idle-bob 2.6s ease-in-out infinite;
}
.enemy.hit .sprite { animation: hit-shake 0.35s ease; }
@keyframes idle-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hit-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-9px); } 60% { transform: translateX(7px); } }
.enemy .ename { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.enemy .intent {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 700;
  font-size: var(--text-base);
  padding: 0.25em 0.8em;
  background: rgba(13, 11, 18, 0.85);
  border: 1px solid var(--panel-edge);
  border-radius: 999px;
  min-height: 36px;
}
.enemy .intent .num { font-family: var(--font-num); font-size: var(--text-lg); }
.enemy .intent .atk { color: var(--accent-soft); }
.enemy .ehp { width: 150px; }
.ehp .hpbar { width: 100%; height: 12px; }
.ehp .hptext { display: flex; justify-content: space-between; font-size: var(--text-sm); color: var(--muted); font-family: var(--font-num); }
.status-row { display: flex; gap: 0.35em; flex-wrap: wrap; justify-content: center; min-height: 1.6em; }
.status-chip {
  font-size: var(--text-sm); font-weight: 700;
  padding: 0.05em 0.55em;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  cursor: pointer;
  transition: border-color 0.18s;
}
.status-chip:hover { border-color: var(--gold); }
.status-chip.buff { color: var(--good); }
.status-chip.debuff { color: var(--accent-soft); }
.block-badge {
  display: inline-flex; align-items: center; gap: 0.3em;
  color: var(--c-block); font-weight: 900; font-family: var(--font-num); font-size: var(--text-lg);
}

/* プレイヤー帯 */
.player-strip {
  display: flex; align-items: center; gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  border-top: 1px solid var(--panel-edge);
  background: rgba(29, 24, 40, 0.75);
  flex-wrap: wrap;
}
.player-strip .pname { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); }
.player-strip .hpwrap { display: flex; align-items: center; gap: var(--space-sm); }
.player-strip .hptext { font-family: var(--font-num); font-weight: 600; }

/* 手札エリア */
.hand-area {
  position: relative;
  display: flex; align-items: flex-end; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  background: linear-gradient(180deg, transparent, rgba(13, 11, 18, 0.65));
}
.energy-orb {
  flex-shrink: 0;
  width: 86px; height: 86px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #ffb36b, var(--accent) 58%, #7c1f10);
  border: 3px solid #f4a261;
  box-shadow: 0 0 28px rgba(232, 71, 43, 0.5);
  font-family: var(--font-num);
}
.energy-orb .val { font-size: 1.9rem; font-weight: 700; line-height: 1.05; }
.energy-orb .lab { font-size: 0.875rem; letter-spacing: 0.15em; font-family: var(--font-body); font-weight: 700; }

.hand { flex: 1; display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 215px; flex-wrap: wrap; }

.battle-side { display: flex; flex-direction: column; gap: var(--space-sm); align-items: flex-end; flex-shrink: 0; }
.pile-chip {
  color: var(--muted); font-size: var(--text-sm); font-weight: 700;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 8px;
  padding: 0.3em 0.7em; min-height: 44px; min-width: 56px;
  cursor: pointer; transition: border-color 0.18s, color 0.18s;
}
.pile-chip:hover { border-color: var(--gold); color: var(--ink); }
.endturn { min-width: 130px; }

/* ---------- カード ---------- */
.card {
  position: relative;
  width: 142px; min-height: 196px;
  border-radius: 12px;
  padding: 30px 12px 12px;
  background: linear-gradient(170deg, #2b2440 0%, #211a30 100%);
  border: 2px solid var(--ctype, var(--panel-edge));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  user-select: none;
  flex-shrink: 0;
}
.card.attack { --ctype: var(--c-attack); }
.card.skill { --ctype: var(--c-skill); }
.card.power { --ctype: var(--c-power); }
.card .cost {
  position: absolute; top: -12px; left: -10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #4d4366, #241d33 70%);
  border: 2px solid var(--ctype, var(--panel-edge));
  font-family: var(--font-num); font-weight: 700; font-size: 1.15rem;
}
.card .cname { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.card .ctype-label { font-size: 0.875rem; color: var(--ctype); font-weight: 700; letter-spacing: 0.12em; }
.card .cdesc { font-size: 0.875rem; line-height: 1.55; color: #d9d0c0; flex: 1; }
.card.up .cname { color: var(--gold); }
.card.up { box-shadow: 0 6px 16px rgba(0,0,0,0.45), 0 0 14px rgba(217, 164, 65, 0.28); }
.card.playable { cursor: pointer; }
.card.playable:hover { transform: translateY(-16px) scale(1.06); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6), 0 0 18px color-mix(in srgb, var(--ctype) 50%, transparent); z-index: 5; }
.card.unplayable { opacity: 0.55; filter: saturate(0.55); }
.card.selected { transform: translateY(-20px) scale(1.08); box-shadow: 0 0 0 3px var(--gold), 0 18px 36px rgba(0,0,0,0.6); z-index: 6; }
.card.pickable { cursor: pointer; }
.card.pickable:hover { transform: translateY(-8px) scale(1.05); box-shadow: 0 0 0 3px var(--gold), 0 14px 28px rgba(0,0,0,0.55); }
.card-deal { animation: card-deal 0.34s ease both; }
@keyframes card-deal { from { opacity: 0; transform: translateY(34px) rotate(3deg); } to { opacity: 1; } }

/* ターゲット選択バナー */
.target-banner {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(13, 11, 18, 0.92);
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.5em 1.6em;
  font-weight: 700;
  z-index: 40;
  animation: title-in 0.25s ease both;
}

/* 敵ターンバナー */
.turn-banner {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 11, 18, 0.55);
  z-index: 60;
  pointer-events: all;
}
.turn-banner .text {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: 0.4em;
  color: var(--accent-soft);
  text-shadow: 0 0 40px rgba(232, 71, 43, 0.6);
  animation: banner-zoom 0.8s ease both;
}
@keyframes banner-zoom { from { opacity: 0; transform: scale(1.35); } 30% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } to { opacity: 0; } }

/* ダメージフロート */
.float-num {
  position: absolute;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.7rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  animation: float-up 1s ease-out both;
  z-index: 95;
}
.float-num.dmg { color: #ff8a70; }
.float-num.heal { color: var(--good); }
.float-num.block { color: var(--c-block); }
@keyframes float-up { from { opacity: 1; transform: translateY(0) scale(1); } 25% { transform: translateY(-14px) scale(1.25); } to { opacity: 0; transform: translateY(-58px) scale(0.95); } }

.shake { animation: screen-shake 0.4s ease; }
@keyframes screen-shake { 0%,100% { transform: translate(0); } 20% { transform: translate(-7px, 3px); } 45% { transform: translate(6px, -3px); } 70% { transform: translate(-4px, 2px); } }

/* ============================================================
   報酬・休憩・商店・イベント
   ============================================================ */
.panel-screen {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-xl) var(--space-md);
  gap: var(--space-lg);
  animation: title-in 0.4s ease both;
}
.panel-screen h2 { font-size: var(--text-2xl); letter-spacing: 0.25em; color: var(--gold); }
.panel-screen .lead { color: var(--muted); max-width: 560px; text-align: center; font-size: var(--text-base); }
.panel-screen .big-emoji { font-size: 4.5rem; line-height: 1; filter: drop-shadow(0 10px 22px rgba(0,0,0,0.5)); }

.choice-row { display: flex; gap: var(--space-md); flex-wrap: wrap; justify-content: center; }
.choice-col { display: flex; flex-direction: column; gap: var(--space-md); width: 100%; max-width: 460px; }
.choice-col .btn { justify-content: flex-start; text-align: left; min-height: 56px; line-height: 1.5; }

.reward-list { display: flex; flex-direction: column; gap: var(--space-md); width: 100%; max-width: 460px; }
.reward-item {
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
  min-height: 56px;
}
.reward-item .ricon { font-size: 1.6rem; }
.reward-item.done { opacity: 0.45; }

/* 商店 */
.shop-grid { display: flex; gap: var(--space-md); flex-wrap: wrap; justify-content: center; max-width: 900px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.shop-item .price { font-family: var(--font-num); color: var(--gold); font-weight: 700; font-size: var(--text-lg); }
.shop-item.sold { opacity: 0.35; pointer-events: none; }
.shop-item .relic-big {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .18s, transform .18s;
}
.shop-item .relic-big:hover { border-color: var(--gold); transform: translateY(-4px); }
.shop-item .rname { font-size: var(--text-sm); font-weight: 700; max-width: 120px; text-align: center; line-height: 1.4; }

/* レリック獲得表示 */
.relic-gain {
  display: flex; align-items: center; gap: var(--space-md);
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  max-width: 460px;
}
.relic-gain .remoji { font-size: 2.4rem; }
.relic-gain .rtitle { font-weight: 900; color: var(--gold); }
.relic-gain .rdesc { color: var(--muted); font-size: var(--text-sm); }

/* ============================================================
   オーバーレイ（カード選択・デッキ閲覧）
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(13, 11, 18, 0.94);
  backdrop-filter: blur(5px);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-xl) var(--space-md);
  overflow-y: auto;
  z-index: 70;
  animation: fade-in 0.22s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal h2 { font-size: var(--text-2xl); letter-spacing: 0.2em; color: var(--gold); margin-bottom: var(--space-lg); }
.modal .card-grid { display: flex; flex-wrap: wrap; gap: var(--space-md); justify-content: center; max-width: 1000px; margin-bottom: var(--space-lg); }
.modal .modal-actions { display: flex; gap: var(--space-md); margin-top: var(--space-sm); }

/* 情報モーダル（レリック一覧・状態の説明） */
.info-list {
  display: flex; flex-direction: column; gap: var(--space-sm);
  width: min(560px, 92vw);
  max-height: 60vh; overflow-y: auto;
  margin-bottom: var(--space-md);
}
.info-row {
  display: flex; align-items: flex-start; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  text-align: left;
}
.info-row .info-icon { font-size: 1.7rem; line-height: 1.3; flex-shrink: 0; }
.info-row .info-body b { color: var(--gold); }
.info-row .info-body p { color: var(--muted); font-size: var(--text-sm); line-height: 1.6; }

/* ============================================================
   勝利・敗北
   ============================================================ */
.end-screen { text-align: center; }
.end-screen h1 { font-size: clamp(3rem, 8vw, 5rem); letter-spacing: 0.3em; margin-bottom: var(--space-sm); }
.end-screen h1.win { color: var(--gold); text-shadow: 0 0 50px rgba(217, 164, 65, 0.4); }
.end-screen h1.lose { color: var(--accent); text-shadow: 0 0 50px rgba(232, 71, 43, 0.4); }
.score-table {
  margin: var(--space-lg) auto;
  border-collapse: collapse;
  min-width: 300px;
}
.score-table td { padding: 0.45em 1.2em; border-bottom: 1px solid var(--panel-edge); text-align: left; }
.score-table td:last-child { text-align: right; font-family: var(--font-num); font-weight: 600; }
.score-table tr.total td { border-bottom: none; color: var(--gold); font-weight: 900; font-size: var(--text-xl); }
.unlock-note { color: var(--good); font-weight: 700; animation: title-in 0.7s 0.4s ease both; }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 900px) {
  .title-screen { grid-template-columns: 1fr; gap: var(--space-lg); padding: var(--space-lg); }
  .title-tate { writing-mode: horizontal-tb; font-size: clamp(2.6rem, 11vw, 4rem); letter-spacing: 0.12em; text-align: center; }
  .title-side.left, .title-side.right { justify-self: center; text-align: center; align-items: center; }
}
@media (max-width: 640px) {
  /* 手札は折り返さず横スクロール。気力玉と操作列は下段にまとめる */
  .hand-area { flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-sm) var(--space-md) var(--space-md); }
  .hand {
    order: -1; flex-basis: 100%;
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    min-height: 0; gap: 6px; padding: 6px 2px;
  }
  .card { width: 118px; min-height: 168px; }
  .energy-orb { width: 60px; height: 60px; }
  .energy-orb .val { font-size: 1.3rem; }
  .battle-side { flex: 1; flex-direction: row; align-items: center; justify-content: flex-end; gap: var(--space-xs); }
  .pile-chip { min-width: 48px; padding: 0.3em 0.45em; }
  .endturn { min-width: 0; white-space: nowrap; padding: 0.65em 0.9em; }
  /* 敵3体が縦積みにならないよう、固定幅(ehp 150px)をやめて等分で横に並べる */
  .enemy { min-width: 0; flex: 1 1 0; max-width: 180px; padding: var(--space-xs); }
  .enemy .ehp { width: 100%; max-width: 150px; }
  .enemy .sprite { font-size: clamp(2.2rem, 11vw, 3.4rem); }
  .enemy-area { gap: var(--space-xs); align-content: center; padding: var(--space-xs) var(--space-xs) 0; }
  .player-strip { padding: 4px var(--space-md); }
  .hand-area { padding: var(--space-xs) var(--space-sm) var(--space-sm); }
  .hud { gap: var(--space-sm); padding: var(--space-sm); }
  .hud .seed { display: none; }
  .hpbar { width: 90px; }
  /* HUDが2段(約100px)に折り返すため、その分を引いて1画面に収める */
  .battle-screen { min-height: calc(100dvh - 100px); }
}

/* ============================================================
   戦闘演出（カード飛翔・敵ランジ・大ダメージ・コーチ・日替わり）
   ============================================================ */
.float-num.big { font-size: 2.6rem; color: #ff5a3c; }
.float-num.act {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.enemy .intent { cursor: pointer; }
.enemy.lunge .sprite { animation: lunge 0.38s ease; }
@keyframes lunge {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(26px) scale(1.14); filter: drop-shadow(0 0 14px rgba(232, 71, 43, 0.7)); }
  100% { transform: translateY(0) scale(1); }
}
.fly-ghost {
  position: fixed; margin: 0; z-index: 95; pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.5, 0, 0.9, 0.4), opacity 0.38s ease;
  will-change: transform, opacity;
}
.coach-bubble {
  position: fixed; transform: translate(-50%, -100%); z-index: 70;
  background: var(--gold); color: #1c1410;
  font-weight: 700; font-size: var(--text-base); line-height: 1.5;
  width: max-content; max-width: min(320px, 86vw); text-align: center;
  padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  animation: coach-bob 1.6s ease-in-out infinite;
  pointer-events: none;
}
.coach-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--gold); border-bottom: 0;
}
@keyframes coach-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -7px; } }
.daily-note { font-size: var(--text-sm); color: var(--muted); margin: 0; max-width: 320px; line-height: 1.6; }
.daily-note b { color: var(--gold); }

/* ============================================================
   第4弾: 操作性改善（ツールチップ・マップ確認・各種フィードバック）
   ============================================================ */
/* 即時ホバーツールチップ（タッチ端末ではタップモーダルが担当） */
@media (hover: hover) and (pointer: fine) {
  [data-tip] { position: relative; }
  [data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    background: #211c2c; color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 8px 12px; border-radius: 8px;
    font-size: 0.875rem; font-weight: 500; line-height: 1.5; letter-spacing: normal;
    width: max-content; max-width: 260px; white-space: normal; text-align: left;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    z-index: 130; pointer-events: none;
  }
  /* HUD内は画面上端で見切れるので下に出し、右端を超えないよう右寄せ */
  .hud [data-tip]:hover::after { bottom: auto; top: calc(100% + 10px); left: auto; right: 0; transform: none; }
}

/* HUDの種ボタン・マップボタン */
.hud .seed { background: none; border: none; cursor: pointer; font-family: inherit; padding: 4px 6px; min-height: 44px; }
.hud .seed:hover { color: var(--gold); }

/* ブロックバッジをタップ可能に */
button.block-badge { background: none; border: none; cursor: pointer; padding: 2px 4px; }

/* ターン数チップ */
.turn-chip { color: var(--muted); font-size: var(--text-sm); font-family: var(--font-num); letter-spacing: 0.08em; white-space: nowrap; }

/* 商店: 買えない価格 */
.price.cant { color: var(--accent-soft); }

/* 気力不足フィードバック */
.float-num.warn { color: var(--gold); font-size: 1.1rem; font-family: var(--font-display); white-space: nowrap; }
.card.deny { animation: deny-shake 0.3s ease; }
@keyframes deny-shake { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }

/* やることがない時のターン終了ボタン誘導 */
.endturn.pulse { animation: endturn-pulse 1.4s ease-in-out infinite; }
@keyframes endturn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 71, 43, 0.55); }
  50% { box-shadow: 0 0 0 9px rgba(232, 71, 43, 0); }
}

/* マップ確認モーダル */
.map-peek .tower-wrap { width: 100%; display: flex; justify-content: center; }
.map-peek .map-node { cursor: default; }
/* 実効値（筋力・敏捷・弱体反映）で変化しているカード説明 */
.cdesc.modded { color: var(--gold); }

/* ============================================================
   第5弾: 霊符・流派・呪い・百鬼帖・登塔録
   ============================================================ */

/* 呪いカード（暗紫・禍々しく） */
.card.curse { --ctype: #7c3aed; }
.card.curse { background: linear-gradient(160deg, #1c1426, #14101c); }
.card.curse .cname { color: #b794f6; }

/* HUD 霊符チップ */
.hud .talis-strip { display: flex; align-items: center; gap: 0.35em; }
.hud .talis-chip {
  font-size: 1.25rem; line-height: 1;
  padding: 0.3em 0.32em;
  min-width: 44px; min-height: 40px;
  background: linear-gradient(160deg, #221a2e, var(--panel));
  border: 1px solid #5b4a78;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.18s, transform 0.18s;
}
.hud .talis-chip:hover { border-color: var(--gold); transform: translateY(-2px); }
.hud .talis-empty {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; min-height: 40px;
  color: var(--muted);
  border: 1px dashed rgba(122, 110, 140, 0.45);
  border-radius: 8px;
  font-size: 1rem;
  user-select: none;
}

/* タイトル: 流派選択 */
.style-row { display: flex; gap: var(--space-sm); width: 100%; max-width: 320px; }
.style-chip {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 0.2em;
  padding: var(--space-sm) var(--space-xs);
  min-height: 64px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.style-chip .semoji { font-size: 1.5rem; line-height: 1; }
.style-chip .sname { font-family: var(--font-display); font-size: var(--text-sm); letter-spacing: 0.15em; color: var(--muted); }
.style-chip:hover { border-color: var(--gold); transform: translateY(-2px); }
.style-chip.on {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(232, 71, 43, 0.16), var(--panel));
  box-shadow: 0 0 14px rgba(232, 71, 43, 0.25);
}
.style-chip.on .sname { color: var(--ink); }
.style-desc { color: var(--muted); font-size: var(--text-sm); min-height: 1.6em; max-width: 320px; }

/* タイトル: 百鬼帖・登塔録ボタン */
.title-extra { display: flex; flex-direction: column; gap: var(--space-sm); width: 100%; max-width: 280px; }
.title-extra .btn { justify-content: space-between; font-size: var(--text-base); }
.title-extra .cnt { font-family: var(--font-num); color: var(--gold); font-size: var(--text-sm); }

/* 百鬼帖（妖怪図鑑） */
.modal.bestiary { max-width: 980px; }
.bestiary-act {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.25em;
  color: var(--gold);
  margin: var(--space-lg) 0 var(--space-sm);
  border-bottom: 1px solid var(--panel-edge);
  padding-bottom: var(--space-xs);
  width: 100%; max-width: 880px;
  text-align: left;
}
.bestiary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-sm);
  width: 100%; max-width: 880px;
}
.bestiary-cell {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  column-gap: var(--space-sm);
  align-items: center;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  min-height: 88px;
}
.bestiary-cell .bemoji { grid-row: 1 / 4; font-size: 1.9rem; line-height: 1; }
.bestiary-cell .bname { font-weight: 700; font-size: var(--text-base); }
.bestiary-cell .bkind {
  margin-left: 0.5em;
  font-size: 0.78rem; font-weight: 700;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 0.3em;
  vertical-align: 0.1em;
}
.bestiary-cell .bmeta { color: var(--muted); font-size: var(--text-sm); font-family: var(--font-num); }
.bestiary-cell .bmoves { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.bestiary-cell.unknown { opacity: 0.6; filter: saturate(0.4); }

/* 登塔録（ラン履歴） */
.history-table {
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  font-size: var(--text-sm);
  min-width: min(520px, 86vw);
}
.history-table th {
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: var(--space-xs) var(--space-md) var(--space-xs) 0;
  border-bottom: 1px solid var(--panel-edge);
}
.history-table td {
  padding: var(--space-xs) var(--space-md) var(--space-xs) 0;
  border-bottom: 1px solid rgba(58, 48, 74, 0.4);
}
.history-table td:nth-child(5) { font-family: var(--font-num); color: var(--gold); }
.history-table tr.win td { color: var(--ink); }
.history-table tr.win td:nth-child(4) { color: var(--good); font-weight: 700; }

/* モバイル調整 */
@media (max-width: 640px) {
  .hud .talis-chip { min-width: 40px; min-height: 38px; font-size: 1.1rem; }
  .hud .talis-empty { min-width: 24px; min-height: 38px; }
  .style-row { max-width: 100%; }
  .bestiary-grid { grid-template-columns: 1fr 1fr; }
  .bestiary-cell { padding: var(--space-xs) var(--space-sm); min-height: 72px; }
  .bestiary-cell .bmoves { display: none; }
  .history-table { font-size: 0.85rem; }
  .title-extra { flex-direction: row; max-width: 100%; }
  .title-extra .btn { font-size: var(--text-sm); }
}
