/* =========================
   RESET & BASE
========================= */
*{margin:0;padding:0;box-sizing:border-box;}

html,body{
  height:100%;
}

body{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
  background:linear-gradient(135deg,#f6f7ff,#eef1ff);
  color:#111;
  overflow:hidden;

  display:flex;
  flex-direction:column;
  /* "100dvh" tək başına telefon fon rejimindən/bfcache-dən qayıdanda bəzi
     mobil brauzerlərdə köhnə dəyərlə "yapışıb" qala bilir. js/chat.js
     --app-height-i real window.innerHeight ilə təzələyir (JS-in öz ölçməsi
     brauzerin daxili dvh keşindən asılı deyil) — dəyər hələ təyin olunmayıbsa
     (JS işə düşməmişdən əvvəlki ilk anlıq render) 100dvh ehtiyat kimi qalır. */
  height:100dvh;
  height: var(--app-height, 100dvh);
}

/* =========================
   HEADER
========================= */
.chat-header{
  position: relative;
  flex:0 0 auto;
  backdrop-filter:blur(14px);
  background:rgba(255,255,255,.8);
  border-bottom:1px solid rgba(0,0,0,.06);
  z-index: 1000;
}

.chat-daily-music {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(0,0,0,.05);
  background: rgba(255,255,255,.72);
}

.chat-daily-music[hidden] {
  display: none;
}

.chat-daily-music-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.chat-daily-music-label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6a5cff;
}

.chat-daily-music-title,
.chat-daily-music-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-daily-music-title {
  font-size: 14px;
  color: #111;
}

.chat-daily-music-artist {
  font-size: 12px;
  color: #666;
}

.chat-daily-music-actions {
  display: flex;
  gap: 8px;
}

.chat-daily-music-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg,#6a5cff,#8b7cff);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(106,92,255,.24);
}

.chat-mission-strip {
  padding: 8px 12px 10px;
  border-top: 1px solid rgba(0,0,0,.05);
  background: linear-gradient(135deg, rgba(255,209,102,.32), rgba(6,214,160,.18));
}

/* 🎨 Müvəqqəti ad effektləri (hərrac/mükafat sistemi) — nişan (tier-name-*)
   rənglənməsi ilə eyni texnika, amma tam ayrıca, müstəqil sinif adları ilə.
   !important: css/badges.css bu fayldan SONRA yüklənir və eyni gücdə
   (.user-name-text[class*="tier-name-"]) qaydası var — nişan səviyyəsi ilə
   toqquşanda, aktiv qazanılmış mükafat (bu effekt) üstün olmalıdır. */
