:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --gold: #d4af37;
  --gold-2: #b38b1e;
  --text: #e9e4d0;
  --muted: #aaa27c;
  --bubble-user: #1b1b1b;
  --bubble-bot: #0f0f0f;
  --danger: #a33a2a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Cinzel", ui-serif, Georgia, serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -20%, #1b1400 0%, #0a0a0a 60%, #000 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-header {
  width: 100%;
  max-width: 920px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  color: var(--gold);
}
.site-title { font-weight: 700; letter-spacing: 0.5px; }
.book-link { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-2); }
.book-link:hover { color: var(--text); }

.page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.phone {
  position: relative;
  width: 380px;
  height: 720px;
  background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
  border-radius: 38px;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 8px rgba(212,175,55,0.08), 0 20px 60px rgba(0,0,0,0.8), inset 0 0 40px rgba(212,175,55,0.06);
  overflow: hidden;
}

.notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 22px;
  background: #000;
  border-radius: 0 0 12px 12px;
  box-shadow: inset 0 -2px 0 rgba(255,255,255,0.02);
  z-index: 2;
}

.phone-header {
  height: 64px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0 16px 12px 16px;
  border-bottom: 1px solid rgba(212,175,55,0.25);
  background: linear-gradient(180deg, rgba(212,175,55,0.06), rgba(0,0,0,0));
}
.app-title { color: var(--gold); font-weight: 600; }
.app-title .djinn { font-family: "UnifrakturMaguntia", cursive; font-size: 22px; letter-spacing: 1px; margin-right: 6px; color: var(--gold-2); }

.chat {
  position: absolute;
  top: 64px;
  bottom: 64px;
  left: 0;
  right: 0;
  overflow-y: auto;
  padding: 16px 14px 16px 14px;
  scrollbar-width: thin;
}
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.25); border-radius: 8px; }

.msg {
  display: flex;
  margin: 10px 0;
}
.msg.user { justify-content: flex-end; }
.msg .bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  border: 1px solid rgba(212,175,55,0.18);
}
.msg.user .bubble {
  background: var(--bubble-user);
  color: var(--text);
  border-top-right-radius: 4px;
}
.msg.bot .bubble {
  background: var(--bubble-bot);
  color: var(--text);
  border-top-left-radius: 4px;
}
.meta { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }

.typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0.4; animation: pulse 1.2s infinite ease-in-out; }
.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

.input-row {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid rgba(212,175,55,0.2);
  background: linear-gradient(180deg, #0a0a0a, #050505);
}
.input-row input {
  flex: 1;
  height: 40px;
  background: #0f0f0f;
  color: var(--text);
  border: 1px solid rgba(212,175,55,0.28);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  font-size: 16px; /* prevent iOS zoom */
}
.input-row input::placeholder { color: #7b7042; }
.send {
  height: 40px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #111;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.send:hover { filter: brightness(1.05); }
.send:active { transform: translateY(1px); }

.imprint {
  width: 100%;
  max-width: 920px;
  text-align: center;
  padding: 18px 12px 36px 12px;
  color: var(--muted);
  font-size: 10px;
}
.imprint a { color: var(--gold); text-decoration: none; }

@media (max-width: 420px) {
  .phone { width: 100%; height: calc(100vh - 220px); }
}


