@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   STREAM ROOM - AUTHENTIC THEME & OLED CINEMA SYSTEM
   ========================================================================== */

:root {
  --bg-darkest: #050608;
  --bg-app: #08090d;
  --bg-surface: #10121a;
  --bg-secondary: #171924;
  --bg-tertiary: #1f2232;
  --bg-input: #151722;
  --bg-stage: #000000;

  --text-white: #ffffff;
  --text-normal: #dbdee1;
  --text-muted: #949ba4;

  --blurple: #5865f2;
  --blurple-hover: #4752c4;
  --green: #23a55a;
  --green-glow: rgba(35, 165, 90, 0.7);
  --red: #da373c;
  --red-hover: #c03136;
  --coral: #e50914;
  --coral-bright: #ff3b53;

  /* Typography & Design Tokens */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-sans);
  letter-spacing: -0.011em;
  background-color: var(--bg-darkest);
  color: var(--text-normal);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
  text-rendering: optimizeLegibility;
}

body.about-standalone-page,
body.error-page-container {
  height: auto !important;
  min-height: 100% !important;
  min-height: 100dvh !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  user-select: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: auto !important;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.01em;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--blurple);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--blurple);
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}
.btn-primary:hover {
  background-color: var(--blurple-hover);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   1. JOIN ROOM MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  backdrop-filter: blur(8px);
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  background: linear-gradient(
    145deg,
    rgba(22, 25, 38, 0.88) 0%,
    rgba(14, 16, 26, 0.94) 100%
  );
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: min(100%, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
    0 28px 70px -10px rgba(0, 0, 0, 0.8),
    0 8px 24px rgba(0, 0, 0, 0.5);
}

.brand-badge {
  width: 52px;
  height: 52px;
  background-color: var(--blurple);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.modal-header {
  text-align: center;
}

.modal-header h2 {
  font-size: 22px;
  color: var(--text-white);
  font-weight: 700;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.form-group input {
  background-color: var(--bg-darkest);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-white);
  font-size: 14px;
  outline: none;
}
.form-group input:focus {
  border-color: var(--blurple);
}

.room-input-row {
  display: flex;
  gap: 8px;
}
.room-input-row input {
  flex: 1;
}

.network-badge {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   2. MAIN APPLICATION (Matching Image 1 & 2)
   ========================================================================== */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  background-color: var(--bg-darkest);
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* Top Bar (Image 1 top left: Speaker + "Stream Room"; top right: Chat icon) */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(clamp(12px, 1.8vh, 18px), env(safe-area-inset-top, 12px))
           max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right, 16px))
           max(clamp(8px, 1.2vh, 14px), 8px)
           max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left, 16px));
  box-sizing: border-box;
  z-index: 50;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speaker-icon {
  color: var(--text-muted);
}

.room-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
  letter-spacing: 0.2px;
}

.host-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-normal);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.15s ease;
}
.icon-btn:hover {
  color: var(--text-white);
}

.chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Workspace */
.main-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Stage Section (Center Theater) */
.stage-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px 96px;
  background: radial-gradient(ellipse 90% 65% at 50% 45%, rgba(88, 101, 242, 0.12) 0%, rgba(35, 165, 90, 0.05) 42%, rgba(8, 10, 15, 0.98) 78%);
  position: relative;
  overflow: hidden;
  transition: padding 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.idle-mode .stage-section {
  padding: 14px 20px 14px;
}

/* Stage Cinema Group (Wraps cinema stage wrapper + participants so they collectively drop down in idle mode) */
.stage-cinema-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(1360px, 94vw);
  position: relative;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.is-grid-view .stage-cinema-group {
  display: contents !important;
}

/* Cinema Stage Wrapper (Wraps Ambient Glow canvas + Cinema Box) */
.cinema-stage-wrapper {
  width: 100%;
  max-width: min(1320px, 92vw);
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 250px);
  max-height: calc(100dvh - 250px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 1;
  margin: 0 auto;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              scale 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Desktop Dock & Participant Clearance: Prevents webcam and dock overlap */
@media (min-width: 933px) {
  body.has-participants .cinema-stage-wrapper,
  .stage-cinema-group:has(.participants-tile-area:not(.hidden)) .cinema-stage-wrapper {
    max-height: calc(100vh - 360px);
    max-height: calc(100dvh - 360px);
  }
}

/* Main Cinema Frame (Matching the red outline: grand cinema stage) */
.cinema-box {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 12px;
  position: relative;
  z-index: 2; /* CRITICAL: Stacked on top of ambient glow canvas (z-index: 0) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  flex-shrink: 1;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#moviePlayer {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  border-radius: 12px;
  position: relative;
  z-index: 2;
  /* Deep cinema black calibration (eliminates washed-out greyish YUV mismatch on mobile/browsers) */
  filter: contrast(1.04) brightness(0.98);
}

/* ==========================================================================
   STAGE LOUNGE & ARENA (Waiting State when no media is active)
   ========================================================================== */
.stage-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: var(--bg-stage);
  border-radius: 12px;
  cursor: default;
  overflow: hidden;
}

.stage-lounge,
.cinema-stage-lounge {
  background: radial-gradient(circle at 50% 40%, #1e2029 0%, #12131a 55%, #090a0d 100%);
}

.stage-lounge-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1080px, 92vw);
  height: min(600px, 80vh);
  border-radius: 50%;
  background: radial-gradient(ellipse 75% 55% at 50% 50%, rgba(88, 101, 242, 0.28) 0%, rgba(35, 165, 90, 0.16) 42%, transparent 72%);
  filter: blur(56px);
  pointer-events: none;
  animation: loungeGlowBreathing 4.5s infinite ease-in-out;
  z-index: 1;
}

@keyframes loungeGlowBreathing {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.stage-lounge-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: min(680px, 64vw);
  width: 92%;
  max-height: 94%;
  box-sizing: border-box;
  padding: 38px 48px;
  background: rgba(30, 31, 38, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stage-lounge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stage-avatar-wrapper {
  position: relative;
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
}

/* 1. Concentric speaking pulse halo: ONLY active when mic is open */
.stage-speaking-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #23a55a;
  opacity: 0.8;
  animation: speakingHaloPulse 2.4s infinite cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  display: none;
}

.stage-avatar-wrapper.mic-open .stage-speaking-pulse {
  display: block;
}

.stage-avatar-wrapper.mic-muted .stage-speaking-pulse {
  display: none !important;
}

@keyframes speakingHaloPulse {
  0% { transform: scale(0.92); opacity: 0.9; box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.6); }
  70% { transform: scale(1.18); opacity: 0; box-shadow: 0 0 0 16px rgba(35, 165, 90, 0); }
  100% { transform: scale(1.18); opacity: 0; }
}

/* 2. Avatar Box: Green halo & ring when mic is open; sleek neutral border when muted */
.stage-center-avatar-box {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #2b2d31;
  border: 3px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.stage-avatar-wrapper.mic-open .stage-center-avatar-box {
  border-color: #23a55a;
  box-shadow: 0 0 22px rgba(35, 165, 90, 0.45);
}

.stage-avatar-wrapper.mic-muted .stage-center-avatar-box {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.stage-center-avatar-box img,
.stage-center-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 3. Mic Badge: Bottom right circular indicator */
.stage-avatar-mic-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #1e2029;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
}

.stage-avatar-mic-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

.stage-avatar-mic-badge:hover {
  transform: scale(1.08);
}

/* Open Mic: Green (#23a55a) */
.stage-avatar-wrapper.mic-open .stage-avatar-mic-badge {
  background-color: #23a55a;
  box-shadow: 0 2px 10px rgba(35, 165, 90, 0.45);
}

.stage-avatar-wrapper.mic-open .stage-mic-icon-open {
  display: block;
}

.stage-avatar-wrapper.mic-open .stage-mic-icon-muted {
  display: none;
}

/* Muted Mic: Red (#da373c) */
.stage-avatar-wrapper.mic-muted .stage-avatar-mic-badge {
  background-color: #da373c;
  box-shadow: 0 2px 10px rgba(218, 55, 60, 0.4);
}

.stage-avatar-wrapper.mic-muted .stage-mic-icon-open {
  display: none;
}

.stage-avatar-wrapper.mic-muted .stage-mic-icon-muted {
  display: block;
}

.stage-lounge-details {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-badge-row {
  margin-bottom: 12px;
}

.stage-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid rgba(35, 165, 90, 0.35);
  color: #57F287;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  user-select: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stage-status-pill.is-muted {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #949ba4;
}

.stage-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #57F287;
  box-shadow: 0 0 8px rgba(87, 242, 135, 0.9);
  animation: livePillPulse 2s infinite ease-in-out;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.stage-status-pill.is-muted .stage-status-dot {
  background-color: #da373c;
  box-shadow: 0 0 6px rgba(218, 55, 60, 0.5);
  animation: none;
}

.stage-lounge-title {
  font-size: 24px;
  font-weight: 700;
  color: #f2f3f5;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.stage-lounge-subtext {
  font-size: 14.5px;
  line-height: 1.55;
  color: #949ba4;
  margin-bottom: 22px;
  max-width: 480px;
}

.btn-stage-primary {
  background-color: #5865F2;
  color: #ffffff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.38);
  transition: background-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-stage-primary:hover {
  background-color: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(88, 101, 242, 0.55);
}

.btn-stage-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Fallback legacy .load-movie-btn classes */
.load-movie-btn {
  opacity: 0.95;
  pointer-events: auto;
}

/* ==========================================================================
   STAGE BROADCASTER BADGE (Top-Left Pill in Theater)
   ========================================================================== */
.stage-bottom-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(18, 20, 27, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
  z-index: 6;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.stage-stream-badge .stage-live-label {
  background-color: #f23f43;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1.5px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.stage-stream-badge .stage-tag-divider {
  width: 1px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.18);
}

.stage-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #57F287;
  box-shadow: 0 0 8px rgba(87, 242, 135, 0.9);
  animation: livePillPulse 2s infinite ease-in-out;
}

@keyframes livePillPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.tag-mic-icon {
  color: var(--red);
  flex-shrink: 0;
}

/* ==========================================================================
   TOP RIGHT CINEMA VOLUME HUD INDICATOR (In-sync overlay)
   ========================================================================== */
.cinema-volume-meter {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(16, 17, 21, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 169, 60, 0.4);
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px rgba(229, 169, 60, 0.15);
  color: #fff;
  z-index: 70;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s ease, transform 0.22s ease;
  user-select: none;
}

.cinema-volume-meter.fade-out {
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
}

.cinema-volume-meter svg {
  color: #e5a93c;
  flex-shrink: 0;
}

.meter-bar-track {
  width: 72px;
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.meter-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e5a93c, #ffc86b);
  border-radius: 3px;
  transition: width 0.08s ease-out;
}

.meter-value {
  font-size: 13px;
  font-weight: 700;
  min-width: 42px;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.tag-mic-icon.active {
  color: #57F287;
}

.stage-username-text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tap to unmute banner */
.unmute-banner {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: var(--blurple);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: pulseBtn 1.5s infinite;
}

@keyframes pulseBtn {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   CINEMA CONTROLS HUD (Modern Lounge Scrubber & Player Controls)
   ========================================================================== */
.cinema-controls-hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(14, 16, 22, 0.98) 0%, rgba(14, 16, 22, 0.82) 48%, rgba(14, 16, 22, 0.28) 82%, transparent 100%);
  padding: 26px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 8;
  border-radius: 0 0 14px 14px;
}

.cinema-box.has-movie:hover .cinema-controls-hud,
.cinema-box:not(:has(#stagePlaceholder:not(.hidden))):hover .cinema-controls-hud,
.cinema-controls-hud.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cinema-box:has(#stagePlaceholder:not(.hidden)) .cinema-controls-hud {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Timeline Scrubber Container */
.hud-timeline-container {
  width: 100%;
  padding: 8px 0;
  cursor: pointer;
  position: relative;
  touch-action: none;
}

.hud-timeline-bar {
  width: 100%;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  position: relative;
  transition: height 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-timeline-container:hover .hud-timeline-bar {
  height: 8px;
}

.hud-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  transition: width 0.2s linear;
}

.hud-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5865F2 0%, #7983f5 55%, #f43f5e 100%);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(88, 101, 242, 0.65);
}

.hud-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px #5865F2, 0 3px 8px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.hud-timeline-container:hover .hud-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* Hover time tooltip */
.hud-hover-time {
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  background-color: #1e1f22;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f2f3f5;
  display: none;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}

/* Controls Row */
.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 10px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

/* Play/Pause Blurple Circular Button */
.hud-circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #5865F2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.45);
}

.hud-circle-btn:hover {
  background-color: #4752c4;
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(88, 101, 242, 0.68);
}

.hud-circle-btn:active {
  transform: scale(0.94);
}

/* Secondary Icon Buttons (Rewind 10, Forward 10, Volume, Fullscreen, Ambient, PiP) */
.hud-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transform: translateY(-1px) scale(1.05);
}

.hud-icon-btn:active {
  transform: translateY(0) scale(0.95);
}

/* Red Hover for Stop Movie / Eject */
#stopMovieBtn:hover {
  background: rgba(242, 63, 67, 0.2);
  border-color: rgba(242, 63, 67, 0.4);
  color: #f23f43;
}

/* Prevent inner SVG icons and child elements from capturing pointer events to avoid repeated hover triggers */
.hud-circle-btn *,
.hud-icon-btn *,
.hud-sub-gear-btn *,
.cinema-controls-hud button *,
.mini-control-btn *,
.window-action-btn *,
#cinemaControls button *,
#miniPlayerControls button * {
  pointer-events: none;
}

/* Time Display */
.hud-time {
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #f2f3f5;
  display: flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  user-select: none;
  margin-left: 6px;
}

.hud-time-slash {
  color: #80848e;
  font-weight: 400;
  margin: 0 2px;
}

#durationDisplay {
  color: #949ba4;
  font-weight: 500;
}

/* Volume Slider Group */
.hud-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-slider {
  width: 68px;
  height: 5px;
  -webkit-appearance: none;
  background: linear-gradient(to right, #5865F2 0%, #5865F2 var(--vol-fill, 100%), rgba(255, 255, 255, 0.22) var(--vol-fill, 100%), rgba(255, 255, 255, 0.22) 100%);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: width 0.2s ease;
}

.hud-slider:hover {
  background: linear-gradient(to right, #7983f5 0%, #7983f5 var(--vol-fill, 100%), rgba(255, 255, 255, 0.35) var(--vol-fill, 100%), rgba(255, 255, 255, 0.35) 100%);
}

.hud-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 2px #5865F2, 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.hud-slider:hover::-webkit-slider-thumb {
  transform: scale(1.22);
}

/* Audio & Subtitle Glassmorphic Dropdown Pills */
.hud-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0 12px;
  height: 34px;
  border-radius: var(--radius-full, 9999px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.hud-pill-group:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-pill-icon {
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.hud-pill-group:hover .hud-pill-icon {
  color: #ffffff;
}

.hud-select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  padding-right: 4px;
  max-width: 90px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  line-height: 34px;
}

#speedSelect {
  max-width: 46px;
}

.hud-select option {
  background-color: #1e1f24;
  color: #ffffff;
  font-weight: 500;
  padding: 6px;
}

/* Subtle separator between select and settings button */
.hud-pill-divider {
  width: 1px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.18);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Subtitle delay gear button */
.hud-sub-gear-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  padding: 0;
  transition: transform 0.25s ease, color 0.18s ease, background 0.18s ease;
  flex-shrink: 0;
}

.hud-sub-gear-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(45deg);
}

/* Ambient Cinema Backlight Toggle Button */
#ambientToggleBtn.active-toggle {
  color: #ffc850;
  background: rgba(255, 200, 80, 0.16);
  border: 1px solid rgba(255, 200, 80, 0.35);
  box-shadow: 0 0 14px rgba(255, 200, 80, 0.28);
  border-radius: 50%;
}

/* Mobile responsiveness for Cinema Controls HUD */
@media (max-width: 680px) {
  .cinema-controls-hud {
    padding: 8px 8px 6px;
    gap: 4px;
    background: linear-gradient(to top, rgba(6, 7, 10, 0.98) 0%, rgba(6, 7, 10, 0.82) 65%, transparent 100%);
  }
  .hud-timeline-container {
    padding: 3px 0;
  }
  .hud-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }
  .hud-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 4px;
  }
  .hud-left .hud-time {
    margin-left: auto;
    white-space: nowrap;
  }
  .hud-right {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 5px;
    overflow: visible;
    flex-wrap: nowrap;
  }
  .hud-right #ambientToggleBtn {
    margin-left: auto;
  }
  .hud-circle-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    position: relative;
    touch-action: manipulation;
  }
  .hud-circle-btn::after {
    display: none !important;
  }
  .hud-circle-btn svg {
    width: 15px;
    height: 15px;
  }
  .hud-volume-group {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .hud-slider {
    display: none;
  }
  .hud-time {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
  }
  .hud-pill-group {
    padding: 2px 4px;
    gap: 2px;
    height: 24px;
    font-size: 10px;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .hud-pill-icon {
    width: 11px;
    height: 11px;
  }
  .hud-select {
    max-width: 44px;
    font-size: 10px;
    padding: 0 1px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .hud-right #speedSelect {
    max-width: 36px;
  }
  .hud-icon-btn {
    width: 26px;
    height: 26px;
    padding: 2px;
    flex-shrink: 0;
    border-radius: 6px;
    position: relative;
    touch-action: manipulation;
  }
  .hud-icon-btn::after {
    display: none !important;
  }
  .hud-icon-btn svg {
    width: 15px;
    height: 15px;
  }
  .hud-sub-gear-btn {
    padding: 2px;
    position: relative;
    touch-action: manipulation;
  }
  .hud-sub-gear-btn::after {
    display: none !important;
  }
  .stage-bottom-tag {
    top: 8px;
    left: 8px;
    padding: 3px 6px;
    font-size: 10px;
  }
}

/* ==========================================================================
   PARTICIPANT TILE AREA (Matching the 3 red boxes in user sketch)
   ========================================================================== */

.participants-tile-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(1360px, 94vw);
  margin-top: 16px;
  flex-shrink: 0;
}

.participants-tile-area.hidden,
.participants-tile-area[data-count="0"] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.stage-cinema-group[data-participant-count="0"] .cinema-stage-wrapper,
.stage-cinema-group:not([data-participant-count]) .cinema-stage-wrapper,
body:not(.has-participants) .cinema-stage-wrapper {
  max-width: 100% !important;
  margin: 0 auto !important;
}

.participants-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 6px;
}

/* Participant Tile Card */
.participant-tile {
  flex: 0 1 280px;
  width: 280px;
  height: 142px;
  background-color: var(--bg-secondary);
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 1;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* Dynamic desktop card scaling when fewer participants are present */
@media (min-width: 1025px) {
  .stage-cinema-group[data-participant-count="1"] .participant-tile {
    width: 320px;
    max-width: 320px;
    height: 180px;
    max-height: 180px;
    flex: 0 0 320px;
    border-radius: 12px;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center {
    width: 82px;
    height: 82px;
    font-size: 32px;
  }

  .stage-cinema-group[data-participant-count="2"] .participant-tile {
    width: 290px;
    max-width: 290px;
    height: 160px;
    max-height: 160px;
    flex: 0 1 290px;
    border-radius: 11px;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-avatar-center {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }
}

/* Animated Concentric Emerald Speaking Halo Pulse */
@keyframes stageSpeakingHaloPulse {
  0% {
    box-shadow: 0 0 0 2px rgba(35, 165, 90, 0.9),
                0 0 0 5px rgba(35, 165, 90, 0.5),
                0 0 14px rgba(35, 165, 90, 0.6),
                0 0 24px rgba(35, 165, 90, 0.3);
    border-color: rgba(35, 165, 90, 1);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(35, 165, 90, 1),
                0 0 0 8px rgba(35, 165, 90, 0.35),
                0 0 20px rgba(35, 165, 90, 0.75),
                0 0 32px rgba(35, 165, 90, 0.45);
    border-color: #23a55a;
  }
  100% {
    box-shadow: 0 0 0 2px rgba(35, 165, 90, 0.9),
                0 0 0 5px rgba(35, 165, 90, 0.5),
                0 0 14px rgba(35, 165, 90, 0.6),
                0 0 24px rgba(35, 165, 90, 0.3);
    border-color: rgba(35, 165, 90, 1);
  }
}

.participant-tile.is-speaking,
.participant-tile.stage-speaking-halo,
.stage-speaking-halo {
  animation: stageSpeakingHaloPulse 1.6s ease-in-out infinite !important;
  border-color: #23a55a !important;
}

.participant-tile.is-speaking .tile-avatar-center,
.stage-speaking-halo .tile-avatar-center {
  box-shadow: 0 0 0 3px rgba(35, 165, 90, 0.85), 0 0 16px rgba(35, 165, 90, 0.5) !important;
}

.tile-avatar-center {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  position: relative;
}

.tile-avatar-center img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video element inside participant tile */
.tile-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #000;
  transition: object-position 0.28s cubic-bezier(0.25, 1, 0.5, 1), transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: object-position, transform;
}

.tile-video.face-tracking-active {
  transition: object-position 0.28s cubic-bezier(0.25, 1, 0.5, 1), transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: object-position, transform;
}

/* Bottom Left Name Badge on Tile (Image 1) */
.tile-bottom-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: var(--text-white);
  padding: 3px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  max-width: calc(100% - 12px);
  z-index: 4;
}

.tile-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-mic-icon {
  flex-shrink: 0;
}
.tile-mic-icon.muted {
  color: var(--red);
}
.tile-mic-icon.active {
  color: var(--text-muted);
}

/* ==========================================================================
   3. FLOATING ACTION DOCK (Image 1 & Auto-Hide on Image 2)
   ========================================================================== */

.dock-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0));
  z-index: 40;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dock-wrapper.menu-active,
