:root{
  --bg1:#fff5fb;
  --bg2:#ffe9f3;
  --card:#ffffffcc;
  --text:#2a2230;
  --accent:#ff4d8d;
  --yes:#22c55e;
  --no:#ef4444;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  min-height:100vh;
  display:grid;
  place-items:center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 600px at 20% 20%, var(--bg2), transparent),
              radial-gradient(900px 500px at 80% 30%, #fff0f7, transparent),
              linear-gradient(180deg, var(--bg1), #fff);
  overflow:hidden;
}

.bg-hearts{
  position:fixed; inset:0;
  pointer-events:none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,77,141,.15) 0 10px, transparent 11px),
    radial-gradient(circle at 70% 10%, rgba(255,77,141,.12) 0 8px, transparent 9px),
    radial-gradient(circle at 90% 60%, rgba(255,77,141,.10) 0 9px, transparent 10px),
    radial-gradient(circle at 30% 80%, rgba(255,77,141,.10) 0 7px, transparent 8px);
  filter: blur(0.2px);
  animation: floatBg 8s ease-in-out infinite;
}
@keyframes floatBg{
  0%,100%{ transform: translateY(0px); }
  50%{ transform: translateY(-10px); }
}

.card{
  width:min(920px, 92vw);
  background:var(--card);
  border:1px solid rgba(255,77,141,.25);
  border-radius:24px;
  padding:28px 22px;
  box-shadow: 0 18px 60px rgba(0,0,0,.12);
  backdrop-filter: blur(8px);
  position:relative;
}

h1{
  margin:0 0 10px;
  font-size: clamp(26px, 4vw, 44px);
  line-height:1.05;
}
.accent{ color:var(--accent); }

.subtitle{
  margin:0 0 16px;
  font-size: clamp(14px, 2vw, 18px);
  opacity:.9;
}

.media{
  width:100%;
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(0,0,0,.06);
  background:#fff;
}
video{
  width:100%;
  display:block;
  max-height: 420px;
  object-fit: cover;
}

.actions{
  margin-top:16px;
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
  position:relative;
}

.btn{
  border:0;
  padding:12px 18px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  transition: transform .12s ease, filter .12s ease;
  font-size:16px;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}
.btn:hover{ transform: translateY(-1px) scale(1.02); }
.btn:active{ transform: translateY(1px) scale(.98); }

.yes{ background: rgba(34,197,94,.95); color:#06210f; }
.no{ background: rgba(239,68,68,.92); color:#2a0505; }

.hint{
  margin:12px 0 0;
  text-align:center;
  opacity:.7;
  font-size:14px;
}

.hidden{ display:none; }

.celebrate{
  margin-top:18px;
  text-align:center;
  padding:18px;
  border-radius:18px;
  background: rgba(255,255,255,.7);
  border:1px dashed rgba(255,77,141,.35);
}

.bouquet-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  flex-wrap:wrap;
}

/* Better Bouquet */
.bouquet {
  width: 180px;
  height: 200px;
  position: relative;
}

.stem {
  position: absolute;
  width: 12px;
  height: 130px;
  background: linear-gradient(#2ea44f, #1f7a3a);
  border-radius: 10px;
  bottom: 10px;
  left: 84px;
  transform: rotate(-6deg);
}

.stem.s2 { left: 70px; transform: rotate(6deg); height: 120px; }
.stem.s3 { left: 98px; transform: rotate(-2deg); height: 135px; }

/* Flower petals */
.flower {
  position: absolute;
  width: 70px;
  height: 70px;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,.15));
}

.flower span {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 40%, #fff, #ff9ec9 55%, #ff2e6a 100%);
  border-radius: 50%;
}

.flower::before,
.flower::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 40% 40%, #fff, #ff9ec9 55%, #ff2e6a 100%);
  border-radius: 50%;
  transform: rotate(45deg);
  opacity: 0.95;
}

.flower::after { transform: rotate(-45deg); }

.f1 { left: 10px; top: 10px; }
.f2 { left: 55px; top: -5px; transform: scale(1.1); }
.f3 { left: 100px; top: 15px; }

