/* =============================================
   人格を増やせ。— 共通スタイル
   テーマ：暗闇の中に光が差し込む哲学的デザイン
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* =============================================
   テーマ定義
   ============================================= */

/* デフォルト：黒テーマ */
:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --text: #e8e0d0;
  --text-muted: #8a8070;
  --gold: #c9a84c;
  --gold-light: #e8c870;
  --gold-dark: #8a6a20;
  --border: #2a2a38;
  --nav-bg: rgba(10, 10, 15, 0.92);
  --white: #ffffff;
  --content-p: #c8c0b0;
  --author-bio: #c8c0b0;

  /* 章ごとのカラー */
  --color-intro: #c9a84c;
  --color-ch1: #8b7cf6;
  --color-ch2: #ef4444;
  --color-ch3: #f97316;
  --color-ch4: #22c55e;
  --color-ch5: #06b6d4;
  --color-ch6: #ec4899;
  --color-ch7: #84cc16;
  --color-ch8: #64748b;
  --color-ch9: #c9a84c;
}

/* 白テーマ */
[data-theme="white"] {
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --bg3: #ebebeb;
  --text: #1a1a1a;
  --text-muted: #777777;
  --gold: #9a6e1a;
  --gold-light: #b8860b;
  --gold-dark: #7a5010;
  --border: #dddddd;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --content-p: #333333;
  --author-bio: #444444;
}

/* ベージュテーマ */
[data-theme="beige"] {
  --bg: #f5f0e8;
  --bg2: #ede8de;
  --bg3: #e4ddd0;
  --text: #2c2416;
  --text-muted: #8a7a60;
  --gold: #8a6020;
  --gold-light: #a87830;
  --gold-dark: #6a4810;
  --border: #d4c8b0;
  --nav-bg: rgba(245, 240, 232, 0.95);
  --content-p: #3a3020;
  --author-bio: #4a3e28;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Serif JP', serif;
  font-size: 16px;
  line-height: 1.9;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =============================================
   プログレスバー
   ============================================= */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 0 8px var(--gold);
}

/* =============================================
   ナビゲーション
   ============================================= */
.nav {
  position: fixed;
  top: 2px;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.nav-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-logo {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-chapters {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-chapters::-webkit-scrollbar {
  display: none;
}

.nav-ch {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-ch:hover {
  color: var(--text);
  border-color: var(--border);
}

.nav-ch.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-ch.unlocked {
  color: var(--gold);
  border-color: var(--gold-dark);
}

/* =============================================
   ヒーローセクション
   ============================================= */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 60px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgba(201, 168, 76, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(139, 124, 246, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-20px) rotate(720deg);
    opacity: 0;
  }
}

.hero-badge {
  display: inline-block;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 32px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-title .accent {
  color: var(--gold);
  display: block;
}

.hero-subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 12px;
  line-height: 1.7;
}

.hero-author {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
  letter-spacing: 0.1em;
}

.hero-author span {
  color: var(--gold);
}

.hero-cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #0a0a0f;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 40px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201, 168, 76, 0.5);
}

/* =============================================
   チャプターグリッド（トップページ）
   ============================================= */
.chapters-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px 80px;
}

.section-heading {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 40px;
  text-align: center;
}

.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.chapter-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  display: block;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--card-color, var(--gold));
  opacity: 0.6;
  transition: opacity 0.3s;
}

.chapter-card:hover {
  border-color: var(--card-color, var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.chapter-card:hover::before {
  opacity: 1;
}

.chapter-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.chapter-card.locked::after {
  content: '🔒';
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 18px;
}

.chapter-card.completed::after {
  content: '✓';
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 16px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  color: var(--card-color, var(--gold));
  width: 28px;
  height: 28px;
  border: 2px solid var(--card-color, var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 1px;
}

.card-number {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--card-color, var(--gold));
  margin-bottom: 8px;
  text-transform: uppercase;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}

.card-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =============================================
   章ページ共通
   ============================================= */
.chapter-hero {
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.chapter-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(var(--ch-rgb, 201, 168, 76), 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.chapter-badge {
  display: inline-block;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ch-color, var(--gold));
  border: 1px solid var(--ch-color, var(--gold));
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
  opacity: 0.8;
}

.chapter-title {
  font-size: clamp(24px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.3;
  max-width: 700px;
  margin-bottom: 16px;
}

.chapter-title .ch-accent {
  color: var(--ch-color, var(--gold));
}

.chapter-subtitle {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  max-width: 500px;
}

/* =============================================
   コンテンツセクション
   ============================================= */
.content-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.content-block {
  margin-bottom: 48px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.content-block.visible {
  opacity: 1;
  transform: translateY(0);
}

.content-block h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ch-color, var(--gold));
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
}

.content-block h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin: 28px 0 12px;
  line-height: 1.5;
}

.content-block p {
  margin-bottom: 16px;
  color: var(--content-p);
  font-size: 15px;
  line-height: 2;
}

.content-block strong {
  color: var(--text);
  font-weight: 500;
}

.quote-block {
  border-left: 3px solid var(--ch-color, var(--gold));
  padding: 20px 24px;
  margin: 32px 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
}

.quote-block p {
  font-size: 17px;
  font-style: italic;
  color: var(--text);
  line-height: 1.8;
  margin: 0;
}

.quote-source {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: right;
}

.pattern-list {
  list-style: none;
  margin: 24px 0;
}

.pattern-list li {
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: #c8c0b0;
  position: relative;
  padding-left: 52px;
}

.pattern-list li::before {
  content: attr(data-num);
  position: absolute;
  left: 16px;
  top: 16px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ch-color, var(--gold));
  letter-spacing: 0.1em;
}

.pattern-list li strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 4px;
}

