/* ========================================
   ゲーム企画書ドキュメント CSS
   焼肉テーマ: ダーク + 炎のアクセント
   ======================================== */

/* === リセット・ベース === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0d0a08;
  --bg-secondary: #1a1410;
  --bg-tertiary: #241c14;
  --bg-card: #1e1812;
  --bg-card-hover: #2a2018;
  --bg-sidebar: #14100c;
  --bg-code: #1c1610;
  --border-primary: rgba(200, 120, 50, 0.2);
  --border-accent: rgba(255, 140, 0, 0.35);
  --text-primary: #e8e0d6;
  --text-secondary: #b0a090;
  --text-muted: #786858;
  --accent-fire: #ff6b00;
  --accent-ember: #e94560;
  --accent-gold: #ffd700;
  --accent-warm: #d4a044;
  --accent-meat: #c0392b;
  --accent-green: #27ae60;
  --accent-blue: #3498db;
  --accent-purple: #9b59b6;
  --shadow-glow: 0 0 20px rgba(255, 107, 0, 0.15);
  --font-main: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Source Code Pro', monospace;
  --sidebar-width: 280px;
  --header-height: 56px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
}

a {
  color: var(--accent-warm);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent-gold);
}

/* === ヘッダー === */
.doc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #1a0f08 100%);
  border-bottom: 1px solid var(--border-accent);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(255, 100, 0, 0.6));
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: 400;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 107, 0, 0.12);
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 6px;
  color: var(--accent-warm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
}
.header-back:hover {
  background: rgba(255, 107, 0, 0.25);
  color: var(--accent-gold);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* === サイドバー === */
.doc-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  overflow-y: auto;
  z-index: 50;
  padding: 16px 0;
  transition: transform 0.3s ease;
}

.doc-sidebar::-webkit-scrollbar {
  width: 4px;
}
.doc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.doc-sidebar::-webkit-scrollbar-thumb {
  background: rgba(200, 120, 50, 0.3);
  border-radius: 2px;
}

.sidebar-section {
  margin-bottom: 6px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-section-title .section-icon {
  font-size: 0.9rem;
}

.sidebar-link {
  display: block;
  padding: 7px 20px 7px 36px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 3px solid transparent;
  line-height: 1.4;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 107, 0, 0.06);
  border-left-color: rgba(255, 107, 0, 0.3);
}

.sidebar-link.active {
  color: var(--accent-fire);
  background: rgba(255, 107, 0, 0.1);
  border-left-color: var(--accent-fire);
  font-weight: 600;
}

.sidebar-sub-link {
  padding-left: 48px;
  font-size: 0.82rem;
}

/* === メインコンテンツ === */
.doc-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 32px 48px 80px;
  max-width: 960px;
}

/* === セクション === */
.doc-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section-header {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-accent);
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-fire), transparent);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px rgba(255, 100, 0, 0.4));
}

/* サブセクション */
.subsection {
  margin-bottom: 36px;
}

.subsection-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-warm);
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-fire);
}

.sub-subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  margin-top: 20px;
}

/* === テキスト === */
p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

.highlight {
  color: var(--accent-fire);
  font-weight: 600;
}

.text-gold {
  color: var(--accent-gold);
}

.text-red {
  color: var(--accent-ember);
}

.text-green {
  color: var(--accent-green);
}

/* === 概要カード === */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 18px;
  transition: all var(--transition);
}

.overview-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.overview-card .card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.overview-card .card-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.overview-card .card-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

/* === コンセプトブロック === */
.concept-block {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.08) 0%, rgba(233, 69, 96, 0.06) 100%);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.concept-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-fire), var(--accent-ember));
}

.concept-quote {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-gold);
  font-style: italic;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* === テーブル === */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead {
  background: linear-gradient(135deg, #1e160e 0%, #241a10 100%);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-warm);
  border-bottom: 2px solid var(--border-accent);
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(200, 120, 50, 0.08);
  color: var(--text-secondary);
  vertical-align: top;
}

tr:nth-child(even) {
  background: rgba(255, 107, 0, 0.02);
}

tr:hover {
  background: rgba(255, 107, 0, 0.06);
}

td.na {
  color: var(--text-muted);
  font-style: italic;
}

td.score-positive {
  color: var(--accent-green);
  font-weight: 600;
}

td.score-negative {
  color: var(--accent-ember);
  font-weight: 600;
}

td.score-high {
  color: var(--accent-gold);
  font-weight: 700;
}

/* === コードブロック === */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.code-block .comment {
  color: #5a6a50;
}

.code-block .keyword {
  color: var(--accent-ember);
}

.code-block .string {
  color: var(--accent-green);
}

.code-block .number {
  color: var(--accent-warm);
}

/* === フローチャート === */
.flow-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 4px;
  position: relative;
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  width: 2px;
  height: calc(100% - 10px);
  background: linear-gradient(180deg, var(--accent-fire), rgba(255, 107, 0, 0.1));
}

.flow-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-fire), var(--accent-ember));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
  z-index: 1;
}