.user-name-text.name-effect-gold {
  background: linear-gradient(90deg, #b8860b, #ffe9a8, #b8860b) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-silver {
  background: linear-gradient(90deg, #9ea4ad, #f3f5f7, #9ea4ad) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-neon {
  background: linear-gradient(90deg, #0bd97a, #baffdf, #0bd97a) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(11, 217, 122, .55);
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-rainbow {
  background: linear-gradient(90deg, #ff3d3d, #ff9f1c, #ffee32, #2ee6a6, #3aa0ff, #c04bff, #ff3d3d) !important;
  background-size: 300% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  animation: name-effect-rainbow-shift 3s linear infinite !important;
}

.user-name-text.name-effect-flame {
  background: linear-gradient(90deg, #ff4d1c, #ffcf4d, #ff4d1c) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 77, 28, .55);
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-ice {
  background: linear-gradient(90deg, #6fd8ff, #eafcff, #6fd8ff) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(111, 216, 255, .55);
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-stars {
  background: linear-gradient(90deg, #ffe9a8, #ffffff, #ffe9a8) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(255, 255, 255, .85);
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

.user-name-text.name-effect-vipblack {
  background: linear-gradient(90deg, #b8860b, #1a1a1a, #b8860b) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  animation: name-effect-gold-shift 2.4s linear infinite !important;
}

/* 🌟 "Qızıl gün" — #103 Gizli Qutu-nun pulla ALINA BİLMƏYƏN yeganə effekti.
   Digərlərindən fərqi: sabit sürüşən zolaq YOX, DÖYÜNƏN parıltı (pulse) —
   ekranda dərhal fərqlənsin deyə. */
.user-name-text.name-effect-goldenday {
  background: linear-gradient(90deg, #ffd700, #fff6c8, #ffd700) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  font-weight: 700;
  animation: name-effect-gold-shift 2.4s linear infinite, name-effect-goldenday-pulse 1.4s ease-in-out infinite !important;
}

@keyframes name-effect-goldenday-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(255, 215, 0, .55); }
  50% { text-shadow: 0 0 16px rgba(255, 215, 0, 1); }
}

@keyframes name-effect-gold-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes name-effect-rainbow-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ✨ Avatar çərçivəsi (hərrac mükafatı) — nişan sisteminin frame-{tier}
   sinifindən (css/badges.css, `.message-row .avatar.frame-{tier}`, 3 sinif =
   daha yüksək spesifiklik) TAM AYRICA. !important olmasa, nişan səviyyəsi
   olan istifadəçilərdə bu effekt görünməzdi — ad effektindəki eyni problem. */
.avatar.avatar-frame-glow {
  box-shadow: 0 0 0 3px #fff176, 0 0 14px 3px rgba(255, 241, 118, .85) !important;
  animation: avatar-frame-glow-pulse 1.6s ease-in-out infinite !important;
}

@keyframes avatar-frame-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #fff176, 0 0 12px 3px rgba(255, 241, 118, .7); }
  50% { box-shadow: 0 0 0 3px #fff176, 0 0 24px 5px rgba(255, 241, 118, 1); }
}

/* #55 Alına bilən profil çərçivələri — "glow" (yalnız hərracdan) ilə EYNİ
   sistemin (activeAvatarFrame) 3 YENİ, tam ayrıca, birbaşa SATIN ALINA
   BİLƏN variantı. #avatarImg seçicisi profile.html-in öz avatarı üçündür
   (əvvəllər bu effekt yalnız çatda göstərilirdi, profildə heç vaxt
   göstərilmirdi). */
.avatar.avatar-frame-ice,
#avatarImg.avatar-frame-ice {
  box-shadow: 0 0 0 3px #7ee8fa, 0 0 14px 3px rgba(126, 232, 250, .85) !important;
  animation: avatar-frame-ice-pulse 1.8s ease-in-out infinite !important;
}
@keyframes avatar-frame-ice-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #7ee8fa, 0 0 10px 3px rgba(126, 232, 250, .6); }
  50% { box-shadow: 0 0 0 3px #7ee8fa, 0 0 22px 5px rgba(126, 232, 250, 1); }
}

.avatar.avatar-frame-emerald,
#avatarImg.avatar-frame-emerald {
  box-shadow: 0 0 0 3px #2ecc71, 0 0 14px 3px rgba(46, 204, 113, .8) !important;
  animation: avatar-frame-emerald-pulse 2s ease-in-out infinite !important;
}
@keyframes avatar-frame-emerald-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #2ecc71, 0 0 10px 3px rgba(46, 204, 113, .55); }
  50% { box-shadow: 0 0 0 3px #a8ffce, 0 0 20px 4px rgba(46, 204, 113, .95); }
}

.avatar.avatar-frame-sunset,
#avatarImg.avatar-frame-sunset {
  animation: avatar-frame-sunset-cycle 3s linear infinite !important;
}
@keyframes avatar-frame-sunset-cycle {
  0%   { box-shadow: 0 0 0 3px #ff7e5f, 0 0 16px 4px rgba(255, 126, 95, .8); }
  33%  { box-shadow: 0 0 0 3px #feb47b, 0 0 16px 4px rgba(254, 180, 123, .8); }
  66%  { box-shadow: 0 0 0 3px #c56cf0, 0 0 16px 4px rgba(197, 108, 240, .8); }
  100% { box-shadow: 0 0 0 3px #ff7e5f, 0 0 16px 4px rgba(255, 126, 95, .8); }
}

/* 💎 #56 hissə 5: VIP-yalnız "Almaz Çərçivə" — digərlərindən fərqli olaraq
   tam göy qurşağı sürətli dövrə (6 dayanacaq, digərləri 3-lə keçinir) —
   "super"/eksklüziv hiss etdirmək üçün digər çərçivələrdən nəzərəçarpacaq
   dərəcədə fərqli. */
.avatar.avatar-frame-diamond,
#avatarImg.avatar-frame-diamond {
  animation: avatar-frame-diamond-cycle 2s linear infinite !important;
}
@keyframes avatar-frame-diamond-cycle {
  0%   { box-shadow: 0 0 0 3px #ff5f6d, 0 0 18px 5px rgba(255, 95, 109, .85); }
  16%  { box-shadow: 0 0 0 3px #ffc371, 0 0 18px 5px rgba(255, 195, 113, .85); }
  33%  { box-shadow: 0 0 0 3px #f9f871, 0 0 18px 5px rgba(249, 248, 113, .85); }
  50%  { box-shadow: 0 0 0 3px #7effa0, 0 0 18px 5px rgba(126, 255, 160, .85); }
  66%  { box-shadow: 0 0 0 3px #71c9ff, 0 0 18px 5px rgba(113, 201, 255, .85); }
  83%  { box-shadow: 0 0 0 3px #c371ff, 0 0 18px 5px rgba(195, 113, 255, .85); }
  100% { box-shadow: 0 0 0 3px #ff5f6d, 0 0 18px 5px rgba(255, 95, 109, .85); }
}

/* 💬 Mesaj balonu stili (hərrac mükafatı) — .message-row.me/.other öz fon
   rəngini təyin etdiyi üçün (daha yüksək spesifiklik), !important lazımdır. */
.message-bubble.bubble-style-gold {
  background: linear-gradient(135deg, #b8860b, #ffe9a8) !important;
  color: #2b1d00 !important;
}

.message-bubble.bubble-style-purple {
  background: linear-gradient(135deg, #7b2ff7, #f107a3) !important;
  color: #fff !important;
}

.message-bubble.bubble-style-glow {
  box-shadow: 0 0 0 2px #6a5cff, 0 0 16px 2px rgba(106, 92, 255, .55) !important;
}

.message-bubble.bubble-style-italic {
  font-style: italic;
  font-weight: 600;
}

/* 💬 #56 hissə 3: birbaşa (bal ilə, mağazadan) satın alınan balon effektləri —
   yuxarıdakı 4-ü (gold/purple/glow/italic) YALNIZ hərracdan qazanılır, bunlar
   isə magaza.html-də həmişəlik satın alınır. Eyni activeBubbleStyle
   sahəsini/render kodunu bölüşür (bax js/chat.js ALL_BUBBLE_STYLES), ona görə
   yalnız siyahıya əlavə sinif adları kifayətdir. */
.message-bubble.bubble-style-ocean {
  background: linear-gradient(135deg, #0575e6, #00f260) !important;
  color: #012b1f !important;
}

.message-bubble.bubble-style-midnight {
  background: linear-gradient(135deg, #232526, #0f2027) !important;
  color: #eae6ff !important;
  box-shadow: 0 0 0 1px rgba(155, 130, 255, .5) !important;
}

.message-bubble.bubble-style-neon {
  background: linear-gradient(135deg, #d4fc79, #96e6a1) !important;
  color: #0d2b0d !important;
  box-shadow: 0 0 10px 1px rgba(150, 230, 161, .7) !important;
}

/* 👑 #56 hissə 5: VIP-yalnız "Kral Balonu" — statik deyil, ANİMASİYALI
   qızıl/bənövşəyi axan qradient (digər balon effektlərinin heç biri
   animasiyalı deyil, ona görə bu VIP eksklüzivliyini vizual olaraq dərhal
   fərqləndirir). */
.message-bubble.bubble-style-royal {
  background: linear-gradient(120deg, #bf953f, #fcf6ba, #b993d6, #8ca6db, #bf953f) !important;
  background-size: 300% 300% !important;
  animation: bubble-royal-shift 3s ease infinite !important;
  color: #2b1d3d !important;
  box-shadow: 0 0 12px 2px rgba(191, 149, 63, .5) !important;
}
@keyframes bubble-royal-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 🔵 Ad yanında yanıb-sönən nöqtə (hərrac mükafatı). */
.user-name-text.name-glow-dot::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 5px;
  border-radius: 50%;
  background: #2ee6a6;
  vertical-align: middle;
  animation: name-glow-dot-blink 1.2s ease-in-out infinite;
}

@keyframes name-glow-dot-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px 1px rgba(46, 230, 166, .9); }
  50% { opacity: .35; box-shadow: 0 0 2px 0 rgba(46, 230, 166, .4); }
}

/* 🏷️ Müvəqqəti ləqəb (hərrac/mükafat sistemi) — adın yanında kiçik nişan. */
.user-title-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(90deg, #6a5cff, #a78bfa);
  vertical-align: middle;
}

.user-title-badge[hidden] {
  display: none;
}

.chat-mission-strip[hidden] {
  display: none !important;
}

.chat-mission-strip button {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111;
  text-align: left;
  cursor: pointer;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
}

.chat-mission-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,209,102,.45);
}

.chat-mission-strip b,
.chat-mission-strip small {
  display: block;
}

.chat-mission-strip small {
  color: #666;
  margin-top: 2px;
}

/* 🤝 #58 Əl tutma bonusu — bal 0-a düşəndə çatın başında görünən, tək-sətirli
   dəvət. hidden olanda tam yoxa çıxır (kilidli/passiv görünüş yoxdur, çünki
   bu düymə YALNIZ uyğun olanda render olunur — bax js/chat.js). */
.helping-hand-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 10px 14px;
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1a3a1a;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, #d4fc79, #96e6a1);
  box-shadow: 0 6px 16px rgba(150, 230, 161, .35);
}

.helping-hand-banner.hidden {
  display: none;
}

/* 🔨 Qlobal hərrac zolağı — mövcud .chat-mission-strip stilini bazası kimi
   istifadə edir, sadəcə öz elementləri üçün əlavə qaydalar. */
.auction-strip .auction-strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  cursor: pointer;
  user-select: none;
}

/* Yığcam görünüş: yalnız başlıq zolağı (indiki qalib/hovuz + saat) görünür,
   ekranın çox yerini tutmasın deyə. Zolağın özünə basanda (aşağıdakı JS)
   açılıb-bağlanır — "Otaqdakılar" panelindəki eyni naxış. */
.auction-strip-body {
  display: none;
  margin-top: 10px;
}

.auction-strip.expanded .auction-strip-body {
  display: block;
}

/* Aşağıda, ortada kiçik yellənən ox — zolağın sürüşdürülüb açıla biləcəyini
   bildirir. Açılanda yuxarı dönür (bağlamaq işarəsi). */
.auction-strip-toggle {
  display: block;
  margin: 4px auto 0;
  width: fit-content;
  font-size: 20px;
  line-height: 1;
  opacity: .7;
  cursor: pointer;
  animation: auction-toggle-bounce 1.6s ease-in-out infinite;
  transition: transform .2s ease;
}

.auction-strip.expanded .auction-strip-toggle {
  transform: rotate(180deg);
  animation: none;
}

@keyframes auction-toggle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

.auction-strip-info {
  flex: 1 1 180px;
  min-width: 0;
}

.auction-strip-info b,
.auction-strip-info small {
  display: block;
}

.auction-strip-info small {
  color: #666;
  margin-top: 2px;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.4;
}

/* Qatlanmış halda mətn bir sətirdə kəsilir (lider adı əvvəldə olduğu üçün
   həmişə görünür) — açılanda normal, çox sətirli mətnə qayıdır. */
.auction-strip:not(.expanded) .auction-strip-info small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auction-strip-timer {
  flex: 0 0 auto;
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 6px 14px rgba(0,0,0,.08);
}

.auction-strip-bid-row {
  display: flex;
  margin-top: 8px;
}

/* Təklif düyməsi indi ayrıca yer tutmur — rəqəm qutusunun sağ küncündə,
   onun İÇİNDƏ üzən kiçik ➤ ikon kimi görünür (axtarış zolağı naxışı). */
.auction-bid-input-wrap {
  position: relative;
  flex: 1 1 140px;
  min-width: 140px;
}

.auction-bid-input-wrap input {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 10px 40px 10px 12px;
  font-size: 14px;
  /* Brauzer (Edge/Chrome) bu qutunun mətnini özü məcburi ağ göstərir (avtomatik
     qaranlıq rejim override-i, adi CSS "color" ilə keçilmir) — ona görə açıq
     rəngdə mətn yazmaq əvəzinə, fonu tünd edib məcburi ağ mətnə uyğunlaşdırırıq. */
  background: #1c1c2e !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  color-scheme: dark;
}

.auction-bid-input-wrap button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #6a5cff;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auction-bid-input-wrap button:disabled {
  opacity: .5;
  cursor: default;
}

.auction-strip-status {
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  min-height: 14px;
}

/* Sərbəst rəqəm yazmaq əvəzinə (25-26 Avq 2026 hərrac davası) — köhnə
   input/düymə strukturuna TOXUNMADAN, ayrıca kiçik bir sətirdə +/- düymələri.
   Öz-özlüyündə məhdud enli, daşma riski olmayan sadə sətir. */
.auction-step-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.auction-step-row button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #6a5cff;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.auction-step-row button:disabled {
  opacity: .5;
  cursor: default;
}

body[data-theme="dark"] .auction-strip-timer {
  background: var(--chat-dark-surface-alt);
  color: #fff;
}

body[data-theme="dark"] .auction-strip-info small,
body[data-theme="dark"] .auction-strip-status {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .auction-strip-bid-row input {
  background: var(--chat-dark-surface-alt) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  color-scheme: dark;
}


.chat-tabs{
  display:flex;
  /* Sol yuxarı küncdəki (geri + tema + missiyalar + səs) düymələri "Qlobal"
     tab-ının üstünə düşməsin deyə, tab sırasını sağa itələyirik. */
  padding-left: 172px;
}

.chat-tab{
  flex:1;
  padding:10px 0;
  font-size:13px;
  background:none;
  border:none;
  font-weight:600;
  color:#666;
}

.pm-tab-unread-badge {
  margin-left: 6px;
  vertical-align: middle;
}

.pm-tab-unread-badge[hidden] {
  display: none;
}

.chat-tab.active{
  color:#6a5cff;
  border-bottom:3px solid #6a5cff;
}

/* =========================
   CONTAINER
========================= */
.chat-container{
  flex:1;
  min-height:0;
  overflow:hidden;
  width:100%;
  position: relative;
  z-index: 1;
}

/* =========================
   SLIDER
========================= */
.chat-slider{
  display:flex;
  height:100%;
  width:100%;
  will-change:transform;
  transition:transform .28s ease;
}

/* =========================
   PAGE
========================= */
.chat-page{
  flex:0 0 100%;
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
}

#globalChat {
  position: relative;
}

.scroll-bottom-btn {
  position: absolute;
  right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6a5cff, #8b7cff);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(106,92,255,0.45);
  cursor: pointer;
  z-index: 6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.scroll-bottom-btn:active {
  transform: scale(0.92);
}

.scroll-bottom-btn.hidden {
  display: none;
}

/* =========================
   MESSAGES
========================= */
.messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding:16px 14px 120px;
  display:flex;
  flex-direction:column;
  gap:14px;
  position: relative;
  z-index: 1;
  user-select:text;
  -webkit-user-select:text;
}

/* =========================
   MESSAGE ROW
========================= */
.message-row{
  display:flex;
  align-items:flex-end;
  gap:8px;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  user-select: text;
  -webkit-user-select: text;
  transition: transform 0.18s ease;
}

.message-row.reply-swipe-active {
  transform: translateX(42px);
}

.reply-swipe-icon {
  position: absolute;
  left: 4px;
  bottom: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.message-row.reply-swipe-active .reply-swipe-icon {
  opacity: 1;
  transform: scale(1);
}

.message-row.other{justify-content:flex-start;}
.message-row.me{justify-content:flex-end;position:relative;}

.avatar{
  width:36px;
  height:36px;
  border-radius:50%;
  object-fit:cover;
}

.message-bubble{
  max-width:72%;
  padding:10px 14px;
  border-radius:18px;
  font-size:14.5px;
  box-shadow:0 8px 20px rgba(0,0,0,.08);
  cursor:text;
  user-select:text;
  -webkit-user-select:text;
}

.message-bubble .user-line,
.message-bubble .text,
.message-bubble .time{
  user-select:text;
  -webkit-user-select:text;
}

.message-bubble .text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-bubble .text a {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}

.message-row.other .message-bubble{
  background:#fff;
  border-bottom-left-radius:6px;
}

.message-row.me .message-bubble{
  background:linear-gradient(135deg,#6a5cff,#8b7cff);
  color:#fff;
  border-bottom-right-radius:6px;
  margin-right:40px;
}

.reply-quote {
  display: block;
  margin-bottom: 7px;
  padding: 7px 9px;
  border-left: 3px solid #10b981;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.10);
  max-width: 100%;
}

.message-row.me .reply-quote {
  background: rgba(255, 255, 255, 0.16);
  border-left-color: rgba(255, 255, 255, 0.75);
}

.reply-quote strong,
.reply-quote span {
  display: block;
  line-height: 1.3;
}

.reply-quote strong {
  font-size: 12px;
  color: #059669;
  margin-bottom: 2px;
}

.message-row.me .reply-quote strong {
  color: #fff;
}

.reply-quote span {
  font-size: 12px;
  opacity: 0.82;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-quote[data-jump-key] {
  cursor: pointer;
}

.reply-quote.reply-jump-missing {
  animation: reply-jump-shake 0.4s ease;
}

@keyframes reply-jump-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.message-row.reply-jump-highlight .message-bubble {
  animation: reply-jump-flash 1.2s ease;
}

@keyframes reply-jump-flash {
  0% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.9); }
  100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0); }
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
  user-select: none;
  -webkit-user-select: none;
}

.reaction-btn {
  min-width: 32px;
  height: 26px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 8px;
  background: rgba(255,255,255,0.72);
  color: #333;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.reaction-btn b {
  font-size: 11px;
  font-weight: 800;
}

.reaction-btn.active {
  background: #fff3bf;
  border-color: rgba(250, 204, 21, 0.7);
  color: #6b4e00;
}

.reaction-btn:active {
  transform: scale(0.94);
}

.message-row.me .reaction-btn {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

.message-row.me .reaction-btn.active {
  background: rgba(255, 243, 191, 0.28);
  border-color: rgba(255,255,255,0.42);
}

/* =========================
   INPUT
========================= */
.reply-preview {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 720px;
  z-index: 21;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.reply-preview.hidden {
  display: none;
}

.reply-preview-line {
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: #10b981;
}

.reply-preview-body {
  min-width: 0;
}

.reply-preview-body strong,
.reply-preview-body span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-preview-body strong {
  color: #047857;
  font-size: 13px;
}

.reply-preview-body span {
  color: #475569;
  font-size: 13px;
  margin-top: 2px;
}

.reply-preview button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.chat-input {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 720px;

  display: flex;
  align-items: flex-end;
  gap: 12px;

  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  padding: 10px 14px;
  border-radius: 26px;

  box-shadow:
    0 10px 25px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(0,0,0,0.04);

  z-index: 20;
}

.chat-input input,
.chat-input textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 10px 4px;
  color: #111;
}

.chat-input textarea {
  font-family: inherit;
  resize: none;
  max-height: 120px;
  line-height: 1.35;
  /* Enter/Return sətrə keçir (mobil klaviaturada da) — göndərmək YALNIZ
     düymə ilədir, autoGrowChatInput() (chat.js) hündürlüyü tənzimləyir. */
}

.chat-input input::placeholder,
.chat-input textarea::placeholder {
  color: #999;
}

.chat-input button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6a5cff, #8b7cff);
  color: #fff;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(106,92,255,0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-input button:active {
  transform: scale(0.92);
  box-shadow: 0 4px 10px rgba(106,92,255,0.35);
}

.chat-input .voice-btn {
  background: linear-gradient(135deg, #10b981, #22c55e);
  box-shadow: 0 6px 18px rgba(16,185,129,0.35);
}

.chat-input .voice-btn.recording {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: voicePulse 1s ease-in-out infinite;
}

.chat-input .voice-cancel-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 18px rgba(239,68,68,0.35);
}

.chat-input .voice-cancel-btn[hidden] {
  display: none;
}

.chat-input .voice-btn:disabled,
.chat-input button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

@keyframes voicePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); }
  50% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

.voice-message {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 210px;
}

.voice-message audio {
  width: 180px;
  max-width: 48vw;
  height: 32px;
}

.voice-duration {
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
}

.image-message {
  position: relative;
  display: inline-block;
}

.image-message img {
  display: block;
  max-width: 220px;
  max-height: 280px;
  border-radius: 12px;
  cursor: pointer;
  object-fit: cover;
}

.video-message {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 220px;
}

.video-message video {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 12px;
  background: #000;
}

.video-message .voice-speed-btn {
  align-self: flex-start;
}

.pm-upload-status {
  align-self: center;
  width: min(320px, calc(100% - 28px));
  margin: 10px auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(14, 20, 34, 0.9);
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.pm-upload-status-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pm-upload-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.pm-upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35d6a5, #47a3ff);
  transition: width 0.2s ease;
}

.pm-upload-status-detail {
  margin-top: 7px;
  font-size: 12px;
  opacity: 0.78;
}

.pm-media-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 280px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(10, 14, 22, 0.35);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}

.pm-media-status[hidden] {
  display: none;
}

.pm-media-status.pm-media-error {
  background: rgba(10, 14, 22, 0.72);
  pointer-events: auto;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  padding: 8px;
}

.pm-media-status .fa-spinner {
  font-size: 18px;
}

/* ===== "VP" (tək dəfəlik şəkil) ===== */
.vp-message {
  position: relative;
}

.vp-message.vp-locked,
.vp-message.vp-consumed {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  padding: 16px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.06);
  font-size: 13.5px;
  font-weight: 700;
}

.vp-message.vp-locked {
  cursor: pointer;
}

.vp-message.vp-locked i,
.vp-message.vp-consumed i {
  font-size: 16px;
  opacity: 0.75;
}

.vp-message.vp-consumed {
  opacity: 0.65;
}

.vp-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(0,0,0,0.55);
}

.vp-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0,0,0,0.94);
  cursor: pointer;
}

.vp-overlay img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 10px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.vp-overlay video {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 10px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

.vp-overlay-hint {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.voice-speed-btn {
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: inherit;
  background: rgba(0,0,0,0.06);
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}

.message-row.me .voice-speed-btn {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.18);
}

/* =========================
   🔧 FIX: AVATAR ARXAYA KEÇSİN (ME)
========================= */
.message-row.me {
  position: relative;
}

.message-row.me .avatar {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 30px;
  height: 30px;
  z-index: 1;
  pointer-events: none;
}

.message-row.me .message-bubble {
  position: relative;
  z-index: 2;
  margin-right: 40px;
}

/* =========================
   COMING SOON
========================= */
.coming-soon{
  margin:auto;
  font-size:15px;
  color:#777;
}

/* =========================
   🔒 ADMIN 3 DOT MENU
========================= */
.chat-admin {
  position: absolute;
  /* Android tətbiqinin native "yenilə" düyməsi (WebAppActivity.kt-də
     secondaryRefreshButton, TOP|END gravity, ~10dp margin, 36dp ölçü) EYNİ
     bu küncdə, saytın ÖZ WebView-ündən ÜSTÜN (topmost) bir native View kimi
     oturur — köhnə top:6px bu native düymənin altına girib "Mesajları sil"
     (admin menyusu) toxunulmaz olurdu. Aşağı itələyib bu zonadan çıxarır. */
  top: 60px;
  right: 10px;
  z-index: 2000;
}

.admin-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  color: #6a5cff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2001;
}

.admin-btn:active {
  background: rgba(106,92,255,0.12);
}

.admin-menu {
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 170px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  z-index: 3000;
}

.chat-admin.open .admin-menu {
  display: flex;
}

.admin-menu button {
  border: none;
  background: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: #222;
}

.admin-menu button:hover {
  background: rgba(106,92,255,0.1);
}

.admin-menu button#adminClearChat { color: #ff3b30; }
.admin-menu button#adminCloseChat { color: #ff9500; }
.admin-menu button#adminOpenChat { color: #34c759; }

/* =========================
   📱 MESSAGE ACTION SHEET
========================= */
.msg-sheet {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

.msg-sheet[hidden] {
  display: none;
}

.msg-sheet:not([hidden]) {
  pointer-events: auto;
}

.msg-sheet-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.msg-sheet:not([hidden]) .msg-sheet-overlay {
  opacity: 1;
}

.msg-sheet-box {
  background: white;
  border-radius: 20px 20px 0 0;
  padding: 16px;
  padding-bottom: 24px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  z-index: 10000;
  position: relative;
}

.msg-sheet:not([hidden]) .msg-sheet-box {
  transform: translateY(0);
}

.msg-action {
  width: 100%;
  padding: 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  border-radius: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
}

.msg-action i {
  font-size: 18px;
  width: 24px;
}

.msg-action.danger {
  color: #ff3b30;
}

.msg-action.cancel {
  background: #f2f2f7;
  text-align: center;
  font-weight: 600;
  margin-top: 8px;
  justify-content: center;
}

.msg-action:active {
  background: #f5f5f5;
}

/* =========================
   📱 MESSAGE LONG PRESS EFFECT
========================= */
.message-row:active {
  opacity: 0.8;
  transition: opacity 0.1s;
}

/* =========================
   📱 SAFARI FIX
========================= */
@supports (-webkit-touch-callout: none) {
  .chat-container {
    -webkit-overflow-scrolling: touch;
  }
  
  .messages {
    -webkit-overflow-scrolling: touch;
  }
}
/* =========================
   👥 GROUPS LIST
========================= */

#groupsChat {
  padding: 0;
  background: transparent;
}

/* Header (Qruplar + plus btn) */
.groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
}

.groups-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.groups-header button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg,#6a5cff,#8b7cff);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(106,92,255,0.45);
}

.groups-header button:active {
  transform: scale(0.92);
}

.groups-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#clanLeaderboardLink {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg,#ffb238,#ff8f3f);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(255,143,63,0.45);
  text-decoration: none;
}

#clanLeaderboardLink:active {
  transform: scale(0.92);
}

/* =========================
   🏆 KLAN ZOLAĞI
========================= */
/* Hərrac zolağı ilə EYNİ qatlanan naxış (bax .auction-strip) — başlıq
   sətri həmişə görünür, qalanı (anbar/TOP-bağışçı/müharibə/düymələr)
   .expanded əlavə olunanda açılır. Yeri çox tutmasın deyə. */
.clan-strip {
  padding: 10px 16px;
  background: rgba(255, 178, 56, 0.12);
  border-bottom: 1px solid rgba(255, 178, 56, 0.3);
}

.clan-strip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.clan-strip-body {
  display: none;
  margin-top: 10px;
}

.clan-strip.expanded .clan-strip-body {
  display: block;
}

.clan-strip-toggle {
  display: block;
  margin: 4px auto 0;
  width: fit-content;
  font-size: 20px;
  line-height: 1;
  opacity: .7;
  cursor: pointer;
  animation: auction-toggle-bounce 1.6s ease-in-out infinite;
  transition: transform .2s ease;
}

.clan-strip.expanded .clan-strip-toggle {
  transform: rotate(180deg);
  animation: none;
}

.clan-strip-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #7a5200;
  margin-bottom: 10px;
}

.clan-strip-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #7a5200;
  min-width: 0;
}

.clan-score-text {
  font-weight: 700;
}

.clan-vault-text {
  font-weight: 700;
  opacity: .85;
}

.clan-top-text {
  opacity: .8;
}

.clan-war-text {
  font-weight: 700;
}

.clan-tier-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.clan-tier-badge.tier-bronze {
  background: linear-gradient(135deg,#cd7f32,#e3a466);
  color: #3a1e00;
}

.clan-tier-badge.tier-silver {
  background: linear-gradient(135deg,#c0c0c0,#e8e8e8);
  color: #333;
}

.clan-tier-badge.tier-gold {
  background: linear-gradient(135deg,#ffd166,#ffb238);
  color: #4a2e00;
}

.clan-tier-badge.tier-platinum {
  background: linear-gradient(135deg,#9be8ff,#7fd6ff);
  color: #003b4a;
}

/* Qruplar siyahısı kartında (chat.js renderGroupCard) — istifadəçi "hansı
   klan daha güclüdür siyahıdan görünmür" dedi, açıq klan görünüşündəki
   .clan-level-badge/.clan-tier-badge EYNİ stillərini bura da gətirir. */
.group-strength {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.group-strength .clan-level-badge {
  cursor: default;
}

.clan-level-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .3px;
  background: linear-gradient(135deg,#6a5cff,#8f7bff);
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  /* Mobil brauzerlərdə "title" atributu tooltip göstərmir — basıb saxlayanda
     əvəzinə mətn seçimi/"Kopyala" menyusu çıxır. Bunu söndürürük, əvəzinə
     JS click handler-i (bax js/chat.js) məlumatı alert() ilə göstərir. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.clan-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#clanStripLeaderboardLink {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 178, 56, 0.2);
  color: #7a5200;
  font-size: 13px;
  text-decoration: none;
  flex-shrink: 0;
}

#clanStripLeaderboardLink:active {
  transform: scale(0.92);
}

body[data-theme="dark"] #clanStripLeaderboardLink {
  color: #ffcf8a;
}

.clan-top-list-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 178, 56, 0.2);
  color: #7a5200;
  font-size: 13px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.clan-top-list-btn:active { transform: scale(0.92); }
body[data-theme="dark"] .clan-top-list-btn { color: #ffcf8a; }

.clan-top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin: 12px 0;
}

.clan-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 178, 56, 0.08);
}

.clan-top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}
.clan-top-rank.rank1 { background: #ffd166; color: #5a3d00; }
.clan-top-rank.rank2 { background: #d9d9e3; color: #3a3a45; }
.clan-top-rank.rank3 { background: #e0b087; color: #4a2c10; }

.clan-top-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-top-amount {
  font-size: 13px;
  font-weight: 800;
  color: #ff8f3f;
  flex-shrink: 0;
}

.clan-top-empty {
  text-align: center;
  font-size: 13px;
  opacity: 0.7;
  margin: 16px 0;
}

.clan-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  margin: 12px 0;
}

.clan-activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 178, 56, 0.08);
}

.clan-activity-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.clan-activity-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
}

.clan-activity-time {
  font-size: 11px;
  opacity: 0.6;
  flex-shrink: 0;
  white-space: nowrap;
}

.clan-emblem-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.clan-emblem-option {
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 178, 56, 0.08);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.clan-emblem-option:hover,
.clan-emblem-option:active {
  background: rgba(255, 178, 56, 0.22);
  transform: scale(1.08);
}
body[data-theme="dark"] .clan-emblem-option {
  border-color: rgba(255, 255, 255, 0.1);
}

.group-emblem {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

/* #101 Klan emblemi öz-dizayn (rəng+forma) — CLAN_EMBLEMS emoji
   seçiminin YANINDA əlavə tab. */
.clan-emblem-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.clan-emblem-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}
.clan-emblem-tab.active {
  background: rgba(255, 178, 56, 0.18);
  border-color: rgba(255, 178, 56, 0.4);
  font-weight: 600;
}
body[data-theme="dark"] .clan-emblem-tab {
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.clan-emblem-custom-label {
  font-size: 13px;
  opacity: 0.75;
  margin: 10px 0 6px;
}

.clan-emblem-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  margin: 0 0 14px;
}
.clan-emblem-color-option {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.clan-emblem-color-option:hover,
.clan-emblem-color-option:active {
  transform: scale(1.1);
}
.clan-emblem-color-option.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 178, 56, 0.8);
}

.clan-donate-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg,#ffb238,#ff8f3f);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(255,143,63,0.4);
}

.clan-donate-btn:active {
  transform: scale(0.95);
}

body[data-theme="dark"] .clan-strip {
  background: rgba(255, 178, 56, 0.08);
  border-bottom-color: rgba(255, 178, 56, 0.2);
}

body[data-theme="dark"] .clan-strip-info,
body[data-theme="dark"] .clan-strip-extra {
  color: #ffcf8a;
}

.groups-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 16px 0;
  padding: 9px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.05);
  color: #777;
}

.groups-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #222;
}

/* #31 Klan axtarışında mövzu/aktivlik filtri */
.groups-filter-row {
  display: flex;
  gap: 8px;
  margin: 8px 16px 0;
}
.groups-filter-select {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  font-size: 12px;
}

.groups-search input::placeholder {
  color: #999;
}

/* List container */
.groups-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

/* Group card */
.group-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.group-card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Left side */
.group-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-name {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.group-meta {
  font-size: 12.5px;
  color: #777;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Right side (icons) */
.group-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6a5cff;
}

.group-status .lock {
  color: #ff9500;
}

.group-status .open {
  color: #34c759;
}

/* Empty state */
.groups-empty {
  margin: auto;
  font-size: 14px;
  color: #777;
  text-align: center;
  padding: 40px 20px;
}

/* =========================
   💻 TABLET & PC
========================= */
@media (min-width: 768px) {
  .groups-list {
    max-width: 720px;
    margin: 0 auto;
  }

  .groups-header {
    max-width: 720px;
    margin: 0 auto;
  }

  .groups-search {
    max-width: 720px;
    margin: 10px auto 0;
  }

  .groups-filter-row {
    max-width: 720px;
    margin: 8px auto 0;
  }
}

@media (min-width: 1024px) {
  .groups-list {
    max-width: 820px;
  }

  .groups-header {
    max-width: 820px;
  }

  .groups-search {
    max-width: 820px;
  }
}
/* =========================
   ➕ CREATE GROUP MODAL
========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  width: 90%;
  max-width: 340px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1;
  /* BUG DÜZƏLİŞİ: uzun siyahılı modallarda (dost/üzv seçici) pəncərə ekrandan
     hündür olanda heç bir scroll imkanı yox idi — "Ləğv et" düyməsi əlçatmaz
     qalırdı. İndi pəncərənin ÖZÜ scroll olur, düymələr həmişə çatılan olur. */
  max-height: 85vh;
  overflow-y: auto;
}

.modal-box h3 {
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.modal-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  font-size: 15px;
  outline: none;
}

.modal-box input:focus {
  border-color: #6a5cff;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-actions .btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: none;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions .btn.cancel {
  background: #f2f2f7;
  color: #333;
}

.modal-actions .btn.primary {
  background: linear-gradient(135deg,#6a5cff,#8b7cff);
  color: #fff;
}

.modal-actions .btn.neutral {
  background: #e8e8f0;
  color: #333;
}

.pm-send-mode-hint {
  margin: -6px 0 4px;
  font-size: 12.5px;
  color: rgba(0,0,0,0.55);
  line-height: 1.4;
}

.pm-send-mode-actions {
  flex-wrap: wrap;
}

.pm-send-mode-actions .btn {
  min-width: 96px;
}
/* =========================
   📱 SAFE AREA (PWA / iOS)
========================= */
.chat-input {
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.pm-input-bar {
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.groups-list {
  padding-bottom: calc(120px + env(safe-area-inset-bottom));
}

.modal-box {
  margin-bottom: env(safe-area-inset-bottom);
}
/* =========================
   🖼 GROUP AVATAR (FIX)
========================= */
.group-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;

  border-radius: 50%;
  object-fit: cover;

  background: #eee;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.group-left {
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-card {
  gap: 12px;
}

.group-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-last {
  font-size: 12.5px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* =========================
   💬 GROUP CHAT HEADER (FIX)
   Phone / PWA / Tablet / PC
========================= */

/* Qrup chat başlığı konteyneri */
.group-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.group-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}


/* 🔙 Geri düyməsi */
#backToGroups {
  width: 40px;
  height: 40px;
  min-width: 40px;

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

  border: none;
  border-radius: 12px;
  background: rgba(106,92,255,0.12);
  color: #6a5cff;

  font-size: 20px;
  cursor: pointer;

  transition: transform .12s ease, background .12s ease;
}

#backToGroups:active {
  transform: scale(0.94);
  background: rgba(106,92,255,0.18);
}

/* 🏷 Qrup adı */
#activeGroupName {
  flex: 1;
  min-width: 0;

  font-size: 17px;
  font-weight: 800;
  color: #111;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  letter-spacing: 0.2px;
}


/* Sağ tərəf (placeholder – balans üçün) */
.group-header-spacer {
  width: 40px;
  height: 40px;
  min-width: 40px;
}

/* =========================
   📱 Telefon
========================= */
@media (max-width: 480px) {
  #activeGroupName {
    font-size: 16px;
  }

  #backToGroups {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 19px;
  }
}

