/* =========================================================================
   ONE TREE HILL: DIRECTOR'S CUT — PRODUCTION SIMULATOR STYLES
   ========================================================================= */

:root {
  --bg-dark: #0a0c10;
  --bg-panel: #12161f;
  --bg-card: #191f2c;
  --bg-card-hover: #222a3b;
  --border-subtle: #283145;
  --border-gold: #e59a28;
  --accent-amber: #f59e0b;
  --accent-orange: #ea580c;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-purple: #a855f7;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --font-display: 'Anton', Impact, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-hand: 'Caveat', cursive;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow: hidden;
}

/* Subtle 35mm Film Grain Overlay */
.film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: radial-gradient(rgba(255,255,255,0.2) 1px, transparent 0);
  background-size: 3px 3px;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
  position: relative;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ================= TITLE SCREEN ================= */
#title-screen {
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 35%, #1e293b 0%, #090b10 80%);
}

.title-bg-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#title-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.title-overlay {
  position: relative;
  z-index: 2;
  max-width: 820px;
  padding: 2.5rem 3rem;
  background: rgba(11, 14, 21, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(245, 158, 11, 0.12);
  backdrop-filter: blur(12px);
  text-align: center;
}

.wb-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  margin-bottom: 0.8rem;
}

.main-title {
  font-family: var(--font-display);
  font-size: 5rem;
  letter-spacing: 0.06em;
  line-height: 0.95;
  color: #ffffff;
  text-shadow: 0 4px 25px rgba(245, 158, 11, 0.5), 0 0 2px #000;
  margin-bottom: 0.35rem;
}

.subtitle-banner {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: var(--accent-amber);
  margin-bottom: 1.25rem;
}

.title-tagline {
  font-size: 1.05rem;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.title-tagline span {
  display: block;
  font-style: normal;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.title-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.feat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.feat-pill strong {
  color: #fff;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.btn-primary-clapper {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #090b10;
  border: none;
  border-radius: 8px;
  padding: 0.95rem 1.8rem;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-clapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.55);
}

.clapper-stripes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    #090b10,
    #090b10 8px,
    #ffffff 8px,
    #ffffff 16px
  );
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.9rem 1.35rem;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-amber);
}

.sound-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toggle-audio {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

/* ================= TOP PRODUCTION HUD ================= */
.top-hud {
  height: 58px;
  background: #0d1017;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  flex-shrink: 0;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-icon:hover {
  border-color: var(--accent-amber);
}

.ep-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

.ep-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent-amber);
}

.ep-name {
  font-weight: 700;
  font-size: 0.86rem;
}

.scene-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.32rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

#hud-scene-num {
  color: #38bdf8;
  font-weight: 700;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stat-bar-wrap {
  width: 72px;
  height: 8px;
  background: #090b10;
  border-radius: 99px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}