.dock-wrapper:has(.device-menu:not(.hidden)),
.dock-wrapper:has(.dock-reactions-menu:not(.hidden)),
.dock-wrapper:has(.dock-reactions-tray:not(.hidden)),
.dock-wrapper:has(#dockReactionsTray:not(.hidden)) {
  z-index: 2600 !important;
}

.dock-wrapper.menu-active .floating-pill-dock,
.dock-wrapper:has(#dockReactionsTray:not(.hidden)) .floating-pill-dock,
.dock-wrapper:has(.dock-reactions-tray:not(.hidden)) .floating-pill-dock,
.floating-pill-dock:has(#dockReactionsTray:not(.hidden)),
.floating-pill-dock:has(.dock-reactions-tray:not(.hidden)) {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}

.dock-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  padding: 0 max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right, 16px)) 0 max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left, 16px));
  box-sizing: border-box;
  pointer-events: none;
}

.dock-container > * {
  pointer-events: auto;
}

/* Left & Right corner buttons (Image 1) */
.corner-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

#dockInviteBtn {
  left: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left, 16px));
}

#theaterFullscreenBtn {
  right: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right, 16px));
}

.corner-icon-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Floating Center Pill Dock (Image 1) */
.floating-pill-dock {
  background: rgba(14, 16, 24, 0.85);
  backdrop-filter: blur(14px) saturate(190%);
  -webkit-backdrop-filter: blur(14px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  box-shadow: 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 44px -6px rgba(0, 0, 0, 0.7),
    0 4px 16px rgba(0, 0, 0, 0.4);
  gap: 12px;
}

/* Active Status Rings for Pill Dock */
.active-status-ring,
.pill-btn.active-status-ring {
  outline: none;
  border-color: rgba(88, 101, 242, 0.7) !important;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.4), 0 0 14px rgba(88, 101, 242, 0.5) !important;
}

.pill-btn.active-status-ring.ring-speaking,
.pill-btn.ring-speaking {
  border-color: #23a55a !important;
  box-shadow: 0 0 0 2px rgba(35, 165, 90, 0.4), 0 0 14px rgba(35, 165, 90, 0.55) !important;
  color: #23a55a !important;
}

.pill-btn.active-status-ring.ring-camera,
.pill-btn.ring-camera {
  border-color: #5865F2 !important;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.45), 0 0 14px rgba(88, 101, 242, 0.55) !important;
  color: #fff !important;
}

.pill-btn.active-status-ring.ring-screenshare,
.pill-btn.ring-screenshare {
  border-color: #5865F2 !important;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.45), 0 0 16px rgba(88, 101, 242, 0.6) !important;
  color: #fff !important;
}

.pill-btn.active-status-ring.ring-library,
.pill-btn.ring-library,
.pill-btn.active-status-ring.ring-movie,
.pill-btn.ring-movie,
.pill-btn.active-status-ring.ring-layout,
.pill-btn.ring-layout {
  border-color: #5865F2 !important;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.4), 0 0 12px rgba(88, 101, 242, 0.5) !important;
  color: #fff !important;
}

.pill-btn.active-status-ring.ring-reactions,
.pill-btn.ring-reactions {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 0 14px rgba(245, 158, 11, 0.55) !important;
  color: #f59e0b !important;
}

/* Dock Reactions Floating Menu Tray */
.dock-reactions-menu,
.dock-reactions-tray,
.device-menu.dock-reactions-menu,
#dockReactionsTray {
  position: absolute !important;
  bottom: calc(100% + 14px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: max-content !important;
  min-width: min-content !important;
  max-width: min(440px, calc(100vw - 20px)) !important;
  background: rgba(14, 16, 24, 0.94) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 28px !important;
  padding: 6px 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  z-index: 2700 !important;
  box-sizing: border-box !important;
  align-items: center !important;
  justify-content: center !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  top: auto !important;
  will-change: transform, opacity;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-reactions-menu:not(.hidden),
.dock-reactions-tray:not(.hidden),
.device-menu.dock-reactions-menu:not(.hidden),
#dockReactionsTray:not(.hidden) {
  display: flex !important;
}

.dock-reactions-menu.hidden,
.dock-reactions-tray.hidden,
.device-menu.dock-reactions-menu.hidden,
#dockReactionsTray.hidden {
  display: none !important;
}

.dock-reactions-menu::before,
.dock-reactions-tray::before,
.device-menu.dock-reactions-menu::before {
  display: none !important;
  content: none !important;
}

.dock-reactions-items {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}

.dock-reaction-item {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dock-reaction-item:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.22);
}

.dock-reaction-item:active {
  transform: scale(0.92);
}

/* Split Button with Chevron Overlay Badge */
.split-dock-btn,
.pill-split-group {
  position: relative;
  display: flex;
  align-items: center;
}

.pill-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pill-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.pill-btn:active {
  transform: translateY(1px) scale(0.96);
}

.pill-btn svg,
.pill-btn svg * {
  pointer-events: none;
}

/* Muted / Red State */
.pill-btn-muted {
  background-color: rgba(218, 55, 60, 0.22);
  border-color: rgba(218, 55, 60, 0.4);
  color: #ff5b60;
}
.pill-btn-muted:hover {
  background-color: rgba(218, 55, 60, 0.38);
  border-color: rgba(218, 55, 60, 0.6);
  color: #fff;
}

