/* =========================================================
   黒曜の鐘楼 — メインスタイルシート
   漆黒の黒曜石・古びた青銅鐘の金彩・紅筋の結晶・夜明け前の灰金色モチーフ
   ========================================================= */

:root {
  --bg-deep: #06060b;
  --bg-panel: rgba(13, 12, 20, 0.94);
  --bg-panel-solid: #0d0c14;
  --bg-card: rgba(20, 18, 30, 0.88);
  --bg-card-hover: rgba(30, 27, 44, 0.96);
  --border-subtle: rgba(196, 174, 140, 0.16);
  --border-strong: rgba(212, 162, 89, 0.34);

  --text-main: #ebe6dc;
  --text-prose: #e5dfd4;
  --text-muted: #a69c8e;
  --text-dim: #6f675e;

  --accent-cyan: #d4a259;
  --accent-cyan-soft: rgba(212, 162, 89, 0.15);
  --accent-crimson: #d92648;
  --accent-crimson-dark: #881337;
  --accent-crimson-soft: rgba(217, 38, 72, 0.18);
  --accent-violet: #a78bfa;
  --accent-violet-soft: rgba(167, 139, 250, 0.16);
  --accent-amber: #e59a24;
  --accent-amber-soft: rgba(229, 154, 36, 0.16);
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.14);

  --font-serif: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", Georgia, serif;
  --font-sans: "Noto Sans JP", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", -apple-system, sans-serif;
  --font-mono: "Consolas", "Cascadia Code", "Courier New", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-panel: 0 12px 32px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 背景オーバーレイ（漆黒の船倉・月光と波紋の揺らぎ） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(125, 211, 252, 0.08), transparent 55%),
    radial-gradient(circle at 18% 85%, rgba(217, 119, 6, 0.06), transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(190, 18, 60, 0.06), transparent 50%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px,
      transparent 28px
    );
  pointer-events: none;
  z-index: 0;
}

#vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: box-shadow 0.8s ease, opacity 0.8s ease;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.75);
}

body.state-high-pain #vignette-overlay {
  box-shadow: inset 0 0 130px rgba(190, 18, 60, 0.42), inset 0 0 40px rgba(0, 0, 0, 0.85);
  animation: pulseVignette 2.4s infinite ease-in-out;
}

body.state-high-corrupt #vignette-overlay {
  box-shadow: inset 0 0 135px rgba(126, 34, 206, 0.38), inset 0 0 45px rgba(0, 0, 0, 0.88);
}

body.state-forced-awake #vignette-overlay {
  box-shadow: inset 0 0 160px rgba(225, 29, 72, 0.55), inset 0 0 60px rgba(15, 23, 42, 0.9);
  animation: pulseVignette 1.5s infinite ease-in-out;
}

body.state-dead #vignette-overlay {
  box-shadow: inset 0 0 190px rgba(136, 19, 55, 0.8), inset 0 0 80px rgba(0, 0, 0, 0.96);
  animation: pulseDeadVignette 1.8s infinite ease-in-out;
}

body.state-unconscious #vignette-overlay {
  box-shadow: inset 0 0 180px rgba(88, 28, 135, 0.7), inset 0 0 70px rgba(0, 0, 0, 0.92);
}

@keyframes pulseDeadVignette {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; filter: grayscale(60%); }
}

@keyframes pulseVignette {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.55); }
  50% { box-shadow: 0 0 14px 3px rgba(225, 29, 72, 0.75); }
}

@keyframes subtleTremble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ユーティリティ */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

#app-root {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

/* =========================================================
   ボタンスタイル
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #9f1239, #be123c);
  border-color: #f43f5e;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(190, 18, 60, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #be123c, #e11d48);
  border-color: #fda4af;
  box-shadow: 0 6px 22px rgba(225, 29, 72, 0.5);
}

.btn-cyan {
  background: linear-gradient(135deg, #0c4a6e, #0369a1);
  border-color: #38bdf8;
  color: #f0f9ff;
}

.btn-cyan:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  border-color: #7dd3fc;
}

.btn-fail-roll {
  background: linear-gradient(135deg, #3b0764, #581c87);
  border-color: #c084fc;
  color: #f5d0fe;
}

.btn-fail-roll:hover:not(:disabled) {
  background: linear-gradient(135deg, #581c87, #7e22ce);
  border-color: #e879f9;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.4);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.02rem;
}

.btn-spoiler {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.4), rgba(153, 27, 27, 0.35));
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.btn-spoiler:hover:not(:disabled) {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.55), rgba(185, 28, 28, 0.5));
}

/* =========================================================
   開始画面（キャラクター設定）
   ========================================================= */
