/* ═══ In-Game Chat ═══ */
.chat-panel {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 20;
}

.chat-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  position: absolute;
  bottom: 0;
  right: 0;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.chat-toggle:hover { transform: scale(1.1); }

.chat-body {
  display: none;
  width: 300px;
  height: 350px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-direction: column;
  overflow: hidden;
  position: absolute;
  bottom: 60px;
  right: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.chat-body.open { display: flex; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.chat-msg {
  font-size: 0.85rem;
  line-height: 1.4;
}
.chat-msg .chat-sender {
  font-weight: 600;
  color: var(--accent);
  margin-right: 0.3rem;
}
.chat-msg .chat-text { color: var(--text-primary); }
.chat-msg.system {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.8rem;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
}
.chat-input-row input {
  flex: 1;
  border: none;
  border-radius: 0;
  background: var(--bg-card);
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}
.chat-input-row .btn {
  border-radius: 0;
  background: var(--accent);
  color: white;
}

@media (max-width: 480px) {
  .chat-body {
    width: calc(100vw - 2rem);
    right: -0.5rem;
  }
}