.pill-btn-danger {
  background: linear-gradient(135deg, #da373c 0%, #c03136 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 50px;
  box-shadow: 0 4px 14px rgba(218, 55, 60, 0.4);
}
.pill-btn-danger:hover {
  background: linear-gradient(135deg, #e54348 0%, #da373c 100%);
  box-shadow: 0 6px 20px rgba(218, 55, 60, 0.6);
}

.pill-chevron-btn,
#micDeviceDropdownBtn,
#micDeviceBtn,
#camDeviceDropdownBtn,
#camDeviceBtn {
  position: absolute;
  bottom: -2px;
  right: -5px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  border: 2px solid var(--bg-surface);
  color: var(--text-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pill-chevron-btn:hover,
#micDeviceDropdownBtn:hover,
#micDeviceBtn:hover,
#camDeviceDropdownBtn:hover,
#camDeviceBtn:hover {
  background-color: #43464d;
  color: #fff;
}
.pill-chevron-btn:active,
#micDeviceDropdownBtn:active,
#micDeviceBtn:active,
#camDeviceDropdownBtn:active,
#camDeviceBtn:active {
  background-color: #43464d;
  color: #fff;
  transform: scale(0.92);
}
.pill-chevron-btn svg,
.pill-chevron-btn svg * {
  pointer-events: none;
}

/* Device Dropdown Menu */
.device-menu {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  background-color: rgba(28, 29, 34, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 8px 0;
  z-index: 1000;
  will-change: transform, opacity;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-menu.sheet-closing,
.dock-reactions-menu.sheet-closing,
.dock-reactions-tray.sheet-closing,
#dockReactionsTray.sheet-closing {
  animation: popoverFadeOut 0.18s cubic-bezier(0.32, 0, 0.67, 0) forwards !important;
  pointer-events: none !important;
}

@keyframes popoverFadeIn {
  from {
    transform: translate(-50%, 8px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

@keyframes popoverFadeOut {
  from {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(-50%, 6px) scale(0.97);
    opacity: 0;
  }
}

.device-menu-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px 4px;
}

.device-menu-items {
  display: flex;
  flex-direction: column;
}

.device-opt {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-normal);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-opt:hover {
  background-color: var(--bg-secondary);
  color: #fff;
}

/* More Options Menu (Three dots dropdown) */
.more-options-menu {
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: rgba(30, 31, 35, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-normal, #dbdee1);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.more-menu-item:hover,
.more-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.more-menu-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.25);
  outline-offset: -2px;
}

.more-menu-item:active {
  transform: scale(0.98);
}

.more-menu-item.active-sharing {
  background: rgba(235, 69, 158, 0.18);
  color: #ff6584;
}

.more-menu-item svg {
  flex-shrink: 0;
  color: var(--text-muted, #949ba4);
  transition: color 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.more-menu-item svg * {
  pointer-events: none;
}

.more-menu-item:hover svg {
  color: #fff;
}

.more-menu-item.active-sharing svg {
  color: #ff6584;
}

.more-menu-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  pointer-events: none;
}

.more-menu-text * {
  pointer-events: none;
}

.more-menu-title {
  font-size: 13.5px;
  font-weight: 600;
  color: inherit;
  line-height: 1.2;
}

.more-menu-desc {
  font-size: 11px;
  color: var(--text-muted, #949ba4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Screen Share Video Stream on Main Stage */
.screen-share-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  z-index: 8;
  border-radius: 12px;
}

/* YouTube Player Box on Main Stage */
.youtube-player-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 8;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-player-box iframe,
.youtube-player-box #youtubeIframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Extra Feature Modals (YouTube, URL) */
.extra-feature-modal-card {
  max-width: 500px;
  width: 90%;
  max-height: min(100%, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px;
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-with-icon h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.extra-feature-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

/* Ambient Cinema Glow Canvas & Wrapper (Ambilight - Strictly BEHIND cinema box) */
.ambient-glow-wrapper {
  position: absolute;
  top: -24px;
  left: -32px;
  right: -32px;
  bottom: -24px;
  width: calc(100% + 64px);
  height: calc(100% + 48px);
  pointer-events: none;
  z-index: 0; /* Behind .cinema-box (z-index: 2) */
  border-radius: 28px;
  overflow: visible;
  display: block;
}

.ambient-glow-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: blur(52px) saturate(2.4) brightness(1.1);
  opacity: 0.72;
  pointer-events: none;
  z-index: 0; /* Behind .cinema-box (z-index: 2) */
  border-radius: 28px;
  transition: opacity 0.4s ease;
  display: block;
}

/* Fallback direct canvas positioning when without wrapper */
.cinema-stage-wrapper > .ambient-glow-canvas {
  top: -24px;
  left: -32px;
  right: -32px;
  bottom: -24px;
  width: calc(100% + 64px);
  height: calc(100% + 48px);
}

.ambient-glow-canvas.hidden,
.ambient-glow-wrapper.hidden,
#ambientGlowCanvas.hidden,
#ambientGlowWrapper.hidden {
  opacity: 0 !important;
  display: none !important;
  visibility: hidden !important;
}

/* Subtitle Drop Overlay */
.subtitle-drop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 17, 21, 0.88);
  backdrop-filter: blur(8px);
  border: 2px dashed var(--coral, #eb459e);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  z-index: 50;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Mobile Gesture Ripple Feedback Overlay */
.mobile-gesture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  display: flex;
}

.gesture-indicator-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gesture-pill {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: gesturePulse 0.4s ease-out forwards;
}

@keyframes gesturePulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* HUD Controls Enhancements */
.hud-sub-gear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #949ba4);
  padding: 2px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.hud-sub-gear-btn:hover {
  color: #fff;
}

.hud-pill-text-icon {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #949ba4);
  margin-right: -4px;
}

.hud-icon-btn.active-toggle {
  color: var(--coral, #eb459e);
  background: rgba(235, 69, 158, 0.15);
  border-radius: 6px;
}

.more-status-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  margin-left: 6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: all 0.2s ease;
}

.more-status-badge.badge-active {
  background: var(--coral, #eb459e);
  color: #fff;
}

/* Device Menu Audio Processing Toggle Rows */
.device-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.device-menu-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--text-normal, #dbdee1);
  cursor: pointer;
}

.device-menu-toggle-row:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.device-menu-toggle-row input[type="checkbox"] {
  accent-color: var(--coral, #eb459e);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

/* Subtitle Settings Modal */
.sub-settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

/* Subtitle Live Preview Cinema Card */
#subtitlePreviewCard,
.subtitle-preview-card {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.subtitle-preview-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 5;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--coral, #eb459e);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(235, 69, 158, 0.3);
}

.subtitle-preview-scene {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 25%, #1a2236 0%, #0d121f 55%, #05070c 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
  overflow: hidden;
}

.subtitle-preview-stars {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 70px 65px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 140px 20px, rgba(255,255,255,0.8), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 220px 75px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 300px 35px, rgba(255,255,255,0.7), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 380px 50px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 450px 25px, rgba(255,255,255,0.9), rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 480px 150px;
  opacity: 0.65;
  pointer-events: none;
}

.subtitle-preview-nebula {
  position: absolute;
  top: -20px;
  left: 20%;
  width: 60%;
  height: 90px;
  background: radial-gradient(ellipse at center, rgba(88, 101, 242, 0.18) 0%, rgba(235, 69, 158, 0.12) 50%, transparent 80%);
  filter: blur(20px);
  pointer-events: none;
}

.subtitle-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.subtitle-preview-box {
  position: relative;
  z-index: 3;
  max-width: 90%;
  padding: 6px 14px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  transition: backdrop-filter 0.15s ease, -webkit-backdrop-filter 0.15s ease, background-color 0.15s ease;
}

.subtitle-preview-text {
  display: inline-block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 1.35;
  transition: font-size 0.08s ease, color 0.15s ease, opacity 0.08s ease;
}

/* Subtitle Continuous Customization Sliders */
.sub-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-slider-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-normal, #dbdee1);
}

.sub-value-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-tertiary, #1e1f23);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--coral, #eb459e);
  min-width: 44px;
  text-align: center;
}

.sub-slider-track-wrap {
  width: 100%;
  display: flex;
  align-items: center;
}

.sub-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sub-range-slider:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sub-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral, #eb459e);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(235, 69, 158, 0.6);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.sub-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(235, 69, 158, 0.9);
}

.sub-range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral, #eb459e);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(235, 69, 158, 0.6);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.sub-range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(235, 69, 158, 0.9);
}

.sub-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted, #949ba4);
  padding: 0 2px;
}

/* Dialogue Booster (Night Mode) */
.dialogue-booster {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dialogue-booster:hover {
  border-color: rgba(235, 69, 158, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.dialogue-booster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialogue-booster-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.dialogue-booster-title svg {
  color: var(--coral, #eb459e);
  flex-shrink: 0;
}

.dialogue-booster-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dialogue-booster-label {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
}

.dialogue-booster-sublabel {
  font-size: 11px;
  color: var(--text-muted, #949ba4);
}

.dialogue-booster-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.dialogue-booster-toggle-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  transition: 0.2s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dialogue-booster-toggle-wrap input:checked + .toggle-slider {
  background-color: var(--green, #23a55a);
}

.dialogue-booster-toggle-wrap input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.sub-offset-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-offset-badge {
  background: var(--bg-tertiary, #1e1f23);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 54px;
  text-align: center;
}

.sub-hint-text {
  font-size: 11px;
  color: var(--text-muted, #949ba4);
  margin-top: 4px;
  display: block;
}

.sub-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-style-btn {
  padding: 6px 12px;
  background: var(--bg-tertiary, #1e1f23);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-normal, #dbdee1);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sub-style-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sub-style-btn.active {
  background: var(--coral, #eb459e);
  border-color: var(--coral, #eb459e);
  color: #fff;
}

.custom-file-upload-btn {
  display: block;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-normal, #dbdee1);
  text-align: center;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-file-upload-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--coral, #eb459e);
  color: #fff;
}

.custom-file-upload-btn input[type="file"] {
  display: none;
}

/* Active Floating Poll Widget */
.active-poll-widget {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 290px;
  max-width: calc(100% - 40px);
  background: rgba(22, 23, 27, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 14px;
  z-index: 25;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.poll-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.poll-badge-live {
  background: #ff4757;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.poll-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #949ba4);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.poll-close-btn:hover {
  color: #fff;
}

.poll-widget-question {
  margin: 0 0 10px 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.poll-widget-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poll-opt-btn {
  position: relative;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-normal, #dbdee1);
  font-size: 12.5px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.15s ease;
}

.poll-opt-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.poll-opt-btn.voted {
  border-color: var(--coral, #eb459e);
  font-weight: 700;
  color: #fff;
}

.poll-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(235, 69, 158, 0.25);
  pointer-events: none;
  transition: width 0.3s ease;
  z-index: 1;
}

.poll-opt-text {
  position: relative;
  z-index: 2;
}

.poll-opt-pct {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #949ba4);
}

.poll-widget-footer {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted, #949ba4);
  text-align: right;
}

.poll-options-input-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cinema Trivia Game Modal */
.trivia-modal-card {
  max-width: 560px;
  width: 90%;
  max-height: min(100%, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px;
}

.trivia-timer-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin: 12px 0 16px 0;
  overflow: hidden;
}

.trivia-timer-fill {
  width: 100%;
  height: 100%;
  background: var(--coral, #eb459e);
  transition: width 1s linear;
}

.trivia-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.trivia-round-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral, #eb459e);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trivia-timer-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.trivia-question-text {
  margin: 0 0 18px 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.trivia-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .trivia-options-grid {
    grid-template-columns: 1fr;
  }
}

.trivia-opt-btn {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text-normal, #dbdee1);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.trivia-opt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.trivia-opt-btn.correct {
  background: rgba(46, 204, 113, 0.25) !important;
  border-color: #2ecc71 !important;
  color: #2ecc71 !important;
}

.trivia-opt-btn.wrong {
  background: rgba(231, 76, 60, 0.25) !important;
  border-color: #e74c3c !important;
  color: #e74c3c !important;
}

.trivia-feedback {
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.trivia-scoreboard-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.trivia-scores-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #949ba4);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.trivia-scores-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trivia-score-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-normal, #dbdee1);
}

.trivia-score-pill strong {
  color: #fff;
}

/* Party Soundboard Grid */
.soundboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

@media (max-width: 480px) {
  .soundboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.soundboard-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-normal, #dbdee1);
}

.soundboard-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  color: #fff;
}

.soundboard-btn:active {
  transform: scale(0.96);
}

.soundboard-icon {
  font-size: 26px;
}

.soundboard-name {
  font-size: 12px;
  font-weight: 600;
}

/* Individual Participant Volume Popover */
.tile-vol-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
  z-index: 10;
}

.participant-tile:hover .tile-vol-btn {
  opacity: 1;
}

.tile-volume-popover {
  position: absolute;
  bottom: 34px;
  right: 0;
  width: 140px;
  background: rgba(24, 25, 29, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile-volume-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #949ba4);
  display: flex;
  justify-content: space-between;
}

.tile-vol-slider {
  width: 100%;
  accent-color: var(--coral, #eb459e);
  cursor: pointer;
}

/* ==========================================================================
   IDLE AUTO-HIDE (Matching Image 3: Controls drop after 3s idle)
   ========================================================================== */

.top-bar {
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.dock-wrapper {
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.idle-hidden:not(.menu-active),
.idle-mode .dock-wrapper:not(.menu-active):not(:has(.device-menu:not(.hidden))):not(:has(#dockReactionsTray:not(.hidden))):not(:has(.dock-reactions-tray:not(.hidden))) {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(100%) !important;
}

.top-bar.idle-hidden,
.idle-mode .top-bar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-100%) !important;
}

.idle-mode .cinema-controls-hud {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* In idle state, cinema overlays smoothly fade out for an immersive full-screen movie experience */
.idle-mode .stage-bottom-tag {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-8px) !important;
}

.idle-mode .tile-username {
  display: none !important;
}

.idle-mode .tile-bottom-badge {
  padding: 5px 6px !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   4. CHAT SIDEBAR (Matching Image 3)
   ========================================================================== */

/* Mobile Backdrop overlay (tap to dismiss on mobile) */
.chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1025px) {
  .chat-backdrop {
    display: none !important;
  }
}

@media (max-width: 1024px) and (orientation: landscape) {
  .chat-backdrop {
    display: none !important;
  }
}

.chat-mobile-drag-handle {
  display: none;
}

.chat-panel {
  width: 380px;
  height: 100%;
  max-height: 100%;
  background: rgba(14, 16, 24, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 60;
  flex-shrink: 0;
  will-change: margin-right, transform, opacity;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.65);
}

.chat-panel.chat-panel-opening,
.chat-panel:not(.hidden):not(.chat-panel-closing) {
  animation: slideInPanel 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-panel.chat-panel-closing {
  animation: slideOutPanel 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none !important;
}

@keyframes slideInPanel {
  from {
    margin-right: -380px;
    opacity: 0.6;
  }
  to {
    margin-right: 0;
    opacity: 1;
  }
}

@keyframes slideOutPanel {
  from {
    margin-right: 0;
    opacity: 1;
  }
  to {
    margin-right: -380px;
    opacity: 0;
  }
}

/* ==========================================================================
   THEATER SCREEN ACCOMMODATION TO THE LEFT WHEN CHAT IS OPEN
   (Replaces mini-player mode with fluid responsive accommodation across PC, Tab, Mobile)
   ========================================================================== */

/* Transitions so stage, movie wrapper, and webcams scale fluidly when chat toggles */
body.chat-is-open .stage-section,
body.chat-is-closing .stage-section {
  transition: padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.chat-is-open .stage-cinema-group,
body.chat-is-closing .stage-cinema-group {
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.chat-is-open .cinema-stage-wrapper,
body.chat-is-closing .cinema-stage-wrapper {
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* PC / Desktop: Cinema stage accommodates to the left */
@media (min-width: 1025px) {
  body.chat-is-open .stage-section {
    padding-right: 28px !important;
    padding-left: 28px !important;
  }

  body.chat-is-open .stage-cinema-group {
    max-width: min(1200px, calc(100vw - 420px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.chat-is-open .cinema-stage-wrapper {
    max-width: 100% !important;
    max-height: calc(100vh - 220px) !important;
    max-height: calc(100dvh - 220px) !important;
  }

  body.chat-is-open.has-participants .cinema-stage-wrapper {
    max-height: calc(100vh - 340px) !important;
    max-height: calc(100dvh - 340px) !important;
  }
}

/* Tablet (Landscape & Portrait) & Compact Screens: Accommodate movie screen to the left */
@media (min-width: 601px) and (max-width: 1024px) {
  body.chat-is-open .chat-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: min(360px, 46vw) !important;
    height: 100dvh !important;
    z-index: 2200 !important;
    box-shadow: -12px 0 38px rgba(0, 0, 0, 0.75) !important;
  }

  body.chat-is-open .stage-section {
    padding-right: calc(min(360px, 46vw) + 16px) !important;
    padding-left: 16px !important;
  }

  body.chat-is-open .stage-cinema-group {
    max-width: calc(100vw - min(360px, 46vw) - 32px) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  body.chat-is-open .cinema-stage-wrapper {
    max-width: 100% !important;
    max-height: calc(100dvh - 180px) !important;
    margin-left: 0 !important;
  }

  body.chat-is-open.has-participants .cinema-stage-wrapper {
    max-height: calc(100dvh - 280px) !important;
  }
}

/* Mobile Devices: Accommodate movie screen to the left */
@media (max-width: 600px) {
  body.chat-is-open .stage-cinema-group {
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  body.chat-is-open .cinema-stage-wrapper {
    margin-left: 0 !important;
  }
}

.chat-panel-header {
  height: 52px;
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 17, 24, 0.92);
  backdrop-filter: blur(20px);
}

.chat-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.chat-live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
  animation: chatPulseDot 2s infinite ease-in-out;
}

@keyframes chatPulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.7;
  }
}

.chat-status-pill {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-transform: uppercase;
}

.chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.chat-close-btn:active {
  transform: scale(0.95);
}

.chat-messages-scroll {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  scroll-behavior: smooth;
}

.chat-messages-scroll::-webkit-scrollbar {
  width: 6px;
}
.chat-messages-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}
.chat-messages-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Welcome Hero inside Chat (Matching Image 3) */
.chat-welcome-hero {
  margin-top: auto;
  padding: 24px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.welcome-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.18), rgba(129, 140, 248, 0.18));
  border: 1px solid rgba(244, 63, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fb7185;
  margin-bottom: 6px;
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.2);
  position: relative;
}

.welcome-icon-glow {
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.chat-welcome-hero h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.02em;
}

.chat-welcome-hero p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.chat-welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-starter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.chat-starter-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(244, 63, 94, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.chat-starter-chip:active {
  transform: scale(0.96);
}

.chat-starter-chip svg {
  flex-shrink: 0;
}

/* Floating New Messages Pill */
.chat-new-messages-pill {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  background: rgba(244, 63, 94, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 80;
  animation: pillSpring 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
}

.chat-new-messages-pill:hover {
  transform: translateX(-50%) translateY(-2px);
  background: #f43f5e;
  box-shadow: 0 10px 28px rgba(244, 63, 94, 0.6);
}

.chat-new-messages-pill:active {
  transform: translateX(-50%) scale(0.95);
}

@keyframes pillSpring {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Chat Message Item */
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 12px;
  margin: 1px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.035);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: chatMsgEntrance 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-msg:hover {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

@keyframes chatMsgEntrance {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Role Badges */
.chat-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.role-host,
.chat-role-badge.role-host {
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.38);
  color: #fb7185;
}

.role-viewer,
.chat-role-badge.role-viewer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

/* System Messages in Chat */
.chat-msg.chat-msg-system {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  margin: 3px 0;
}

.chat-system-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  color: var(--text-muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 100%;
  word-break: break-word;
}

.chat-system-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}

.chat-system-text {
  font-weight: 500;
  color: #cbd5e1;
}

.chat-system-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 2px;
  flex-shrink: 0;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-msg-user {
  font-size: 13.5px;
  font-weight: 700;
}

.chat-msg-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

.chat-msg-text {
  font-size: 14px;
  color: var(--text-normal);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.chat-msg-text.chat-msg-jumbo-emojis .chat-inline-reaction-svg {
  width: 32px;
  height: 32px;
  vertical-align: -6px;
  margin: 2px 4px;
}

.chat-inline-reaction-svg {
  display: inline-flex;
  vertical-align: -4px;
  margin: 0 2px;
  width: 20px;
  height: 20px;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-inline-reaction-svg:hover {
  transform: scale(1.35);
}

.chat-inline-reaction-svg:active {
  transform: scale(0.95);
}
}

.chat-inline-reaction-svg svg {
  width: 100%;
  height: 100%;
}

/* Bottom Chat Wrapper & Input Bar */
.chat-bottom-wrapper {
  position: relative;
  flex-shrink: 0;
}

.chat-compose-bar {
  padding: 0 16px 16px;
}

.chat-pill-input-box {
  background: rgba(18, 20, 28, 0.88);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 8px;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-pill-input-box:focus-within {
  border-color: rgba(244, 63, 94, 0.45);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.18), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.chat-pill-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-white);
  font-size: 14px;
  padding: 8px 0;
  min-width: 0;
}

.chat-pill-input-box input::placeholder {
  color: var(--text-muted);
}

.chat-action-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-action-icon-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.08);
}

.chat-action-icon-btn:active {
  transform: scale(0.92);
}

.chat-action-icon-btn.active {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.18);
}

.chat-action-icon-btn.chat-reaction-trigger-btn:hover {
  color: #fb7185;
}

.chat-action-icon-btn.chat-send-btn {
  color: #fb7185;
}

.chat-action-icon-btn.chat-send-btn:hover {
  color: #fff;
  background: rgba(244, 63, 94, 0.25);
  transform: scale(1.12);
}

.chat-input-right-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* ==========================================================================
   EMOJI PICKER POPOVER
   ========================================================================== */
.chat-emoji-picker {
  position: absolute;
  bottom: calc(100% - 6px);
  right: 16px;
  width: 330px;
  max-width: calc(100% - 32px);
  height: 350px;
  background: rgba(18, 20, 28, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8), 0 0 24px rgba(244, 63, 94, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  animation: pickerSpring 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pickerSpring {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emoji-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.emoji-picker-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fb7185;
}

.emoji-picker-tabs {
  display: flex;
  gap: 4px;
}

.emoji-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.emoji-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: scale(1.1);
}

.emoji-tab-btn.active {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fb7185;
}

.emoji-tab-btn svg {
  pointer-events: none;
}

.emoji-picker-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.emoji-picker-search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.emoji-picker-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: #fff;
}

.emoji-picker-search-bar input::placeholder {
  color: var(--text-muted);
}

.emoji-picker-grid {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  align-content: flex-start;
}

.emoji-picker-grid::-webkit-scrollbar {
  width: 6px;
}
.emoji-picker-grid::-webkit-scrollbar-track {
  background: transparent;
}
.emoji-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.emoji-item-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.14s;
  user-select: none;
  padding: 0;
}

.emoji-item-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.22);
}

.emoji-item-btn:active {
  transform: scale(0.92);
}

.emoji-item-btn svg {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.emoji-category-header {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 2px 2px;
}

/* ==========================================================================
   QUICK REACTIONS TRAY
   ========================================================================== */
.chat-reactions-tray {
  position: absolute;
  bottom: calc(100% - 6px);
  right: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  width: max-content;
  background: rgba(20, 21, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 40px;
  padding: 6px 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7), 0 0 18px rgba(244, 63, 94, 0.18);
  z-index: 100;
  box-sizing: border-box;
  animation: pickerFadeUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-reactions-tray::-webkit-scrollbar {
  display: none;
}

.reactions-tray-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fb7185;
  padding-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
  flex-shrink: 0;
}

.reaction-tray-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.reaction-item-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.18s;
  user-select: none;
  touch-action: manipulation;
}

.reaction-item-btn svg {
  width: 19px;
  height: 19px;
  transition: transform 0.18s ease;
}

.reaction-item-btn:hover {
  transform: scale(1.32) translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.reaction-item-btn:hover svg {
  transform: scale(1.15);
}

.reaction-item-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   FLOATING SCREEN & CHAT REACTION BURSTS
   ========================================================================== */
.reaction-burst-container {
  position: absolute;
  bottom: 85px;
  right: 28px;
  width: 120px;
  height: 380px;
  pointer-events: none;
  overflow: visible;
  z-index: 60;
}

.chat-reaction-burst-container {
  position: absolute;
  bottom: 75px;
  right: 20px;
  width: 90px;
  height: 280px;
  pointer-events: none;
  overflow: visible;
  z-index: 60;
}

.floating-reaction {
  position: absolute;
  bottom: 0;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  will-change: transform, opacity;
  animation: floatReactionBurst 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  user-select: none;
}

.floating-reaction-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(88, 101, 242, 0.65)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7));
}

.floating-reaction-emoji .reaction-svg {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.75));
}

.floating-reaction-user {
  font-size: 11px;
  font-weight: 700;
  color: #dbdee1;
  background: rgba(14, 16, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 8px;
  border-radius: 12px;
  margin-top: 4px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.chat-inline-reaction-svg {
  display: inline-flex;
  vertical-align: -3px;
  margin: 0 3px;
}

.chat-inline-reaction-svg .reaction-svg {
  width: 18px;
  height: 18px;
}

.reaction-tag-love {
  color: #f43f5e;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.7);
}
.reaction-tag-fire {
  color: #f59e0b;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}
.reaction-tag-popcorn {
  color: #fbbf24;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}
.reaction-tag-clap {
  color: #38bdf8;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}
.reaction-tag-laugh {
  color: #a3e635;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(163, 230, 53, 0.7);
}
.reaction-tag-shock {
  color: #c084fc;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.7);
}
.reaction-tag-rocket {
  color: #818cf8;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(129, 140, 248, 0.7);
}
.reaction-tag-party {
  color: #ec4899;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(236, 72, 153, 0.7);
}
.reaction-tag-dead {
  color: #94a3b8;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(148, 163, 184, 0.7);
}
.reaction-tag-custom {
  color: #fff;
  font-weight: 700;
}

@keyframes reactionBurst {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 15px, 0) scale(0.4) rotate(0deg);
  }
  14% {
    opacity: 1;
    transform: translate3d(calc(-50% + var(--x-mid, 0px)), -55px, 0) scale(1.3) rotate(var(--rot-mid, -6deg));
  }
  70% {
    opacity: 0.95;
    transform: translate3d(calc(-50% + var(--x-end, 12px)), -220px, 0) scale(1.05) rotate(var(--rot-end, 8deg));
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--x-end, 16px)), -330px, 0) scale(0.7) rotate(var(--rot-end, 14deg));
  }
}

@keyframes floatReactionBurst {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 15px, 0) scale(0.4) rotate(0deg);
  }
  14% {
    opacity: 1;
    transform: translate3d(calc(-50% + var(--x-mid, 0px)), -55px, 0) scale(1.3) rotate(var(--rot-mid, -6deg));
  }
  70% {
    opacity: 0.95;
    transform: translate3d(calc(-50% + var(--x-end, 12px)), -220px, 0) scale(1.05) rotate(var(--rot-end, 8deg));
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--x-end, 16px)), -330px, 0) scale(0.7) rotate(var(--rot-end, 14deg));
  }
}

/* ==========================================================================
   GRID GALLERY VIEW & STAGE LAYOUT
   ========================================================================== */

.is-grid-view .stage-section,
.stage-grid-mode .stage-section {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  padding: 16px 24px !important;
  overflow-y: auto !important;
}

.is-grid-view .cinema-stage-wrapper,
.stage-grid-mode .cinema-stage-wrapper {
  flex: 1 1 450px !important;
  max-width: 580px !important;
  max-height: 360px !important;
  height: 280px !important;
  aspect-ratio: auto !important;
}

.is-grid-view .cinema-box,
.stage-grid-mode .cinema-box {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: auto !important;
}

.is-grid-view .ambient-glow-wrapper,
.stage-grid-mode .ambient-glow-wrapper,
.is-grid-view .ambient-glow-canvas,
.stage-grid-mode .ambient-glow-canvas {
  display: none !important;
}

.is-grid-view .participants-tile-area,
.stage-grid-mode .participants-tile-area {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  width: 100% !important;
  flex: 1 1 100% !important;
}

.is-grid-view .participants-row,
.stage-grid-mode .participants-row {
  width: 100% !important;
}

/* Stage Grid Partitioning */
.stage-grid-partition {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stage-partition-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #949ba4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-partition-title {
  color: #dbdee1;
}

.stage-partition-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
}

.is-grid-view .stage-speakers-partition .participants-row,
.stage-grid-mode .stage-speakers-partition .participants-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
  justify-items: center;
}

.is-grid-view .stage-audience-partition .participants-row,
.stage-grid-mode .stage-audience-partition .participants-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  justify-items: center;
}

.is-grid-view .participant-tile,
.stage-grid-mode .participant-tile {
  flex: 1 1 240px !important;
  max-width: 380px !important;
  height: 240px !important;
  border-radius: 12px !important;
}

.stage-audience-partition .participant-tile {
  height: 110px !important;
  min-height: 110px !important;
  max-height: 110px !important;
  background: rgba(24, 25, 33, 0.65) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.stage-audience-partition .participant-tile .tile-avatar-center {
  width: 44px !important;
  height: 44px !important;
  font-size: 18px !important;
}

.stage-audience-partition .participant-tile .tile-bottom-badge {
  font-size: 11px !important;
  padding: 2px 8px !important;
}

.is-grid-view .tile-avatar-center,
.stage-grid-mode .tile-avatar-center {
  width: 68px !important;
  height: 68px !important;
  font-size: 24px !important;
}

/* ==========================================================================
   SCREEN SHARE PICTURE-IN-PICTURE (PiP) & FOCUS TOGGLE
   ========================================================================== */

#screenSharePipContainer {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 280px;
  max-width: calc(100% - 32px);
  aspect-ratio: 16 / 9;
  background: rgba(18, 19, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 45;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.22s ease, opacity 0.2s ease;
}

#screenSharePipContainer:hover {
  border-color: rgba(88, 101, 242, 0.6);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 18px rgba(88, 101, 242, 0.25);
}

#screenSharePipContainer.hidden {
  display: none !important;
}

.screen-share-pip-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: linear-gradient(180deg, rgba(12, 13, 18, 0.88) 0%, rgba(12, 13, 18, 0) 100%);
  z-index: 5;
  pointer-events: auto;
  opacity: 0.92;
  transition: opacity 0.2s ease;
}

#screenSharePipContainer:hover .screen-share-pip-header {
  opacity: 1;
}

.screen-share-pip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.pip-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #23a55a;
  box-shadow: 0 0 6px rgba(35, 165, 90, 0.8);
  display: inline-block;
  animation: pipPulseDot 1.8s infinite ease-in-out;
}

@keyframes pipPulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

#screenShareFocusBtn {
  background: rgba(30, 32, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#screenShareFocusBtn:hover {
  background: rgba(88, 101, 242, 0.9);
  border-color: #5865f2;
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}

#screenShareFocusBtn:active {
  transform: translateY(0);
}

#screenShareFocusBtn.active {
  background: #5865f2;
  border-color: #7983f5;
  box-shadow: 0 0 8px rgba(88, 101, 242, 0.6);
}

.screen-share-pip-body {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-share-pip-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 768px) {
  #screenSharePipContainer {
    width: 190px;
    top: 12px;
    right: 12px;
  }
}

/* ==========================================================================
   5. FULLSCREEN CINEMA
   ========================================================================== */

.cinema-box:fullscreen,
.cinema-box:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  background-color: #000 !important;
}

.cinema-box:fullscreen #moviePlayer,
.cinema-box:-webkit-full-screen #moviePlayer,
.cinema-box:fullscreen #screenSharePlayer,
.cinema-box:-webkit-full-screen #screenSharePlayer,
.cinema-box:fullscreen #youtubePlayerBox,
.cinema-box:-webkit-full-screen #youtubePlayerBox {
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}

/* ==========================================================================
   6. MOVIE LIBRARY MODAL
   ========================================================================== */

.modal-large {
  max-width: 640px;
  width: 90%;
  max-height: min(85vh, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  gap: 14px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header-row h3 {
  font-size: 18px;
  color: #fff;
}
.modal-x-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  min-width: 32px;
  min-height: 32px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.modal-x-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}
.modal-x-btn:active {
  background-color: rgba(255, 255, 255, 0.16);
}

.modal-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.modal-now-playing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(229, 169, 60, 0.12);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.modal-now-playing-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.modal-now-playing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5a93c;
  box-shadow: 0 0 8px #e5a93c;
  flex-shrink: 0;
  animation: liveDotPulse 2s infinite ease-in-out;
}

.modal-now-playing-text {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-now-playing-text strong {
  color: #ffc86b;
}

.upload-drop-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.upload-drop-area:hover {
  border-color: var(--blurple);
  color: var(--text-white);
}
.upload-drop-area p {
  color: var(--text-white);
  font-size: 14px;
  font-weight: 600;
}
.upload-drop-area span {
  color: var(--blurple);
  font-size: 12px;
}

.movie-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--blurple) rgba(255, 255, 255, 0.1);
}

/* Prominent Custom Scrollbar for Movie Modal & Large Modals to browse downward */
.modal-large::-webkit-scrollbar,
.movie-items-list::-webkit-scrollbar,
#movieModal .modal-card::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
}

.modal-large::-webkit-scrollbar-track,
.movie-items-list::-webkit-scrollbar-track,
#movieModal .modal-card::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 4px !important;
}

.modal-large::-webkit-scrollbar-thumb,
.movie-items-list::-webkit-scrollbar-thumb,
#movieModal .modal-card::-webkit-scrollbar-thumb {
  background: var(--blurple) !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.modal-large::-webkit-scrollbar-thumb:hover,
.movie-items-list::-webkit-scrollbar-thumb:hover,
#movieModal .modal-card::-webkit-scrollbar-thumb:hover {
  background: var(--blurple-hover) !important;
}

.movie-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  gap: 12px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  min-width: 0;
  box-sizing: border-box;
}
.movie-card-row:hover {
  background-color: #35373c;
  border-color: rgba(255, 255, 255, 0.08);
}

.movie-card-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.movie-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.movie-card-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.movie-card-row .play-btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* On phones / portrait mobile views: stack movie info and Play button so it is never pushed out or blocked */
@media (max-width: 600px), (max-width: 768px) and (orientation: portrait) {
  .movie-card-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .movie-card-info {
    width: 100% !important;
    min-width: 0 !important;
  }

  .movie-card-row .play-btn {
    width: 100% !important;
    height: 38px !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    letter-spacing: 0.2px !important;
  }
}

/* Sleek Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #202225;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--blurple);
}

/* Firefox scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #202225 rgba(0, 0, 0, 0.2);
}

.movie-card-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--blurple);
  color: #fff;
  letter-spacing: 0.5px;
}

.movie-card-badge.badge-mkv {
  background-color: #eb459e;
}

.movie-card-badge.badge-mp4 {
  background-color: var(--blurple);
}

.movie-card-badge.badge-webm {
  background-color: #57f287;
  color: #000;
}
.movie-card-size {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--green);
  width: 0%;
}

/* ==========================================================================
   UNIVERSAL FLOATING HUD TOAST CAPSULE (Compact Glassmorphic HUD Pill)
   ========================================================================== */
