@media (min-width: 768px) {
  #chat-form {
    margin-bottom: 1.5rem;
  }
}


/* Root + Layout */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: monospace;
  background-color: #0e0e10;
  color: #f4f4f4;
  display: flex;
  flex-direction: column;
}

/* Container */
#chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Chat area (reversed) */
#chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 1rem;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

#chat-window::-webkit-scrollbar {
  width: 8px;
}

#chat-window::-webkit-scrollbar-track {
  background: transparent;
}

#chat-window::-webkit-scrollbar-thumb {
  background-color: transparent;
}

#chat-window:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}


/* Firefox support */
#chat-window {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}


/* Message bubbles */
.message {
  padding: 1rem;
  border-radius: 10px;
  line-height: 1.5;
  max-width: 85%;
  word-wrap: break-word;
}

.npc {
  background-color: #222;
  align-self: flex-start;
}

.player {
  background-color: #444;
  align-self: flex-end;
}

/* Form at bottom */
#chat-form {
  display: flex;
  padding: 0.75rem;
  background-color: #111;
  border-top: 1px solid #222;
  box-sizing: border-box;
}

#chat-form input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  background-color: #1a1a1a;
  color: white;
}

#chat-form button {
  margin-left: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

/* Typing animation */
.typing {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #aaa;
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
}
