/* ============================================================
   SpeakFlow Studio — Modern Warm Language Coach Stylesheet
   ============================================================ */

:root {
  --bg-page: #f7f9fc;
  --bg-grad: radial-gradient(circle at 12% 8%, #eef2ff 0%, #f7f9fc 48%, #f0fdfa 100%);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-solid: #ffffff;
  --bg-soft: #f1f5f9;
  --bg-input: #ffffff;
  --border: rgba(148, 163, 184, 0.25);
  --border-strong: rgba(148, 163, 184, 0.42);
  --text-main: #0f172a;
  --text-muted: #64748b;

  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.12);
  --teal: #0d9488;
  --teal-soft: rgba(13, 148, 136, 0.13);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.12);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.14);

  --bubble-a: #ffffff;
  --bubble-b: #eef2ff;

  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --font-ui: 'Kanit', 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'Plus Jakarta Sans', 'Kanit', sans-serif;
}

body.theme-dark {
  --bg-page: #0b1120;
  --bg-grad: radial-gradient(circle at 12% 8%, #1e1b4b 0%, #0b1120 55%, #0a2024 100%);
  --bg-card: rgba(23, 33, 52, 0.92);
  --bg-solid: #1e293b;
  --bg-soft: rgba(51, 65, 85, 0.68);
  --bg-input: #0f172a;
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(148, 163, 184, 0.36);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-soft: rgba(129, 140, 248, 0.18);
  --bubble-a: #1e293b;
  --bubble-b: #252b54;
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.44);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text-main);
  background: var(--bg-page);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  overflow-x: hidden;
}

button, input, select { font-family: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small-text { font-size: 0.86rem; }

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideIn 0.22s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--rose); }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }

/* ==================== TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 2px;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #0d9488);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.brand-copy strong {
  display: block;
  font-family: var(--font-en);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--primary);
}

.brand-copy small { display: block; font-size: 0.75rem; color: var(--text-muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.pill-primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
  font-weight: 600;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}

/* ==================== LAYOUT & BUTTONS ==================== */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.screen { display: none; animation: fadeIn 0.24s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.13s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { padding: 12px 22px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 7px 12px; font-size: 0.84rem; border-radius: 10px; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #0d9488);
  color: #ffffff;
  box-shadow: 0 7px 18px rgba(79, 70, 229, 0.24);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-ghost { background: var(--bg-soft); border: 1px solid var(--border); }

/* ==================== HERO & EXPLORER ==================== */
.hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px 28px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 24px;
  align-items: center;
}

.hero-chip {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.24;
}

.accent-text { color: var(--primary); }
.hero p { margin: 0 0 18px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.hero-stats-box {
  background: var(--bg-soft);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-stat {
  background: var(--bg-solid);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.mini-stat span { display: block; font-size: 0.72rem; color: var(--text-muted); }
.mini-stat strong { font-family: var(--font-en); font-size: 1.15rem; color: var(--primary); }

.voice-active-summary {
  grid-column: 1 / -1;
  background: var(--bg-solid);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.voice-active-summary strong { color: var(--teal); }

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.text-input, .select-input {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-input);
  font-size: 0.94rem;
  outline: none;
}

.search-row .text-input { flex: 1 1 280px; }
.level-select { min-width: 190px; }

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-tab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.scenario-card {
  position: relative;
  text-align: left;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  overflow: hidden;
}

.scenario-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--sc-color, var(--primary));
}

.scenario-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.sc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sc-title-group { display: flex; gap: 11px; align-items: center; }

.sc-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.sc-title-group h3 { margin: 0; font-size: 1.04rem; line-height: 1.25; }
.sc-title-group small { font-family: var(--font-en); font-size: 0.78rem; color: var(--text-muted); }

.level-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}

.level-badge.Beginner { background: var(--success-soft); color: #059669; }
.level-badge.Intermediate { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.level-badge.Advanced { background: var(--rose-soft); color: var(--rose); }

.sc-desc { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; flex: 1; }

.sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
}

.sc-cast-mini { display: flex; gap: 6px; flex-wrap: wrap; }
.sc-cast-mini span {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
}

.done-tag { color: var(--success); font-weight: 600; }

/* ==================== CONVERSATION STUDIO ==================== */
.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.studio-title-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.st-icon { font-size: 2rem; }
.st-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-title-row h2 { margin: 0; font-size: 1.22rem; }

.studio-cast { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cast-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}
.cast-pill.female { background: var(--rose-soft); color: var(--rose); }
.cast-pill.male { background: var(--primary-soft); color: var(--primary); }

.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 16px;
}

.practice-tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.ptab {
  padding: 8px 14px;
  border-radius: 11px;
  border: 1.5px solid transparent;
  background: var(--bg-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.ptab.active {
  background: var(--primary);
  color: #ffffff;
}

.toolbar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
}

.speed-select { padding: 6px 10px; font-size: 0.85rem; }

.tips-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tip-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ==================== LISTEN PLAYER & CHAT FEED ==================== */
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 13px 16px;
}

.player-left, .player-status { display: flex; align-items: center; gap: 10px; }

.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.audio-wave span {
  width: 4px;
  height: 6px;
  border-radius: 3px;
  background: var(--primary);
  animation: waveBounce 0.7s ease-in-out infinite alternate;
}
.audio-wave span:nth-child(2) { animation-delay: 0.15s; }
.audio-wave span:nth-child(3) { animation-delay: 0.3s; }
.audio-wave span:nth-child(4) { animation-delay: 0.45s; }
@keyframes waveBounce { from { height: 5px; } to { height: 18px; } }

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  max-width: 82%;
}

