/* ============================================
   GOD — Visual Narrative Journey
   Two-panel layout (Arjuna | Krishna)
   Muralidhara art style, warm palette
   ============================================ */

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

:root {
  --primary: #E8712C;
  --primary-light: #F5A623;
  --primary-dark: #C9561A;
  --accent: #D4A017;
  --accent-light: #F0C040;
  --bg: #FFF8E7;
  --surface: #FFF0D0;
  --text: #3E2723;
  --text-muted: #795548;
  --text-light: #A1887F;
  --border: #D7CCC8;
  --border-light: #EFEBE9;
  --arjuna-bg: #2C1A0E;
  --arjuna-accent: #E65100;
  --arjuna-text: #FFCC80;
  --krishna-bg: #0D1B3E;
  --krishna-accent: #5C6BC0;
  --krishna-text: #B3C5FF;
  --shadow-sm: 0 1px 3px rgba(62,39,35,0.1);
  --shadow-md: 0 4px 12px rgba(62,39,35,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── SCREENS ─────────────────── */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── DASHAVATARA LANDING — Orbital Layout ─────────────────── */

#dashavatara-screen {
  background: radial-gradient(ellipse at center, #0f1a2e 0%, #0a0a1a 70%, #050510 100%);
  overflow: hidden;
}

.dasha-cosmos {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── GOD center — clickable ── */
#god-center {
  position: relative;
  z-index: 10;
  text-align: center;
  cursor: pointer;
  padding: 2rem;
  transition: transform 0.3s;
}

#god-center:hover {
  transform: scale(1.04);
}

#god-center:hover .god-title {
  text-shadow: 0 0 60px rgba(244,162,97,0.8), 0 0 120px rgba(244,162,97,0.3);
}

#god-center:hover .god-enter-hint {
  opacity: 1;
}

.god-om {
  font-size: 2.5rem;
  color: #f4a261;
  margin-bottom: 0.2rem;
  text-shadow: 0 0 30px rgba(244,162,97,0.7);
  animation: god-pulse 3s ease-in-out infinite;
}

@keyframes god-pulse {
  0%, 100% { text-shadow: 0 0 30px rgba(244,162,97,0.5); opacity: 0.8; }
  50%       { text-shadow: 0 0 50px rgba(244,162,97,1), 0 0 80px rgba(244,162,97,0.4); opacity: 1; }
}

.god-title {
  font-size: clamp(5rem, 15vw, 12rem);
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #f4a261;
  text-shadow: 0 0 40px rgba(244,162,97,0.5), 0 8px 32px rgba(0,0,0,0.6);
  line-height: 1;
  margin-bottom: 0.15em;
  transition: text-shadow 0.3s;
  user-select: none;
}

.god-sub {
  font-size: 0.85rem;
  color: #6a8aaa;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.god-enter-hint {
  font-size: 0.7rem;
  color: #f4a261;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.5;
  transition: opacity 0.3s;
}

/* ── Avatar orbit ring ── */
.avatar-orbit {
  position: absolute;
  width: min(90vw, 90vh, 800px);
  height: min(90vw, 90vh, 800px);
  border-radius: 50%;
  border: 1px solid rgba(244,162,97,0.06);
}