.flow-content {
  padding: 4px 0 16px;
}

.flow-content .flow-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.flow-content .flow-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.flow-arrow {
  text-align: center;
  color: var(--accent-fire);
  font-size: 1.2rem;
  margin: 4px 0;
  padding-left: 32px;
}

/* === 網グリッド図 === */
.grid-visual {
  display: inline-grid;
  grid-template-columns: repeat(4, 72px);
  gap: 4px;
  margin-bottom: 16px;
}

.grid-cell {
  width: 72px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid;
}

.grid-cell.normal {
  background: rgba(52, 152, 219, 0.1);
  border-color: rgba(52, 152, 219, 0.3);
  color: var(--accent-blue);
}

.grid-cell.strong {
  background: rgba(255, 107, 0, 0.15);
  border-color: rgba(255, 107, 0, 0.4);
  color: var(--accent-fire);
  box-shadow: inset 0 0 12px rgba(255, 107, 0, 0.1);
}

/* === 肉カード（焼き加減ビジュアル） === */
.meat-visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}

.meat-visual-card:hover {
  border-color: var(--border-accent);
}

.meat-visual-card.meat-rare {
  border-left: 3px solid var(--accent-gold);
}

.meat-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.meat-card-header .meat-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.meat-card-header .meat-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.meat-card-header .meat-count {
  margin-left: auto;
}

.meat-stages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.meat-stage {
  text-align: center;
}

.meat-stage img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid rgba(200, 120, 50, 0.15);
  transition: all var(--transition);
  background: var(--bg-tertiary);
}

.meat-stage img:hover {
  border-color: var(--accent-fire);
  transform: scale(1.08);
  z-index: 1;
  position: relative;
}

.meat-stage-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.2;
}

.meat-stage-score {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 1px;
}

.meat-scores-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.meat-score-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.meat-score-tag.edible { background: rgba(39, 174, 96, 0.1); color: var(--accent-green); }
.meat-score-tag.inedible { background: rgba(100, 100, 100, 0.1); color: var(--text-muted); }
.meat-score-tag.burnt { background: rgba(233, 69, 96, 0.1); color: var(--accent-ember); }
.meat-score-tag.best { background: rgba(255, 215, 0, 0.12); color: var(--accent-gold); border: 1px solid rgba(255, 215, 0, 0.25); }

/* === アクション/ハプニング カード画像付き === */
.card-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.card-visual-item {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 14px;
  transition: all var(--transition);
}

.card-visual-item:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.card-visual-img {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(200, 120, 50, 0.2);
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.card-visual-body {
  flex: 1;
  min-width: 0;
}

.card-visual-body .card-v-id {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.card-visual-body .card-v-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-visual-body .card-v-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.card-visual-body .card-v-count {
  margin-top: 6px;
}

/* === キャラクターカード === */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 16px;
  transition: all var(--transition);
  display: flex;
  gap: 14px;
}

.char-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.char-portrait {
  width: 80px;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(200, 120, 50, 0.2);
  flex-shrink: 0;
  background: var(--bg-tertiary);
}

.char-info {
  flex: 1;
  min-width: 0;
}

.char-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.char-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.char-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.char-skill-name {
  font-size: 0.82rem;
  color: var(--accent-warm);
  font-weight: 600;
}

.char-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 6px;
}

.char-type {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 6px;
}

