/* «Печатает…» в чате теста: карточка собеседника (голова, ник, тир, роль) + прыгающие точки.
   Карточка выезжает снизу при появлении и плавно уезжает, когда человек перестал печатать. */
.chat-typing-slot { min-height: 0; margin-top: 8px; }
.chat-typing {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  padding: 7px 12px 7px 8px; border-radius: 14px; border-bottom-left-radius: 4px;
  background: var(--panel-2, #1a1d27); border: 1px solid var(--border, #2a2f40);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  animation: ct-in .32s cubic-bezier(.2, .9, .25, 1.15) both;
}
.chat-typing.leaving { animation: ct-out .22s ease-in both; }
.chat-typing + .chat-typing { margin-top: 6px; }
.chat-typing .ct-av { position: relative; flex: none; width: 34px; height: 34px; }
.chat-typing .ct-av .avatar-head { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; }
.chat-typing .ct-av img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.chat-typing .ct-av::after {                       /* пульсирующее кольцо вокруг головы */
  content: ''; position: absolute; inset: -3px; border-radius: 10px;
  border: 2px solid var(--ct-accent, #6ea2ff); opacity: 0; animation: ct-ring 1.6s ease-out infinite;
}
.chat-typing .ct-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-typing .ct-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.1; }
.chat-typing .ct-name { font-weight: 800; font-size: 13px; color: var(--text, #e7eaf4); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-typing .ct-tier {
  font-size: 10px; font-weight: 900; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px;
  color: #1a1203; background: linear-gradient(160deg, #ffe27a, #f0b429); box-shadow: 0 0 8px rgba(240, 180, 41, .35);
}
.chat-typing .ct-role {
  font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 1px 7px; border-radius: 5px;
  color: var(--ct-accent, #6ea2ff); background: color-mix(in srgb, var(--ct-accent, #6ea2ff) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ct-accent, #6ea2ff) 40%, transparent);
}
.chat-typing .ct-sub { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-dim, #8a91ab); }
.chat-typing .ct-dots { display: inline-flex; align-items: flex-end; gap: 3px; height: 10px; }
.chat-typing .ct-dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ct-accent, #6ea2ff);
  animation: ct-bounce 1.1s ease-in-out infinite;
}
.chat-typing .ct-dots i:nth-child(2) { animation-delay: .16s; }
.chat-typing .ct-dots i:nth-child(3) { animation-delay: .32s; }

/* оттенки ролей (тон приходит с сервера из publicStaffBadges) */
.chat-typing[data-tone="gold"]     { --ct-accent: #f5c518; }
.chat-typing[data-tone="crimson"]  { --ct-accent: #ff5d73; }
.chat-typing[data-tone="lightblue"]{ --ct-accent: #6fd3ff; }
.chat-typing[data-tone="orange"]   { --ct-accent: #ff9f43; }
.chat-typing[data-tone="purple"]   { --ct-accent: #b388ff; }
.chat-typing[data-tone="blue"]     { --ct-accent: #5b8cff; }
.chat-typing[data-tone="green"]    { --ct-accent: #3ec079; }
.chat-typing[data-side="player"]   { --ct-accent: #5cd6a0; }

@keyframes ct-in   { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes ct-out  { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes ct-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-6px); opacity: 1; } }
@keyframes ct-ring { 0% { opacity: .7; transform: scale(.92); } 80%, 100% { opacity: 0; transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) {
  .chat-typing, .chat-typing.leaving, .chat-typing .ct-dots i, .chat-typing .ct-av::after { animation: none; }
}