.setup-screen {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  animation: fadeIn 0.5s ease;
}

.hero-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 32px 24px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(7, 9, 13, 0.9));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  position: relative;
  overflow: hidden;
}

.hero-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-crimson), transparent);
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  color: #f8fafc;
  text-shadow: 0 2px 24px rgba(56, 189, 248, 0.22);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 680px;
  margin: 0 auto 14px;
}

.hero-notice {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-crimson-soft);
  border: 1px solid rgba(225, 29, 72, 0.35);
  color: #fda4af;
  font-size: 0.8rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 22px;
  margin-bottom: 26px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-panel);
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-text, .input-select, .input-number {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(7, 10, 16, 0.85);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.input-text:focus, .input-select:focus, .input-number:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.radio-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-cards-2col {
  grid-template-columns: repeat(2, 1fr);
}

.radio-card {
  position: relative;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card-box {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 21, 32, 0.7);
  transition: all 0.2s;
  height: 100%;
}

.radio-card input:checked + .radio-card-box {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.radio-card-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #f8fafc;
  display: block;
  margin-bottom: 3px;
}

.radio-card-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: block;
  line-height: 1.4;
}

.tone-preview {
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: #cbd5e1;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat-box {
  background: rgba(7, 10, 16, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  text-align: center;
}

.stat-box label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.stat-box input {
  text-align: center;
  padding: 5px 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.derived-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.derived-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.derived-item label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(7, 10, 16, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}

.skill-item label {
  font-size: 0.8rem;
  color: var(--text-main);
  white-space: nowrap;
}

.skill-item input {
  width: 62px;
  padding: 4px 6px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.post-clear-banner {
  margin-top: 28px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(24, 16, 36, 0.9), rgba(30, 15, 24, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.35);
  text-align: center;
}

.post-clear-banner h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  color: #fde68a;
  font-size: 1.05rem;
}

.post-clear-banner p {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.post-clear-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* =========================================================
   プレイ画面（サイドバー＋本文）
   ========================================================= */
.play-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* サイドバー：ヨワ特化ステータス＆モニター */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(9, 12, 18, 0.96);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 3px; }

.explorer-plate {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 18, 32, 0.85));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.explorer-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.explorer-name {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: #f8fafc;
}

.explorer-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.forced-awake-alert {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-crimson-dark);
  border: 1px solid #fb7185;
  color: #ffe4e6;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  animation: pulseBadge 1.6s infinite;
}

.dead-alert {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(136, 19, 55, 0.95);
  border: 1px solid #fda4af;
  color: #ffe4e6;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  animation: pulseBadge 1.2s infinite;
}

.unconscious-alert {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(88, 28, 135, 0.95);
  border: 1px solid #d8b4fe;
  color: #fae8ff;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.insanity-alert {
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(120, 53, 15, 0.95);
  border: 1px solid #f59e0b;
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}

.monitor-section {
  background: rgba(15, 20, 30, 0.72);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.monitor-heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ゲージ類 */
.vital-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.vital-pill {
  background: rgba(7, 10, 16, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 6px;
  text-align: center;
}

.vital-pill.danger {
  border-color: var(--accent-crimson);
  background: rgba(136, 19, 55, 0.3);
}

.vital-pill.dead {
  border-color: #f43f5e;
  background: rgba(159, 18, 57, 0.65);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
}

.vital-pill.unconscious {
  border-color: #c084fc;
  background: rgba(88, 28, 135, 0.65);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.45);
}

.vital-pill-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.vital-pill-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 700;
  color: #f8fafc;
}

.gauge-row {
  margin-bottom: 9px;
}

