:root {
  color-scheme: dark;
  --bg: #05060a;
  --bg-glow: radial-gradient(ellipse at top, #1a1030 0%, #05060a 60%);
  --ink: #e7e1f5;
  --dim: #8b84a8;
  --accent: #b98cff;
  --user-bubble: #1c1730;
  --oracle-bubble: #120d1f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-glow);
  color: var(--ink);
  font-family: "Iowan Old Style", "Georgia", serif;
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

main {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

h1 {
  text-align: center;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--accent);
  margin: 0;
}

.intro {
  text-align: center;
  color: var(--dim);
  margin: 0;
  font-style: italic;
}

#thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.message {
  padding: 0.9rem 1.1rem;
  border-radius: 0.25rem;
  line-height: 1.5;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  color: var(--ink);
}

.message.oracle {
  align-self: flex-start;
  background: var(--oracle-bubble);
  border: 1px solid #2a2340;
  color: var(--accent);
  font-style: italic;
}

.message.error {
  align-self: flex-start;
  color: #d98c8c;
  font-style: italic;
}

#question-form {
  display: flex;
  gap: 0.5rem;
}

#question-input {
  flex: 1;
  background: var(--user-bubble);
  border: 1px solid #2a2340;
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 1rem;
}

#question-input:focus {
  outline: 2px solid var(--accent);
}

button {
  background: var(--accent);
  color: #120d1f;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 0.25rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