.orbit-avatar {
  position: absolute;
  width: 140px;
  height: 140px;
  left: 50%;
  top: 50%;
  margin-left: -70px;
  margin-top: -70px;
  --angle: calc(var(--i) * 36deg - 90deg);
  transform: rotate(var(--angle)) translateX(min(43vw, 43vh, 370px)) rotate(calc(-1 * var(--angle)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.3s;
}

.orbit-avatar:hover {
  transform: rotate(var(--angle)) translateX(min(43vw, 43vh, 370px)) rotate(calc(-1 * var(--angle))) scale(1.15);
  z-index: 20;
}

.orbit-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  object-fit: contain;
  border: 2px solid rgba(244,162,97,0.25);
  box-shadow: 0 0 12px rgba(244,162,97,0.15);
  background: rgba(244,162,97,0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.orbit-avatar:hover img {
  border-color: rgba(244,162,97,0.7);
  box-shadow: 0 0 24px rgba(244,162,97,0.4);
}

/* Krishna avatar — special glow */
.orbit-avatar:nth-child(8) img {
  border-color: rgba(100,150,255,0.4);
  box-shadow: 0 0 18px rgba(100,150,255,0.3);
}

.orbit-label {
  font-size: 0.6rem;
  color: #6a8aaa;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ── Responsive orbit ── */
@media (max-width: 600px) {
  .god-title { font-size: 3.5rem; }
  .god-sub { font-size: 0.65rem; }
  .avatar-orbit { width: min(95vw, 95vh, 500px); height: min(95vw, 95vh, 500px); }
  .orbit-avatar {
    width: 80px; height: 80px;
    margin-left: -40px; margin-top: -40px;
    transform: rotate(var(--angle)) translateX(min(44vw, 44vh, 220px)) rotate(calc(-1 * var(--angle)));
  }
  .orbit-avatar img { width: 68px; height: 68px; }
  .orbit-label { font-size: 0.45rem; }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 2.5rem;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: inherit; min-width: 200px;
  box-shadow: 0 4px 12px rgba(232,113,44,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,113,44,0.4);
}

.btn-secondary {
  background: white; color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 2.5rem;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; font-family: inherit; min-width: 200px;
  transition: border-color 0.2s, transform 0.15s;
}

.btn-secondary:hover { border-color: var(--primary); transform: translateY(-1px); }

.continue-info { font-size: 0.78rem; color: var(--text-light); margin-top: 0.4rem; }
#seeker-greeting { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; min-height: 1.2em; }

/* ── LESSON SCREEN ─────────────────── */

#lesson-screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: var(--bg);
}

#lesson-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 80px;
  -webkit-overflow-scrolling: touch;
}

#lesson-scroll::-webkit-scrollbar { width: 6px; }
#lesson-scroll::-webkit-scrollbar-track { background: var(--border-light); }
#lesson-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Scene header */
#scene-header {
  text-align: center;
  margin-bottom: 1rem;
}

#lesson-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
}

#lesson-location {
  font-size: 0.72rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

/* Scene image */
#scene-image-wrap {
  max-width: 960px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.scene-img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

/* Hide broken images gracefully */
img[src=""] { display: none; }
img:not([src]) { display: none; }

/* Scene text */
#scene-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
  padding: 12px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Narrative */
#narrative-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ══════════════════════════════════════
   MANGA PANELS — Two facing pages
   ══════════════════════════════════════ */

#manga-panels {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  min-height: 420px;
}

.manga-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s;
}

/* ARJUNA panel — warm earth dark */
.panel-arjuna {
  background: var(--arjuna-bg);
}

/* KRISHNA panel — divine deep blue */
.panel-krishna {
  background: var(--krishna-bg);
}

/* Image area in each panel */
.panel-image {
  width: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.panel-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

/* Hide panel when image is missing */
.panel-image:empty,
.panel-image:not(:has(img)) {
  min-height: 60px;
}

/* Image placeholder */
.img-placeholder {
  text-align: center;
  padding: 20px;
}

.img-placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.15;
  margin-bottom: 0.75rem;
}

.panel-arjuna .img-placeholder-icon { color: var(--arjuna-text); }
.panel-krishna .img-placeholder-icon { color: var(--krishna-text); }

.img-placeholder-text {
  font-size: 0.65rem;
  font-style: italic;
  line-height: 1.4;
  opacity: 0.3;
}

.panel-arjuna .img-placeholder-text { color: var(--arjuna-text); }
.panel-krishna .img-placeholder-text { color: var(--krishna-text); }

/* Dialogue area below image */
.panel-dialogue {
  padding: 14px 16px 18px;
  flex: 1;
}

.panel-speaker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.speaker-icon { font-size: 0.9rem; }

.panel-speaker-arjuna { color: var(--arjuna-text); }
.panel-speaker-krishna { color: var(--krishna-text); }

.panel-words {
  font-size: 0.85rem;
  line-height: 1.7;
  font-style: italic;
}

.panel-arjuna .panel-words { color: #FFCC80; }
.panel-krishna .panel-words { color: #C5CAE9; }

/* ── REVEAL BUTTON ─────────────────── */

#reveal-wrap {
  text-align: center;
  margin: 1.5rem auto;
  max-width: 800px;
}

.reveal-btn {
  background: linear-gradient(135deg, var(--arjuna-bg), var(--krishna-bg));
  color: #FFCC80;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 14px 36px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.reveal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 160, 23, 0.3);
}

.reveal-icon { font-size: 1.1rem; margin-right: 6px; }

/* Hidden content — slides down when revealed */
.reveal-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease;
}

.reveal-content.revealed {
  max-height: 2000px;
  opacity: 1;
}