@media (max-width: 600px) {
  .meat-stages {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-visual-grid {
    grid-template-columns: 1fr;
  }

  .character-grid {
    grid-template-columns: 1fr;
  }
}

.type-buff { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.type-defense { background: rgba(52, 152, 219, 0.15); color: var(--accent-blue); border: 1px solid rgba(52, 152, 219, 0.3); }
.type-attack { background: rgba(233, 69, 96, 0.15); color: var(--accent-ember); border: 1px solid rgba(233, 69, 96, 0.3); }
.type-unique { background: rgba(155, 89, 182, 0.15); color: var(--accent-purple); border: 1px solid rgba(155, 89, 182, 0.3); }

/* === ファイルツリー（カード型） === */
.tree-group {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.tree-group:hover {
  border-color: var(--border-accent);
}

.tree-group-title {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-warm);
  background: rgba(255, 107, 0, 0.05);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-group-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(200, 120, 50, 0.1);
  border: 1px solid rgba(200, 120, 50, 0.2);
  padding: 1px 8px;
  border-radius: 10px;
}

.tree-sub-group {
  border-top: 1px solid rgba(200, 120, 50, 0.08);
}

.tree-sub-title {
  padding: 8px 18px 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.tree-items {
  padding: 4px 0;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px;
  transition: background var(--transition);
  min-height: 34px;
}

.tree-item:hover {
  background: rgba(255, 107, 0, 0.04);
}

.tree-icon {
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.tree-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 140px;
}

.tree-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: 8px;
  border-left: 1px solid rgba(200, 120, 50, 0.15);
}

.tree-item-important .tree-name {
  color: var(--accent-fire);
  font-weight: 700;
}

@media (max-width: 600px) {
  .tree-item {
    flex-wrap: wrap;
    gap: 4px;
  }

  .tree-name {
    min-width: auto;
  }

  .tree-desc {
    width: 100%;
    padding-left: 30px;
    border-left: none;
    font-size: 0.78rem;
  }
}

/* === ロードマップ === */
.roadmap-phase {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.roadmap-phase::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.roadmap-phase.phase-done::before { background: var(--accent-green); }
.roadmap-phase.phase-current::before { background: var(--accent-fire); }
.roadmap-phase.phase-todo::before { background: var(--text-muted); }

.phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.phase-badge {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-done { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-current { background: rgba(255, 107, 0, 0.15); color: var(--accent-fire); border: 1px solid rgba(255, 107, 0, 0.3); }
.badge-todo { background: rgba(100, 100, 100, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 100, 100, 0.3); }

.phase-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.phase-items {
  list-style: none;
  padding: 0;
}

.phase-items li {
  padding: 4px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.phase-items li .check {
  color: var(--accent-green);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.phase-items li .pending {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* === 注意ブロック === */
.note-block {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}

.note-info {
  background: rgba(52, 152, 219, 0.08);
  border: 1px solid rgba(52, 152, 219, 0.2);
  border-left: 3px solid var(--accent-blue);
}

.note-warning {
  background: rgba(255, 107, 0, 0.08);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-left: 3px solid var(--accent-fire);
}

.note-danger {
  background: rgba(233, 69, 96, 0.08);
  border: 1px solid rgba(233, 69, 96, 0.2);
  border-left: 3px solid var(--accent-ember);
}

.note-block .note-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-info .note-title { color: var(--accent-blue); }
.note-warning .note-title { color: var(--accent-fire); }
.note-danger .note-title { color: var(--accent-ember); }

/* === アーキテクチャ図 === */
.arch-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-secondary);
}

/* === イベントテーブル === */
.event-direction {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.direction-send { background: rgba(39, 174, 96, 0.15); color: var(--accent-green); }
.direction-receive { background: rgba(52, 152, 219, 0.15); color: var(--accent-blue); }

/* === スクロールバー === */
.doc-main::-webkit-scrollbar {
  width: 6px;
}
.doc-main::-webkit-scrollbar-track {
  background: transparent;
}
.doc-main::-webkit-scrollbar-thumb {
  background: rgba(200, 120, 50, 0.2);
  border-radius: 3px;
}

/* === レスポンシブ === */
@media (max-width: 960px) {
  .doc-sidebar {
    transform: translateX(-100%);
  }

  .doc-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .doc-main {
    margin-left: 0;
    padding: 24px 20px 60px;
  }

  .menu-toggle {
    display: block;
  }

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

  .character-grid {
    grid-template-columns: 1fr;
  }

  .grid-visual {
    grid-template-columns: repeat(4, 60px);
  }

  .grid-cell {
    width: 60px;
    height: 40px;
    font-size: 0.7rem;
  }
}

@media (max-width: 600px) {
  .doc-main {
    padding: 16px 14px 40px;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .subsection-title {
    font-size: 1.1rem;
  }

  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .header-subtitle {
    display: none;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 7px 10px;
  }
}

/* === アニメーション === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-section {
  animation: fadeIn 0.4s ease-out;
}

/* === リスト === */
ul.feature-list {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

ul.feature-list li {
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

ul.feature-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-fire);
  font-size: 0.8rem;
}

/* === バッジ === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-ap { background: rgba(255, 215, 0, 0.15); color: var(--accent-gold); border: 1px solid rgba(255, 215, 0, 0.3); }
.badge-count { background: rgba(52, 152, 219, 0.15); color: var(--accent-blue); border: 1px solid rgba(52, 152, 219, 0.3); }

/* === 焼き加減ステージ === */
.cook-stages {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cook-stage {
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 80px;
  border: 1px solid;
}

.cook-0 { background: rgba(200, 200, 200, 0.08); border-color: rgba(200, 200, 200, 0.2); color: #999; }
.cook-1 { background: rgba(200, 180, 150, 0.08); border-color: rgba(200, 180, 150, 0.2); color: #b5a58a; }
.cook-2 { background: rgba(233, 69, 96, 0.1); border-color: rgba(233, 69, 96, 0.25); color: #e94560; }
.cook-3 { background: rgba(255, 140, 0, 0.1); border-color: rgba(255, 140, 0, 0.25); color: #ff8c00; }
.cook-4 { background: rgba(139, 90, 43, 0.15); border-color: rgba(139, 90, 43, 0.3); color: #c0822d; }
.cook-5 { background: rgba(60, 60, 60, 0.2); border-color: rgba(60, 60, 60, 0.3); color: #666; }

.cook-label {
  display: block;
  font-size: 0.7rem;
  margin-top: 2px;
  opacity: 0.7;
}

/* === TOPへ戻る === */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-fire), var(--accent-ember));
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 107, 0, 0.4);
}
