/* ============================================
   CHAT STYLES - Стили для чата
   ============================================ */

/* Контейнер чата */
.chat.compact {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Тело чата с сообщениями */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin-bottom: 10px;
  max-height: 300px;
  font-size: 13px;
  line-height: 1.4;
}

/* Скроллбар для чата */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Сообщение в чате */
.chat-message {
  padding: 4px 0;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Время сообщения */
.msg-time {
  color: #888;
  font-size: 11px;
  margin-right: 5px;
}

/* Имя отправителя */
.msg-sender {
  color: #4a9eff;
  font-weight: bold;
  margin-right: 5px;
}

/* Текст сообщения */
.msg-text {
  color: #fff;
}

/* Локальное сообщение */
.chat-message.local {
  border-left: 2px solid transparent;
  padding-left: 6px;
}

.chat-message.local:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: #4a9eff;
}

/* Приватное сообщение отправленное */
.chat-message.private-sent {
  background: rgba(138, 43, 226, 0.15);
  border-left: 2px solid #8a2be2;
  padding-left: 6px;
  margin: 2px 0;
  border-radius: 3px;
}

.chat-message.private-sent .msg-private {
  color: #ba55d3;
  font-weight: bold;
  margin-right: 5px;
}

/* Приватное сообщение полученное */
.chat-message.private-received {
  background: rgba(34, 139, 34, 0.15);
  border-left: 2px solid #228b22;
  padding-left: 6px;
  margin: 2px 0;
  border-radius: 3px;
}

.chat-message.private-received .msg-private {
  color: #32cd32;
  font-weight: bold;
  margin-right: 5px;
}

/* Системное сообщение */
.chat-message.system {
  color: #ffa500;
  font-style: italic;
  text-align: center;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 165, 0, 0.2);
  border-bottom: 1px solid rgba(255, 165, 0, 0.2);
  margin: 4px 0;
}

/* Сообщение об ошибке */
.chat-message.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 6px 8px;
  border-left: 3px solid #ff6b6b;
  border-radius: 3px;
  margin: 4px 0;
  font-weight: 500;
}

/* Имена игроков в чате — ПКМ курсор */
[data-player-name] {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 2px;
  transition: background 0.15s, color 0.15s;
}
[data-player-name]:hover {
  background: rgba(74, 158, 255, 0.18);
  color: #93c5fd;
  text-decoration: underline dotted;
}

/* /to — публичный шёпот (все видят) */
.chat-message.to-sent,
.chat-message.to-received {
  background: rgba(234, 179, 8, 0.07);
  border-left: 2px solid #ca8a04;
  padding-left: 6px;
  margin: 2px 0;
  border-radius: 3px;
}

.msg-to {
  color: #fbbf24;
  font-weight: bold;
  margin-right: 5px;
}

/* Сообщение от игрока из чёрного списка */
.chat-message.blacklisted .msg-sender {
  color: #ef4444;
}
.chat-message.blacklisted .msg-text {
  color: #fca5a5;
  opacity: 0.75;
}
.chat-message.blacklisted {
  border-left: 2px solid #ef4444;
  padding-left: 6px;
  background: rgba(239, 68, 68, 0.05);
}

/* Форма ввода */
.chat-input {
  display: flex;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.chat-input input:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

.chat-input input::placeholder {
  color: #888;
}

.chat-input button {
  padding: 8px 16px;
  background: #4a9eff;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-input button:hover {
  background: #3a8eef;
  transform: translateY(-1px);
}

.chat-input button:active {
  transform: translateY(0);
}

/* Подсказка для команд */
.chat-hint {
  font-size: 11px;
  color: #888;
  padding: 4px 8px;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.chat-hint code {
  color: #ba55d3;
  background: rgba(138, 43, 226, 0.15);
  padding: 2px 4px;
  border-radius: 2px;
  font-family: monospace;
}

/* Combat badge next to name in chat */
.msg-combat-badge {
  color: #dc3545;
  font-size: 12px;
  margin-left: 3px;
  text-shadow: 0 0 4px rgba(220, 53, 69, 0.6);
  cursor: default;
}