/* ===== ОБНОВЛЕННЫЙ СТРОГИЙ МАТОВЫЙ ДИЗАЙН ===== */

/* 1. Канвас для частиц (ставим между фоном и контентом) */
.background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* Выше app-background (-1), но ниже container (1) */
  pointer-events: none;
  opacity: 0.6;
}

/* 2. Стеклянная карточка-контейнер */
.menu-card {
  background: rgba(20, 20, 20, 0.4); /* Полупрозрачная заливка */
  backdrop-filter: blur(24px);       /* Сильное размытие фона под карточкой */
  -webkit-backdrop-filter: blur(24px);
  
  border: 1px solid rgba(255, 255, 255, 0.08); /* Тонкая рамка */
  border-top: 1px solid rgba(255, 255, 255, 0.12); /* Свет сверху чуть ярче */
  border-radius: 24px;
  
  padding: 32px; /* Внутренний отступ */
  
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4), /* Глубокая тень */
    inset 0 0 0 1px rgba(255, 255, 255, 0.02); /* Внутренний блик */
    
  transition: transform 0.4s ease, opacity 0.4s ease;
  margin-bottom: 24px;
}

/* При наведении на карточку она чуть-чуть всплывает */
.menu-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* 3. Декоративная сетка (Grid Floor) */
/* Добавляем псевдоэлемент к .app-background для создания пола */
.app-background::before {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -50%;
  width: 200%;
  height: 60%;
  background: 
    linear-gradient(transparent 0%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(60deg); /* 3D перспектива */
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 100%); /* Исчезает вдали */
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(60px); }
}

/* Скрываем карточку и сетку во время активного звонка, чтобы не отвлекали */
body.mode-call .menu-card {
  display: none;
}
body.mode-call .app-background::before {
  opacity: 0;
  transition: opacity 1s ease;
}

/* Адаптация карточки под мобильные */
@media (max-width: 480px) {
  .menu-card {
    padding: 20px;
    border-radius: 20px;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Убираем подсветку при тапе на мобильных */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Блокируем "пружину" и скролл всей страницы */
html {
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

* {
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
}

body {
  background: #000000;
  color: #f0f0f0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

.container {
  max-width: 440px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 48px;
}

h1 {
  font-weight: 500;
  font-size: 24px;
  color: #fff;
  letter-spacing: -0.5px;
  opacity: 0.9;
  margin-bottom: 12px;
}

.subtitle {
  color: #888;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.card, .settings-panel, .create-screen, .join-screen {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* ===== НОВЫЙ ДИЗАЙН КНОПОК МЕНЮ ===== */

.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.mode-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* Эффект подсветки при наведении */
.mode-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mode-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Иконка слева в кружочке */
.btn-icon-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  margin-right: 16px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mode-btn:hover .btn-icon-bg {
  background: #fff;
  color: #000; /* Иконка становится черной на белом фоне */
}

/* Текстовый блок */
.btn-text-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.btn-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.btn-desc {
  font-size: 13px;
  color: #888;
  font-weight: 400;
}

.mode-btn:hover .btn-desc {
  color: #bbb;
}

/* Стрелочка справа */
.btn-arrow {
  color: #555;
  transition: transform 0.3s ease, color 0.3s ease;
}

.mode-btn:hover .btn-arrow {
  color: #fff;
  transform: translateX(4px);
}

/* Специфичный стиль для кнопки "Создать" (можно добавить акцент, если хочется) */
.mode-create:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Отключенное состояние (если не авторизован) */
.mode-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: rgba(255, 255, 255, 0.02);
}

.mode-btn:disabled:hover {
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.08);
}

.settings-panel {
  display: none;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 24px;
}

.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 #333;
}

.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: #333;
  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;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 14px;
  color: #b0b0b0;
  margin-bottom: 8px;
  font-weight: 500;
}

.settings-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a; /* Изменено с transparent на темный цвет */
  color: #f0f0f0;
  font-size: 14px;
  cursor: pointer;
}

/* Добавлено: стили для выпадающих пунктов */
.settings-select option {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

.settings-select:focus {
  outline: none;
  border-color: #fff;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.create-screen,
.join-screen {
  display: none;
}

.create-screen.active,
.join-screen.active {
  display: block;
}

.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);
  background: transparent;
  border: none;
  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 #333;
  cursor: pointer;
}