#toastContainer,
.toast-shelf {
  position: fixed;
  top: max(24px, calc(16px + env(safe-area-inset-top, 0px)));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 10000;
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 440px);
  margin: 0;
  padding: 0;
}

.toast {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  min-height: 34px;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 16px;
  border-radius: 9999px;
  background: rgba(14, 16, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  will-change: transform, opacity;
  animation: toastSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast * {
  pointer-events: none;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: #94a3b8;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.toast-message {
  display: inline-block;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  line-height: 1;
}

.toast-success {
  border-color: rgba(46, 204, 113, 0.4);
}
.toast-success .toast-icon {
  color: #2ecc71;
}

.toast-warning {
  border-color: rgba(245, 158, 11, 0.45);
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

.toast-error {
  border-color: rgba(231, 76, 60, 0.45);
}
.toast-error .toast-icon {
  color: #e74c3c;
}

.toast-info {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Subtle bounce on in-place update */
@keyframes toastBounce {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.08);
  }
  70% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.toast.toast-bounce {
  animation: toastBounce 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Slide in from top */
@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Smooth exit dismissal */
.toast.toast-hiding {
  opacity: 0 !important;
  transform: translateY(-6px) scale(0.96) !important;
}

@media (max-width: 600px), (max-height: 500px) and (orientation: landscape) {
  #toastContainer,
  .toast-shelf {
    top: max(16px, calc(10px + env(safe-area-inset-top, 0px)));
    max-width: calc(100vw - 24px);
  }

  .toast {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    gap: 6px;
    font-size: 12px;
  }

  .toast-icon {
    width: 13px;
    height: 13px;
  }

  .toast-icon svg {
    width: 13px;
    height: 13px;
  }

  .toast-message {
    font-size: 12px;
  }
}

/* ==========================================================================
   7. MOBILE & TABLET RESPONSIVENESS
   ========================================================================== */

/* Universal Mobile Sheet Backdrop */
.mobile-sheet-backdrop {
  display: none;
}

@media (max-width: 768px), (max-height: 600px) and (orientation: landscape), (max-width: 932px) and (orientation: landscape) {
  .mobile-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2400;
    opacity: 1;
    transition: opacity 0.22s ease;
    touch-action: none;
  }
  .mobile-sheet-backdrop:not(.hidden):not(.backdrop-closing) {
    animation: sheetBackdropFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }
  .mobile-sheet-backdrop.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
  }
  .mobile-sheet-backdrop.backdrop-closing {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  @keyframes sheetBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* Transform Dropdown Popups into Native Slide-Up Bottom Sheets */
  .floating-pill-dock {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(14, 16, 24, 0.96) !important;
  }

  .device-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 76dvh !important;
    border-radius: 20px 20px 0 0 !important;
    background: rgba(18, 19, 24, 0.98) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-bottom: none !important;
    padding: 10px 16px max(18px, env(safe-area-inset-bottom, 18px)) !important;
    z-index: 2500 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateY(0) !important;
    will-change: transform, opacity;
  }

  .device-menu.sheet-opening,
  .device-menu:not(.hidden):not(.sheet-closing) {
    animation: sheetSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .device-menu.sheet-closing {
    animation: sheetSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    pointer-events: none !important;
  }

  @keyframes sheetSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0.6;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  @keyframes sheetSlideDown {
    from {
      transform: translateY(0);
      opacity: 1;
    }
    to {
      transform: translateY(100%);
      opacity: 0;
    }
  }

  @media (orientation: landscape) and (max-height: 600px), (min-width: 601px) and (max-width: 1024px) {
    .device-menu {
      left: 50% !important;
      right: auto !important;
      transform: translateX(-50%) !important;
      width: min(440px, calc(100vw - 32px)) !important;
      max-width: 440px !important;
      border-radius: 18px !important;
      border: 1px solid rgba(255, 255, 255, 0.15) !important;
      bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85) !important;
      max-height: 82dvh !important;
    }

    .device-menu.sheet-opening,
    .device-menu:not(.hidden):not(.sheet-closing) {
      animation: tabletSheetSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .device-menu.sheet-closing {
      animation: tabletSheetSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }

    @keyframes tabletSheetSlideUp {
      from {
        transform: translate(-50%, 40px);
        opacity: 0;
      }
      to {
        transform: translate(-50%, 0);
        opacity: 1;
      }
    }

    @keyframes tabletSheetSlideDown {
      from {
        transform: translate(-50%, 0);
        opacity: 1;
      }
      to {
        transform: translate(-50%, 40px);
        opacity: 0;
      }
    }
  }

  .device-menu::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.28);
    margin: 2px auto 12px;
  }

  .device-menu-header {
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    color: #fff !important;
    padding: 4px 6px 8px !important;
  }

  .more-menu-item {
    padding: 12px 14px !important;
    border-radius: 10px !important;
    margin-bottom: 2px !important;
  }

  .device-opt {
    padding: 12px 14px !important;
    font-size: 14px !important;
    border-radius: 8px;
  }

  /* Touch Target Expansions (44x44px rule per Apple HIG & Google Material) */
  .pill-btn, .corner-icon-btn, .icon-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
  }
  .pill-chevron-btn,
  #micDeviceDropdownBtn,
  #micDeviceBtn,
  #camDeviceDropdownBtn,
  #camDeviceBtn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: absolute !important;
    z-index: 2 !important;
  }
  .pill-btn::after {
    content: '';
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: -4px;
    right: -4px;
  }
  .pill-chevron-btn::after {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -6px;
    right: -6px;
  }
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   PORTRAIT MODE LAYOUT (Phones, Foldables & Tablets up to 1024px)
   Strictly follows user red box specification:
     - Top Bar: Left Room Title/Host Badge + Right Chat Button
     - Cinema Stage: 16:9 Aspect Ratio spanning width, center-balanced
     - Participant Card: Generous 322px x 181px box for single user (or balanced pairs/grid)
     - Floating Pill Dock: Wide ~512px dock, centered with comfortable bottom clearance
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) and (orientation: portrait) {
  html, body, .app-container {
    overflow-x: hidden;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  /* 1. Top Bar (Matches Top-Left and Top-Right Red Boxes) */
  .top-bar {
    height: 50px;
    padding: max(0px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 16px)) 0 max(16px, env(safe-area-inset-left, 16px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .speaker-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .room-heading {
    font-size: 15.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .host-indicator {
    display: inline-flex !important;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(87, 242, 135, 0.15);
    color: #57f287;
    border: 1px solid rgba(87, 242, 135, 0.3);
    flex-shrink: 0;
  }

  .top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .top-bar-right .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
  }

  /* 2. Main Stage Area (Vertically Balanced Theater) */
  .stage-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(52px, calc(48px + env(safe-area-inset-top, 0px))) max(10px, env(safe-area-inset-right, 10px)) max(78px, calc(70px + env(safe-area-inset-bottom, 16px))) max(10px, env(safe-area-inset-left, 10px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    gap: clamp(6px, 1.5vh, 12px);
    transition: padding 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .idle-mode .stage-section {
    padding: 10px max(10px, env(safe-area-inset-right, 10px)) 10px max(10px, env(safe-area-inset-left, 10px));
  }

  .stage-cinema-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    gap: clamp(8px, 1.6vh, 14px);
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
  }

  /* Inactivity Idle Mode: Cinema screen gently glides into full center */
  .idle-mode .stage-cinema-group {
    transform: translateY(clamp(6px, 2vh, 16px));
  }

  /* 3. Cinema Stage Wrapper (Prominent theater screen: 100% width, 16:9 aspect ratio) */
  .cinema-stage-wrapper {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(480px, 48dvh);
    margin: 0 auto;
    flex-shrink: 0;
    position: relative;
  }

  .cinema-box {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  }

  .ambient-glow-wrapper:not(.hidden),
  .cinema-stage-wrapper > .ambient-glow-canvas:not(.hidden) {
    position: absolute;
    top: -16px !important;
    left: -20px !important;
    right: -20px !important;
    bottom: -16px !important;
    width: calc(100% + 40px) !important;
    height: calc(100% + 32px) !important;
    max-width: none !important;
    display: block;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
  }

  .ambient-glow-wrapper > .ambient-glow-canvas:not(.hidden) {
    position: absolute;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block;
    filter: blur(36px) saturate(2.2);
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
  }

  .ambient-glow-canvas:not(.hidden) {
    display: block;
    filter: blur(36px) saturate(2.2);
    opacity: 0.72;
  }

  /* Portrait & Tablet Cinema Controls HUD (Clean 2-row layout) */
  .cinema-controls-hud {
    padding: 8px 10px 6px;
    gap: 4px;
    background: linear-gradient(to top, rgba(6, 7, 10, 0.98) 0%, rgba(6, 7, 10, 0.82) 65%, transparent 100%);
  }
  .hud-timeline-container {
    padding: 3px 0;
  }
  .hud-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }
  .hud-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 5px;
  }
  .hud-left .hud-time {
    margin-left: auto;
    font-size: 11px;
    white-space: nowrap;
  }
  .hud-right {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    gap: 3px;
    overflow: visible;
    flex-wrap: nowrap;
  }
  .hud-right #ambientToggleBtn {
    margin-left: auto;
  }
  .hud-circle-btn {
    width: 32px;
    height: 32px;
    position: relative;
    touch-action: manipulation;
  }
  .hud-circle-btn::after {
    display: none !important;
  }
  .hud-icon-btn {
    width: 28px;
    height: 28px;
    padding: 2px;
    position: relative;
    touch-action: manipulation;
    flex-shrink: 0;
  }
  .hud-icon-btn::after {
    display: none !important;
  }
  .hud-pill-group {
    height: 25px;
    padding: 2px 5px;
    gap: 2px;
    font-size: 10px;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .hud-select {
    max-width: 46px;
    font-size: 10px;
    padding: 0 1px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .hud-right #speedSelect {
    max-width: 36px;
  }
  .hud-sub-gear-btn {
    padding: 2px;
    position: relative;
    touch-action: manipulation;
  }
  .hud-sub-gear-btn::after {
    display: none !important;
  }

  /* 4. Balanced Participant Distribution Above & Below Cinema Stage */
  .participants-tile-area {
    width: 100%;
    margin-top: 0;
    padding: 0 4px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
  }

  .participants-top-area {
    margin-bottom: 8px;
    margin-top: 0;
  }

  .participants-bottom-area {
    margin-top: 8px;
    margin-bottom: 0;
  }

  .participants-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 2px 4px;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }

  /* ==========================================================================
     Progressive Participant Scaling in Portrait Mode
     Avoids blank space when few members exist; scales gracefully as more join.
     ========================================================================== */

  /* 1 Member: Generous video tile (eliminates the large blank void) */
  .stage-cinema-group[data-participant-count="1"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .participant-tile {
    width: min(340px, 88vw) !important;
    max-width: 340px !important;
    height: 180px !important;
    max-height: 180px !important;
    border-radius: 12px !important;
    flex: 0 0 auto !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-avatar-center {
    width: 76px !important;
    height: 76px !important;
    font-size: 28px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-username,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-username {
    font-size: 13px !important;
  }

  /* 2 Members: 1 Top, 1 Bottom - Symmetrically framing center cinema screen */
  .stage-cinema-group[data-participant-count="2"] .participant-tile {
    width: min(280px, 76vw) !important;
    max-width: 280px !important;
    height: 145px !important;
    max-height: 145px !important;
    border-radius: 11px !important;
    flex: 0 0 auto !important;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-avatar-center {
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-username {
    font-size: 12px !important;
  }

  /* 3 Members: 1 Top (centered), 2 Bottom (side-by-side) */
  .stage-cinema-group[data-participant-count="3"] .participants-top-area .participant-tile {
    width: min(270px, 72vw) !important;
    max-width: 270px !important;
    height: 135px !important;
    max-height: 135px !important;
    border-radius: 11px !important;
    flex: 0 0 auto !important;
  }

  .stage-cinema-group[data-participant-count="3"] .participants-bottom-area .participant-tile {
    flex: 0 1 calc(50% - 6px) !important;
    max-width: 210px !important;
    min-width: 135px !important;
    height: 125px !important;
    max-height: 125px !important;
    border-radius: 10px !important;
  }

  .stage-cinema-group[data-participant-count="3"] .tile-avatar-center {
    width: 48px !important;
    height: 48px !important;
    font-size: 19px !important;
  }

  .stage-cinema-group[data-participant-count="3"] .tile-username {
    font-size: 11.5px !important;
  }

  /* 4 Members: 2 Top (side-by-side), 2 Bottom (side-by-side) */
  .stage-cinema-group[data-participant-count="4"] .participant-tile {
    flex: 0 1 calc(50% - 6px) !important;
    max-width: 200px !important;
    min-width: 130px !important;
    height: 120px !important;
    max-height: 120px !important;
    border-radius: 10px !important;
  }

  .stage-cinema-group[data-participant-count="4"] .tile-avatar-center {
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
  }

  .stage-cinema-group[data-participant-count="4"] .tile-username {
    font-size: 11px !important;
  }

  /* 5 or 6 Members: 2-3 Top, 3 Bottom (compact 3-across rows) */
  .stage-cinema-group[data-participant-count="5"] .participant-tile,
  .stage-cinema-group[data-participant-count="6"] .participant-tile,
  .participants-row:has(.participant-tile:nth-child(3):last-child) .participant-tile {
    flex: 0 1 calc(33.333% - 6px) !important;
    max-width: 165px !important;
    min-width: 105px !important;
    height: 106px !important;
    max-height: 106px !important;
    border-radius: 8px !important;
  }

  .stage-cinema-group[data-participant-count="5"] .tile-avatar-center,
  .stage-cinema-group[data-participant-count="6"] .tile-avatar-center,
  .participants-row:has(.participant-tile:nth-child(3):last-child) .tile-avatar-center {
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
  }

  .stage-cinema-group[data-participant-count="5"] .tile-username,
  .stage-cinema-group[data-participant-count="6"] .tile-username,
  .participants-row:has(.participant-tile:nth-child(3):last-child) .tile-username {
    font-size: 10.5px !important;
  }

  /* 7+ Members: Smooth horizontal scrollable ribbons (never shrinks below readable size) */
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .participants-row,
  .participants-row:has(.participant-tile:nth-child(4)) {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .participants-row:has(.participant-tile:nth-child(4))::-webkit-scrollbar,
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .participants-row::-webkit-scrollbar {
    display: none;
  }

  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .participant-tile,
  .participants-row:has(.participant-tile:nth-child(4)) .participant-tile {
    flex: 0 0 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    height: 98px !important;
    border-radius: 8px !important;
  }

  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .tile-avatar-center,
  .participants-row:has(.participant-tile:nth-child(4)) .tile-avatar-center {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }

  /* Fallback 2-card row when count attribute is absent */
  .participants-row:has(.participant-tile:nth-child(2):last-child) .participant-tile {
    flex: 0 1 calc(50% - 6px) !important;
    max-width: 240px !important;
    height: 130px !important;
    border-radius: 10px !important;
  }

  .participants-row:has(.participant-tile:nth-child(2):last-child) .tile-avatar-center {
    width: 48px !important;
    height: 48px !important;
    font-size: 19px !important;
  }

  .participant-tile {
    flex: 0 1 calc(50% - 8px);
    max-width: 240px;
    min-width: 110px;
    height: 120px;
    border-radius: 10px;
  }

  .tile-avatar-center {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .tile-name-badge {
    font-size: 11px;
    padding: 2px 7px;
  }

  /* 5. Floating Pill Dock (Matches Bottom Red Box: ~512px wide, floating gracefully above bottom) */
  .dock-wrapper {
    height: 76px;
    padding: 0 16px;
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
    flex-shrink: 0;
  }

  .dock-container {
    justify-content: center;
    width: 100%;
    position: relative;
  }

  #theaterFullscreenBtn {
    display: flex !important;
    position: absolute;
    right: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right, 16px));
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-full);
    color: var(--text-normal);
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }

  #dockInviteBtn {
    display: flex !important;
    position: absolute;
    left: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left, 16px));
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-full);
    color: var(--text-normal);
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }

  #dockInviteBtn:hover,
  #dockInviteBtn:active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
  }

  .floating-pill-dock {
    gap: 8px;
    padding: 6px 14px;
    max-width: min(512px, calc(100vw - 24px));
    width: auto;
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: visible !important;
  }

  .pill-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .pill-btn svg {
    width: 19px;
    height: 19px;
    pointer-events: none;
  }

  .pill-chevron-btn,
  #micDeviceDropdownBtn,
  #micDeviceBtn,
  #camDeviceDropdownBtn,
  #camDeviceBtn {
    position: absolute !important;
    bottom: -2px !important;
    right: -4px !important;
    width: 17px !important;
    height: 17px !important;
    border-radius: var(--radius-full) !important;
    border: 2px solid var(--bg-surface) !important;
    background-color: var(--bg-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
  }

  .pill-chevron-btn svg,
  #micDeviceDropdownBtn svg,
  #camDeviceDropdownBtn svg {
    width: 9px !important;
    height: 9px !important;
    stroke-width: 3;
    pointer-events: none !important;
  }

  /* Fullscreen Chat in Portrait */
  .chat-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2200;
    padding-top: max(8px, env(safe-area-inset-top, 8px));
    will-change: transform, opacity;
  }

  .chat-panel.chat-panel-opening,
  .chat-panel:not(.hidden):not(.chat-panel-closing) {
    animation: slideInPortraitChat 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  .chat-panel.chat-panel-closing {
    animation: slideOutPortraitChat 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    pointer-events: none !important;
  }

  @keyframes slideInPortraitChat {
    from {
      transform: translate3d(0, 100%, 0);
      opacity: 0.7;
    }
    to {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
  }

  @keyframes slideOutPortraitChat {
    from {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
    to {
      transform: translate3d(0, 100%, 0);
      opacity: 0;
    }
  }

  .chat-compose-bar {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
  }

  /* Mobile Portrait Drag Handle & Header Optimization */
  .chat-mobile-drag-handle {
    display: block !important;
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    margin: 8px auto 6px auto;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .chat-mobile-drag-handle:active {
    background: rgba(255, 255, 255, 0.55);
    cursor: grabbing;
  }

  /* Mobile Portrait Emoji Picker bounds & touch targets */
  .chat-emoji-picker {
    left: 12px !important;
    right: 12px !important;
    width: calc(100% - 24px) !important;
    max-width: none !important;
    max-height: min(320px, 46dvh) !important;
    bottom: calc(100% + 4px) !important;
  }

  .emoji-picker-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 4px !important;
  }

  .emoji-item-btn {
    position: relative;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  .emoji-item-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    min-width: 44px;
    min-height: 44px;
    pointer-events: none;
  }

  /* Universal 44px Touch Targets on Mobile Portrait */
  .chat-action-icon-btn,
  #closeChatBtn,
  .reaction-item-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .emoji-tab-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    flex-shrink: 0 !important;
  }

  .chat-starter-chip {
    min-height: 44px !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .chat-new-messages-pill {
    min-height: 44px !important;
    padding: 8px 18px !important;
  }
}

/* --------------------------------------------------------------------------
   Tablet Portrait Optimization (501px <= width <= 1024px, e.g. iPad, Galaxy Tab)
   Fills spacious tablet screen without awkward blank areas
   -------------------------------------------------------------------------- */
@media (min-width: 501px) and (max-width: 1024px) and (orientation: portrait) {
  .floating-pill-dock {
    max-width: min(512px, calc(100vw - 140px)) !important;
  }

  .cinema-stage-wrapper {
    max-height: min(540px, 50dvh) !important;
    max-width: 900px !important;
  }

  .ambient-glow-wrapper:not(.hidden),
  .cinema-stage-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: -20px !important;
    left: -28px !important;
    right: -28px !important;
    bottom: -20px !important;
    width: calc(100% + 56px) !important;
    height: calc(100% + 40px) !important;
    max-width: none !important;
    display: block;
    overflow: visible;
  }
  .ambient-glow-canvas:not(.hidden) {
    filter: blur(42px) saturate(2.3);
    opacity: 0.72;
  }

  /* Single Participant on Tablet: Prominent 225px card */
  .stage-cinema-group[data-participant-count="1"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .participant-tile {
    width: min(440px, 68vw) !important;
    max-width: 440px !important;
    height: 225px !important;
    max-height: 225px !important;
    border-radius: 14px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-avatar-center {
    width: 76px !important;
    height: 76px !important;
    font-size: 30px !important;
  }

  /* 2 Participants on Tablet */
  .stage-cinema-group[data-participant-count="2"] .participant-tile {
    width: min(340px, 48vw) !important;
    max-width: 340px !important;
    height: 180px !important;
    max-height: 180px !important;
    border-radius: 12px !important;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-avatar-center {
    width: 62px !important;
    height: 62px !important;
    font-size: 24px !important;
  }

  /* 3-4 Participants on Tablet */
  .stage-cinema-group[data-participant-count="3"] .participant-tile,
  .stage-cinema-group[data-participant-count="4"] .participant-tile {
    height: 145px !important;
    max-width: 250px !important;
  }

  .stage-cinema-group[data-participant-count="3"] .tile-avatar-center,
  .stage-cinema-group[data-participant-count="4"] .tile-avatar-center {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }

  /* 5-6 Participants on Tablet */
  .stage-cinema-group[data-participant-count="5"] .participant-tile,
  .stage-cinema-group[data-participant-count="6"] .participant-tile {
    height: 125px !important;
    max-width: 195px !important;
  }

  .stage-cinema-group[data-participant-count="5"] .tile-avatar-center,
  .stage-cinema-group[data-participant-count="6"] .tile-avatar-center {
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
  }

  /* 7+ Participants on Tablet */
  .participants-row:has(.participant-tile:nth-child(4)) .participant-tile,
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .participant-tile {
    flex: 0 0 160px !important;
    height: 110px !important;
  }

  .participants-row:has(.participant-tile:nth-child(4)) .tile-avatar-center,
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .tile-avatar-center {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
}

/* --------------------------------------------------------------------------
   Phone Portrait Tweaks (width <= 500px, e.g. Moto G Power 412x823, iPhone 13-16)
   Matches exact phone red boxes:
     - Single Card: ~220px wide x ~138px tall
     - Floating Dock: ~342px wide, elevated ~35px above bottom edge
   -------------------------------------------------------------------------- */
@media (max-width: 500px) and (orientation: portrait) {
  .top-bar {
    height: 46px;
    padding: 0 12px;
  }

  .room-heading {
    font-size: 14.5px;
  }

  .ambient-glow-wrapper:not(.hidden),
  .cinema-stage-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: -8px !important;
    left: -10px !important;
    right: -10px !important;
    bottom: -8px !important;
    width: calc(100% + 20px) !important;
    height: calc(100% + 16px) !important;
    max-width: none !important;
    display: block;
    overflow: visible;
  }
  .ambient-glow-canvas:not(.hidden) {
    filter: blur(28px) saturate(2.2);
    opacity: 0.72;
  }

  /* Single Participant Card on phones: generous sizing eliminating blank spaces */
  .participant-tile:only-child,
  .stage-cinema-group[data-participant-count="1"] .participant-tile {
    width: min(340px, 88vw) !important;
    max-width: 340px !important;
    height: 175px !important;
    border-radius: 12px !important;
  }

  .participant-tile:only-child .tile-avatar-center,
  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center {
    width: 64px !important;
    height: 64px !important;
    font-size: 24px !important;
  }

  .participant-tile:only-child .tile-name-badge,
  .stage-cinema-group[data-participant-count="1"] .tile-name-badge {
    font-size: 12px !important;
    padding: 3px 9px !important;
    bottom: 6px !important;
    left: 6px !important;
  }

  /* Floating Dock on phones: matches exact red box width ~342px, floating ~35px above bottom */
  .dock-wrapper {
    height: 68px;
    padding: 0;
    padding-bottom: max(32px, env(safe-area-inset-bottom, 32px));
  }

  #dockInviteBtn {
    position: absolute !important;
    left: max(clamp(12px, 2.5vw, 20px), env(safe-area-inset-left, 12px)) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: var(--radius-full) !important;
    background: rgba(14, 16, 24, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
    color: var(--text-normal) !important;
    z-index: 50 !important;
    touch-action: manipulation !important;
  }

  #theaterFullscreenBtn {
    position: absolute !important;
    right: max(clamp(12px, 2.5vw, 20px), env(safe-area-inset-right, 12px)) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: var(--radius-full) !important;
    background: rgba(14, 16, 24, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
    color: var(--text-normal) !important;
    z-index: 50 !important;
    touch-action: manipulation !important;
  }

  #dockInviteBtn:hover,
  #dockInviteBtn:active,
  #theaterFullscreenBtn:hover,
  #theaterFullscreenBtn:active {
    color: #fff !important;
    background: rgba(26, 29, 45, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }

  .floating-pill-dock {
    gap: 4px;
    padding: 4px 8px;
    max-width: min(512px, calc(100vw - 128px)) !important;
    width: auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .pill-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .pill-btn svg {
    width: 18px;
    height: 18px;
  }

  .pill-chevron-btn,
  #micDeviceDropdownBtn,
  #micDeviceBtn,
  #camDeviceDropdownBtn,
  #camDeviceBtn {
    position: absolute !important;
    bottom: -2px !important;
    right: -3px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: var(--radius-full) !important;
    border: 1.5px solid var(--bg-surface) !important;
    background-color: var(--bg-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
  }

  .pill-chevron-btn svg,
  #micDeviceDropdownBtn svg,
  #camDeviceDropdownBtn svg {
    width: 8px !important;
    height: 8px !important;
    stroke-width: 3;
    pointer-events: none !important;
  }

  /* Compact, tap-friendly HUD pills for phone portrait */
  .hud-pill-group {
    padding: 2px 3px !important;
    gap: 2px !important;
    height: 24px !important;
    font-size: 9.5px !important;
    flex-shrink: 0 !important;
  }

  .hud-pill-icon {
    width: 10px !important;
    height: 10px !important;
  }

  .hud-select {
    max-width: 40px !important;
    font-size: 9.5px !important;
    padding: 0 1px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .hud-right #speedSelect {
    max-width: 34px !important;
  }

  .hud-icon-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 2px !important;
    flex-shrink: 0 !important;
  }

  .hud-circle-btn {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
  }

  .hud-left {
    gap: 3px !important;
  }

  .hud-left .hud-time {
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .hud-right {
    gap: 2px !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
  }
}

/* --------------------------------------------------------------------------
   Ultra-Narrow Phone Portrait (width <= 360px, e.g. Galaxy Z Fold Cover)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) and (orientation: portrait) {
  .top-bar {
    padding: 0 6px !important;
    gap: 4px !important;
  }

  .room-heading {
    font-size: 13px !important;
  }

  .host-indicator {
    display: none !important;
  }

  .hud-pill-group {
    padding: 1px 2px !important;
    height: 22px !important;
    font-size: 9px !important;
  }

  .hud-select {
    max-width: 36px !important;
    font-size: 9px !important;
  }

  .hud-right #speedSelect {
    max-width: 30px !important;
  }

  .hud-icon-btn {
    width: 24px !important;
    height: 24px !important;
    padding: 1px !important;
  }

  .hud-circle-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .hud-left .hud-time {
    font-size: 9px !important;
  }

  .dock-wrapper {
    padding: 0 !important;
  }

  #dockInviteBtn {
    left: max(8px, env(safe-area-inset-left, 8px)) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  #theaterFullscreenBtn {
    right: max(8px, env(safe-area-inset-right, 8px)) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .floating-pill-dock {
    padding: 3px 6px !important;
    gap: 4px !important;
    max-width: calc(100vw - 120px) !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .pill-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .pill-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .pill-chevron-btn,
  #micDeviceDropdownBtn,
  #micDeviceBtn,
  #camDeviceDropdownBtn,
  #camDeviceBtn {
    position: absolute !important;
    bottom: -2px !important;
    right: -2px !important;
    width: 14px !important;
    height: 14px !important;
    border-radius: var(--radius-full) !important;
    border: 1.5px solid var(--bg-surface) !important;
    background-color: var(--bg-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
  }

  .pill-chevron-btn svg,
  #micDeviceDropdownBtn svg,
  #camDeviceDropdownBtn svg {
    width: 7px !important;
    height: 7px !important;
    stroke-width: 3;
    pointer-events: none !important;
  }

  .participant-tile:only-child {
    width: min(260px, 92vw) !important;
    height: 140px !important;
  }

  /* Cinema Stage Lounge Ultra-Narrow Portrait */
  .stage-lounge-card {
    padding: 10px 12px !important;
    max-width: calc(100% - 12px) !important;
  }

  .stage-avatar-wrapper {
    width: 46px !important;
    height: 46px !important;
    margin-bottom: 6px !important;
  }

  .stage-center-avatar-box {
    width: 46px !important;
    height: 46px !important;
    border-width: 2px !important;
  }

  .stage-avatar-mic-badge {
    width: 19px !important;
    height: 19px !important;
    border-width: 1.5px !important;
  }

  .stage-avatar-mic-badge svg {
    width: 9px !important;
    height: 9px !important;
  }

  .stage-badge-row {
    margin-bottom: 4px !important;
  }

  .stage-status-pill {
    padding: 2px 7px !important;
    font-size: 8.5px !important;
  }

  .stage-lounge-title {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }

  .stage-lounge-subtext {
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    margin-bottom: 8px !important;
    max-width: 240px !important;
  }

  .btn-stage-primary {
    font-size: 12px !important;
    padding: 8px 14px !important;
    min-height: 42px !important;
  }
}

/* --------------------------------------------------------------------------
   Compact Height Portrait (height <= 760px, e.g. iPhone SE, Galaxy S8, compact Android)
   -------------------------------------------------------------------------- */
@media (max-height: 760px) and (orientation: portrait) {
  .stage-section {
    padding: max(48px, calc(44px + env(safe-area-inset-top, 0px))) max(8px, env(safe-area-inset-right, 8px)) max(70px, calc(64px + env(safe-area-inset-bottom, 12px))) max(8px, env(safe-area-inset-left, 8px));
    gap: 6px;
  }

  .idle-mode .stage-section {
    padding: 8px max(8px, env(safe-area-inset-right, 8px)) 8px max(8px, env(safe-area-inset-left, 8px));
  }

  .cinema-stage-wrapper {
    max-height: min(340px, 44dvh);
  }

  .stage-cinema-group {
    gap: 8px;
  }

  .participants-top-area {
    margin-bottom: 4px;
  }

  .participants-bottom-area {
    margin-top: 4px;
  }

  /* Single Participant: Generous 155px card eliminating blank space on compact phones */
  .stage-cinema-group[data-participant-count="1"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .participant-tile {
    width: min(300px, 86vw) !important;
    max-width: 300px !important;
    height: 155px !important;
    max-height: 155px !important;
    border-radius: 11px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-avatar-center {
    width: 60px !important;
    height: 60px !important;
    font-size: 22px !important;
  }

  /* 2 Participants: 125px cards framing center cinema screen */
  .stage-cinema-group[data-participant-count="2"] .participant-tile {
    width: min(250px, 72vw) !important;
    max-width: 250px !important;
    height: 125px !important;
    max-height: 125px !important;
    border-radius: 10px !important;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-avatar-center {
    width: 50px !important;
    height: 50px !important;
    font-size: 19px !important;
  }

  /* 3-4 Participants: 110px cards */
  .stage-cinema-group[data-participant-count="3"] .participant-tile,
  .stage-cinema-group[data-participant-count="4"] .participant-tile,
  .participants-row:has(.participant-tile:nth-child(2):last-child) .participant-tile {
    height: 110px !important;
    max-width: 190px !important;
  }

  .stage-cinema-group[data-participant-count="3"] .tile-avatar-center,
  .stage-cinema-group[data-participant-count="4"] .tile-avatar-center,
  .participants-row:has(.participant-tile:nth-child(2):last-child) .tile-avatar-center {
    width: 42px !important;
    height: 42px !important;
    font-size: 16px !important;
  }

  /* 5-6 Participants: 98px cards */
  .stage-cinema-group[data-participant-count="5"] .participant-tile,
  .stage-cinema-group[data-participant-count="6"] .participant-tile,
  .participants-row:has(.participant-tile:nth-child(3):last-child) .participant-tile {
    height: 98px !important;
    max-width: 150px !important;
  }

  /* 7+ Participants */
  .participants-row:has(.participant-tile:nth-child(4)) .participant-tile,
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]):not([data-participant-count="4"]):not([data-participant-count="5"]):not([data-participant-count="6"]) .participant-tile {
    flex: 0 0 130px !important;
    height: 92px !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Landscape Theater Mode (max-height: 600px and orientation: landscape)
   With Concurrent Watch + Chat Split View
   -------------------------------------------------------------------------- */
@media (max-height: 600px) and (orientation: landscape), (max-width: 932px) and (orientation: landscape) {
  .top-bar {
    height: 38px;
    padding: 0 max(12px, env(safe-area-inset-right, 12px)) 0 max(12px, env(safe-area-inset-left, 12px));
    padding-top: max(0px, env(safe-area-inset-top, 0px));
  }

  .top-bar-right .icon-btn {
    width: 36px !important;
    height: 36px !important;
    position: relative !important;
  }

  .top-bar-right .icon-btn::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 44px !important;
    height: 44px !important;
  }

  .speaker-icon {
    width: 16px;
    height: 16px;
  }

  .room-heading {
    font-size: 13px;
  }

  .stage-section {
    padding: 38px 10px 48px;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: visible;
    transition: padding 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .idle-mode .stage-section {
    padding: 6px 10px 6px;
  }

  /* Video fits available height and width strictly without clipping right column */
  .cinema-stage-wrapper {
    aspect-ratio: 16 / 9;
    max-height: calc(100dvh - 78px);
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0 auto;
    flex: 1 1 auto;
    flex-shrink: 1;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1), max-width 0.3s ease;
  }

  .ambient-glow-wrapper:not(.hidden),
  .cinema-stage-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: -14px !important;
    left: -22px !important;
    right: -22px !important;
    bottom: -14px !important;
    width: calc(100% + 44px) !important;
    height: calc(100% + 28px) !important;
    max-width: none !important;
    display: block;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
  }

  .ambient-glow-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block;
    filter: blur(34px) saturate(2.3);
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
  }

  .ambient-glow-canvas:not(.hidden) {
    display: block;
    filter: blur(34px) saturate(2.3);
    opacity: 0.72;
  }

  body.has-participants .cinema-stage-wrapper {
    max-width: calc(100% - clamp(180px, 22vw, 225px) - 12px) !important;
  }

  body:not(.has-participants) .cinema-stage-wrapper,
  .stage-cinema-group[data-participant-count="0"] .cinema-stage-wrapper,
  .stage-cinema-group:not([data-participant-count]) .cinema-stage-wrapper {
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .idle-mode .cinema-stage-wrapper {
    max-height: calc(100dvh - 16px);
    max-width: 100% !important;
  }

  .cinema-box {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
  }

  /* Sleek HUD controls fitting inside cinema-box in landscape so all buttons are visible and tap-friendly */
  .cinema-controls-hud {
    bottom: 0 !important;
    transform: none !important;
    padding: 6px 8px 4px !important;
    gap: 3px !important;
    background: linear-gradient(to top, rgba(6, 7, 10, 0.98) 0%, rgba(6, 7, 10, 0.85) 60%, transparent 100%) !important;
  }

  .hud-timeline-container {
    padding: 3px 0 !important;
  }

  .hud-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    width: 100% !important;
  }

  .hud-left {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    gap: 4px !important;
  }

  .hud-left .hud-time {
    margin-left: auto !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
  }

  .hud-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    gap: 3px !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
  }

  .hud-right #ambientToggleBtn {
    margin-left: auto !important;
  }

  .hud-circle-btn {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    touch-action: manipulation !important;
  }

  .hud-circle-btn::after {
    display: none !important;
  }

  .hud-circle-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .hud-icon-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 2px !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    position: relative !important;
    touch-action: manipulation !important;
  }

  .hud-icon-btn::after {
    display: none !important;
  }

  .hud-icon-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .hud-pill-group {
    padding: 2px 4px !important;
    gap: 2px !important;
    height: 24px !important;
    font-size: 10px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
    position: relative !important;
  }

  .hud-pill-icon {
    width: 11px !important;
    height: 11px !important;
  }

  .hud-select {
    font-size: 10px !important;
    max-width: clamp(44px, 7vw, 75px) !important;
    padding: 0 2px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .hud-right #speedSelect {
    max-width: clamp(34px, 5vw, 48px) !important;
  }

  .hud-sub-gear-btn {
    padding: 2px !important;
    position: relative !important;
    touch-action: manipulation !important;
  }

  .hud-sub-gear-btn::after {
    display: none !important;
  }

  /* In landscape mode, top area is hidden; all participants stack in right column */
  .participants-top-area {
    display: none !important;
  }

  /* Participants stacked in right column: dynamic scaling to avoid empty space */
  .participants-tile-area {
    margin-top: 0;
    max-height: calc(100vh - 78px);
    max-height: calc(100dvh - 78px);
    width: clamp(180px, 22vw, 225px);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    transition: max-height 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .participants-tile-area.hidden,
  .participants-tile-area[data-count="0"],
  .stage-cinema-group[data-participant-count="0"] .participants-tile-area,
  body:not(.has-participants) .participants-tile-area {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none !important;
  }

  .idle-mode .participants-tile-area {
    max-height: calc(100dvh - 16px);
  }

  .participants-row {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 2px;
    width: 100%;
    height: 100%;
    max-height: 100%;
  }

  /* 1 Participant in Landscape: fills vertical column generously */
  .stage-cinema-group[data-participant-count="1"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .participant-tile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 220px !important;
    flex: 0 0 220px !important;
    border-radius: 12px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-avatar-center {
    width: 64px !important;
    height: 64px !important;
    font-size: 24px !important;
  }

  /* 2 Participants in Landscape: fills column split 50/50 */
  .stage-cinema-group[data-participant-count="2"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(2):last-child) .participant-tile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 140px !important;
    flex: 0 0 140px !important;
    border-radius: 11px !important;
  }

  .stage-cinema-group[data-participant-count="2"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(2):last-child) .tile-avatar-center {
    width: 50px !important;
    height: 50px !important;
    font-size: 19px !important;
  }

  /* 3 Participants in Landscape: fills column split 33/33/33 */
  .stage-cinema-group[data-participant-count="3"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(3):last-child) .participant-tile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 105px !important;
    flex: 0 0 105px !important;
    border-radius: 9px !important;
  }

  .stage-cinema-group[data-participant-count="3"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(3):last-child) .tile-avatar-center {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }

  /* 4+ Participants in Landscape: scrollable list with 100px minimum clear tiles */
  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]) .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(4)) .participant-tile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100px !important;
    flex: 0 0 100px !important;
    border-radius: 8px !important;
  }

  .stage-cinema-group[data-participant-count]:not([data-participant-count="1"]):not([data-participant-count="2"]):not([data-participant-count="3"]) .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:nth-child(4)) .tile-avatar-center {
    width: 38px !important;
    height: 38px !important;
    font-size: 15px !important;
  }

  .participant-tile {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-radius: 10px;
  }

  .tile-avatar-center {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .tile-name-badge {
    font-size: 11px;
    padding: 2px 7px;
    bottom: 4px;
    left: 4px;
  }

  .stage-cinema-group {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 12px;
    margin: 0 auto !important;
    transition: max-width 0.3s ease;
  }

  /* Compact dock in landscape */
  .dock-wrapper {
    height: 44px;
    padding: 0 max(8px, env(safe-area-inset-right, 8px)) 0 max(8px, env(safe-area-inset-left, 8px));
    padding-bottom: max(3px, env(safe-area-inset-bottom, 0));
  }

  .dock-container {
    justify-content: center;
    width: 100%;
    position: relative;
  }

  #theaterFullscreenBtn {
    display: flex !important;
    position: absolute;
    right: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right, 16px));
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-full);
    color: var(--text-normal);
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }

  #dockInviteBtn {
    display: flex !important;
    position: absolute;
    left: max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left, 16px));
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-full);
    color: var(--text-normal);
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  }

  #dockInviteBtn:hover,
  #dockInviteBtn:active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
  }

  .floating-pill-dock {
    padding: 2px 6px;
    gap: 5px;
    border-radius: 12px;
    overflow: visible !important;
  }

  .pill-btn {
    width: 34px;
    height: 34px;
    position: relative;
    touch-action: manipulation;
  }

  .pill-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
  }

  .pill-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
  }

  .pill-chevron-btn,
  #micDeviceDropdownBtn,
  #micDeviceBtn,
  #camDeviceDropdownBtn,
  #camDeviceBtn {
    position: absolute !important;
    bottom: -2px !important;
    right: -3px !important;
    width: 15px !important;
    height: 15px !important;
    border-radius: var(--radius-full) !important;
    border: 1.5px solid var(--bg-surface) !important;
    background-color: var(--bg-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
    z-index: 2 !important;
  }

  .pill-chevron-btn::after {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -6px;
    right: -6px;
  }

  .pill-chevron-btn svg,
  #micDeviceDropdownBtn svg,
  #camDeviceDropdownBtn svg {
    width: 8px !important;
    height: 8px !important;
    stroke-width: 3;
    pointer-events: none !important;
  }

  /* Concurrent Watch + Chat Split Mode in Landscape */
  .chat-panel {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: min(340px, 42vw) !important;
    height: 100dvh !important;
    z-index: 2200 !important;
    background: rgba(14, 15, 20, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8) !important;
    padding-top: max(4px, env(safe-area-inset-top, 0px)) !important;
    will-change: transform, opacity;
  }

  .chat-panel.chat-panel-opening,
  .chat-panel:not(.hidden):not(.chat-panel-closing) {
    animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

  .chat-panel.chat-panel-closing {
    animation: slideOutRight 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    pointer-events: none !important;
  }

  @keyframes slideInRight {
    from {
      transform: translate3d(100%, 0, 0);
      opacity: 0.6;
    }
    to {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
  }

  @keyframes slideOutRight {
    from {
      transform: translate3d(0, 0, 0);
      opacity: 1;
    }
    to {
      transform: translate3d(100%, 0, 0);
      opacity: 0;
    }
  }

  /* Landscape Mobile/Tablet Emoji Picker bounds */
  .chat-emoji-picker {
    width: calc(100% - 16px) !important;
    left: 8px !important;
    right: 8px !important;
    max-height: min(220px, 60dvh) !important;
    bottom: calc(100% + 4px) !important;
  }

  .emoji-picker-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 4px !important;
  }

  .emoji-item-btn {
    position: relative;
    min-width: 38px !important;
    min-height: 38px !important;
  }

  .chat-action-icon-btn,
  #closeChatBtn,
  .emoji-tab-btn,
  .reaction-item-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* Base transitions so stage and participants smoothly return to full size when chat closes */
  .stage-cinema-group {
    transition: max-width 0.26s cubic-bezier(0.16, 1, 0.3, 1), transform 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .cinema-stage-wrapper {
    transition: max-width 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .participants-tile-area {
    transition: width 0.26s cubic-bezier(0.16, 1, 0.3, 1), padding 0.26s ease !important;
  }

  /* When chat is open, scale the stage group dynamically so movie remains fully visible */
  body.chat-is-open .stage-section {
    padding-right: calc(min(340px, 42vw) + 12px) !important;
    padding-left: max(8px, env(safe-area-inset-left, 8px)) !important;
    transition: padding 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  body.chat-is-open .stage-cinema-group {
    max-width: calc(100vw - min(340px, 42vw) - 36px) !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  body.chat-is-open .cinema-stage-wrapper {
    max-width: calc(100% - 105px) !important;
    margin-left: 0 !important;
  }
  body.chat-is-open:not(.has-participants) .cinema-stage-wrapper,
  body.chat-is-open .stage-cinema-group[data-participant-count="0"] .cinema-stage-wrapper {
    max-width: 100% !important;
  }
  body.chat-is-open .participants-tile-area {
    width: 95px !important;
  }

  body.chat-is-open .hud-select {
    max-width: 32px !important;
  }
  body.chat-is-open .hud-right #speedSelect {
    max-width: 28px !important;
  }
  body.chat-is-open .hud-pill-group {
    padding: 1px 3px !important;
    height: 22px !important;
    font-size: 9px !important;
  }
  body.chat-is-open .hud-icon-btn {
    width: 24px !important;
    height: 24px !important;
    padding: 1px !important;
  }
  body.chat-is-open .hud-circle-btn {
    width: 26px !important;
    height: 26px !important;
  }
  body.chat-is-open .hud-left .hud-time {
    font-size: 9.5px !important;
  }

  /* Horizontal / Landscape Mode for Load / Share Movie Modal (Browse Downward with Scrollbar) */
  #movieModal.modal-overlay,
  .modal-overlay {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 3000 !important;
  }

  #movieModal .modal-card,
  .modal-large {
    max-width: min(640px, calc(100vw - 24px)) !important;
    width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 4px auto !important;
    padding: 12px 18px !important;
    gap: 8px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--blurple) rgba(255, 255, 255, 0.12) !important;
  }

  #movieModal .modal-header-row {
    padding-bottom: 0 !important;
  }
  #movieModal .modal-header-row h3 {
    font-size: 16px !important;
  }

  #movieModal .upload-drop-area {
    padding: 8px 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    border-width: 1.5px !important;
  }
  #movieModal .upload-drop-area svg {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
  }
  #movieModal .upload-drop-area p {
    font-size: 12px !important;
    margin: 0 !important;
  }
  #movieModal .upload-drop-area span {
    font-size: 11px !important;
  }

  #movieModal .movie-items-list {
    max-height: min(220px, 48dvh) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    scrollbar-color: var(--blurple) rgba(255, 255, 255, 0.12) !important;
    padding-right: 6px !important;
    gap: 6px !important;
  }

  #movieModal .movie-card-row {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 7px 12px !important;
    gap: 10px !important;
  }
  #movieModal .movie-card-row .play-btn {
    width: auto !important;
    height: 30px !important;
  }
}