.gauge-row:last-child {
  margin-bottom: 0;
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.gauge-label { color: #cbd5e1; }
.gauge-val { font-family: var(--font-mono); font-weight: 600; }

.gauge-track {
  height: 8px;
  background: rgba(7, 10, 16, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s;
}

.gauge-pain { background: linear-gradient(90deg, #f59e0b, #e11d48); }
.gauge-pain.critical { animation: pulseBadge 1.4s infinite; }
.gauge-dignity { background: linear-gradient(90deg, #64748b, #38bdf8); }
.gauge-dignity.low { background: linear-gradient(90deg, #7f1d1d, #a855f7); }
.gauge-control { background: linear-gradient(90deg, #0ea5e9, #10b981); }
.gauge-control.low { background: linear-gradient(90deg, #b91c1c, #f59e0b); }
.gauge-corrupt { background: linear-gradient(90deg, #6d28d9, #d946ef); }

/* 動的テキストモニター */
.text-monitor-item {
  margin-bottom: 8px;
  padding: 7px 9px;
  background: rgba(7, 10, 16, 0.82);
  border-left: 2px solid var(--accent-cyan);
  border-radius: 0 4px 4px 0;
}

.text-monitor-item.voice-critical { border-left-color: var(--accent-crimson); }
.text-monitor-item.body-critical { border-left-color: var(--accent-violet); }

.text-monitor-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.text-monitor-value {
  display: block;
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.45;
  font-family: var(--font-serif);
}

/* 状態異常タグ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.status-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.status-tag.tag-pain { background: rgba(136, 19, 55, 0.45); border-color: rgba(244, 63, 94, 0.5); color: #fecdd3; }
.status-tag.tag-shame { background: rgba(88, 28, 135, 0.45); border-color: rgba(192, 132, 252, 0.5); color: #f3e8ff; }
.status-tag.tag-phys { background: rgba(120, 53, 15, 0.45); border-color: rgba(251, 191, 36, 0.45); color: #fef3c7; }
.status-tag.tag-mythos { background: rgba(6, 78, 59, 0.5); border-color: rgba(52, 211, 153, 0.45); color: #d1fae5; }

.sidebar-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: auto;
}

.clue-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-amber);
  color: #090b0f;
  font-size: 0.7rem;
  font-weight: 700;
}

/* =========================================================
   メインストーリーペイン
   ========================================================= */
.story-main {
  padding: 32px clamp(20px, 4vw, 56px) 80px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}

.scene-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeIn 0.4s ease;
}

.scene-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.act-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-cyan-soft);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
}

.time-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.scene-title {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin: 0;
  color: #f8fafc;
  letter-spacing: 0.06em;
}

/* 本文エリア */
.prose-container {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 2.02;
  color: var(--text-prose);
  animation: fadeIn 0.45s ease;
}

.prose-container p {
  margin: 0 0 1.35em;
  text-align: justify;
}

.prose-container .dialogue-captor {
  padding: 12px 16px;
  margin: 1.3em 0;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(15, 23, 42, 0.62);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #e0f2fe;
}

.prose-container .dialogue-pc {
  padding: 10px 16px;
  margin: 1.15em 0;
  border-left: 3px solid #94a3b8;
  background: rgba(30, 41, 59, 0.42);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #f8fafc;
}

.prose-container .agony-block {
  padding: 14px 18px;
  margin: 1.4em 0;
  border-left: 3px solid var(--accent-crimson);
  background: linear-gradient(90deg, rgba(136, 19, 55, 0.24), rgba(13, 17, 24, 0.55));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #ffe4e6;
}

.prose-container .whisper-block {
  padding: 12px 16px;
  margin: 1.3em 0;
  border: 1px dashed rgba(168, 85, 247, 0.45);
  background: rgba(59, 7, 100, 0.22);
  border-radius: var(--radius-sm);
  color: #e9d5ff;
  font-style: italic;
}

.prose-container .system-log {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  padding: 10px 14px;
  margin: 1.2em 0;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-strong);
  color: #cbd5e1;
}

.prose-container .clue-toast {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 12px 16px;
  margin: 1.4em 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.35), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef3c7;
}

/* =========================================================
   ダイス判定パネル
   ========================================================= */
.dice-panel {
  margin-top: 26px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(10, 14, 22, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: var(--shadow-panel);
  animation: fadeIn 0.35s ease;
}

.dice-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dice-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: #f0f9ff;
}

.dice-target-badge {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.dice-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.dice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dice-result-box {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

.dice-result-box.res-success {
  background: var(--accent-emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #a7f3d0;
}

.dice-result-box.res-fail {
  background: var(--accent-crimson-soft);
  border: 1px solid rgba(244, 63, 94, 0.55);
  color: #fecdd3;
}

.dice-number {
  font-size: 1.6rem;
  font-weight: 800;
}

/* =========================================================
   選択肢ボタンリスト
   ========================================================= */
.choices-panel {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

.choice-btn {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(19, 25, 36, 0.94), rgba(13, 17, 25, 0.96));
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.choice-btn:hover {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(28, 38, 56, 0.98), rgba(16, 23, 35, 0.98));
  transform: translateX(4px);
}

.choice-btn.choice-submit {
  border-color: rgba(168, 85, 247, 0.45);
  background: linear-gradient(135deg, rgba(46, 16, 72, 0.65), rgba(18, 12, 28, 0.94));
}

.choice-btn.choice-submit:hover {
  border-color: #d8b4fe;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.28);
}

.choice-btn.choice-resist {
  border-color: rgba(225, 29, 72, 0.4);
}

.choice-btn.choice-resist:hover {
  border-color: #fb7185;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.25);
}

.choice-btn.choice-tremble {
  animation: subtleTremble 0.45s infinite;
}

.choice-main-text {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: #f8fafc;
}

.choice-sub-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.choice-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.choice-tag.tag-resist { background: rgba(225, 29, 72, 0.2); color: #fda4af; }
.choice-tag.tag-submit { background: rgba(168, 85, 247, 0.22); color: #e9d5ff; }
.choice-tag.tag-cost { background: rgba(245, 158, 11, 0.2); color: #fde68a; }

/* =========================================================
   推理・仮説検証パネル
   ========================================================= */
.deduction-panel {
  margin-top: 26px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(9, 13, 21, 0.98));
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: var(--shadow-panel);
}

.deduction-panel h3 {
  font-family: var(--font-serif);
  color: #fde68a;
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.deduction-q {
  margin: 18px 0;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 16, 0.78);
  border: 1px solid var(--border-subtle);
}

.deduction-q label {
  display: block;
  font-family: var(--font-serif);
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 10px;
  font-size: 0.98rem;
}

.deduction-hint-box {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid var(--accent-emerald);
  font-size: 0.82rem;
  color: #a7f3d0;
}

/* =========================================================
   エンディングバナー
   ========================================================= */
.ending-banner {
  margin: 28px 0;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 12, 24, 0.92));
  box-shadow: var(--shadow-panel);
}

.ending-type {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--accent-amber);
  margin-bottom: 8px;
}

.ending-title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  margin: 0 0 10px;
  color: #f8fafc;
}

.ending-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* =========================================================
   モーダル（手がかり／セーブ／ネタバレ二段階ロック／真相／ギャラリー）
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.82);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.modal-box.modal-wide {
  max-width: 980px;
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  color: #f8fafc;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(11, 15, 23, 0.9);
}

/* 手がかりカード */
.clue-card {
  padding: 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 32, 0.88);
  border: 1px solid var(--border-subtle);
}

.clue-card-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: #fde68a;
  margin: 0 0 8px;
}

.clue-card-fact {
  font-size: 0.9rem;
  color: var(--text-prose);
  margin: 0 0 10px;
  line-height: 1.75;
}

.clue-card-hint {
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.11);
  border-left: 3px solid var(--accent-emerald);
  font-size: 0.86rem;
  color: #a7f3d0;
  line-height: 1.65;
}

.clue-card-hint-locked {
  padding: 8px 12px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.12);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* セーブスロット */
.save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 32, 0.85);
  border: 1px solid var(--border-subtle);
}

/* 真相シート用 */
.truth-doc h3 {
  font-family: var(--font-serif);
  color: #fde68a;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 6px;
  margin-top: 26px;
}

.truth-doc h4 {
  color: #7dd3fc;
  margin: 16px 0 8px;
}

.truth-doc blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.88rem;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.truth-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin: 12px 0;
}

.truth-table th, .truth-table td {
  border: 1px solid var(--border-subtle);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.truth-table th {
  background: rgba(30, 41, 59, 0.85);
  color: #fde68a;
}

/* ギャラリー */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gallery-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(15, 21, 32, 0.88);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text-main);
}

.gallery-item:hover {
  border-color: var(--accent-violet);
  background: rgba(46, 16, 72, 0.35);
}

.gallery-item-cat {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 4px;
}

.gallery-item-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 4px;
}

.gallery-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.warning-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(136, 19, 55, 0.26);
  border: 1px solid rgba(244, 63, 94, 0.55);
  color: #ffe4e6;
  margin-bottom: 16px;
  line-height: 1.75;
}

/* レスポンシブ */
@media (max-width: 960px) {
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .play-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .radio-cards { grid-template-columns: 1fr; }
}

/* =========================================================
   追加スタイル：いあきゃらインポート・RP入力欄・BCDice・通過ログ
   ========================================================= */
.iachara-box {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(14, 30, 52, 0.85), rgba(15, 21, 34, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.iachara-textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(5, 8, 14, 0.9);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: vertical;
  margin-bottom: 10px;
}

.char-avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 16, 0.8);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.char-avatar-img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--accent-cyan);
  background: #0f172a;
  flex-shrink: 0;
}

