/**
 * IELTS Cinematic Writing Knowledge Studio — Stylesheet (v1.0 Fullscreen Cinema Edition)
 * English Mastery Hub • IELTS Writing Task 2 Societal Knowledge Vault (32 Themes)
 *
 * Taste-Skill Dial Calibration:
 * - DESIGN_VARIANCE: 7 (Asymmetric glassmorphic balance, high-contrast typography, category hues)
 * - MOTION_INTENSITY: 8 (Filmic scene dissolves, chapter slates, 3D perspective flips, debate glow)
 * - VISUAL_DENSITY: 3 (Spacious full-screen cinema canvas for deep argumentative absorption)
 */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surface Foundations */
  --bg-deep: #080c12;
  --bg-theater: #0c1017;
  --bg-card: rgba(18, 24, 32, 0.82);
  --bg-card-hover: rgba(28, 36, 48, 0.92);
  --bg-overlay: rgba(8, 12, 18, 0.88);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-active: rgba(255, 255, 255, 0.12);

  /* Borders & Highlights */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.24);
  --border-card: rgba(255, 255, 255, 0.12);

  /* Typography: Flawless Vietnamese Subsets */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-display: 'Plus Jakarta Sans', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Category Dynamic Accents (Default Cyan for Environment) */
  --theme-accent: #06b6d4;
  --theme-accent-glow: rgba(6, 182, 212, 0.35);
  --theme-accent-bg: rgba(6, 182, 212, 0.15);

  /* Dialectic Debate Accents */
  --color-pro: #10b981;
  --color-pro-glow: rgba(16, 185, 129, 0.25);
  --color-pro-bg: rgba(16, 185, 129, 0.12);
  --color-con: #f43f5e;
  --color-con-glow: rgba(244, 63, 94, 0.25);
  --color-con-bg: rgba(244, 63, 94, 0.12);

  /* Component Dimensions & Geometry */
  --radius-card: 20px;
  --radius-btn: 9999px;
  --radius-pill: 9999px;
  --transition-fluid: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100dvh;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atmospheric Backdrop & Letterbox Vignettes */
.cinematic-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.backdrop-img {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center 25%;
  filter: blur(36px) brightness(0.22) saturate(1.3);
  transform: scale(1.12);
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.backdrop-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, var(--theme-accent-glow), transparent 60%),
              radial-gradient(circle at 80% 85%, rgba(168, 85, 247, 0.08), transparent 50%),
              linear-gradient(to bottom, rgba(8, 12, 18, 0.75), rgba(8, 12, 18, 0.98));
}

.cinema-letterbox-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
}

.cinema-letterbox-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 90px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

/* Chapter Transition Scene Slate Overlay */
.chapter-scene-slate {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 12, 18, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.chapter-scene-slate.active {
  opacity: 1;
  pointer-events: auto;
}

.slate-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 680px;
  padding: 2rem;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter-scene-slate.active .slate-content {
  transform: translateY(0) scale(1);
}

.slate-chapter-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  color: var(--theme-accent);
}

.slate-chapter-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.slate-chapter-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Main Application Shell */
.cinematic-app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top Glassmorphic Navigation Bar */
.cinematic-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.75rem;
  background: rgba(12, 16, 23, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.btn-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  text-decoration: none;
  transition: var(--transition-fluid);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-nav-back:hover {
  color: var(--text-main);
  background: var(--bg-glass-active);
  border-color: var(--border-focus);
  transform: translateX(-2px);
}

.nav-passage-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  min-width: 0;
  overflow: hidden;
}

.passage-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  background: var(--theme-accent-bg);
  color: var(--theme-accent);
  border: 1px solid var(--theme-accent-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.passage-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-theme-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fluid);
}

.btn-theme-selector:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--theme-accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-theater-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fluid);
  white-space: nowrap;
}

.btn-theater-action:hover {
  color: var(--text-main);
  background: var(--bg-glass-active);
  border-color: var(--border-focus);
}

.btn-theater-action.active {
  color: #fff;
  background: var(--theme-accent-bg);
  border-color: var(--theme-accent);
  box-shadow: 0 0 16px var(--theme-accent-glow);
}

.btn-theater-action.btn-theater-practice {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
  text-decoration: none;
}

.btn-theater-action.btn-theater-practice:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-theater-video {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.35);
}

.btn-theater-video:hover {
  background: rgba(250, 204, 21, 0.15);
  border-color: #facc15;
}

/* Multi-Stage Track Header */
.cinematic-chapter-track {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 2rem 0.5rem;
  gap: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 12, 18, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chapter-track-segments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.chapter-segment {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-fluid);
}

.chapter-segment:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chapter-segment.completed .chapter-segment-fill {
  width: 100%;
}

.chapter-segment.active .chapter-segment-fill {
  width: 100%;
  box-shadow: 0 0 12px var(--theme-accent);
}

