/* ==========================================================
   REGENESIS — 4K OLED POD SCREEN VISUALIZER
   Luxury Architectural Glassmorphic Stylesheet
   ========================================================== */

/* --- NEW SCIENCE TYPOGRAPHY --- */
@font-face {
  font-family: 'New Science';
  src: url('fonts/New_Science_Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science';
  src: url('fonts/New_Science_Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science';
  src: url('fonts/New_Science_Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science';
  src: url('fonts/New_Science_SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science';
  src: url('fonts/New_Science_Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science Extended';
  src: url('fonts/New_Science_Regular_Extended.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'New Science Extended';
  src: url('fonts/New_Science_Bold_Extended.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-main: 'New Science', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-extended: 'New Science Extended', 'New Science', system-ui, sans-serif;

  /* Theme Colors - Obsidian Luxury */
  --bg-deep: #06090e;
  --bg-surface: rgba(13, 19, 31, 0.72);
  --bg-surface-elevated: rgba(20, 28, 45, 0.85);
  --bg-glass-input: rgba(255, 255, 255, 0.05);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(2, 132, 199, 0.5);
  --border-glass-card: rgba(255, 255, 255, 0.12);

  --color-accent: #0284c7;
  --color-accent-glow: rgba(2, 132, 199, 0.35);
  --color-gold: #c5a059;
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.4);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-dock: 0 24px 60px -12px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  --shadow-card: 0 20px 40px -10px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f1f5f9; /* Default Architectural Studio White */
  color: var(--text-primary);
}

body.env-studio-white {
  background-color: #f1f5f9;
}

/* 3D Canvas Viewport */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- LIVE 9:16 MIRROR FLOATING STATUS BADGE --- */
.mirror-status-badge {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.mirror-status-badge.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-10px);
}

.mirror-badge-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 12px rgba(16, 185, 129, 0.25);
}

.status-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGlow 1.6s infinite ease-in-out;
}

.mirror-badge-title {
  font-family: var(--font-main);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f8fafc;
}

.mirror-badge-sub {
  font-family: monospace;
  font-size: 0.62rem;
  color: #34d399;
  letter-spacing: 0.08em;
}

.mirror-stop-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.mirror-stop-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

.mirror-launch-btn {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.8), rgba(16, 185, 129, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.mirror-launch-btn:hover {
  background: linear-gradient(135deg, rgba(2, 132, 199, 1), rgba(16, 185, 129, 1));
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

/* --- TECHNICAL LUXURY LOADING OVERLAY --- */
.luxury-loader-overlay {
  position: fixed;
  inset: 0;
  background-color: #070a10;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

.luxury-loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-bg-pattern {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.loader-watermark {
  width: 600px;
  height: 600px;
  opacity: 0.03;
  filter: blur(2px);
}

.loader-hud-card {
  position: relative;
  width: 90%;
  max-width: 480px;
  background: rgba(14, 20, 32, 0.85);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 38px 32px 32px;
  box-shadow: var(--shadow-dock);
  text-align: center;
}

.loader-emblem-container {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-outer-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(2, 132, 199, 0.5);
  animation: spinSlow 12s linear infinite;
}

.loader-pulse-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-glow) 0%, transparent 70%);
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.loader-shield-img {
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 2;
}

.loader-brand-title {
  font-family: var(--font-extended);
  font-size: 1.6rem;
  letter-spacing: 0.32em;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.loader-brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 24px;
}

.loader-telemetry-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 24px;
  text-align: left;
}

.telemetry-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.telemetry-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--color-emerald);
  font-weight: 600;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald-glow);
  animation: pulseDot 1.6s ease-in-out infinite;
}

.telemetry-code {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.telemetry-feed-text {
  font-family: monospace;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loader-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loader-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.loader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.2s ease-out;
  position: relative;
}

.loader-progress-pip {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: #ffffff;
  box-shadow: 0 0 10px #38bdf8;
}

.loader-progress-metrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.loader-metric-pct {
  font-family: monospace;
  color: var(--color-accent);
  font-weight: 600;
}

/* --- TOP NAVIGATION BAR --- */
.top-nav {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 40;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.top-nav.cinema-hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.brand-area {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-card);
  border-radius: var(--radius-full);
  padding: 8px 18px 8px 14px;
  box-shadow: var(--shadow-card);
}

.brand-logo-img {
  height: 18px;
  width: auto;
}

.brand-divider {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 300;
}

.brand-subline {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  font-weight: 500;
}

.telemetry-nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-card);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #e2e8f0;
  box-shadow: var(--shadow-card);
}

