/* ══════════════════════════════
   SIDEBAR OVERLAY
══════════════════════════════ */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 400; }
.sidebar-overlay.show { display: block; }

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 240px; height: 100dvh;
  background: linear-gradient(to bottom, transparent 80px, #13112b 80px);
  border-radius: 0 0 18px 0;
  z-index: 500;
  transform: translateX(-240px);
  transition: transform 0.28s ease;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar.open { transform: translateX(0); }

.side-header-spacer { height: 80px; flex-shrink: 0; }

.side-avatar-wrap {
  position: absolute; top: 0; right: 8px;
  width: 160px; height: 160px;
  pointer-events: none; z-index: 2;
}
.side-avatar-img {
  width: 160px; height: 160px; object-fit: cover; object-position: top center; display: block;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 82%);
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 82%);
}
.side-avatar-placeholder {
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #555 0%, #111 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 82%);
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 82%);
}

.side-user-header { background: #2a1860; border-radius: 0 18px 0 0; padding: 28px 14px 14px; flex-shrink: 0; }
.side-welcome-line { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-welcome-name { color: #f5c400; }
.side-logout-btn { color: #eb0400; font-size: 11px; font-weight: 600; cursor: pointer; background: none; border: none; padding: 0; margin-top: 4px; display: block; }
.side-logout-btn:hover { text-decoration: underline; }

#sidebarContent { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }

.side-nav { flex-shrink: 0; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 2px; }
.side-nav-item { font-size: 22px; font-weight: 700; color: #fff; cursor: pointer; padding: 5px 0; background: none; border: none; text-align: left; transition: color 0.15s; white-space: nowrap; }
.side-nav-item:hover { color: #9147ff; }
.side-nav-item.active { color: #9147ff; }
.side-nav-devtools { font-size: 13px !important; color: #6e6e7a !important; margin-top: 6px; }
.side-nav-devtools:hover { color: #f5c400 !important; }
.side-nav-devtools.active { color: #f5c400 !important; }

/* Login / Register form */
.form-section { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.form-title { font-size: 11px; font-weight: 700; color: #adadb8; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 2px; }
input[type=text], input[type=password] { background: #0e0e10; border: 1px solid #3a3a3d; border-radius: 6px; color: #efeff1; font-size: 13px; padding: 8px 10px; width: 100%; outline: none; }
input:focus { border-color: #9147ff; }
.btn { border: none; border-radius: 6px; font-size: 13px; font-weight: 700; padding: 9px; cursor: pointer; width: 100%; transition: filter 0.15s; }
.btn:hover { filter: brightness(1.15); }
.btn-primary   { background: #9147ff; color: #fff; }
.btn-secondary { background: #2a2a2d; color: #efeff1; }
.form-msg { font-size: 12px; color: #eb0400; min-height: 16px; }
.form-msg.ok { color: #2ecc71; }

/* Friends section */
.side-friends-section { padding: 0 12px 12px; flex-shrink: 0; }
.side-friends-header {
  font-size: 11px; font-weight: 700; color: #adadb8;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.side-friends-tabs { display: flex; border-bottom: 1px solid #2a2a2d; margin-bottom: 4px; }
.side-friends-tab {
  flex: 1; padding: 5px 0; font-size: 10px; font-weight: 700; color: #adadb8;
  background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.side-friends-tab.active { color: #9147ff; border-bottom-color: #9147ff; }
.side-friends-tab:hover:not(.active) { color: #efeff1; }
.side-friends-list { display: flex; flex-direction: column; gap: 1px; }
.side-friend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; border-radius: 6px; cursor: pointer;
  transition: background 0.1s;
}
.side-friend-row:hover { background: #1f1f23; }
.side-friend-avatar-wrap { position: relative; flex-shrink: 0; }
.side-friend-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.side-friend-dot {
  position: absolute; bottom: 0; right: -1px;
  width: 9px; height: 9px; border-radius: 50%; border: 2px solid #13112b;
}
.side-friend-dot.online   { background: #00b85c; }
.side-friend-dot.hangout  { background: #9147ff; }
.side-friend-dot.away     { background: #f59e0b; }
.side-friend-dot.offline  { background: #6b7280; }
.side-friend-nick { font-size: 12px; font-weight: 600; color: #efeff1; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-friends-empty { font-size: 11px; color: #6e6e7a; padding: 6px 2px; }

/* Mini perfil */
#friendMiniProfile {
  position: fixed; z-index: 600;
  width: 240px;
  background: #0e0c1e;
  border: 1px solid #3a3a4d;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.85);
  display: none;
}
#friendMiniProfile.show { display: block; }
.fmp-banner {
  height: 52px; background: #2a1860; position: relative; flex-shrink: 0;
}
.fmp-avatar-wrap {
  position: absolute; bottom: -18px; left: 12px;
  width: 44px; height: 44px;
  border-radius: 50%; border: 3px solid #0e0c1e;
  overflow: hidden; background: #1a1840;
}
.fmp-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fmp-body { padding: 24px 12px 10px; }
.fmp-nick { font-size: 14px; font-weight: 700; color: #efeff1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmp-status { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11px; color: #adadb8; }
.fmp-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.fmp-status-dot.online  { background: #00b85c; }
.fmp-status-dot.hangout { background: #9147ff; }
.fmp-status-dot.away    { background: #f59e0b; }
.fmp-status-dot.offline { background: #6b7280; }
.fmp-actions { display: flex; gap: 6px; margin-top: 10px; }
.fmp-btn {
  flex: 1; padding: 7px 0; border: none; border-radius: 7px;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: filter 0.15s;
}
.fmp-btn:hover { filter: brightness(1.15); }
.fmp-btn-primary   { background: #9147ff; color: #fff; }
.fmp-btn-follow    { background: #2ecc71; color: #0a1a0a; }
.fmp-btn-danger    { background: #2a2a2d; color: #eb0400; }
.fmp-btn-danger:hover { background: #eb0400; color: #fff; filter: none; }

/* Online section */
.side-online-section { padding: 0 14px 16px; flex-shrink: 0; }
.side-online-header { font-size: 11px; font-weight: 700; color: #adadb8; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; user-select: none; }
.side-online-header .sol-star { color: #f5c400; font-size: 13px; }
.side-online-clip { overflow: hidden; }
.side-online-clip.sol-active { height: 146px; -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%); }
.side-online-list { display: flex; flex-direction: column; gap: 6px; }
.side-online-list.sol-scrolling { animation: sol-scroll var(--sol-dur, 10s) linear infinite; }
@keyframes sol-scroll { from { transform: translateY(0); } to { transform: translateY(var(--sol-offset, -200px)); } }
.side-online-row { display: flex; align-items: center; gap: 8px; height: 32px; flex-shrink: 0; }
.side-online-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid #9147ff; flex-shrink: 0; background: #1a1a2e; }
.side-online-nick { font-size: 12px; font-weight: 700; color: #efeff1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }

/* Botão de notificações (permanente) */
.side-notif-btn {
  display: block; margin: 0 12px 6px;
  background: linear-gradient(135deg, #0e0020, #1a0a30);
  border: 1px solid #9147ff;
  border-radius: 8px; padding: 8px 10px;
  cursor: pointer; text-align: left; width: calc(100% - 24px);
  color: #c084fc; font-size: 12px; font-weight: 700;
  animation: none;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 4px rgba(145,71,255,0.2);
}
.side-notif-btn.has-notifs { animation: purpleGlow 2s ease-in-out infinite; }
.side-notif-btn:hover { background: linear-gradient(135deg, #1a0a30, #2a1050); }
@keyframes purpleGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(145,71,255,0.3); }
  50%       { box-shadow: 0 0 18px rgba(145,71,255,0.7); }
}

/* Painel de notificações */
#notifOverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72); z-index: 2000;
  align-items: center; justify-content: center;
}
#notifOverlay.show { display: flex; }
#notifPanel {
  background: #0e0e10; border: 1px solid #2a2a3d;
  border-radius: 16px; width: 400px; max-width: 94vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 16px 60px rgba(0,0,0,.85);
}
.nfp-header {
  background: #18181b; border-bottom: 2px solid #9147ff;
  padding: 14px 18px; display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.nfp-title { font-size: 15px; font-weight: 700; color: #c084fc; flex: 1; }
.nfp-mark-all {
  background: none; border: 1px solid #3a3a4d; color: #adadb8;
  font-size: 11px; font-weight: 600; padding: 5px 10px;
  border-radius: 6px; cursor: pointer; transition: all .15s;
}
.nfp-mark-all:hover { border-color: #9147ff; color: #c084fc; }
.nfp-close {
  background: none; border: none; color: #6e6e7a;
  font-size: 18px; cursor: pointer; line-height: 1; padding: 0;
}
.nfp-close:hover { color: #eb0400; }
.nfp-list { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.nfp-list::-webkit-scrollbar { width: 4px; }
.nfp-list::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 2px; }
.nfp-item {
  display: flex; align-items: center; gap: 10px;
  background: #18181b; border: 1px solid #2a2a2d; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: background .15s;
  position: relative;
}
.nfp-item:hover { background: #1f1f27; }
.nfp-item.unread { border-color: #4a2a7a; background: #14102a; }
.nfp-item.unread::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: #9147ff; border-radius: 0 3px 3px 0;
}
.nfp-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #1a1840; }
.nfp-icon { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
.nfp-text { flex: 1; min-width: 0; }
.nfp-msg { font-size: 13px; font-weight: 600; color: #efeff1; }
.nfp-time { font-size: 10px; color: #6e6e7a; margin-top: 2px; }
.nfp-empty { text-align: center; color: #6e6e7a; font-size: 13px; padding: 28px 0; }

/* Solicitações de amizade — badge dourado */
.side-friend-req-btn {
  display: none; margin: 0 12px 10px;
  background: linear-gradient(135deg, #1a1200, #2a1e00);
  border: 1px solid #f5c400;
  border-radius: 8px; padding: 8px 10px;
  cursor: pointer; text-align: left; width: calc(100% - 24px);
  color: #f5c400; font-size: 12px; font-weight: 700;
  animation: goldGlow 2s ease-in-out infinite;
  transition: background 0.15s;
}
.side-friend-req-btn.has-requests { display: block; }
.side-friend-req-btn:hover { background: linear-gradient(135deg, #2a1e00, #3a2a00); }
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(245,196,0,0.3); }
  50%       { box-shadow: 0 0 18px rgba(245,196,0,0.7); }
}

/* Overlay de solicitações */
#friendReqOverlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.72); z-index: 2000;
  align-items: center; justify-content: center;
}
#friendReqOverlay.show { display: flex; }
#friendReqPanel {
  background: #0e0e10; border: 1px solid #2a2a3d;
  border-radius: 16px; width: 380px; max-width: 94vw;
  max-height: 80vh; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 16px 60px rgba(0,0,0,.85);
}
.frp-header {
  background: #18181b; border-bottom: 2px solid #f5c400;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.frp-title { font-size: 15px; font-weight: 700; color: #f5c400; }
.frp-close {
  background: none; border: none; color: #6e6e7a;
  font-size: 18px; cursor: pointer; line-height: 1; padding: 0;
}
.frp-close:hover { color: #eb0400; }
.frp-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.frp-list::-webkit-scrollbar { width: 4px; }
.frp-list::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 2px; }
.frp-item {
  display: flex; align-items: center; gap: 12px;
  background: #18181b; border: 1px solid #2a2a2d; border-radius: 10px;
  padding: 10px 12px;
}
.frp-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid #2a2a2d; }
.frp-nick { font-size: 14px; font-weight: 700; color: #efeff1; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frp-btns { display: flex; gap: 6px; flex-shrink: 0; }
.frp-accept {
  background: #9147ff; border: none; color: #fff;
  font-size: 11px; font-weight: 700; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.frp-accept:hover { background: #7b35e0; }
.frp-deny {
  background: #2a2a2d; border: none; color: #adadb8;
  font-size: 11px; font-weight: 700; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; transition: background .15s;
}
.frp-deny:hover { background: #eb0400; color: #fff; }
.frp-empty { text-align: center; color: #6e6e7a; font-size: 13px; padding: 24px 0; }

/* Sidebar tab (persistent left-edge button) */
.sidebar-tab { position: fixed; left: 0; top: 50%; transform: translateY(-50%); background: #9147ff; color: #fff; border: none; border-radius: 0 8px 8px 0; padding: 14px 5px; cursor: pointer; z-index: 450; font-size: 16px; transition: left 0.28s ease; line-height: 1; }
.sidebar-tab:hover { background: #7b35e0; }
.sidebar-tab.pushed { left: 240px; }

/* Notif stack */
#notif-stack {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  align-items: flex-end; pointer-events: none;
}
.notif-card {
  background: #18181b; border-radius: 12px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 300px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.8);
  pointer-events: auto; cursor: default;
  transform: translateX(340px);
  transition: transform 0.3s cubic-bezier(.2,.8,.4,1), opacity 0.3s;
  opacity: 0;
}
.notif-card.in  { transform: translateX(0); opacity: 1; }
.notif-card.out { transform: translateX(340px); opacity: 0; }
.notif-card.poke   { border: 1px solid #9147ff; }
.notif-card.friend { border: 2px solid #9147ff; cursor: pointer; }
