* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #191933, #342a4d);
  color: #f5f5f5;
}

.container {
  max-width: 760px;
  margin: 40px auto;
  padding: 20px;
}

.dragon-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.dragon-source-hidden {
  display: none;
}

.dragon-mascot-image {
  width: 220px;
  max-width: 40vw;
  height: auto;
  object-fit: contain;
  animation: floaty 2.8s ease-in-out infinite;
}

.dragon-mascot-image.speaking {
  animation: floaty 1.2s ease-in-out infinite, talking-glow 0.6s ease-in-out infinite alternate;
}

.dragon-speech {
  flex: 1;
  background: #ffd66c;
  color: #3a2600;
  border: 2px solid #b07a11;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0;
}

.subtitle {
  margin-top: 8px;
  color: #d8d0ff;
}

.chat-box {
  margin-top: 20px;
  height: 480px;
  overflow-y: auto;
  border: 1px solid #5f4b9a;
  border-radius: 12px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
}

.message {
  max-width: 85%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.message.user {
  margin-left: auto;
  background: #5c78ff;
}

.message.bot {
  background: #8a53d4;
}

.chat-form {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.chat-form input {
  flex: 1;
  border: 1px solid #5f4b9a;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
}

.chat-form button {
  border: none;
  background: #ff8c42;
  color: #101010;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes talking-glow {
  from {
    filter: drop-shadow(0 0 4px rgba(255, 80, 80, 0.4));
  }
  to {
    filter: drop-shadow(0 0 14px rgba(255, 40, 40, 0.9));
  }
}