/* ── VERSE SECTION ─────────────────── */

#verse-section {
  text-align: center;
  margin-bottom: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Frame badge — encounter indicator */
#frame-badge {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(232,113,44,0.12), rgba(212,160,23,0.12));
  padding: 8px 20px;
  border-radius: 24px;
  font-weight: 700;
  margin: 0 auto 1rem;
  display: inline-block;
  border: 1px solid rgba(232,113,44,0.2);
}

#verse-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--primary);
  background: rgba(232,113,44,0.1);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

#verse-sanskrit {
  font-size: 0.85rem;
  color: var(--text);
  font-style: italic;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

#verse-explanation {
  line-height: 1.7;
}

.verse-pada {
  display: block;
  margin-bottom: 0.25rem;
}

.verse-pada:last-child { margin-bottom: 0; }

/* ── WORD TABLE ─────────────────── */

#word-section {
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.word-table-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.word-table {
  width: 100%;
  border-collapse: collapse;
}

.word-table th {
  text-align: left;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.word-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.82rem;
}

.word-table td:first-child {
  font-weight: 600;
  color: #8B4513;
  font-size: 1rem;
}

.word-table td:nth-child(2) {
  font-weight: 600;
  color: #1A237E;
  font-style: italic;
}

.word-table td:last-child { color: var(--text-muted); }
.word-table tr:last-child td { border-bottom: none; }

/* ── BEINGS ─────────────────── */

#beings-section {
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.beings-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.beings-row { display: flex; flex-wrap: wrap; gap: 6px; }

.being-tag {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── NAVIGATION ─────────────────── */

#lesson-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
}

.nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  min-width: 100px; justify-content: center;
}

.nav-prev {
  background: white; border: 1.5px solid var(--border); color: var(--text-muted);
}

.nav-prev:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.nav-next {
  background: var(--primary); border: 1.5px solid var(--primary); color: white;
  box-shadow: 0 2px 8px rgba(232,113,44,0.3);
}

.nav-next:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,113,44,0.4);
}

.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.nav-arrow { font-size: 1.1rem; line-height: 1; }

#dot-nav { display: flex; gap: 8px; align-items: center; }

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s;
  border: none; padding: 0;
}

.dot.active { background: var(--primary); transform: scale(1.3); }
.dot.completed { background: #2E7D32; }

/* ── COMPLETION ─────────────────── */

#completion-screen {
  flex-direction: column; text-align: center;
  padding: 2rem; background: var(--bg);
}

.completion-inner { max-width: 480px; }
.completion-om { font-size: 3.5rem; color: var(--primary); margin-bottom: 1rem; }
.completion-title { font-size: 1.8rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.completion-text { font-size: 0.92rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 1rem; }
.completion-verse { font-style: italic; color: var(--primary); font-size: 0.9rem; margin-bottom: 2rem; }
.completion-actions { display: flex; flex-direction: column; gap: 1rem; align-items: center; }

/* ── LIGHTBOX ─────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.lightbox-open {
  opacity: 1;
}

.lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

/* Make images in lesson look clickable */
#lesson-scroll img {
  cursor: zoom-in;
  transition: transform 0.15s;
}

#lesson-scroll img:hover {
  transform: scale(1.02);
}

/* ── FADE ─────────────────── */

#fade-overlay {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}

#fade-overlay.fading { opacity: 1; pointer-events: all; }

/* ── RESPONSIVE ─────────────────── */

@media (max-width: 700px) {
  #manga-panels {
    flex-direction: column;
    gap: 8px;
    min-height: auto;
  }

  .panel-image { width: 100%; }

  #lesson-scroll { padding: 16px 12px 80px; }
  #lesson-title { font-size: 1.25rem; }

  .nav-btn { padding: 8px 14px; font-size: 0.8rem; min-width: 80px; }
}

/* ══════════════════════════════════════
   TOC SCREEN — TABLE OF CONTENTS
   ══════════════════════════════════════ */

#toc-screen {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #0a0a1a;
  overflow-y: auto;
}

/* Hero section with Virat Swaroop image */
#toc-hero {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0d1b3e 0%, #1a0a2e 50%, #0a1a0a 100%);
}

#toc-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0.55;
  cursor: pointer;
  transition: opacity 0.3s;
}

#toc-hero-img:hover {
  opacity: 0.85;
}

#toc-hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
  width: 100%;
  cursor: zoom-in;
}

#toc-hero-om {
  font-size: 2.5rem;
  color: #F0C040;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 30px rgba(240,192,64,0.6);
}

