/* === No flash on load === */
body.preload #main-app { display: none !important; }
body.preload #auth-overlay { display: none !important; }

/* ===== Body ===== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #1a1a2e 0%, #162447 100%);
  color: #fff;
  overflow-x: hidden;
  height: 100vh;
  display: block;
}

/* ===== Overlay ===== */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(34, 34, 34, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#auth-overlay.show {
  display: flex;
}

/* ===== Auth Card ===== */
#auth-card {
  background: #36393f;
  padding: 40px 30px;
  border-radius: 8px;
  width: 360px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  color: #fff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

#auth-card h1 {
  font-size: 36px;
  margin-bottom: 10px;
  color: #fff;
}

#auth-card h3 {
  font-size: 16px;
  margin-bottom: 30px;
  color: #b9bbbe;
}

#auth-card input {
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 4px;
  border: none;
  background: #202225;
  color: #dcddde;
}

#auth-card input::placeholder {
  color: #72767d;
}

#auth-card .buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary-btn {
  background-color: #5865f2;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.secondary-btn {
  background-color: #202225;
  color: #fff;
  border: 1px solid #72767d;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.primary-btn:hover {
  background-color: #4752c4;
}

.secondary-btn:hover {
  border-color: #fff;
}

/* ===== Main App ===== */
#main-app {
  display: none;          /* горизонтальное расположение колонок */
  flex-direction: row;    /* важно: три столбца */
  flex: 1;
  width: 100%;
  height: 100vh;
  background: #1e1e2a;
}

#main-app.show {
  display: flex;
}

/* ===== Sidebar / левый столб ===== */
.sidebar {
  width: 90px;
  background-color: #202225;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

/* Верх: список иконок */
.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Низ: контейнер под user-panel (без gap/списка кнопок) */
.sidebar-bottom {
  margin-top: auto;              /* прижимаем вниз */
  padding-bottom: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Круглые кнопки ТОЛЬКО для иконок вверху */
.sidebar-top > button,
.sidebar-top #serversList button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background-color: #36393f;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-top > button:hover,
.sidebar-top #serversList button:hover {
  background-color: #5865f2;
}

/* ===== Средняя колонка: Друзья ===== */
.friends-column {
  flex: 350px;
  background-color: #2f3136;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #202225;
}

.friends-column .header {
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #202225;
}

.tabs {
  display: flex;
  justify-content: space-around;
  background-color: #2f3136;
  border-bottom: 1px solid #202225;
}

.tab {
  padding: 10px 5px;
  cursor: pointer;
  color: #b9bbbe;
  border-radius: 5px;
}

.tab.active {
  color: #fff;
  border-bottom: 2px solid #5865f2;
}

.search {
  padding: 10px;
  border-bottom: 1px solid #202225;
}

.search input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: none;
  background-color: #202225;
  color: #fff;
}

.friend-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.friend {
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  cursor: pointer;
}

.friend.online { background-color: #3ba55d; }
.friend.offline { background-color: #4f545c; }

/* ===== Profile Modal Overlay ===== */
#profile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* скрыто по умолчанию */
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Показываем модалку */
#profile-overlay.show {
  display: flex;
}

/* ===== MODAL (base) ===== */
.modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;                 /* показываем через JS: flex */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  padding: 12px;
}

.modal-content{
  width: min(520px, calc(100% - 24px));
  background: #1f1f1f;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  padding: 14px;
}

.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-header h2{
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* Кнопка закрытия (крестик) */
.close-btn{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #2a2a2a;
  cursor: pointer;
  position: relative;
}

.close-btn::before,
.close-btn::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  background: rgba(255,255,255,.75);
  transform-origin: center;
}

.close-btn::before{ transform: translate(-50%,-50%) rotate(45deg); }
.close-btn::after{  transform: translate(-50%,-50%) rotate(-45deg); }

.close-btn:hover{
  background: #3a3a3a;
}

/* ===== Profile Modal ===== */
#profile-modal {
  display: none; /* 🔹 скрыто по умолчанию */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center; /* центрируем содержимое */
  align-items: center;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}

/* Внутренний блок с контентом */
#profile-modal .modal-content {
  background: #313338;
  width: 420px;
  max-width: 90%;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  color: #fff;
  position: relative; /* для кнопки выхода */
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* Заголовок */
#profile-modal h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 20px;
  text-align: center;
}

