/* ── CHAT SOBREPOSTO (Estilo igual ao tema - CORES VIBRANTES) ── */
.iv-chat-overlay {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 480px;
  height: auto;
  max-height: 400px;
  z-index: 9999;
  pointer-events: none;
  background: transparent;
}

#chat {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--f-body, 'Segoe UI', 'Georgia', serif);
  user-select: none;
  pointer-events: none;
  background: transparent;
}

#chat .msg {
  display: block;
  width: 100%;
  padding: 8px 14px;
  margin-bottom: 5px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  opacity: 1;
  transform: translateX(-10px);
  transition: transform 0.4s ease, opacity 0.4s ease;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  font-weight: 500;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Efeito de entrada das mensagens */
#chat .msg.show {
  transform: translateX(0);
  opacity: 1;
}

/* Tipo 0 - Mensagem normal (BRANCO FORTE com destaque azul) */
#chat .msg.type0 {
  color: #ffffff;
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(59,130,246,0.15), rgba(0,0,0,0.75));
  font-weight: 500;
  text-shadow: 0 0 2px rgba(59,130,246,0.3);
}

/* Tipo 1 - Mensagem especial (DOURADO VIBRANTE) */
#chat .msg.type1 {
  color: #fbbf24;
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245,158,11,0.2), rgba(0,0,0,0.75));
  font-weight: 700;
  text-shadow: 0 0 3px rgba(245,158,11,0.4);
}

/* Tipo 2 - Mensagem de sistema (VERDE NEON) */
#chat .msg.type2 {
  color: #22c55e;
  border-left-color: #10b981;
  background: linear-gradient(90deg, rgba(34,197,94,0.15), rgba(0,0,0,0.75));
  font-weight: 600;
  font-style: normal;
  text-shadow: 0 0 2px rgba(34,197,94,0.3);
}

/* Tipo 3 - Mensagem de evento (LARANJA/LARANJA VIVO) */
#chat .msg.type3 {
  color: #ff6b35;
  border-left-color: #ff4d1e;
  background: linear-gradient(90deg, rgba(255,107,53,0.2), rgba(0,0,0,0.8));
  font-weight: 800;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  text-shadow: 0 0 3px rgba(255,107,53,0.5);
  animation: eventGlow 1.5s ease-in-out infinite;
}

/* Tipo 4 - Mensagem de guild/clã (ROXO) */
#chat .msg.type4 {
  color: #c084fc;
  border-left-color: #a855f7;
  background: linear-gradient(90deg, rgba(168,85,247,0.15), rgba(0,0,0,0.75));
  font-weight: 600;
  text-shadow: 0 0 2px rgba(168,85,247,0.3);
}

/* Tipo 5 - Mensagem de PvP/combate (VERMELHO) */
#chat .msg.type5 {
  color: #ff4444;
  border-left-color: #dc2626;
  background: linear-gradient(90deg, rgba(220,38,38,0.2), rgba(0,0,0,0.75));
  font-weight: 700;
  text-shadow: 0 0 2px rgba(220,38,38,0.4);
}

/* Animação de brilho para eventos */
@keyframes eventGlow {
  0%, 100% { 
    text-shadow: 0 0 2px rgba(255,107,53,0.5);
    border-left-color: #ff4d1e;
  }
  50% { 
    text-shadow: 0 0 8px rgba(255,107,53,0.9);
    border-left-color: #ff8c42;
  }
}

/* Efeito fade-out nas mensagens mais antigas (melhorado) */
#chat .msg:nth-last-child(1) { 
  opacity: 1; 
  transform: translateX(0);
}
#chat .msg:nth-last-child(2) { 
  opacity: 0.95; 
  transform: translateX(-2px);
}
#chat .msg:nth-last-child(3) { 
  opacity: 0.88; 
  transform: translateX(-4px);
}
#chat .msg:nth-last-child(4) { 
  opacity: 0.81; 
  transform: translateX(-6px);
}
#chat .msg:nth-last-child(5) { 
  opacity: 0.74; 
  transform: translateX(-8px);
}
#chat .msg:nth-last-child(6) { 
  opacity: 0.67; 
  transform: translateX(-10px);
}
#chat .msg:nth-last-child(7) { 
  opacity: 0.60; 
  transform: translateX(-12px);
}
#chat .msg:nth-last-child(8) { 
  opacity: 0.53; 
  transform: translateX(-14px);
}
#chat .msg:nth-last-child(9) { 
  opacity: 0.46; 
  transform: translateX(-16px);
}
#chat .msg:nth-last-child(10) { 
  opacity: 0.39; 
  transform: translateX(-18px);
}
#chat .msg:nth-last-child(11) { 
  opacity: 0.32; 
  transform: translateX(-20px);
}
#chat .msg:nth-last-child(12) { 
  opacity: 0.25; 
  transform: translateX(-22px);
}
#chat .msg:nth-last-child(13) { 
  opacity: 0.18; 
  transform: translateX(-24px);
}
#chat .msg:nth-last-child(14) { 
  opacity: 0.11; 
  transform: translateX(-26px);
}
#chat .msg:nth-last-child(15),
#chat .msg:nth-last-child(16),
#chat .msg:nth-last-child(17) { 
  opacity: 0; 
  transform: translateX(-35px);
  display: none;
}

/* Scrollbar customizada */
#chat::-webkit-scrollbar {
  width: 4px;
}
#chat::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
}
#chat::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6, #f59e0b);
  border-radius: 2px;
}

/* Versão responsiva para mobile */
@media (max-width: 768px) {
  .iv-chat-overlay {
    width: 340px;
    max-height: 320px;
    bottom: 10px;
    left: 10px;
  }
  
  #chat .msg {
    font-size: 11px;
    padding: 6px 12px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
  }
}