.nav-actions {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Glass Buttons */
.glass-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-card);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.glass-btn-pill:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-btn-pill.active {
  background: rgba(2, 132, 199, 0.18);
  border-color: var(--color-accent);
  color: #38bdf8;
  box-shadow: 0 0 20px var(--color-accent-glow);
}

.glass-btn-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass-card);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.glass-btn-icon:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.glass-btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 8px 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  transition: var(--transition-fast);
}

.glass-btn-accent:hover {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.6);
  transform: translateY(-1px);
}

/* --- LUXURY GLASSMORPHIС RIGHT SIDEBAR & FLOATING DOCK --- */
.control-sidebar {
  position: fixed;
  right: 24px;
  top: 76px;
  bottom: 24px;
  width: 320px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(10, 15, 26, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-dock);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.control-sidebar.cinema-hidden {
  opacity: 0;
  transform: translateX(40px);
  pointer-events: none;
}

.control-sidebar::-webkit-scrollbar {
  width: 5px;
}
.control-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.control-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
.control-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.segmented-control.vertical-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 3px;
}

.segmented-control.vertical-stack .seg-btn {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-xs);
  padding: 7px 12px;
}

.full-width {
  width: 100% !important;
}

/* Transport card in sidebar */
.sidebar-transport-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

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

.time-readout {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.time-readout .time-code {
  color: var(--text-secondary);
}

/* URL Input in Sidebar */
.sidebar-input-wrap {
  width: 100%;
}

.sidebar-text-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.76rem;
  outline: none;
  box-sizing: border-box;
  transition: var(--transition-fast);
}

.sidebar-text-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.sidebar-info-note {
  font-size: 0.67rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Selects */
.select-wrap {
  position: relative;
  width: 100%;
}

.luxury-select {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: #f8fafc;
  font-family: var(--font-main);
  font-size: 0.76rem;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: var(--transition-fast);
}

.luxury-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent-glow);
}

.luxury-select option {
  background: #0d131f;
  color: #f8fafc;
}

.sidebar-row-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Legacy / Fallback Bottom Floating Glass Dock */
.control-dock {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1080px, 95vw);
  background: var(--bg-surface);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-glass-card);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  box-shadow: var(--shadow-dock);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.control-dock.cinema-hidden {
  opacity: 0;
  transform: translate(-50%, 40px);
  pointer-events: none;
}

.dock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.primary-transport-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 14px;
}

/* Source Selector & Segmented Control */
.source-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-label {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
}

.segmented-control {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
}

.seg-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.seg-btn:hover {
  color: #ffffff;
}

.seg-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.segmented-control.mini .seg-btn {
  padding: 4px 10px;
  font-size: 0.68rem;
}

/* Transport Controls */
.transport-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

.transport-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.transport-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.transport-btn-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.transport-btn-small:hover {
  color: #ffffff;
}

/* Scrubber */
.time-scrubber-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 280px;
}

.time-code {
  font-family: monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 38px;
  text-align: center;
}

.scrub-slider-wrap {
  position: relative;
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
}

.scrub-fill {
  position: absolute;
  left: 0;
  height: 4px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: 1;
}

/* Sliders */
.luxury-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.luxury-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.luxury-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.mini-range {
  width: 80px;
}

.volume-control-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Secondary Settings Row */
.secondary-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.setting-val {
  font-family: monospace;
  font-size: 0.62rem;
  color: var(--color-accent);
}

.slider-setting {
  min-width: 90px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-group-mini {
  display: flex;
  gap: 6px;
}

.glass-btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 5px 9px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.glass-btn-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Key hint bar */
.key-hint-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  z-index: 25;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.key-hint-bar.cinema-hidden {
  opacity: 0;
}

kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 4px;
  font-family: monospace;
  font-size: 0.6rem;
  color: #cbd5e1;
}

.hint-sep {
  opacity: 0.4;
}

/* Cinema Exit Pill */
.cinema-exit-pill {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: #94a3b8;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 8px 18px;
  cursor: pointer;
  z-index: 100;
  transition: var(--transition-fast);
}

.cinema-exit-pill:hover {
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border-color: var(--color-accent);
}

/* Drop Zone Overlay */
.drop-zone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.85);
  backdrop-filter: blur(20px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--color-accent);
  margin: 20px;
  border-radius: var(--radius-lg);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drop-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  margin-bottom: 6px;
  animation: pulseGlow 2s infinite ease-in-out;
}

.drop-card h3 {
  font-family: var(--font-extended);
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  color: #ffffff;
}

.drop-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Keyframe Animations */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* --- 2D FLAT PATTERN VIEWPORT (ZERO 3D PROJECTION) --- */
.flat-pattern-view {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060910;
}

