:root { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
}

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

body { 
  margin: 0; 
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.1) 0%, 
    rgba(20, 28, 50, 0.15) 25%, 
    rgba(25, 35, 60, 0.2) 50%, 
    rgba(30, 41, 59, 0.25) 75%, 
    rgba(35, 45, 65, 0.3) 100%), url('img/bg.png');
  background-size: cover;
  background-position: left center;
  background-attachment: fixed;
  color: #f8fafc; 
  min-height: 100vh;
  overflow-x: hidden;
}

.hero-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 2rem;
}

.hero-content {
  position: absolute;
  top: 20%;
  right: 8%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  max-width: 500px;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd, #7dd3fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  text-shadow: 0 4px 20px rgba(125, 211, 252, 0.4);
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: #cbd5e1;
  margin-bottom: 3rem;
  line-height: 1.6;
  font-weight: 300;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.call-button {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 1.5rem 3rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 20px 40px rgba(34, 197, 94, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(0);
  margin-top: 1rem;
}

.call-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(34, 197, 94, 0.6);
  background: linear-gradient(135deg, #16a34a, #15803d);
  scale: 1.05;
}

.call-button:active {
  transform: translateY(-2px);
  scale: 1.02;
}

/* Fade-in анимации (только opacity, без transform для сохранения layout) */
.fade-in,
.fade-in-delay-1,
.fade-in-delay-2,
.fade-in-delay-3 {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-active {
  opacity: 1;
}

.fade-in-delay-1 {
  transition-delay: 0.2s;
}

.fade-in-delay-2 {
  transition-delay: 0.4s;
}

.fade-in-delay-3 {
  transition-delay: 0.6s;
}

/* Футер */
.footer {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.footer-text {
  font-size: 0.9rem;
  color: rgba(203, 213, 225, 0.7);
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.footer-link {
  color: rgba(125, 211, 252, 0.9);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(125, 211, 252, 0.4);
}

/* Адаптивный дизайн для мобильных устройств */
@media (max-width: 768px) {
  body {
    background: url('img/bg.png');
    background-size: cover;
    background-position: -120px center;
    background-attachment: fixed;
  }
  
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
      rgba(15, 23, 42, 0.1) 0%, 
      rgba(20, 28, 50, 0.15) 25%, 
      rgba(25, 35, 60, 0.2) 50%, 
      rgba(30, 41, 59, 0.25) 75%, 
      rgba(35, 45, 65, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
  }
  
  .hero-container {
    position: relative;
    z-index: 2;
    padding: 1rem 0;
    padding-top: calc(1rem + 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  
  .hero-content {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100%;
    margin: 0 auto 3rem auto;
    width: 100%;
  }
  
  .hero-title {
    font-size: clamp(2.5rem, 12vw, 4rem);
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin-bottom: 0;
    text-align: center;
  }
  
  .call-button {
    position: static;
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    width: fit-content;
  }
  
  .footer {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 1rem;
  }
  
  .footer-text {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  body {
    background: url('img/bg.png');
    background-size: cover;
    background-position: -120px center;
    background-attachment: fixed;
  }
  
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
      rgba(15, 23, 42, 0.1) 0%, 
      rgba(20, 28, 50, 0.15) 25%, 
      rgba(25, 35, 60, 0.2) 50%, 
      rgba(30, 41, 59, 0.25) 75%, 
      rgba(35, 45, 65, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
  }
  
  .hero-container {
    padding: 0.5rem 0;
    padding-top: calc(0.5rem + 150px);
    width: 100%;
  }
  
  .hero-title {
    font-size: clamp(2rem, 10vw, 3rem);
  }
  
  .hero-subtitle {
    font-size: clamp(0.9rem, 4vw, 1.25rem);
    padding: 0 1rem;
  }
  
  .call-button {
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 15px;
  }
  
  .footer {
    bottom: 1.5rem;
  }
  
  .footer-text {
    font-size: 0.75rem;
  }
  
  .video-container {
    padding-bottom: 1.5rem;
  }
}

/* Дополнительные эффекты для десктопа */
@media (min-width: 1024px) {
  .call-button {
    font-size: 1.4rem;
    padding: 2rem 3.5rem;
  }
  
  .hero-content {
    top: 18%;
    right: 6%;
    max-width: 600px;
  }
  
  .hero-title {
    font-size: clamp(3.5rem, 8vw, 7rem);
  }
}

/* Стили для страницы звонка */
.call-page {
  background: linear-gradient(135deg, 
    rgba(15, 23, 42, 0.1) 0%, 
    rgba(20, 28, 50, 0.15) 25%, 
    rgba(25, 35, 60, 0.2) 50%, 
    rgba(30, 41, 59, 0.25) 75%, 
    rgba(35, 45, 65, 0.3) 100%), url('img/bg_call.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  overflow: hidden;
}

.call-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(11, 18, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.call-topbar .header-title {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd, #7dd3fc);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.call-topbar .header-title:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.call-actions {
  display: flex;
  gap: 1rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.leave-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.video-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  height: calc(100vh - 80px);
  box-sizing: border-box;
}

.video-wrapper {
  position: relative;
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.8) 0%, 
    rgba(51, 65, 85, 0.8) 50%, 
    rgba(71, 85, 105, 0.8) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, 
    rgba(30, 41, 59, 0.9) 0%, 
    rgba(51, 65, 85, 0.9) 50%, 
    rgba(71, 85, 105, 0.9) 100%);
  z-index: 1;
}

.placeholder-content {
  text-align: center;
  color: #cbd5e1;
}

.placeholder-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.placeholder-text {
  font-size: 1.25rem;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Стили для состояния отключенного собеседника */
.video-placeholder.peer-disconnected {
  background: linear-gradient(135deg, 
    rgba(59, 7, 7, 0.9) 0%, 
    rgba(75, 8, 8, 0.9) 50%, 
    rgba(91, 33, 33, 0.9) 100%);
}

.video-placeholder.peer-disconnected .placeholder-content {
  color: #fecaca;
}

.video-placeholder.peer-disconnected .placeholder-icon {
  opacity: 0.8;
}

.video-placeholder.peer-disconnected .placeholder-text {
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Стили для состояния отказа в доступе к медиа */
.video-placeholder.permission-denied {
  background: linear-gradient(135deg, 
    rgba(120, 53, 15, 0.9) 0%, 
    rgba(146, 64, 14, 0.9) 50%, 
    rgba(180, 83, 9, 0.9) 100%);
}

.video-placeholder.permission-denied .placeholder-content {
  color: #fed7aa;
  text-align: center;
  max-width: 280px;
  margin: 0 auto;
}

.video-placeholder.permission-denied .placeholder-icon {
  font-size: 3rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.video-placeholder.permission-denied .placeholder-text {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.4;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

/* Отзеркаливаем только локальное видео */
#localVideo {
  transform: scaleX(-1);
}

.video-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
  /* Отключаем анимацию для кнопок управления */
  opacity: 1 !important;
  transition: none !important;
}

.control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.control-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1); /* Делаем иконку белой */
  transition: all 0.3s ease;
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.control-btn.muted {
  position: relative;
}

.control-btn.muted .control-icon {
  filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(0deg) brightness(0.7); /* Красноватый оттенок */
  opacity: 0.6;
}

.control-btn.muted::after {
  content: '✕';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #dc2626;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 1;
}

.control-btn.muted:hover .control-icon {
  opacity: 0.8;
}

.control-btn.muted:hover::after {
  transform: translate(-50%, -50%) scale(1.1);
}

.banner {
  position: fixed;
  left: 50%;
  top: 100px;
  transform: translateX(-50%);
  background: rgba(31, 41, 55, 0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 20;
}

/* Мобильная адаптация для видео */
@media (max-width: 768px) {
  .call-page {
    background: url('img/bg_call.png');
    background-size: cover;
    background-position: center;
  }
  
  .call-topbar {
    padding: 0.75rem 1rem;
  }
  
  .call-topbar strong {
    font-size: 1.25rem;
  }
  
  .call-actions {
    gap: 0.5rem;
  }
  
  .action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .video-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    padding-bottom: 2rem;
    height: calc(100vh - 70px);
    gap: 0.75rem;
  }
  
  .video-wrapper {
    border-radius: 15px;
    width: 100%;
    max-width: 100%;
    height: calc((100vh - 70px - 1rem - 0.75rem) / 2);
    min-height: 200px;
    max-height: 45vh;
  }
  
  .placeholder-icon {
    font-size: 3rem;
  }
  
  .placeholder-text {
    font-size: 1rem;
  }
  
  .control-btn {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }
  
  .control-icon {
    width: 20px;
    height: 20px;
  }
}

/* Исправления для iOS устройств (Safari и Chrome на iOS) */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 768px) {
    .video-container {
      padding-bottom: 2rem !important; /* Увеличиваем отступ для Safari */
      min-height: calc(100vh - 70px - 2rem); /* Учитываем отступ */
    }
    
    .video-controls {
      left: 50% !important;
      transform: translateX(-50%) !important; /* Принудительное центрирование */
      right: auto !important;
    }
  }
  
  @media (max-width: 480px) {
    .video-container {
      padding-bottom: 2.5rem !important; /* Еще больше отступ для маленьких экранов */
    }
    
    .video-controls {
      left: 50% !important;
      transform: translateX(-50%) !important;
      right: auto !important;
    }
  }
}

/* Универсальные исправления для iOS (все браузеры на iOS) */
@media (max-width: 768px) {
  /* Применяем для всех мобильных устройств, но с большим приоритетом для iOS */
  .video-container {
    padding-bottom: 2rem;
  }
}

/* Специальные стили для iOS устройств (определенных через JavaScript) */
.ios-device .video-container {
  padding-bottom: 3rem !important;
  height: calc(100vh - 70px - 3rem) !important;
  max-height: calc(100vh - 70px - 3rem) !important;
  overflow: hidden !important;
}

.ios-device .video-wrapper {
  max-height: calc((100vh - 70px - 3rem) / 2) !important;
  overflow: hidden !important;
}

.ios-device .video-controls {
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
}

@media (max-width: 480px) {
  .ios-device .video-container {
    padding-bottom: 3.5rem !important;
    height: calc(100vh - 70px - 3.5rem) !important;
    max-height: calc(100vh - 70px - 3.5rem) !important;
  }
  
  .ios-device .video-wrapper {
    max-height: calc((100vh - 70px - 3.5rem) / 2) !important;
  }
}

/* АГРЕССИВНЫЕ ФИКСЫ ДЛЯ CHROME НА iOS */
.chrome-ios .video-container {
  padding-top: 1rem !important; /* Отступ сверху от хедера */
  padding-bottom: 4rem !important;
  height: calc(100vh - 80px - 4rem) !important; /* Увеличиваем отступ от хедера */
  max-height: calc(100vh - 80px - 4rem) !important;
  min-height: calc(100vh - 80px - 4rem) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  margin-top: 0 !important; /* Убираем возможные отступы */
}

.chrome-ios .video-wrapper {
  max-height: calc((100vh - 80px - 4rem) / 2) !important;
  height: calc((100vh - 80px - 4rem) / 2) !important;
  min-height: calc((100vh - 80px - 4rem) / 2) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.chrome-ios .video-controls {
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  bottom: 1rem !important;
  /* Отключаем анимацию для Chrome на iOS */
  opacity: 1 !important;
  transition: none !important;
}

/* Отключаем анимацию для всех элементов в Chrome на iOS */
.chrome-ios .fade-in,
.chrome-ios .fade-in-delay-1,
.chrome-ios .fade-in-delay-2,
.chrome-ios .fade-in-delay-3 {
  opacity: 1 !important;
  transition: none !important;
}

@media (max-width: 480px) {
  .chrome-ios .video-container {
    padding-top: 1.5rem !important; /* Больше отступ сверху для маленьких экранов */
    padding-bottom: 5rem !important;
    height: calc(100vh - 90px - 5rem) !important; /* Увеличиваем отступ от хедера */
    max-height: calc(100vh - 90px - 5rem) !important;
    min-height: calc(100vh - 90px - 5rem) !important;
  }
  
  .chrome-ios .video-wrapper {
    max-height: calc((100vh - 90px - 5rem) / 2) !important;
    height: calc((100vh - 90px - 5rem) / 2) !important;
    min-height: calc((100vh - 90px - 5rem) / 2) !important;
  }
}

/* Дополнительные фиксы для Chrome на iOS с использованием viewport units */
@supports (-webkit-touch-callout: none) {
  .chrome-ios .video-container {
    padding-bottom: 4.5rem !important;
    height: calc(100dvh - 70px - 4.5rem) !important;
    max-height: calc(100dvh - 70px - 4.5rem) !important;
    min-height: calc(100dvh - 70px - 4.5rem) !important;
  }
  
  .chrome-ios .video-wrapper {
    max-height: calc((100dvh - 70px - 4.5rem) / 2) !important;
    height: calc((100dvh - 70px - 4.5rem) / 2) !important;
    min-height: calc((100dvh - 70px - 4.5rem) / 2) !important;
  }
}

/* Экстремальные фиксы для Chrome на iOS - используем фиксированные значения */
@media (max-width: 768px) {
  .chrome-ios .video-container {
    padding-top: 1.5rem !important; /* Отступ сверху от хедера */
    padding-bottom: 5rem !important;
    height: calc(100vh - 130px) !important; /* Увеличиваем отступ от хедера */
    max-height: calc(100vh - 130px) !important;
    min-height: calc(100vh - 130px) !important;
  }
  
  .chrome-ios .video-wrapper {
    max-height: calc((100vh - 130px) / 2) !important;
    height: calc((100vh - 130px) / 2) !important;
    min-height: calc((100vh - 130px) / 2) !important;
  }
}

@media (max-width: 480px) {
  .chrome-ios .video-container {
    padding-top: 2rem !important; /* Больше отступ сверху для маленьких экранов */
    padding-bottom: 6rem !important;
    height: calc(100vh - 150px) !important; /* Увеличиваем отступ от хедера */
    max-height: calc(100vh - 150px) !important;
    min-height: calc(100vh - 150px) !important;
  }
  
  .chrome-ios .video-wrapper {
    max-height: calc((100vh - 150px) / 2) !important;
    height: calc((100vh - 150px) / 2) !important;
    min-height: calc((100vh - 150px) / 2) !important;
  }
}

/* Дополнительные исправления для iOS WebKit (включая Chrome на iOS) */
@media screen and (-webkit-min-device-pixel-ratio: 1) and (max-width: 768px) {
  .video-container {
    padding-bottom: 2.5rem !important; /* Увеличенный отступ для iOS */
    height: calc(100vh - 70px - 2.5rem) !important; /* Фиксированная высота */
    max-height: calc(100vh - 70px - 2.5rem) !important;
    overflow: hidden !important; /* Предотвращаем переполнение */
  }
  
  .video-wrapper {
    max-height: calc((100vh - 70px - 2.5rem) / 2) !important; /* Ограничиваем высоту видео */
    overflow: hidden !important;
  }
  
  .video-controls {
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }
}

@media screen and (-webkit-min-device-pixel-ratio: 1) and (max-width: 480px) {
  .video-container {
    padding-bottom: 3rem !important; /* Еще больше отступ для маленьких экранов iOS */
    height: calc(100vh - 70px - 3rem) !important;
    max-height: calc(100vh - 70px - 3rem) !important;
  }
  
  .video-wrapper {
    max-height: calc((100vh - 70px - 3rem) / 2) !important;
  }
}

/* Дополнительная адаптация для маленьких экранов (iPhone) */
@media (max-width: 480px) and (max-height: 800px) {
  .call-page {
    background: url('img/bg_call.png');
    background-size: cover;
    background-position: center;
  }
  
  .call-topbar {
    padding: 0.5rem 1rem;
    height: 60px;
  }
  
  .call-topbar strong {
    font-size: 1.1rem;
  }
  
  .action-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .video-container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    padding-bottom: 3rem;
    height: calc(100vh - 60px);
    gap: 0.5rem;
  }
  
  .video-wrapper {
    border-radius: 12px;
    width: 100%;
    max-width: 100%;
    height: calc((100vh - 60px - 1rem - 0.5rem) / 2);
    min-height: 180px;
    max-height: 42vh;
  }
  
  .placeholder-icon {
    font-size: 2.5rem;
  }
  
  .placeholder-text {
    font-size: 0.9rem;
  }
  
  .control-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .control-icon {
    width: 18px;
    height: 18px;
  }
  
  .video-controls {
    bottom: 8px;
    right: 8px;
    gap: 8px;
  }
  
  /* Дополнительные исправления для Safari */
  @supports (-webkit-touch-callout: none) {
    .video-controls {
      left: 50% !important;
      transform: translateX(-50%) !important;
      right: auto !important;
    }
  }
}

/* Специальная адаптация для высоких мобильных экранов */
@media (max-width: 480px) and (min-height: 800px) {
  .video-container {
    justify-content: center;
    align-items: center;
    padding-bottom: 4rem;
    height: calc(100vh - 70px);
  }
  
  .video-wrapper {
    width: 100%;
    max-width: 100%;
    height: calc((100vh - 70px - 1rem - 0.75rem) / 2);
    min-height: 220px;
    max-height: 40vh;
  }
  
  /* Дополнительные исправления для Safari на высоких экранах */
  @supports (-webkit-touch-callout: none) {
    .video-container {
      padding-bottom: 3rem !important; /* Больше отступ для высоких экранов */
    }
    
    .video-controls {
      left: 50% !important;
      transform: translateX(-50%) !important;
      right: auto !important;
    }
  }
}

/* Старые стили (совместимость) */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; background: #0b1220; position: sticky; top: 0; }
.actions button { margin-left: .5rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px; height: calc(100dvh - 64px); box-sizing: border-box; }
.grid video { width: 100%; height: 100%; object-fit: cover; background: #111; border-radius: 10px; }
