@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Roboto:wght@400;500&family=SF+Mono&display=swap');

:root {
  /* ═══════════════════════════════════════════════════════
     ТЕМА: DEFAULT DARK (Материал You, тёмная)
     Чтобы поменять тему — измените значения переменных ниже
     или подключите файл themes.css и добавьте класс на <html>
     ═══════════════════════════════════════════════════════ */

  /* — Фоны и поверхности — */
  --color-bg:                 #141218;
  --color-surface:            #141218;
  --color-surface-container:  #1D1B20;
  --color-surface-high:       #2B2930;
  --color-surface-highest:    #36343B;
  --color-surface-island:     #2B2930;
  --color-surface-input:      #201E24;
  --color-surface-card:       #1E1F22;
  --color-surface-overlay:    #211E26;
  --color-surface-toast:      #312E3A;

  /* — Основной акцент (primary) — */
  --color-primary:            #D0BCFF;
  --color-primary-dim:        #EADDFF;
  --color-primary-container:  #4F378B;
  --color-primary-on:         #381E72;

  /* — Вторичный акцент — */
  --color-secondary-container: #4A4458;
  --color-secondary-on:        #E8DEF8;

  /* — Tertiary / розовый — */
  --color-tertiary:           #EFB8C8;
  --color-tertiary-on:        #492532;

  /* — Текст — */
  --color-text:               #E6E0E9;
  --color-text-muted:         #CAC4D0;
  --color-text-bright:        #fff;
  --color-text-disabled:      #888;
  --color-text-hint:          #666;

  /* — Обводки / разделители — */
  --color-outline:            #938F99;
  --color-outline-variant:    #49454F;
  --color-divider:            rgba(255,255,255,0.06);
  --color-divider-strong:     rgba(255,255,255,0.1);

  /* — Статусные цвета — */
  --color-success:            #4ade80;
  --color-success-dim:        #a5f5c8;
  --color-success-bg:         rgba(74,222,128,0.1);
  --color-success-border:     rgba(74,222,128,0.35);
  --color-success-glow:       rgba(74,222,128,0.5);
  --color-warning:            #f59e0b;
  --color-warning-dim:        #fbbf24;
  --color-warning-bg:         rgba(245,158,11,0.1);
  --color-warning-border:     rgba(245,158,11,0.35);
  --color-warning-glow:       rgba(245,158,11,0.5);
  --color-error:              #F2B8B5;
  --color-error-solid:        #ef4444;
  --color-error-bg:           rgba(239,68,68,0.1);
  --color-error-border:       rgba(239,68,68,0.35);
  --color-error-on:           #601410;

  /* — Специальные цвета — */
  --color-youtube:            #FF0000;
  --color-danger:             #984061;

  /* — Скроллбар — */
  --color-scrollbar-track:    #1a1a1a;
  --color-scrollbar-thumb:    #333;
  --color-scrollbar-hover:    #444;

  /* — Типографика — */
  --font-ui:                  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand:               'Montserrat', sans-serif;
  --font-label:               'Roboto', sans-serif;
  --font-mono:                'SF Mono', 'Fira Code', monospace;

  /* — Форма / скругления — */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   28px;
  --radius-full: 100px;

  /* — Анимации — */
  --easing-emphasized: cubic-bezier(0.2, 0.0, 0, 1.0);
  --duration-long:     0.5s;

  /* ── Алиасы (для обратной совместимости с M3) ── */
  --md-sys-color-background:            var(--color-bg);
  --md-sys-color-surface:               var(--color-surface);
  --md-sys-color-surface-container:     var(--color-surface-container);
  --md-sys-color-surface-container-high:    var(--color-surface-high);
  --md-sys-color-surface-container-highest: var(--color-surface-highest);
  --md-sys-color-primary:               var(--color-primary);
  --md-sys-color-on-primary:            var(--color-primary-on);
  --md-sys-color-primary-container:     var(--color-primary-container);
  --md-sys-color-on-primary-container:  var(--color-primary-dim);
  --md-sys-color-secondary-container:   var(--color-secondary-container);
  --md-sys-color-on-secondary-container: var(--color-secondary-on);
  --md-sys-color-tertiary:              var(--color-tertiary);
  --md-sys-color-on-tertiary:           var(--color-tertiary-on);
  --md-sys-color-on-surface:            var(--color-text);
  --md-sys-color-on-surface-variant:    var(--color-text-muted);
  --md-sys-color-outline:               var(--color-outline);
  --md-sys-color-outline-variant:       var(--color-outline-variant);
  --md-sys-color-error:                 var(--color-error);
  --md-sys-color-on-error:              var(--color-error-on);
  --md-sys-shape-corner-medium:         var(--radius-md);
  --md-sys-shape-corner-large:          var(--radius-lg);
  --md-sys-shape-corner-extra-large:    var(--radius-xl);
  --md-sys-shape-corner-full:           var(--radius-full);
  --md-sys-motion-easing-emphasized:    var(--easing-emphasized);
  --md-sys-motion-duration-long2:       var(--duration-long);
}
/* --- CSS: Вставить/Заменить в style.css --- */

svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
  
  pointer-events: none;
  
  transition: transform 0.3s ease, opacity 0.3s ease;
}
/* 1. Исправление кнопки "Пригласить" (анимация галочки) */

/* Когда скопировано */
/* 2. Исправление кнопок управления (нижняя панель) */

.control-btn svg {
  width: 28px;
  height: 28px;
}

/* Stroke-стиль для иконок демонстрации экрана */
#shareBtn svg,
#stopShareBtn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 24px;
  height: 24px;
}

.control-btn.hang-btn svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}
/* 3. Исправление кнопки Микрофона (там сложная анимация) */

/* 4. Исправление кнопок главного меню (большие круги) */


.btn-icon-bg svg {
  width: 32px;
  height: 32px;
}
/* 5. Исправление выпадающего меню (стрелочка) */
/* Вращение спиннера */
.animate-spin {
  animation: spin 1s linear infinite;
  transform-origin: center;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: var(--color-scrollbar-track);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar-thumb);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-hover);
}

html {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}
/* --- Canvas & Layout --- */

.background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

.container {
  max-width: 440px;
  width: 100%;
  position: relative;
  z-index: 20000 !important;
}

.app-background::before {
  display: none;
}

.hidden {
  display: none !important;
}
/* --- Header / Island Style --- */

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  min-height: 40px;
  top: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body.mode-call .app-header {
  position: fixed !important;
  top: 24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  height: 56px !important;
  width: auto !important;
  min-width: 220px;
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center !important;
  gap: 12px !important; /* Отступ между каплями */
  padding: 0 !important;
  margin: 0 !important;
  z-index: 22000;
  
  /* Делаем родитель прозрачным */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Десктопные капли */
.main-island { display: contents; }
body.mode-call .main-island {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 8px 12px 8px 20px !important;
  background: var(--color-surface-high) !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}

body.mode-call .header-extras-btn {
  margin: 0 !important;
  height: 100% !important;
  padding: 0 16px !important;
  background: var(--color-surface-high) !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
  border: none !important;
}

body.mode-call .header-extras-btn:hover {
  background: var(--color-surface-highest) !important;
}

.app-header-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

body.mode-call .app-header-right {
  position: static !important;
  transform: none !important;
  margin-left: 0 !important;
  padding: 0 !important;
  height: auto;
  width: auto;
}

.app-header h1 {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  margin: 0;
  pointer-events: auto;
}

body.mode-call .app-header h1 {
  display: none !important;
}
/* Разделитель */
.header-separator {
  width: 1px;
  height: 24px;
  background-color: var(--color-outline-variant);
  /* Outline Variant */
  margin: 0 4px;
  display: none;
}

body.mode-call .header-separator:not(.hidden) {
  display: block;
}
/* --- Элементы внутри островка --- */
/* Таймер */
/* Бейдж участников */
/* --- КНОПКА ПРИГЛАШЕНИЯ (M3 Filled/Tonal Button) --- */
.header-invite-btn {
  display: flex;
  align-items: center;
  gap: 10px;

  
  background: #3c3a42 !important;
  

  color: var(--color-secondary-on) !important;
  

  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 0 20px 0 16px;
  
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.2, 0.0, 0, 1.0);
  height: 44px;
  /* Larger touch target */
  margin-left: 8px;

  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;

  overflow: hidden;
  position: relative;
}

.header-invite-btn:hover {
  background: var(--color-secondary-container) !important;
  
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.header-invite-btn:active {
  transform: scale(0.96) translateY(0);
  background: #433e4f !important;
}.invite-icon-box {
  width: 24px;
  height: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: inherit;
}.invite-icon-box svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}
.invite-icon-box .icon-link {
  opacity: 1;
}.invite-icon-box .icon-check {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5) rotate(-45deg);
}
/* === STATE: COPIED === */
.header-invite-btn.copied {
  
  background: #203e31 !important;
  
  color: var(--color-success-dim) !important;
  /* Light Green Text */
  border-color: #2d5a45 !important;
  padding-right: 24px;
  
}

.header-invite-btn.copied:hover {
  background: #254939 !important;
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}.header-invite-btn.copied .icon-link {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5) rotate(45deg);
}.header-invite-btn.copied .icon-check {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  stroke: var(--color-success) !important;
  fill: var(--color-success);
}

.header-invite-btn.copied .invite-text {
  color: var(--color-success-dim) !important;
}

.invite-text {
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  padding-right: 0;
  transition: color 0.3s ease;
}

.header-invite-btn.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  /* ── ТОП-ОСТРОВКИ (МОБИЛЬНАЯ ВЕРСИЯ) ── */
  body.mode-call .app-header {
    position: fixed !important;
    top: 20px !important; left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important; height: 48px !important;
    margin: 0 !important; z-index: 22000 !important;
    display: inline-flex !important;
    align-items: center !important; justify-content: center !important;
    flex-wrap: nowrap !important; white-space: nowrap !important;
    gap: 10px !important;
    padding: 0 !important;
    /* Убираем фон родителя */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mode-call .main-island,
  body.mode-call .header-extras-btn {
    background: rgba(28,25,36,0.92) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 28px rgba(0,0,0,0.55) !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
  }

  body.mode-call .main-island {
    padding: 10px 18px !important; gap: 10px !important;
  }

  body.mode-call .header-extras-btn {
    padding: 0 16px !important;
    justify-content: center !important;
  }
}
/* --- Timers & Badges --- */.call-timer {
  font-family: 'Roboto', sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: var(--color-text) !important;
  padding: 0 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1px !important;
  position: static !important;
  transform: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  opacity: 1;
  margin: 0 !important;
  height: auto !important;
  min-width: auto !important;
  border-left: none !important;
  border-radius: 0 !important;
  line-height: 1 !important;
}

.call-timer.hidden {
  display: none !important;
}

.participant-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--md-sys-color-secondary-container) !important;
  color: var(--md-sys-color-on-primary-container) !important;
  border: none !important;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  margin-top: 8px;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
body.mode-call .participant-badge svg {
  width: 18px !important;
  height: 18px !important;
  margin-right: 6px;
  stroke-width: 2px;
  opacity: 1;
  display: block;
}

body.mode-call .participant-badge span {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  margin: 0;
}body.mode-call .participant-badge.full {
  color: var(--color-primary) !important;
}

