* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Georgia", serif;
  background: #1a1a2e;
  color: #e0d6c8;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

#scene {
  flex: 1;
  display: block;
}

#chat-panel {
  width: 380px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background: rgba(20, 15, 10, 0.92);
  border-left: 1px solid rgba(180, 150, 100, 0.3);
  backdrop-filter: blur(10px);
}

#chat-header {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(180, 150, 100, 0.2);
  background: rgba(40, 30, 20, 0.5);
}

#chat-header h2 {
  font-size: 1.3rem;
  color: #d4a84b;
  font-weight: normal;
  letter-spacing: 1px;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
  background: rgba(100, 80, 50, 0.5);
  border: 1px solid rgba(180, 150, 100, 0.3);
  color: #e0d6c8;
}

.message.assistant {
  align-self: flex-start;
  background: rgba(180, 150, 100, 0.15);
  border: 1px solid rgba(212, 168, 75, 0.25);
  color: #f0e6d6;
}

.message.typing {
  color: #d4a84b;
  font-style: italic;
}

#chat-input-area {
  padding: 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(180, 150, 100, 0.2);
  background: rgba(40, 30, 20, 0.5);
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(180, 150, 100, 0.3);
  border-radius: 8px;
  background: rgba(30, 25, 18, 0.8);
  color: #e0d6c8;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: #d4a84b;
}

#chat-input::placeholder {
  color: rgba(180, 150, 100, 0.5);
}

#send-btn {
  padding: 10px 20px;
  background: rgba(212, 168, 75, 0.25);
  border: 1px solid rgba(212, 168, 75, 0.4);
  border-radius: 8px;
  color: #d4a84b;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

#send-btn:hover {
  background: rgba(212, 168, 75, 0.4);
}

#send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Scrollbar */
#chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(180, 150, 100, 0.3);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }
  #scene {
    height: 40vh;
  }
  #chat-panel {
    width: 100%;
    height: 60vh;
    border-left: none;
    border-top: 1px solid rgba(180, 150, 100, 0.3);
  }
}
