:root {
  --ink: #34202a;
  --muted: #7d5a67;
  --paper: #fff8f9;
  --paper-soft: #ffeef2;
  --rose: #e91f55;
  --rose-dark: #97082d;
  --wine: #7e3f55;
  --plum: #3d1e34;
  --gold: #d7a75f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #7f3d56;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 221, 229, 0.42), transparent 18rem),
    radial-gradient(circle at 86% 18%, rgba(255, 190, 206, 0.28), transparent 20rem),
    linear-gradient(135deg, #8a3f5c, #502741 48%, #2f1a30);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.34;
  background-image:
    radial-gradient(circle at 28px 28px, transparent 25px, rgba(255, 255, 255, 0.42) 26px, transparent 28px),
    radial-gradient(circle at 78px 28px, transparent 25px, rgba(255, 255, 255, 0.42) 26px, transparent 28px),
    linear-gradient(135deg, transparent 39px, rgba(255, 255, 255, 0.35) 40px, transparent 43px),
    linear-gradient(45deg, transparent 39px, rgba(255, 255, 255, 0.35) 40px, transparent 43px);
  background-size: 106px 96px;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 86%, transparent);
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  place-items: center;
}

.unlock-screen {
  width: min(100%, 32rem);
  animation: rise-in 700ms ease both;
}

.unlock-panel,
.love-card {
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 246, 248, 0.96));
  box-shadow:
    0 1.6rem 4rem rgba(25, 3, 16, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.unlock-panel {
  padding: clamp(1.4rem, 6vw, 2.6rem);
  text-align: center;
}

.from-line,
.card-from {
  margin: 0;
  color: var(--rose-dark);
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0.35rem 0 0.55rem;
  color: var(--plum);
  font-size: clamp(2.25rem, 10vw, 4.1rem);
  line-height: 0.95;
}

.unlock-copy {
  width: min(23rem, 100%);
  margin: 0 auto 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.heart-button {
  width: min(15rem, 70vw);
  aspect-ratio: 1.08;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.heart-button:hover,
.heart-button:focus-visible {
  filter: brightness(1.04);
  transform: translateY(-2px) scale(1.025);
  outline: 0;
}

.heart-button:active {
  transform: translateY(2px) scale(0.975);
}

.heart-button:disabled {
  cursor: default;
}

.heart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.heart-base {
  fill: url("#emptyHeart");
  filter: url("#heartShadow");
}

.heart-fill {
  fill: url("#fullHeart");
  transition: y 240ms ease, height 240ms ease;
}

.heart-outline {
  fill: none;
  stroke: rgba(69, 16, 34, 0.86);
  stroke-width: 4.2;
  stroke-linejoin: round;
}

.heart-shine {
  fill: none;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-linecap: round;
  stroke-width: 6;
}

.progress-wrap {
  width: min(18rem, 100%);
  height: 0.48rem;
  margin: 0.75rem auto 0.7rem;
  border-radius: 999px;
  background: rgba(125, 67, 85, 0.15);
  overflow: hidden;
}

.progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9aae, var(--rose), var(--rose-dark));
  transition: width 240ms ease;
}

.tap-note {
  min-height: 1.25rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card-stage {
  width: min(100%, 44rem);
  animation: card-open 800ms cubic-bezier(.2, .75, .2, 1) both;
}

.is-hidden {
  display: none;
}

.love-card {
  padding: clamp(1rem, 4vw, 1.5rem);
  text-align: center;
}

.song-frame {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 14px;
  background: #24161f;
  color: #fff;
  box-shadow: 0 0.7rem 1.4rem rgba(71, 12, 33, 0.18);
}

.song-heading {
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.song-volume {
  color: #ffe4eb;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.88;
}

.player-box {
  position: relative;
  width: min(100%, 38rem);
  margin: 0 auto;
  min-height: 12rem;
  max-height: 72vh;
  aspect-ratio: var(--video-ratio, 16 / 9);
  background: #160d14;
  overflow: hidden;
}

.player-box.is-portrait {
  width: min(100%, 24rem);
}

.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #160d14;
}

.photo-frame {
  margin: 0 auto 1.05rem;
  overflow: hidden;
  border-radius: 16px;
  background: #1f171d;
  box-shadow: 0 0.8rem 2rem rgba(69, 12, 32, 0.18);
}

.photo-frame img {
  width: 100%;
  max-height: min(68vh, 38rem);
  display: block;
  object-fit: cover;
  object-position: center 38%;
}

.photo-frame figcaption {
  padding: 0.75rem 1rem;
  color: #fff6f8;
  font-size: 1rem;
  font-style: italic;
  background: linear-gradient(90deg, #3b1f32, #7d2442);
}

.card-from {
  margin: 0.55rem 0 0.9rem;
  font-size: 1.05rem;
}

.letter {
  width: min(100%, 34rem);
  margin: 0 auto;
  color: #37232c;
  font-size: clamp(1rem, 2.35vw, 1.12rem);
  line-height: 1.35;
}

.letter p {
  margin: 0 0 0.7rem;
}

.letter .closing {
  margin: 1rem 0 0.2rem;
  color: var(--rose-dark);
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.45;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(1.2rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes card-open {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 38rem) {
  .page-shell {
    padding: 0.75rem;
  }

  .unlock-panel,
  .love-card {
    border-radius: 14px;
  }

  .song-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.28rem;
  }

  .player-box {
    min-height: 10rem;
  }

  .photo-frame img {
    max-height: 31rem;
  }

  .letter {
    line-height: 1.3;
  }
}