/* =========================
   💻 Tablet
========================= */
@media (min-width: 768px) {
  .group-chat-header {
    padding: 12px 16px;
  }

  #activeGroupName {
    font-size: 18px;
  }
}

/* =========================
   🖥 PC / Large screen
========================= */
@media (min-width: 1024px) {
  .group-chat-header {
    max-width: 900px;
    margin: 0 auto;

    border-left: 1px solid rgba(0,0,0,0.04);
    border-right: 1px solid rgba(0,0,0,0.04);
    border-radius: 0 0 18px 18px;
  }
}
/* =========================
   🧩 SYSTEM MESSAGE (GROUP)
========================= */
.system-message {
  display: flex;
  justify-content: center;
  margin: 6px 0;
  pointer-events: none;
}

.system-badge {
  max-width: 85%;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #555;

  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;

  text-align: center;
  line-height: 1.4;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Dark-ish variant (gələcək üçün hazır) */
.system-badge.danger {
  background: rgba(255, 59, 48, 0.12);
  color: #c62828;
}
/* =========================
   👥 GROUP MEMBERS MODAL
========================= */

/* Overlay */
.group-members-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 6000;
}

/* Modal box */
.group-members-modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 720px;
  max-height: 70vh;

  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px);
  border-radius: 20px 20px 0 0;

  box-shadow: 0 -12px 40px rgba(0,0,0,0.25);

  display: flex;
  flex-direction: column;

  z-index: 6001;
  transition: transform 0.28s ease;
}

