/* ═══════════════════════════════════════════════════════════════
   ДИАЛОГ — стиль Hades
   - Большой портрет слева, выходит за рамку панели сверху
   - Текстовая плашка справа с золотой двойной рамкой и угловыми орнаментами
   - Имя в "табличке" с эмблемой персонажа слева
   - Цветовой акцент рамки и имени меняется под персонажа
   ═══════════════════════════════════════════════════════════════ */

#screen-dialogue {
  background:
    radial-gradient(ellipse at 35% 60%, rgba(50, 35, 20, 0.55), rgba(0,0,0,0.92) 70%),
    linear-gradient(180deg, #0a0604 0%, #060403 100%);
}

/* SKIP в углу */
.skip-btn {
  position: fixed;
  top: 28px; right: 36px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.35em;
  color: rgba(212, 169, 87, 0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  z-index: 100;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 8px 12px;
}
.skip-btn:hover {
  color: var(--gold-bright);
  transform: translateX(2px);
}

/* ═══ КОНТЕЙНЕР ДИАЛОГА (нижняя половина экрана) ═══ */
.dlg-container {
  position: absolute;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
  width: min(1100px, 92vw);
  height: 280px;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

/* ── ПОРТРЕТ слева — выходит за рамку панели сверху ── */
.dlg-portrait-wrap {
  position: relative;
  width: 420px;
  height: 540px;
  margin-bottom: -10px;
  margin-right: -30px;
  pointer-events: auto;
  flex-shrink: 0;
  z-index: 3;
}

.dlg-portrait {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.75));
  /* мягко гасим края портрета — растворяем в чёрный фон диалога */
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 58%,
    #000 0%, #000 45%, rgba(0,0,0,0.6) 70%, transparent 100%);
          mask-image: radial-gradient(ellipse 70% 80% at 50% 58%,
    #000 0%, #000 45%, rgba(0,0,0,0.6) 70%, transparent 100%);
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.dlg-portrait.visible {
  opacity: 1;
  transform: translateX(0);
}
/* мягкий "глоу" вокруг портрета под цвет персонажа */
.dlg-portrait::before {
  content: "";
  position: absolute;
  inset: 12% 8% 8% 8%;
  background: radial-gradient(ellipse at center, var(--char-glow, rgba(212,169,87,0.18)) 0%, transparent 65%);
  z-index: -1;
  filter: blur(12px);
  pointer-events: none;
}

/* ═══ ПАНЕЛЬ С ТЕКСТОМ справа ═══ */
.dlg-panel {
  position: relative;
  flex-grow: 1;
  min-height: 230px;
  margin-bottom: 0;
  padding: 18px 36px 22px;
  pointer-events: auto;
  background:
    linear-gradient(180deg,
      rgba(44, 30, 22, 0.96) 0%,
      rgba(28, 19, 14, 0.96) 60%,
      rgba(20, 14, 10, 0.97) 100%);
  border: 2px solid var(--char-accent, var(--gold));
  border-radius: 3px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(212, 169, 87, 0.18),
    inset 0 0 0 1px rgba(0,0,0,0.4),
    0 0 24px var(--char-accent-soft, rgba(212, 169, 87, 0.15));
  z-index: 2;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease 0.15s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.15s,
              border-color 0.4s ease, box-shadow 0.4s ease;
}
.dlg-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

/* внутренняя тонкая двойная рамка */
.dlg-panel::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid var(--char-accent-dim, rgba(212, 169, 87, 0.4));
  border-radius: 2px;
  pointer-events: none;
}

/* угловые орнаменты — завитушки */
.dlg-corner {
  position: absolute;
  width: 26px; height: 26px;
  pointer-events: none;
  color: var(--char-accent, var(--gold));
  opacity: 0.85;
}
.dlg-corner.tl { top: -3px; left: -3px;  }
.dlg-corner.tr { top: -3px; right: -3px; transform: scaleX(-1); }
.dlg-corner.bl { bottom: -3px; left: -3px; transform: scaleY(-1); }
.dlg-corner.br { bottom: -3px; right: -3px; transform: scale(-1, -1); }

/* ── ТАБЛИЧКА С ИМЕНЕМ ── над панелью, выходит сверху */
.dlg-name-tag {
  position: absolute;
  top: -28px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 24px 10px 16px;
  background:
    linear-gradient(180deg,
      rgba(56, 40, 28, 0.97) 0%,
      rgba(34, 23, 16, 0.97) 100%);
  border: 2px solid var(--char-accent, var(--gold));
  border-radius: 3px;
  box-shadow:
    0 -4px 12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(212, 169, 87, 0.2);
  z-index: 3;
}
.dlg-name-tag::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--char-accent-dim, rgba(212, 169, 87, 0.4));
  border-radius: 2px;
  pointer-events: none;
}