.room-url-value:hover {
  border-color: #fff;
  background: transparent;
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#roomInput {
  width: 100%;
  padding: 20px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid #333;
  border-radius: 0;
  font-size: 48px;
  font-weight: 200;
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 12px;
  color: #fff;
  transition: border-color 0.3s ease;
}

#roomInput:focus {
  outline: none;
  border-bottom-color: #fff;
  background: transparent;
}

#roomInput::placeholder {
  color: #666;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 500;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-btn {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 100px;
  background: #fff;
  color: #000;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: transform 0.2s;
}

.action-btn:hover {
  background: #e0e0e0;
  transform: scale(1.02);
}

.action-btn:disabled {
  background: #444;
  cursor: not-allowed;
  color: #888;
}

.settings-btn {
  background: #333 !important;
  color: #f0f0f0 !important;
  border: 1px solid #444 !important;
  font-size: 14px;
  padding: 14px;
}

.settings-btn:hover {
  background: #444 !important;
  color: #ffffff !important;
}

.exit-btn {
  background: #333;
  color: #f0f0f0;
  border-color: #444;
}

.exit-btn:hover {
  background: #444;
  border-color: #555;
  color: #ffffff;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  font-weight: 600;
}

.status.disconnected {
  background: #333;
  color: #888;
  border: 1px solid #444;
}

.status.waiting {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status.connected {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  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 .status-indicator {
  background: #fbbf24;
  animation: statusPulse 2s ease-in-out infinite;
}

.status.connected .status-indicator {
  background: #4ade80;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.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: #4ade80;
}

.connection-quality.good .quality-bar {
  background: #fbbf24;
}

.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: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  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 #333;
}

.stats-header h3 {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.stats-close {
  background: #333;
  border: none;
  color: #f0f0f0;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-close:hover {
  background: #444;
}

.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 #333;
}

.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 #333;
  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;
}

/* ===== АНИМАЦИЯ ПУЛЬСАЦИИ (POP) ===== */
/* Важно сохранить translateX(-50%), чтобы панель не съезжала при анимации */
@keyframes controlsPop {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
  100% { transform: translateX(-50%) scale(1); }
}

/* ===== БАЗОВЫЙ СТИЛЬ ПАНЕЛИ ===== */
.controls-panel {
  position: fixed;
  bottom: 40px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 12px 24px;
  
  /* Стандартный темный фон */
  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  border-radius: 100px;
  width: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  z-index: 1000;

  /* Плавный переход цветов */
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.controls-panel.hidden {
  display: none;
}

/* ===== СОСТОЯНИЯ (ЦВЕТА) ===== */

/* 1. Переподключение: Размытый Оранжевый */
.controls-panel.state-reconnecting {
  background: rgba(245, 158, 11, 0.45) !important; /* Amber */
  border-color: rgba(245, 158, 11, 0.8) !important;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
  /* Анимация POP при появлении статуса */
  animation: controlsPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. Успех: Размытый Белый */
.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);
}

/* 3. Ошибка/Сбой: Размытый Красный */
.controls-panel.state-error {
  background: rgba(239, 68, 68, 0.45) !important; /* Red */
  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);
}

/* ===== ОБНОВЛЕННЫЙ БАННЕРА (MATTE BLACK) ===== */
.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 #333; /* Темная рамка вместо светлой */
  border-radius: 100px; /* Капсула */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6); /* Черная тень вместо синей */
  
  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: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.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;
}

/* Убираем старую галочку через CSS */
.participant-banner .banner-icon::before {
  content: none;
}

.participant-banner .banner-text {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .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;
  }
}

.control-btn {
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: #fff;
  font-weight: 600;
  width: 48px;
  height: 48px;
  min-width: auto;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.control-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5px;
}

.control-btn span {
  display: none;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: translateY(-2px);
  border-color: transparent;
}

.controls-panel:hover .control-btn {
  opacity: 0.7; /* Затеняем все кнопки, когда мышь на панели */
}

