html {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 20% 10%, #fff1c4 0%, #ffe0a3 18%, #ffb0b0 44%, #ff7a9f 72%, #7b1e3a 100%);
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 确保画布不拦截点击事件 */
  z-index: -9999; /* 将画布置于顶层 */
}

.container {
  height: 100vh;
  width: 100vw;
  margin: 0 auto;
  text-align: center;
  visibility: hidden;
  position: relative;
  overflow: hidden;
}

.container div.six {
  top: 15vh;
  z-index: 1;
}

.container div.seven,
.container div.eight {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
}

.container > div {
  position: absolute;
  left: 0;
  right: 0;
  top: 20vh;
}

.one {
  font-size: 4.5rem;
}

.one > img {
  vertical-align: middle;
  margin-bottom: 10px;
  max-width: 100%;
  height: auto;
}

.two {
  font-size: 1.2rem;
  font-weight: lighter;
}

.three {
  font-size: 3rem;
}

.four .text-box {
  width: 600px;
  margin: 0 auto;
  border: 3px solid #aaa;
  border-radius: 5px;
  padding: 10px;
  position: relative;
}

.text-box p {
  margin: 0;
  text-align: left;
}

.text-box span {
  visibility: hidden;
}

.text-box .fake-btn {
  position: absolute;
  right: 5px;
  bottom: 2px;
  color: #fff;
  background-color: #03C160;
  padding: 8px 16px;
  border-radius: 8px;
}

.five p {
  font-size: 2rem;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
}

.idea-3 strong {
  padding: 3px 5px;
  border-radius: 3px;
  display: inline-block;
}

.five .idea-5 {
  font-size: 4rem;
}

.idea-5 span,
.idea-6 span,
.wish-hbd span {
  display: inline-block;
}

.idea-6 span {
  font-size: 15rem;
}

.six {
  position: relative;
}

.six img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

.six .hat {
  position: absolute;
  width: 80px;
  top: -70px;
  left: 49%;
  /* 等比例扩大图片到2倍 */
  transform: scale(1.1);
}

.baloons img {
  display: inline-block;
  position: absolute;
}

.baloons img:nth-child(even) {
  left: -10%;
}

.baloons img:nth-child(odd) {
  right: -10%;
}

.baloons img:nth-child(3n + 0) {
  left: 30%;
}

.eight svg {
  width: 25px;
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  z-index: -1;
}

.eight svg:nth-child(1) {
  top: 7vh;
  left: 5vw;
  fill: #bd6ecf;
}

.eight svg:nth-child(2) {
  top: 23vh;
  left: 35vw;
  fill: #7dd175;
}

.eight svg:nth-child(3) {
  top: 33vh;
  left: 23vw;
  fill: #349d8b;
}

.eight svg:nth-child(4) {
  top: 43vh;
  left: 57vw;
  fill: #347a9d;
}

.eight svg:nth-child(5) {
  top: 68vh;
  left: 7vw;
  fill: #c66053;
}

.eight svg:nth-child(6) {
  top: 42vh;
  left: 77vw;
  fill: #bfaa40;
}

.eight svg:nth-child(7) {
  top: 68vh;
  left: 83vw;
  fill: #e3bae8;
}

.eight svg:nth-child(8) {
  top: 86vh;
  left: 37vw;
  fill: #8762cb;
}

.eight svg:nth-child(9) {
  top: 94vh;
  left: 87vw;
  fill: #9a90da;
}

.wish-hbd {
  font-size: 3em;
  margin: 0;
  text-transform: uppercase;
}

.wish h5 {
  font-weight: lighter;
  font-size: 2rem;
  margin: 10px 0 0;
}

.nine p {
  font-size: 2rem;
  font-weight: lighter;
}

#replay { display:none !important; }

/* Media Queries */
@media screen and (max-height: 1000px) {
  .six .hat {
    left: 49%;
  }
}

@media screen and (max-height: 800px) {
  .six .hat {
    left: 46%;
  }
}

@media screen and (max-height: 700px) {
  .six .hat {
    left: 44%;
  }
}

@media screen and (max-height: 850px) and (max-width: 450px) {
  .six .hat {
    left: 42%;
  }
}

