/* Request 5: the Growth Heart as a speaker, the save toast, "continue" on the title, the epilogue in the ending panel */

/* ---------- the Growth Heart in the talk box: furnace red, a pulsing ring, a slightly glitchy name ---------- */
#talkBox[data-speaker="heart"] #talkPic {
  border-color: #ff6a3a;
  background: radial-gradient(circle at 50% 46%, #8a3216, #22100b 72%);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 3px #16202e, 0 0 18px rgba(255, 106, 58, .55);
  animation: heartRing 1.3s ease-in-out infinite;
}
#talkBox[data-speaker="heart"] #talkPic img { width: 150%; top: 4%; }
#talkBox[data-speaker="heart"] #talkName {
  color: #ff8a4a;
  text-shadow: 1.5px 0 0 #16202e, -1.5px 0 0 #16202e, 0 1.5px 0 #16202e, 0 -1.5px 0 #16202e, 2px 0 0 rgba(95, 242, 255, .45);
  animation: heartGlitch 3.2s steps(1) infinite;
}
#talkBox[data-speaker="heart"] #talkTag { background: #ff6a3a; color: #22100b; }
#talkBox[data-speaker="heart"] #talkText { color: #ffe8da; }
#talkBox[data-speaker="heart"] #talkNext { border-top-color: #ff8a4a; }
@keyframes heartRing {
  0%, 100% { box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 3px #16202e, 0 0 10px rgba(255, 106, 58, .35); }
  50% { box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 3px #16202e, 0 0 26px rgba(255, 106, 58, .85); }
}
@keyframes heartGlitch {
  0%, 92%, 100% { transform: none; }
  93% { transform: translateX(2px) skewX(-8deg); }
  95% { transform: translateX(-2px); }
  97% { transform: translateX(1px) skewX(6deg); }
}

/* ---------- save toast (placed under the HUD panel by savegame.js) ---------- */
#saveToast {
  position: fixed; left: 12px; top: 120px; z-index: 13;
  display: flex; align-items: center; gap: 8px;
  min-height: 30px; padding: 3px 14px 3px 6px; border-radius: 999px;
  background: rgba(14, 24, 34, .74); border: 2px solid rgba(255, 210, 122, .6);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .3);
  font-weight: 900; font-size: 14px; line-height: 1.1; color: #fff4dc;
  text-shadow: 1.5px 0 0 #16202e, -1.5px 0 0 #16202e, 0 1.5px 0 #16202e, 0 -1.5px 0 #16202e;
  pointer-events: none; opacity: 0; transform: translateY(-8px) scale(.9);
  transition: opacity .25s ease-out, transform .3s cubic-bezier(.34, 1.56, .64, 1);
  white-space: nowrap;
}
#saveToast.show { opacity: 1; transform: none; }
#saveToast .sgGear {
  position: relative; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%;
  border: 4px dotted #ffd27a; box-sizing: border-box;
  animation: sgSpin 1.1s linear infinite;
}
#saveToast .sgGear::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: #ffd27a;
}
@keyframes sgSpin { to { transform: rotate(360deg); } }

/* ---------- "continue the last journey" under the start prompt ---------- */
#contInfo {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 14px; border-radius: 999px;
  background: rgba(14, 24, 34, .62); border: 2px solid rgba(95, 242, 255, .55);
  font-size: 15px; font-weight: 900; color: #c8fbff; letter-spacing: .02em;
  text-shadow: 1.5px 0 0 #16202e, -1.5px 0 0 #16202e, 0 1.5px 0 #16202e, 0 -1.5px 0 #16202e;
  animation: contIn .5s cubic-bezier(.34, 1.56, .64, 1) .35s both;
}
#contInfo .sgGear {
  position: relative; width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%;
  border: 3px dotted #7ff4ff; box-sizing: border-box; animation: sgSpin 3s linear infinite;
}
@keyframes contIn { from { transform: translateY(10px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- epilogue inside the ending panel ---------- */
#modalBody:has(.epi) { max-height: 56vh; overflow-y: auto; }
.epi { margin-top: 12px; padding-top: 10px; border-top: 2px solid rgba(255, 217, 138, .3); text-align: left; }
.epi h4 { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: #ffd27a; letter-spacing: .04em; }
.epi ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.epi li {
  position: relative; padding-left: 20px;
  font-family: system-ui, sans-serif; font-size: 15px; line-height: 1.45; font-weight: 600; color: #f4f1e8;
  animation: epiIn .45s ease-out both;
}
.epi li::before {
  content: ""; position: absolute; left: 3px; top: .5em; width: 8px; height: 8px;
  transform: rotate(45deg); background: #ffd25a; box-shadow: 0 0 6px #ffd25a;
}
.epi li:nth-child(1) { animation-delay: .5s; }
.epi li:nth-child(2) { animation-delay: .8s; }
.epi li:nth-child(3) { animation-delay: 1.1s; }
@keyframes epiIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

@media (max-height: 460px) {
  #talkBox[data-speaker="heart"] #talkPic img { width: 150%; top: 4%; }
  #saveToast { font-size: 13px; min-height: 26px; padding: 2px 12px 2px 5px; }
  #saveToast .sgGear { width: 17px; height: 17px; border-width: 3px; }
  #contInfo { font-size: 13px; margin-top: 3px; padding: 2px 12px; }
  #modalBody:has(.epi) { max-height: 48vh; }
  .epi { margin-top: 6px; padding-top: 6px; }
  .epi h4 { font-size: 15px; }
  .epi li { font-size: 13px; line-height: 1.35; }
}