.controls-panel .control-btn:hover {
  opacity: 1; /* Активная кнопка яркая */
  transform: translateY(-4px) scale(1.1); /* Всплывает вверх */
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.control-btn.muted {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.control-btn.muted:hover {
  background: #ff3b30;
  color: #000;
}

.control-btn.sharing-active {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.control-btn.sharing-active:hover {
  background: #4ade80;
  color: #000;
}

.control-btn.hang-btn {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.control-btn.hang-btn:hover {
  background: #ff3b30;
  color: #000;
}

/* --- В файле style.css --- */

/* Базовый стиль кнопки микрофона */
#muteBtn {
  /* Переменная по умолчанию 0 */
  --mic-level: 0;
  position: relative;
  overflow: visible; /* Чтобы свечение не обрезалось */
  transition: background-color 0.2s, color 0.2s; /* Убираем transition на transform, чтобы не было лагов */
}

/* Иконка ВКЛЮЧЕННОГО микрофона */
#muteBtn .mic-on {
  /*
     1. Масштаб: от 1 до 1.3 в зависимости от громкости.
     2. Тень: Белое свечение вокруг иконки.
  */
  transform: scale(calc(1 + var(--mic-level) * 0.3));
  filter: drop-shadow(0 0 calc(var(--mic-level) * 10px) rgba(255, 255, 255, 0.6));

  /* Важно: will-change для производительности */
  will-change: transform, filter;
  /* Плавность движения, чтобы не дергалось резко */
  transition: transform 0.05s linear, filter 0.05s linear;
}

/* Дополнительный эффект: Внутреннее заполнение кнопки при громком крике */
#muteBtn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);

  /* Круг становится видимым только когда вы говорите */
  opacity: var(--mic-level);
  transform: scale(calc(0.8 + var(--mic-level) * 0.4));

  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
  z-index: 0;
}

/* Убедимся, что иконка поверх эффекта */
#muteBtn svg {
  position: relative;
  z-index: 1;
}

/* Когда микрофон выключен (класс muted) - убираем эффекты */
#muteBtn.muted {
  --mic-level: 0 !important;
}
#muteBtn.muted .mic-off {
  transform: scale(1);
  filter: none;
}

.mic-dropdown {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.mic-main-btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.mic-dropdown-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center;
  gap: 0 !important;
  padding: 0 !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 48px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.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-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100vw - 32px);
  max-width: 280px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  z-index: 1001;
}

.dropdown-section {
  margin-bottom: 12px;
}

.dropdown-section:last-child {
  margin-bottom: 0;
}

.dropdown-section label {
  display: block;
  font-size: 12px;
  color: #b0b0b0;
  margin-bottom: 6px;
  font-weight: 600;
}

.dropdown-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a; /* ИЗМЕНЕНО: вместо transparent ставим темный цвет */
  color: #f0f0f0;
  font-size: 12px;
  cursor: pointer;
  appearance: none; /* Опционально: убирает стандартную стрелку браузера, чтобы стиль был строже */
  -webkit-appearance: none;
  -moz-appearance: none;
}

.dropdown-select:focus {
  outline: none;
  border-color: #fff;
}

/* ДОБАВЛЕНО: стилизация выпадающих опций */
.dropdown-select option {
  background-color: #1a1a1a;
  color: #f0f0f0;
  padding: 10px;
}

.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 #333;
  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);
}

.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 {
  display: none;
}

#speakerIndicator {
  display: none !important;
}

/* 1. ТАЙМЕР ЗВОНКА (СЛЕВА) */
.call-timer {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 22000;
  
  /* Наследуем стили капсулы */
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  padding: 0 16px;
  color: #f0f0f0;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.call-timer.hidden {
  display: none;
}

/* АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ */
@media (max-width: 640px) {
  /* Уменьшаем отступы и размеры */
  
  /* Таймер */
  .call-timer {
    top: 16px;
    left: 16px;
    padding: 0 12px;
    height: 36px;
    font-size: 12px;
  }

  /* Заголовок */
  body.mode-call .app-header {
    top: 16px;
    height: 36px;
    padding: 0 16px;
    gap: 6px;
  }
  
  body.mode-call .app-header h1 {
    font-size: 14px;
  }
  
  /* Код комнаты */
  .call-room-code {
    top: 16px;
    right: 16px;
    left: auto;
    transform: none;
    padding: 0 12px;
    height: 36px;
    font-size: 12px;
    border-radius: 100px; /* Сохраняем капсулу */
    background: rgba(20, 20, 20, 0.75);
  }
  
  .code-label-text {
    display: none; /* Скрываем слово "КОД" на мобильных для экономии места */
  }
  
  .code-value-text {
    font-size: 13px;
    letter-spacing: 0.5px;
  }
}
/* ===== КОНТЕЙНЕР ДЛЯ ВИДЕО/ЭКРАНА (ОБНОВЛЕННЫЙ) ===== */
.screen-container {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  
  /* Размеры: на ПК до 90% ширины/высоты, но не больше 1280px */
  width: 90vw;
  height: 80vh;
  max-width: 1280px;
  max-height: 720px;
  
  background: #000; /* Черный фон для полос */
  border-radius: 16px; /* Закругление */
  overflow: hidden;
  
  /* Убрали яркую рамку, оставили тонкую "стеклянную" */
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.screen-container.hidden {
  display: none !important;
}

.screen-container video {
  width: 100%;
  height: 100%;
  /* САМОЕ ВАЖНОЕ: contain показывает всё изображение целиком, не обрезая и не растягивая */
  object-fit: contain; 
  background: #000;
}

/* Для режима камеры на весь экран (если нужно) можно раскомментировать, 
   но contain лучше для кросс-платформенности */
/* .screen-container.camera-mode video { object-fit: cover; } */

.screen-info {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 101;
  pointer-events: none;
}

.screen-fullscreen-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 101;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.screen-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 640px) {
  .screen-container {
    width: 100vw;
    height: 100vh; /* На весь экран телефона */
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
    background: #000;
  }
  
  .screen-info {
    top: safe-area-inset-top + 10px;
    left: 10px;
  }
  
  .screen-fullscreen-btn {
    top: safe-area-inset-top + 10px;
    right: 10px;
  }
}