.char-avatar-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* プレイ中のロールプレイ（行動・セリフ）＆フリーBCDiceパネル */
.rp-section {
  margin-top: 26px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(13, 18, 28, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-panel);
}

.rp-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.rp-section-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: #7dd3fc;
}

.rp-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.rp-entry-card {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(20, 29, 44, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.3);
  animation: fadeIn 0.25s ease;
}

.rp-entry-avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.rp-entry-body {
  flex: 1;
  min-width: 0;
}

.rp-entry-speaker {
  font-size: 0.8rem;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 3px;
}

.rp-entry-time {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 6px;
}

.rp-entry-text {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  color: #f8fafc;
  white-space: pre-wrap;
  line-height: 1.75;
}

.rp-dice-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: rgba(15, 23, 42, 0.92);
  border-left: 3px solid var(--accent-cyan);
}

.rp-dice-card.is-ok { border-left-color: var(--accent-emerald); color: #a7f3d0; }
.rp-dice-card.is-ng { border-left-color: var(--accent-crimson); color: #fecdd3; }

.rp-textarea {
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(6, 9, 15, 0.9);
  color: #f8fafc;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.65;
  resize: vertical;
}

.rp-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.rp-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.free-bcdice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
}

.bcdice-cmd-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(7, 10, 16, 0.9);
  border: 1px solid var(--border-subtle);
  color: #bae6fd;
}

