/* ==========================================================================
   ماژول استایل پنل‌های اجتماعی (پروفایل من، دوستان، حاضرین، درخواست‌ها، DM)
   متناظر با packages/web/public/ui/socialPanels.js
   ========================================================================== */

/* ---------- اعلان شناور دریافت درخواست دوستی ---------- */
.friend-req-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(21, 25, 38, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(244, 201, 93, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(244, 201, 93, 0.15);
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1100;
  animation: slideDown .3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 92vw;
  direction: rtl;
  color: #f1f5f9;
}
@keyframes slideDown {
  0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- اعلان شناور پیام خصوصی (DM Toast) ---------- */
.dm-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(21, 25, 38, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(244, 201, 93, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(244, 201, 93, 0.15);
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1200;
  animation: slideDown .3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 94vw;
  width: max-content;
  direction: rtl;
  color: #f1f5f9;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.dm-toast.closing {
  opacity: 0;
  transform: translateX(-50%) translateY(-15px);
  pointer-events: none;
}
.dmt-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
  max-width: 250px;
}
.dmt-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dmt-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dmt-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold, #f4c95d);
  background: rgba(244, 201, 93, 0.12);
  border: 1px solid rgba(244, 201, 93, 0.3);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
.dmt-text {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.dmt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 6px;
  flex-shrink: 0;
}
.dmt-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #f4c95d, #df9b2a);
  color: #0d121c;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 7px 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(244, 201, 93, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}
.dmt-open-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(244, 201, 93, 0.45);
}
.dmt-open-btn:active {
  transform: translateY(0);
}
.dmt-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #94a3b8;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}
.dmt-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  transform: scale(1.05);
}
.frt-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.frt-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #f1f5f9;
}
.frt-desc {
  font-size: 11.5px;
  color: #94a3b8;
}
.frt-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: 4px;
}
.frt-btn {
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 6px 12px;
}
.frt-btn.accept {
  background: #10b981;
  color: #062316;
}
.frt-btn.accept:hover {
  background: #34d399;
}
.frt-btn.reject {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
.frt-btn.reject:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* ---------- دکمه‌های وضعیت دوستی در کارت پروفایل ---------- */
.pc-action-btn.is-friend {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.pc-action-btn.is-friend:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
.pc-action-btn.pending {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  cursor: default;
}
.pc-action-btn.accept-highlight {
  background: #10b981;
  color: #041a10;
  font-weight: 800;
  border: none;
}
.pc-action-btn.accept-highlight:hover {
  background: #34d399;
}

/* ---------- درخواست‌ها و دکمه‌های دعوت در پنل دوستان ---------- */
.fp-requests-wrap {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fp-sec-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold);
}
.fp-req-item {
  background: rgba(244, 201, 93, 0.06);
  border: 1px solid rgba(244, 201, 93, 0.2);
  border-radius: 10px;
  padding: 6px 8px;
}
.fp-req-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fp-accept-btn {
  background: #10b981;
  color: #052215;
  border: none;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
}
.fp-reject-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: none;
  font-family: inherit;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 8px;
  cursor: pointer;
}
.fp-inroom-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 8px;
}
.fp-invite-btn.highlight {
  background: rgba(91, 140, 255, 0.2);
  border: 1px solid rgba(91, 140, 255, 0.45);
  color: #93c5fd;
  font-weight: 700;
}
.fp-invite-btn.highlight:hover {
  background: #3b82f6;
  color: #fff;
}

