/* Life Chapter journeys and chapter-only Memory Lane. */
.memory-lane-chapter-banner {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid rgba(34, 116, 109, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(236, 250, 246, 0.98), rgba(232, 244, 248, 0.96));
  box-shadow: 0 12px 30px rgba(21, 83, 84, 0.08);
}

.memory-lane-chapter-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #159879, #127a91);
}

.memory-lane-chapter-mark svg {
  width: 22px;
  height: 22px;
}

.memory-lane-chapter-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.memory-lane-chapter-copy > span {
  color: #268172;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.memory-lane-chapter-copy > strong {
  overflow: hidden;
  color: #123f4a;
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-lane-chapter-copy > small {
  color: #547178;
  font-size: 0.76rem;
}

.memory-lane-chapter-back {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(25, 105, 103, 0.18);
  border-radius: 8px;
  color: #174d56;
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.memory-lane-chapter-back svg {
  width: 16px;
  height: 16px;
}

.memory-lane-chapter-back:hover {
  border-color: rgba(21, 152, 121, 0.42);
  background: #fff;
}

.memory-lane-chapter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.memory-lane-chapter-edit {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(20, 130, 113, 0.2);
  border-radius: 999px;
  color: #0c675f;
  background: rgba(225, 248, 241, 0.92);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 820;
  cursor: pointer;
}

.memory-lane-chapter-edit svg {
  width: 15px;
  height: 15px;
}

.memory-lane-chapter-edit:hover {
  border-color: rgba(21, 152, 121, 0.42);
  background: #e8fbf5;
}

.memory-lane-chapter-empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 34px 20px;
  border: 1px solid rgba(33, 108, 106, 0.14);
  border-radius: 8px;
  color: #537178;
  text-align: center;
  background: rgba(249, 253, 252, 0.88);
}

.memory-lane-chapter-empty > svg {
  width: 28px;
  height: 28px;
  color: #159879;
}

.memory-lane-chapter-empty > strong {
  color: #173f49;
  font-size: 1.05rem;
}

.memory-lane-chapter-empty > p {
  max-width: 440px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.story-mode-active .memory-journey-toast {
  border-color: rgba(50, 178, 147, 0.24);
}

/* A chapter journey reads as one continuous story, with calm progress between stops. */
.map-stage.chapter-journey-active::after {
  opacity: 0.48;
  background:
    radial-gradient(circle at 50% 46%, transparent 0 34%, rgba(3, 14, 24, 0.2) 72%),
    linear-gradient(180deg, rgba(4, 24, 34, 0.16), transparent 38%, rgba(3, 15, 26, 0.26));
}

.memory-peek-card.story-mode-card.story-mode-chapter-stop {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--peek-accent, #159879) 28%, rgba(224, 248, 241, 0.44));
  background:
    linear-gradient(145deg, rgba(7, 30, 40, 0.94), rgba(8, 60, 61, 0.88)),
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--peek-accent, #159879) 26%, transparent), transparent 46%);
  box-shadow:
    0 26px 68px rgba(0, 18, 29, 0.32),
    0 0 0 6px color-mix(in srgb, var(--peek-accent, #159879) 6%, transparent);
}

.story-chapter-progress {
  display: block;
  width: min(190px, 100%);
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(225, 248, 241, 0.17);
}

.story-chapter-progress > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69e0ba, #d8fff3);
  box-shadow: 0 0 12px rgba(105, 224, 186, 0.4);
  transition: width 700ms cubic-bezier(0.2, 0.78, 0.2, 1);
}

.map-stage.chapter-journey-active .memory-bottom-sheet.relieve-opening,
.map-stage.chapter-journey-active .memory-bottom-sheet.relive-opening {
  animation-duration: 900ms;
}

@media (max-width: 640px) {
  .memory-lane-chapter-banner {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 13px;
  }

  .memory-lane-chapter-mark {
    width: 42px;
    height: 42px;
  }

  .memory-lane-chapter-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .memory-lane-chapter-edit,
  .memory-lane-chapter-back {
    width: 100%;
    min-width: 0;
    padding: 0 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .memory-lane-chapter-banner,
  .memory-lane-chapter-edit,
  .memory-lane-chapter-back,
  .story-chapter-progress > i {
    transition: none !important;
  }
}