/* ===== Аватар ===== */
.avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.avatar-block img {
  width: 80px;           /* маленький размер */
  height: 80px;
  border-radius: 50%;    /* круг */
  object-fit: cover;     /* обрезка без искажения */
  background: #202225;
  border: 2px solid #5865f2; /* рамка (опционально) */
  margin-bottom: 10px;
}

.avatar-block input[type="file"] {
  color: #fff;
}

/* ===== Inputs ===== */
.profile-field {
  margin-bottom: 12px;
}

.profile-field label {
  display: block;
  font-size: 12px;
  color: #b5bac1;
  margin-bottom: 4px;
}

.profile-field input,
.profile-field textarea {
  width: 100%;
  background: #1e1f22;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  color: #fff;
  resize: none;
}

.profile-field textarea {
  min-height: 70px;
}

/* ===== Кнопка Сохранить ===== */
#saveProfileBtn {
  width: 100%;
  margin-top: 10px;
  background: #5865f2;
  border: none;
  padding: 10px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

#saveProfileBtn:hover {
  background: #4752c4;
}

/* ===== Кнопка выхода в модальном окне ===== */
.profile-logout-btn {
  position: absolute;       /* закрепим в углу модалки */
  top: 15px;                /* отступ сверху */
  right: 15px;              /* отступ справа */
  background-color: #ed4245; /* красный фон */
  color: #fff;              /* белый текст */
  border: none;
  border-radius: 4px;       /* слегка закругленные углы */
  padding: 6px 12px;        /* размер кнопки */
  font-size: 14px;          /* размер текста */
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.profile-logout-btn:hover {
  background-color: #c03537; /* темный красный при наведении */
  transform: scale(1.05);    /* лёгкий эффект увеличения */
}

/* ===== Модальльное окно создания канала ===== */
#create-channel-modal {
}

#create-channel-modal .modal-content {
  background: #313338;
  width: 400px;
  max-width: 90%;
  border-radius: 8px;
  padding: 20px;
  color: #fff;
}

#create-channel-modal .field {
  margin-bottom: 12px;
}

#create-channel-modal label {
  font-size: 12px;
  color: #b5bac1;
}

#create-channel-modal input,
#create-channel-modal select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  border: none;
  background: #1e1f22;
  color: #fff;
}

#create-channel-modal .primary-btn {
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  background: #5865f2;
  border: none;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

#create-channel-modal .primary-btn:hover {
  background: #4752c4;
}

/* ===== Вариант 2: колонка 2 (навигация) ===== */
.nav-column{
  width: 280px;
  background-color: #2f3136;
  border-right: 1px solid #202225;
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;
}

.nav-title{
  font-size: 13px;
  color: #b9bbbe;
  margin: 6px 0 10px;
}

.nav-item{
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #dcddde;
}

.nav-item:hover{
  background: rgba(255,255,255,0.06);
}

.nav-item.active{
  background: rgba(88,101,242,0.25);
}

/* ===== Вариант 2: колонка 3 (контент) ===== */
.main-column{
  flex: 1;
  background: #1e1e2a;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* Теперь friends-column внутри main-column должна растягиваться */
#friendsView.friends-column{
  flex: 1;
  width: 100%;
  border-right: none; /* раньше был border-right, теперь не надо */
}

#serversList{
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* ===== Voice View (колонка 3) ===== */
.voice-view{
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* важно для скролла */
}

.voice-header{
  position: relative;
  padding: 12px 14px;
  border-bottom: 1px solid #202225;
  background: #2b2d31;
}

.server-title-btn{
  background: transparent;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}

.server-title-btn:hover{
  background: rgba(255,255,255,0.06);
}

.server-menu{
  position: absolute;
  top: 52px;
  left: 14px;
  width: 220px;
  background: #1e1f22;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  z-index: 50;
}