.flat-pattern-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 45%, rgba(15, 23, 42, 0.95) 0%, rgba(4, 7, 12, 1) 100%),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 45px 45px, 45px 45px;
  pointer-events: none;
}

.flat-cad-hud {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.flat-cad-hud.cinema-hidden {
  opacity: 0;
}

.cad-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 19, 31, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(2, 132, 199, 0.45);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cad-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulseDot 2s infinite ease-in-out;
}

.cad-badge-title {
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #f8fafc;
}

.cad-metrics-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 0.64rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.cad-metrics-row strong {
  color: #38bdf8;
  font-weight: 600;
}

.cad-metric-sep {
  opacity: 0.35;
}

/* Central Stage Wrap */
.flat-stage-wrap {
  position: relative;
  height: min(78vh, 860px);
  width: calc(min(78vh, 860px) * 0.569363);
  max-width: 90vw;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  margin-top: 24px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.flat-screen-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: #000000;
}

.flat-screen-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.flat-dxf-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Persistent View Switcher (Fixed Bottom-Left on both 3D Cabin & Flat View) */
.persistent-view-switcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 55;
  display: flex;
  align-items: center;
  pointer-events: auto;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.persistent-view-switcher.cinema-hidden {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.view-mode-pill-container {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 15, 26, 0.90);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  padding: 4px;
  gap: 4px;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.12);
}

.view-pill-btn {
  background: transparent;
  border: none;
  outline: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.view-pill-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.view-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Mobile Drawer Components (Hidden on Desktop) */
.mobile-drawer-header {
  display: none;
}

.mobile-drawer-backdrop {
  display: none;
}

.mobile-controls-toggle {
  display: none;
}

.mobile-only-section {
  display: none;
}

/* ==========================================================================
   Responsive Mobile Optimization (Max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  #canvas-container {
    touch-action: none;
  }

  /* Top Navigation */
  .top-nav {
    left: 12px;
    right: 12px;
    top: 10px;
  }

  .brand-area {
    padding: 6px 10px;
    gap: 6px;
  }

  .brand-logo-img {
    height: 15px;
  }

  .brand-divider,
  .brand-subline,
  .telemetry-nav-pill {
    display: none;
  }

  /* Hide header angle selector on mobile (accessible in controls drawer) */
  #angle-selector {
    display: none !important;
  }

  /* Compact Canopy Door button (Icon only on mobile) */
  #canopy-status-text {
    display: none;
  }

  #btn-canopy-toggle {
    padding: 6px 9px;
    border-radius: var(--radius-full);
  }

  #btn-cinema-toggle {
    width: 32px;
    height: 32px;
    padding: 6px;
  }

  /* Mobile Bottom Sheet Controls Drawer */
  .mobile-drawer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 6px;
  }

  .mobile-drawer-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
  }

  .mobile-drawer-title-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-drawer-title {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-primary);
  }

  .mobile-drawer-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-drawer-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
  }

  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 14, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 65;
    opacity: 1;
    transition: opacity 0.28s ease;
  }

  .mobile-drawer-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .control-sidebar {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    max-width: 100vw;
    max-height: 76vh;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 12px 18px 30px 18px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.15);
    z-index: 70;
    transform: translateY(115%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .control-sidebar.mobile-open {
    transform: translateY(0);
  }

  .mobile-only-section {
    display: block;
  }

  /* Floating Controls Toggle Button (Bottom-Right) */
  .mobile-controls-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 16px;
    right: 14px;
    z-index: 55;
    background: rgba(13, 19, 32, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full);
    padding: 7px 15px;
    color: #f8fafc;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.12);
    transition: all 0.22s ease;
  }

  .mobile-controls-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  .mobile-controls-toggle.cinema-hidden {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
  }

  /* Persistent View Switcher on Mobile (Bottom-Left) */
  .persistent-view-switcher {
    bottom: 16px;
    left: 14px;
    z-index: 55;
  }

  .persistent-view-switcher .view-pill-btn {
    padding: 7px 12px;
    font-size: 11px;
    gap: 4px;
  }

  /* CAD Telemetry HUD in Flat View on Mobile */
  .flat-cad-hud {
    top: 56px;
    width: 92vw;
    max-width: 92vw;
    gap: 4px;
  }

  .cad-badge {
    padding: 3px 10px;
  }

  .cad-badge-title {
    font-size: 8.5px;
    letter-spacing: 0.05em;
  }

  .cad-metrics-row {
    font-size: 9px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Sized to comfortably fit 9:16 portrait on mobile viewports */
  .flat-stage-wrap {
    height: min(65vh, 520px);
    width: calc(min(65vh, 520px) * 0.569363);
    margin-top: 40px;
  }

  .key-hint-bar {
    display: none !important;
  }
}