/* Open state */
.group-members-modal.active {
  transform: translateX(-50%) translateY(0);
}

/* Header */
.group-members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.group-members-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #111;
}

/* Close button */
.group-members-header .close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(106,92,255,0.12);
  color: #6a5cff;
  font-size: 18px;
  cursor: pointer;
}

.group-members-header .close-btn:active {
  transform: scale(0.92);
}

/* Members list */
.group-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Member row */
.group-member-row {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 14px;

  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.group-member-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.group-member-actions .mute-btn,
.group-member-actions .kick-btn {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.group-member-actions .mute-btn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.group-member-actions .kick-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.group-member-actions .officer-toggle-btn {
  border: none;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
}

/* Avatar */
.group-member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

/* Name */
.group-member-name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  flex: 1;
}

.group-owner-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #3b2500;
  font-size: 11px;
  font-weight: 800;
}

.group-officer-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  color: #1e1b4b;
  font-size: 11px;
  font-weight: 800;
}

/* Hidden helper */
.hidden {
  display: none;
}

/* #28 Klan çatında sabitlənən mesaj — chat.html AÇIQ (light) mövzuludur
   (body arxa fonu #f6f7ff/#eef1ff, mətn #111) — ilk versiya səhvən tünd
   mövzu rənglərini (ağ/açıq sarı mətn) istifadə etmişdi, açıq fonun
   üzərində demək olar görünməz idi. İndi tünd mətn + doymuş kəhrəba fon. */