.menu-item{
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #dcddde;
  padding: 10px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.menu-item:hover{
  background: rgba(255,255,255,0.08);
}

.voice-content{
  flex: 1;
  overflow: auto;
  padding: 14px;
  min-height: 0;
}

.voice-rooms-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rooms-title{
  font-weight: bold;
}

.create-room-btn{
  border: none;
  background: #5865f2;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.create-room-btn:hover{
  background: #4752c4;
}

.rooms-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rooms-empty{
  opacity: 0.8;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.voice-footer{
  border-top: 1px solid #202225;
  background: #2b2d31;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
}

.voice-footer-btn{
  border: none;
  background: #36393f;
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.voice-footer-btn:hover{
  background: #4f545c;
}

.voice-footer-btn.danger{
  background: #ed4245;
}

.voice-footer-btn.danger:hover{
  background: #c03537;
}

.room-card{
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  background: #1e1f22;
  margin-bottom: 10px;
}

.room-card:hover{
  outline: 1px solid rgba(88, 101, 242, 0.5);
}

.room-card.active {
  outline: 2px solid #5865f2;
}

.room-top{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

.small-btn{
  border:none;
  background: rgba(255,255,255,0.08);
  color:#fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor:pointer;
}

.small-btn:hover{
  background: rgba(255,255,255,0.14);
}

.room-users{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0.95;
  font-weight: normal;
}

.room-user{
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.15);
}

.room-user.empty{
  opacity: 0.7;
}

.room-card.active-room{
  outline: 2px solid #5865f2;
}

.invite-results{
  margin-top: 12px;
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.invite-row{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #232323;
  border: 1px solid rgba(255,255,255,.06);
}

.invite-avatar{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}

.invite-name{
  flex: 1;
  color: #eaeaea;
  font-size: 14px;
}

.invite-btn{
  background: #3a3a3a;
  border: none;
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transform: scale(1);
  transition: transform .12s ease, background .12s ease;
}

.invite-btn:hover{
  transform: scale(1.06);
  background: #4a4a4a;
}

.invite-btn:disabled{
  opacity:.55;
  cursor: default;
  transform:none;
}

.danger-btn{
  width: 100%;
  background: #ed4245;
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.danger-btn:hover{
  background: #c03537;
  transform: scale(1.02);
}

/* ===== DM notifications ===== */

.dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dm-info {
  flex: 1;              /* 👈 занимает всё доступное место */
  overflow: hidden;
}

.dm-nickname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-bell {
  width: 18px;           /* 👈 ЗАРЕЗЕРВИРОВАНО МЕСТО */
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;        /* 👈 не сжимается */
  opacity: 1;
}

/* ===== Emoji custom scrollbar ===== */

/* скрываем нативный скролл полностью */
.lyra-scroll-hidden {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge / IE */
}
.lyra-scroll-hidden::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari */
}

/* кастомная вертикальная полоска */
.lyra-mini-scrollbar {
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 4px;
  width: 4px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 10;
  overflow: hidden; /* ✅ */
}

.lyra-mini-scrollbar.show {
  opacity: 1;
}

.lyra-mini-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 999px;
  background: rgba(88,101,242,0.9);   /* фирменный синий */
}

/* приглушённое состояние */
.lyra-mini-scrollbar.idle .lyra-mini-thumb {
  background: rgba(88,101,242,0.35);
}

.lyra-mini-scrollbar {
  z-index: 9999 !important;
}

.lyra-mini-thumb {
  z-index: 9999 !important;
}

/* =========================================================
   USER CONTROL PANEL (панель профиля в левом узком сайдбаре)
   ========================================================= */

/* [1] Контейнер всей панели (прямоугольник с закруглением) */
#user-panel {
  width: 70px;

  /* стало чуть "длиннее вверх" */
  min-height: 200px;          /* можешь подогнать: 160/170/180 */
  padding: 12px 6px;          /* чуть больше воздуха */

  background: #2a2b2f;
  border-radius: 14px;

  display: flex;
  flex-direction: column;
  align-items: center;

  /* распределяем блоки по высоте, чтобы панель выглядела выше */
  justify-content: space-between;

  gap: 10px;                  /* можно оставить */
}

/* ---------------------------------------------------------
   [2] Кнопка профиля (Аватар + Ник + Статус) — одна кнопка
   --------------------------------------------------------- */
#user-panel-profile {
  all: unset;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* ... твои [2.1]-[2.6] без изменений ... */

/* ---------------------------------------------------------
   [3] Кнопки управления (микрофон / звук) — В РЯД
   --------------------------------------------------------- */

/* [3.1] Контейнер кнопок */
.user-controls {
  display: flex;
  flex-direction: row;        /* было column */
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* [3.2] Стиль кнопок mic/sound */
.user-controls button {
  width: 34px;                /* чуть компактнее, чтобы влезло 2 кнопки */
  height: 34px;
  border-radius: 10px;

  border: none;
  background: #2a2b2f;
  color: #fff;

  cursor: pointer;

  /* на будущее — иконки будут центрироваться идеально */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* [3.3] Hover для кнопок */
.user-controls button:hover {
  background: #3a3d42;
}

/* ---------------------------------------------------------
   [4] (опционально, пригодится позже)
   Состояния: muted / deafened (красный актив)
   --------------------------------------------------------- */
/*
.user-controls button.is-off {
  background: #3b1d22;
  color: #ff6b6b;
}
.user-controls button.is-off:hover {
  background: #4a2229;
}
*/

/* ===== User avatar (фон + буква) ===== */
.user-avatar {
  position: relative;
  width: 60px; /* Размер автара в панели */
  height: 60px; /* Размер автара в панели */
  border-radius: 50%;

  background: #5865f2; /* временно, потом JS поменяет */

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

/* Буква ника */
.user-avatar-letter {
  position: absolute;
  z-index: 1;

  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  user-select: none;
}

/* Картинка аватара */
.user-avatar img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: cover;

  border-radius: 50%;

  z-index: 2;
  display: block;
}

/* Если картинка не загрузилась — прячем её, буква остаётся */
.user-avatar img[src=""],
.user-avatar img:not([src]) {
  display: none;
}

/* ===== Статус пользователя (кружок на аватаре) ===== */
.user-status {
  position: absolute;
  bottom: -2px;
  right: -2px;

  width: 12px;
  height: 12px;
  border-radius: 50%;

  /* Цвет статуса (по умолчанию Онлайн) */
  background: #2a2b2f;

  /* Обводка = фон панели (эффект "вырезано из панели") */
  border: 4px solid #2a2b2f;

  z-index: 3;
}

/* Онлайн */
.user-status.online {
  background: #23a55a;
}

/* Офлайн */
.user-status.offline {
  background: #747f8d;
}

/* Не беспокоить */
.user-status.dnd {
  background: #f23f43;
}

/* Нет на месте */
.user-status.idle {
  background: #f0b232;
}

/* navBar должен быть позиционируемым контейнером */
#navBar{
  overflow: visible;
}

/* ===== Popover профиля (внутри второго блока) ===== */

#profile-popover-root{
  position: relative;
  min-height: 1px;
  overflow: visible;
}

/* popover по умолчанию скрыт */
#profile-popover{
  position: absolute;
  left: 10px;
  top: 10px; /* будет перезаписан JS */

  width: 260px;
  max-width: min(420px, calc(100vw - 24px));

  --pp-bg: #232428;
  background: var(--pp-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  padding: 0px;
  z-index: 999999;

  display: none;            /* ✅ КЛЮЧЕВОЕ: не виден при загрузке */
  visibility: hidden;
  opacity: 0;

  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}

/* показываем только когда открыт */
#profile-popover.show{
  display: block;
  visibility: visible;
  opacity: 1;

  transform: translateY(0);
  pointer-events: auto;
}

/* Внутренности (минимально, чтобы выглядело “как дискорд”) */
#profile-popover .pp-top{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom: 10px;
}