body.mode-call .participant-badge.full svg {
  opacity: 1;
}

.participant-badge.hidden {
  display: none;
}

.participant-badge:not(.full):not(.hidden) {
  
  animation: none;
}

.participant-badge.pop-anim {
  animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
@keyframes badgePop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  
  100% {
    transform: scale(1);
  }
}

.participant-badge.exit-anim {
  animation: badgeExit 0.5s cubic-bezier(0.33, 1, 0.68, 1) !important;
}
@keyframes badgeExit {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(0.85);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
  }
}
/* --- Auth & User Badge --- */

#authSection {
  background: var(--color-surface-high) !important;   
  border-radius: 20px !important;
  border: none !important;
  padding: 14px 18px !important;
  margin-bottom: 16px !important;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: none !important;
  transition: none;
}

#authStatus {
  color: var(--color-text-muted) !important;
  font-family: 'Roboto', sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  text-align: left !important;
  max-width: 190px;
}

#authStatus strong {
  color: var(--color-primary) !important;
  font-weight: 600 !important;
}

#telegramLoginContainer {
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* === USER BADGE — flat pill, Secondary Container === */
.user-badge {
  background: var(--color-secondary-container) !important;   
  border: none !important;
  border-radius: var(--radius-full) !important;
  padding: 5px 16px 5px 5px !important;
  color: var(--color-secondary-on) !important;
  font-family: 'Roboto', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  display: flex;
  align-items: center;
  gap: 10px !important;
  cursor: default !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s ease !important;
}

.user-badge:hover {
  background: #524E62 !important;
  transform: scale(1.04) !important;
}

.user-badge:active {
  transform: scale(0.96) !important;
}

.user-avatar {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  border: none !important;
  object-fit: cover !important;
  display: block;
}

.user-badge-icon {
  width: 30px !important;
  height: 30px !important;
  background: #6B5A8E !important;   
  color: var(--color-primary-dim) !important;
  border: none !important;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-badge-icon svg {
  width: 16px !important;
  height: 16px !important;
  fill: currentColor !important;
}

.user-badge-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 !important;
}

.user-badge.hidden,
.user-avatar.hidden,
.user-badge-icon.hidden {
  display: none !important;
}
/* --- Menu Card & Interface --- */

.menu-card {
  background: var(--color-surface-overlay) !important;
  border-radius: var(--radius-xl) !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px !important;
  margin-bottom: 20px;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

body.mode-call .menu-card {
  display: none;
}

.card,
.settings-panel,
.create-screen,
.join-screen {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.create-screen,
.join-screen {
  display: none;
}

.create-screen.active {
  display: block;
}

.join-screen.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s cubic-bezier(0.2, 0.0, 0, 1.0);
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* --- Mode Buttons (M3 Expressive Redesign) --- */

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
/* Базовая кнопка */
.mode-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 20px 20px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  border: none !important;
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.2s ease !important;
}

.mode-btn:active {
  transform: scale(0.95) !important;
  transition-duration: 0.1s !important;
}
/* === КНОПКА 1: "Новая встреча" — Primary Container, большое скругление === */
.mode-btn.mode-create {
  background: var(--color-primary-container) !important;   
  border-radius: 20px 20px 8px 20px !important;  
  color: var(--color-primary-dim) !important;
}

.mode-btn.mode-create:hover {
  filter: brightness(1.15);
  transform: scale(1.02) translateY(-2px);
}
/* === КНОПКА 2: "Войти по коду" — другой цвет (Teal/Tertiary), другая форма === */
.mode-btn.mode-join {
  background: #1A4A5C !important;   
  border-radius: 8px 20px 20px 20px !important;  
  color: #C3E7FF !important;
  border: none !important;
}

.mode-btn.mode-join:hover {
  filter: brightness(1.15);
  transform: scale(1.02) translateY(-2px);
}
/* Иконка-круг */.btn-icon-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 18px;
  flex-shrink: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-btn:hover .btn-icon-bg {
  transform: scale(1.15) rotate(-6deg);
}

.mode-create .btn-icon-bg {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mode-join .btn-icon-bg {
  background: rgba(0, 0, 0, 0.2);
  color: #C3E7FF;
}
/* Текст */
.btn-text-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.btn-title {
  font-family: var(--font-label);
  font-size: 18px;         
  font-weight: 700;        /* жирнее */
  letter-spacing: 0px;
}

.mode-create .btn-title { color: var(--color-primary-dim); }
.mode-join   .btn-title { color: #C3E7FF; }

.btn-desc {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.75;
  line-height: 1.4;
}

.btn-arrow { display: none; }

.mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, 0.02);
}
/* --- Inputs --- */
/* --- Стили экрана "Войти по коду" (M3 Redesign) --- */

.screen-header {
  text-align: center;
  margin-bottom: 24px;
}

.screen-header h3 {
  font-family: var(--font-label);
  font-size: 24px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
}

.screen-header p {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
}

.m3-input-group {
  margin-bottom: 20px;
  width: 100%;
}

.m3-text-field {
  position: relative;
  background-color: var(--md-sys-color-surface-container-highest);
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
  transition: background-color 0.2s, border-bottom-color 0.2s;
}

.m3-text-field:hover {
  background-color: #403d46;
}

.m3-text-field:focus-within {
  border-bottom: 2px solid var(--md-sys-color-primary);
  background-color: #403d46;
}

.m3-text-field input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface);
  font-family: var(--font-label);
  font-size: 16px;
  padding: 24px 16px 8px 16px;
  outline: none;
}

.m3-text-field label {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
  transition: transform 0.2s ease, color 0.2s ease;
  transform-origin: left top;
}

.m3-text-field input:focus ~ label,
.m3-text-field input:not(:placeholder-shown) ~ label {
  transform: translateY(-10px) scale(0.75);
  color: var(--md-sys-color-primary);
}

.m3-text-field input:not(:focus):not(:placeholder-shown) ~ label {
  color: var(--md-sys-color-on-surface-variant);
}

.large-code-field {
  border-radius: 16px 16px 0 0;
}

.large-code-field input {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 12px;
  padding: 32px 16px 12px 16px;
  text-transform: uppercase;
  caret-color: var(--md-sys-color-primary);
}

.large-code-field label {
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center top;
  font-size: 16px;
}

.large-code-field input:focus ~ label,
.large-code-field input:not(:placeholder-shown) ~ label {
  transform: translateX(-50%) translateY(-14px) scale(0.75);
}

.trailing-icon {
  position: absolute;
  right: 16px;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s ease;
}

.trailing-icon svg {
  width: 24px;
  height: 24px;
}

.large-code-field:focus-within .trailing-icon {
  color: var(--md-sys-color-primary);
}

.m3-text-field.input-error {
  border-bottom-color: var(--md-sys-color-error) !important;
  animation: shake 0.4s ease-in-out;
}

.m3-text-field.input-error label,
.m3-text-field.input-error .trailing-icon {
  color: var(--md-sys-color-error) !important;
}

.m3-text-field.input-error input {
  caret-color: var(--md-sys-color-error);
}
@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}
/* --- Action Buttons --- */

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}


.action-btn:hover {
  background-color: var(--color-primary-dim) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15);
}

.action-btn:disabled {
  background: var(--color-scrollbar-hover);
  cursor: not-allowed;
  color: #888;
}

.exit-btn {
  background: transparent !important;
  color: var(--md-sys-color-primary) !important;
  border: 1px solid var(--md-sys-color-outline) !important;
}

.exit-btn:hover {
  background: rgba(208, 188, 255, 0.08) !important;
  border-color: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-primary) !important;
}
/* --- Room Info --- */

.room-code {
  text-align: center;
  margin-bottom: 28px;
}

.room-code-label {
  font-size: 14px;
  color: #888;
  margin-bottom: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.room-code-value {
  text-align: center;
  background: transparent;
  border: none;
  font-size: 64px;
  font-weight: 200;
  color: #fff;
  letter-spacing: 8px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.room-code-value:hover {
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.room-url {
  text-align: center;
  margin-bottom: 28px;
}

.room-url-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-url-value {
  font-size: 13px;
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  color: #fff;
  word-break: break-all;
  padding: 12px 16px;
  background: transparent;
  border-radius: 8px;
  border: 1px solid var(--color-scrollbar-thumb);
  cursor: pointer;
}

.room-url-value:hover {
  border-color: #fff;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: 600;
  border: none;
}


.status.connected {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
  flex-shrink: 0;
}
.status.waiting {
  background: rgba(255, 111, 0, 0.15);
  color: #FFB74D;
  border: 1px solid rgba(255, 183, 77, 0.4);
  box-shadow: 0 0 15px rgba(255, 111, 0, 0.1);
}.status.waiting .status-indicator {
  background: #FF9100;
  animation: statusPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px #FF9100;
}.status.disconnected {
  background: rgba(186, 26, 26, 0.15);
  color: #FF897D;
  border: 1px solid rgba(255, 137, 125, 0.4);
  box-shadow: 0 0 15px rgba(186, 26, 26, 0.15);
}

.status.connected .status-indicator {
  background: var(--color-success);
}
/* --- Controls Panel (Bottom Island) --- */
@keyframes controlsPop {
  0% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.05);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

@keyframes reconnectPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 109, 0, 0.4), 0 0 20px rgba(255, 109, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.6);
    transform: translateX(-50%) scale(1);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(255, 109, 0, 0), 0 0 40px rgba(255, 109, 0, 0.4);
    border-color: rgba(255, 152, 0, 1);
    transform: translateX(-50%) scale(1.02);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 109, 0, 0), 0 0 20px rgba(255, 109, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.6);
    transform: translateX(-50%) scale(1);
  }
}

.controls-panel.state-reconnecting {
  background: linear-gradient(135deg, #3E1810 0%, #5D1A00 100%) !important;
  color: #FFD180 !important;
  /* Orange A100 */
  border: 1px solid #FF9800 !important;
  animation: reconnectPulse 1.5s infinite !important;
}

.controls-panel.state-success {
  background: rgba(255, 255, 255, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  animation: controlsPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.controls-panel.state-error {
  background: rgba(239, 68, 68, 0.45) !important;
  border-color: rgba(239, 68, 68, 0.8) !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
  animation: controlsPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* Control Buttons */


.control-btn span {
  display: none;
}


.controls-panel:hover .control-btn {
  opacity: 0.7;
}

.controls-panel .control-btn:hover {
  opacity: 1;
}

.control-btn.muted,
.control-btn.hidden-camera {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--md-sys-color-outline) !important;
  box-shadow: none;
}

.control-btn.muted:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--md-sys-color-on-surface) !important;
}

.control-btn.muted svg,
.control-btn.muted .mic-off {
  stroke: #FFB4AB;
}

.control-btn.sharing-active {
  background-color: #B5F29B !important;
  color: #0c3900 !important;
}

.control-btn.hang-btn {
  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;
  margin-left: 0 !important;
  aspect-ratio: 1 / 1;
  background-color: #E02B1D !important;
  /* Vibrant Red */
  color: #FFFFFF !important;
  /* White Icon */
}

.control-btn.hang-btn:hover {
  background-color: #C5221F !important;
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(224, 43, 29, 0.4);
}

.control-btn.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  /* Variant */
  border: none;
  color: var(--color-text);
}

