* {
  box-sizing: border-box;
}

:root {
  --pink: #ff8ab3;
  --rose: #ff4f86;
  --gold: #ffd28a;
  --deep: #120711;
  --paper: #fff7fb;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--paper);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 138, 179, .35), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(255, 210, 138, .25), transparent 28%),
    linear-gradient(135deg, #1a0715, #3a0d25 45%, #170511);
}

.scene {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100vh;
  padding: 28px;
  text-align: center;
}

.stars,
.stars::before,
.stars::after {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255,210,138,.8) 0 1px, transparent 1.8px);
  background-size: 90px 90px, 140px 140px;
  background-position: 0 0, 40px 50px;
  animation: twinkle 5s ease-in-out infinite alternate;
  pointer-events: none;
}

.stars::before {
  opacity: .45;
  transform: scale(1.2);
  animation-duration: 7s;
}

.stars::after {
  opacity: .35;
  transform: scale(.8);
  animation-duration: 4s;
}

@keyframes twinkle {
  from { opacity: .35; }
  to { opacity: .85; }
}

.intro {
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

.tag {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: .24em;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 9vw, 88px);
  line-height: 1;
  text-shadow: 0 12px 35px rgba(0,0,0,.35);
}

.subtitle {
  margin: 16px 0 0;
  color: rgba(255,247,251,.86);
  font-size: clamp(16px, 3.6vw, 22px);
}

.door-wrap {
  position: relative;
  z-index: 2;
  width: min(340px, 72vw);
  height: min(420px, 88vw);
  perspective: 1100px;
}

.glow {
  position: absolute;
  inset: 36px 18px 0;
  border-radius: 48% 48% 20px 20px;
  background: radial-gradient(circle at center, rgba(255,210,138,.75), rgba(255,79,134,.35), transparent 65%);
  filter: blur(20px);
  opacity: .75;
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(.96); opacity: .55; }
  50% { transform: scale(1.04); opacity: .95; }
}

.door {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transform-style: preserve-3d;
}

.door-left,
.door-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255,255,255,.14), transparent 22%),
    linear-gradient(160deg, #ff7aaa, #bf285e 48%, #6b1438);
  border: 2px solid rgba(255,255,255,.18);
  box-shadow:
    inset 0 0 28px rgba(255,255,255,.16),
    0 25px 70px rgba(0,0,0,.38);
  transition: transform 1.2s cubic-bezier(.22, 1, .36, 1), filter 1.2s;
}

.door-left {
  left: 0;
  border-radius: 180px 0 0 18px;
  transform-origin: left center;
}

.door-right {
  right: 0;
  border-radius: 0 180px 18px 0;
  transform-origin: right center;
}

.door-left::before,
.door-right::before {
  content: "";
  position: absolute;
  inset: 28px 18px;
  border: 1px solid rgba(255,255,255,.22);
}

.door-left::before {
  border-radius: 120px 8px 8px 8px;
}

.door-right::before {
  border-radius: 8px 120px 8px 8px;
}

.heart-mark {
  position: absolute;
  top: 45%;
  right: -21px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--gold));
  box-shadow: 0 10px 30px rgba(255,79,134,.55);
  font-size: 22px;
}

.door-handle {
  position: absolute;
  top: 48%;
  left: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(255,210,138,.18), 0 0 24px rgba(255,210,138,.75);
}

.door.open .door-left {
  transform: rotateY(-108deg);
  filter: brightness(1.15);
}

.door.open .door-right {
  transform: rotateY(108deg);
  filter: brightness(1.15);
}

.hint {
  position: relative;
  z-index: 2;
  margin: 28px 0 0;
  color: rgba(255,247,251,.75);
  font-size: 15px;
}

.loading {
  position: fixed;
  left: 50%;
  bottom: 42px;
  z-index: 5;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  padding: 12px 18px;
  border-radius: 999px;
  color: #4a182e;
  background: rgba(255,247,251,.92);
  font-weight: 800;
  transition: .45s ease;
}

.loading.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.float-heart {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  color: rgba(255, 210, 138, .92);
  animation: floatUp 1.8s ease-out forwards;
  text-shadow: 0 0 18px rgba(255,138,179,.9);
}

@keyframes floatUp {
  from {
    transform: translateY(0) scale(.8);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  to {
    transform: translateY(-120px) scale(1.45);
    opacity: 0;
  }
}

@media (max-width: 520px) {
  .door-wrap {
    width: 270px;
    height: 350px;
  }

  .subtitle {
    max-width: 320px;
  }
}