/* Tablet Landscape Mode: Ensure track selects truncate, stage is centered, and HUD controls never overflow */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
  .stage-section {
    overflow: visible;
  }
  .cinema-stage-wrapper {
    margin: 0 auto !important;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    overflow: visible;
  }
  .ambient-glow-wrapper:not(.hidden),
  .cinema-stage-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: -18px !important;
    left: -26px !important;
    right: -26px !important;
    bottom: -18px !important;
    width: calc(100% + 52px) !important;
    height: calc(100% + 36px) !important;
    max-width: none !important;
    display: block;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
  }
  .ambient-glow-wrapper > .ambient-glow-canvas:not(.hidden) {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    display: block;
    filter: blur(40px) saturate(2.3);
    opacity: 0.72;
    pointer-events: none;
    z-index: 0;
  }
  .ambient-glow-canvas:not(.hidden) {
    display: block;
    filter: blur(40px) saturate(2.3);
    opacity: 0.72;
  }
  .hud-select {
    max-width: clamp(54px, 8vw, 84px) !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }
  .hud-right #speedSelect {
    max-width: 48px !important;
  }
  .hud-row {
    flex-wrap: nowrap !important;
  }
  .hud-icon-btn {
    position: relative;
    touch-action: manipulation;
  }
  .hud-icon-btn::after {
    display: none !important;
  }
  .hud-circle-btn {
    position: relative;
    touch-action: manipulation;
  }
  .hud-circle-btn::after {
    display: none !important;
  }
}