/* ---------- پنل حاضرین ---------- */
.occupants-panel {
  position: fixed; top: 56px; right: 14px; width: 200px;
  background: rgba(10,18,14,.95); border: 1px solid var(--line);
  border-radius: 14px; z-index: 22; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .2s;
}
.occupants-panel.open { max-height: 360px; opacity: 1; }
.occ-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,.06);
  font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--line);
}
.occ-close { background: transparent; border: none; color: #9fb0c4; font-size: 14px; cursor: pointer; padding: 0; }
.occ-close:hover { color: #eaf2ec; }
.occ-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.05);
}
.occ-item.turn { background: rgba(244,201,93,.1); }
.occ-item.me { background: rgba(91,140,255,.1); }
.occ-item.watching { color: #7a8b8e; }
.occ-pos { color: #7a8b8e; font-size: 11px; min-width: 32px; }
.occ-name { flex: 1; }
.occ-badge { font-size: 10px; background: var(--gold); color: #2a1d00; border-radius: 8px; padding: 1px 6px; font-weight: 700; }

/* ---------- منوی سریعِ آواتار/نام: مشاهده پروفایل + پیام خصوصی ---------- */
.avatar-menu {
  background: rgba(10,18,14,.97); border: 1px solid var(--line);
  border-radius: 12px; padding: 5px;
  z-index: 60; box-shadow: 0 10px 32px rgba(0,0,0,.55);
  min-width: 160px;
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 2px;
}
.avatar-menu-item {
  display: block; width: 100%; text-align: right; padding: 8px 10px;
  background: transparent; border: none; border-radius: 8px;
  color: #e7efe9; font-size: 13px; font-family: inherit;
  cursor: pointer; transition: background .12s;
}
.avatar-menu-item:hover { background: rgba(91,140,255,.22); }

/* ---------- کارت پروفایل سریع ---------- */
.profile-card {
  background: linear-gradient(160deg,#101e18,#0c1812); border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px; padding: 16px; z-index: 40;
  box-shadow: 0 12px 36px rgba(0,0,0,.6);
  width: min(320px, 90vw);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 12px;
  text-align: right;
}
/* هدر افقی: آواتار سمت راست + اطلاعات سمت چپ */
.pc-header {
  display: flex; align-items: flex-start; gap: 12px; direction: rtl;
}
.pc-header .seat-avatar { flex: none; width: 72px; height: 72px; font-size: 32px; }
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 2px; }
.pc-user-meta { font-size: 11.5px; color: rgba(207,238,207,.65); }
.pc-close {
  position: absolute; top: 8px; left: 10px;
  background: transparent; border: none; color: #7a8b8e;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.pc-close:hover { color: #eaf2ec; }
.profile-card { position: fixed; z-index: 9999; }
.pc-backdrop { position: fixed; inset: 0; background: rgba(4,10,7,.55); backdrop-filter: blur(2px); z-index: 9998; }

/* ═══ پیام خصوصی ═══ */
.dm-backdrop { position: fixed; inset: 0; background: rgba(4,10,7,.6); backdrop-filter: blur(3px); z-index: 600; }
.dm-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100dvh - 60px));
  display: flex; flex-direction: column; z-index: 601;
  background: linear-gradient(180deg, #151926, #0e111a); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.75), 0 0 0 1px rgba(244,197,66,.12);
}
.dm-head {
  flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  padding: 6px 10px; min-height: 38px; box-sizing: border-box; border-bottom: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(90deg, rgba(244,197,66,.07), rgba(21,25,38,.6));
}
.dm-back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #f4c542;
  cursor: pointer; transition: all 0.15s ease; flex-shrink: 0;
}
.dm-back-btn:hover { background: rgba(244,197,66,0.18); color: #fff; border-color: rgba(244,197,66,0.35); }
.dm-peer-title { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; text-align: right; }
.dm-peer-av { flex-shrink: 0; width: 26px !important; height: 26px !important; }
.dm-peer-av .seat-avatar { width: 26px !important; height: 26px !important; font-size: 11px !important; }
.dm-peer-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.dm-peer, .dm-peer-name { font-weight: 700; font-size: 13px; color: #f2f3f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.dm-peer-sub { font-size: 10.5px; color: #8b90a0; white-space: nowrap; transition: color 0.15s; }
.dm-peer-sub:empty { display: none; }
.dm-peer-sub.typing { color: #38bdf8; font-weight: 600; display: inline-block; }
.dm-load-more {
  text-align: center; padding: 6px 10px; font-size: 11px; color: #8b90a0;
  background: rgba(255,255,255,0.04); border-radius: 8px; margin-bottom: 6px;
}
.fp-typing-text { color: #38bdf8; font-weight: 700; }
@keyframes dmMsgEnter {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.dm-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: radial-gradient(circle at 50% 0%, rgba(244, 197, 66, 0.04) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
              #0f131f;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.dm-log::-webkit-scrollbar {
  width: 4px;
}
.dm-log::-webkit-scrollbar-track {
  background: transparent;
}
.dm-log::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.dm-log::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
.dm-msg {
  max-width: 84%;
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  animation: dmMsgEnter 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.dm-msg.me {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
}
.dm-bub {
  display: inline-flex;
  flex-direction: column;
  background: rgba(26, 32, 48, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px 15px 15px 3px;
  padding: 6px 11px 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #f1f5f9;
  word-break: break-word;
  text-align: right;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: transform 0.1s ease;
}
.dm-msg.me .dm-bub {
  background: linear-gradient(140deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px 15px 3px 15px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
}
.dm-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: inherit;
  white-space: pre-wrap;
  user-select: text;
}
.dm-meta {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 3px;
  margin-top: 2px;
  margin-right: -1px;
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.45);
  user-select: none;
  line-height: 1;
}
.dm-msg.me .dm-meta {
  color: rgba(255, 255, 255, 0.72);
}
.dm-time {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.85;
}
.dm-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dm-status.sent {
  color: rgba(255, 255, 255, 0.6);
}
.dm-status.read {
  color: #38bdf8;
}
.dm-status.read svg {
  stroke: #38bdf8;
}
.dm-status.pending svg {
  animation: dmSpin 1.8s linear infinite;
  opacity: 0.7;
}
@keyframes dmSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.dm-status.error {
  color: #f87171;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.25);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 700;
}
.dm-msg.pending {
  opacity: 0.75;
}
.dm-msg.error .dm-bub {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
}
.dm-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 3px;
  vertical-align: middle;
}
.dm-typing-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #38bdf8;
  display: inline-block;
  animation: dmDotPulse 1.2s infinite ease-in-out;
}
.dm-typing-dots span:nth-child(1) { animation-delay: 0s; }
.dm-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.dm-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dmDotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}
.dm-empty-box {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  max-width: 220px;
}
.dm-empty-bubble-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(244, 197, 66, 0.08);
  color: var(--gold, #f4c542);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.dm-empty-title {
  font-weight: 700;
  font-size: 12px;
  color: #f1f5f9;
  margin-bottom: 3px;
}
.dm-empty-desc {
  font-size: 10px;
  color: #8b90a0;
  line-height: 1.4;
}
.dm-compose { flex: none; display: flex; gap: 7px; padding: 9px 11px; border-top: 1px solid var(--line); background: rgba(10,18,14,.96); }
.dm-compose .dm-input { flex: 1; min-width: 0; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 16px; padding: 8px 13px; font: inherit; font-size: 13px; color: #eaf2ec; }
.dm-compose .dm-input:focus { outline: none; border-color: rgba(91,140,255,.5); }
.pc-action-btn.dm-open-btn { background: rgba(91,140,255,.12); border-color: rgba(91,140,255,.35); }
/* نشانِ پیامِ نخوانده روی آیکونِ دوستان */
.tb-ic .dm-badge { background: #ff5a5a; color: #fff; }
.pc-name { font-weight: 700; font-size: 17px; margin: 0 0 2px; line-height: 1.25; }
.pc-grade { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-bottom: 3px; flex-wrap: wrap; }
.pc-rank { color: var(--gold); font-weight: 700; }
.pc-stats2 { margin-top: 2px; font-size: 12px; }
.pc-grade-label { font-weight: 700; }
.pc-elo-num { color: rgba(207,238,207,.55); }
.pc-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 13px; color: #b9c6bd; margin-bottom: 2px; }
.pc-sep { opacity: .4; }
.pc-bio { font-size: 12px; color: #9fb0c4; font-style: italic; margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
/* ردیف دکمه‌های اکشن */
.pc-actions { display: flex; gap: 6px; }
.pc-action-btn {
  background: rgba(255,255,255,.08); border: 1px solid var(--line);
  color: #eaf2ec; border-radius: 10px; padding: 7px 10px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  flex: 1; min-width: 0; text-align: center;
  transition: background .12s;
}
.pc-action-btn:hover { background: rgba(91,140,255,.28); }
.pc-action-btn.primary-sm {
  background: rgba(91,140,255,.2); border-color: rgba(91,140,255,.5); color: #8ab4ff;
}
.pc-action-btn.primary-sm:hover { background: rgba(91,140,255,.35); }

/* ---------- پنل پروفایل من ---------- */
.my-profile-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 28px));
  max-height: calc(100dvh - 60px); display: flex; flex-direction: column;
  background: #151926; border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px; overflow: hidden; z-index: 501;
  box-shadow: 0 24px 64px rgba(0,0,0,.75);
}
.mp-backdrop { position: fixed; inset: 0; background: rgba(4,6,15,.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 500; }
.mp-body { overflow-y: auto; flex: 1; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mp-av-wrap { position: relative; cursor: pointer; border-radius: 50%; }
.mp-av-wrap .seat-avatar { width: 72px; height: 72px; font-size: 32px; transition: opacity .15s; }
.mp-av-wrap:hover .seat-avatar { opacity: .75; }
.mp-av-hint { position: absolute; bottom: 0; right: 0; background: linear-gradient(135deg, #f9dd8a, #f4c542); color: #1a1200; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.mp-username { font-weight: 800; font-size: 16px; color: #f2f3f6; }
.mp-grade-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.mp-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.mp-stat { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.28); border-radius: 10px; padding: 8px 4px; }
.mp-stat b { font-size: 17px; font-weight: 800; color: #f2f3f6; }
.mp-stat span { font-size: 10px; color: #8b90a0; margin-top: 2px; }
.mp-stat.win b { color: #34d399; }
.mp-stat.loss b { color: #f87171; }
.mp-divider { width: 100%; border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 4px 0; }
.mp-label { font-size: 12px; color: #8b90a0; align-self: flex-start; font-weight: 700; }
.mp-bio-input { width: 100%; background: #1c2030; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; color: #f2f3f6; padding: 9px 12px; font: inherit; font-size: 13px; resize: none; box-sizing: border-box; }
.mp-bio-input:focus { outline: none; border-color: rgba(244,197,66,.5); }
.mp-save-btn {
  width: 100% !important;
  margin-top: 10px !important;
  background: linear-gradient(135deg, #f9dd8a, #f4c542 60%, #b8862a) !important;
  color: #1a1200 !important;
  font-weight: 800 !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  box-shadow: 0 4px 14px rgba(244, 197, 66, 0.25) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mp-save-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.mp-fields-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.mp-field-row { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.mp-field-row-split { display: flex; gap: 8px; width: 100%; }
.mp-field-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mp-field-label { font-size: 11.5px; color: #8b90a0; font-weight: 600; text-align: right; }
.mp-field-input {
  width: 100%; background: #1c2030; border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px; color: #f2f3f6; padding: 7px 10px; font: inherit;
  font-size: 12.5px; box-sizing: border-box;
}
.mp-field-input:focus { outline: none; border-color: rgba(244,197,66,.5); }
.mp-field-select {
  cursor: pointer;
  background-color: #1c2030;
}
.mp-field-select option {
  background: #151926;
  color: #f2f3f6;
}
.pc-user-meta {
  font-size: 11px;
  color: #8b90a0;
  margin-top: -2px;
  margin-bottom: 3px;
  font-weight: 500;
}

/* ---------- پنل دوستان — شیت یکپارچه و مدرن در مرکز صفحه (UX 2026 لوکس) ---------- */
.friends-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.friends-modal-overlay.hidden,
.friends-modal-overlay[hidden] {
  display: none !important;
}

.friends-panel {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: #151926;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(244, 201, 93, 0.1);
  overflow: hidden;
  position: relative;
  color: #f2f3f6;
  animation: modalPop 0.25s var(--ease-spring);
}

.fp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px 14px;
  background: linear-gradient(180deg, rgba(244, 201, 93, 0.06), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.fp-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fp-title-group h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #f2f3f6;
}
.fp-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold, #f4c95d);
  filter: drop-shadow(0 0 8px rgba(244, 201, 93, 0.4));
}
.fp-head-icon svg {
  display: block;
}
.fp-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a8adbd;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.fp-close-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  transform: scale(1.05);
}

.fp-search-wrap {
  padding: 12px 18px;
  background: #12151f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.fp-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c2030;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 7px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fp-search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(244, 201, 93, 0.2);
}
.fp-search-box input {
  background: transparent;
  border: none;
  color: #f2f3f6;
  font-size: 13.5px;
  outline: none;
  width: 100%;
  font-family: inherit;
}
.fp-search-box input::placeholder {
  color: #717789;
}
.fp-search-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8b90a0;
  flex-shrink: 0;
}
.fp-search-ic svg {
  display: block;
}
.fp-search-hint {
  font-size: 11.5px;
  color: var(--gold);
  padding: 2px 4px;
}
.fp-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.fp-requests-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(234, 179, 8, 0.06);
  border-bottom: 1px solid rgba(234, 179, 8, 0.18);
  flex-shrink: 0;
}
.fp-sec-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f6d97a;
}
.fp-req-item {
  background: #1c2030 !important;
  border-color: rgba(234, 179, 8, 0.25) !important;
}
.fp-req-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.fp-accept-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.fp-accept-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}
.fp-reject-btn {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.fp-reject-btn:hover {
  background: rgba(239, 68, 68, 0.28);
}

.fp-list {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1c2030;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  transition: all 0.16s ease;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.fp-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(244, 201, 93, 0.25);
  transform: translateY(-1px);
}
.fp-item.online {
  border-inline-start: 3px solid #10b981;
}
.fp-name-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.fp-name {
  font-size: 14px;
  font-weight: 700;
  color: #f2f3f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-name-link {
  cursor: pointer;
}
.fp-name-link:hover {
  color: var(--gold);
  text-decoration: underline;
}
.fp-status-text {
  font-size: 11px;
  color: #8b90a0;
}
.fp-item.online .fp-status-text {
  color: #34d399;
  font-weight: 600;
}
.fp-req-sub {
  font-size: 11px;
  color: #f6d97a;
}
.fp-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.fp-dm-btn {
  background: rgba(244, 201, 93, 0.12);
  border: 1px solid rgba(244, 201, 93, 0.35);
  color: #f4c542;
  border-radius: 9px;
  padding: 0 10px;
  height: 32px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.16s ease;
  font-family: inherit;
  flex-shrink: 0;
  box-sizing: border-box;
  white-space: nowrap;
}
.fp-dm-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  stroke: currentColor;
}
.fp-dm-btn:hover {
  background: linear-gradient(135deg, #f4c542, #d4af37);
  color: #1a1200;
  border-color: #f4c542;
  box-shadow: 0 0 12px rgba(244, 201, 93, 0.4);
  transform: translateY(-1px);
}
.fp-dm-btn:active {
  transform: translateY(0);
}
.fp-invite-btn {
  background: linear-gradient(135deg, rgba(91, 140, 255, 0.2), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(91, 140, 255, 0.4);
  color: #93c5fd;
  border-radius: 9px;
  padding: 0 10px;
  height: 32px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  white-space: nowrap;
}
.fp-invite-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  display: inline-block;
  stroke: currentColor;
}
.fp-invite-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}
.fp-invite-btn.done {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  cursor: default;
}
.fp-invite-btn.pending {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  cursor: default;
}
.fp-invite-btn.highlight {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
}
.fp-inroom-tag {
  font-size: 11px;
  color: #8b90a0;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}
.fr-av-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.fr-av-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  background: #e53e3e;
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 700;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1.5px solid #142018;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  z-index: 4;
  pointer-events: none;
}
.fr-av-badge.sm {
  top: -2px;
  inset-inline-end: -2px;
  min-width: 11px;
  height: 11px;
  font-size: 7.5px;
  padding: 0 2px;
  border-width: 1px;
}
.fr-av-badge.hidden,
.fr-av-badge[hidden] {
  display: none !important;
}

/* ─── ویوِ پروفایلِ موبایل (فقط نمایش) + منوی کارتیِ ۳تایی ────────────────── */
.pf-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 18px;
  background: #151926;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.pf-edit {
  position: absolute; top: 12px; left: 12px;
  background: #1c2030; color: #e7e9f0;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px;
  padding: 6px 12px; font: 700 12px 'Vazirmatn', Tahoma, sans-serif; cursor: pointer;
  transition: all 0.15s;
}
.pf-edit:hover {
  background: #252b40;
  color: #fff;
}
.pf-av { display: flex; justify-content: center; }
.pf-av .seat-avatar { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); border: 2px solid rgba(244, 197, 66, 0.6); }
.pf-name { margin: 12px 0 4px; font: 700 18px 'Vazirmatn', Tahoma, sans-serif; color: #f2f3f6; }
.pf-grade { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 700; }
.pf-bio { margin: 8px 0 0; font-size: 12.5px; color: #8b90a0; line-height: 1.7; max-width: 34ch; }
.pf-sec {
  align-self: stretch; text-align: start;
  margin: 16px 2px 8px; font-size: 12px; font-weight: 700; color: #8b90a0;
}
.pf-grid { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 10px 4px 8px;
  background: #12151f;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
/* عدد با Vazirmatn (ارقامِ فارسیِ درست) — درشت و رنگی بر اساسِ معنا */
.pf-stat b {
  font: 800 22px/1.15 'Vazirmatn', Tahoma, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #f2f3f6;
}
.pf-stat span { font-size: 8.4px; color: #8b90a0; white-space: nowrap; }
.pf-stat.gold b { color: #f4c542; }
.pf-stat.win  b { color: #5eeab0; }
.pf-stat.loss b { color: #f87171; }
.pf-stat.warn b { color: #fbbf24; }

.pf-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pf-menu-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 78px; padding: 10px 4px;
  background: #1c2030;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px;
  color: #f2f3f6; text-decoration: none; cursor: pointer;
  font: 700 12px 'Vazirmatn', Tahoma, sans-serif;
  transition: all 0.15s ease;
}
.pf-menu-item svg { width: 24px; height: 24px; color: #f4c542; }
.pf-menu-item:hover, .pf-menu-item:active { background: #252b40; border-color: rgba(255, 255, 255, 0.18); }
.pf-menu-item.danger, .pf-menu-item.danger svg { color: #f27272; }
.pf-menu-badge {
  position: absolute; top: 6px; left: 8px;
  background: #ff4757; color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 10px; padding: 1px 5px;
}

/* پنلِ ویرایش: آواتارِ مربعی وسط‌چین + راهنما */
.mp-av-caption { text-align: center; font-size: 11px; color: #8ea598; margin: 4px 0 12px; }
.mp-av-wrap { border-radius: 20px; margin: 6px auto 0; width: fit-content; }
.mp-av-wrap .seat-avatar { width: 78px; height: 78px; }

/* ─── ریسپانسیو پنل دوستان در صفحات کوچک ─── */
@media (max-width: 480px) {
  .friends-modal-overlay {
    padding: 8px;
  }
  .friends-panel {
    max-height: 92vh;
    border-radius: 16px;
  }
  .fp-head {
    padding: 12px 14px 10px;
  }
  .fp-title-group h3 {
    font-size: 16px;
  }
  .fp-search-wrap {
    padding: 10px 14px;
  }
  .fp-list {
    padding: 10px 12px;
    gap: 6px;
  }
  .fp-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .fp-actions {
    gap: 4px;
  }
  .fp-dm-btn, .fp-invite-btn {
    padding: 0 7px;
    height: 30px;
    font-size: 11px;
    gap: 4px;
  }
  .fp-dm-btn svg, .fp-invite-btn svg {
    width: 14px;
    height: 14px;
  }
  .fp-inroom-tag {
    font-size: 10px;
    padding: 3px 6px;
  }
}

/* ─── تب‌های پنل دوستان و گفتگوها ─── */
.fp-tabs-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px 0;
  gap: 8px;
  flex-shrink: 0;
}
.fp-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b90a0;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.fp-tab-btn:hover {
  color: #e2e8f0;
}
.fp-tab-btn.active {
  color: var(--gold, #f4c95d);
  border-bottom-color: var(--gold, #f4c95d);
  background: linear-gradient(180deg, transparent, rgba(244, 201, 93, 0.07));
}
.fp-tab-icon {
  display: inline-flex;
  align-items: center;
}
.fp-tab-chat-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}
.fp-tab-chat-badge.hidden {
  display: none !important;
}

/* ─── کارت‌های لیست گفتگوها (Threads) ─── */
.fp-threads-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fp-thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fp-thread-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(-2px);
}
.fp-thread-item.unread {
  background: rgba(91, 140, 255, 0.09);
  border-color: rgba(91, 140, 255, 0.28);
}
.fp-thread-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.fp-thread-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 4px;
  gap: 8px;
}
.fp-thread-time {
  font-size: 11px;
  color: #8b90a0;
  white-space: nowrap;
}
.fp-thread-snippet {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: right;
}
.fp-thread-snippet.bold {
  color: #f1f5f9;
  font-weight: 700;
}
.fp-thread-badge {
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

/* حالت خالی گفتگوها */
.fp-empty-threads {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 12px;
}
.fp-empty-icon {
  font-size: 42px;
  opacity: 0.6;
}
.fp-empty-threads h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #e2e8f0;
}
.fp-empty-threads p {
  margin: 0;
  max-width: 260px;
  line-height: 1.5;
  color: #8b90a0;
}

/* ─── تب‌های درون‌خطی دوستان و گفتگوها در ریل لابی ─── */
.lb3-fr-unified-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-bottom: 10px !important;
}
.lb3-fr-head-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 800;
  color: #f1f5f9;
}
.lb3-fr-head-title .lb3-tab-icon svg {
  color: var(--gold, #f4c95d);
}
.lb3-frrow.has-unread {
  background: rgba(244, 201, 93, 0.08);
  border: 1px solid rgba(244, 201, 93, 0.22);
}
.lb3-frrow.has-unread:hover {
  background: rgba(244, 201, 93, 0.14);
}
.lb3-frrow.has-unread .lb3-frname {
  color: #fff;
  font-weight: 700;
}
.lb3-chat-quick-btn.unread-btn {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}
.lb3-rail-tabs-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-bottom: 10px !important;
}
.lb3-rail-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 2px;
  gap: 3px;
  flex: 1;
}
.lb3-rail-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.lb3-rail-tab:hover {
  color: #f1f5f9;
}
.lb3-rail-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold, #f4c95d);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.lb3-rail-tab .lb3-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lb3-rail-tab .lb3-tab-icon svg {
  display: block;
  stroke: currentColor;
  transition: transform 0.15s ease, stroke 0.15s ease;
}
.lb3-rail-tab:hover .lb3-tab-icon svg {
  transform: scale(1.08);
}
.lb3-tab-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lb3-tab-badge.hidden {
  display: none !important;
}
.lb3-chatrow {
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb3-chatrow:hover {
  background: rgba(255, 255, 255, 0.06);
}
.lb3-chatrow.unread {
  background: rgba(244, 201, 93, 0.06);
}
.lb3-chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lb3-chat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.lb3-chat-time {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 500;
}
.lb3-chat-snippet {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
}
.lb3-chat-snippet.bold {
  color: #f1f5f9;
  font-weight: 700;
}
.lb3-empty-threads {
  padding: 20px 10px;
  text-align: center;
}

/* ─── جستجوی درون‌خطی در ریل لابی ─── */
.lb3-rail-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.lb3-rail-search-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  color: #f1f5f9;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.lb3-rail-search-input:focus {
  border-color: var(--gold, #f4c95d);
}
.lb3-rail-search-clear {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb3-rail-search-clear:hover {
  color: #fff;
}

/* ─── ابعاد و چیدمان یکپارچه پنل دوستان و گفتگوها در سایدبار لابی ─── */
.lb3-social-panel {
  height: 345px !important;
  max-height: 345px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding: 12px 14px !important;
  background: #151926 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}
.lb3-social-panel .lb3-mini-head {
  flex: none;
  margin-bottom: 8px;
}
.lb3-social-panel .lb3-rail-search-wrap {
  flex: none;
  margin-bottom: 8px;
}
.lb3-social-panel .lb3-frlist {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

/* ─── حالت درون‌خطی چت خصوصی در سایدبار لابی و پنل دوستان ─── */
.dm-panel.dm-inline,
.dm-inline-panel {
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 16px !important;
  background: transparent !important;
  margin: 0 !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.dm-panel.dm-inline .dm-head,
.dm-inline-panel .dm-head {
  padding: 4px 10px !important;
  min-height: 34px !important;
  height: 34px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  background: linear-gradient(90deg, rgba(244, 197, 66, 0.08), rgba(21, 25, 38, 0.8)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  flex-shrink: 0 !important;
}
.dm-panel.dm-inline .dm-back-btn,
.dm-inline-panel .dm-back-btn {
  width: 24px !important;
  height: 24px !important;
}
.dm-panel.dm-inline .dm-peer-av,
.dm-inline-panel .dm-peer-av {
  width: 24px !important;
  height: 24px !important;
}
.dm-panel.dm-inline .dm-peer-av .seat-avatar,
.dm-inline-panel .dm-peer-av .seat-avatar {
  width: 24px !important;
  height: 24px !important;
  font-size: 10px !important;
}
.dm-panel.dm-inline .dm-log,
.dm-inline-panel .dm-log {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
  padding: 10px 10px 8px !important;
  gap: 6px !important;
  display: flex !important;
  flex-direction: column !important;
  background: radial-gradient(circle at 50% 0%, rgba(244, 197, 66, 0.04) 0%, transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
              #0f131f !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.dm-panel.dm-inline .dm-compose,
.dm-inline-panel .dm-compose {
  padding: 6px 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #151926 !important;
  flex-shrink: 0 !important;
}
.dm-panel.dm-inline .dm-compose .dm-input,
.dm-inline-panel .dm-compose .dm-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 12.5px;
  direction: rtl;
  transition: all 0.2s ease;
}
.dm-panel.dm-inline .dm-compose .dm-input:focus,
.dm-inline-panel .dm-compose .dm-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(244, 197, 66, 0.5);
  box-shadow: 0 0 0 2px rgba(244, 197, 66, 0.15);
}
.dm-panel.dm-inline .dm-compose .dm-input::placeholder,
.dm-inline-panel .dm-compose .dm-input::placeholder {
  color: #767b8d;
}
.dm-panel.dm-inline .dm-compose .composer-send,
.dm-inline-panel .dm-compose .composer-send {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f9dd8a 0%, #f4c542 50%, #b8862a 100%);
  color: #241a04;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(184, 134, 42, 0.35);
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, filter 0.15s ease;
}
.dm-panel.dm-inline .dm-compose .composer-send:hover,
.dm-inline-panel .dm-compose .composer-send:hover {
  filter: brightness(1.06);
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 197, 66, 0.45);
}
.dm-panel.dm-inline .dm-compose .composer-send:active,
.dm-inline-panel .dm-compose .composer-send:active {
  filter: brightness(0.95);
  transform: scale(0.96);
}
.dm-panel.dm-inline .dm-msg,
.dm-inline-panel .dm-msg {
  max-width: 88% !important;
}

.lb3-mini.lb3-social-panel.lb3-in-chat {
  padding: 0 !important;
  overflow: hidden !important;
  height: 345px !important;
  max-height: 345px !important;
}

.friends-panel .dm-inline-panel,
.friends-panel .dm-panel.dm-inline {
  border: none !important;
  border-radius: 20px !important;
  height: 520px !important;
  max-height: 80vh !important;
}

.lb3-chat-quick-btn {
  margin-right: auto;
  margin-left: 0;
  padding: 3px 6px;
  opacity: 0.6;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background 0.15s;
}
.lb3-chat-quick-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .mobile-tab-content .lb3-social-panel,
  .mobile-tab-content .lb3-social-panel.lb3-in-chat {
    height: calc(100dvh - 160px) !important;
    max-height: none !important;
  }
}



