/* ==========================================================================
   Act 10: Birthday Blessing Finale Overlay
   Positioned harmoniously below the photo-formed 「生日快乐」 mosaic
   ========================================================================== */

.scene--finale {
  z-index: var(--z-finale);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: calc(16px + var(--safe-top)) calc(20px + var(--safe-right))
    calc(26px + var(--safe-bottom)) calc(20px + var(--safe-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scene--finale.is-active {
  visibility: visible;
  pointer-events: auto;
}

/* Soft deep starry twilight feather beneath finale text for effortless readability */
.scene--finale::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38%;
  background: linear-gradient(
    to top,
    rgba(9, 15, 32, 0.86) 0%,
    rgba(11, 18, 38, 0.48) 58%,
    rgba(11, 18, 38, 0) 100%
  );
  pointer-events: none;
}

.finale-panel {
  position: relative;
  z-index: 1;
  width: min(90vw, 540px);
  max-height: 31dvh;
  max-height: calc(var(--app-h) * 0.31);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  text-align: center;
  padding: 6px 10px 8px;
}

.finale-panel::-webkit-scrollbar {
  width: 3px;
}

.finale-panel::-webkit-scrollbar-thumb {
  background: rgba(230, 211, 179, 0.28);
  border-radius: 3px;
}

.finale-title {
  margin: 0 0 10px;
  font-size: clamp(19px, 5vw, 24px);
  font-weight: 400;
  letter-spacing: 0.2em;
  padding-left: 0.2em;
  color: #FAF3E6;
  text-shadow: 0 2px 16px rgba(4, 8, 22, 0.75);
}

.finale-title:empty {
  display: none;
}

.finale-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finale-line {
  margin: 0;
  font-size: clamp(14px, 3.7vw, 16px);
  line-height: 1.85;
  letter-spacing: 0.08em;
  color: rgba(242, 232, 216, 0.88);
  text-shadow: 0 1px 12px rgba(4, 8, 22, 0.72);
}

.finale-meta {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.finale-meta.is-empty {
  display: none;
}

.finale-signature,
.finale-date {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: rgba(218, 206, 188, 0.72);
}

.finale-signature:empty,
.finale-date:empty {
  display: none;
}

.finale-replay-btn {
  margin-top: 16px;
  min-height: 44px;
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: #F6ECD9;
  background: rgba(20, 32, 62, 0.72);
  border: 1px solid rgba(230, 211, 179, 0.42);
  box-shadow: 0 4px 16px rgba(4, 8, 22, 0.45);
}

.finale-replay-btn:active {
  transform: scale(0.96);
}