/* ==========================================================================
   7. CINEMATIC LANDING & JOIN SCREEN (Inspired by Image 2)
   ========================================================================== */

.landing-page-wrapper {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  background: transparent !important;
  background-image: none !important;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: visible !important;
  -webkit-font-smoothing: antialiased;
}

html {
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100% !important;
  scroll-behavior: smooth;
}

/* Landing page body state - Allows natural window scrolling and exact Stitch obsidian theme */
body:not(.in-room) {
  height: auto !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
  background-color: #07070a !important;
  color: #f1f3f9 !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  user-select: auto !important;
}

body.in-room {
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

/* Top Landing Navigation */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top, 18px)) max(36px, env(safe-area-inset-right, 36px)) 18px max(36px, env(safe-area-inset-left, 36px));
  background: rgba(8, 9, 13, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45), inset 0 -1px 0 0 rgba(255, 255, 255, 0.04);
}

.landing-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #111218;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(255, 8, 68, 0.25);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-logo-mark:hover {
  transform: scale(1.05);
  box-shadow: 0 0 24px rgba(255, 8, 68, 0.45);
}

.brand-logo-mark-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.room-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.room-brand-mark:hover {
  transform: scale(1.06);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  font-family: var(--font-sans);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link-btn {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbdee1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-link-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 4px 14px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.nav-link-btn:active {
  transform: translateY(0);
}

.nav-link-btn.support-highlight {
  color: #ff5270;
  background: rgba(235, 59, 90, 0.12);
  border: 1px solid rgba(235, 59, 90, 0.3);
  box-shadow: 0 0 14px rgba(235, 59, 90, 0.15);
}
.nav-link-btn.support-highlight:hover {
  background: rgba(235, 59, 90, 0.22);
  border-color: rgba(235, 59, 90, 0.45);
  box-shadow: 0 0 20px rgba(235, 59, 90, 0.3);
  color: #fff;
}

.nav-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background-color: rgba(87, 242, 135, 0.1);
  border: 1px solid rgba(87, 242, 135, 0.22);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--green);
}

.pulsing-green-dot {
  width: 7px;
  height: 7px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(87, 242, 135, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(87, 242, 135, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(87, 242, 135, 0); }
}

/* Hero Split Container */
.landing-hero-container {
  max-width: 1220px;
  margin: 0 auto;
  width: 100%;
  padding: 60px 32px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
  flex: 1;
}

.screening-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(254, 231, 92, 0.09);
  border: 1px solid rgba(254, 231, 92, 0.28);
  border-radius: var(--radius-full);
  color: #fee75c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.landing-hero-headline {
  font-size: 54px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: #fff;
  margin-bottom: 20px;
  font-family: var(--font-sans);
}

