@font-face {
  font-family: 'Written';
  src: url('../fonts/WrittenSC-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'WrittenSC';
  src: url('../fonts/WrittenSC-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  width: 100vw;
  background-color: #121212; /* 深色背景 */
  color: #e0e0e0; /* 浅色文字 */
  font-family: 'Written', 'WrittenSC', sans-serif;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 确保画布不拦截点击事件 */
  z-index: -9999; /* 将画布置于顶层 */
  filter: brightness(1.2); /* 增加亮度，使烟花在深色背景上更明显 */
}

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

.container div.cake-scene {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  position: absolute;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container div.cake-scene .cake {
  width: 400px;
  height: 400px;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.7));
  object-fit: contain;
  max-width: 90vw;
  max-height: 60vh;
}

.container div.cake-scene .cake-text {
  margin-top: 30px;
  text-align: center;
}

.container div.cake-scene .cake-text h3 {
  font-size: 3rem;
  color: #ff69b4;
  text-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
  margin: 0;
  font-weight: bold;
  letter-spacing: 2px;
}

.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 #6e6e6e; /* 更改边框颜色 */
  border-radius: 5px;
  padding: 10px;
  position: relative;
  background-color: #1e1e1e; /* 文本框背景色 */
}

.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;
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.2); /* 添加发光效果 */
}

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

.idea-3 strong {
  padding: 3px 5px;
  border-radius: 3px;
  display: inline-block;
  background-color: #03C160; /* 更改背景色 */
  color: #fff; /* 确保文字颜色为白色 */
}

.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: #e48dff; /* 更亮的紫色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(2) {
  top: 23vh;
  left: 35vw;
  fill: #8fff8f; /* 更亮的绿色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(3) {
  top: 33vh;
  left: 23vw;
  fill: #4dffdf; /* 更亮的青色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(4) {
  top: 43vh;
  left: 57vw;
  fill: #4db8ff; /* 更亮的蓝色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(5) {
  top: 68vh;
  left: 7vw;
  fill: #ff8a7f; /* 更亮的红色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(6) {
  top: 42vh;
  left: 77vw;
  fill: #ffeb7f; /* 更亮的黄色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(7) {
  top: 68vh;
  left: 83vw;
  fill: #ffd1ff; /* 更亮的粉色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(8) {
  top: 86vh;
  left: 37vw;
  fill: #b48fff; /* 更亮的紫色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.eight svg:nth-child(9) {
  top: 94vh;
  left: 87vw;
  fill: #c4bdff; /* 更亮的淡紫色 */
  filter: brightness(1.2); /* 增加亮度 */
}

.wish-hbd {
  font-size: 3em;
  margin: 0;
  text-transform: uppercase;
  color: #ffffff; /* 纯白色 */
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); /* 添加发光效果 */
}

.wish h5 {
  font-weight: lighter;
  font-size: 2rem;
  margin: 10px 0 0;
  color: #b8e6ff; /* 淡蓝色 */
}

.nine p {
  font-size: 2rem;
  font-weight: lighter;
  color: #e0e0e0; /* 浅色文字 */
}

#replay {
  z-index: 3;
  cursor: pointer;
  color: #03C160; /* 绿色 */
  text-decoration: underline;
}

/* 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 {
  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.6rem;
  border: 1px solid #03C160;
  border-radius: 5px;
  background-color: transparent;
  color: #e0e0e0; /* 浅色文字 */
  box-shadow: 0 0 10px rgba(3, 193, 96, 0.3); /* 添加发光效果 */
}

.startSign .button:hover {
  background-color: #03C160;
  color: #fff;
  padding: 1rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(3, 193, 96, 0.5); /* 悬停时增强发光效果 */
}
