/* Переменная высоты полос (чтобы менять в одном месте) */
:root {
  --bar-height: 10vh;
}

/* Оверлей внутри области картинки */
.sidebar-overlay {
  position: absolute;
  top: calc(var(--bar-height) + env(safe-area-inset-top));
  bottom: calc(var(--bar-height) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 8;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Кнопка открытия/закрытия */
.sidebar-toggle {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 12; /* Выше полос, чтобы легко нажималась */
  width: 44px;
  height: 52px;
  /*background: rgba(255, 255, 255, 0.08);*/
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /*border: 1px solid rgba(255, 255, 255, 0.15);*/
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-left: none;
  /*border-radius: 0 14px 14px 0;*/
  border-radius: 0 6px 6px 0;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

/* Эффект при наведении на кнопку открытия */
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12); /* Тоже мягкое стеклянное подсвечивание */
  border-color: rgba(255, 255, 255, 0.4); /* Мягкая полупрозрачная рамка */
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
}
/*
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
}
*/


/* Эффект при клике (нажатии) на кнопку открытия */
.sidebar-toggle:active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(0.96); /* Легкий эффект нажатия */
}




.sidebar-toggle svg {
  width: 22px;
  height: 22px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-toggle.active {
  left: 260px;
}

.sidebar-toggle.active svg {
  transform: rotate(180deg);
}

/* Glass Панель в границах картинки */
.glass-sidebar {
  position: absolute;
  /* Ограничиваем сверху и снизу ровно по границе черных полос */
  top: calc(var(--bar-height) + env(safe-area-inset-top));
  bottom: calc(var(--bar-height) + env(safe-area-inset-bottom));
  left: -280px;
  width: 260px;
  height: auto; /* Высота подстраивается под область между полосами */
  z-index: 9; /* Ниже полос (z-index: 10), чтобы не заходила на них */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  /* Скругляем правые углы меню внутри кадра */
  border-radius: 0; 
  /*  border-radius: 0 16px 16px 0; */
  padding: 24px 18px;
  box-sizing: border-box;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* На случай, если экран очень маленький */
}

.glass-sidebar.active {
  left: 0;
}

.sidebar-header h2 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

/* Ссылки */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 5px;
  /*  border-radius: 12px;*/
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}

.nav-item .icon-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item.tg:hover {
  background: rgba(42, 171, 238, 0.2);
  border-color: rgba(42, 171, 238, 0.4);
  transform: translateX(4px);
}
.nav-item.twitch:hover {
  background: rgba(145, 70, 255, 0.2);
  border-color: rgba(145, 70, 255, 0.4);
  transform: translateX(4px);
}
.nav-item.yt:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.4);
  transform: translateX(4px);
}

/* Мобильный медиа-запрос под высоту полос 8vh */
@media (max-width: 768px) and (orientation: portrait) {
  :root {
    --bar-height: 8vh; /* Уменьшаем высотное ограничение под полосы 8vh */
  }

  .glass-sidebar {
    width: 240px;
    left: -260px;
  }

  .sidebar-toggle.active {
    left: 240px;
  }
}