.pinned-message-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 193, 7, 0.22);
  border-bottom: 1px solid rgba(184, 134, 11, 0.35);
  color: #7a5200;
  font-size: 12px;
}
.pinned-message-banner.hidden { display: none; }
.pinned-message-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pinned-message-author {
  font-weight: 800;
  margin-right: 6px;
  color: #7a5200;
}
.pinned-message-body {
  color: #3a2c00;
}
.pinned-message-unpin {
  border: none;
  background: transparent;
  color: #7a5200;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
}
.pinned-message-unpin.hidden { display: none; }

.message-pin-btn {
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  margin-left: 4px;
}
.message-pin-btn:hover {
  color: #b8860b;
}
.group-admin {
  margin-left: auto;
  position: relative;
  z-index: 2000;
}

.group-admin-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  font-weight: 700;
  color: #6a5cff;

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

  cursor: pointer;
}

.group-admin-btn:active {
  background: rgba(106,92,255,0.12);
}
.group-admin-menu {
  position: absolute;
  top: 44px;
  right: 0;

  min-width: 200px;
  padding: 8px;

  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-radius: 14px;

  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  z-index: 3000;
}
/* .hidden (display:none) İLƏ EYNİ spesifikliyə malikdir, ona görə
   flex-layout YALNIZ .hidden olmayanda tətbiq olunur — əks halda bu qayda
   sonradan yazıldığı üçün .hidden-i üstələyib menyu HEÇ VAXT bağlanmırdı. */