.control-btn .icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}
/* Mic Dropdown */

.mic-dropdown {
  position: relative;
  display: flex !important;
  align-items: stretch;
  padding: 0 !important;
  gap: 1px;
  overflow: visible !important;
  border-radius: 16px !important;
  background-color: var(--color-primary) !important;
  /* Primary */
  color: var(--color-primary-on) !important;
  /* On Primary */
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  box-shadow: none !important;
  height: 56px !important;
}

.mic-dropdown:hover {
  transform: translateY(-4px);
  filter: brightness(1.08);
}.mic-main-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  width: 56px !important;
  height: 100% !important;
  border-radius: 16px 4px 4px 16px !important;
  margin: 0 !important;
  color: inherit !important;
  box-shadow: none !important;
  transform: none !important;
}.mic-dropdown-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  flex-direction: row !important;
  gap: 0 !important;
  width: 32px !important;
  height: 100% !important;
  border-radius: 4px 16px 16px 4px !important;
  background: rgba(0, 0, 0, 0.1) !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
}.mic-dropdown-toggle svg {
  width: 16px;
  height: 16px;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
}

.mic-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.mic-dropdown:has(.muted) {
  background-color: var(--color-outline-variant) !important;
  color: var(--color-text) !important;
}

.mic-dropdown:has(.muted) .mic-dropdown-toggle {
  background: rgba(255, 255, 255, 0.1) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.mic-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  max-width: 90vw;
  background: var(--color-surface-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mic-dropdown-menu:not(.hidden) {
  animation: menuPopUp 0.3s var(--md-sys-motion-easing-emphasized);
}
@keyframes menuPopUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.9);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.dropdown-section {
  margin-bottom: 12px;
}

.dropdown-section:last-child {
  margin-bottom: 0;
}

.dropdown-section label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9CA3AF;
  margin-bottom: 8px;
  font-weight: 700;
  padding-left: 2px;
}

.dropdown-select {
  width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color-scheme: dark;
  background-color: #2B2D31;
  color: #F2F3F5;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 36px 10px 12px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-select:hover {
  background-color: #383A40;
  border-color: rgba(255, 255, 255, 0.1);
}

.dropdown-select:focus {
  background-color: #383A40;
  border-color: var(--color-primary);
}

.dropdown-select option {
  background-color: var(--color-surface-card);
  color: #fff;
  padding: 10px;
}


.mic-on.hidden, .mic-off.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5) rotate(-90deg) !important;
  pointer-events: none;
}


#muteBtn.muted {
  --mic-level: 0 !important;
}

#muteBtn.muted .mic-off {
  transform: scale(1);
  filter: none;
}.mic-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, filter;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  transform: translateY(0);
  opacity: 1;
}.mic-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  transform: translateY(150%);
  opacity: 0;
  pointer-events: none;
}

.mic-loader svg {
  width: 20px;
  height: 20px;
  color: var(--color-warning-dim);
  animation: spin 1s linear infinite;
}

#muteBtn.loading-mic .mic-wrapper {
  transform: translateY(-150%);
  opacity: 0;
}

#muteBtn.loading-mic .mic-loader {
  transform: translateY(0);
  opacity: 1;
}

#muteBtn.loading-mic {
  pointer-events: none;
  background: rgba(255, 255, 255, 0.05);
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
/* --- Modals & Overlays --- */


.modal-dialog.hidden {
  display: none;
}
@keyframes modalEnter {
  0% {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}


.modal-body {
  padding: 0 24px;
  font-family: var(--font-label);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  line-height: 20px;
}


.modal-actions .action-btn {
  flex: 0 1 auto;
  /* Do not stretch */
  min-width: unset;
  height: 40px !important;
  padding: 0 24px;
  font-size: 14px !important;
  border-radius: 20px;
  margin: 0;
}

.action-btn.primary {
  background: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
}

.action-btn.primary:hover {
  background: var(--color-primary-dim) !important;
  
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* Quality Dialog */


.quality-select option {
  background-color: var(--color-surface-high);
  color: var(--color-text);
  padding: 12px;
}


.quality-info-box strong {
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 500;
}
/* Share Dialog */
.share-modal-content {
  max-width: 380px;
  text-align: center;
}

.share-prompt {
  color: #a0aec0;
  margin-bottom: 20px;
  font-size: 15px;
}

.room-share-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 20px;
  text-align: left;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  word-break: break-all;
}

.info-label {
  color: #a0aec0;
  font-size: 14px;
}

.info-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}
/* --- Settings Panel --- */

.settings-panel {
  display: none;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: 24px;
  z-index: 21000 !important;
  position: relative;
}

.settings-panel.active {
  display: block;
}

.settings-panel h3 {
  margin-bottom: 24px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h4 {
  color: #f0f0f0;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-scrollbar-thumb);
}

.settings-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #2a2a2a;
  gap: 18px;
}

.settings-toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-toggle-text {
  flex: 1 1 auto;
}

.settings-toggle-title {
  font-size: 15px;
  font-weight: 500;
  color: #f0f0f0;
}

.settings-toggle-desc {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
  line-height: 1.5;
}

.settings-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-scrollbar-thumb);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.settings-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #f0f0f0;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.settings-switch input:checked+.settings-switch-track {
  background: rgba(255, 255, 255, 0.8);
}

.settings-switch input:checked+.settings-switch-track::after {
  transform: translateX(22px);
  background: #000;
}

.settings-switch input:focus-visible+.settings-switch-track {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.settings-switch input:disabled+.settings-switch-track {
  background: #2a2a2a;
  opacity: 0.6;
}

.settings-switch input:disabled+.settings-switch-track::after {
  background: #555;
}

.settings-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-scrollbar-thumb);
  border-radius: 8px;
  background: var(--color-scrollbar-track);
  color: #f0f0f0;
  font-size: 14px;
  cursor: pointer;
}

.settings-select option {
  background-color: var(--color-scrollbar-track);
  color: #f0f0f0;
}

.settings-select:focus {
  outline: none;
  border-color: #fff;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
/* ================================================================
   SCREEN SHARE / CAMERA CONTAINER — Redesigned
   ================================================================ */

.screen-container {
  position: fixed;
  z-index: 100;

  /* Центрирование */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  
  width: calc(100vw - 48px);
  height: calc(100vh - 180px);
  
  max-width: 1600px;

  
  margin-top: 10px;

  /* Стиль */
  background: #0a0a0a;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 120px rgba(0, 0, 0, 0.3);

  
  display: flex;
  align-items: center;
  justify-content: center;

  /* Анимация появления */
  animation: screenContainerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;

  
  transition:
    border-radius 0.4s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.3s ease;
}
@keyframes screenContainerIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.screen-container.hidden {
  display: none !important;
}
/* --- Видео элемент --- */

.screen-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: 0;
  
  transition: object-fit 0.3s ease;
}
/* --- Режим камеры: object-fit cover + зеркалирование для себя --- */

.screen-container.camera-mode video {
  object-fit: cover;
}

.screen-container.camera-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at center,
      transparent 50%,
      rgba(0, 0, 0, 0.25) 100%);
}
/* --- Информационный бейдж (верхний левый угол) --- */

.screen-info {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 102;
  pointer-events: none;

  
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);

  /* Типографика */
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;

  /* Анимация появления */
  animation: badgeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
@keyframes badgeFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* --- Кнопка полноэкранного режима --- */

.screen-fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 102;

  
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;

  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);

  
  animation: badgeFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.screen-fullscreen-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.screen-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
  color: #fff;
}

.screen-fullscreen-btn:hover svg {
  transform: scale(1.1);
}

.screen-fullscreen-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.1);
}
/* --- Полноэкранный режим --- */

.screen-container:fullscreen,
.screen-container:-webkit-full-screen {
  border-radius: 0;
  border: none;
  box-shadow: none;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
}

.screen-container:fullscreen video,
.screen-container:-webkit-full-screen video {
  border-radius: 0;
}

.screen-container:fullscreen .screen-info,
.screen-container:-webkit-full-screen .screen-info {
  top: 24px;
  left: 24px;
}

.screen-container:fullscreen .screen-fullscreen-btn,
.screen-container:-webkit-full-screen .screen-fullscreen-btn {
  top: 24px;
  right: 24px;
}

.screen-container:fullscreen .screen-info,
.screen-container:fullscreen .screen-fullscreen-btn {
  opacity: 1;
  transition: opacity 0.3s ease;
}
/* --- Тень под UI (чтобы текст был читаем на светлом контенте) --- */

.screen-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 101;
  pointer-events: none;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.45) 0%,
      rgba(0, 0, 0, 0.15) 50%,
      transparent 100%);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.screen-container.hidden::after {
  display: none;
}
/* --- Блокировка взаимодействия --- */

.screen-container.no-interact {
  pointer-events: none;
}

body.ui-priority .screen-container {
  pointer-events: none;
}
/* --- Индикатор демонстрации экрана --- */

.screen-share-indicator {
  position: fixed;
  top: 90px;
  
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;

  
  background: rgba(20, 18, 24, 0.8);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 10px 24px;

  /* Тень */
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.1);

  /* Текст */
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;

  /* Анимация */
  animation: indicatorSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes indicatorSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.screen-share-indicator.hidden {
  display: none;
}

.screen-share-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.screen-share-info::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  /* Primary */
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(208, 188, 255, 0.4);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(208, 188, 255, 0);
  }
}

.screen-share-text {
  white-space: nowrap;
}
/* ================================================================
   MOBILE RESPONSIVE — Screen Container
   ================================================================ */
