/* ============================================================
   SUMMON THE DRAUGR: cinematic chat page
   Dark ember and rune aesthetic, mobile-first.
   ============================================================ */

.summon-stage {
  position: relative;
  padding: 3rem 0 4rem;
  background:
    radial-gradient(120% 40% at 50% 100%, rgba(193, 18, 31, 0.14) 0%, rgba(193, 18, 31, 0) 60%),
    linear-gradient(180deg, #0a0908 0%, #0e0b09 100%);
  overflow: hidden;
}
.summon-stage::before {
  /* faint rune dust drifting up */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 78%, rgba(255, 110, 60, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 34% 88%, rgba(255, 150, 80, 0.4) 50%, transparent 51%),
    radial-gradient(2px 2px at 61% 82%, rgba(255, 110, 60, 0.35) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 83% 90%, rgba(255, 150, 80, 0.45) 50%, transparent 51%),
    radial-gradient(2px 2px at 47% 70%, rgba(255, 110, 60, 0.25) 50%, transparent 51%);
  animation: ember-rise 9s ease-in-out infinite alternate;
}
@keyframes ember-rise {
  from { transform: translateY(0); opacity: 0.7; }
  to { transform: translateY(-26px); opacity: 1; }
}

.summon-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.summon-head { text-align: center; margin-bottom: 1.6rem; }
.summon-avatar {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 1rem;
}
.summon-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(193, 18, 31, 0.55));
  position: relative;
  z-index: 1;
}
.summon-ember {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 110, 60, 0.5);
  animation: ember-pulse 3.2s ease-in-out infinite;
}
.summon-ember::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(193, 18, 31, 0.35);
  animation: ember-pulse 3.2s ease-in-out 1.6s infinite;
}
@keyframes ember-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}
.summon-head h1 {
  margin: 0 0 0.4rem;
  letter-spacing: 0.03em;
}
.summon-tag {
  color: var(--bone-dim);
  font-style: italic;
  margin: 0;
}

/* ---------- chat shell ---------- */
.chat-shell {
  background: rgba(18, 16, 14, 0.92);
  border: 1px solid #2c2521;
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(122, 12, 20, 0.06);
  overflow: hidden;
}
.chat-log {
  min-height: 320px;
  max-height: 56vh;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  scrollbar-width: thin;
  scrollbar-color: var(--blood-deep) transparent;
}
.msg {
  max-width: 88%;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  line-height: 1.5;
  font-size: 0.98rem;
  animation: msg-rise 0.45s ease both;
  word-wrap: break-word;
}
@keyframes msg-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-draugr {
  align-self: flex-start;
  background: #171310;
  border: 1px solid #2c2521;
  border-left: 3px solid var(--blood);
  color: var(--bone);
}
.msg-draugr .who {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blood-bright);
  margin-bottom: 0.3rem;
}
.msg-user {
  align-self: flex-end;
  background: var(--ash);
  border: 1px solid #33291f;
  color: var(--bone-dim);
}
.msg-error {
  align-self: center;
  background: transparent;
  border: 1px dashed var(--blood-deep);
  color: var(--blood-bright);
  font-size: 0.9rem;
  text-align: center;
}

/* typing indicator: the Draugr stirs */
.typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--bone-dim);
  font-style: italic;
  font-size: 0.9rem;
  padding: 0.4rem 0.2rem;
  animation: msg-rise 0.4s ease both;
}
.typing .dots { display: inline-flex; gap: 4px; }
.typing .dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blood-bright);
  animation: dot-throb 1.2s ease-in-out infinite;
}
.typing .dots span:nth-child(2) { animation-delay: 0.2s; }
.typing .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-throb {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ---------- suggested openers ---------- */
.openers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.1rem 0.9rem;
}
.opener {
  font: inherit;
  font-size: 0.86rem;
  color: var(--bone-dim);
  background: transparent;
  border: 1px solid #3a2f28;
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.opener:hover, .opener:focus-visible {
  border-color: var(--blood);
  color: var(--bone);
  background: rgba(193, 18, 31, 0.08);
  outline: none;
}

/* ---------- input row ---------- */
.chat-form {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem 0.4rem;
  border-top: 1px solid #241f1b;
}
.chat-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--bone);
  background: #0d0b09;
  border: 1px solid #33291f;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.chat-form input:focus {
  outline: none;
  border-color: var(--blood);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.25);
}
.chat-form input:disabled { opacity: 0.55; }
.btn-send {
  flex: 0 0 auto;
  width: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blood-deep);
  border: 1px solid var(--blood);
  border-radius: 8px;
  color: var(--bone);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-send:hover:not(:disabled) { background: var(--blood); }
.btn-send:active:not(:disabled) { transform: scale(0.96); }
.btn-send:disabled { opacity: 0.5; cursor: default; }
.btn-send svg { width: 20px; height: 20px; }

.summon-note {
  min-height: 1.4em;
  margin: 0.35rem 1.1rem 0.9rem;
  font-size: 0.82rem;
  color: var(--gold);
  font-style: italic;
}

.summon-disclaimer {
  text-align: center;
  color: var(--bone-dim);
  opacity: 0.65;
  font-size: 0.82rem;
  margin-top: 1.4rem;
  font-style: italic;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 720px) {
  .summon-stage { padding: 4rem 0 5rem; }
  .chat-log { min-height: 380px; }
}
