:root {
  --night: #0A0E27;
  --night-deep: #04060F;
  --gold: #7EE8C4;
  --rose: #E6879A;
  --mist: #C7CBE0;
  --white: #F5F3EE;
  --line: rgba(126, 232, 196, 0.25);
  --aurora-1: #6EE7B7;
  --aurora-2: #A78BFA;
  --aurora-3: #67E8F9;
  --snow: #EAF2FF;
  --rock-far: #131A33;
  --rock-mid: #1B2340;
  --rock-near: #101427;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(to bottom, var(--night-deep) 0%, var(--night) 55%, #0D1230 100%);
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
}

/* ---------- BACKGROUND LAYERS ---------- */
#stars, #snow, #aurora, #mountains {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  background: var(--white);
  border-radius: 50%;
  opacity: 0.6;
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.9; }
}

#snow { overflow: hidden; }

.snowflake {
  position: absolute;
  top: -5%;
  background: var(--snow);
  border-radius: 50%;
  opacity: 0.7;
  animation-name: fall, sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
}

@keyframes fall {
  from { transform: translateY(-5vh); }
  to { transform: translateY(105vh); }
}

@keyframes sway {
  0%, 100% { margin-left: 0; }
  50% { margin-left: 24px; }
}

#aurora {
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: 0.75;
}

.aurora-band {
  position: absolute;
  top: -10%;
  width: 140%;
  height: 70%;
  left: -20%;
  filter: blur(40px);
  border-radius: 50%;
}

.aurora-band.a1 {
  background: radial-gradient(ellipse at 30% 40%, var(--aurora-1) 0%, transparent 60%);
  animation: driftA 16s ease-in-out infinite;
}

.aurora-band.a2 {
  background: radial-gradient(ellipse at 60% 30%, var(--aurora-2) 0%, transparent 55%);
  animation: driftB 22s ease-in-out infinite;
  opacity: 0.7;
}

.aurora-band.a3 {
  background: radial-gradient(ellipse at 45% 50%, var(--aurora-3) 0%, transparent 55%);
  animation: driftC 19s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes driftA {
  0%, 100% { transform: translateX(0) translateY(0) scaleY(1); }
  50% { transform: translateX(6%) translateY(3%) scaleY(1.15); }
}
@keyframes driftB {
  0%, 100% { transform: translateX(0) translateY(0) scaleY(1); }
  50% { transform: translateX(-8%) translateY(-2%) scaleY(1.1); }
}
@keyframes driftC {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(5%) translateY(4%); }
}

#mountains {
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  height: 55vh;
  min-height: 320px;
}

.ridge {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  width: 110%;
}

.ridge svg { display: block; width: 100%; height: 100%; }
.ridge.far { height: 100%; opacity: 0.55; }
.ridge.mid { height: 78%; opacity: 0.8; }
.ridge.near { height: 52%; opacity: 1; }

/* ---------- SHARED UI ---------- */
.eyebrow {
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--mist);
  margin-bottom: 18px;
}

.next-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 13px 34px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, opacity 0.4s, transform 0.4s;
  margin-top: 48px;
}

.next-btn:hover {
  background: var(--gold);
  color: var(--night-deep);
}

.next-btn.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* ---------- SCREENS ---------- */
#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  width: 100vw;
}

.screen {
  display: none;
  min-height: 100vh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.screen.active {
  display: flex;
  animation: screenIn 0.9s ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- SCREEN 1: LOCK ---------- */
.orb-wrap {
  width: 100px;
  height: 100px;
  margin-bottom: 34px;
  position: relative;
}

.orb {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E9FFF6, var(--gold) 55%, #3E9E80 100%);
  box-shadow: 0 0 40px rgba(126, 232, 196, 0.45), 0 0 80px rgba(126, 232, 196, 0.15);
  animation: breathe 5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.orb-ring {
  position: absolute;
  inset: -16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.orb-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--rose);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

h1.lock-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.8rem, 7vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 34px;
}

h1.lock-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold), var(--aurora-3), var(--rose), var(--gold));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShimmer 6s linear infinite;
  display: inline-block;
  padding-right: 0.15em;
}