@media (max-width: 640px) {
  .screen-container {
    
    width: 100vw;
    height: calc(100vh - 160px);
    max-width: none;
    border-radius: 0;
    border: none;
    margin-top: 0;
    box-shadow: none;

    
    top: calc(50% - 20px);
  }

  .screen-container::after {
    border-radius: 0;
  }

  .screen-container video {
    object-fit: contain;
  }

  
  .screen-container.camera-mode video {
    object-fit: cover;
  }

  .screen-info {
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 11px;
  }

  .screen-fullscreen-btn {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  .screen-fullscreen-btn svg {
    width: 18px;
    height: 18px;
  }

  .screen-share-indicator {
    top: 70px;
    padding: 8px 18px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .screen-container {
    height: calc(100vh - 140px);
  }

  .screen-info {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 4px 10px;
  }

  .screen-fullscreen-btn {
    width: 34px;
    height: 34px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .screen-container {
    height: calc(100vh - 80px);
    top: 40px;
    transform: translateX(-50%);
    border-radius: var(--radius-md);
  }

  .screen-info {
    top: 8px;
    left: 8px;
  }

  .screen-fullscreen-btn {
    top: 8px;
    right: 8px;
  }
}
/* --- Notifications & Banners --- */


.participant-banner {
  position: fixed;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate(-50%, 16px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid var(--color-scrollbar-thumb);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
  color: #f0f0f0;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 1100;
  max-width: calc(100% - 48px);
  text-align: center;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.participant-banner.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  border-color: rgba(255, 255, 255, 0.15);
}

.participant-banner.hidden {
  display: none;
}

.participant-banner .banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
}

.participant-banner .banner-icon::before {
  content: none;
}

.participant-banner .banner-text {
  display: inline-block;
  white-space: nowrap;
}
/* --- Preloader M3 (Полноэкранный) --- */
.preloader {
  position: fixed;
  inset: 0; 
  z-index: 50000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--md-sys-color-background); /* Тёмный фон M3 */
  pointer-events: all; 
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.logo-container {
  width: 180px;
  height: 180px;
  animation: preloader-glow 3s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader .logo-container svg {
  width: 100%;
  height: 100%;
}
@keyframes preloader-glow {
  0%, 35%, 58%, 100% { filter: drop-shadow(0 0 4px rgba(208, 188, 255, 0.05)); }
  46% { filter: drop-shadow(0 0 20px rgba(208, 188, 255, 0.3)); }
}

.line1, .line2 {
  stroke: var(--md-sys-color-primary);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.line1 {
  stroke-dasharray: 100;
  animation: draw1 3s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}

.line2 {
  stroke-dasharray: 90;
  animation: draw2 3s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}
@keyframes draw1 {
  0%, 3%   { stroke-dashoffset: 100; }
  33%      { stroke-dashoffset: 0; }
  60%      { stroke-dashoffset: 0; }
  93%, 100%{ stroke-dashoffset: -100; }
}
@keyframes draw2 {
  0%, 11%  { stroke-dashoffset: 90; }
  41%      { stroke-dashoffset: 0; }
  56%      { stroke-dashoffset: 0; }
  89%, 100%{ stroke-dashoffset: -90; }
}

.loading-text-wrapper {
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.dot {
  animation: blink 1.4s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  opacity: 0;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
  0%, 60%, 100% { opacity: 0; }
  30%           { opacity: 1; }
}

/* ===== RECONNECT PRELOADER — orange jagged drawing ===== */
.preloader.reconnect-mode .logo-container {
  animation: reconnect-glow 2.4s ease-in-out infinite;
}

@keyframes reconnect-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 120, 0, 0.2)); }
  50%       { filter: drop-shadow(0 0 18px rgba(255, 140, 0, 0.6)); }
}

/* Override line colors */
.preloader.reconnect-mode .line1,
.preloader.reconnect-mode .line2 {
  stroke: #FF8C00;
  stroke-dasharray: 5 13;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preloader.reconnect-mode .line1 {
  stroke-dashoffset: 100;
  animation: reconnect-draw1 3.2s cubic-bezier(0.45, 0.0, 0.55, 1.0) infinite;
}

.preloader.reconnect-mode .line2 {
  stroke-dashoffset: 90;
  animation: reconnect-draw2 3.2s cubic-bezier(0.45, 0.0, 0.55, 1.0) infinite;
  animation-delay: 0.3s;
}

@keyframes reconnect-draw1 {
  0%   { stroke-dashoffset: 100; }
  85%  { stroke-dashoffset: -18; }
  100% { stroke-dashoffset: -60; opacity: 0; }
}

@keyframes reconnect-draw2 {
  0%   { stroke-dashoffset: 90; }
  85%  { stroke-dashoffset: -16; }
  100% { stroke-dashoffset: -55; opacity: 0; }
}

/* Orange dots */
.preloader.reconnect-mode .loading-text-wrapper {
  color: #FFA040;
}

.preloader.reconnect-mode .dot {
  color: #FF8C00;
}

/* --- СТАТИЧНЫЙ ЛОГОТИП ГЛАВНОЙ СТРАНИЦЫ --- */
.main-logo {
  display: none;
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
}

body.mode-mode .main-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-logo svg {
  width: 100%;
  height: 100%;
}

/* --- КНОПКА ДОПОЛНЕНИЯ В ХЕДЕРЕ --- */
.header-extras-btn {
  background: rgba(208, 188, 255, 0.08) !important;
}
.header-extras-btn:hover {
  background: rgba(208, 188, 255, 0.14) !important;
}

/* --- ПАНЕЛЬ ДОПОЛНЕНИЯ --- */
.extras-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 30000;
  backdrop-filter: blur(4px);
}
.extras-overlay.hidden { display: none !important; }

.extras-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: min(440px, 100vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--color-surface-high);
  border-radius: var(--radius-xl) 28px 0 0;
  z-index: 30001;
  padding: 0 0 24px;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.extras-panel.hidden { display: none !important; }
.extras-panel.extras-panel--visible {
  transform: translateX(-50%) translateY(0);
}

.extras-handle {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  margin: 12px auto 0;
}

.extras-header {
  padding: 16px 24px 8px;
}
.extras-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.1px;
}

.extras-section {
  padding: 4px 0;
}
.extras-section-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(202,196,208,0.5);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 24px 4px;
}

.extras-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 12px 24px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
  color: inherit;
}
.extras-item:hover:not(.extras-item--disabled) {
  background: rgba(255,255,255,0.05);
}
.extras-item--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.extras-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(208,188,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-primary);
}
.extras-item-icon svg {
  width: 20px;
  height: 20px;
}

.extras-item-text {
  flex: 1;
  min-width: 0;
}
.extras-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}
.extras-item-desc {
  font-size: 12px;
  color: rgba(202,196,208,0.6);
  margin-top: 2px;
}

.extras-item-arrow {
  color: rgba(202,196,208,0.4);
  flex-shrink: 0;
}
.extras-item-arrow svg {
  width: 18px;
  height: 18px;
}

.extras-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(208,188,255,0.12);
  border: 1px solid rgba(208,188,255,0.25);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Misc Components --- */
/* Code Invite Button */
.call-room-code {
  position: fixed;
  top: 24px;
  right: 20px;
  bottom: auto;
  left: auto;
  transform: none;
  z-index: 22000;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--md-sys-color-primary-container) !important;
  color: var(--md-sys-color-on-primary-container) !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.call-room-code:hover {
  background-color: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.call-room-code:hover svg {
  color: var(--md-sys-color-on-primary) !important;
}

.call-room-code:active {
  transform: translateY(1px);
}

.call-room-code svg {
  opacity: 0.8;
  transition: opacity 0.2s;
  color: var(--md-sys-color-on-primary-container) !important;
}

.call-room-code.copied {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  cursor: default;
}

.code-context-menu {
  position: fixed;
  z-index: 1600;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  min-width: 180px;
  padding: 6px 0;
  display: none;
}

.code-context-menu:not(.hidden) {
  display: block;
}

.code-value-text {
  font-family: "SF Mono", "Monaco", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.code-label-text {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-copy-icon {
  width: 16px;
  height: 16px;
  color: #888;
  transition: color 0.2s;
}

.code-context-menu button {
  width: 100%;
  background: transparent;
  border: 0;
  color: #f0f0f0;
  font-size: 14px;
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.code-context-menu button:hover:not(:disabled),
.code-context-menu button:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.code-context-menu button:disabled {
  color: rgba(240, 240, 240, 0.35);
  cursor: not-allowed;
}

.code-context-menu::after {
  content: "";
  position: absolute;
  top: -8px;
  left: var(--menu-arrow-left, 24px);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent rgba(17, 24, 39, 0.95) transparent;
}

.code-context-menu.invert::after {
  top: auto;
  bottom: -8px;
  border-width: 8px 8px 0 8px;
  border-color: rgba(17, 24, 39, 0.95) transparent transparent transparent;
}
/* --- Participant Panel (M3 Expressive — Click-triggered) --- */

.participant-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
body.mode-call .participant-badge {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--color-text-muted) !important;
  box-shadow: none !important;
  animation: none !important;
  border: none !important;
  height: auto !important;
  width: auto !important;
  border-radius: 0 !important;
  gap: 6px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  user-select: none;
}

body.mode-call .participant-badge:active {
  transform: scale(0.92) !important;
}

.participant-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 22500;
  display: none;
}

.participant-panel-overlay.active {
  display: block;
}
/* Сама панель */
.participant-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(0.88);
  transform-origin: top center;
  width: 296px;

  
  background: var(--color-surface-input);
  border: 1px solid rgba(208, 188, 255, 0.1);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.45),
    0 24px 56px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 23000;

  transition:
    opacity 0.28s cubic-bezier(0.2, 0, 0, 1),
    transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1),
    visibility 0.28s;
}
/* Состояние открытия */
.participant-tooltip.panel-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}
/* Заголовок панели */
.pt-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px 6px;
  font-size: 11px;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(202, 196, 208, 0.55);
}

.pt-header::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: rgba(202, 196, 208, 0.2);
  flex-shrink: 0;
}

.pt-header::after {
  content: '';
  display: inline-block;
  flex: 1;
  height: 1px;
  background: rgba(202, 196, 208, 0.2);
}
/* Строка участника */
.pt-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  transition:
    background-color 0.18s cubic-bezier(0.2, 0, 0, 1),
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.pt-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(208, 188, 255, 0);
  border-radius: inherit;
  transition: background 0.2s ease;
  pointer-events: none;
}

.pt-item:hover::before {
  background: rgba(208, 188, 255, 0.07);
}

.pt-item:active {
  transform: scale(0.97);
}

.pt-item:nth-child(2) { animation: ptItemSlide 0.35s cubic-bezier(0.34, 1.45, 0.64, 1) both; }
.pt-item:nth-child(3) { animation: ptItemSlide 0.35s 0.06s cubic-bezier(0.34, 1.45, 0.64, 1) both; }
@keyframes ptItemSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Аватар контейнер */
.pt-avatar-box {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.pt-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-primary-container);
  color: var(--color-primary-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-label);
  
  box-shadow:
    0 0 0 2px var(--color-surface-input),
    0 0 0 3.5px rgba(208, 188, 255, 0.35);
  transition: box-shadow 0.3s ease;
}

.pt-item:hover .pt-avatar {
  box-shadow:
    0 0 0 2px var(--color-surface-input),
    0 0 0 3.5px rgba(208, 188, 255, 0.6);
}

.pt-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 2px var(--color-surface-input),
    0 0 0 3.5px rgba(208, 188, 255, 0.35);
}

.pt-avatar.local {
  background: linear-gradient(135deg, #2d5349, #3d6b5f);
  color: #bcebe2;
  box-shadow:
    0 0 0 2px var(--color-surface-input),
    0 0 0 3.5px rgba(188, 235, 226, 0.4);
}
/* Ожидание */
.pt-avatar.waiting {
  background: #28262E;
  color: #5c5868;
  border: 2px dashed rgba(255,255,255,0.12);
  box-shadow: none;
  animation: waitingPulse 2s ease-in-out infinite;
}
@keyframes waitingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
/* Инфо-блок */
.pt-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.pt-name {
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-label);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.1px;
}

.pt-status-text {
  font-size: 12px;
  font-family: var(--font-label);
  color: rgba(202, 196, 208, 0.65);
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pt-status-text.status-online::before,
.pt-status-text.status-call::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bcebe2;
  flex-shrink: 0;
}

.pt-status-text.status-call::before {
  background: var(--color-success-dim);
  box-shadow: 0 0 5px rgba(165, 245, 200, 0.6);
}
/* Бейдж "ВЫ" */
.pt-you-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-label);
  background: rgba(239, 184, 200, 0.12);
  color: var(--color-tertiary);
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(239, 184, 200, 0.25);
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.pt-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 10px;
}