@media screen and (max-width: 500px) {
  .container {
    width: 90%;
  }

  .four .text-box {
    width: 90%;
  }

  .text-box .fake-btn {
    right: 5px;
    bottom: -48px;
  }

  .idea-5 span {
    display: block;
  }

  .idea-6 span {
    font-size: 10rem;
  }

  .six .hat {
    width: 50px;
    top: -20px;
  }

  .wish-hbd {
    font-size: 2.2em;
  }

  .wish h5 {
    font-size: 1.4rem;
  }

  .nine p {
    font-size: 1.5rem;
    font-weight: lighter;
  }
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.play-pause {
  display: none !important;
  width: 50px;
  height: 50px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url('../img/play.svg');
  background-color: transparent;
  border: none;
  cursor: pointer;
  z-index: 100;

  position: absolute;
  right: 5vw;
  top: 5vh;
  transition: all 0.3s ease-in-out;
}

.play-pause.playing {
  background-image: url('../img/pause.svg');
  animation: rotate 2s linear infinite;
}

.startSign {
  /* 居中 */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: 20vh 5vw;
}

.startSign .button {
  padding: 1rem 1.8rem;
  border: 1px solid #fff2b2;
  border-radius: 999px;
  background: linear-gradient(90deg,#ff5577,#ff8a5b,#ffc14d);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255,80,120,.35);
}

.startSign .button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  cursor: pointer;
}


.ten {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  opacity: 0;
  visibility: hidden;
  z-index: 20;
  padding: 6vh 5vw 8vh;
  overflow-y: auto;
  background: radial-gradient(circle at top, rgba(255,246,205,.38), rgba(126,23,57,.95));
}
.ten-tibet {
  z-index: 21;
  background: radial-gradient(circle at top, rgba(255,236,196,.32), rgba(71,31,61,.95));
}
.ten-title {
  text-align: center;
  font-size: clamp(28px, 5vw, 52px);
  color: #fff;
  margin: 0 0 10px;
}
.ten-sub {
  text-align: center;
  color: #f8d9ea;
  font-size: clamp(14px, 2vw, 20px);
  margin: 0 auto 22px;
  max-width: 980px;
}
.photo-grid {
  width: min(1200px, 100%);
  margin: 0 auto;
  columns: 3 260px;
  column-gap: 14px;
}
.photo-grid img {
  width: 100%;
  margin: 0 0 14px;
  border-radius: 14px;
  break-inside: avoid;
  box-shadow: 0 12px 28px rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.photo-grid img:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 34px rgba(0,0,0,.35);
}
@media (max-width: 768px){
  .photo-grid { columns: 2 160px; column-gap: 10px; }
  .photo-grid img { margin-bottom: 10px; border-radius: 10px; }
}

/* ===== Upgrade v2: cleaner pacing + story slider ===== */
.startSign .two:first-child { font-size: 1.35rem; color: #fff8e8; }

.baloons img {
  width: clamp(42px, 6vw, 78px);
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.22));
  opacity: .95;
}
.baloons img:nth-child(odd){ transform: rotate(-7deg); }
.baloons img:nth-child(even){ transform: rotate(7deg); }

.heart-3d {
  width: 120px;
  height: 108px;
  margin: 0;
  display: block;
  opacity: 0;
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%) scale(0.2);
  z-index: 1;
  filter: drop-shadow(0 10px 18px rgba(220,0,53,.35));
  transform-origin: center;
}

/* disable old overlapping wall */
.ten, .ten-tibet { display: none !important; }