form#lock-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 300px;
}

#password-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(126, 232, 196, 0.3);
  border-radius: 2px;
  padding: 14px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  letter-spacing: 0.15em;
  color: var(--white);
  text-align: center;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}

#password-input:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.07);
}

#password-input::placeholder {
  color: rgba(199, 203, 224, 0.4);
  letter-spacing: 0.05em;
}

button#unlock-btn {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 13px 30px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

button#unlock-btn:hover {
  background: var(--gold);
  color: var(--night-deep);
}

.error-msg {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--rose);
  height: 16px;
  letter-spacing: 0.05em;
}

.hint-text {
  font-family: 'Poppins', sans-serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(199, 203, 224, 0.55);
  margin-top: 24px;
}

.shake { animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- SCREEN 2: REVEAL ---------- */
.reveal-burst {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 8px;
}

.burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  opacity: 0;
}

.screen.active .burst-ring {
  animation: burstOut 2.4s ease-out infinite;
}

.burst-ring.r2 { animation-delay: 0.5s !important; }
.burst-ring.r3 { animation-delay: 1s !important; }

@keyframes burstOut {
  0% { transform: scale(0.3); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.reveal-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  animation: popIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

h2.reveal-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3.2rem, 9vw, 5.4rem);
  font-weight: 400;
  line-height: 1.15;
  margin-top: 20px;
  opacity: 0;
  animation: fadeUp 1s ease 0.6s both;
  display: inline-block;
  padding-right: 0.15em;
}

h2.reveal-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--aurora-2), var(--rose));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShimmer 6s linear infinite;
  display: inline-block;
  padding-right: 0.15em;
}

.reveal-sub {
  font-family: 'Poppins', sans-serif;
  color: var(--mist);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 16px;
  opacity: 0;
  animation: fadeUp 1s ease 1s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

#reveal-next {
  opacity: 0;
  animation: fadeUp 1s ease 1.4s both;
}

/* ---------- SCREEN 3: GIFTS ---------- */
.gifts-row {
  display: flex;
  gap: 44px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.gift {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.gift-icon {
  width: clamp(160px, 26vw, 300px);
  height: clamp(160px, 26vw, 300px);
  position: relative;
  animation: floaty 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px var(--gift-glow, rgba(126, 232, 196, 0.35)));
  transition: transform 0.3s, opacity 0.4s, filter 0.4s;
}

.gift-icon::before {
  content: '';
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gift-glow, rgba(126, 232, 196, 0.3)) 0%, transparent 70%);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: -1;
}

.gift:hover .gift-icon::before {
  opacity: 1;
  transform: scale(1);
}

.gift:nth-child(1) .gift-icon { animation-delay: 0s; }
.gift:nth-child(2) .gift-icon { animation-delay: 0.6s; }
.gift:nth-child(3) .gift-icon { animation-delay: 1.2s; }

.gift-box {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 40%;
  bottom: 6%;
  background: linear-gradient(160deg, var(--gift-light), var(--gift-dark));
  border-radius: 8px;
  box-shadow: inset 0 -10px 18px rgba(0,0,0,0.25);
}

.gift-lid {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 24%;
  height: 18%;
  background: linear-gradient(160deg, var(--gift-dark), var(--gift-light));
  border-radius: 6px;
  box-shadow: 0 6px 10px rgba(0,0,0,0.2);
}

.gift-ribbon-v {
  position: absolute;
  left: 46%;
  width: 8%;
  top: 24%;
  bottom: 6%;
  background: rgba(255,255,255,0.88);
  border-radius: 2px;
}

.gift-bow {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 22%;
}

.gift-bow span {
  position: absolute;
  top: 0;
  width: 52%;
  height: 100%;
  background: rgba(255,255,255,0.88);
  border-radius: 50% 50% 50% 4px / 60% 60% 40% 40%;
}

.gift-bow span:first-child {
  left: 0;
  transform: rotate(-18deg);
}