/* =========================================================
   追加スタイル：CoC6 正気度ロール（SANチェック）＆ルルブ参照型・狂気発症パネル
   ========================================================= */
.san-panel {
  margin-top: 24px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(35, 16, 52, 0.92), rgba(14, 11, 24, 0.96));
  border: 1px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 12px 32px rgba(88, 28, 135, 0.32);
  animation: fadeIn 0.35s ease;
}

.san-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.san-panel-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: #f3e8ff;
}

.san-formula-badge {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
}

.insanity-box {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(24, 9, 38, 0.92);
  border: 1px solid #d946ef;
  box-shadow: inset 0 0 28px rgba(168, 85, 247, 0.25);
}

.insanity-rulebook-note {
  padding: 12px 14px;
  margin: 12px 0;
  border-left: 3px solid #f59e0b;
  background: rgba(120, 53, 15, 0.28);
  border-radius: 0 4px 4px 0;
  font-size: 0.86rem;
  color: #fde68a;
  line-height: 1.65;
}

.status-tag.tag-insanity {
  background: linear-gradient(135deg, rgba(112, 26, 117, 0.75), rgba(136, 19, 55, 0.75));
  border-color: #f0abfc;
  color: #fae8ff;
  font-weight: 700;
  animation: pulseBadge 2s infinite;
}

/* 死亡・救命介入パネル */
.dead-panel {
  background: rgba(26, 5, 12, 0.95);
  border: 2px solid var(--accent-crimson);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 20px;
  box-shadow: 0 0 35px rgba(225, 29, 72, 0.4);
}

.dead-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(225, 29, 72, 0.3);
}

.dead-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fecdd3;
}

.dead-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-crimson);
  color: #fff;
  font-weight: 700;
}

.dead-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #fda4af;
  margin: 0 0 16px;
}

.dead-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 気絶・意識不明パネル */
.unconscious-panel {
  background: rgba(19, 9, 36, 0.95);
  border: 2px solid #a855f7;
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 20px;
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.35);
}

.unconscious-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.3);
}

.unconscious-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fae8ff;
}

.unconscious-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #9333ea;
  color: #fff;
  font-weight: 700;
}

.unconscious-desc {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #e9d5ff;
  margin: 0 0 16px;
}