/* эмблема персонажа слева от имени */
.dlg-emblem {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--char-accent, var(--gold));
  filter: drop-shadow(0 0 4px var(--char-accent-soft, rgba(212, 169, 87, 0.5)));
  position: relative;
  z-index: 1;
}
.dlg-emblem svg { width: 100%; height: 100%; }

/* имя + подпись */
.dlg-name-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  position: relative;
  z-index: 1;
}
.dlg-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.18em;
  color: var(--char-accent, var(--gold));
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7), 0 0 8px var(--char-accent-soft, transparent);
}
.dlg-role {
  margin-top: 3px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(212, 169, 87, 0.65);
  text-transform: uppercase;
}

/* ── ТЕКСТ ── */
.dlg-text {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.55;
  color: #f1e4c8;
  letter-spacing: 0.025em;
  min-height: 110px;
  padding: 14px 70px 8px 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
}

/* мигающий курсор печати */
.cursor-blink {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--char-accent, var(--gold));
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.8s ease-in-out infinite;
  opacity: 0.85;
  border-radius: 1px;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.2; }
}

/* ── CONTINUE ── */
.dlg-continue {
  position: absolute;
  bottom: 10px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--char-accent, var(--gold));
  cursor: pointer;
  text-transform: uppercase;
  padding: 4px 8px;
  transition: color 0.2s ease, transform 0.2s ease;
}
.dlg-continue::after {
  content: "▼";
  font-size: 10px;
  animation: continue-bounce 1.4s ease-in-out infinite;
}
.dlg-continue:hover {
  color: #fff8e1;
  transform: translateY(-1px);
}
.dlg-continue[hidden] { display: none; }

@keyframes continue-bounce {
  0%, 100% { transform: translateY(0);   opacity: 0.7; }
  50%      { transform: translateY(3px); opacity: 1;   }
}

/* ═════════ ЦВЕТОВЫЕ ТЕМЫ ПЕРСОНАЖЕЙ ═════════ */

/* LYRON — серебристо-лунный (космонавт-нарратор) */
[data-speaker="lyron"] {
  --char-accent: #c8d4e0;
  --char-accent-dim: rgba(200, 212, 224, 0.45);
  --char-accent-soft: rgba(200, 212, 224, 0.4);
  --char-glow: rgba(180, 195, 215, 0.22);
}

/* HEATHCLIFF — пурпурно-розовый ниндзя (его аура) */
[data-speaker="heathcliff"] {
  --char-accent: #d36ab6;
  --char-accent-dim: rgba(211, 106, 182, 0.45);
  --char-accent-soft: rgba(220, 80, 170, 0.5);
  --char-glow: rgba(210, 70, 165, 0.3);
}

/* NOXX — фиолетовый, парень с косой (его аура и глаз на косе) */
[data-speaker="noxx"] {
  --char-accent: #b88be3;
  --char-accent-dim: rgba(184, 139, 227, 0.45);
  --char-accent-soft: rgba(160, 100, 220, 0.5);
  --char-glow: rgba(160, 90, 210, 0.28);
}

/* ═════════ АДАПТИВ ═════════ */
@media (max-width: 900px) {
  .dlg-container {
    width: 96vw;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    bottom: 3vh;
  }
  .dlg-portrait-wrap {
    width: 100%;
    height: 280px;
    margin: 0 0 -8px 0;
  }
  .dlg-portrait {
    background-position: bottom center;
  }
  .dlg-panel {
    padding: 14px 22px 18px;
  }
  .dlg-text {
    padding-right: 8px;
    padding-bottom: 32px;
    font-size: 15px;
    min-height: 80px;
  }
  .dlg-name { font-size: 16px; }
  .dlg-role { font-size: 10px; }
}