#toc-hero-title {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 2px 16px rgba(0,0,0,0.8);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

#toc-hero-verse {
  font-size: 1rem;
  color: #E8D5A8;
  font-style: italic;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 0.5rem;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

#toc-hero-ref {
  font-size: 0.72rem;
  color: #D4A017;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

#toc-hero-sub {
  font-size: 0.75rem;
  color: #8a9ab5;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

/* ── Category quick-nav bar ── */
#toc-category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0a0a1a;
  padding: 12px 0;
  border-bottom: 1px solid rgba(212,160,23,0.1);
}

.cat-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,160,23,0.15);
  color: #8a9ab5;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.cat-btn:hover {
  border-color: rgba(212,160,23,0.4);
  color: #D4A017;
}

.cat-btn.active {
  background: rgba(212,160,23,0.15);
  border-color: #D4A017;
  color: #D4A017;
}

/* Body / grid area */
#toc-body {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Grid of topic cards */
#toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Individual topic card */
.toc-card {
  background: #111128;
  border: 1px solid rgba(212, 160, 23, 0.15);
  border-radius: 12px;
  padding: 1.2rem 1.2rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.toc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,160,23,0.4), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.toc-card:hover {
  border-color: rgba(212, 160, 23, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 160, 23, 0.12);
}

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

/* Topic number badge */
.toc-num {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #D4A017;
  background: rgba(212, 160, 23, 0.1);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-radius: 20px;
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 0.65rem;
}

/* Card title */
.toc-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #F0E6C8;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

/* Card description */
.toc-card-desc {
  font-size: 0.75rem;
  color: #7a7090;
  line-height: 1.55;
  margin-bottom: 0.85rem;
}

/* Card explore arrow */
.toc-card-arrow {
  font-size: 0.7rem;
  font-weight: 700;
  color: #D4A017;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toc-card:hover .toc-card-arrow {
  opacity: 1;
}

/* Journey card — spans full width, blue accent */
.toc-card-journey {
  grid-column: 1 / -1;
  background: rgba(42,100,180,0.1);
  border-color: rgba(100,150,255,0.2);
}

.toc-card-journey:hover {
  background: rgba(42,100,180,0.18);
  border-color: rgba(100,150,255,0.4);
  box-shadow: 0 4px 20px rgba(42,100,180,0.15);
}

.toc-card-journey .toc-num { color: #90b0ff; background: rgba(100,150,255,0.1); border-color: rgba(100,150,255,0.2); }
.toc-card-journey .toc-card-arrow { color: #90b0ff; }

/* Progress states */
.toc-card-complete { border-color: rgba(46,125,50,0.35); }
.toc-card-complete .toc-num { color: #4caf50; background: rgba(76,175,80,0.1); border-color: rgba(76,175,80,0.2); }
.toc-card-complete .toc-card-arrow { color: #4caf50; }

.toc-card-partial { border-color: rgba(244,162,97,0.25); }
.toc-card-partial .toc-card-arrow { color: #f4a261; }

/* TOC card image */
.toc-card-img {
  display: block;
  width: calc(100% + 2.4rem);
  margin: -1.2rem -1.2rem 0.8rem;
  height: 120px;
  object-fit: cover;
  border-radius: 11px 11px 0 0;
  opacity: 0.8;
  transition: opacity 0.2s;
  cursor: zoom-in;
}
.toc-card:hover .toc-card-img {
  opacity: 1;
}

/* Meta line — page count / read count */
.toc-card-meta {
  font-size: 0.62rem;
  color: #5a5878;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Footer buttons */
#toc-footer {
  text-align: center;
  padding-bottom: 1rem;
}

#toc-footer .btn-secondary {
  background: transparent;
  color: #a8c0d8;
  border-color: rgba(168,192,216,0.2);
}

#toc-footer .btn-secondary:hover {
  border-color: #f4a261;
  color: #f4a261;
}

/* TOC open button on welcome screen */
.btn-toc {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.04em;
}

.btn-toc:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Topics button in lesson nav */
.nav-topics {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 6px 12px;
  min-width: auto;
  letter-spacing: 0.06em;
}

.nav-topics:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 700px) {
  #toc-hero { min-height: 220px; max-height: 280px; }
  #toc-hero-title { font-size: 1.2rem; }
  #toc-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  #toc-body { padding: 1.25rem 1rem; }
  .nav-topics { display: none; }
}