.notifications-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
  width: auto;
}

.notification-item {
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(80, 80, 80, 0.3);
  border-radius: 8px;
  padding: 12px 18px;
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-10px);
  animation: notificationSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 400px;
  min-width: 200px;
  transition: all 0.2s ease;
}

.notification-item:hover {
  background: rgba(35, 35, 35, 0.98);
  border-color: rgba(100, 100, 100, 0.4);
}

.notification-item.removing {
  animation: notificationSlideOut 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes notificationSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notificationSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

.notification-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.notification-item.info .notification-icon {
  background: rgba(100, 100, 100, 0.2);
  color: #a0a0a0;
}

.notification-item.success .notification-icon {
  background: rgba(80, 200, 120, 0.15);
  color: #50c878;
}

.notification-item.warning .notification-icon {
  background: rgba(255, 180, 0, 0.15);
  color: #ffb400;
}

.notification-item.error .notification-icon {
  background: rgba(255, 80, 80, 0.15);
  color: #ff5050;
}

.notification-text {
  flex: 1;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.modal-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}

.modal-dialog.hidden {
  display: none;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 0;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
  margin-bottom: 20px;
}

.modal-header h3 {
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.modal-close {
  background: #333;
  border: none;
  color: #f0f0f0;
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #444;
}

.modal-body {
  padding: 0 24px;
}

.quality-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a; /* Изменено с transparent на темный цвет */
  color: #f0f0f0;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 12px;
}

/* Добавлено: стили для выпадающих пунктов */
.quality-select option {
  background-color: #1a1a1a;
  color: #f0f0f0;
}

.quality-select:focus {
  outline: none;
  border-color: #fff;
}

.quality-preview {
  margin-top: 20px;
  padding: 16px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 10px;
}

.preview-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  color: #888;
  gap: 6px;
}

.preview-info span {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.quality-description {
  font-size: 13px;
  color: #f0f0f0;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 24px;
  margin-top: 20px;
  border-top: 1px solid #333;
}

.modal-actions .action-btn {
  flex: 1;
}

.action-btn.primary {
  background: #fff;
  color: #000;
}

.action-btn.primary:hover {
  background: #e0e0e0;
}

.screen-share-indicator {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #f0f0f0;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  border: 1px solid #333;
}

.screen-share-indicator.hidden {
  display: none;
}

/* Кнопка "Пригласить" справа */
.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: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0 16px;
  
  color: #f0f0f0;
  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 20px rgba(0, 0, 0, 0.1);
}

