/* ================================================================ Canlı sohbet — premium görünüm
   Mesajlar: app.js appendChatMessage (.cm normal, .cg hediye) */

/* ---------- kart ve başlık */
.hp-chat__card {
  border: 1px solid transparent !important;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(168, 85, 247, 0.2), transparent 70%),
    radial-gradient(70% 30% at 50% 100%, rgba(236, 72, 153, 0.1), transparent 70%),
    linear-gradient(180deg, #170f27, #0d0916) padding-box,
    linear-gradient(160deg, rgba(253, 230, 138, 0.45), rgba(167, 139, 250, 0.3) 35%, rgba(255, 255, 255, 0.05) 60%, rgba(244, 114, 182, 0.4)) border-box !important;
}
.hp-chat__head { padding: 14px 14px 12px; border-bottom: 0; position: relative; }
.hp-chat__head::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(253, 230, 138, 0.35), rgba(167, 139, 250, 0.25) 50%, transparent);
}
.hp-chat__icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 18px -8px rgba(236, 72, 153, 0.9);
}
.hp-chat__title h4 {
  font-size: 16px;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 30%, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hp-chat__badge {
  gap: 5px;
  color: #fff;
  background: linear-gradient(135deg, #e11d48, #ec4899);
  border: 0;
  box-shadow: 0 4px 12px -4px rgba(225, 29, 72, 0.9);
}
.hp-chat__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: chat-blink 1.2s ease-in-out infinite;
}

/* ---------- sabitlenmiş not */
.hp-chat__pinned {
  margin: 10px 10px 2px;
  padding: 9px 12px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(251, 191, 36, 0.1), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(253, 230, 138, 0.25);
}
.hp-chat__pinned-head { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #fde68a; }
.hp-chat__pinned-head em { color: rgba(253, 230, 138, 0.6); font-size: 10px; }
.hp-chat__pinned p { margin-top: 4px; font-size: 12px; color: #d9cfe8; }

/* ---------- mesaj akışı */
#chat-stream {
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 139, 250, 0.35) transparent;
  -webkit-mask: linear-gradient(180deg, transparent 0, #000 14px, #000 100%);
  mask: linear-gradient(180deg, transparent 0, #000 14px, #000 100%);
}
#chat-messages { gap: 2px !important; padding: 7px 7px 5px !important; }
#chat-empty { padding: 18px 8px !important; text-align: center; font-size: 12px !important; color: #8f84a3 !important; }

/* Normal mesaj: kutusuz, sıkı satır — küçük avatar + (isim · mesaj), saat her zaman sağ üstte */
.cm {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 11px;
  transition: background-color 0.15s ease;
  animation: chat-in 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.cm:hover { background: rgba(255, 255, 255, 0.04); }
.cm__av {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #241a35;
}
.cm__av.is-link { cursor: pointer; }
.cm__av.is-link:hover { box-shadow: 0 0 0 2px #f472b6; }
.cm__main { flex: 1; min-width: 0; padding-right: 30px; }
.cm__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  color: #e6e0f0;
  overflow-wrap: anywhere;
}
.cm__name {
  margin-right: 5px;
  font-weight: 700;
  font-size: 12.5px;
  /* sade gri: renkli isim yalnız isim tasarımı paketi alanlarda (looks.css) */
  color: #9d93b0;
}
.cm__name.is-link { cursor: pointer; }
.cm__name.is-link:hover { text-decoration: underline; text-underline-offset: 2px; }
/* Yarışmacı: pembe→altın isim + doğrulama rozeti */
.cm__name--star {
  background: linear-gradient(90deg, #f9a8d4, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #f472b6 !important;
}
.cm__verified {
  margin: 0 4px 0 -3px;
  font-size: 12px !important;
  vertical-align: -2px;
  color: #f472b6;
  font-variation-settings: "FILL" 1;
}
.cm__time,
.cg__time {
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #6f6585;
  font-variant-numeric: tabular-nums;
}
/* ---------- hediye satırı: sade, hediyenin renginde ince vurgu */
.cg {
  --g1: #f9a8d4;
  --g2: #ec4899;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0;
  padding: 6px 7px 6px 10px;
  border-radius: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--g2) 16%, transparent), transparent 85%);
  animation: chat-gift-in 0.4s cubic-bezier(0.2, 1.2, 0.4, 1);
}
/* sol kenarda hediye renginde şerit */
.cg::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--g1), var(--g2));
}
.cg__from {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: #241a35;
}
.cg__from.is-link, .cg__to-img.is-link { cursor: pointer; }
.cg__main { flex: 1; min-width: 0; padding-right: 30px; }
.cg__who, .cg__what {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 4px;
  margin: 0;
  min-width: 0;
  line-height: 1.35;
}
.cg__who { font-size: 12.5px; }
.cg__name { font-weight: 700; color: #9d93b0; overflow-wrap: anywhere; }
.cg__name.is-link { cursor: pointer; }
.cg__name.is-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.cg__name--to { color: color-mix(in srgb, var(--g1) 85%, #fff); }
.cg__arrow { font-size: 13px !important; color: color-mix(in srgb, var(--g1) 80%, #fff); opacity: 0.8; }
.cg__to-img { width: 17px; height: 17px; border-radius: 50%; object-fit: cover; }
.cg__what { margin-top: 2px; font-size: 12px; color: rgba(226, 226, 235, 0.8); }
.cg__emoji {
  font-size: 18px;
  line-height: 1;
  animation: chat-gift-pop 0.6s cubic-bezier(0.2, 1.7, 0.4, 1) 0.1s both;
}
.cg__gift { font-weight: 700; color: color-mix(in srgb, var(--g1) 75%, #fff); }
.cg__pts {
  padding: 0 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.6;
  color: #fff;
  background: linear-gradient(135deg, var(--g2), color-mix(in srgb, var(--g2) 50%, #000));
}
/* Değerli hediye biraz daha belirgin (büyümeden) */
.cg--big, .cg--mega { background: linear-gradient(90deg, color-mix(in srgb, var(--g2) 26%, transparent), transparent 90%); }
.cg--mega .cg__emoji { font-size: 20px; }

/* ---------- yazma alanı */
.hp-chat__form { padding: 10px 10px 12px; border-top: 0; background: linear-gradient(180deg, transparent, rgba(8, 5, 16, 0.55)); }
.hp-chat__bar {
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(40, 28, 64, 0.9), rgba(20, 14, 32, 0.95)) padding-box,
    linear-gradient(135deg, rgba(167, 139, 250, 0.45), rgba(255, 255, 255, 0.06) 50%, rgba(244, 114, 182, 0.4)) border-box;
}

@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes chat-gift-in { 0% { opacity: 0; transform: translateX(-14px) scale(0.96); } 100% { opacity: 1; transform: none; } }
@keyframes chat-gift-pop { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes chat-gift-bob { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-4px) rotate(-6deg); } 70% { transform: translateY(-1px) rotate(5deg); } }
@keyframes chat-sheen { to { background-position: -60% 0; } }
@keyframes chat-orbit { to { --cg-a: 360deg; } }
@keyframes chat-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (prefers-reduced-motion: reduce) {
  .cm, .cg, .cg__emoji, .hp-chat__badge::before { animation: none !important; }
}

/* Bildirim listesinde tıklanabilir kullanıcı */
#header-notify-list .notify-user { color: #f9a8d4; cursor: pointer; }
#header-notify-list .notify-user:hover { text-decoration: underline; text-underline-offset: 2px; }
#header-notify-list .notify-user-av { cursor: pointer; transition: box-shadow 0.15s ease; }
#header-notify-list .notify-user-av:hover { box-shadow: 0 0 0 2px #f472b6; }

/* Profil araması: avatar + isim + yarışmacı etiketi */
.profile-search-item { display: flex !important; align-items: center; gap: 8px; }
.profile-search-item img { width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.profile-search-item b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.profile-search-item em {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  color: #fbcfe8;
  background: rgba(236, 72, 153, 0.18);
  border: 1px solid rgba(244, 114, 182, 0.35);
}

/* Düello sırasında atılan hediye: hangi meydan okuma olduğu */
.cg__duel { display: flex; align-items: center; gap: 4px; margin: 0 0 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; color: #fdba74; }
.cg__duel .material-symbols-outlined { font-size: 13px; }
.cg__duel b { color: #fff; font-weight: 800; overflow-wrap: anywhere; }