/* Bouquet wrap */
.wrap {
  position: absolute;
  width: 150px;
  height: 90px;
  bottom: 0;
  left: 15px;
  background: linear-gradient(135deg, #ff7aa8, #ff2e6a);
  border-radius: 20px 20px 30px 30px;
  box-shadow: 0 15px 30px rgba(0,0,0,.15);
}

.wrap::before {
  content: "";
  position: absolute;
  width: 60px;
  height: 30px;
  background: #fff;
  border-radius: 999px;
  left: 45px;
  top: 30px;
  opacity: 0.4;
}


/* White heart */
.heart{
  position:relative;
  width:160px;
  display:grid;
  place-items:center;
  gap:8px;
}
/* Red Heart */
.heart-red {
  width: 100px;
  height: 100px;
  background: #ff1e3c;
  position: relative;
  transform: rotate(45deg);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(255, 0, 60, 0.4);
  animation: heartPop 0.6s ease forwards;
}

.heart-red::before,
.heart-red::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  background: #ff1e3c;
  border-radius: 50%;
}

.heart-red::before {
  left: -50px;
  top: 0;
}

.heart-red::after {
  top: -50px;
  left: 0;
}

@keyframes heartPop {
  from { transform: rotate(45deg) scale(0.6); opacity: 0; }
  to { transform: rotate(45deg) scale(1); opacity: 1; }
}


.yes-text{
  margin:0;
  font-weight:900;
  color:var(--accent);
  letter-spacing:.5px;
}

.final-msg{
  margin:12px 0 0;
  font-size:18px;
  font-weight:700;
}

/* Modal */
.modal{
  position:fixed; inset:0;
  display:grid;
  place-items:center;
  background: rgba(0,0,0,.25);
  padding:18px;
}
.modal-box{
  width:min(420px, 92vw);
  background:#fff;
  border-radius:18px;
  padding:18px;
  box-shadow: 0 20px 70px rgba(0,0,0,.25);
  border:1px solid rgba(255,77,141,.25);
}
/* Force hidden to win for the modal */
.modal.hidden {
  display: none !important;
}

.modal-box h2{ margin:0 0 8px; }
.modal-box p{ margin:0 0 14px; opacity:.9; }
.modal-actions{ display:flex; justify-content:flex-end; }
.small{ padding:10px 14px; font-size:14px; }

.gif{
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  border-radius: 18px;
  display: block;
}


/* Cover screen */
.envelope-screen{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  background: radial-gradient(900px 500px at 50% 30%, rgba(255,255,255,.65), transparent),
              rgba(0,0,0,.15);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.envelope-screen.fade-out{
  animation: fadeOut .5s ease forwards;
}
@keyframes fadeOut{
  to{ opacity:0; transform: translateY(-6px); pointer-events:none; }
}

.open-btn{
  padding: 14px 22px;
  font-size: 16px;
}

.open-hint{
  margin: 0;
  opacity: .85;
  font-size: 14px;
  text-align: center;
}

/* Envelope */
.envelope{
  width: min(360px, 84vw);
  height: 220px;
  position: relative;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.22));
}

.env-back{
  position:absolute; inset:0;
  background: #ffd6e6;
  border-radius: 18px;
  border: 1px solid rgba(255,77,141,.25);
}

.env-front{
  position:absolute; inset:0;
  background: linear-gradient(135deg, #ffc1da, #ff9fc6);
  border-radius: 18px;
  clip-path: polygon(0 100%, 50% 52%, 100% 100%, 100% 0, 0 0);
  border: 1px solid rgba(255,77,141,.22);
}

.env-flap{
  position:absolute; inset:0;
  background: linear-gradient(135deg, #ff93be, #ff6aa6);
  border-radius: 18px;
  clip-path: polygon(0 0, 100% 0, 50% 55%);
  transform-origin: top;
  transform: rotateX(0deg);
  transition: transform .55s ease;
  border: 1px solid rgba(255,77,141,.18);
}

.env-paper{
  position:absolute;
  left: 18px; right: 18px;
  bottom: 16px;
  height: 160px;
  background: rgba(255,255,255,.92);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.06);
  display:grid;
  place-items:center;
  transform: translateY(30px);
  transition: transform .55s ease;
}

.paper-text{
  margin:0;
  font-weight:800;
  color: rgba(42,34,48,.9);
}

/* Open animation state */
.envelope.open .env-flap{
  transform: rotateX(160deg);
}
.envelope.open .env-paper{
  transform: translateY(-12px);
}

.hidden{ display:none; }