.call-room-code:hover {
  background: rgba(255, 255, 255, 0.15); /* Подсветка при наведении */
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.call-room-code:active {
  transform: translateY(1px);
}

/* Иконка внутри кнопки */
.call-room-code svg {
  opacity: 0.8;
  transition: opacity 0.2s;
}
.call-room-code:hover svg {
  opacity: 1;
}

/* Состояние "Скопировано" */
.call-room-code.copied {
  background: rgba(16, 185, 129, 0.15); /* Легкий зеленый оттенок */
  border-color: rgba(16, 185, 129, 0.3);
  cursor: default;
}

/* Адаптация для мобильных */
@media (max-width: 640px) {
  .call-room-code {
    top: 16px;
    right: 16px;
    height: 36px;
    padding: 0 12px;
    /* На мобильных делаем кнопку компактнее, убираем текст, оставляем иконку */
  }
  
  /* На очень узких экранах можно скрыть текст и оставить только иконку */
  .call-room-code .code-value-text {
    display: none;
  }
  
  /* Но если нажали и "Скопировано" - показываем текст ненадолго */
  .call-room-code.copied .code-value-text {
    display: inline-block;
    font-size: 12px;
  }
}

.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-value-text {
  font-family: "SF Mono", "Monaco", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.code-context-menu:not(.hidden) {
  display: block;
}

.code-copy-icon {
  width: 16px;
  height: 16px;
  color: #888;
  transition: color 0.2s;
}

/* Внутренние элементы кнопки */
.code-label-text {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.call-room-code:active {
  transform: translateY(0);
}

.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;
}

.log {
  background: transparent;
  border: 1px solid #333;
  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 #333;
}

.log div:last-child {
  border-bottom: none;
}

.hidden {
  display: none;
}

.mic-on,
.mic-off {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .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);
  }

  body {
    padding: 16px;
  }

  .container {
    max-width: 100%;
  }

  .header {
    margin-bottom: 32px;
  }

  h1 {
    font-size: 20px;
  }

  .card {
    padding: 0;
    border-radius: 0;
  }

  .controls-panel {
    bottom: 20px;
    padding: 10px 20px;
    gap: 12px;
  }

  .control-btn {
    width: 56px;
    height: 56px;
  }

  .control-btn svg {
    width: 22px;
    height: 22px;
  }

  .mic-dropdown {
    height: 56px;
  }

  .mic-main-btn {
    width: 56px;
    height: 56px;
  }

  .mic-dropdown-toggle {
    width: 32px !important;
    height: 56px;
  }

  .mic-dropdown-menu {
    width: calc(100vw - 32px);
    max-width: 240px;
  }

  #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;
  }

  .screen-container {
    width: calc(100vw - 32px);
    height: 50vh;
    max-height: 400px;
    border-radius: 10px;
  }

  .screen-info {
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .screen-fullscreen-btn {
    padding: 6px;
    border-radius: 4px;
    right: 12px;
    top: 12px;
  }

  .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;
  }

  .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;
  }

  .call-timer {
    top: 16px;
    left: 16px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .call-room-code {
    top: calc(84px + env(safe-area-inset-top, 0px));
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 1.1px;
  }

  .mic-dropdown-menu {
    width: 240px;
  }

  .mic-dropdown-toggle {
    min-width: 56px !important;
    width: 56px;
    height: 56px;
  }

  .mic-main-btn {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 640px) {
  .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;
  }
}

@media (max-width: 480px) {
  .notifications-container {
    top: 12px;
    max-width: calc(100vw - 24px);
  }

  .notification-item {
    padding: 9px 12px;
    font-size: 11.5px;
    gap: 8px;
  }
}

* {
  scrollbar-width: thin;
  scrollbar-color: #333 #1a1a1a;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #444;
}

.container {
  z-index: 20000 !important;
  position: relative;
}

.screen-container.no-interact {
  pointer-events: none;
}
body.ui-priority .screen-container {
  pointer-events: none;
}

#settingsPanel {
  z-index: 21000 !important;
  position: relative;
}

.app-header {
  position: relative; /* Важно для позиционирования дочерних элементов */
  display: flex;
  align-items: center;
  justify-content: center; /* Заголовок Audit по центру */
  margin-bottom: 48px;
  min-height: 40px;
}

.app-header-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Обновленный стиль профиля --- */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;

  /* Делаем его похожим на кнопку/капсулу */
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 12px 4px 4px; /* Меньше отступ слева, чтобы фото касалось края */
  border-radius: 100px;

  transition: all 0.2s ease;
  cursor: default;
}

.user-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-badge.hidden {
  display: none !important;
}

/* Стиль для фото пользователя */
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover; /* Чтобы фото не сплющивалось */
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.user-avatar.hidden {
  display: none;
}

/* Стиль для запасной иконки (если нет фото) */
.user-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #a0a0a0;
}

.user-badge-icon svg {
  width: 18px;
  height: 18px;
}

.user-badge-icon.hidden {
  display: none;
}

.user-badge-name {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px; /* Небольшой отступ справа */
}