.msg-row.side-b {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.msg-bubble {
  flex: 1;
  background: var(--bubble-a);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.msg-row.side-b .msg-bubble { background: var(--bubble-b); }

.msg-row.speaking .msg-bubble {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-md);
  transform: scale(1.01);
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.msg-speaker { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }

.msg-actions { display: flex; gap: 5px; }

.mini-act-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.mini-act-btn:hover { border-color: var(--primary); }
.mini-act-btn.starred { background: rgba(245, 158, 11, 0.2); border-color: #f59e0b; }

.msg-en {
  font-family: var(--font-en);
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.48;
  margin: 0 0 6px;
  cursor: pointer;
}

.msg-th {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.msg-phon {
  font-size: 0.84rem;
  color: var(--teal);
  margin: 0;
}

/* ==================== ROLEPLAY DOCK ==================== */
.roleplay-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 16px;
}

.rp-role-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.rp-turn-dock {
  margin-top: 16px;
  border: 2px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rp-dock-head { display: flex; align-items: center; justify-content: space-between; }

.your-turn-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
}

.rp-target-box {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 14px 16px;
}

.rp-target-en { font-family: var(--font-en); font-size: 1.15rem; font-weight: 700; margin-bottom: 5px; }
.rp-target-th { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 3px; }
.rp-target-phon { font-size: 0.85rem; color: var(--teal); }

.rp-mic-feedback {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--success-soft);
  font-size: 0.9rem;
}

.rp-dock-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==================== REPLY QUIZ ==================== */
.quiz-card {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-top { display: flex; align-items: center; justify-content: space-between; }

.quiz-partner-box {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px;
}

.quiz-speaker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.quiz-speaker-row button { margin-left: auto; }
.quiz-avatar { font-size: 1.9rem; }
.quiz-en { font-family: var(--font-en); font-size: 1.14rem; font-weight: 700; margin: 0 0 6px; }
.quiz-th { margin: 0; font-size: 0.92rem; }
.quiz-instruction { margin: 0; font-weight: 600; }

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

.quiz-opt-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--border-strong);
  background: var(--bg-solid);
  cursor: pointer;
  transition: all 0.14s ease;
}

.quiz-opt-btn:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-1px); }
.quiz-opt-btn strong { display: block; font-family: var(--font-en); font-size: 1rem; margin-bottom: 3px; }
.quiz-opt-btn small { color: var(--text-muted); font-size: 0.84rem; }