.stat-bar.ratings { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-bar.chemistry { background: linear-gradient(90deg, #ec4899, #f43f5e); }
.stat-bar.heart { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
}

.budget-val {
  color: var(--accent-green);
  font-size: 0.85rem;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hud-script {
  background: #1e293b;
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.35);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-hud-script:hover {
  background: #334155;
}

/* ================= MAIN 3-COLUMN STUDIO WORKSPACE ================= */
.studio-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 310px;
  gap: 0.65rem;
  padding: 0.65rem;
  overflow: hidden;
}

.panel-left, .panel-center, .panel-right {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header h2 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--accent-amber);
  font-weight: 700;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* LEFT PANEL: SCRIPT BRIEF & GEAR SELECTORS */
.script-card {
  margin: 0.65rem;
  padding: 0.75rem;
  background: #171c28;
  border: 1px solid #2b354b;
  border-left: 3px solid var(--accent-amber);
  border-radius: 6px;
}

.script-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.slugline {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.74rem;
  color: #fff;
}

.weather-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #93c5fd;
}

.scene-synopsis {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.director-goal-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: 5px;
  padding: 0.45rem 0.6rem;
}

.goal-header {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.3rem;
}

.goal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vibe-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fde68a;
}

.setup-controls {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.65rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}

.option-cards {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.opt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opt-card:hover {
  background: var(--bg-card-hover);
  border-color: #475569;
}

.opt-card.selected {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  box-shadow: inset 0 0 0 1px var(--accent-amber);
}

.opt-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.opt-title {
  font-size: 0.79rem;
  font-weight: 700;
  color: #fff;
}

.opt-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.opt-cost {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #34d399;
  flex-shrink: 0;
}

/* LIVE TELEMETRY DURING FILMING */
.live-telemetry {
  flex: 1;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
}

.telemetry-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  text-align: center;
}

.take-quality-meter {
  background: var(--bg-card);
  padding: 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.meter-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.quality-bar-outer {
  width: 100%;
  height: 12px;
  background: #090b10;
  border-radius: 99px;
  overflow: hidden;
}

.quality-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.25s ease;
}

.shot-log-header {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.shot-log-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.shot-log-item {
  padding: 0.4rem 0.55rem;
  background: rgba(255,255,255,0.03);
  border-left: 3px solid var(--accent-amber);
  border-radius: 4px;
  color: #e2e8f0;
}

.shot-log-item.great {
  border-left-color: var(--accent-green);
  color: #a7f3d0;
}

/* CENTER PANEL: VIEWPORT & CAMERA DECK */
.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: #0e121a;
  border-bottom: 1px solid var(--border-subtle);
}

.mode-tabs {
  display: flex;
  gap: 0.4rem;
}

.mode-tab {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.38rem 0.85rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-tab.active {
  background: rgba(245, 158, 11, 0.16);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.timecode-display {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #f87171;
  background: #07090d;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  border: 1px solid #27272a;
}

.canvas-stage-wrap {
  flex: 1;
  position: relative;
  background: #07090e;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#stage-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
}

#stage-canvas:active {
  cursor: grabbing;
}

/* CLAPPERBOARD OVERLAY */
.clapper-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30;
}

.clapper-board {
  width: 340px;
  background: #18181b;
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.9);
  overflow: hidden;
  transform: scale(1);
  animation: popIn 0.25s ease-out;
}

.clapper-top {
  height: 36px;
  background: repeating-linear-gradient(
    -45deg,
    #111,
    #111 18px,
    #f59e0b 18px,
    #f59e0b 36px
  );
  border-bottom: 3px solid #fff;
  transform-origin: left bottom;
  transition: transform 0.18s ease-in;
}

.clapper-top.open {
  transform: rotate(-22deg);
}

.clapper-body {
  padding: 1rem;
  font-family: var(--font-mono);
  color: #fff;
}

.clapper-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #3f3f46;
  padding: 0.45rem 0;
}

.clapper-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.clapper-row small {
  display: block;
  font-size: 0.62rem;
  color: #a1a1aa;
}

.clapper-row strong {
  font-size: 1rem;
  color: var(--accent-amber);
}

/* COACHING MODAL OVERLAY */
.coaching-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 16, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 35;
  padding: 1.5rem;
}

.coaching-card {
  max-width: 560px;
  width: 100%;
  background: #141925;
  border: 2px solid var(--accent-amber);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}

.coaching-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #090b10;
  background: var(--accent-amber);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}

.coaching-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
  color: #fff;
}