#profile-popover .pp-ava{
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background:#2b2d31;
}

#profile-popover .pp-name{
  font-weight: 700;
  color:#fff;
  line-height: 1.1;
}

#profile-popover .pp-state{
  font-size: 12px;
  color:#b5bac1;
  margin-top: 2px;
}

/* Кнопки/пункты */
#profile-popover .pp-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top: 10px;
}

#profile-popover .pp-item{
  width: 100%;
  border: none;
  background: #2b2d31;
  color:#fff;
  border-radius: 10px;
  padding: 10px 10px;
  cursor:pointer;
  text-align:left;
}

#profile-popover .pp-item:hover{
  background:#3a3d42;
}

#profile-popover .pp-item.danger{
  background:#3b1d22;
  color:#ffb4b4;
}
#profile-popover .pp-item.danger:hover{
  background:#4a2229;
}

/* navBar можно оставить как есть (важно overflow visible) */
#navBar{
  overflow: visible;
}

/* ===== Popover Banner Header ===== */
#profile-popover .pp-header{
  position: relative;
  overflow: visible; /* ✅ чтобы аватар мог “вылезать” вниз */
}

#profile-popover .pp-banner{
  position: relative;            /* ✅ ВАЖНО: якорь для overlay/hint */
  height: 101px;

  background-image:
    var(--banner-url),
    linear-gradient(135deg, rgba(255,255,255,0.12), rgba(0,0,0,0.12));
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;

  cursor: pointer;

  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  overflow: hidden;
}

#profile-popover .pp-bannerOverlay{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.35);
  color: #fff;
  font-weight: 600;
  font-size: 14px;

  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 2;
}

