:root {
  --bg: #0a0015;
  --bg-gradient: linear-gradient(to bottom, #0a0015, #1a0025);
  --accent-purple: #8b00ff;
  --crimson: #c41e3a;
  --gold: #d4af37;
  --text-light: #f0e6ff;
  --text-dim: #b0a0d0;
  --message-user: rgba(212, 175, 55, 0.15);
  --message-bot: rgba(139, 0, 255, 0.12);
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-light);
  height: 100vh;
  overflow: hidden;
}

.app { display: flex; flex-direction: column; height: 100vh; }

.top-bar {
  background: rgba(10, 0, 21, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gold);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Cinzel', serif;
}

.character-info { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 64px; height: 80px; /* ~4:5 */
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--crimson);
  box-shadow: 0 0 12px rgba(196, 30, 58, 0.6);
}

.name-area h1 { font-size: 1.5rem; color: var(--gold); }
.subtitle { font-size: 0.9rem; color: var(--text-dim); }

.thirst-bar { text-align: right; font-size: 0.9rem; }
.progress {
  height: 6px; background: #333; border-radius: 3px; margin-top: 4px; overflow: hidden;
}
.progress-inner { height: 100%; background: linear-gradient(to right, #8b00ff, #c41e3a); width: 50%; transition: width 0.4s; }

.main {
  flex: 1; display: flex; overflow: hidden;
}

.portrait-column {
  width: 35%; min-width: 280px; background: rgba(20, 0, 40, 0.4);
  border-right: 1px solid rgba(212,175,55,0.2);
  padding: 16px; display: flex; align-items: center; justify-content: center;
  font-style: italic; color: var(--text-dim);
}

.chat-container { flex: 1; display: flex; flex-direction: column; }

.chat-log {
  flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth;
}

.message {
  margin-bottom: 16px; padding: 10px 14px; border-radius: 8px; max-width: 80%;
}
.message.user {
  background: var(--message-user); align-self: flex-end; margin-left: auto;
  border: 1px solid var(--gold);
}
.message.bot {
  background: var(--message-bot); border: 1px solid var(--accent-purple);
}
.message .sender { font-weight: bold; color: var(--gold); display: block; margin-bottom: 4px; font-family: 'Cinzel', serif; }

.input-bar {
  background: rgba(10, 0, 21, 0.9);
  border-top: 1px solid var(--crimson);
  padding: 12px; display: flex; gap: 8px;
}
#user-input {
  flex: 1; padding: 12px; border: 1px solid var(--accent-purple); border-radius: 24px;
  background: rgba(255,255,255,0.05); color: white; font-size: 1rem;
}
#send-btn {
  padding: 12px 24px; background: var(--crimson); color: white; border: none; border-radius: 24px;
  cursor: pointer; font-weight: bold;
}
#send-btn:hover { background: #e03e52; }

/* Scrollbar styling */
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-track { background: #111; }
.chat-log::-webkit-scrollbar-thumb { background: var(--accent-purple); border-radius: 3px; }