.coaching-context {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.coaching-choices {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.coach-btn {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.coach-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  transform: translateX(4px);
}

.coach-btn strong {
  display: block;
  font-size: 0.88rem;
  color: var(--accent-amber);
  margin-bottom: 0.2rem;
}

.coach-btn span {
  font-size: 0.78rem;
  color: #cbd5e1;
}

/* BOTTOM CAMERA SWITCHER & ACTION BAR */
.switcher-deck {
  padding: 0.65rem 0.85rem;
  background: #0e121a;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cam-buttons {
  display: flex;
  gap: 0.5rem;
}

.cam-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0.5rem 0.8rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s;
}

.cam-btn:hover {
  border-color: #64748b;
}

.cam-btn.active {
  background: rgba(239, 68, 68, 0.16);
  border-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

.cam-btn.recommended {
  border-color: var(--accent-amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.cam-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #475569;
}

.cam-btn.active .cam-led {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.cam-btn-info {
  text-align: left;
}

.cam-btn-info strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.cam-btn-info small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.deck-instructions {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  text-align: center;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-deck-secondary {
  background: var(--bg-card);
  color: #e2e8f0;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-deck-secondary:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.btn-roll-action {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-roll-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.6);
}

.btn-cut-print {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #052e16;
  border: none;
  border-radius: 7px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

/* RIGHT PANEL: CAST ON SET & LIVE DIALOGUE */
.cast-list {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  max-height: 245px;
  overflow-y: auto;
}

.cast-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cast-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #090b10;
  flex-shrink: 0;
}

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

.cast-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.mark-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.mark-badge.good {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.mark-badge.off {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.dialogue-monitor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dialogue-header {
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.optimal-cam-pill {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.dialogue-feed {
  flex: 1;
  padding: 0.65rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.feed-placeholder {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  margin-top: 2rem;
  line-height: 1.5;
}

.dialogue-line {
  background: #161c28;
  border: 1px solid #263044;
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  animation: fadeSlideUp 0.22s ease-out;
}

.dialogue-line.active-beat {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.09);
}

.line-speaker {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 0.25rem;
}

.line-text {
  font-size: 0.8rem;
  color: #f1f5f9;
  line-height: 1.42;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= MODALS ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal.hidden, .hidden {
  display: none !important;
}

.modal-card {
  background: #131824;
  border: 1px solid #2e3a52;
  border-radius: 12px;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.6rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent-amber);
}

.btn-close {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
}

/* EPISODE SELECT GRID */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 0.85rem;
}

.ep-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ep-select-card:hover {
  border-color: var(--accent-amber);
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

.ep-select-card .ep-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-amber);
  font-weight: 700;
}

.ep-select-card h3 {
  font-size: 1.02rem;
  margin: 0.25rem 0 0.45rem;
  color: #fff;
}

.ep-select-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.8rem;
}

.ep-select-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #93c5fd;
}

/* CRISIS MODAL */
.crisis-card {
  max-width: 650px;
  border: 2px solid var(--accent-amber);
}

.crisis-banner {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: #090b10;
  background: var(--accent-amber);
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.crisis-ep-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

#crisis-headline {
  font-size: 1.45rem;
  color: #fff;
  margin-bottom: 0.65rem;
}

.crisis-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.crisis-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.crisis-opt-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  text-align: left;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.crisis-opt-btn:hover {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
}

.crisis-opt-btn strong {
  display: block;
  font-size: 0.92rem;
  color: var(--accent-amber);
  margin-bottom: 0.25rem;
}

.crisis-opt-btn span {
  display: block;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.crisis-opt-btn small {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #34d399;
}

/* WRAP MODAL */
.wrap-card {
  max-width: 700px;
}

.wrap-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-amber);
  letter-spacing: 0.1em;
}

.wrap-header h2 {
  font-size: 1.5rem;
  margin: 0.25rem 0 1rem;
}

.wrap-score-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.wrap-metric {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.wrap-metric small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.wrap-metric strong {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-amber);
}

.wrap-notes-box {
  background: #171f2e;
  border-left: 4px solid var(--accent-amber);
  padding: 0.95rem 1.1rem;
  border-radius: 6px;
  margin-bottom: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.wrap-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* SCRIPT PAGES MODAL */
.script-pages {
  background: #fdf2f8;
  color: #18181b;
  font-family: var(--font-mono);
  padding: 1.75rem 2.25rem;
  border-radius: 6px;
  line-height: 1.6;
  font-size: 0.86rem;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.12);
}

.script-pages h4 {
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #d4d4d8;
  padding-bottom: 0.35rem;
}

.script-margin-note {
  font-family: var(--font-hand);
  color: #be123c;
  font-size: 1.15rem;
  margin: 0.6rem 0;
}

.manual-step {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.manual-step h3 {
  font-size: 1rem;
  margin: 0.2rem 0 0.4rem;
}

.manual-step p {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
}