.pt-actions {
  display: flex;
  gap: 6px;
  padding: 6px 10px 4px;
}

.pt-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(202, 196, 208, 0.45);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-label);
  cursor: not-allowed;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.pt-action-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.5;
}
/* Цвета статусов */
.status-online {
  color: rgba(188, 235, 226, 0.85) !important;
}

.status-call {
  color: rgba(165, 245, 200, 0.9) !important;
}

.status-connecting {
  color: rgba(147, 143, 153, 0.75) !important;
}

.legal-footer {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 40px;
  width: 100%;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.legal-footer.hidden {
  opacity: 0;
  pointer-events: none;
}

.legal-pill-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: border-color 0.3s ease;
}

.legal-pill-container:hover {
  border-color: rgba(208,188,255,0.15);
}

.legal-link {
  color: #C4C7C5;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  cursor: pointer;
  white-space: nowrap;
}

.legal-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.legal-link:active {
  background-color: rgba(255, 255, 255, 0.12);
  transform: scale(0.98);
}

.legal-separator {
  width: 1px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.2);
  margin: 0 2px;
}
/* Debug / Tools */
.log {
  background: transparent;
  border: 1px solid var(--color-scrollbar-thumb);
  border-radius: 8px;
  padding: 12px;
  max-height: 120px;
  overflow-y: auto;
  font-size: 11px;
  color: #888;
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  margin-top: 16px;
}

.log:empty {
  display: none;
}

.log div {
  padding: 2px 0;
  border-bottom: 1px solid var(--color-scrollbar-thumb);
}

.log div:last-child {
  border-bottom: none;
}

.connection-quality {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(20, 20, 20, 0.75);
  border-radius: 10px;
  border: 1px solid rgba(45, 45, 45, 0.6);
  z-index: 100;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.connection-quality.hidden {
  display: none;
}

.quality-indicator {
  display: flex;
  gap: 2px;
  align-items: end;
  height: 16px;
}

.quality-bar {
  width: 3px;
  background: #666;
  border-radius: 1px;
  transition: all 0.4s ease;
}

.quality-bar:nth-child(1) {
  height: 6px;
}

.quality-bar:nth-child(2) {
  height: 8px;
}

.quality-bar:nth-child(3) {
  height: 10px;
}

.quality-bar:nth-child(4) {
  height: 12px;
}

.connection-quality.excellent .quality-bar {
  background: var(--color-success);
}

.connection-quality.good .quality-bar {
  background: var(--color-warning-dim);
}

.connection-quality.poor .quality-bar {
  background: #f87171;
}

.quality-text {
  display: none;
}

.stats-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 10, 0.9);
}

.stats-panel.hidden {
  display: none;
}

.stats-content {
  background: var(--color-scrollbar-track);
  border: 1px solid var(--color-scrollbar-thumb);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-scrollbar-thumb);
}

.stats-header h3 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.stats-close {
  background: var(--color-scrollbar-thumb);
  border: none;
  color: #f0f0f0;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-close:hover {
  background: var(--color-scrollbar-hover);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-section {
  margin-bottom: 16px;
}

.stat-section h4 {
  font-size: 14px;
  color: #f0f0f0;
  margin-bottom: 12px;
  font-weight: 500;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-scrollbar-thumb);
}

.stat-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.stat-value {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
}

.stat-unit {
  font-size: 11px;
  color: #666;
  margin-left: 4px;
}

.stats-history {
  border-top: 1px solid var(--color-scrollbar-thumb);
  padding-top: 16px;
}

.stat-chart {
  text-align: center;
}

.stat-chart canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.chart-label {
  font-size: 11px;
  color: #888;
  margin-top: 8px;
  font-weight: 500;
}

.speaker-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  bottom: auto;
  z-index: 105;
}

.speaker-indicator .bar {
  display: none;
}

.speaker-indicator::after {
  content: '';
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.1;
  transition: transform 0.1s ease;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.speaker-indicator.active::after {
  transform: scale(1.5);
  opacity: 0.3;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.4);
}

.speaker-indicator.hidden,
#speakerIndicator {
  display: none !important;
}
/* --- Dialogs --- */.modal-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  visibility: hidden;
}.modal-dialog.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}.modal-content {
  background: var(--color-surface-high);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}.modal-dialog.visible .modal-content {
  animation: modalEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform: scale(1);
}.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 16px;
  margin-bottom: 24px;
}.modal-header h3 {
  color: var(--color-text);
  font-family: var(--font-label);
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  line-height: 32px;
}.modal-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}.modal-close:hover {
  background: rgba(230, 224, 233, 0.08);
}
.quality-info-box {
  background: var(--color-surface-highest);
  border: none;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--color-primary);
}.quality-info-box p {
  color: var(--color-text);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.input-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}.quality-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-outline);
  border-bottom: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23CAC4D0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 24px;
  appearance: none;
  outline: none;
}.quality-select:focus {
  outline: none;
  border-bottom: 2px solid var(--md-sys-color-primary);
  background: #403d46;
  border-color: var(--color-primary);
  border-width: 2px;
  padding: 11px 15px;
}.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  margin-top: 32px;
  border-top: none;
}
/* Action Buttons */.action-btn {
  width: 100%;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  height: 56px !important;
  font-size: 14px;
  font-weight: 500;
  text-transform: none !important;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.1px;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  background-color: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}.action-btn.exit-btn {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(208, 188, 255, 0.2);
}.action-btn.exit-btn:hover {
  background: rgba(208, 188, 255, 0.08);
  border-color: var(--color-primary);
}

#startWithQuality {
  background: var(--color-danger) !important;
  /* Tertiary */
  color: #FFFFFF !important;
  
  box-shadow: 0 2px 6px rgba(152, 64, 97, 0.3);
}

#startWithQuality:hover {
  background: #B05575 !important;
  box-shadow: 0 4px 10px rgba(152, 64, 97, 0.4);
  transform: translateY(-1px);
}
/* --- Control Bar (Bottom Island) --- */
.controls-panel.hidden {
  display: none;
  transform: translateX(-50%) translateY(150%);
}.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  border: none;
  cursor: pointer;
  flex-direction: column;
  color: var(--color-secondary-on);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-secondary-container);
}.control-btn:hover {
  background-color: var(--md-sys-color-primary-container) !important;
  color: var(--md-sys-color-on-primary-container) !important;
  transform: scale(1.05);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
  filter: brightness(1.08);
  background: #554F65;
}.control-btn .material-symbols-rounded {
  font-size: 28px;
  width: auto;
  height: auto;
  line-height: 1;
  color: inherit;
}

.control-btn:not(.muted):not(#hangBtn):not(#shareBtn) {
  background: #6750A4;
  /* Primary */
  color: #FFFFFF;
  /* On Primary */
}

.control-btn.muted,
.control-btn.camera-off {
  background: #1C1B1F;
  /* Surface */
  color: #C4C7C5;
  /* Variant */
  border: 1px solid var(--color-scrollbar-hover);
  /* Subtle Border */
}
/* DROP DOWN & Extra Styling handled in HTML structure,
   but we target specific IDs for the Palette Diversification here */
/* 1. HANGUP BUTTON - Error (#B3261E) */
#hangBtn {
  background: #B3261E !important;
  /* Error */
  color: #FFFFFF !important;
  /* On Error */
  width: 72px;
  border-radius: var(--radius-xl);
}

#hangBtn:hover {
  background: #C43C34 !important;
  box-shadow: 0 4px 12px rgba(179, 38, 30, 0.3);
}
/* 2. SHARE BUTTON - Secondary (#9B4244) or Tertiary (var(--color-danger))
   User gave Secondary: #9B4244, Tertiary: var(--color-danger).
   Let's use Tertiary for Share to differentiate from the Red Hangup.
   Actually, Tertiary (var(--color-danger)) is also pink/red.
   Let's use Primary Container (var(--color-primary-dim)) with Dark Text (#22005D) for a high-contrast style that stands out from dark buttons?
   
   OR better, let's stick to the "Expressive" idea:
   Active Share = Tertiary Key (var(--color-danger)).
*/
/* ── Share Dropdown ───────────────────────────────────────── */
.share-dropdown {
  position: relative;
}

.share-quality-dropdown {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--color-surface-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Arrow pointer */
}

.share-quality-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--color-surface-card);
}

.share-quality-dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.1);
  margin-top: 1px;
}

.share-quality-dropdown:not(.hidden) {
  animation: sqDropDown 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes sqDropDown {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.92); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0)   scale(1); }
}

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

.sqd-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.2px;
}

.sqd-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.sqd-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-text);
}

.sqd-close svg {
  width: 16px;
  height: 16px;
}

.sqd-quality-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(208, 188, 255, 0.08);
  border: 1px solid rgba(208, 188, 255, 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 500;
}

.sqd-quality-badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
}

.sqd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sqd-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9CA3AF;
  font-weight: 700;
}

.sqd-select {
  width: 100%;
  padding: 9px 36px 9px 12px;
  background: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23CAC4D0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: border-color 0.15s;
}

.sqd-select:focus {
  border-color: var(--color-primary);
  background-color: #1c1a22;
}

.sqd-actions {
  display: flex;
  gap: 8px;
}

.sqd-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.sqd-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-muted);
}

.sqd-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

.sqd-btn-primary {
  background: var(--color-primary);
  color: #1C0A4A;
  font-weight: 600;
}

.sqd-btn-primary:hover {
  background: var(--color-secondary-on);
}
.share-quality-dropdown.visible {
  display: flex !important;
}
/* ── end Share Dropdown ───────────────────────────────────── */

#shareBtn {
  background: #2D2B33 !important;
  color: var(--color-text-muted) !important;
}

#shareBtn:hover {
  background: #3A3741 !important;
  color: var(--color-secondary-on) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#stopShareBtn {
  background: var(--color-primary-dim) !important;
  /* Primary Container */
  color: #22005D !important;
  
  animation: pulsePurple 2s infinite;
}
@keyframes pulsePurple {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 221, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(234, 221, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(234, 221, 255, 0);
  }
}
/* Tooltip for buttons */
.control-btn::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: rgba(227, 226, 230, 0.9);
  /* Inverse Surface */
  color: #303030;
  /* Inverse On Surface */
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  font-weight: 500;
}

.control-btn:hover::after {
  opacity: 1;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: #f0f0f0;
  margin-bottom: 0 !important;
}

.checkbox-label input {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--color-scrollbar-thumb);
  border-radius: 3px;
  margin-right: 8px;
  position: relative;
  background: transparent;
  transition: all 0.3s ease;
}

.checkbox-label input:checked+.checkmark {
  background: #fff;
  border-color: #fff;
}