.highlight-box {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.03));
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 8px;
  padding: 24px;
  margin: 32px 0;
}

.highlight-box p {
  color: var(--text);
  font-size: 16px;
  margin: 0;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* =============================================
   テストセクション
   ============================================= */
.quiz-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.quiz-header {
  text-align: center;
  margin-bottom: 48px;
}

.quiz-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ch-color, var(--gold));
}

.quiz-header p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
}

.quiz-progress-bar {
  background: var(--bg3);
  border-radius: 4px;
  height: 4px;
  margin: 20px 0;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ch-color, var(--gold)), var(--gold-light));
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--ch-color, var(--gold));
}

.quiz-counter {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 24px;
}

.quiz-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
  display: none;
}

.quiz-card.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-question {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
  margin-bottom: 28px;
  color: var(--text);
}

.quiz-question .q-num {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ch-color, var(--gold));
  display: block;
  margin-bottom: 10px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  transition: all 0.2s;
  text-align: left;
  font-family: 'Noto Serif JP', serif;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--ch-color, var(--gold));
  background: rgba(255, 255, 255, 0.03);
}

.quiz-option.hint {
  background: rgba(201, 168, 76, 0.05);
  border-color: rgba(201, 168, 76, 0.2);
}

.quiz-option .opt-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ch-color, var(--gold));
  min-width: 20px;
  padding-top: 2px;
}

.quiz-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
  color: #86efac;
}

.quiz-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-explanation {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--ch-color, var(--gold));
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  display: none;
}

.quiz-explanation.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.quiz-explanation strong {
  color: var(--ch-color, var(--gold));
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =============================================
   合格ポップアップ
   ============================================= */
.pass-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pass-overlay.show {
  display: flex;
}

.pass-modal {
  background: var(--bg2);
  border: 1px solid var(--ch-color, var(--gold));
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 0 60px rgba(201, 168, 76, 0.2);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pass-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.pass-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ch-color, var(--gold));
  margin-bottom: 8px;
}

.pass-score {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pass-message {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 32px;
}

.pass-next-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--ch-color, var(--gold)), var(--gold-light));
  color: #0a0a0f;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

.pass-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(201, 168, 76, 0.4);
}

.fail-retry-btn {
  display: inline-block;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  padding: 14px 36px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  margin-top: 12px;
}

.fail-retry-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* =============================================
   紙吹雪
   ============================================= */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  top: -10px;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

/* =============================================
   フッター
   ============================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
}

.footer p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

.footer a {
  color: var(--gold);
  text-decoration: none;
}

/* =============================================
   特典ページ
   ============================================= */
.gift-hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gift-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(201, 168, 76, 0.12) 0%, transparent 70%);
}

.gift-keyword-box {
  background: var(--bg2);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  margin: 0 auto 32px;
  text-align: center;
}

.gift-keyword {
  font-size: 48px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin: 16px 0;
  text-shadow: 0 0 30px rgba(201, 168, 76, 0.5);
}

.gift-line-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #06c755;
  color: white;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 18px 40px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(6, 199, 85, 0.3);
}

.gift-line-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(6, 199, 85, 0.4);
}

/* =============================================
   著者プロフィール
   ============================================= */
.author-section {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px;
  border-top: 1px solid var(--border);
}

.author-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.author-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.author-role {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}

.author-bio {
  font-size: 14px;
  color: var(--author-bio);
  line-height: 1.9;
}

/* =============================================
   テーマ切り替えボタン
   ============================================= */
.theme-switcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.theme-toggle-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.theme-toggle-btn.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.35), 0 4px 16px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

.theme-toggle-btn[data-t="dark"] {
  background: #0a0a0f;
}

.theme-toggle-btn[data-t="white"] {
  background: #ffffff;
}

.theme-toggle-btn[data-t="beige"] {
  background: #f5f0e8;
}

.theme-toggle-btn::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg2);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.theme-toggle-btn:hover::after {
  opacity: 1;
}

@media (max-width: 600px) {
  .theme-switcher {
    bottom: 16px;
    right: 16px;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }
}

/* =============================================
   スクロールアニメーション
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   レスポンシブ
   ============================================= */
@media (max-width: 600px) {
  .chapters-grid {
    grid-template-columns: 1fr;
  }

  .quiz-card {
    padding: 24px 20px;
  }

  .pass-modal {
    padding: 36px 24px;
  }

  .nav-chapters {
    display: none;
  }
}