.app-header h1 {
  margin: 0;
  font-family: "Montserrat", sans-serif; /* Или Inter, как вам нравится */
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  pointer-events: auto;
}
/* Адаптация под мобильные */
@media (max-width: 480px) {
  .app-header {
    justify-content: flex-start; /* На мобильных логотип слева */
  }

  .app-header h1 {
    font-size: 18px;
  }

  .user-badge-name {
    max-width: 100px;
    font-size: 12px;
  }
  .user-avatar, .user-badge-icon {
    width: 24px;
    height: 24px;
  }
}
/* Общий стиль для всех верхних элементов в режиме звонка */
.glass-pill-style {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  padding: 0 16px;
  
  color: #f0f0f0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

/* Иконка внутри бейджа */
body.mode-call .participant-badge svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  display: block; /* Убираем лишние отступы строчных элементов */
}

body.mode-call .participant-badge span {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  margin: 0;
}
/* 3. Бейдж участников (Счетчик) */
body.mode-call .participant-badge {
  /* Полностью убираем оформление отдельного блока */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  width: auto !important;
  border-radius: 0 !important;
  animation: none !important;
  
  display: flex;
  align-items: center;
  gap: 6px; /* Расстояние между иконкой и цифрой */
  
  color: #9ca3af; /* Базовый серый цвет */
}

/* Состояние: Полная комната (меняем только цвет текста/иконки) */
body.mode-call .participant-badge.full {
  color: #4ade80; /* Зеленый текст */
}

body.mode-call .participant-badge.full svg {
  opacity: 1;
}

/* Скрываем бейдж */
body.mode-call .participant-badge.hidden {
  display: none;
}


body.mode-call .app-header h1 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 !important;
  padding: 0;
  line-height: 1;
  border: none;
  display: flex;
  align-items: center;
}
body.mode-call .app-header h1::after {
  content: "·"; /* Точка по центру */
  margin: 0 8px; /* Отступы от точки */
  color: rgba(255, 255, 255, 0.3); /* Тусклый цвет */
  font-weight: 400;
  font-size: 16px;
}


/* Адаптация под мобильные */
@media (max-width: 640px) {
  body.mode-call .app-header {
    top: 16px !important;
    height: 38px;
    padding: 0 16px;
  }
  
  body.mode-call .app-header h1 {
    font-size: 14px;
    padding-right: 10px;
  }
  
  body.mode-call .participant-badge {
    padding-left: 10px !important;
    gap: 4px;
  }
  
  body.mode-call .participant-badge span {
    font-size: 12px;
  }
}

body.mode-call .app-header {
  position: fixed !important; 
  top: 24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  
  /* Размеры */
  height: 40px; /* Чуть компактнее */
  width: auto;
  
  /* Flexbox: выравниваем все в одну строку */
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  
  /* Фон и эффекты */
  background: rgba(20, 20, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  
  /* Внутренние отступы капсулы */
  padding: 0 18px;
  margin: 0 !important;
  z-index: 22000;
  
  /* Расстояние между элементами внутри */
  gap: 0;
}

/* ДОБАВИТЬ ЭТОТ БЛОК В КОНЕЦ style.css или к стилям body.mode-call */

/* Исправление наложения текста на бейдж в режиме звонка */
body.mode-call .app-header-right {
  position: static !important; /* Отключаем абсолют, чтобы элементы шли друг за другом */
  transform: none !important;  /* Убираем смещение по вертикали */
  margin-left: 4px;            /* Небольшой отступ от точки */
  height: auto;
  width: auto;
}

/* Дополнительная страховка для выравнивания */
body.mode-call .app-header {
  justify-content: center !important; /* Центрируем всё содержимое капсулы */
  width: auto !important;             /* Ширина по содержимому */
  min-width: 120px;                   /* Минимальная ширина чтобы не схлопывалось */
}


body.mode-call .app-header,
body.mode-create .app-header,
body.mode-join .app-header,
body.mode-settings .app-header {
  top: 12px;
}

/* --- 3. Адаптация для мобильных --- */
@media (max-width: 640px) {
  .call-room-code {
    /* Перемещаем наверх справа, чтобы не мешать кнопкам внизу */
    top: 16px;
    right: 16px;
    bottom: auto;
    left: auto;
    transform: none;
    
    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;
  }
}

.participant-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.6); /* Полупрозрачный фон */
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 8px;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform-origin: center;
}