.checkbox-label input:checked+.checkmark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* --- Media Queries --- */
@media (max-width: 640px) {

  /* Layout */
  .container {
    max-width: 100%;
  }

  
  body.mode-call .app-header {
    height: 32px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    top: 16px !important;
  }

  body.mode-call .app-header h1 {
    display: none !important;
  }

  body.mode-call .participant-badge {
    padding-left: 10px !important;
    gap: 4px;
    font-size: 12px;
  }

  body.mode-call .participant-badge span {
    font-size: 12px;
  }

  .call-timer {
    top: 16px;
    left: 16px;
    height: 28px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px !important;
    border-left: none !important;
    padding-left: 0 !important;
  }

  .call-room-code {
    top: 16px;
    right: 16px;
    height: 36px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(10, 10, 10, 0.85);
  }

  .code-label-text {
    display: none;
  }

  .code-value-text {
    font-size: 13px;
  }

  .code-copy-icon {
    width: 14px;
    height: 14px;
  }

  
  .controls-panel {
    bottom: 24px;
    padding: 8px 12px;
    gap: 8px;
    width: 92%;
    border-radius: var(--radius-xl);
    max-width: 360px;
    justify-content: space-evenly;
  }

  .control-btn {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
  }

  .mic-dropdown {
    border-radius: 14px !important;
  }

  .mic-main-btn {
    width: 42px !important;
    height: 48px !important;
  }

  .mic-dropdown-toggle {
    width: 24px !important;
    height: 48px !important;
  }

  .control-btn.hang-btn {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
  }

  
  .screen-container {
    width: 100vw;
    height: 80vh;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
    background: #000;
  }

  .screen-container video {
    object-fit: contain !important;
    width: 100%;
    height: 100%;
  }

  .screen-info {
    top: 12px;
    left: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .screen-fullscreen-btn {
    top: 12px;
    right: 10px;
    padding: 6px;
    border-radius: 4px;
  }

  .screen-fullscreen-btn svg {
    width: 16px;
    height: 16px;
  }

  .notifications-container {
    top: 16px;
    max-width: calc(100vw - 32px);
  }

  .notification-item {
    padding: 10px 14px;
    font-size: 12px;
    max-width: 100%;
    min-width: 180px;
  }

  .notification-icon {
    width: 16px;
    height: 16px;
  }

  .participant-banner {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    padding: 8px 16px;
    font-size: 13px;
    gap: 10px;
  }

  .participant-banner .banner-text {
    white-space: normal;
  }
}
@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .header {
    margin-bottom: 32px;
  }

  h1 {
    font-size: 20px;
  }

  .card {
    padding: 0;
    border-radius: 0;
  }

  .menu-card {
    padding: 20px;
    border-radius: 20px;
  }

  .app-header {
    justify-content: flex-start;
  }

  .app-header h1 {
    font-size: 18px;
  }

  .user-badge {
    padding: 4px 12px 4px 4px !important;
    font-size: 13px !important;
  }

  .user-badge-name {
    max-width: 100px;
    font-size: 12px;
  }

  .user-avatar,
  .user-badge-icon {
    width: 28px !important;
    height: 28px !important;
  }

  #authSection {
    padding: 20px 16px !important;
    border-radius: 20px !important;
  }

  .settings-toggle-row {
    padding: 12px 0;
    gap: 10px;
  }

  .settings-toggle-title {
    font-size: 14px;
  }

  .settings-toggle-desc {
    font-size: 11px;
  }

  .settings-switch {
    width: 44px;
    height: 24px;
  }

  .settings-switch-track::after {
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
  }

  .settings-switch input:checked+.settings-switch-track::after {
    transform: translateX(20px);
  }

  #shareBtn,
  #stopShareBtn {
    display: none !important;
  }

  .speaker-indicator {
    width: 150px;
    height: 150px;
  }

  .speaker-indicator::after {
    width: 60px;
    height: 60px;
  }

  .room-code-value {
    font-size: 48px;
    letter-spacing: 6px;
  }

  .connection-quality {
    top: 16px;
    right: 16px;
    padding: 6px 10px;
  }

  .quality-text {
    font-size: 10px;
    min-width: 40px;
  }

  .stats-content {
    padding: 20px;
    margin: 16px;
    width: calc(100% - 32px);
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mic-dropdown-menu {
    width: 240px;
  }

  .notifications-container {
    top: 12px;
    max-width: calc(100vw - 24px);
  }

  .notification-item {
    padding: 9px 12px;
    font-size: 11.5px;
    gap: 8px;
  }

  .legal-footer {
    margin-top: 32px;
  }

  .legal-pill-container {
    width: 90%;
    justify-content: space-between;
  }

  .legal-link {
    font-size: 12px;
    padding: 10px 0;
    flex: 1;
    text-align: center;
  }
}
/* --- JUICY ANIMATIONS PACK (FIXED) --- */

:root {
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* 1. Пружинистое нажатие */
.control-btn,
.action-btn,
.mode-btn {
  transition:
    transform 0.2s var(--ease-spring),
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    border-radius 0.2s ease !important;
}

.control-btn:active,
.action-btn:active,
.mode-btn:active {
  transform: scale(0.9) !important;
}
/* 2. Морфинг (ФОРМА) кнопки микрофона */

#muteBtn:not(.muted) {
  
  border-radius: var(--blob-radius, 24px) !important;
  will-change: border-radius;
  
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
/* 3. Анимация появления панели */.controls-panel {
  position: fixed;
  bottom: 24px;
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background-color: var(--color-surface-high) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-full);
  Expressive: Rounded Rectangle / Squircle */
  padding: 12px !important;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.6s var(--ease-spring), opacity 0.3s ease;
  background: var(--color-surface-high);
  padding: 12px 24px;
  opacity: 0;
}

.controls-panel:not(.hidden) {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
/* 4. Вращение иконок (без глюков) */
.mic-on,
.mic-off {
  transition: transform 0.3s var(--ease-spring), opacity 0.2s ease !important;
  position: absolute;
  
}.hidden {
  display: none !important;
  opacity: 0;
  transform: scale(0.5) rotate(-90deg) !important;
  pointer-events: none;
}.mic-on:not(.hidden), .mic-off:not(.hidden) {
  opacity: 1;
  transform: scale(1) rotate(0deg) !important;
}
/* --- ИСПРАВЛЕНИЕ МОБИЛЬНОЙ ВЕРСТКИ (FINAL FIX) --- */
@media (max-width: 640px) {
  .controls-panel {
    bottom: 24px;
    /* Чуть выше от края */
    padding: 6px !important;
    gap: 12px !important;
    
    width: auto !important;
    max-width: 90vw;
    border-radius: var(--radius-full) !important;
    background: var(--color-surface-card) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
  }

  /* --- 1. Фикс размеров кнопок --- */
  .control-btn {
    width: 52px !important;
    
    height: 52px !important;
    border-radius: 50% !important;
    flex-shrink: 0;
  }

  /* --- 2. Фикс "Развалившейся" кнопки микрофона --- */

  
  .mic-dropdown {
    height: 52px !important;
    border-radius: var(--radius-full) !important;
    padding: 0 !important;
    gap: 0 !important;
    
    overflow: hidden;
    
    
  }

  
  .mic-main-btn {
    width: 60px !important;
    height: 100% !important;
    border-radius: 0 !important;
    background: transparent !important;
    
  }

  
  #muteBtn:not(.muted) {
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  
  .mic-dropdown-toggle {
    width: 32px !important;
    height: 100% !important;
    border-radius: 0 !important;
    
    background: rgba(0, 0, 0, 0.1) !important;
    border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
  }

  /* --- 3. Кнопка сброса (Красная) --- */
  .control-btn.hang-btn {
    width: 68px !important;
    /* Широкая пилюля */
    height: 52px !important;
    border-radius: var(--radius-full) !important;
  }

  /* --- 4. Фикс верхнего бара (чтобы не прилипал) --- */
  body.mode-call .app-header {
    top: 16px !important;
    width: auto !important;
    min-width: 200px;
    padding: 6px 16px !important;
  }
}
/* ===== FIX: Центрирование иконки микрофона ===== */

#muteBtn .mic-wrapper {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#muteBtn .mic-on, #muteBtn .mic-off {
  position: absolute !important;
  width: 28px !important;
  height: 28px !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  font-size: 28px;
  inset: 0 !important;
  margin: auto !important;
}
/* Видимая иконка */
#muteBtn .mic-on:not(.hidden),
#muteBtn .mic-off:not(.hidden) {
  opacity: 1;
  transform: scale(1) rotate(0deg) !important;
}

#muteBtn .mic-on.hidden,
#muteBtn .mic-off.hidden {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg) !important;
}
/* ========== USER BADGE BUTTON ========== */
button.user-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

button.user-badge:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

button.user-badge:active {
  transform: scale(0.97);
}

.user-badge-chevron {
  width: 16px !important;
  height: 16px !important;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ========== GOOGLE SIGN-IN BUTTON ========== */
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  font-family: 'Inter', 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-google-signin:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.btn-google-signin:active {
  background: rgba(255,255,255,0.06);
  transform: translateY(0);
  box-shadow: none;
}

.btn-google-signin svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  flex-shrink: 0;
}

.auth-buttons-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-divider {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  padding: 0 2px;
  flex-shrink: 0;
}

/* ========== ACCOUNT PANEL (Material 3 Expressive Redesign) ========== */
.account-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 50000;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.account-overlay--visible {
  opacity: 1;
}

.account-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--md-sys-color-surface); /* var(--color-bg) */
  z-index: 50001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
  overflow-y: auto;
  border-radius: 36px 0 0 36px;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  padding: 12px;
}

.account-panel--visible {
  transform: translateX(0);
}

/* Header */
.account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 24px 8px;
  border-bottom: none; /* Убираем бордер для Flat стиля */
}

.account-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: background 0.2s ease;
}

.account-back-btn:hover {
  background: var(--md-sys-color-surface-container-highest);
}

.account-back-btn svg {
  width: 24px !important;
  height: 24px !important;
}

.account-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin: 0;
  letter-spacing: -0.5px;
}

/* Profile Card */
.account-profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--md-sys-color-surface-container-high);
  border-radius: 32px;
  border: none;
  margin: 0 8px 24px;
  box-shadow: none;
}

.account-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--md-sys-color-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.account-avatar-fallback {
  color: var(--md-sys-color-on-primary-container);
}

.account-avatar-fallback svg {
  width: 40px !important;
  height: 40px !important;
}

.account-profile-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-profile-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-profile-provider {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-highest);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  width: fit-content;
}

.provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-on-surface-variant);
}

/* Section */
.account-section {
  padding: 0 8px 16px;
  border-bottom: none;
}

.account-section-header {
  padding: 8px 16px 16px;
}

.account-section-title {
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* List Item (Card Style) */
.account-item {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
}

.account-item-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-primary);
  flex-shrink: 0;
}

.account-item-icon svg {
  width: 28px !important;
  height: 28px !important;
}

.account-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.account-item-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.account-item-description {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

.account-item-action {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.account-item-value {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--md-sys-color-surface-container-highest);
  font-size: 15px;
  font-family: "SF Mono", "Monaco", monospace;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  letter-spacing: 0.5px;
}

/* M3 Expressive Field */
.m3-filled-field {
  flex: 1;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--md-sys-color-surface-container-highest);
  display: flex;
  align-items: center;
  padding: 0 20px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.m3-filled-field:hover {
  background: var(--md-sys-color-secondary-container);
}

.m3-filled-field:focus-within {
  background: var(--md-sys-color-secondary-container);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}

.m3-filled-field-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface);
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.m3-filled-field-input::placeholder {
  color: rgba(202, 196, 208, 0.5);
}

/* M3 Expressive Icon Button */
.m3-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s;
}

.m3-icon-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