.story-slider {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: none;
  background: radial-gradient(circle at 10% 10%, rgba(255,237,189,.35), rgba(74,16,38,.95));
  color: #fff;
  padding: 5vh 5vw;
}
.story-slider.active { display: block; }
.story-head { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.stage-btn {
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
  color: #fff; padding: 8px 14px; border-radius: 999px;
}
.stage-btn.active { background: linear-gradient(90deg,#ff5a78,#ff8a5b); border-color: transparent; }
.story-title { text-align: center; margin: 10px 0 6px; font-size: clamp(24px,4.6vw,44px); }
.story-sub { text-align: center; max-width: 980px; margin: 0 auto 18px; font-size: clamp(14px,2.2vw,20px); color: #ffe8f1; }
.story-viewer {
  display: grid; grid-template-columns: 52px 1fr 52px; gap: 10px; align-items: center;
  width: min(1100px, 100%); margin: 0 auto;
}
#storyImage {
  width: 100%; max-height: 62vh; object-fit: contain;
  border-radius: 18px; background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.28); box-shadow: 0 14px 30px rgba(0,0,0,.35);
}
.nav-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.2); color: #fff; font-size: 20px;
}
.story-index { text-align: center; margin-top: 10px; color: #ffeec2; }

/* gift entry + dense 3D balloons */
.startSign{ position: fixed; inset: 0; overflow: hidden; min-height: 100vh; z-index: 60; background: radial-gradient(circle at 20% 10%, rgba(255,245,216,.16), rgba(0,0,0,.1)); display:flex; flex-direction:column; justify-content:flex-start; align-items:center; padding-top:16vh; }
.balloon-veil{ position:absolute; inset:0; width:100vw; height:100vh; pointer-events:none; }
.veil-balloon{
  position:absolute; bottom:-140px;
  width: var(--w,92px); height: calc(var(--w,92px) * 1.25);
  border-radius: 52% 48% 50% 50%/58% 58% 42% 42%;
  background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.88), rgba(255,255,255,.25) 16%, transparent 30%),
              linear-gradient(150deg, var(--c1,#ff7b9d), var(--c2,#ff295f));
  box-shadow: inset -14px -18px 26px rgba(0,0,0,.15), 0 16px 24px rgba(0,0,0,.22);
  transform-style: preserve-3d;
}
.veil-balloon::after{
  content:''; position:absolute; left:50%; bottom:-22px; width:1.6px; height:26px; background:rgba(255,255,255,.7);
}
.gift-trigger{ background:transparent; border:none; display:flex; flex-direction:column; align-items:center; gap:10px; cursor:pointer; z-index:3; }
.gift-box{ position:relative; width:120px; height:96px; background:linear-gradient(135deg,#ff5b7f,#ff2d5e); border-radius:12px; box-shadow:0 16px 30px rgba(197,0,58,.35); }
.gift-lid{ position:absolute; left:-6px; right:-6px; top:-18px; height:24px; background:linear-gradient(135deg,#ff7897,#ff3d6d); border-radius:10px; transition:transform .35s ease; transform-origin:left bottom; }
.gift-ribbon-v{ position:absolute; top:0; bottom:0; left:50%; width:16px; transform:translateX(-50%); background:#ffe8b0; }
.gift-ribbon-h{ position:absolute; left:0; right:0; top:36px; height:14px; background:#ffe8b0; }
.gift-text{ color:#fff6dd; font-size:1rem; letter-spacing:.08em; }
.gift-trigger.open .gift-lid{ transform:rotate(-28deg) translateY(-4px); }

.baloons img{ display:none !important; }

.five { position: relative; }


.story-slider { padding: 0 !important; background: #000 !important; }
.story-title { display:none !important; }
.story-sub {
  position: absolute; z-index: 42; bottom: 6vh; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 10px 16px; border-radius: 12px;
  background: rgba(14,9,16,.42); backdrop-filter: blur(6px);
  max-width: min(1000px, 92vw); text-align: center; opacity: 0; transition: opacity .45s ease;
}
.finale{ position:absolute; inset:0; display:none; align-content:start; justify-items:center; background:rgba(10,0,12,.78); z-index:55; padding:9vh 4vw 6vh; overflow-y:auto; }
.finale.show{ display:grid; }
.finale-gift{ font-size:74px; filter: drop-shadow(0 8px 22px rgba(255,80,120,.5)); }
.finale-text{ white-space:pre-line; color:#ffe9ef; text-align:center; max-width:min(900px,90vw); font-size:clamp(16px,2.4vw,26px); line-height:1.8; margin:8px 0 18px; }
.story-photo-chip{ position:fixed; width:86px; height:120px; object-fit:cover; border-radius:10px; border:1px solid rgba(255,255,255,.25); box-shadow:0 12px 22px rgba(0,0,0,.35); z-index:70; }
.story-sub.show { opacity: 1; }
.story-viewer.full { width: 100vw; height: 100vh; margin: 0; display:grid; grid-template-columns: 1fr; position: relative; }
#storyImage {
  width: 100%; height: 100vh; max-height: 100vh !important; object-fit: contain !important;
  border-radius: 0 !important; border: none !important; box-shadow: none !important;
  filter: saturate(1.06) contrast(1.03);
  transition: transform 1.4s ease-out, opacity .45s ease-out;
}
.story-viewer.full {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1b1118;
}
.story-viewer.full::before{
  content:''; position:absolute; inset:0; background:inherit; filter: blur(24px) brightness(.9) saturate(1.05);
  transform: scale(1.12); z-index:0;
}
.story-viewer.full::after{
  content:''; position:absolute; inset:0; background: radial-gradient(circle at center, rgba(0,0,0,0) 52%, rgba(0,0,0,.16) 100%);
  z-index:1;
}
.story-viewer.full > * { position: relative; z-index: 2; }
#storyImage.kenburns { transform: scale(1.06); }
.nav-btn { display:none !important; }
.story-viewer.full { cursor: pointer; }
.stage-btn, .story-index, .story-head { display:none !important; }

.final-mosaic{ width:min(1240px,96vw); columns:3 220px; column-gap:12px; margin-top:10px; }
.final-mosaic img{ width:100%; margin:0 0 12px; border-radius:12px; break-inside:avoid; box-shadow:0 14px 28px rgba(0,0,0,.38); border:1px solid rgba(255,255,255,.2); opacity:0; transform: translateY(24px) scale(.95) rotate(var(--r,0deg)); transition: transform .55s ease, opacity .55s ease; }
.final-mosaic img.show{ opacity:1; transform: translateY(0) scale(1) rotate(var(--r,0deg)); }
@media (max-width: 900px){ .final-mosaic{ columns:2 180px; } }
@media (max-width: 640px){ .final-mosaic{ columns:2 140px; } }
.final-summary{white-space:pre-line;color:#ffe9ef;text-align:center;max-width:min(920px,92vw);line-height:1.9;font-size:clamp(16px,2.1vw,24px);margin:20px auto 40px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.16);padding:18px 16px;border-radius:14px;}

.final-mosaic img{ transition: transform .35s ease, opacity .35s ease; }
.final-mosaic img:hover{ filter: brightness(1.04); transform: translateY(-2px) scale(1.01) rotate(var(--r,0deg)); }

.all-photos-btn{position:absolute; right:18px; bottom:18px; z-index:5; border:none; border-radius:999px; padding:8px 14px; background:rgba(0,0,0,.45); color:#fff; backdrop-filter:blur(4px);}
.final-count{color:#ffdce7; text-align:center; margin:0 0 12px; opacity:.9;}

.all-photos-btn,.final-count{ display:none !important; }