/* Класс анимации выхода */
.participant-badge.exit-anim {
  /* !important нужен, чтобы перебить постоянную пульсацию (waitingPulse) на время анимации */
  animation: badgeExit 0.5s cubic-bezier(0.33, 1, 0.68, 1) !important;
}

@keyframes badgeExit {
  0% { 
    transform: scale(1); 
    /* Начинаем с зеленого (если был full) или обычного */
  }
  30% { 
    transform: scale(0.85); /* Сжимаемся */
    background: rgba(239, 68, 68, 0.3); /* Красная вспышка */
    border-color: rgba(239, 68, 68, 0.6);
  }
  100% { 
    transform: scale(1); 
    /* Возвращаемся к исходному состоянию */
  }
}

/* Убедимся, что базовый POP тоже имеет приоритет над пульсацией при срабатывании */
.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); background: rgba(255, 255, 255, 0.15); }
  100% { transform: scale(1); }
}

.participant-badge svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

/* Состояние: Ожидание (Пульсация) */
.participant-badge:not(.full):not(.hidden) {
  animation: waitingPulse 3s infinite ease-in-out;
}

@keyframes waitingPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); border-color: rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 10px 0 rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); border-color: rgba(255, 255, 255, 0.1); }
}

/* Состояние: Полная комната (Зеленый) */
.participant-badge.full {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.participant-badge.hidden {
  display: none;
}



@media (max-width: 640px) {
  .participant-badge {
    font-size: 12px;
    padding: 4px 10px;
  }
}

/* ===== СТИЛИ ДИАЛОГА ШЕРИНГА (ПРИГЛАШЕНИЯ) ===== */

/* Основной контейнер модального окна */
.modal-dialog {
  /* Переопределение/уточнение базовых стилей модала для анимации */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-dialog.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Анимация "Pop-In" для контента модального окна */
.modal-dialog.visible .modal-content {
  animation: modalEnter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalEnter {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Стили для контента шеринга */
.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: 12px;
  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%; 
}

/* ===== НОВЫЙ СТИЛЬ ПРЕЛОАДЕРА (ТОСТ/УВЕДОМЛЕНИЕ) ===== */

.preloader {
  /* Позиционирование поверх всего, но не перекрывая клики вокруг */
  position: fixed;
  top: 80px; /* Чуть ниже заголовка */
  left: 50%;
  transform: translateX(-50%);
  z-index: 50000;
  
  display: flex;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent; /* Прозрачный фон контейнера */
  pointer-events: none; /* ПРОПУСКАТЬ КЛИКИ СКВОЗЬ ПУСТОТУ */
  
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preloader.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  pointer-events: none;
}

.preloader-content {
  /* Само окошко */
  background: rgba(20, 20, 20, 0.85); /* Полупрозрачный черный */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px; /* Капсульная форма */
  padding: 8px 20px 8px 12px;
  
  display: flex;
  align-items: center;
  gap: 12px;
  
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  pointer-events: auto; /* Само окошко можно трогать, если нужно */
}

.preloader-spinner {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24; /* Желтый цвет ожидания */
  animation: spin 1s linear infinite;
}

.preloader-spinner svg {
  width: 100%;
  height: 100%;
}

.preloader-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preloader-text {
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Убираем subtext из дизайна, он лишний для компактного вида */
.preloader-subtext {
  display: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Добавить в конец файла или к стилям модального окна */

.quality-info-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.quality-info-box p {
  color: #a0aec0;
  font-size: 14px;
  margin: 0;
}

.quality-info-box strong {
  color: #f0f0f0;
  font-weight: 600;
}

/* Кнопка смены камеры может быть чуть меньше или другого цвета, если нужно */
#flipCameraBtn svg {
  width: 22px;
  height: 22px;
}

/* При активной камере (класс добавляется через JS) */
#cameraBtn.sharing-active {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

#cameraBtn.sharing-active:hover {
  background: #4ade80;
  color: #000;
}

/* Утилитарный класс для скрытия */
.hidden {
  display: none !important;
}

/* Фикс для видео контейнера, чтобы оно не было слишком большим на телефоне */
/* ИСПРАВЛЕНИЕ ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 640px) {
  .screen-container {
    width: 100vw;
    height: 80vh; /* Высота на 80% экрана */
    max-height: none;
    aspect-ratio: auto; /* Убираем фиксированное соотношение */
    border-radius: 0;
    border: none;
    background: #000;
  }
  
  .screen-container video {
    /* ВАЖНО: contain - видео помещается целиком, cover - обрезается/растягивается */
    object-fit: contain !important; 
    width: 100%;
    height: 100%;
  }
}
/* --- Анимация загрузки микрофона --- */

/* Базовые настройки кнопки для корректной маскировки */
#muteBtn {
  position: relative;
  overflow: hidden; /* Скрываем всё, что вылетает за пределы круга */
}

