* { box-sizing: border-box; }

body{
  margin:0;
  overflow:hidden;
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  text-align:center;
  color:white;
}

.wrap{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.card{
  width: min(520px, 92vw);
  border-radius: 26px;
  padding: 22px 18px;
  background: rgba(255,255,255,0.12);
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
  backdrop-filter: blur(8px);
}

h1{
  margin: 0 0 12px 0;
  font-size: 28px;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.sub{
  margin: 0 0 18px 0;
  font-size: 16px;
  opacity: .95;
}

.screen{ display:none; }
.screen.active{ display:block; }

/* Buttons */
.btn{
  padding: 14px 26px;
  font-size: 18px;
  border: none;
  border-radius: 999px;
  cursor:pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  will-change: transform;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btnRow{
  display:flex;
  gap: 12px;
  justify-content:center;
  align-items:center;
  flex-wrap: wrap;
}

.btn.primary, .btn.yes{
  background: white;
  color: #ff4e88;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.btn.no{
  background: #ff4e88;
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  position: relative;
}

.message{
  display:none;
  margin-top: 18px;
  font-size: 24px;
  line-height: 1.25;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* Envelope */
.envelopeWrap{
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px 0 6px;
}

.envelope{
  width: 290px;
  height: 190px;
  position: relative;
  cursor: pointer;
  user-select: none;
  transform: translateZ(0);
}

.env-back{
  position:absolute; inset:0;
  background: rgba(255,255,255,0.18);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.14);
}

.env-front{
  position:absolute; left:0; right:0; bottom:0;
  height: 72%;
  background: rgba(255,255,255,0.22);
  border-radius: 0 0 18px 18px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.env-flap{
  position:absolute; left:0; right:0; top:0;
  height: 60%;
  background: rgba(255,255,255,0.28);
  border-radius: 18px 18px 0 0;
  transform-origin: top center;
  transform: rotateX(0deg);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 0.5s ease;
}

.env-heart{
  position:absolute;
  left:50%; top:60%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  text-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

.env-hint{
  position:absolute;
  left:50%; bottom: 10px;
  transform: translateX(-50%);
  font-size: 14px;
  opacity: .9;
}

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

/* Letter */
.letter{
  margin: 10px auto 16px;
  width: min(420px, 88vw);
  background: rgba(255,255,255,0.20);
  border-radius: 20px;
  padding: 16px 16px;
  text-align: left;
  box-shadow: 0 16px 50px rgba(0,0,0,0.12);
}

.letter-title{
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 700;
}

.letter-body{
  margin: 0 0 12px 0;
  line-height: 1.55;
  font-size: 16px;
}

.letter-sign{
  margin: 0;
  text-align: right;
  opacity: .95;
  font-weight: 700;
}

/* Floating hearts */
.heart{
  position: fixed;
  top: -10vh;
  pointer-events: none;
  animation: fall linear forwards;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.10));
}

@keyframes fall{
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(110vh); opacity: 0; }
}

/* Confetti */
.confetti{
  position: fixed;
  top: -10vh;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall{
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(120vh) rotate(360deg); opacity: 0; }
}

/* Mobile */
@media (max-width: 480px){
  h1{ font-size: 26px; }
  .sub{ font-size: 15px; }

  .btnRow{
    flex-direction: column;
    gap: 12px;
  }

  .btn{
    width: 86vw;
    max-width: 360px;
    padding: 14px 0;
  }
}
