/* ============================================
   GAME CHAT ROOMS
   ============================================ */

.game-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-chat-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.game-chat-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  height: 80vh;
  max-height: 700px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 20px;
  border: 2px solid rgba(8, 145, 178, 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-chat-header h3 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}

.chat-room-desc {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
}

.game-chat-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.game-chat-close:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: rotate(90deg);
}

.chat-pinned-message {
  padding: 12px 24px;
  background: rgba(139, 92, 246, 0.15);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 0.85rem;
  color: #c4b5fd;
}

.chat-pinned-message strong {
  color: white;
}

.game-chat-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.game-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.game-chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.game-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(6, 214, 160, 0.3);
  border-radius: 4px;
}

.game-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 214, 160, 0.5);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
}

.chat-empty p {
  margin: 0 0 8px;
  font-size: 1rem;
}

.game-chat-message {
  display: flex;
  gap: 12px;
  animation: slideInChat 0.2s ease-out;
}

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

.game-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.game-chat-avatar:hover {
  transform: scale(1.1);
}

.game-chat-message-content {
  flex: 1;
  min-width: 0;
}

.game-chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.game-chat-username {
  font-weight: 600;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
}

.game-chat-username:hover {
  color: #06d6a0;
}

.game-chat-timestamp {
  font-size: 0.7rem;
  color: #64748b;
}

.game-chat-message-text {
  margin: 0;
  font-size: 0.95rem;
  color: #cbd5e1;
  word-wrap: break-word;
  line-height: 1.5;
}

.game-chat-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.game-chat-footer input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 0.95rem;
}

.game-chat-footer input:focus {
  outline: none;
  border-color: #06d6a0;
  background: rgba(255, 255, 255, 0.08);
}

.game-chat-footer input::placeholder {
  color: #64748b;
}

.game-chat-footer button {
  padding: 12px 24px;
  white-space: nowrap;
}

/* Online indicator (future enhancement) */
.chat-online-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #4ade80;
  margin-top: 4px;
}

.chat-online-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .game-chat-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .game-chat-header {
    padding: 16px 20px;
  }

  .game-chat-messages {
    padding: 16px 20px;
  }

  .game-chat-footer {
    padding: 16px 20px;
  }

  .game-chat-avatar {
    width: 36px;
    height: 36px;
  }
}