/* Обертка иконок (для движения вверх-вниз) */
.mic-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  transform: translateY(0); /* Нормальное состояние */
  opacity: 1;
}

/* Спиннер загрузки */
.mic-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  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: #fbbf24; /* Желтый цвет загрузки */
  animation: spin 1s linear infinite;
}

/* === Состояние ЗАГРУЗКИ (.loading-mic) === */

/* Иконки улетают вверх */
#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); /* Чуть тусклее */
}
/* ===== КНОПКА СМЕНЫ КАМЕРЫ (Круглый стиль) ===== */
.control-btn.secondary-btn {
  /* Делаем её такой же круглой, как остальные */
  width: 48px;
  height: 48px;
  border-radius: 50%;

  /* Немного отличаем фон, чтобы выделить её как второстепенную */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px;
  transition: all 0.2s ease;
}

.control-btn.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.control-btn.secondary-btn:active {
  transform: scale(0.95);
}

/* Контейнер для вращения иконки */
.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);
}
/* ===== СПИСОК УЧАСТНИКОВ (TOOLTIP) ===== */

/* Обертка для позиционирования */
.participant-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Сам выпадающий список */
.participant-tooltip {
  position: absolute;
  top: calc(100% + 12px); /* Отступ снизу от бейджа */
  left: 50%;
  transform: translateX(-50%) scale(0.8); /* Начальный масштаб 0.8 */
  transform-origin: top center;

  width: max-content;
  min-width: 160px;
  max-width: 240px;

  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border-radius: 16px;

  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  z-index: 23000;
  transition:
    opacity 0.2s ease,
    transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), /* Пружинистая анимация */
    visibility 0.2s;
}

/* Стрелочка сверху (треугольник) */
.participant-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 6px 6px 6px;
  border-style: solid;
  border-color: transparent transparent rgba(20, 20, 20, 0.9) transparent;
}

/* Эффект при наведении на БЕЙДЖ: показываем список */
.participant-wrapper:hover .participant-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) scale(1); /* Увеличиваем до нормального размера */
}

/* Элемент списка (имя) */
.pt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #f0f0f0;
  font-weight: 500;
  padding: 4px 0;
}

/* Точки статуса */
.pt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pt-dot.local {
  background: #60a5fa; /* Голубой для себя */
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.pt-dot.remote {
  background: #4ade80; /* Зеленый для собеседника */
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.pt-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.pt-you {
  color: #94a3b8;
  font-size: 11px;
  margin-left: 4px;
}

/* Мобильная адаптация: скрываем hover эффект на тачскринах,
   или оставляем (на телефонах hover срабатывает при клике) */
@media (max-width: 640px) {
  .participant-tooltip {
    /* На мобильных сдвигаем чуть ниже, чтобы пальцем не перекрыть */
    top: calc(100% + 16px);
  }
}

/* --- СТИЛИ ДЛЯ НИЖНЕГО МЕНЮ (ПРАВОВАЯ ИНФОРМАЦИЯ) --- */

.legal-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  
  /* Плавное появление/исчезновение */
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Скрываем footer, когда класс hidden добавлен */
.legal-footer.hidden {
  display: none; /* Или используйте opacity: 0; pointer-events: none; для анимации */
}

/* Стиль самой кнопки-ссылки */
.legal-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  
  padding: 8px 16px;
  border-radius: 100px; /* Полная капсула */
  
  /* Эффект матового стекла (очень легкий) */
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  
  color: #888; /* Тусклый текст по умолчанию */
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.3px;
  
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

/* Эффект при наведении */
.legal-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff; /* Белый текст */
  transform: translateY(-2px); /* Легкое всплытие */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Эффект нажатия */
.legal-pill:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.05);
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
  .legal-footer {
    gap: 8px;
    flex-wrap: wrap; /* Если не влезет, перенесется */
  }
  
  .legal-pill {
    padding: 6px 12px;
    font-size: 11px;
    background: transparent; /* На мобильных убираем фон, чтобы не перегружать */
    border-color: transparent;
  }
  
  .legal-pill:hover {
    background: rgba(255, 255, 255, 0.05);
  }
}