.m3-icon-btn:active {
  transform: scale(0.95);
}

.m3-icon-btn svg {
  width: 24px !important;
  height: 24px !important;
}

/* Save Status */
.account-save-status {
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  margin-top: 12px;
  text-align: center;
  animation: modalEnter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.account-save-status--ok {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
}

.account-save-status--err {
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
}

/* Logout Button */
.account-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: calc(100% - 16px);
  margin: 8px auto 24px;
  padding: 16px;
  border-radius: var(--radius-full);
  border: none;
  background: #3F1D1D; /* Deep red error container */
  color: #F9DEDC; /* On error container */
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.account-logout-btn:hover {
  background: #522222;
  transform: scale(1.02);
}

.account-logout-btn:active {
  transform: scale(0.96);
}

.account-logout-btn svg {
  width: 22px !important;
  height: 22px !important;
}

/* Responsive */
@media (max-width: 480px) {
  .account-panel {
    max-width: 100%;
    top: auto;
    bottom: 0;
    border-radius: 36px 36px 0 0;
    transform: translateY(100%);
    max-height: 92vh;
    padding: 8px;
  }

  .account-panel--visible {
    transform: translateY(0);
  }

  .account-header {
    padding: 20px 12px;
  }

  .account-profile-card {
    padding: 20px;
    margin: 0 4px 20px;
    border-radius: var(--radius-xl);
  }

  .account-item {
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 24px;
  }
  
  .m3-filled-field {
    height: 52px;
  }
  
  .m3-icon-btn {
    width: 52px;
    height: 52px;
  }
}

/* =================================================================
   MOBILE FIX v3 — CENTER CONTROLS + CLEAN LAYOUT
   ================================================================= */

.hidden { display: none !important; }
.controls-panel.hidden { display: none !important; opacity: 0 !important; pointer-events: none !important; }

body.mode-call { padding: 0 !important; overflow: hidden !important; }

@media (max-width: 768px) {

  body:not(.mode-call) {
    padding: 20px 16px !important;
    overflow-y: auto !important;
    align-items: flex-start !important;
  }

  /* ── ВИДЕО НА ВЕСЬ ЭКРАН ── */
  body.mode-call .screen-container:not(.hidden) {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100dvh !important;
    transform: none !important;
    border-radius: 0 !important; border: none !important;
    margin: 0 !important; max-width: none !important;
    box-shadow: none !important; background: #08080f !important;
    z-index: 50 !important;
  }

  /* ── ТОП-ОСТРОВОК ── */
  body.mode-call .app-header {
    position: fixed !important;
    top: 20px !important; left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important; height: auto !important;
    padding: 10px 18px !important; gap: 10px !important;
    margin: 0 !important; z-index: 22000 !important;
    display: inline-flex !important;
    align-items: center !important; justify-content: center !important;
    flex-wrap: nowrap !important; white-space: nowrap !important;
    background: rgba(28,25,36,0.92) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 28px rgba(0,0,0,0.55) !important;
  }

  body.mode-call .call-timer {
    font-size: 14px !important; font-weight: 600 !important;
    color: #ede8ff !important; font-variant-numeric: tabular-nums !important;
  }

  body.mode-call .header-separator:not(.hidden) {
    display: block !important; width: 1px !important; height: 16px !important;
    background: rgba(255,255,255,0.18) !important; margin: 0 !important;
  }

  body.mode-call .participant-badge:not(.hidden) {
    display: inline-flex !important; align-items: center !important;
    gap: 5px !important; font-size: 14px !important; font-weight: 500 !important;
    color: #cfc8e8 !important; background: transparent !important;
    padding: 0 !important; margin: 0 !important; border: none !important;
    box-shadow: none !important; border-radius: 0 !important; animation: none !important;
  }

  body.mode-call .participant-badge svg { width: 15px !important; height: 15px !important; }

  body.mode-call .header-invite-btn:not(.hidden) {
    display: flex !important; align-items: center !important;
    justify-content: center !important;
    width: 34px !important; height: 34px !important;
    padding: 0 !important; margin-left: 2px !important;
    border-radius: 50% !important;
    background: rgba(208,188,255,0.1) !important;
    border: 1px solid rgba(208,188,255,0.2) !important;
  }

  body.mode-call .invite-text { display: none !important; }
  body.mode-call .app-header-right { display: none !important; }

  /* ══════════════════════════════════════════════
     НИЖНЯЯ ПАНЕЛЬ — КНОПКИ СТРОГО ПО ЦЕНТРУ
  ══════════════════════════════════════════════ */

  .controls-panel:not(.hidden) {
    position: fixed !important;
    bottom: 0 !important; left: 0 !important; right: 0 !important;
    transform: none !important; opacity: 1 !important;
    width: 100% !important; max-width: none !important;

    /* ✅ ЦЕНТРИРОВАНИЕ ГРУППЫ КНОПОК */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;

    padding: 20px 24px calc(30px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;

    background: linear-gradient(
      to top,
      rgba(8,7,14,1.0)  0%,
      rgba(8,7,14,0.92) 40%,
      rgba(8,7,14,0.55) 70%,
      rgba(8,7,14,0.0)  100%
    ) !important;
    border: none !important; border-radius: 0 !important;
    box-shadow: none !important; backdrop-filter: none !important;
    z-index: 1000 !important;
  }

  /* Скрыть screen share на мобилке */
  .controls-panel .share-dropdown,
  .controls-panel #shareBtn,
  .controls-panel #stopShareBtn { display: none !important; }

  /* Скрыть flip camera — нет места */
  .controls-panel #flipCameraBtn { display: none !important; }

  /* ── Все кнопки одинакового размера ── */
  .controls-panel:not(.hidden) .control-btn {
    width: 64px !important; height: 64px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important; flex-grow: 0 !important;
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    transform: none !important; margin: 0 !important;
  }

  .controls-panel:not(.hidden) .control-btn span { display: none !important; }

  /* ── МИК: пилюля ── */
  .controls-panel:not(.hidden) .mic-dropdown {
    height: 64px !important;
    flex-shrink: 0 !important; flex-grow: 0 !important;
    display: flex !important; align-items: stretch !important;
    border-radius: var(--radius-full) !important; overflow: visible !important;
    padding: 0 !important; gap: 0 !important; margin: 0 !important;
    background-color: var(--color-primary) !important; color: var(--color-primary-on) !important;
  }

  .controls-panel:not(.hidden) .mic-dropdown:has(.muted) {
    background-color: #383245 !important; color: #b8b0cc !important;
  }

  .controls-panel:not(.hidden) .mic-main-btn {
    width: 64px !important; height: 100% !important;
    border-radius: var(--radius-full) 0 0 100px !important;
    background: transparent !important; color: inherit !important;
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    padding: 0 !important; margin: 0 !important; border: none !important;
    box-shadow: none !important; transform: none !important;
    position: relative !important; overflow: hidden !important;
  }

  .controls-panel:not(.hidden) .mic-dropdown-toggle {
    width: 28px !important; height: 100% !important;
    border-radius: 0 100px 100px 0 !important;
    background: rgba(0,0,0,0.1) !important;
    border-left: 1px solid rgba(0,0,0,0.12) !important;
    display: flex !important;
    align-items: center !important; justify-content: center !important;
    padding: 0 !important; margin: 0 !important;
    color: inherit !important; flex-shrink: 0 !important;
  }

  .controls-panel:not(.hidden) .mic-dropdown-toggle svg { width: 14px !important; height: 14px !important; }

  /* ── ЗАВЕРШИТЬ: красная пилюля ── */
  .controls-panel:not(.hidden) #hangBtn {
    width: 74px !important; height: 64px !important;
    border-radius: var(--radius-full) !important;
    background: #C0392B !important; color: #fff !important;
    box-shadow: 0 6px 20px rgba(192,57,43,0.4) !important;
  }

  .controls-panel:not(.hidden) #hangBtn svg {
    width: 26px !important; height: 26px !important; fill: #fff !important;
  }

  /* ── КАМЕРА ── */
  /* На мобилке camera-dropdown выглядит как обычная круглая кнопка */
  .controls-panel:not(.hidden) .camera-dropdown {
    height: 64px !important;
    background-color: #4A3F6A !important;
    border-radius: 50% !important;
    width: 64px !important;
    flex-shrink: 0 !important;
  }

  /* Скрыть стрелку на мобилке */
  .controls-panel:not(.hidden) #cameraDropdownToggle {
    display: none !important;
  }

  .controls-panel:not(.hidden) #cameraBtn {
    width: 64px !important; height: 64px !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: var(--color-secondary-on) !important;
  }

  .controls-panel:not(.hidden) .camera-dropdown:has(#cameraBtn.sharing-active) {
    background-color: #6750A4 !important;
  }

  .controls-panel:not(.hidden) #cameraBtn.camera-off {
    background: transparent !important; color: #6a6080 !important;
  }

  /* ── Dropdown меню микрофона ── */
  .mic-dropdown-menu:not(.hidden) {
    position: fixed !important;
    bottom: calc(94px + env(safe-area-inset-bottom, 0px)) !important;
    left: 16px !important; right: 16px !important;
    width: auto !important; transform: none !important;
    border-radius: 24px !important;
    background: #181520 !important;
    border: 1px solid rgba(255,255,255,0.09) !important;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.6) !important;
    padding: 20px !important;
    animation: mMenuUp 0.28s cubic-bezier(0.2,0,0,1) !important;
  }

  @keyframes mMenuUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }

  .participant-banner:not(.hidden) {
    bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
    left: 16px !important; right: 16px !important; max-width: none !important;
  }
}

/* Маленькие телефоны */
@media (max-width: 390px) {
  .controls-panel:not(.hidden) {
    gap: 12px !important;
    padding-left: 16px !important; padding-right: 16px !important;
  }
  .controls-panel:not(.hidden) .control-btn { width: 58px !important; height: 58px !important; }
  .controls-panel:not(.hidden) .mic-dropdown { height: 58px !important; }
  .controls-panel:not(.hidden) .mic-main-btn { width: 58px !important; }
  .controls-panel:not(.hidden) #hangBtn { width: 68px !important; height: 58px !important; }
}

/* ================================================================
   CO-WATCH YOUTUBE PANEL  (extras-youtube.js)
   ================================================================ */

/* ── Panel shell ── */
.ytcw-panel {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-background, #0f0d13);
  z-index: 31000;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.2, 0, 0, 1);
  overscroll-behavior: contain;
}
.ytcw-panel.hidden { display: none !important; }
.ytcw-panel.ytcw-panel--visible { transform: translateX(0); }

/* ── Header ── */
.ytcw-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  background: var(--color-surface-container);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ytcw-back-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ytcw-back-btn:hover { background: rgba(255,255,255,0.08); }
.ytcw-back-btn svg { width: 22px; height: 22px; fill: currentColor; }

.ytcw-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}
.ytcw-yt-icon {
  width: 20px; height: 20px;
  fill: var(--color-youtube);
  flex-shrink: 0;
}

