
/* =========================
   style.css (UPDATED)
   - Keeps same background for all screens
   - Fixes Screen 4 letter overflow (scroll inside letter)
   - Fixes Screen 5 reveal card to look like Screen 2 (card style)
   - Keeps gift hint visible (subtitle)
   ========================= */

/* --------- Global Reset --------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", Arial, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden; /* No page scrolling */
}

/* Same background for ALL screens */
body {
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
}

/* --------- Screen System --------- */
.app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(1.01);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* --------- Shared Layout --------- */
.wrap {
  width: min(1000px, 95vw);
  text-align: center;
  padding: 0 12px;
}

.title {
  font-size: 2.35rem;
  margin-bottom: 8px;
  color: #ffffff;
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.subtitle {
  margin-bottom: 26px;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.tiny-note {
  margin-top: 14px;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

/* --------- Buttons --------- */
.btn, .start-btn, .continue {
  background: #ffffff;
  color: #ff5e7e;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover, .start-btn:hover, .continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.btn.secondary {
  background: rgba(255,255,255,0.28);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.35);
}

.start-btn {
  padding: 14px 32px;
  min-width: 300px;
  font-size: 16px;
}

/* Only show when needed */
.continue {
  display: none;
  margin-top: 20px;
  padding: 14px 26px;
  font-size: 16px;
}

/* --------- Animations helpers --------- */
.fade { animation: fadeAnim 0.28s ease; }
@keyframes fadeAnim {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pulse { animation: pulseAnim 0.65s ease; }
@keyframes pulseAnim {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.pop { animation: popAnim 0.35s ease; }
@keyframes popAnim {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================
   SCREEN 1: HERO (FULL FIX for image hearts)
   ========================= */
#screen-hero {
  text-align: center;
  position: relative; /* ensure hearts layer positions correctly */
}

/* hearts layer behind content */
.hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* hero content above hearts */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  padding: 20px;
}

/* --------- IMAGE HEARTS (images/hearts.png) --------- */
/* This is the element you create in JS: class="heart heart--img" */
.heart.heart--img {
  position: absolute;
  bottom: -18vh;               /* start below */
  background-image: none;      /* JS will set background-image inline */
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  /* IMPORTANT: don't force background to transparent with !important */
  /* Let JS background-image show */

  pointer-events: none;
  will-change: transform, opacity;

  /* Use a transform animation that doesn't fight with "transform:none" */
  animation-name: floatImg;
  animation-timing-function: linear;
  animation-iteration-count: 1; /* JS removes element after duration */
}

/* Disable the old CSS heart shape circles only for image hearts */
.heart.heart--img::before,
.heart.heart--img::after {
  content: none !important;
  display: none !important;
}

/* Float up smoothly */
@keyframes floatImg {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(-130vh); opacity: 0; }
}

/* --------- (Optional) keep your old CSS hearts available (not used now) --------- */
.heart:not(.heart--img) {
  position: absolute;
  width: 15px;
  height: 15px;
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(45deg);
  opacity: 0.7;
  animation: float 6s linear infinite;
}

.heart:not(.heart--img)::before,
.heart:not(.heart--img)::after {
  content: "";
  position: absolute;
  width: var(--s, 15px);
  height: var(--s, 15px);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}
.heart:not(.heart--img)::before { top: -7px; left: 0; }
.heart:not(.heart--img)::after  { left: -7px; top: 0; }

@keyframes float {
  0%   { transform: translateY(110vh) rotate(45deg); opacity: 0; }
  50%  { opacity: 0.8; }
  100% { transform: translateY(-15vh) rotate(45deg); opacity: 0; }
}

/* --------- Hero text --------- */
.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 18px;
  color: #111;
  text-shadow: 0 12px 40px rgba(0,0,0,0.10);
}

.typing {
  font-size: 1.2rem;
  min-height: 42px;
}


/* =========================
   SCREEN 2: WHY CARDS
   ========================= */
.card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;

  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.12);
}

.polaroid {
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 14px 14px 18px;
  transform: rotate(-1.2deg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.polaroid img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: #fff;
}

.caption {
  margin-top: 10px;
  color: #ff5e7e;
  font-weight: 900;
  font-size: 0.98rem;
}

.cardText {
  text-align: left;
  padding: 6px 6px;
}

.line {
  font-size: 1.35rem;
  line-height: 1.5;
  font-weight: 900;
  color: #ffffff;
  min-height: 92px;
  margin-bottom: 16px;
  text-shadow: 0 12px 40px rgba(0,0,0,0.10);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.22);
}

.bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  transition: width 0.35s ease;
}