.group-admin-menu:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.group-admin-menu button {
  border: none;
  background: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  color: #222;
}

.group-admin-menu button:hover,
.group-admin-menu button:active {
  background: rgba(106,92,255,0.1);
}

body[data-theme="dark"] .group-admin-menu button {
  color: var(--chat-dark-text);
}
@media (max-width: 480px) {
  #activeGroupName {
    font-size: 16px;
  }

  .group-admin-btn {
    width: 36px;
    height: 36px;
    font-size: 21px;
  }
}

@media (min-width: 768px) {
  .group-chat-header {
    padding: 12px 16px;
  }

  #activeGroupName {
    font-size: 18px;
  }
}
/* =========================
   👑 ADMIN TRANSFER MODAL
   Əvvəllər bu modal Tailwind-tərzi class-larla (w-full, bg-gray-200 və s.)
   yazılmışdı, amma layihədə Tailwind YÜKLƏNMİR — o class-lar heç nə
   etmirdi (düymə "çılpaq" görünürdü), üstəlik #adminTransferModal-a
   BİRBAŞA `display:flex` verilmişdi ki, bu ID seçicisi .hidden class-ından
   (aşağı spesifiklik) HƏMİŞƏ güclü olur — modal HEÇ VAXT bağlana bilmirdi.
   İndi js/chat.js-də bu modal saytın öz .modal/.modal-box/.btn sisteminə
   köçürülüb (bax donateClanModal və s. eyni naxış) — .modal.hidden artıq
   sınanmış, düzgün işləyən gizlətmə qaydasıdır.
========================= */