.unconscious-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-amber {
  background: #d97706;
  border-color: #f59e0b;
  color: #fff;
}
.btn-amber:hover {
  background: #b45309;
}

/* 通過ログ・ステータス変化 */
.log-status-change,
.log-status-card {
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 4px;
  font-size: 0.86rem;
  border-left: 4px solid var(--accent-crimson);
  background: rgba(225, 29, 72, 0.12);
  color: #fecdd3;
}

.log-status-change.status-revived,
.log-status-change.status-revived_reason {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
}

.log-status-change.status-conscious,
.log-status-change.status-conscious_reason {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

.log-status-change.status-unconscious {
  border-left-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  color: #e9d5ff;
}

/* =========================================================
   統一ストーリーカードストリーム（本文・セリフ・RP・ダイス直接並び替え対応）
   ========================================================= */
.story-card-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.story-card {
  position: relative;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

.story-card-prose > p {
  margin: 0;
}

.story-card-prose > .dialogue-captor,
.story-card-prose > .agony-block {
  margin: 4px 0;
}

.story-card-prose > hr {
  margin: 14px 0;
}

.story-card-status {
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.84rem;
  border-left: 3px solid var(--accent-amber);
  background: rgba(217, 119, 6, 0.12);
  color: #fde68a;
  font-family: var(--font-sans);
}

.story-card-stream .rp-entry-card {
  margin: 4px 0;
  border-left: 3px solid var(--accent-cyan);
  background: rgba(14, 30, 52, 0.78);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.story-card-stream .rp-dice-card {
  margin: 4px 0;
}


/* =========================================================
   配布用追加スタイル：ポータル戻り・幕間回復・カード型推理・SANロスト
   ========================================================= */
.portal-back-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.84rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-portal:hover {
  color: #f8fafc;
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.9);
}

.interlude-heal-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.28);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.interlude-heal-note {
  font-size: 0.76rem;
  color: #a7f3d0;
  line-height: 1.5;
  flex: 1 1 220px;
}

.deduction-q-title {
  font-family: var(--font-serif);
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 12px;
  line-height: 1.65;
}

.deduction-radio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.deduction-radio-card {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans) !important;
  font-weight: 400 !important;
  margin: 0 !important;
}

.deduction-radio-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(22, 33, 54, 0.92);
}

.deduction-radio-card:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(14, 116, 144, 0.22);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.deduction-radio-card input[type="radio"] {
  margin-top: 4px;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  accent-color: #38bdf8;
}

.deduction-radio-card.is-eliminated {
  opacity: 0.68;
  border-color: rgba(244, 63, 94, 0.42);
  background: rgba(45, 12, 24, 0.55);
}

.deduction-radio-text {
  color: #e2e8f0;
  font-size: 0.92rem;
  line-height: 1.7;
  word-break: break-word;
  white-space: normal;
}

.deduction-elim-badge {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fecdd3;
  background: rgba(225, 29, 72, 0.32);
  border: 1px solid rgba(244, 63, 94, 0.55);
  vertical-align: 1px;
}

.san-lost-panel {
  background: rgba(28, 10, 42, 0.96);
  border: 2px solid #c084fc;
  border-radius: var(--radius-md);
  padding: 22px;
  margin-top: 22px;
}

.san-lost-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.san-lost-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: #f3e8ff;
}

.san-lost-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #f5d0fe;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.5);
}

.san-lost-desc {
  font-size: 0.9rem;
  color: #e9d5ff;
  line-height: 1.75;
  margin-bottom: 14px;
}

.san-lost-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lost-narrative-box {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(7, 10, 18, 0.72);
  border-left: 3px solid rgba(244, 63, 94, 0.7);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.85;
  color: #e2e8f0;
}

.san-lost-panel .lost-narrative-box {
  border-left-color: #c084fc;
}

.unconscious-panel .lost-narrative-box {
  border-left-color: #38bdf8;
}

.lost-narrative-box p {
  margin: 0 0 10px;
}

.lost-narrative-box p:last-child {
  margin-bottom: 0;
}

.ending-miracle-box {
  text-align: left;
  max-width: 660px;
  margin: 0 auto 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #ecfdf5;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.85;
}

.ending-miracle-title {
  font-weight: 700;
  color: #6ee7b7;
  margin-bottom: 8px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}