.count {
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  white-space: nowrap;
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* =========================
   SCREEN 3: MEMORIES
   ========================= */
.mem-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.mem-item{
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 12px 12px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  transform: rotate(calc(var(--r, 0) * 1deg));
}

.mem-item:hover{
  transform: translateY(-3px) scale(1.02) rotate(calc(var(--r, 0) * 1deg));
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

.mem-item img{
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: #fff;
}

.mem-item .caption{
  margin-top: 10px;
  color: #ff5e7e;
  font-weight: 900;
  font-size: 0.95rem;
  text-align: center;
}

.mem-actions{
  display:flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.show{
  display:flex;
}

.modal-card{
  width: min(760px, 95vw);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 22px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 70px rgba(0,0,0,0.22);
  padding: 18px;
  position: relative;
  color: #fff;
  animation: popAnim 0.35s ease;
}

.modal-close{
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.modal-polaroid{
  background: rgba(255,255,255,0.95);
  border-radius: 18px;
  padding: 12px 12px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-polaroid img{
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 14px;
  display:block;
  background:#fff;
}

.modal-caption{
  margin-top: 10px;
  color: #ff5e7e;
  font-weight: 900;
  text-align:center;
}

.modal-text{
  margin: 14px 6px 0;
  font-size: 1.15rem;
  line-height: 1.55;
  font-weight: 800;
  text-shadow: 0 12px 40px rgba(0,0,0,0.10);
}

/* =========================
   SCREEN 4: LOVE LETTER (scroll INSIDE)
   ========================= */
.envelope{
  position: relative;
  width: min(640px, 94vw);
  height: 420px;
  margin: 10px auto 0;
  border-radius: 22px;
}

.env-body{
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  border-radius: 22px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.14);
  overflow: hidden;
}

.env-top{
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 55%;
  background: rgba(255,255,255,0.96);
  clip-path: polygon(0 0, 100% 0, 50% 75%);
  transform-origin: top;
  transition: transform 0.6s ease;
  z-index: 3;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.letter{
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 92%;
  height: 84%;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.12);
  padding: 14px 14px 12px;
  z-index: 2;

  display: flex;
  flex-direction: column;

  transform: translateX(-50%) translateY(40px);
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.letter-head{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
  color: #ff5e7e;
  margin-bottom: 10px;
}

.letter-date{
  opacity: 0.85;
  font-weight: 800;
  font-size: 0.95rem;
}

.letter-content{
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;

  color: #111;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.65;

  white-space: pre-line;
  text-align: left;
}

.letter-footer{
  margin-top: 10px;
  display:flex;
  justify-content: flex-end;
}

.letter-sign{
  font-weight: 900;
  color: #ff5e7e;
}

.letter-actions{
  display:flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.envelope.open .env-top{
  transform: rotateX(180deg);
}

.envelope.open .letter{
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cursor{
  display:inline-block;
  width: 10px;
  animation: blink 0.7s infinite;
  color: #ff5e7e;
  font-weight: 900;
}

@keyframes blink{
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* =========================
   SCREEN 5: SURPRISE (Gift + Reveal)
   ========================= */
.gift-area{
  margin-top: 6px;
  display:flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* Gift */
.gift{
  position: relative;
  width: 220px;
  height: 220px;
  cursor: pointer;
  outline: none;
  transform: translateZ(0);
}

.gift-box{
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 200px;
  height: 145px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 55px rgba(0,0,0,0.14);
}

.gift-lid{
  position: absolute;
  left: 50%;
  top: 35px;
  transform: translateX(-50%);
  width: 210px;
  height: 70px;
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 18px 55px rgba(0,0,0,0.12);
  transition: transform 0.7s ease;
  transform-origin: center bottom;
}

.gift-bow{
  position: absolute;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  width: 160px;
  height: 90px;
  pointer-events: none;
}

.bow-left, .bow-right{
  position: absolute;
  top: 18px;
  width: 70px;
  height: 45px;
  border-radius: 999px;
  background: rgba(255,255,255,0.90);
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.bow-left{ left: 6px; transform: rotate(-12deg); }
.bow-right{ right: 6px; transform: rotate(12deg); }

.bow-center{
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.gift.open .gift-lid{
  transform: translateX(-50%) translateY(-60px) rotate(-18deg);
}

/* Reveal wrapper (hidden until opened) */
.reveal{
  width: min(1000px, 95vw);
  border-radius: 22px;
  padding: 22px;
  color: #fff;

  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.12);

  display: none;
  text-align: center;
}

.reveal.show{
  display:block;
  animation: popAnim 0.35s ease;
}

.final-title{
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 0 12px 40px rgba(0,0,0,0.10);
}

.final-text{
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.6;
  text-shadow: 0 12px 40px rgba(0,0,0,0.10);
  margin-bottom: 16px;
}

.final-actions{
  display:flex;
  justify-content: center;
  gap: 12px;
}

/* =========================
   Screens 6-9: glass blocks
   ========================= */
.glass, .play-card{
  width:min(760px,95vw);
  background:rgba(255,255,255,0.16);
  border:1px solid rgba(255,255,255,0.22);
  border-radius:22px;
  padding:18px;
  backdrop-filter: blur(10px);
  box-shadow:0 18px 55px rgba(0,0,0,0.12);
  color:#fff;
  margin: 0 auto;
}

.big-q{
  font-size:1.8rem;
  font-weight:900;
  margin-bottom: 14px;
  text-shadow:0 12px 40px rgba(0,0,0,0.10);
}

.play-area{
  position: relative;
  width: min(520px, 90vw);
  height: 160px;
  margin: 10px auto 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
}

.play-area.center{ height:auto; padding: 6px 0; }

.btn.yes{ background:#fff; color:#ff5e7e; }

.btn.no{
  position:absolute;
  right: 12px;
  top: 60px;
}

.result{
  margin-top: 14px;
  font-weight:900;
  font-size:1.12rem;
}

/* --------- Responsive --------- */
@media (max-width: 860px) {
  .hero-content h1 { font-size: 2.3rem; }
  .typing { font-size: 1.05rem; }

  .card { grid-template-columns: 1fr; }
  .polaroid img { height: 260px; }
  .cardText { text-align: center; }
  .actions { justify-content: center; }

  .mem-grid{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px){
  .mem-grid{ grid-template-columns: 1fr; }
  .mem-item img{ height: 220px; }
  .modal-polaroid img{ height: 260px; }
  .letter-content{ font-size: 1.0rem; }
}



/* =========================
   Screen 6 Valentine — force playful effects to win
   ========================= */

#screen-valentine #valYes{
  /* pulse should be visible even with global .btn styles */
  animation: yesPulse 2s infinite;
}

@keyframes yesPulse {
  0%,100% { box-shadow: 0 0 0 rgba(255,105,150,0); }
  50%     { box-shadow: 0 0 25px rgba(255,105,150,0.6); }
}

/* IMPORTANT: global .btn:hover overrides transform, so we override with higher specificity + !important */
#screen-valentine #valYes:hover{
  transform: translateY(-2px) scale(1.1) !important;
  box-shadow: 0 0 25px rgba(255,105,150,0.6), 0 12px 28px rgba(0,0,0,0.12) !important;
}

/* Cursor (better cross-browser) */
#screen-valentine{
  cursor: url("images/hearts.png") 16 16, auto;
}








/* =========================
   Screen 7 Celebration GIF
   ========================= 
.celebrate{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
}

.celebrate-gif{
  width: min(360px, 70vw);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.14);
  border: 1px solid rgba(255,255,255,0.25);
}

.small-head{
  font-size: 1.05rem;
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}*/


/* =========================
   Screen 7: Split Layout + Countdown
   ========================= */

/* hearts layer inside screen 7 */
.hearts--hurrah{
  position:absolute;
  inset:0;
  overflow:hidden;
  pointer-events:none;
  z-index: 0;
}

#screen-hurrah .wrap{
  position:relative;
  z-index: 1;
}

.hurrah-layout{
  width: min(1000px, 95vw);
  display:flex;
  gap: 22px;
  align-items: center; /* vertical center */
  justify-content: center;
  margin: 0 auto 18px;
}

.hurrah-left{
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
}

.hurrah-img{
  width: min(420px, 42vw);
  max-height: 70vh;
  height: auto;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 18px 55px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.25);
}

.hurrah-right{
  flex: 1;
  text-align: left;
}

.hurrah-title{
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  margin: 8px 0 8px;
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.hurrah-desc{
  color: rgba(255,255,255,0.95);
  font-weight: 800;
  line-height: 1.6;
  margin-bottom: 16px;
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.countdown-box{
  width: min(440px, 95%);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.12);
}

.countdown-label{
  font-weight: 900;
  color: rgba(255,255,255,0.95);
  margin-bottom: 6px;
}

.countdown-time{
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
  text-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.countdown-time .sec{
  font-size: 1.3rem;
  font-weight: 900;
  opacity: 0.9;
  margin-left: 6px;
}

.countdown-sub{
  font-weight: 900;
  color: rgba(255,255,255,0.92);
}

/* Responsive: stack on mobile */
@media (max-width: 860px){
  .hurrah-layout{
    flex-direction: column;
    text-align:center;
  }
  .hurrah-right{
    text-align:center;
  }
  .hurrah-img{
    width: min(520px, 92vw);
    max-height: 52vh;
  }
  .countdown-box{
    margin: 0 auto;
  }
}

/* Force-hide utility (prevents showing before timer ends) */
.hidden{
  display: none !important;
}

.hidden.show{
  display: block !important;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Screen 7 hearts always on top */
.hearts--hurrah{
  z-index: 2 !important;
  opacity: 1;
}

#screen-hurrah .wrap{
  z-index: 3;
}


/* =========================
   Floating Roses (Final Screen)
   ========================= */

.rose-float {
  position: absolute;
  bottom: -20vh;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 0;
  animation-name: floatRose;
  animation-timing-function: linear;
  animation-iteration-count: 1;
}

@keyframes floatRose {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(-130vh); opacity: 0; }
}