.chapter-segment-fill {
  height: 100%;
  width: 0%;
  background: var(--theme-accent);
  transition: width 0.3s ease;
  border-radius: 9999px;
}

.chapter-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.chapter-badge-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chapter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 10px var(--theme-accent);
  display: inline-block;
}

.chapter-active-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
}

.chapter-progress-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* Main Workspace Cinema Canvas */
.cinematic-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem 6.5rem;
  position: relative;
  min-height: calc(100dvh - 140px);
}

/* Slide 0: Overview Hero Card */
.overview-hero-card {
  width: 100%;
  max-width: 980px;
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 2.75rem 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: heroCardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-topic-number {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--theme-accent);
  background: var(--theme-accent-bg);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--theme-accent-glow);
}

.hero-target-band {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.hero-main-title {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.hero-sub-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition-fluid);
}

.hero-stat-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-focus);
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}

.hero-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-theses-section {
  margin-bottom: 2rem;
}

.hero-section-heading {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-accent);
  margin-bottom: 0.85rem;
}

.hero-theses-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hero-thesis-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.hero-thesis-item i {
  color: var(--theme-accent);
  margin-top: 0.25rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.btn-start-cinema {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--theme-accent), #2563eb);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 10px 30px var(--theme-accent-glow);
  transition: var(--transition-fluid);
}

.btn-start-cinema:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px var(--theme-accent-glow);
}

/* Fullscreen Reading Cinema Stage */
.sentence-stage-container {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: stageIn 0.4s ease forwards;
}

@keyframes stageIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.sentence-stage-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 3rem 3.5rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-height: 380px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.sentence-stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--theme-accent), transparent);
}

.context-snippet-prev,
.context-snippet-next {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-dim);
  opacity: 0.45;
  transition: var(--transition-fluid);
  user-select: none;
}

.active-sentence-hero {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: var(--transition-fluid);
}

/* Inline Clickable Vocab Highlights */
.vocab-token {
  position: relative;
  color: var(--theme-accent);
  font-weight: 700;
  background: var(--theme-accent-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  border-bottom: 2px solid var(--theme-accent);
  cursor: pointer;
  transition: var(--transition-fluid);
  display: inline-block;
  line-height: 1.3;
}

.vocab-token:hover {
  background: var(--theme-accent);
  color: #080c12;
  box-shadow: 0 0 16px var(--theme-accent-glow);
  transform: translateY(-1px);
}

/* Slide-Down Bilingual Translation Drawer */
.vietnamese-drawer {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #a5f3fc;
  font-size: 1.15rem;
  line-height: 1.65;
  display: none;
  animation: drawerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.vietnamese-drawer.visible {
  display: block;
}

@keyframes drawerSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sentence Stage Controls Bar (Bottom Deck) */
.sentence-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(12, 16, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
}

.deck-left-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sentence-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sentence-counter-badge strong {
  color: var(--theme-accent);
  font-size: 0.95rem;
}

.btn-active-vocab-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--theme-accent);
  background: var(--theme-accent-bg);
  border: 1px solid var(--theme-accent-glow);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fluid);
}

.btn-active-vocab-badge:hover {
  background: rgba(6, 182, 212, 0.25);
  box-shadow: 0 0 14px var(--theme-accent-glow);
}

.sentence-nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-nav-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fluid);
}

.btn-nav-step:hover:not(:disabled) {
  color: var(--text-main);
  background: var(--bg-glass-active);
  border-color: var(--border-focus);
}

.btn-nav-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-nav-step.btn-nav-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--theme-accent), #2563eb);
  border: none;
  box-shadow: 0 6px 20px var(--theme-accent-glow);
}

.btn-nav-step.btn-nav-primary:hover:not(:disabled) {
  box-shadow: 0 8px 25px var(--theme-accent-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   ACT III: DIALECTIC DEBATE ARENA (EXCLUSIVE WRITING FEATURE)
   ========================================================================== */
.debate-stage-container {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: stageIn 0.4s ease forwards;
}

.debate-prompt-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.75rem 2.25rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.debate-prompt-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--color-pro), #facc15, var(--color-con));
}

.debate-prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(250, 204, 21, 0.3);
  margin-bottom: 0.75rem;
}

.debate-prompt-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
  color: #fff;
}

.debate-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.debate-column {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.debate-column.col-pro {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(16, 185, 129, 0.05);
}

.debate-column.col-con {
  border-color: rgba(244, 63, 94, 0.3);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(244, 63, 94, 0.05);
}

.debate-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.debate-col-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.debate-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
}

.col-pro .debate-badge {
  background: var(--color-pro-bg);
  color: var(--color-pro);
  border: 1px solid var(--color-pro-glow);
}

.col-con .debate-badge {
  background: var(--color-con-bg);
  color: var(--color-con);
  border: 1px solid var(--color-con-glow);
}