.quiz-opt-btn.correct { background: var(--success-soft); border-color: var(--success); }
.quiz-opt-btn.wrong { background: var(--rose-soft); border-color: var(--rose); }

.quiz-footer { display: flex; justify-content: flex-end; }

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.modal-wide { max-width: 720px; }

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

.modal-head h3 { margin: 0; }

.voice-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--text-muted); }

.voice-row { display: flex; gap: 8px; }
.voice-row .select-input { flex: 1; min-width: 0; }

.favs-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.fav-item {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fav-item strong { display: block; font-family: var(--font-en); font-size: 0.98rem; }
.fav-item small { color: var(--text-muted); font-size: 0.84rem; }
.fav-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .msg-row { max-width: 96%; }
}

@media (max-width: 560px) {
  .topbar-right .pill-btn { padding: 6px 10px; font-size: 0.78rem; }
  .brand-copy small { display: none; }
}

/* ==================== CINEMA STAGE, SCENE PHOTOS & WORD FILL MODE ==================== */
.hero-scene-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.hero-scene-strip img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
}
.scenario-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sc-photo-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 12px;
}
.sc-photo-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.62) 100%);
}
.sc-photo-icon, .sc-photo-banner .level-badge {
  position: relative;
  z-index: 2;
}
.sc-photo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.sc-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.cinema-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 230px;
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.28);
  border: 2px solid rgba(99, 102, 241, 0.45);
  color: #fff;
}
.cinema-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 15, 30, 0.62) 0%, rgba(10, 15, 30, 0.45) 45%, rgba(8, 11, 22, 0.9) 100%);
}
.cinema-top-bar, .cinema-actors, .cinema-subtitle {
  position: relative;
  z-index: 2;
}
.cinema-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cinema-badge {
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f8fafc;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.cinema-badge.streak-pill {
  background: rgba(245, 158, 11, 0.24);
  border-color: #fbbf24;
  color: #fef3c7;
}
.cinema-actors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.actor-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.actor-card.is-speaking {
  border-color: #38bdf8;
  background: rgba(30, 58, 138, 0.82);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.55);
}
.actor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}
.actor-info strong {
  display: block;
  color: #fff;
  font-size: 0.98rem;
}
.actor-info small {
  display: block;
  color: #cbd5e1;
  font-size: 0.78rem;
}
.actor-speaking-tag {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #38bdf8;
  color: #082f49;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.actor-card.is-speaking .actor-speaking-tag {
  opacity: 1;
}
.cinema-vs-wave {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}
.cinema-subtitle {
  background: rgba(8, 12, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
}
.cinema-sub-en {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
}
.cinema-sub-th {
  font-size: 0.86rem;
  color: #fde68a;
  margin-top: 3px;
}
.culture-tip-box {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.ambience-btn {
  cursor: pointer;
}
.ambience-btn[aria-pressed="true"] {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #047857;
}
body.theme-dark .ambience-btn[aria-pressed="true"] {
  color: #6ee7b7;
}
.fill-sentence {
  font-size: 1.2rem;
  line-height: 1.6;
}
.fill-blank-slot {
  display: inline-block;
  padding: 2px 12px;
  margin: 0 3px;
  border-radius: 8px;
  border: 2px dashed #6366f1;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  font-weight: 800;
}
.fill-blank-slot.filled {
  border-style: solid;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.16);
  color: #059669;
}
.fill-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.fill-word-btn {
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border, #cbd5e1);
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.fill-word-btn:hover:not(:disabled) {
  border-color: #6366f1;
  transform: translateY(-2px);
}
.fill-word-btn.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.18);
}
.fill-word-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
}
@media (max-width: 680px) {
  .cinema-actors { grid-template-columns: 1fr; }
  .cinema-vs-wave { display: none; }
  .hero-scene-strip { grid-template-columns: repeat(2, 1fr); }
  .fill-options { grid-template-columns: 1fr; }
}