.gift-bow span:last-child {
  right: 0;
  transform: rotate(18deg) scaleX(-1);
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.gift:hover .gift-icon {
  transform: scale(1.05);
}

.gift.unlocked .gift-icon {
  opacity: 0.5;
  animation: none;
  transform: scale(0.92);
  filter: none;
}

.gift-label {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mist);
}

.gift.active .gift-icon .gift-box {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

.gift-panel {
  max-width: 480px;
  width: 100%;
  margin-top: 44px;
  min-height: 40px;
}

.gift-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.gift-question p {
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  color: var(--mist);
}

.gift-question form {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.gift-question input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(126, 232, 196, 0.3);
  border-radius: 2px;
  padding: 12px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--white);
  outline: none;
}

.gift-question input:focus {
  border-color: var(--gold);
}

.gift-question button {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.gift-question button:hover {
  background: var(--gold);
  color: var(--night-deep);
}

.gift-error {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--rose);
  height: 14px;
}

.gift-content {
  animation: fadeUp 0.7s ease both;
}

.gift-content h4 {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-style: normal;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ---------- ENVELOPE OVERLAY (Gift One) ---------- */
.envelope-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 6, 15, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.envelope-overlay-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.envelope-modal {
  position: relative;
  width: 80vw;
  height: 80vh;
  max-width: 680px;
  max-height: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.envelope-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(4, 6, 15, 0.7);
  border: 1px solid var(--line);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}

.envelope-close:hover {
  background: rgba(255,255,255,0.16);
  transform: scale(1.06);
}

.envelope-big {
  position: relative;
  width: min(70%, 340px);
  height: min(50%, 230px);
  cursor: pointer;
  transition: opacity 0.4s ease 0.5s, transform 0.4s ease 0.5s;
}

.envelope-big.open {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.envelope-body-big {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--rock-mid), var(--rock-near));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.envelope-flap-big {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(160deg, var(--rock-far), var(--rock-mid));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.6, 0, 0.4, 1);
  z-index: 2;
}

.envelope-big.open .envelope-flap-big {
  transform: rotateX(180deg);
}

.seal-big {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--rose), #B85C74 70%);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  animation: sealPulse 3.5s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes sealPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.4), 0 0 0 rgba(230, 135, 154, 0.3); }
  50% { box-shadow: 0 4px 18px rgba(0,0,0,0.4), 0 0 18px rgba(230, 135, 154, 0.55); }
}

.seal-big span {
  font-family: 'Great Vibes', cursive;
  font-style: normal;
  font-size: 26px;
  color: rgba(255,255,255,0.9);
}

.envelope-big.open .seal-big {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

.letter-modal-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  padding: clamp(24px, 4vw, 44px) clamp(18px, 3.5vw, 40px) clamp(18px, 3.5vw, 40px);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(126, 232, 196, 0.08), rgba(167, 139, 250, 0.06));
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.6s ease 0.9s, transform 0.6s ease 0.9s;
  pointer-events: none;
  text-align: left;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.letter-modal-content.visible {
  opacity: 1;
  transform: scale(1);
}

.envelope-overlay-backdrop.active .letter-modal-content.visible {
  pointer-events: all;
}

.letter-body {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(12px, 1.5vw, 15.5px);
  line-height: 1.5;
  white-space: pre-line;
  color: var(--white);
}

.letter-body::first-letter {
  font-family: 'Great Vibes', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 2.8em;
  line-height: 0.7;
  float: left;
  padding: 2px 8px 0 0;
  color: var(--gold);
}

.letter-divider-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: clamp(10px, 2vh, 20px) 0 0;
}

.letter-divider-inline::before,
.letter-divider-inline::after {
  content: '';
  height: 1px;
  width: 50px;
  background: var(--line);
}

.letter-divider-inline span { color: var(--rose); font-size: 13px; }

.letter-signature-inline {
  font-family: 'Great Vibes', cursive;
  font-style: normal;
  font-size: clamp(18px, 2.6vw, 24px);
  text-align: right;
  margin-top: clamp(6px, 1.5vh, 14px);
  color: var(--gold);
}