/* Chat input heç vaxt üstə çıxmasın */
.chat-input {
  z-index: 10 !important;
}

#adminTransferList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin: 12px 0;
}

.admin-transfer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.admin-transfer-row:hover {
  background: #f3f4f6;
}

.admin-transfer-row img {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-transfer-row span {
  font-size: 15px;
  font-weight: 500;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   💌 PRIVATE MESSAGES (PM)
========================= */
#pmContainer .chat-page {
  display: none;
}

#pmContainer .chat-page.active {
  display: flex;
}

.pm-empty {
  margin: auto;
  font-size: 14px;
  color: #777;
  text-align: center;
  padding: 40px 20px;
}

.pm-empty.hidden {
  display: none;
}

.pm-friend-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pm-thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 4px;
}

.pm-thread-online-status {
  display: block;
  font-size: 11px;
  color: rgba(0,0,0,0.5);
  margin-top: 1px;
}

.pm-thread-online-status.online {
  color: #22c55e;
  font-weight: 700;
}

body[data-theme="dark"] .pm-thread-online-status {
  color: var(--chat-dark-text-soft);
}

/* group-chat-header sinfi başqa yerdə (qrup çatı) flex olmadan da işlədiyi
   üçün ona toxunmuruq — yalnız öz PM başlığımızı flex sətir edirik ki,
   "Söhbəti təmizlə" düyməsi sağa düzülsün. */
#pmThreadPage .group-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ƏSAS DÜZƏLİŞ: qrup çatının ÖZ başlığı ("group-chat-header sinfi... flex
   olmadan işlədiyi" qeydinin nəzərdə tutduğu YER) həqiqətən flex DEYİLDİ —
   bu da admin "⋮" menyusunun (#groupAdminWrap) qrup adının sətrində DEYİL,
   onun ALTINDA (ayrı sətirdə, klan zolağının da üstündə) düşməsinə səbəb
   olurdu, telefonda lazımsız yer tuturdu. Yuxarıdakı PM qaydası ilə EYNİ
   naxış, sadəcə qrup çatı üçün.*/
#groupChatPage .group-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pm-clear-btn {
  margin-left: auto;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(239,68,68,0.10);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
}

.pm-clear-btn:active {
  transform: scale(0.92);
}

.pm-msg-delete {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
}

.message-row.me .pm-msg-delete {
  background: rgba(255,255,255,0.22);
  color: #fff;
}

.pm-read-receipt {
  margin-top: 3px;
  font-size: 10.5px;
  text-align: right;
  color: rgba(255,255,255,0.6);
}

.pm-read-receipt.read {
  color: #93c5fd;
  font-weight: 700;
}

.pm-list-receipt {
  font-size: 10.5px;
  color: rgba(0,0,0,0.45);
  white-space: nowrap;
}

.pm-list-receipt.read {
  color: #2563eb;
  font-weight: 700;
}

body[data-theme="dark"] .pm-list-receipt {
  color: var(--chat-dark-text-soft);
}

.pm-input-bar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 720px;

  display: flex;
  align-items: center;
  gap: 12px;

  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  padding: 10px 14px;
  border-radius: 26px;

  box-shadow:
    0 10px 25px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(0,0,0,0.04);

  z-index: 20;
}

.pm-input-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 10px 4px;
  color: #111;
}

.pm-input-bar input::placeholder {
  color: #999;
}

.pm-input-bar button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6a5cff, #8b7cff);
  color: #fff;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(106,92,255,0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pm-input-bar .voice-btn {
  background: linear-gradient(135deg, #10b981, #22c55e);
  box-shadow: 0 6px 18px rgba(16,185,129,0.35);
}

.pm-input-bar .voice-btn.recording {
  background: linear-gradient(135deg, #ef4444, #f97316);
  animation: voicePulse 1s ease-in-out infinite;
}

.pm-input-bar .voice-cancel-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 18px rgba(239,68,68,0.35);
}

.pm-input-bar .voice-cancel-btn[hidden] {
  display: none;
}

.pm-input-bar button:active {
  transform: scale(0.92);
  box-shadow: 0 4px 10px rgba(106,92,255,0.35);
}

@media (max-width: 380px) {
  .pm-input-bar {
    gap: 6px;
    padding: 8px 10px;
  }

  .pm-input-bar button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 15px;
  }
}

@media (min-width: 768px) {
  #pmFriendsList {
    max-width: 720px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  #pmFriendsList {
    max-width: 820px;
  }
}

/* =========================
   🌙 DARK MODE TOGGLE BUTTON
   (mövcud qaydalara toxunmadan yalnız əlavə)
========================= */
.chat-header-left {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2001;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-back-btn,
.chat-theme-toggle {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(106,92,255,0.12);
  color: #6a5cff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
}

/* Günün mahnısı vidjeti başlıq zolağına (chat-header-left) köçürüldükdə,
   kart görünüşünü (başlıq/ifaçı, oxut düyməsi) gizlədib yalnız səs
   aç/bağla düyməsini geridəki iki dairəvi ikon düymə (geri/tema) ilə eyni
   görünüşdə saxlayırıq. Yalnız bu yerdəki instansiyaya aiddir — index.html-də
   istifadə olunan tam kart görünüşünə toxunmur.  */
.chat-header-left .chat-daily-music {
  padding: 0;
  border-top: 0;
  background: transparent;
  gap: 0;
}

.chat-header-left .chat-daily-music-copy,
.chat-header-left [data-music-play] {
  display: none;
}

.chat-header-left .chat-daily-music-actions {
  gap: 0;
}

.chat-header-left .chat-daily-music-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(106,92,255,0.12);
  color: #6a5cff;
  box-shadow: none;
  font-size: 15px;
}

.chat-back-btn:active,
.chat-theme-toggle:active {
  transform: scale(0.92);
}