/* Sync dot (top-right) */
.ytcw-sync-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s, box-shadow 0.3s;
}
.ytcw-sync-dot--idle   { background: rgba(255,255,255,0.18); }
.ytcw-sync-dot--loading{ background: var(--color-warning); animation: ytcwPulse 1s ease-in-out infinite; }
.ytcw-sync-dot--ok     { background: var(--color-success); box-shadow: 0 0 6px rgba(74,222,128,0.5); }
.ytcw-sync-dot--warn   { background: var(--color-warning); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.ytcw-sync-dot--bad    { background: var(--color-error-solid); animation: ytcwPulse 0.8s ease-in-out infinite; }

@keyframes ytcwPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── URL bar ── */
.ytcw-url-bar {
  padding: 12px 16px;
  background: var(--color-surface-container);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.ytcw-url-field {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 0;
  transition: border-color 0.2s;
}
.ytcw-url-field:focus-within {
  border-color: var(--color-primary);
  background: rgba(208,188,255,0.05);
}
.ytcw-url-prefix-icon {
  width: 20px; height: 20px;
  fill: var(--color-youtube);
  flex-shrink: 0;
  margin-left: 14px;
}
.ytcw-url-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  padding: 11px 10px 11px 8px;
  outline: none;
  min-width: 0;
}
.ytcw-url-input::placeholder { color: rgba(202,196,208,0.4); }

.ytcw-load-btn {
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, color 0.15s;
}
.ytcw-load-btn:hover  { background: rgba(208,188,255,0.12); color: #fff; }
.ytcw-load-btn:active { background: rgba(208,188,255,0.2); }
.ytcw-load-btn svg    { width: 20px; height: 20px; fill: currentColor; }

/* Load spinner */
.ytcw-load-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(208,188,255,0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: ytcwSpin 0.7s linear infinite;
}
@keyframes ytcwSpin { to { transform: rotate(360deg); } }

/* ── Player area ── */
.ytcw-player-area {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

/* Placeholder */
.ytcw-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(202,196,208,0.4);
  text-align: center;
  padding: 32px 24px;
  width: 100%;
}
.ytcw-placeholder svg {
  width: 56px; height: 56px;
  fill: rgba(255,0,0,0.25);
}
.ytcw-placeholder p {
  font-size: 15px;
  font-weight: 500;
  color: rgba(202,196,208,0.55);
  line-height: 1.5;
  margin: 0;
}
.ytcw-hint-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.ytcw-hint-list span {
  font-size: 11px;
  color: rgba(202,196,208,0.3);
  font-family: monospace;
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 6px;
}

/* Player container fills the area, 16:9 */
.ytcw-player-container {
  position: absolute;
  inset: 0;
}
.ytcw-player-container:empty { display: none; }
.ytcw-player-container > div,
.ytcw-player-container iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Fullscreen button */
.ytcw-fs-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, opacity 0.2s;
  opacity: 0;
  z-index: 2;
}
.ytcw-player-area:hover .ytcw-fs-btn { opacity: 1; }
.ytcw-fs-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* CSS-fallback fullscreen for iOS */
.ytcw-player-area--fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
}

/* ── Status bar ── */
.ytcw-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-surface-container);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  min-height: 48px;
}

/* Drift pill */
.ytcw-drift-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(202,196,208,0.7);
  transition: background 0.2s, border-color 0.2s;
}
.ytcw-drift-pill svg { width: 13px; height: 13px; fill: currentColor; }
.ytcw-drift-pill.ytcw-drift-ok   { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.35); color: var(--color-success); }
.ytcw-drift-pill.ytcw-drift-warn { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35); color: var(--color-warning); }
.ytcw-drift-pill.ytcw-drift-bad  { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.35);  color: var(--color-error-solid); }

/* Peer pill */
.ytcw-peer-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(202,196,208,0.6);
  margin-left: auto;
}
.ytcw-peer-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}
.ytcw-peer-dot--online  { background: var(--color-success); box-shadow: 0 0 5px rgba(74,222,128,0.5); }
.ytcw-peer-dot--wait    { background: var(--color-warning); animation: ytcwPulse 1.2s ease-in-out infinite; }
.ytcw-peer-dot--offline { background: rgba(255,255,255,0.2); }

/* ── Incoming video invite toast ── */
.ytcw-invite-toast {
  position: absolute;
  left: 12px; right: 12px; bottom: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface-toast);
  border: 1px solid rgba(208,188,255,0.25);
  border-radius: 16px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  z-index: 2;
}
.ytcw-invite-toast--visible { transform: translateY(0); opacity: 1; }

.ytcw-invite-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ytcw-invite-icon svg { width: 20px; height: 20px; fill: var(--color-youtube); }

.ytcw-invite-text { flex: 1; min-width: 0; }
.ytcw-invite-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.ytcw-invite-sub   { font-size: 11px; color: rgba(202,196,208,0.55); margin-top: 2px;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ytcw-invite-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ytcw-invite-btn {
  padding: 7px 13px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.ytcw-invite-accept  { background: var(--color-primary); color: var(--color-primary-on); }
.ytcw-invite-accept:hover  { background: var(--color-secondary-on); }
.ytcw-invite-decline { background: rgba(255,255,255,0.08); color: var(--color-text-muted); }
.ytcw-invite-decline:hover { background: rgba(255,255,255,0.14); }

/* ── Shake animation (bad URL) ── */
.ytcw-shake {
  animation: ytcwShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes ytcwShake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-5px); }
  30%      { transform: translateX(5px); }
  45%      { transform: translateX(-4px); }
  60%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
  90%      { transform: translateX(2px); }
}

/* ── Mobile safe area ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .ytcw-status-bar { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* ── Extras panel: enable YouTube item ── */
.extras-item.extras-item--yt {
  pointer-events: auto !important;
  opacity: 1 !important;
  cursor: pointer !important;
}
.extras-item.extras-item--yt:hover {
  background: rgba(255,0,0,0.06) !important;
}
.extras-item.extras-item--yt .extras-item-icon {
  background: rgba(255,0,0,0.1) !important;
  color: var(--color-youtube) !important;
}

/* ================================================================
   CAMERA DROPDOWN (desktop + mobile picker)
   ================================================================ */

/* Wrapper — same pattern as .mic-dropdown */
/* Camera dropdown — styled as pill, same pattern as .mic-dropdown */
.camera-dropdown {
  position: relative;
  display: flex !important;
  align-items: stretch;
  padding: 0 !important;
  gap: 1px;
  overflow: visible !important;
  border-radius: 16px !important;
  background-color: #4A3F6A !important;
  color: var(--color-secondary-on) !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
  box-shadow: none !important;
  height: 56px !important;
}

.camera-dropdown:hover {
  transform: translateY(-4px);
  filter: brightness(1.08);
}

/* Camera active state */
.camera-dropdown:has(#cameraBtn.sharing-active) {
  background-color: #6750A4 !important;
}

/* Camera unavailable / off state */
.camera-dropdown:has(#cameraBtn.cam-unavailable) {
  background-color: var(--color-outline-variant) !important;
  opacity: 0.55;
}

#cameraBtn {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  width: 56px !important;
  height: 100% !important;
  border-radius: 16px 4px 4px 16px !important;
  margin: 0 !important;
  color: inherit !important;
  box-shadow: none !important;
  transform: none !important;
  padding: 0 !important;
  border: none !important;
}

/* When dropdown arrow is hidden, full pill */
.camera-dropdown:not(.has-toggle) #cameraBtn {
  border-radius: 16px !important;
  width: 56px !important;
}

/* The small arrow toggle shown only on desktop */
#cameraDropdownToggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: row !important;
  gap: 0 !important;
  min-width: 32px !important;
  width: 32px !important;
  height: 100% !important;
  border-radius: 4px 16px 16px 4px !important;
  background: rgba(0,0,0,0.15) !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-left: 1px solid rgba(0,0,0,0.15) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

#cameraDropdownToggle svg.dropdown-arrow {
  width: 16px !important;
  height: 16px !important;
  transition: transform 0.2s;
}

#cameraDropdownToggle.open svg.dropdown-arrow {
  transform: rotate(180deg);
}

/* Camera device dropdown menu */
.camera-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--color-surface-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg, 14px);
  padding: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.camera-dropdown-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--color-surface-card);
}

/* Camera unavailable state */
#cameraBtn.cam-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

#cameraBtn .cam-icon-off {
  /* SVG with exclamation badge */
}

.cam-no-devices-text {
  font-size: 12px;
  color: var(--color-text-muted, #888);
  text-align: center;
  padding: 4px 0;
}

/* ================================================================
   MOBILE CAMERA PICKER MODAL
   ================================================================ */

.mobile-cam-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-cam-picker-overlay.hidden {
  display: none;
}

.mobile-cam-picker-modal {
  background: var(--color-surface-card, #1a1a2e);
  border-radius: 24px 24px 16px 16px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpModal {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

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

.mobile-cam-picker-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary, #fff);
}

.mobile-cam-picker-close {
  background: rgba(255,255,255,0.08);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted, #aaa);
  padding: 0;
}

.mobile-cam-picker-close svg { width: 16px; height: 16px; }

/* Preview */
.mobile-cam-preview-wrap {
  position: relative;
  background: #0a0a14;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-cam-preview-video {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror front cam by default */
}

.mobile-cam-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  pointer-events: none;
}

.mobile-cam-preview-placeholder.hidden { display: none; }

/* Camera option buttons */
.mobile-cam-picker-options {
  display: flex;
  gap: 10px;
}

.mobile-cam-option-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.05);
  border: 2px solid transparent;
  border-radius: 14px;
  color: var(--color-text-muted, #aaa);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}

.mobile-cam-option-btn.active {
  border-color: var(--color-primary, #8b5cf6);
  background: rgba(139,92,246,0.12);
  color: var(--color-primary, #8b5cf6);
}

/* Start button */
.mobile-cam-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--color-primary, #8b5cf6);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.mobile-cam-start-btn:active { opacity: 0.85; }
/* ================================================================
   DESKTOP CAMERA PREVIEW MODAL
   ================================================================ */

.desktop-cam-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-cam-preview-overlay.hidden {
  display: none;
}

.desktop-cam-preview-modal {
  background: var(--color-surface-card, #1E1F22);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px;
  width: 420px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.7);
  animation: desktopCamPreviewIn 0.28s cubic-bezier(0.2,0,0,1);
}

@keyframes desktopCamPreviewIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.desktop-cam-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--color-text, #E6E0E9);
}

.desktop-cam-preview-header span {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.desktop-cam-preview-hint {
  width: 100%;
  font-size: 12px;
  color: var(--color-text-muted, #CAC4D0);
  margin: 4px 0 0;
  line-height: 1.5;
}

.desktop-cam-preview-video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0a0a0f;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.desktop-cam-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transform: scaleX(-1); /* mirror for natural selfie view */
}

.desktop-cam-preview-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.desktop-cam-preview-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.desktop-cam-preview-btn--cancel {
  background: rgba(255,255,255,0.07);
  color: var(--color-text-muted, #CAC4D0);
  border: 1px solid rgba(255,255,255,0.1);
}

.desktop-cam-preview-btn--cancel:hover {
  background: rgba(255,255,255,0.12);
  color: var(--color-text, #E6E0E9);
}

.desktop-cam-preview-btn--confirm {
  background: #6750A4;
  color: #fff;
}

.desktop-cam-preview-btn--confirm:hover {
  background: #7965AF;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(103,80,164,0.4);
}