#profile-popover .pp-banner:hover .pp-bannerOverlay{
  opacity: 1;
}

/* Аватар поверх баннера */
#profile-popover .pp-avatarWrap{
  position: absolute;
  left: 16px;
  bottom: -28px;
  z-index: 2; /* ✅ чтобы был выше баннера */
}

#profile-popover .pp-avatar{
  cursor: pointer;

  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;

  border: 0;                 /* ✅ убрали */
  background: var(--pp-bg);  /* ✅ чтобы не было “просветов” на стыке */

  box-shadow: 0 0 0 6px var(--pp-bg); /* ✅ ровное кольцо */
}

#profile-popover .pp-avatar:hover{
  filter: brightness(0.92);
}

/* точка статуса */
#profile-popover .pp-statusDot{
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3ba55d;
  border: 3px solid var(--pp-bg);
}

/* чтобы контент не залез под аватар */
#profile-popover .pp-body{
  padding: 12px;
  padding-top: 44px; /* место под аватар */
}

/* ===== Banner hint icon + tooltip ===== */
#profile-popover .pp-bannerHint{
  position:absolute;
  top:8px;
  right:8px;
  width:18px;
  height:18px;
  border-radius:999px;
  border:0;

  background: rgba(0,0,0,0.45);
  color:#fff;
  font-size:12px;
  font-weight:800;
  line-height:18px;
  text-align:center;

  cursor: help;
  z-index: 5;
  padding:0;
}

/* сам тултип (создадим через ::after) */
#profile-popover .pp-bannerHint::after{
  content: attr(data-tip);
  position:absolute;
  right:0;
  top: 24px;

  width: max-content;
  max-width: 220px;

  background: rgba(20,20,20,0.95);
  color:#fff;
  font-size:12px;
  font-weight:600;
  line-height:1.25;

  padding:8px 10px;
  border-radius:10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);

  opacity:0;
  transform: translateY(-4px);
  pointer-events:none;
  transition: opacity 120ms ease, transform 120ms ease;

  white-space: pre-line; /* чтобы \n работали */
}

/* показать по hover (ПК) и по focus (мобила/клава) */
#profile-popover .pp-bannerHint:hover::after,
#profile-popover .pp-bannerHint:focus::after{
  opacity:1;
  transform: translateY(0);
}

/* ===== Inline nickname edit (popover) ===== */
#profile-popover .pp-nameRow{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

#profile-popover .pp-nameEditIcon{
  display: inline-block; /* ✅ важно */
  width: 14px;
  height: 14px;
  opacity: 0.85;
  background: url("/static/icons/edit.svg") center/contain no-repeat;
}

#profile-popover .pp-nameRow:hover .pp-nameEditIcon{
  opacity: 1;
}

#profile-popover .pp-nameInput{
  display: none;
  width: 180px;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #2b2d31;
  color: #fff;
  outline: none;
  font-weight: 700;
  font-size: 15px;
}

#profile-popover .pp-nameRow.editing .pp-name{
  display: none;
}

#profile-popover .pp-nameRow.editing .pp-nameEditIcon{
  display: none;
}

#profile-popover .pp-nameRow.editing .pp-nameInput{
  display: inline-block;
}

/* ===== Status bubble (like Discord) ===== */
#profile-popover .pp-statusBubble{
  position: absolute;

  left: 108px;     /* ✅ справа от аватара */
  top: 98px;       /* ✅ на уровне середины аватара */

  max-width: 150px;

  background: rgba(43,45,49,0.96);
  color: #e6e6e6;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.2;

  cursor: pointer;
  user-select: none;

  z-index: 10;     /* ✅ чтобы было выше */
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

#profile-popover .pp-statusBubble:hover{
  filter: brightness(1.05);
}

#profile-popover .pp-statusText{
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* textarea скрыто пока не редактируем */
#profile-popover .pp-statusInput{
  display: none;
  width: 190px;
  max-width: 210px;

  resize: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: #2b2d31;
  color: #fff;

  border-radius: 12px;
  padding: 8px 10px;
  outline: none;

  font-size: 12px;
  line-height: 1.2;
}

/* режим редактирования */
#profile-popover .pp-statusBubble.editing{
  border-radius: 14px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#profile-popover .pp-statusBubble.editing .pp-statusText{
  display: none;
}

#profile-popover .pp-statusBubble.editing .pp-statusInput{
  display: block;
}