/* =========================
   🌙 DARK MODE (yalnız chat səhifəsi)
   Bütün qaydalar body[data-theme="dark"] ilə əhatələnib —
   mövcud (işıqlı) görünüşə heç toxunmur, yalnız aktivləşəndə üstələyir.
========================= */
body[data-theme="dark"] {
  --chat-dark-bg-grad: linear-gradient(135deg,#101120,#181933);
  --chat-dark-surface: rgba(30,31,48,.92);
  --chat-dark-surface-solid: #1e1f30;
  --chat-dark-surface-alt: rgba(38,39,57,.92);
  --chat-dark-surface-alt-solid: #262739;
  --chat-dark-border: rgba(255,255,255,.08);
  --chat-dark-text: #f1f2f8;
  --chat-dark-text-soft: #a8aac4;
  --chat-dark-text-faint: #7d7f9c;
}

body[data-theme="dark"] {
  background: var(--chat-dark-bg-grad);
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .chat-header {
  background: var(--chat-dark-surface);
  border-bottom-color: var(--chat-dark-border);
}

body[data-theme="dark"] .chat-daily-music {
  background: var(--chat-dark-surface);
  border-top-color: var(--chat-dark-border);
}

body[data-theme="dark"] .chat-daily-music-title {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .chat-daily-music-artist {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .chat-mission-strip button {
  background: var(--chat-dark-surface-alt);
}

body[data-theme="dark"] .chat-mission-strip small {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .chat-tab {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .chat-tab.active {
  color: #a89bff;
  border-bottom-color: #a89bff;
}

body[data-theme="dark"] .message-row.other .message-bubble {
  background: var(--chat-dark-surface-alt-solid);
}

body[data-theme="dark"] .reaction-btn {
  background: var(--chat-dark-surface-alt);
  border-color: var(--chat-dark-border);
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .reply-quote {
  background: rgba(16, 185, 129, 0.16);
}

body[data-theme="dark"] .reply-quote strong {
  color: #34d399;
}

body[data-theme="dark"] .reply-preview {
  background: var(--chat-dark-surface-solid);
  border-color: rgba(16, 185, 129, 0.28);
}

body[data-theme="dark"] .reply-preview-body strong {
  color: #34d399;
}

body[data-theme="dark"] .reply-preview-body span {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .reply-preview button {
  background: rgba(255,255,255,0.08);
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .chat-input,
body[data-theme="dark"] .pm-input-bar {
  background: var(--chat-dark-surface-solid);
  box-shadow:
    0 10px 25px rgba(0,0,0,0.3),
    inset 0 0 0 1px var(--chat-dark-border);
}

body[data-theme="dark"] .chat-input input,
body[data-theme="dark"] .chat-input textarea,
body[data-theme="dark"] .pm-input-bar input {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .chat-input input::placeholder,
body[data-theme="dark"] .chat-input textarea::placeholder,
body[data-theme="dark"] .pm-input-bar input::placeholder {
  color: var(--chat-dark-text-faint);
}

body[data-theme="dark"] .coming-soon,
body[data-theme="dark"] .pm-empty,
body[data-theme="dark"] .groups-empty {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .admin-menu,
body[data-theme="dark"] .group-admin-menu {
  background: var(--chat-dark-surface-solid);
}

body[data-theme="dark"] .admin-menu button {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .admin-menu button:hover {
  background: rgba(106,92,255,0.18);
}

body[data-theme="dark"] .msg-sheet-box {
  background: var(--chat-dark-surface-solid);
}

body[data-theme="dark"] .msg-action {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .msg-action.cancel {
  background: var(--chat-dark-surface-alt-solid);
}

body[data-theme="dark"] .msg-action:active {
  background: rgba(255,255,255,0.06);
}

body[data-theme="dark"] .groups-header {
  background: var(--chat-dark-surface);
}

body[data-theme="dark"] .groups-header h3 {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .groups-search {
  background: rgba(255,255,255,0.08);
}

body[data-theme="dark"] .groups-search input {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .group-card,
body[data-theme="dark"] .group-member-row {
  background: var(--chat-dark-surface-alt-solid);
}

body[data-theme="dark"] .group-name,
body[data-theme="dark"] .group-member-name,
body[data-theme="dark"] #activeGroupName,
body[data-theme="dark"] .group-members-header h3,
body[data-theme="dark"] .modal-box h3,
body[data-theme="dark"] .admin-transfer-row span {
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .group-meta,
body[data-theme="dark"] .group-last {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .group-avatar,
body[data-theme="dark"] .group-member-avatar {
  background: var(--chat-dark-surface-alt-solid);
}

body[data-theme="dark"] .system-badge {
  background: rgba(255,255,255,0.08);
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .modal-box {
  background: var(--chat-dark-surface-solid);
}

body[data-theme="dark"] .modal-box input {
  background: rgba(255,255,255,0.06);
  border-color: var(--chat-dark-border);
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .modal-actions .btn.cancel {
  background: var(--chat-dark-surface-alt-solid);
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .modal-actions .btn.neutral {
  background: var(--chat-dark-surface-alt-solid);
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .pm-send-mode-hint {
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .group-members-modal {
  background: var(--chat-dark-surface-solid);
}

body[data-theme="dark"] .group-members-header {
  border-bottom-color: var(--chat-dark-border);
}

body[data-theme="dark"] .admin-transfer-row {
  background: var(--chat-dark-surface-alt-solid);
  border-color: var(--chat-dark-border);
}

body[data-theme="dark"] .admin-transfer-row:hover {
  background: rgba(255,255,255,0.08);
}

body[data-theme="dark"] .pm-msg-delete {
  background: rgba(255,255,255,0.1);
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .voice-speed-btn {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--chat-dark-text-soft);
}

body[data-theme="dark"] .vp-message.vp-locked,
body[data-theme="dark"] .vp-message.vp-consumed {
  background: rgba(255,255,255,0.08);
  color: var(--chat-dark-text);
}

body[data-theme="dark"] .pm-friend-unread {
  background: #ff453a;
}

/* 🎬 Emoji "partlayış" effekti (şəxsi mesajlaşma) — tək emoji mesajı canlı
   gələndə ekranın ortasında böyüyüb-döyünüb, sonra kiçilib mesaj siyahısına
   "düşür". Tam vizual overlay-dir, mesajın özünə (balonuna) toxunmur. */
.pm-emoji-burst-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
}

.pm-emoji-burst-emoji {
  font-size: 110px;
  line-height: 1;
  opacity: 0;
  will-change: transform, opacity;
}

.pm-burst-heart {
  animation: pm-burst-heart 1.5s cubic-bezier(.25, .8, .3, 1) forwards;
}

@keyframes pm-burst-heart {
  0% { transform: scale(.2) translateY(0); opacity: 0; }
  14% { transform: scale(1.25) translateY(0); opacity: 1; }
  26% { transform: scale(.92); }
  38% { transform: scale(1.18); }
  50% { transform: scale(.97); }
  62% { transform: scale(1.1); }
  75% { transform: scale(1); }
  100% { transform: scale(.2) translateY(42vh); opacity: 0; }
}

.pm-burst-laugh {
  animation: pm-burst-laugh 1.5s cubic-bezier(.25, .8, .3, 1) forwards;
}

@keyframes pm-burst-laugh {
  0% { transform: scale(.2) rotate(0deg) translateY(0); opacity: 0; }
  14% { transform: scale(1.2) rotate(0deg) translateY(0); opacity: 1; }
  30% { transform: scale(1.1) rotate(-12deg); }
  45% { transform: scale(1.1) rotate(10deg); }
  60% { transform: scale(1.1) rotate(-8deg); }
  75% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(.2) rotate(0deg) translateY(42vh); opacity: 0; }
}

.pm-burst-thumb {
  animation: pm-burst-thumb 1.5s cubic-bezier(.25, .8, .3, 1) forwards;
}

@keyframes pm-burst-thumb {
  0% { transform: scale(.2) translateY(0); opacity: 0; }
  14% { transform: scale(1.25) translateY(0); opacity: 1; }
  30% { transform: scale(1) translateY(0); }
  42% { transform: scale(1.15) translateY(-18px); }
  54% { transform: scale(1) translateY(0); }
  66% { transform: scale(1.1) translateY(-10px); }
  78% { transform: scale(1) translateY(0); }
  100% { transform: scale(.2) translateY(42vh); opacity: 0; }
}

.pm-burst-fire {
  animation: pm-burst-fire 1.5s cubic-bezier(.25, .8, .3, 1) forwards;
}

@keyframes pm-burst-fire {
  0% { transform: scale(.2) rotate(0deg) translateY(0); opacity: 0; }
  14% { transform: scale(1.2) rotate(0deg) translateY(0); opacity: 1; }
  28% { transform: scale(1.05) rotate(-4deg); }
  40% { transform: scale(1.15) rotate(4deg); }
  52% { transform: scale(1.05) rotate(-3deg); }
  64% { transform: scale(1.12) rotate(3deg); }
  76% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(.2) rotate(0deg) translateY(42vh); opacity: 0; }
}

.pm-burst-party {
  animation: pm-burst-party 1.5s cubic-bezier(.25, .8, .3, 1) forwards;
}

@keyframes pm-burst-party {
  0% { transform: scale(.2) rotate(0deg) translateY(0); opacity: 0; }
  14% { transform: scale(1.25) rotate(0deg) translateY(0); opacity: 1; }
  35% { transform: scale(1.1) rotate(20deg); }
  55% { transform: scale(1.1) rotate(-16deg); }
  75% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(.2) rotate(0deg) translateY(42vh); opacity: 0; }
}
