:root{
  --pink-light:#ffe3ee;
  --pink-mid:#ffc2d9;
  --pink-deep:#ff8fb3;
  --red-accent:#e8405f;
  --gold:#b8914a;
  --ink:#4a2e36;
  --white:#ffffff;
  --frame-bg:#ffd9e8;
  --radius-lg:22px;
  --radius-pill:999px;
}

*{box-sizing:border-box;}

html,body{
  height:100%;
  margin:0;
}

body{
  font-family:'Playfair Display', Georgia, serif;
  background:linear-gradient(135deg, var(--pink-light) 0%, var(--pink-mid) 55%, var(--pink-deep) 100%);
  color:var(--ink);
  min-height:100svh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(10px, 2.5vw, 28px);
  position:relative;
  overflow:hidden;
}

/* ---------- Floating hearts background ---------- */

.hearts-bg{
  position:fixed;
  inset:0;
  overflow:hidden;
  pointer-events:none;
  z-index:0;
}

.hearts-bg .heart{
  position:absolute;
  bottom:-10vh;
  font-size:1.4rem;
  line-height:1;
  opacity:0;
  animation-name:float-heart;
  animation-timing-function:ease-in;
  animation-iteration-count:infinite;
  will-change:transform, opacity;
}

.hearts-bg .heart.white{ color:#ffffff; text-shadow:0 0 6px rgba(255,255,255,0.6); }
.hearts-bg .heart.pink{ color:var(--pink-deep); }
.hearts-bg .heart.red{ color:var(--red-accent); }

@keyframes float-heart{
  0%{
    transform:translate(0, 0) rotate(0deg);
    opacity:0;
  }
  8%{
    opacity:0.85;
  }
  50%{
    transform:translate(var(--drift, 20px), -55vh) rotate(var(--spin, 12deg));
  }
  92%{
    opacity:0.7;
  }
  100%{
    transform:translate(calc(var(--drift, 20px) * 2), -110vh) rotate(calc(var(--spin, 12deg) * 2));
    opacity:0;
  }
}

.page{
  position:relative;
  z-index:1;
  width:100%;
  max-width:1400px;
  height:min(94svh, 980px);
  background:rgba(255,255,255,0.35);
  border:1px solid rgba(255,255,255,0.6);
  border-radius:calc(var(--radius-lg) + 6px);
  box-shadow:0 20px 60px rgba(160, 60, 95, 0.18);
  display:flex;
  flex-direction:column;
  padding:clamp(10px, 1.6vw, 22px) clamp(14px, 2.4vw, 32px);
  gap:clamp(6px, 1.2vh, 14px);
}

/* ---------- Header ---------- */

.hero-header{
  text-align:center;
  flex:0 0 auto;
}

.title{
  margin:0;
  font-weight:700;
  font-size:clamp(1.6rem, 3.4vw, 2.7rem);
  color:var(--red-accent);
  letter-spacing:0.5px;
}

.title .amp{
  font-style:italic;
  color:var(--gold);
}

.subtitle{
  margin:2px 0 0;
  font-style:italic;
  font-size:clamp(0.85rem, 1.5vw, 1.1rem);
  color:var(--ink);
  opacity:0.75;
}

/* ---------- Stage / photo frame ---------- */

.stage{
  flex:1 1 auto;
  min-height:0;
  display:flex;
}

.frame{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  background:var(--frame-bg);
  border-radius:var(--radius-lg);
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(184,145,74,0.15), 0 8px 30px rgba(0,0,0,0.08);
}

.main-image{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  background:var(--frame-bg);
  opacity:0;
  transition:opacity 0.6s ease;
}

.main-image.visible{
  opacity:1;
}

.loading-msg{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-style:italic;
  color:#9a7b84;
  font-size:1.1rem;
  text-align:center;
  padding:20px;
}

.loading-msg.hidden{
  display:none;
}

.counter{
  position:absolute;
  right:clamp(10px, 2vw, 20px);
  bottom:clamp(10px, 2vw, 20px);
  background:rgba(255,255,255,0.92);
  color:var(--red-accent);
  font-weight:700;
  font-size:clamp(0.8rem, 1.3vw, 1rem);
  padding:7px 16px;
  border-radius:var(--radius-pill);
  box-shadow:0 4px 14px rgba(0,0,0,0.12);
  font-family:'Playfair Display', Georgia, serif;
}

/* ---------- Controls ---------- */

.controls{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(8px, 1.6vw, 16px);
  flex-wrap:wrap;
  padding-top:4px;
}

.ctrl-btn{
  font-family:'Playfair Display', Georgia, serif;
  border:none;
  cursor:pointer;
  background:var(--red-accent);
  color:#fff;
  font-size:clamp(0.85rem, 1.5vw, 1rem);
  font-weight:600;
  border-radius:var(--radius-pill);
  padding:12px 22px;
  box-shadow:0 6px 16px rgba(232,64,95,0.35);
  transition:transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space:nowrap;
}

.ctrl-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 9px 20px rgba(232,64,95,0.42);
}

.ctrl-btn:active{
  transform:translateY(0);
}

.ctrl-btn.primary-btn{
  min-width:150px;
}

.ctrl-btn.nav-btn{
  background:#ffffff;
  color:var(--red-accent);
  width:44px;
  height:44px;
  min-width:44px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.4rem;
  box-shadow:0 4px 14px rgba(0,0,0,0.12);
}

.ctrl-btn.mute-btn{
  background:#ffffff;
  color:var(--red-accent);
  width:44px;
  height:44px;
  min-width:44px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:1.2rem;
  box-shadow:0 4px 14px rgba(0,0,0,0.12);
}

.ctrl-btn.muted{
  background:#efe3e6;
  color:#b08b93;
}

.ctrl-btn.is-playing{
  background:#c82e4c;
}

/* ---------- Responsive / mobile ---------- */

@media (max-width: 760px){
  body{
    padding:8px;
  }
  .page{
    height:100svh;
    border-radius:16px;
    padding:10px 10px 14px;
    gap:6px;
  }
  .title{
    font-size:1.5rem;
  }
  .subtitle{
    font-size:0.75rem;
  }
  .counter{
    font-size:0.75rem;
    padding:5px 12px;
    bottom:8px;
    right:8px;
  }
  .controls{
    gap:8px;
  }
  .ctrl-btn.primary-btn{
    min-width:0;
    padding:11px 16px;
    font-size:0.8rem;
  }
  .ctrl-btn.nav-btn,
  .ctrl-btn.mute-btn{
    width:40px;
    height:40px;
    min-width:40px;
  }
}

@media (max-width: 420px){
  .controls{
    order:1;
  }
  .ctrl-btn.primary-btn span{
    display:inline;
  }
}