.debate-col-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.argument-card-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.argument-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--transition-fluid);
}

.argument-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.argument-main-claim {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #f1f5f9;
}

.hedging-phrase-box {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--theme-accent);
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #94a3b8;
}

.hedging-phrase-box strong {
  color: #facc15;
}

.btn-copy-arg {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fluid);
}

.btn-copy-arg:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--theme-accent);
}

/* ==========================================================================
   ACT IV: 3D FLASHCARD GYM & VOCABULARY MODAL
   ========================================================================== */
.cinematic-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 12, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cinematic-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cinematic-modal-box {
  width: 100%;
  max-width: 640px;
  background: var(--bg-theater);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cinematic-modal-overlay.active .cinematic-modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: var(--transition-fluid);
}

.btn-modal-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 3D Flashcard Player */
.flashcard-player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}

.flashcard-stage-wrapper {
  perspective: 1200px;
  width: 100%;
  height: 320px;
  cursor: pointer;
}

.flashcard-3d-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px;
}

.flashcard-3d-card.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(22, 30, 42, 0.95);
  border: 1px solid var(--border-card);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.flashcard-front {
  border-top: 3px solid var(--theme-accent);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: rgba(18, 26, 38, 0.98);
  border-top: 3px solid #facc15;
}

.card-flip-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  opacity: 0.7;
}

/* Floating Cinema Vocab Popover Dialog */
.vocab-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
}

.vocab-popover-overlay.active {
  display: block;
}

.cinema-vocab-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 95;
  width: 90%;
  max-width: 480px;
  background: var(--bg-theater);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: popoverIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cinema-vocab-popover.active {
  display: flex;
}

@keyframes popoverIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.popover-accent-line {
  height: 3px;
  background: linear-gradient(to right, var(--theme-accent), #2563eb);
}

.popover-header {
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.popover-term-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}

.popover-pos-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--theme-accent);
  background: var(--theme-accent-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.popover-body {
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.popover-section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.popover-en-def {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.popover-vi-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #a5f3fc;
  background: var(--theme-accent-bg);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--theme-accent);
}

.popover-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.btn-popover-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--theme-accent);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fluid);
}

.btn-popover-copy:hover {
  box-shadow: 0 0 16px var(--theme-accent-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   FLOATING VIDEO DIRECTOR PLAYER HUD
   ========================================================================== */
.cinema-video-hud {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 90%;
  max-width: 820px;
  background: rgba(12, 16, 23, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 0.65rem 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: hudSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hudSlideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hud-top-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
}

.hud-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--theme-accent), #facc15);
  transition: width 0.15s linear;
}

.hud-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hud-left-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hud-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fluid);
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--theme-accent);
}

.hud-btn-play {
  width: 36px;
  height: 36px;
  background: var(--theme-accent);
  color: #080c12;
  border: none;
}

.hud-btn-play:hover {
  box-shadow: 0 0 16px var(--theme-accent-glow);
  transform: scale(1.05);
}

.hud-time-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hud-center-indicator {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.hud-right-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hud-btn-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fluid);
}

.hud-btn-pill:hover,
.hud-btn-pill.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--theme-accent);
}

/* Topic Picker Modal Drawer */
.topic-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 12, 18, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.topic-picker-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.topic-picker-box {
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  background: var(--bg-theater);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topic-picker-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topic-search-input {
  width: 100%;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: #fff;
  outline: none;
  transition: var(--transition-fluid);
}

.topic-search-input:focus {
  border-color: var(--theme-accent);
  background: rgba(255, 255, 255, 0.08);
}

.topic-grid-scroll {
  padding: 1.75rem 2rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.topic-grid-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: var(--transition-fluid);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.topic-grid-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--theme-accent);
  transform: translateY(-2px);
}

.topic-grid-card.active {
  border-color: var(--theme-accent);
  background: var(--theme-accent-bg);
  box-shadow: 0 0 16px var(--theme-accent-glow);
}

.topic-card-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--theme-accent);
  font-weight: 700;
}

.topic-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.topic-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE LAYOUT CALIBRATION
   ========================================================================== */
@media (max-width: 900px) {
  .cinematic-nav {
    padding: 0.75rem 1rem;
  }
  .btn-theater-action span {
    display: none;
  }
  .btn-theater-action {
    padding: 0.45rem;
  }
  .cinematic-chapter-track {
    padding: 0.5rem 1rem;
  }
  .cinematic-main {
    padding: 1rem 1rem 6.5rem;
  }
  .sentence-stage-card {
    padding: 2rem 1.5rem;
  }
  .active-sentence-hero {
    font-size: 1.35rem;
  }
  .debate-split-grid {
    grid-template-columns: 1fr;
  }
  .hero-main-title {
    font-size: 2rem;
  }
  .hero-stats-grid {
    grid-template-columns: 1fr;
  }
}