.coral-gradient-text {
  background: linear-gradient(135deg, #ff3b53 0%, #fa8231 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero-description {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-highlights-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #d1d5db;
}

/* Enter Theater Card */
.enter-theater-card {
  background: linear-gradient(
    145deg,
    rgba(22, 25, 38, 0.78) 0%,
    rgba(14, 16, 26, 0.88) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 16px 0 rgba(255, 8, 68, 0.06),
    0 24px 64px -10px rgba(0, 0, 0, 0.75),
    0 6px 20px 0 rgba(0, 0, 0, 0.4);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.enter-theater-card:hover {
  border-color: rgba(255, 255, 255, 0.26);
  box-shadow: 
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 20px 0 rgba(255, 8, 68, 0.1),
    0 32px 75px -8px rgba(0, 0, 0, 0.85),
    0 8px 24px 0 rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.card-play-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(235, 59, 90, 0.16);
  color: #eb3b5a;
  border: 1px solid rgba(235, 59, 90, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(235, 59, 90, 0.2);
}

.card-title-row h3 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.card-title-row p {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.card-input-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.card-input-group input {
  background: rgba(10, 11, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  padding: 13px 15px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-input-group input:focus {
  border-color: #eb3b5a;
  background: rgba(14, 16, 23, 0.95);
  box-shadow: 0 0 0 3px rgba(235, 59, 90, 0.22), 0 0 16px rgba(235, 59, 90, 0.15);
}

.btn-coral {
  background: linear-gradient(135deg, #e50914 0%, #f43f5e 50%, #e11d48 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: 11px;
  box-shadow: 0 4px 18px rgba(229, 9, 20, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.btn-coral:hover {
  background: linear-gradient(135deg, #f40612 0%, #ff4b6e 50%, #f43f5e 100%);
  box-shadow: 0 6px 26px rgba(229, 9, 20, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1.5px);
}
.btn-coral:active {
  transform: translateY(0.5px);
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.35);
}

.create-room-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 11px;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.card-divider-line {
  display: flex;
  align-items: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.card-divider-line::before,
.card-divider-line::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.card-divider-line span {
  padding: 0 12px;
}

.card-join-row {
  display: flex;
  gap: 8px;
}

.join-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.join-input-wrap input {
  width: 100%;
  background: rgba(10, 11, 16, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  padding: 13px 40px 13px 15px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  outline: none;
  letter-spacing: 0.5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.join-input-wrap input:focus {
  border-color: #5865F2;
  background: rgba(14, 16, 23, 0.95);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25), 0 0 16px rgba(88, 101, 242, 0.15);
}

.dice-btn {
  position: absolute;
  right: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  transition: all 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dice-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  transform: rotate(45deg) scale(1.08);
}
.dice-btn:active {
  transform: scale(0.92) rotate(90deg);
}

.join-btn-submit {
  padding: 0 20px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.join-btn-submit:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}
.join-btn-submit:active {
  transform: translateY(0) scale(0.98);
}

.card-micro-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

/* Landing Footer */
.landing-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 18px));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
.footer-link:hover {
  color: #fff;
}

/* ==========================================================================
   8. ABOUT THE MAKER & STORY PAGE (Matching Images 3, 4, 5)
   ========================================================================== */

.about-page-view {
  position: fixed;
  inset: 0;
  background-color: #08090d;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 8, 68, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 18%, rgba(88, 101, 242, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse at 15% 85%, rgba(247, 37, 133, 0.10) 0%, transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  z-index: 1001;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain;
  user-select: text;
  color: #fff;
  padding-bottom: 80px;
}

.about-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.about-nav-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.about-back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.about-back-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.story-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.story-dot {
  width: 6px;
  height: 6px;
  background-color: #fee75c;
  border-radius: 50%;
}

.about-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

/* Maker Hero Row */
.about-hero-row {
  display: flex;
  align-items: center;
  gap: 40px;
}

.maker-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.maker-avatar-ring {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #eb3b5a, #5865F2);
  box-shadow: 0 0 35px rgba(235, 59, 90, 0.35);
}

.maker-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background-color: #1a1b23;
  display: block;
}

.maker-pill-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #eb3b5a;
  color: #fff;
}

.maker-info-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fee75c;
}

.maker-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #fff;
  line-height: 1.15;
}

.coral-name {
  color: #eb3b5a;
}

.maker-lead-text {
  font-size: 16px;
  line-height: 1.6;
  color: #cbd5e1;
}

.maker-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

/* Special Mention Card */
.special-mention-card {
  display: flex;
  gap: 20px;
  padding: 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(235, 59, 90, 0.08), rgba(22, 23, 29, 0.6));
  border: 1px solid rgba(235, 59, 90, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.mention-heart-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(235, 59, 90, 0.15);
  border: 1px solid rgba(235, 59, 90, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mention-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mention-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #eb3b5a;
}

.mention-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.mention-body p {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

/* Story Sections */
.story-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-num-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.section-heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1.25;
}

.yellow-name { color: #fee75c; }
.green-name { color: #57f287; }
.cyan-name { color: #1abc9c; }

.section-card {
  background: rgba(22, 23, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
}

.story-prose-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: #cbd5e1;
}

.story-prose-card code,
.solution-card code,
.compromise-card code {
  color: #57f287;
  background: rgba(87, 242, 135, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Compromise Grid */
.compromise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.compromise-card {
  background: rgba(22, 23, 29, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compromise-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-icon { background: rgba(235, 59, 90, 0.15); color: #eb3b5a; }
.screen-icon { background: rgba(88, 101, 242, 0.15); color: #5865F2; }
.cloud-icon { background: rgba(254, 231, 92, 0.15); color: #fee75c; }
.sync-icon { background: rgba(26, 188, 156, 0.15); color: #1abc9c; }

.compromise-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #eb3b5a;
}

.compromise-card h4 {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.compromise-card p {
  font-size: 13px;
  line-height: 1.55;
  color: #94a3b8;
  margin-top: 4px;
}

.solution-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
  line-height: 1.65;
  color: #cbd5e1;
  border-color: rgba(87, 242, 135, 0.2);
  background: linear-gradient(135deg, rgba(87, 242, 135, 0.04), rgba(22, 23, 29, 0.7));
}

.diff-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 15px;
  line-height: 1.65;
  color: #cbd5e1;
}

.story-action-buttons {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

/* ==========================================================================
   9. TOP BAR PILL BUTTONS (Inside Theater)
   ========================================================================== */

.top-bar-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.top-bar-pill-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.top-bar-pill-btn.support-pill {
  color: #eb3b5a;
  background: rgba(235, 59, 90, 0.12);
  border-color: rgba(235, 59, 90, 0.3);
}
.top-bar-pill-btn.support-pill:hover {
  background: rgba(235, 59, 90, 0.25);
  color: #fff;
}

/* ==========================================================================
   10. FEEDBACK & SUPPORT MODALS
   ========================================================================== */

.support-modal-card {
  max-width: 480px;
  width: 90%;
  max-height: min(100%, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  gap: 16px;
}

/* ============================================================ */
/* LUMIÈRE FEEDBACK MODAL — OLED OBSIDIAN & CRIMSON PALETTE      */
/* ============================================================ */

.feedback-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: feedbackOverlayIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-modal-card {
  width: 100%;
  max-width: 620px;
  max-height: min(92vh, 880px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: linear-gradient(175deg, rgba(23, 26, 37, 0.94) 0%, rgba(14, 16, 24, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 
    0 0 0 1px rgba(255, 59, 83, 0.08),
    0 30px 80px -10px rgba(0, 0, 0, 0.85),
    0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: #dbdee1;
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  animation: feedbackCardIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes feedbackOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes feedbackCardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feedback-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 59, 83, 0.14);
  border: 1px solid rgba(255, 59, 83, 0.3);
  color: #ff3b53;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.feedback-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.feedback-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #949ba4;
  line-height: 1.4;
}

.feedback-subtitle strong {
  color: #ff3b53;
}

.feedback-close-btn {
  background: transparent;
  border: none;
  color: #949ba4;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.feedback-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.esc-kbd {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: #949ba4;
}

/* Section & Field Labels */
.feedback-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #949ba4;
}

.label-muted {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #6c727f;
}

.feedback-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rating-tier-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ff3b53;
  background: rgba(255, 59, 83, 0.12);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 59, 83, 0.25);
}

/* Category Grid */
.feedback-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (max-width: 480px) {
  .feedback-category-grid {
    grid-template-columns: 1fr;
  }
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbdee1;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.category-pill.active {
  background: rgba(255, 59, 83, 0.12);
  border-color: rgba(255, 59, 83, 0.5);
  box-shadow: 0 4px 16px rgba(255, 59, 83, 0.15);
}

.category-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ff4d6d;
}

.category-pill.active .category-icon {
  background: rgba(255, 59, 83, 0.2);
  color: #ffffff;
}

.category-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.category-text small {
  display: block;
  font-size: 11px;
  color: #949ba4;
}

/* 5-Tier Rating */
.feedback-rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #949ba4;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.rating-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateY(-1px);
}

.rating-btn.active {
  background: rgba(255, 59, 83, 0.15);
  border-color: #ff3b53;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 59, 83, 0.25);
}

.rating-num {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #ff4d6d;
}

.rating-btn.active .rating-num {
  color: #ffffff;
}

/* Textarea & Inputs */
.textarea-wrapper textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 13.5px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 86px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea-wrapper textarea:focus {
  border-color: #ff3b53;
  box-shadow: 0 0 0 2px rgba(255, 59, 83, 0.25), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.textarea-wrapper textarea::placeholder {
  color: #6c727f;
}

.feedback-quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tags-hint {
  font-size: 11px;
  color: #6c727f;
  font-family: 'JetBrains Mono', monospace;
}

.tag-insert-btn {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #949ba4;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tag-insert-btn:hover {
  background: rgba(255, 59, 83, 0.12);
  border-color: rgba(255, 59, 83, 0.4);
  color: #ff3b53;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.input-with-icon svg {
  color: #6c727f;
  flex-shrink: 0;
}

.input-with-icon input {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13.5px;
}

.input-with-icon input::placeholder {
  color: #6c727f;
}

.input-with-icon:focus-within {
  border-color: #ff3b53;
  box-shadow: 0 0 0 2px rgba(255, 59, 83, 0.25);
}

/* Diagnostics Preview */
.feedback-diagnostics-box {
  background: rgba(10, 12, 18, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diagnostics-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diagnostics-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #dbdee1;
  cursor: pointer;
  user-select: none;
}

.diagnostics-checkbox-label input[type="checkbox"] {
  accent-color: #ff3b53;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.safe-badge {
  font-size: 9.5px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid rgba(35, 165, 90, 0.35);
  color: #57F287;
}

.diagnostics-preview-box {
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
}

.diag-key {
  color: #6c727f;
}

.diag-val {
  color: #dbdee1;
}

.diag-disclaimer {
  margin: 6px 0 0;
  font-size: 10.5px;
  color: #6c727f;
  line-height: 1.3;
}

/* Modal Footer & Primary Actions */
.feedback-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary-crimson {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff3b53 0%, #e11d48 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 59, 83, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary-crimson:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 59, 83, 0.5);
  background: linear-gradient(135deg, #ff4d64 0%, #f43f5e 100%);
}

.btn-primary-crimson:active {
  transform: translateY(0) scale(0.98);
}

.feedback-legal-note {
  text-align: center;
  font-size: 11px;
  color: #6c727f;
}

.modal-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Support QR Card */
.qr-showcase-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.qr-scanner-frame {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  background: #101116;
  border: 2px dashed rgba(235, 59, 90, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.support-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.qr-fallback-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 12px;
}

.qr-scan-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
}

.qr-hint-text {
  font-size: 11px;
  color: var(--text-muted);
}

.qr-hint-text code {
  color: #eb3b5a;
  background: rgba(235, 59, 90, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
}

.qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #eb3b5a;
  box-shadow: 0 0 10px #eb3b5a;
  animation: scan-line 3s infinite linear;
}

@keyframes scan-line {
  0% { top: 0%; opacity: 0.2; }
  50% { top: 100%; opacity: 0.8; }
  100% { top: 0%; opacity: 0.2; }
}

.qr-instructions {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  max-width: 340px;
}

.upi-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.upi-id-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.upi-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
}

.upi-value {
  color: #fff;
  font-weight: 700;
  font-family: monospace;
}

.copy-upi-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.maker-verified-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(87, 242, 135, 0.08);
  border: 1px solid rgba(87, 242, 135, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #e0e0e0;
}

.maker-verified-seal a {
  color: #57F287;
  font-weight: 700;
  text-decoration: none;
}

.maker-verified-seal a:hover {
  text-decoration: underline;
}

.upi-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10.5px;
  color: #57F287;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.support-github-cta {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Responsive adjustments for Landing & About */
@media (max-width: 860px) {
  .landing-hero-container {
    grid-template-columns: 1fr;
    padding: 36px 20px;
    gap: 36px;
  }

  .landing-hero-headline {
    font-size: 38px;
  }

  .about-hero-row {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .maker-badges-row {
    justify-content: center;
  }

  .compromise-grid {
    grid-template-columns: 1fr;
  }

  .landing-nav {
    padding: max(14px, env(safe-area-inset-top, 14px)) max(18px, env(safe-area-inset-right, 18px)) 14px max(18px, env(safe-area-inset-left, 18px));
  }

  .landing-nav-actions {
    gap: 8px;
  }

  .landing-nav-actions .nav-link-btn {
    padding: 8px 10px;
    gap: 4px;
  }

  .landing-nav-actions .nav-link-btn span {
    display: none;
  }

  .nav-status-pill {
    display: none;
  }

  .landing-footer-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px 20px max(18px, env(safe-area-inset-bottom, 18px)) 20px;
  }

  .landing-footer-bar .footer-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .landing-hero-container {
    padding: max(20px, env(safe-area-inset-top, 20px)) max(16px, env(safe-area-inset-right, 16px)) max(36px, env(safe-area-inset-bottom, 36px)) max(16px, env(safe-area-inset-left, 16px));
    gap: 24px;
  }

  .landing-hero-headline {
    font-size: clamp(26px, 8vw, 36px);
    letter-spacing: -0.6px;
    line-height: 1.15;
  }

  .landing-hero-description,
  .landing-hero-desc {
    font-size: 14px;
    line-height: 1.55;
  }

  .landing-hero-content,
  .landing-hero-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .enter-theater-card {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .card-input-group input,
  .join-input-wrap input {
    font-size: 16px; /* Prevents auto-zoom in mobile Safari */
    padding: 12px 14px;
  }

  .join-input-wrap input {
    padding-right: 40px;
  }

  .card-title-row {
    margin-bottom: 16px;
    gap: 10px;
  }

  .card-play-icon {
    width: 34px;
    height: 34px;
  }

  .card-form-body {
    gap: 12px;
  }

  .modal-card {
    padding: 20px 16px;
    border-radius: 16px;
    max-height: calc(100dvh - 24px);
  }

  .maker-avatar-ring {
    width: 120px;
    height: 120px;
  }

  .maker-title {
    font-size: 30px;
  }
}

@media (max-height: 700px) and (max-width: 860px) {
  .landing-hero-container {
    padding-top: 16px;
    gap: 20px;
  }

  .enter-theater-card {
    padding: 18px 16px;
  }

  .card-title-row {
    margin-bottom: 12px;
  }

  .card-form-body {
    gap: 10px;
  }
}

/* Tablet Portrait Landing Optimization: elegant centered form width */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: portrait) {
  .landing-hero-container {
    max-width: 720px;
    margin: 0 auto;
    gap: 32px;
  }

  .enter-theater-card {
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
  }
}

/* Mobile & Handheld Landscape Mode for 19:9, 19.5:9, 20:9, 16:9, 5:3 */
@media (orientation: landscape) and (max-height: 520px) {
  .landing-page-wrapper {
    overflow-y: auto;
  }

  .landing-nav {
    padding: max(8px, env(safe-area-inset-top, 8px)) max(18px, env(safe-area-inset-right, 18px)) 8px max(18px, env(safe-area-inset-left, 18px));
  }

  .landing-hero-container {
    display: grid !important;
    grid-template-columns: 1.15fr 0.85fr !important;
    gap: 20px !important;
    padding: 10px max(16px, env(safe-area-inset-right, 16px)) 16px max(16px, env(safe-area-inset-left, 16px)) !important;
    align-items: center !important;
    min-height: calc(100dvh - 56px) !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
  }

  .landing-hero-content,
  .landing-hero-left {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .screening-badge {
    margin-bottom: 6px !important;
    padding: 3px 10px !important;
    font-size: 10px !important;
  }

  .landing-hero-headline {
    font-size: clamp(20px, 3.4vw, 26px) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.4px !important;
  }

  .landing-hero-description,
  .landing-hero-desc {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
  }

  .hero-highlights-row {
    gap: 8px !important;
    margin-top: 2px !important;
  }

  .highlight-item {
    font-size: 11px !important;
    gap: 6px !important;
  }

  .highlight-item svg {
    width: 14px !important;
    height: 14px !important;
  }

  .enter-theater-card {
    padding: 14px 18px !important;
    border-radius: 14px !important;
    max-width: 380px !important;
    margin: 0 auto !important;
    width: 100% !important;
  }

  .card-title-row {
    margin-bottom: 10px !important;
    gap: 8px !important;
  }

  .card-play-icon {
    width: 30px !important;
    height: 30px !important;
  }

  .card-title-row h3 {
    font-size: 15px !important;
  }

  .card-form-body {
    gap: 8px !important;
  }

  .card-input-group label {
    font-size: 10.5px !important;
  }

  .card-input-group input,
  .join-input-wrap input {
    padding: 9px 12px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
  }

  .create-room-btn {
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  .join-btn-submit {
    padding: 0 14px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
  }

  .card-micro-hint {
    font-size: 10px !important;
    margin-top: 1px !important;
  }
}

/* Micro-interaction polish for HUD select dropdowns and buttons */
.hud-pill-group {
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.hud-pill-group:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}
.hud-select {
  cursor: pointer;
  outline: none;
}
.hud-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.5);
  border-radius: 4px;
}

/* ==========================================================================
   STREAMING WATCH PARTY STAGE & MODALS (Netflix, Prime, JioHotstar, Zee5)
   ========================================================================== */

.streaming-player-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #08090d;
  z-index: 5;
  overflow: hidden;
  padding: 24px;
}

.streaming-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(229, 9, 20, 0.15) 0%, rgba(8, 9, 13, 0.95) 75%);
  transition: background 0.5s ease;
  pointer-events: none;
}

.streaming-backdrop.bg-netflix {
  background: radial-gradient(circle at center, rgba(229, 9, 20, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-backdrop.bg-primevideo {
  background: radial-gradient(circle at center, rgba(0, 168, 225, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-backdrop.bg-jiohotstar {
  background: radial-gradient(circle at center, rgba(12, 110, 253, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-backdrop.bg-zee5 {
  background: radial-gradient(circle at center, rgba(130, 48, 198, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-backdrop.bg-disneyplus {
  background: radial-gradient(circle at center, rgba(17, 60, 207, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-backdrop.bg-sonyliv {
  background: radial-gradient(circle at center, rgba(31, 74, 133, 0.22) 0%, rgba(8, 9, 13, 0.95) 75%);
}

.streaming-cinema-card {
  position: relative;
  z-index: 2;
  max-width: 640px;
  width: 100%;
  background: rgba(18, 19, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 32px 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  align-items: center;
  animation: streamFadeIn 0.35s ease-out;
}

@keyframes streamFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.streaming-badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.streaming-platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #ffffff;
  transition: all 0.3s ease;
}

.streaming-platform-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E50914;
}

.streaming-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(87, 242, 135, 0.12);
  border: 1px solid rgba(87, 242, 135, 0.3);
  color: #57F287;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.streaming-content-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
  margin: 4px 0 0;
  letter-spacing: -0.3px;
}

.streaming-content-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #a3a6aa;
  max-width: 520px;
}

.streaming-actions-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
  flex-wrap: wrap;
}

.streaming-launch-action {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
}

.streaming-share-action,
.streaming-ext-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13.5px;
}

.streaming-sync-status-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}

.sync-status-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.sync-status-metric .metric-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #72767d;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sync-status-metric .metric-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.sync-status-metric .metric-value.green {
  color: #57F287;
}

/* Streaming Modal Selector Chips */
.streaming-modal-card {
  max-width: 520px !important;
}

.streaming-platform-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.platform-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #dbdee1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  justify-content: flex-start;
}

.platform-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  transform: translateY(-1px);
}

.platform-chip.active {
  background: rgba(88, 101, 242, 0.18);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.input-hint-sub {
  font-size: 11px;
  color: #72767d;
  margin-top: 3px;
  display: block;
}

/* Extension Guide Modal */
.ext-modal-card {
  max-width: 560px !important;
}

.ext-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0;
  text-align: left;
}

.ext-step-item {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  align-items: flex-start;
}

.ext-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #5865F2;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.ext-step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #dbdee1;
}

.ext-step-content strong {
  color: #ffffff;
  font-size: 14px;
}

.ext-step-content p {
  color: #949ba4;
  line-height: 1.4;
  margin: 0;
}

.ext-step-content code {
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e5a93c;
  font-family: monospace;
}

@media (max-width: 640px) {
  .streaming-cinema-card {
    padding: 20px 16px;
    gap: 12px;
  }
  .streaming-sync-status-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .streaming-platform-selector {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ext-room-badge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.ext-room-info-label {
  font-size: 13px;
  font-weight: 500;
  color: #c9cdfb;
}

.ext-room-code-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ext-room-code-pill {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  background: #111214;
  color: #57f287;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(87, 242, 135, 0.3);
}




/* ==========================================================================
   WINDOWS-STYLE RESIZABLE & REPOSITIONABLE FLOATING WINDOWS
   (Supports both Entire Movie Screen and Participant Webcam Videos)
   ========================================================================== */

/* 1. Hold Indicator Ring (Visual progress feedback before pop-out) */
.video-hold-indicator {
  position: absolute;
  z-index: 2500;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  transition: opacity 0.18s ease;
  user-select: none;
}

.video-hold-indicator.hidden {
  display: none !important;
}

.hold-ring-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hold-progress-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.hold-ring-bg {
  fill: rgba(18, 20, 26, 0.78);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 4px;
}

.hold-ring-progress {
  fill: none;
  stroke: #00d2ff;
  stroke-width: 4.5px;
  stroke-linecap: round;
  stroke-dasharray: 201.06;
  stroke-dashoffset: 201.06;
  filter: drop-shadow(0 0 6px rgba(0, 210, 255, 0.6));
}

.hold-icon-center {
  position: relative;
  z-index: 2;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.hold-tooltip-badge {
  margin-top: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(14, 16, 22, 0.92);
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.video-hold-indicator.hold-success .hold-ring-progress {
  stroke: #20bf6b !important;
  filter: drop-shadow(0 0 10px rgba(32, 191, 107, 0.8)) !important;
}

.video-hold-indicator.hold-success .hold-icon-center {
  transform: scale(1.22);
  color: #20bf6b !important;
}

.video-hold-indicator.hold-success .hold-tooltip-badge {
  border-color: rgba(32, 191, 107, 0.6);
  color: #20bf6b;
}

/* 2. Floating Window State for Entire Movie Screen */
.cinema-stage-wrapper.is-floating-window {
  position: fixed !important;
  z-index: 2200 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
  overflow: visible !important;
  user-select: none;
  min-width: 360px;
  min-height: 220px;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              scale 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              left 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              top 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              height 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, box-shadow;
}

/* Zero-lag direct cursor tracking during window drag and resize */
body.window-dragging-active .cinema-stage-wrapper.is-floating-window,
body.window-resizing-active .cinema-stage-wrapper.is-floating-window,
.cinema-stage-wrapper.is-floating-window.is-dragging-window,
.cinema-stage-wrapper.is-floating-window.is-resizing {
  transition: none !important;
}

.cinema-stage-wrapper.is-floating-window * {
  transition: none !important;
}

.cinema-stage-wrapper.is-floating-window .cinema-box {
  flex: 1 1 0px !important;
  width: 100% !important;
  height: calc(100% - 34px) !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
  position: relative !important;
  cursor: grab;
}

.cinema-stage-wrapper.is-floating-window.is-dragging-window,
.cinema-stage-wrapper.is-floating-window.is-dragging-window .cinema-box,
.cinema-stage-wrapper.is-floating-window .cinema-box:active {
  cursor: grabbing !important;
}

.cinema-stage-wrapper.is-floating-window .cinema-box button,
.cinema-stage-wrapper.is-floating-window .cinema-box select,
.cinema-stage-wrapper.is-floating-window .cinema-box input,
.cinema-stage-wrapper.is-floating-window .cinema-box a,
.cinema-stage-wrapper.is-floating-window .cinema-box .cinema-controls,
.cinema-stage-wrapper.is-floating-window .cinema-box .window-resize-handle {
  cursor: default;
}

.cinema-stage-wrapper.is-floating-window .cinema-video,
.cinema-stage-wrapper.is-floating-window .video-overlay,
.cinema-stage-wrapper.is-floating-window .custom-video-player,
.cinema-stage-wrapper.is-floating-window .stream-player-container {
  width: 100% !important;
  height: 100% !important;
}

.cinema-stage-wrapper.is-floating-window #ambientGlowWrapper,
.cinema-stage-wrapper.is-floating-window #ambientGlowCanvas {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px) !important;
  height: calc(100% + 24px) !important;
  border-radius: 16px;
  pointer-events: none;
  z-index: 0;
  display: block;
}

.cinema-stage-placeholder {
  width: 100%;
  max-width: 1160px;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 250px);
  border: 1.5px dashed rgba(0, 210, 255, 0.35);
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  backdrop-filter: blur(8px);
  margin: 0 auto;
}

.cinema-stage-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #949ba4;
  text-align: center;
  padding: 24px;
}

.placeholder-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.placeholder-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.placeholder-title {
  font-size: 14px;
  font-weight: 700;
  color: #f2f3f5;
  letter-spacing: 0.3px;
}

.placeholder-sub {
  font-size: 12px;
  color: #949ba4;
}

.placeholder-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.4);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.placeholder-dock-btn:hover {
  background: rgba(0, 210, 255, 0.28);
  color: #fff;
  border-color: #00d2ff;
}

/* 3. Floating Window State for Participant Webcam Video Tiles */
.participant-tile.is-floating-window {
  position: fixed !important;
  z-index: 2300 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 12px;
  background: #1e1f22;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.18) !important;
  overflow: visible !important;
  user-select: none;
  min-width: 180px;
  min-height: 120px;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  transition: none !important;
  transform: none !important;
  will-change: auto !important;
  cursor: grab;
}

.participant-tile.is-floating-window.is-dragging-window,
.participant-tile.is-floating-window:active {
  cursor: grabbing !important;
}

.participant-tile.is-floating-window button,
.participant-tile.is-floating-window select,
.participant-tile.is-floating-window input,
.participant-tile.is-floating-window a,
.participant-tile.is-floating-window .tile-vol-btn,
.participant-tile.is-floating-window .tile-volume-popover,
.participant-tile.is-floating-window .window-resize-handle {
  cursor: default;
}

.participant-tile.is-floating-window * {
  transition: none !important;
}

.participant-tile.is-floating-window .tile-video {
  flex: 1 !important;
  width: 100% !important;
  height: calc(100% - 30px) !important;
  object-fit: cover;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-left-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.participant-tile.is-floating-window .tile-avatar-center {
  margin: auto;
}

.participant-tile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #949ba4;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px;
  min-width: 120px;
  min-height: 70px;
  background: rgba(0, 0, 0, 0.25);
}

/* 4. Windows App Title Bar */
.window-title-bar {
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: rgba(22, 24, 34, 0.88);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  cursor: grab;
  user-select: none;
  z-index: 10;
}

.window-title-bar:active,
.is-dragging-window .window-title-bar {
  cursor: grabbing !important;
}

.cinema-stage-wrapper:not(.is-floating-window) .window-title-bar,
.participant-tile:not(.is-floating-window) .window-title-bar {
  display: none !important;
}

.window-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #00d2ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-size-badge {
  font-size: 10px;
  font-weight: 600;
  font-family: monospace;
  color: #949ba4;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.window-title-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: #dbdee1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.window-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.window-dock-btn {
  background: rgba(0, 210, 255, 0.15);
  border-color: rgba(0, 210, 255, 0.35);
  color: #00d2ff;
}

.window-dock-btn:hover {
  background: rgba(0, 210, 255, 0.28);
  border-color: #00d2ff;
  color: #fff;
}

.participant-window-title-bar {
  height: 28px;
  padding: 0 8px;
}
.participant-window-title-bar .window-title-left {
  font-size: 11px;
  color: #57f287;
}

/* 5. 8-Way Windows-Style Resize Handles */
.window-resize-handle {
  position: absolute;
  z-index: 30;
}

.cinema-stage-wrapper:not(.is-floating-window) .window-resize-handle,
.participant-tile:not(.is-floating-window) .window-resize-handle {
  display: none !important;
}

/* Edge Handles */
.window-resize-handle.handle-n {
  top: -5px;
  left: 14px;
  right: 14px;
  height: 10px;
  cursor: ns-resize;
}
.window-resize-handle.handle-s {
  bottom: -5px;
  left: 14px;
  right: 14px;
  height: 10px;
  cursor: ns-resize;
}
.window-resize-handle.handle-e {
  right: -5px;
  top: 14px;
  bottom: 14px;
  width: 10px;
  cursor: ew-resize;
}
.window-resize-handle.handle-w {
  left: -5px;
  top: 14px;
  bottom: 14px;
  width: 10px;
  cursor: ew-resize;
}

/* Corner Handles */
.window-resize-handle.handle-nw {
  top: -5px;
  left: -5px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}
.window-resize-handle.handle-ne {
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  cursor: nesw-resize;
}
.window-resize-handle.handle-sw {
  bottom: -5px;
  left: -5px;
  width: 16px;
  height: 16px;
  cursor: nesw-resize;
}
.window-resize-handle.handle-se {
  bottom: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

/* Classic Windows bottom-right corner grip lines */
.window-resize-handle.handle-se::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, 0.45);
  border-bottom: 2px solid rgba(255, 255, 255, 0.45);
}

/* Highlight edges subtly when hovering */
.is-floating-window:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(0, 210, 255, 0.4) !important;
}

.is-resizing {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.95), 0 0 0 2px #00d2ff !important;
}

body.window-resizing-active,
body.window-dragging-active {
  user-select: none !important;
  cursor: grabbing !important;
}


/* ============================================================ */
/* LUMIÈRE AUDIENCE DISPATCHES / COMMUNITY REVIEWS              */
/* ============================================================ */

/* Filter Pills */
.review-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #949ba4;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.review-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.review-filter-btn.active {
  background: rgba(255, 59, 83, 0.12);
  border-color: rgba(255, 59, 83, 0.45);
  color: #ff3b53;
  box-shadow: 0 2px 12px rgba(255, 59, 83, 0.2);
}

.filter-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  opacity: 0.8;
}

/* Review Cards */
.review-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(23, 26, 37, 0.75) 0%, rgba(14, 16, 24, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 59, 83, 0.3);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(255, 59, 83, 0.15);
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 59, 83, 0.14);
  border: 1px solid rgba(255, 59, 83, 0.3);
  color: #ff3b53;
  font-size: 13px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reviewer-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.reviewer-location {
  font-size: 11px;
  color: #949ba4;
}

.star-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #ff3b53;
  user-select: none;
}

.review-body {
  font-size: 13px;
  line-height: 1.6;
  color: #c4c9d4;
  margin: 0;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.review-tag {
  color: #ff3b53;
  font-weight: 600;
}

.review-metric {
  color: #949ba4;
}

/* ==========================================================================
   MILESTONE 5: VIEWPORT EDGE/CORNER SNAPPING & MINI-PLAYER MODE
   ========================================================================== */

/* Viewport Edge & Corner Snap Guide Overlay */
#windowSnapGuide {
  position: fixed;
  border: 2px dashed rgba(0, 229, 255, 0.85);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35), inset 0 0 12px rgba(0, 229, 255, 0.15);
  background: rgba(0, 229, 255, 0.05);
  border-radius: 12px;
  pointer-events: none;
  z-index: 2400;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#windowSnapGuide.hidden {
  display: none !important;
  opacity: 0;
}

/* Mini-Player Mode: Compact Picture-in-Picture */
.mini-player-active #cinemaStageWrapper,
#cinemaStageWrapper.mini-player-active,
.mini-player-mode {
  position: fixed !important;
  bottom: 90px !important;
  right: 24px !important;
  top: auto !important;
  left: auto !important;
  width: 320px !important;
  height: 180px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 320px !important;
  max-height: 180px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 229, 255, 0.25) !important;
  z-index: 2500 !important;
  overflow: hidden !important;
  margin: 0 !important;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              scale 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease,
              width 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              height 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              right 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
              bottom 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Fluid Motion Spring Physics Active Transition Class */
#cinemaStageWrapper.window-spring-active,
.cinema-stage-wrapper.window-spring-active {
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
              scale 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-radius 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, box-shadow, border-radius;
}

/* Zero-transition lock during active window drag and resize */
body.window-dragging-active #cinemaStageWrapper,
body.window-dragging-active .cinema-stage-wrapper,
body.window-dragging-active .is-floating-window,
body.window-resizing-active #cinemaStageWrapper,
body.window-resizing-active .cinema-stage-wrapper,
body.window-resizing-active .is-floating-window,
#cinemaStageWrapper.is-dragging-window,
#cinemaStageWrapper.is-resizing,
.cinema-stage-wrapper.is-dragging-window,
.cinema-stage-wrapper.is-resizing,
.is-floating-window.is-dragging-window,
.is-floating-window.is-resizing {
  transition: none !important;
}

body.window-dragging-active #cinemaStageWrapper *,
body.window-dragging-active .cinema-stage-wrapper *,
body.window-dragging-active .is-floating-window *,
body.window-resizing-active #cinemaStageWrapper *,
body.window-resizing-active .cinema-stage-wrapper *,
body.window-resizing-active .is-floating-window *,
#cinemaStageWrapper.is-dragging-window *,
#cinemaStageWrapper.is-resizing *,
.cinema-stage-wrapper.is-dragging-window *,
.cinema-stage-wrapper.is-resizing *,
.is-floating-window.is-dragging-window *,
.is-floating-window.is-resizing * {
  transition: none !important;
}

.mini-player-active #cinemaStageWrapper .cinema-box,
#cinemaStageWrapper.mini-player-active .cinema-box {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.mini-player-active #cinemaStageWrapper .cinema-controls-hud,
#cinemaStageWrapper.mini-player-active .cinema-controls-hud,
.mini-player-active #cinemaStageWrapper #cinemaControls,
#cinemaStageWrapper.mini-player-active #cinemaControls,
.mini-player-active #cinemaStageWrapper #cinemaVolumeMeter,
#cinemaStageWrapper.mini-player-active #cinemaVolumeMeter,
.mini-player-active #cinemaStageWrapper .cinema-controls,
#cinemaStageWrapper.mini-player-active .cinema-controls,
.mini-player-active #cinemaStageWrapper .window-title-bar,
#cinemaStageWrapper.mini-player-active .window-title-bar,
.mini-player-active #cinemaStageWrapper .window-resize-handle,
#cinemaStageWrapper.mini-player-active .window-resize-handle {
  display: none !important;
}

/* Quick Mini Controls Overlay */
.mini-player-controls-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2510;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mini-player-active #cinemaStageWrapper:hover .mini-player-controls-overlay,
#cinemaStageWrapper.mini-player-active:hover .mini-player-controls-overlay {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mini-control-btn {
  background: rgba(20, 24, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.mini-control-btn:hover {
  background: rgba(0, 229, 255, 0.25);
  border-color: rgba(0, 229, 255, 0.6);
  transform: scale(1.08);
}

.mini-control-btn.exit-mini-btn {
  background: rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.5);
  color: #00e5ff;
}

.mini-control-btn.exit-mini-btn:hover {
  background: rgba(0, 229, 255, 0.4);
}

/* ==========================================================================
   PLAN B: DOUBLE-TAP SEEK OVERLAY & TIMELINE TOOLTIP
   ========================================================================== */
.double-tap-seek-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}

.seek-ripple-container {
  width: 40%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.seek-ripple-circle {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  transform: scale(0.6);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.seek-ripple-left .seek-ripple-circle {
  border-top-right-radius: 50%;
  border-bottom-right-radius: 50%;
  margin-left: 20px;
}

.seek-ripple-right .seek-ripple-circle {
  border-top-left-radius: 50%;
  border-bottom-left-radius: 50%;
  margin-right: 20px;
}

.seek-ripple-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.seek-ripple-container.active-ripple {
  opacity: 1;
}

.seek-ripple-container.active-ripple .seek-ripple-circle {
  transform: scale(1.1);
  animation: seekRipplePulse 0.55s ease forwards;
}

@keyframes seekRipplePulse {
  0% { transform: scale(0.7); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.0); opacity: 0; }
}

/* Timeline Hover Tooltip with Remaining Time */
.hud-hover-tooltip {
  position: absolute;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(14, 16, 24, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  z-index: 30;
  display: none;
  gap: 4px;
  align-items: center;
  transition: opacity 0.12s ease;
}

.hud-hover-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(14, 16, 24, 0.94) transparent transparent transparent;
}

.hover-time-text {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.hover-time-slash {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.hover-time-rem {
  color: #00e5ff;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

/* Cinema Lights-Dimming Focus Mode */
.cinema-focus-mode #topBar {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-10px) !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.cinema-focus-mode .floating-pill-dock {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, 20px) !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.cinema-focus-mode #cinemaControls {
  opacity: 0 !important;
  pointer-events: none !important;
}

.cinema-focus-mode .participants-tile-area {
  opacity: 0.16 !important;
  transition: opacity 0.5s ease !important;
}

.cinema-focus-mode .participants-tile-area:hover {
  opacity: 1 !important;
}

.cinema-focus-mode .cinema-stage-wrapper {
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.9) !important;
}

/* ==========================================================================
   PLAN A: PARTICIPANT QUICK CONTROLS, NETWORK QUALITY & INVITE TILE
   ========================================================================== */

/* Network Quality Signal Indicator */
.tile-network-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(10, 12, 18, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
  font-size: 9px;
  font-weight: 700;
  color: #949ba4;
  cursor: default;
  transition: opacity 0.15s ease;
}

.tile-network-badge .net-bar {
  width: 3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.25);
  transition: background-color 0.2s ease, height 0.2s ease;
}

.tile-network-badge .net-bar-1 { height: 4px; }
.tile-network-badge .net-bar-2 { height: 8px; }
.tile-network-badge .net-bar-3 { height: 12px; }

.tile-network-badge.net-good .net-bar-1,
.tile-network-badge.net-good .net-bar-2,
.tile-network-badge.net-good .net-bar-3 {
  background: #23a55a;
}

.tile-network-badge.net-fair .net-bar-1,
.tile-network-badge.net-fair .net-bar-2 {
  background: #f59e0b;
}

.tile-network-badge.net-poor .net-bar-1 {
  background: #f23f43;
}

.tile-network-badge .net-latency-text {
  margin-left: 3px;
  font-size: 8.5px;
  color: #dbdee1;
}

/* Participant Quick Action Popover */
.participant-quick-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 12;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.participant-tile:hover .participant-quick-menu,
.participant-tile:focus-within .participant-quick-menu,
.participant-tile.menu-open .participant-quick-menu {
  opacity: 1;
}

.quick-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(20, 24, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #dbdee1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.quick-action-btn:hover {
  background: rgba(88, 101, 242, 0.9);
  color: #fff;
  transform: scale(1.08);
}

.quick-action-btn.active-action {
  background: #5865F2;
  color: #fff;
  border-color: #7983f5;
}

.quick-action-btn.danger-action:hover {
  background: #f23f43;
  border-color: #f23f43;
}

/* Spotlighted Participant Tile */
.participant-tile.is-spotlighted {
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), 0 4px 18px rgba(0, 0, 0, 0.6) !important;
  transform: scale(1.03);
  z-index: 8;
}



/* ==========================================================================
   UNIVERSAL MOBILE & TABLET ZERO-OVERLAP RESPONSIVE OPTIMIZATION
   ========================================================================== */

/* Dynamic viewport height scaling */
html, body, .app-container {
  min-height: 100dvh;
}

/* Mobile Portrait Safety & Zero Overlap */
@media (max-width: 768px) and (orientation: portrait) {
  .participants-bottom-area {
    padding-bottom: 84px !important;
    margin-bottom: 0 !important;
  }
  
  .floating-pill-dock {
    max-width: min(512px, calc(100vw - 128px)) !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
  
  .floating-pill-dock .pill-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
  }
  
  .participant-tile {
    width: min(320px, calc(100vw - 28px)) !important;
    max-width: 320px !important;
    height: 154px !important;
  }

  .chat-panel {
    width: 100% !important;
    max-width: 100% !important;
    height: 100dvh !important;
    z-index: 2200 !important;
  }

  /* Cinema Stage Lounge Mobile Portrait Optimization */
  .cinema-stage-wrapper:has(#stagePlaceholder:not(.hidden)) {
    min-height: clamp(250px, 38dvh, 320px);
    aspect-ratio: auto;
  }

  .stage-placeholder.stage-lounge {
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
  }

  .stage-lounge-halo {
    width: min(280px, 75vw);
    height: min(280px, 75vw);
    filter: blur(28px);
  }

  .stage-lounge-card {
    max-width: min(440px, calc(100% - 20px));
    width: 100%;
    padding: 18px 20px;
    border-radius: 18px;
    gap: 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .stage-avatar-wrapper {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    flex-shrink: 0;
  }

  .stage-center-avatar-box {
    width: 64px;
    height: 64px;
    border-width: 2.5px;
  }

  .stage-avatar-mic-badge {
    width: 24px;
    height: 24px;
    border-width: 2px;
  }

  .stage-avatar-mic-badge svg {
    width: 11px;
    height: 11px;
  }

  .stage-badge-row {
    margin-bottom: 6px;
  }

  .stage-status-pill {
    padding: 3px 9px;
    font-size: 9.5px;
    gap: 5px;
    letter-spacing: 0.04em;
  }

  .stage-status-dot {
    width: 5px;
    height: 5px;
  }

  .stage-lounge-title {
    font-size: 18px;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
  }

  .stage-lounge-subtext {
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 12px;
    max-width: 340px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stage-lounge-actions {
    width: auto;
  }

  .btn-stage-primary {
    font-size: 13.5px;
    padding: 10px 20px;
    min-height: 44px;
    border-radius: 10px;
    gap: 8px;
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }

  .btn-stage-primary svg {
    width: 16px;
    height: 16px;
  }

  /* Live Reactions Dock Tray Mobile Portrait Optimization */
  .dock-reactions-menu,
  .dock-reactions-tray,
  .device-menu.dock-reactions-menu,
  #dockReactionsTray {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(66px + env(safe-area-inset-bottom, 10px)) !important;
    padding: 5px 8px !important;
    border-radius: 22px !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 2700 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .dock-reactions-items {
    gap: 4px !important;
  }

  .dock-reaction-item {
    padding: 4px !important;
    flex-shrink: 0 !important;
  }

  .dock-reaction-item svg {
    width: 18px !important;
    height: 18px !important;
  }
}

/* Mobile & Tablet Landscape Safety (Short Viewports) */
@media (orientation: landscape) and (max-height: 600px) {
  .stage-section {
    padding: 4px 8px !important;
    gap: 4px !important;
  }

  .cinema-stage-wrapper {
    max-height: calc(100dvh - 96px) !important;
  }

  /* Live Reactions Dock Tray Mobile Landscape Optimization */
  .dock-reactions-menu,
  .dock-reactions-tray,
  .device-menu.dock-reactions-menu,
  #dockReactionsTray {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(52px + env(safe-area-inset-bottom, 6px)) !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    max-width: calc(100vw - 16px) !important;
    z-index: 2700 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .dock-reactions-items {
    gap: 4px !important;
  }

  .dock-reaction-item {
    padding: 4px !important;
    flex-shrink: 0 !important;
  }

  .dock-reaction-item svg {
    width: 17px !important;
    height: 17px !important;
  }

  /* Cinema Stage Lounge Mobile Landscape Optimization */
  .stage-placeholder.stage-lounge {
    padding: 6px 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: center !important;
  }

  .stage-lounge-halo {
    width: min(240px, 50vh) !important;
    height: min(240px, 50vh) !important;
    filter: blur(24px) !important;
  }

  .stage-lounge-card {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    max-width: min(640px, calc(100% - 20px)) !important;
    width: auto !important;
    padding: 10px 18px !important;
    gap: 14px !important;
    border-radius: 14px !important;
    max-height: calc(100% - 12px) !important;
  }

  .stage-avatar-wrapper {
    width: 50px !important;
    height: 50px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .stage-center-avatar-box {
    width: 50px !important;
    height: 50px !important;
    border-width: 2px !important;
  }

  .stage-avatar-mic-badge {
    width: 20px !important;
    height: 20px !important;
    border-width: 2px !important;
  }

  .stage-avatar-mic-badge svg {
    width: 10px !important;
    height: 10px !important;
  }

  .stage-lounge-details {
    align-items: flex-start !important;
    text-align: left !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .stage-badge-row {
    margin-bottom: 2px !important;
  }

  .stage-status-pill {
    font-size: 8.5px !important;
    padding: 2px 7px !important;
    gap: 4px !important;
    letter-spacing: 0.04em !important;
  }

  .stage-status-dot {
    width: 5px !important;
    height: 5px !important;
  }

  .stage-lounge-title {
    font-size: 15px !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .stage-lounge-subtext {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin-bottom: 0 !important;
    max-width: 320px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .stage-lounge-actions {
    flex-shrink: 0 !important;
  }

  .btn-stage-primary {
    font-size: 12px !important;
    padding: 8px 14px !important;
    min-height: 40px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    gap: 6px !important;
  }

  .btn-stage-primary svg {
    width: 15px !important;
    height: 15px !important;
  }

  .floating-pill-dock {
    bottom: 6px !important;
    padding: 4px 10px !important;
    border-radius: 18px !important;
    gap: 8px !important;
    background: rgba(14, 16, 24, 0.92) !important;
    max-width: calc(100vw - 12px) !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .floating-pill-dock .pill-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }

  .floating-pill-dock .pill-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  .participants-bottom-area {
    padding-bottom: 50px !important;
    margin-top: 4px !important;
  }

  .participant-tile {
    width: 180px !important;
    height: 98px !important;
    min-width: 140px !important;
  }

  .participant-tile .tile-avatar-center {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }

  .hud-timeline-container {
    padding: 6px 0 !important;
  }

  .hud-row {
    padding: 2px 8px !important;
  }

  .participant-quick-menu {
    top: 4px !important;
    right: 4px !important;
  }
  
  .quick-action-btn {
    width: 22px !important;
    height: 22px !important;
  }
}

/* Narrow Landscape or Short Landscape Height Adaptation */
@media (orientation: landscape) and (max-width: 560px), (orientation: landscape) and (max-height: 360px) {
  .stage-lounge-card {
    flex-wrap: wrap !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 8px 12px !important;
  }

  .stage-lounge-details {
    align-items: center !important;
    text-align: center !important;
  }

  .stage-lounge-subtext {
    display: none !important;
  }

  .btn-stage-primary {
    min-height: 38px !important;
    padding: 6px 12px !important;
    font-size: 11.5px !important;
  }
}

/* Tablet Portrait & Landscape Scaling (768px - 1024px with height > 600px) */
@media (min-width: 768px) and (max-width: 1024px) and (min-height: 601px) {
  .participants-bottom-area {
    padding-bottom: 76px !important;
  }

  .floating-pill-dock {
    bottom: 16px !important;
    gap: 10px !important;
  }

  .floating-pill-dock .pill-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }

  /* Live Reactions Dock Tray Tablet Optimization */
  .dock-reactions-menu,
  .dock-reactions-tray,
  .device-menu.dock-reactions-menu,
  #dockReactionsTray {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 12px)) !important;
    padding: 6px 12px !important;
    border-radius: 26px !important;
    max-width: min(520px, calc(100vw - 32px)) !important;
    z-index: 2700 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .dock-reactions-items {
    gap: 6px !important;
  }

  .dock-reaction-item {
    padding: 5px !important;
    flex-shrink: 0 !important;
  }

  .dock-reaction-item svg {
    width: 20px !important;
    height: 20px !important;
  }

  .participant-tile {
    min-height: 140px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .participant-tile,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .participant-tile {
    width: min(340px, 70vw) !important;
    max-width: 340px !important;
    height: 180px !important;
    max-height: 180px !important;
  }

  .stage-cinema-group[data-participant-count="1"] .tile-avatar-center,
  .stage-section:not([data-participant-count]) .participants-row:has(.participant-tile:only-child) .tile-avatar-center {
    width: 80px !important;
    height: 80px !important;
    font-size: 30px !important;
  }

  /* Cinema Stage Lounge Tablet Scaling */
  .stage-lounge-card {
    max-width: min(600px, 80vw) !important;
    padding: 28px 36px !important;
    border-radius: 20px !important;
  }

  .stage-avatar-wrapper {
    width: 76px !important;
    height: 76px !important;
    margin-bottom: 14px !important;
  }

  .stage-center-avatar-box {
    width: 76px !important;
    height: 76px !important;
  }

  .stage-avatar-mic-badge {
    width: 25px !important;
    height: 25px !important;
  }

  .stage-lounge-title {
    font-size: 21px !important;
    margin-bottom: 6px !important;
  }

  .stage-lounge-subtext {
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    margin-bottom: 18px !important;
    max-width: 420px !important;
  }

  .btn-stage-primary {
    font-size: 14px !important;
    padding: 11px 24px !important;
    min-height: 44px !important;
  }
}

/* ==========================================================================
   Ultra-Narrow Device Optimization (JioPhone 240px, Galaxy Z Fold Cover 344px)
   ========================================================================== */
@media (max-width: 340px) {
  .top-bar {
    height: 40px !important;
    padding: 0 4px !important;
    gap: 3px !important;
  }

  .room-heading {
    font-size: 12px !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .floating-pill-dock {
    padding: 2px 4px !important;
    gap: 3px !important;
    max-width: calc(100vw - 120px) !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .floating-pill-dock .pill-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
  }

  .floating-pill-dock .pill-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .floating-pill-dock .pill-chevron-btn,
  .floating-pill-dock #micDeviceDropdownBtn,
  .floating-pill-dock #micDeviceBtn,
  .floating-pill-dock #camDeviceDropdownBtn,
  .floating-pill-dock #camDeviceBtn {
    position: absolute !important;
    bottom: -2px !important;
    right: -2px !important;
    width: 13px !important;
    height: 13px !important;
    border-radius: var(--radius-full) !important;
    border: 1.5px solid var(--bg-surface) !important;
    background-color: var(--bg-tertiary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
  }

  .floating-pill-dock .pill-chevron-btn svg,
  .floating-pill-dock #micDeviceDropdownBtn svg,
  .floating-pill-dock #camDeviceDropdownBtn svg {
    width: 7px !important;
    height: 7px !important;
    stroke-width: 3;
    pointer-events: none !important;
  }

  .stage-lounge-card {
    padding: 8px 10px !important;
    max-width: calc(100% - 8px) !important;
  }

  .stage-lounge-title {
    font-size: 13px !important;
  }

  .stage-lounge-subtext {
    font-size: 9.5px !important;
    max-width: 190px !important;
  }

  .btn-stage-primary {
    font-size: 11px !important;
    padding: 6px 10px !important;
    min-height: 38px !important;
  }
}

/* ==========================================================================
   Foldables & Dual-Screen Near-Square Aspect Ratio Optimization (~4:3 and 1:1)
   ========================================================================== */
@media (min-width: 600px) and (max-width: 950px) and (min-height: 650px) and (max-height: 950px) {
  .cinema-stage-wrapper {
    max-height: 48dvh !important;
  }

  .stage-section {
    padding-bottom: 70px !important;
  }
}

/* ==========================================================================
   Push-to-Talk (PTT) HUD & Dock Styles
   ========================================================================== */
.ptt-hud-badge {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  border: 1.5px solid #57F287;
  color: #57F287;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(87, 242, 135, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  pointer-events: none;
  animation: pttGlow 1.5s ease-in-out infinite alternate;
}

.ptt-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #57F287;
  box-shadow: 0 0 10px #57F287;
  animation: pttPulse 0.8s ease-in-out infinite alternate;
}

@keyframes pttPulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

@keyframes pttGlow {
  0% { box-shadow: 0 4px 14px rgba(87, 242, 135, 0.25); }
  100% { box-shadow: 0 4px 24px rgba(87, 242, 135, 0.55); }
}

.ptt-active-dock {
  position: relative;
}

.ptt-active-dock::after {
  content: 'PTT';
  position: absolute;
  top: -5px;
  right: -3px;
  background: #5865F2;
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.1;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Movie Theater Buffering HUD
   ========================================================================== */
.movie-buffering-hud {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: rgba(10, 14, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 45;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.movie-buffering-hud.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.92);
}

.movie-spinner-ring {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: movieSpinnerRotate 0.75s linear infinite;
}

@keyframes movieSpinnerRotate {
  to {
    transform: rotate(360deg);
  }
}