.gift-reopen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 12px 22px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.gift-reopen:hover {
  background: var(--gold);
  color: var(--night-deep);
}

/* ---------- SCREEN 4: FINAL ---------- */
h2.final-title {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 4rem);
  margin-bottom: 26px;
}

h2.final-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--aurora-3), var(--gold));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShimmer 6s linear infinite;
 

}

.final-message {
  max-width: 500px;
  font-family: 'Poppins', sans-serif;
  font-size: 19px;
  line-height: 1.85;
  color: var(--white);
  white-space: pre-line;
}

footer.site-footer {
  margin-top: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(199, 203, 224, 0.35);
}

@media (max-width: 480px) {
  .gifts-row { gap: 20px; }
  .gift-icon { width: 42vw; height: 42vw; }
}

/* ---------- MINI GAME: CONNECT THE STARS ---------- */
.stars-game-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.stars-game-instructions {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.stars-svg {
  width: 100%;
  max-width: 520px; /* Increased container width */
  height: auto;
  overflow: visible;
  display: block;
  transform: translateY(50px);
  
}

.stars-scene {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 520px; /* Scaled up by over 50% */
  margin: 0 auto;
}

/* Heart vector path scale and animation */
.heart-bg-shape {
  fill: rgba(230, 135, 154, 0.18);
  stroke: var(--rose);
  stroke-width: 3;
  opacity: 0;
  transform-origin: center center;
  /* Shifted 30px to the right (30px), moved down (40px) */
  transform: translate(80px, 55px) scale(0.6);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.heart-photos-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars-photo {
  position: absolute;
  top: 40%;
  width: 140px; /* Increased base width */
  height: 180px; /* Fixed height frame so both images match size */
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  transition: opacity 0.8s ease 0.3s, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}

.stars-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Normalizes portrait aspect ratios so neither looks smaller */
  display: block;
  filter: drop-shadow(0 0 14px rgba(230, 135, 154, 0.5));
}

.stars-photo-left {
  left: 33%;
}

.stars-photo-right {
  left: 67%;
}

/* Disappear the dots and connected lines on completion */
.star-point, .heart-line {
  transition: opacity 0.6s ease;
}

.stars-game-wrap.complete .star-point,
.stars-game-wrap.complete .heart-line {
  opacity: 0;
  pointer-events: none;
}

/* Completed Pop-up state (20% bigger: 1.5 -> 1.8) */
.stars-game-wrap.complete .heart-bg-shape {
  opacity: 1;
  /* Kept 30px right, 40px down, scale increased to 1.8 */
  transform: translate(80px, 55px) scale(2.0);
}

.stars-game-wrap.complete .stars-photo {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.5); /* 50%+ Larger Photos Pop-up */
}

.star-point {
  fill: var(--white);
  opacity: 0.55;
  transition: fill 0.3s, opacity 0.3s, r 0.3s;
}

.star-point:hover {
  opacity: 0.9;
}

.star-point.lit {
  fill: var(--gold);
  opacity: 1;
  r: 18;
}

.star-point.error {
  fill: var(--rose);
  opacity: 1;
}

.heart-line {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.85;
}

.stars-game-success {
  font-family: 'Great Vibes', cursive;
  font-size: 2.2rem;
  color: var(--rose);
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.stars-game-wrap.complete .stars-game-success {
  opacity: 1;
  height: auto;
  margin-top: 12px;
}

.stars-game-reset {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mist);
  padding: 9px 18px;
  margin-top: 14px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.stars-game-reset:hover {
  border-color: var(--gold);
  color: var(--gold);
}
/* ---------- MINI GAME: PHOTO JIGSAW ---------- */
.jigsaw-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.jigsaw-instructions {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.jigsaw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}

.jigsaw-slot {
  background-color: rgba(255,255,255,0.03);
  background-repeat: no-repeat;
  border: 1px dashed rgba(126, 232, 196, 0.25);
  border-radius: 3px;
  transition: border-color 0.3s, background-color 0.3s;
}

.jigsaw-slot.filled {
  border: 1px solid transparent;
}

.jigsaw-slot.error {
  border-color: var(--rose);
}

.jigsaw-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 300px;
}

