/* ==========================================================================
   Grand Finale Epilogue: Starry Cake + 3D Orbiting Photo Galaxy +
   Share Message Modal + Click-to-Zoom Photo Lightbox
   ========================================================================== */

.scene--cake {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: #000105;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.15s cubic-bezier(0.22, 1, 0.36, 1), visibility 1.15s ease;
}

.scene--cake.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cake-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cake-canvas--bg {
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

.cake-canvas--bg:active {
  cursor: grabbing;
}

.cake-canvas--fg {
  z-index: 6;
  pointer-events: none;
}

.cake-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(22, 62, 190, 0.14) 0%, rgba(2, 5, 16, 0) 48%),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 4, 0.6) 100%);
}

.cake-happy-script {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", "Apple Chancery", Georgia, cursive;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #f6fbff;
  white-space: nowrap;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 20px rgba(125, 198, 255, 0.88),
    0 0 42px rgba(55, 128, 255, 0.56);
}

.cake-interact-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 7;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(218, 232, 252, 0.68);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0, 2, 10, 0.85);
}

/* Subtle floating button to reopen the share message modal anytime */
.cake-note-trigger {
  position: fixed;
  left: calc(14px + var(--safe-left));
  top: calc(14px + var(--safe-top));
  z-index: 9;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  color: rgba(246, 238, 224, 0.9);
  background: rgba(14, 24, 52, 0.62);
  border: 1px solid rgba(190, 214, 255, 0.32);
  box-shadow: 0 6px 20px rgba(0, 4, 18, 0.5);
  transition: transform 0.22s ease, background-color 0.25s ease;
}

.cake-note-trigger:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   Post-Video Share Message Modal ("生日快乐呀！开心吗？有啥想分享分享的吗？")
   -------------------------------------------------------------------------- */
.share-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) calc(18px + var(--safe-right))
    calc(24px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background: rgba(3, 7, 20, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.52s ease;
}

.share-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.share-card {
  width: min(90vw, 400px);
  padding: 28px 22px 22px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(20, 32, 66, 0.92) 0%, rgba(11, 18, 40, 0.95) 100%);
  border: 1px solid rgba(214, 228, 255, 0.28);
  box-shadow:
    0 24px 64px rgba(0, 4, 18, 0.72),
    0 0 40px -12px rgba(105, 168, 255, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translate3d(0, 14px, 0) scale(0.96);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}

.share-modal.is-open .share-card {
  transform: translate3d(0, 0, 0) scale(1);
}

.share-star-badge {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #FFF2C2;
  background: radial-gradient(circle, rgba(255, 228, 138, 0.28) 0%, rgba(92, 152, 255, 0.14) 100%);
  border: 1px solid rgba(255, 232, 168, 0.42);
  box-shadow: 0 0 18px rgba(255, 218, 120, 0.34);
}

.share-title {
  margin: 0 0 16px;
  font-size: clamp(16.5px, 4.4vw, 19px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: #FAF4E8;
}

.share-textarea {
  width: 100%;
  min-height: 112px;
  max-height: 220px;
  resize: vertical;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(198, 216, 250, 0.28);
  background: rgba(5, 10, 26, 0.64);
  color: #FAF6EE;
  font-family: var(--font-serif);
  font-size: 16px; /* 16px prevents iOS/Android auto-zoom on focus */
  line-height: 1.7;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.share-textarea::placeholder {
  color: rgba(202, 212, 234, 0.45);
}

.share-textarea:focus {
  border-color: rgba(164, 206, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(100, 168, 255, 0.14);
}

.share-status {
  min-height: 20px;
  margin: 10px 0 4px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(255, 232, 174, 0.9);
}

.share-status.is-error {
  color: #F6A8A8;
}

.share-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-btn {
  min-height: 44px;
  border-radius: 999px;
  font-size: 14.5px;
  letter-spacing: 0.16em;
  padding: 0 22px;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.25s ease;
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.share-btn--submit {
  color: #0B142C;
  font-weight: 500;
  background: linear-gradient(135deg, #FFF4D6 0%, #E7D2AC 52%, #BBD8FF 100%);
  box-shadow: 0 8px 24px -6px rgba(135, 186, 255, 0.45);
}

.share-btn--skip {
  font-size: 13px;
  color: rgba(212, 222, 242, 0.68);
  min-height: 40px;
}

/* --------------------------------------------------------------------------
   Click-to-Zoom Photo Lightbox Overlay
   -------------------------------------------------------------------------- */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(28px + var(--safe-top)) calc(18px + var(--safe-right))
    calc(28px + var(--safe-bottom)) calc(18px + var(--safe-left));
  background: rgba(2, 5, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.photo-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-stage {
  position: relative;
  max-width: min(92vw, 760px);
  max-height: 74dvh;
  max-height: calc(var(--app-h) * 0.74);
  display: grid;
  place-items: center;
  transform: scale(0.9);
  transition: transform 0.34s cubic-bezier(0.22, 1.15, 0.36, 1);
}

.photo-lightbox.is-open .lightbox-stage {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 72dvh;
  max-height: calc(var(--app-h) * 0.72);
  border-radius: 8px;
  border: 3px solid rgba(255, 250, 240, 0.92);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.75),
    0 0 36px rgba(120, 186, 255, 0.22);
  object-fit: contain;
  display: block;
  background: #0B1224;
}

.lightbox-controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #F4EFE6;
  background: rgba(22, 34, 68, 0.72);
  border: 1px solid rgba(196, 218, 255, 0.32);
}

.lightbox-nav:active {
  transform: scale(0.93);
}

.lightbox-counter {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  color: rgba(232, 236, 248, 0.8);
  min-width: 66px;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: calc(14px + var(--safe-top));
  right: calc(14px + var(--safe-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #FAF3E8;
  background: rgba(22, 34, 68, 0.72);
  border: 1px solid rgba(196, 218, 255, 0.32);
}