.jigsaw-piece {
  width: 56px;
  height: 40px;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.jigsaw-piece:hover {
  transform: translateY(-2px);
}

.jigsaw-piece.selected {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(126, 232, 196, 0.5);
  transform: translateY(-2px);
}

.jigsaw-success {
  font-family: 'Great Vibes', cursive;
  font-size: 1.8rem;
  color: var(--rose);
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.jigsaw-wrap.complete .jigsaw-success {
  opacity: 1;
  height: auto;
}

.jigsaw-wrap.complete .jigsaw-tray {
  display: none;
}

.jigsaw-reset {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mist);
  padding: 9px 18px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
}

.jigsaw-reset:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- GIFT THREE: VIDEO REVEAL ---------- */
.video-message {
  font-family: 'Great Vibes', cursive;
  font-size: 1.9rem;
  color: var(--rose);
  margin-bottom: 18px;
}

.gift-video {
  width: 100%;
  max-width: 340px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  background: #000;
  display: block;
  margin: 0 auto;
}

/* ============================================================
   POLISH PASS — shimmer, sweeps, scrollbars, selection, staggers
   ============================================================ */

@keyframes titleShimmer {
  to { background-position: 300% center; }
}

/* Custom text selection color, matching the theme instead of default blue */
::selection {
  background: rgba(126, 232, 196, 0.35);
  color: var(--white);
}

/* Custom scrollbar for scrollable panels (letter overlay, etc.) */
.letter-modal-content::-webkit-scrollbar {
  width: 6px;
}
.letter-modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.letter-modal-content::-webkit-scrollbar-thumb {
  background: rgba(126, 232, 196, 0.35);
  border-radius: 3px;
}
.letter-modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(126, 232, 196, 0.35) transparent;
}

/* Light-sweep hover effect on outline buttons */
.next-btn,
button#unlock-btn,
.gift-reopen,
.stars-game-reset,
.jigsaw-reset {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.next-btn::before,
button#unlock-btn::before,
.gift-reopen::before,
.stars-game-reset::before,
.jigsaw-reset::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
  z-index: -1;
}

.next-btn:hover::before,
button#unlock-btn:hover::before,
.gift-reopen:hover::before,
.stars-game-reset:hover::before,
.jigsaw-reset:hover::before {
  left: 130%;
}

/* Staggered entrance for the three gift buttons */
.gift {
  opacity: 0;
  animation: fadeUp 0.7s ease both;
}
.gift:nth-child(1) { animation-delay: 0.1s; }
.gift:nth-child(2) { animation-delay: 0.28s; }
.gift:nth-child(3) { animation-delay: 0.46s; }

/* Softer, glowing focus states on text inputs */
#password-input:focus,
.gift-question input:focus {
  box-shadow: 0 0 0 3px rgba(126, 232, 196, 0.15);
}

/* Small ornamental dividers under section headings */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 4px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  height: 1px;
  width: 42px;
  background: var(--line);
}

.section-divider span {
  color: var(--rose);
  font-size: 12px;
}

/* Subtle glow pulse behind the eyebrow labels for a little extra life */
.eyebrow {
  position: relative;
}

/* ---------- FINAL SCREEN: BOOK GIFT ---------- */
.final-gift-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--mist);
  padding: 12px 22px;
  margin-top: 40px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.final-gift-trigger:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.final-gift-trigger::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
  z-index: -1;
}

.final-gift-trigger:hover::before {
  left: 130%;
}

.final-gift-trigger.hidden {
  display: none;
}

.final-gift-panel {
  max-width: 420px;
  width: 100%;
  margin-top: 24px;
}

.final-gift-reveal {
  animation: fadeUp 0.7s ease both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.book-cover-img {
  width: 100%;
  max-width: 220px;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: block;
}
