/* ============================= */
/* RESET & GLOBAL */
/* ============================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: "Segoe Print", "Comic Sans MS", "Marker Felt", cursive, sans-serif;
}

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

body {
  color: #5F5F5F;
  background-color: #F6EAF0;
  overflow: hidden;
  font-size: 20px;
}

/* ============================= */
/* CANVAS BACKGROUND */
/* ============================= */

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ============================= */
/* MAIN CONTAINER */
/* ============================= */

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

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

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

.container .seven,
.container .eight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============================= */
/* TEXT COLOR */
/* ============================= */

.two,
.three,
.five p,
.nine p,
.wish-hbd,
.wish h5,
.final-text p {
  color: #5F5F5F;
}

/* ============================= */
/* TEXT BOX */
/* ============================= */

.four .text-box {
  border: 3px solid #B97A9E;
  background-color: #F6EAF0;
  padding: 1rem;
  border-radius: 8px;
}

.text-box .fake-btn {
  background-color: #B97A9E;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

/* ============================= */
/* BALLOONS */
/* ============================= */

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

/* Balloon positions + colors */
.eight svg:nth-child(1) { top: 7vh; left: 5vw; fill: #D5A3BC; }
.eight svg:nth-child(2) { top: 23vh; left: 35vw; fill: #E8C7D7; }
.eight svg:nth-child(3) { top: 33vh; left: 23vw; fill: #B97A9E; }
.eight svg:nth-child(4) { top: 43vh; left: 57vw; fill: #B0B0B0; }
.eight svg:nth-child(5) { top: 68vh; left: 7vw; fill: #D5A3BC; }
.eight svg:nth-child(6) { top: 42vh; left: 77vw; fill: #E8C7D7; }
.eight svg:nth-child(7) { top: 68vh; left: 83vw; fill: #B97A9E; }
.eight svg:nth-child(8) { top: 86vh; left: 37vw; fill: #B0B0B0; }
.eight svg:nth-child(9) { top: 94vh; left: 87vw; fill: #D5A3BC; }

/* ============================= */
/* WISH TEXT */
/* ============================= */

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

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

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

/* ============================= */
/* REPLAY BUTTON */
/* ============================= */

#replay {
  z-index: 3;
  cursor: pointer;
}

/* ============================= */
/* PLAY / PAUSE BUTTON */
/* ============================= */

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.play-pause {
  position: absolute;
  top: 5vh;
  right: 5vw;
  width: 50px;
  height: 50px;
  background: url('img/play.svg') center/contain no-repeat;
  background-color: transparent;
  border: none;
  cursor: pointer;
  z-index: 100;
  transition: 0.3s ease;
}

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

/* ============================= */
/* START SIGN */
/* ============================= */

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

.startSign .button {
  padding: 1rem 1.6rem;
  border: 1px solid #B97A9E;
  border-radius: 5px;
  transition: 0.3s ease;
}

.startSign .button:hover {
  background-color: #B97A9E;
  color: #fff;
  cursor: pointer;
}

/* ============================= */
/* CAKE */
/* ============================= */
.cake-container {
  margin-top: 20px;
  padding-bottom: 100px;
  text-align: center;
  visibility: hidden; /* Ẩn lúc đầu */
  opacity: 0;
  transition: opacity 0.5s ease;

  transform: translateY(50px); 
}

/* Thêm class để hiện bánh khi cần */
.cake-container.show {
  visibility: visible;
  opacity: 1;
}

.cake {
  font-size: 140px;
  position: relative;
  display: inline-block;
  cursor: pointer;
}

#flame {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 55px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#flame.out {
  opacity: 0;
  transform: translateX(-50%) scale(0);
}

.blow-text {
  font-size: 14px;
  opacity: 0.8;
  margin-top: 10px;
}

/* ============================= */
/* FINAL SCREEN */
/* ============================= */
.container .nine {
  top: 5vh; /* Thay đổi từ 20vh xuống 5vh để sát mép trên */
}

.final-top-img {
  max-width: 400px; /* Thu nhỏ banner một chút */
  margin-bottom: 10px;
}

.final-bottom-img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.final-text p {
  font-size: 1.5rem;
  margin: 8px 0;
  line-height: 1.4;
}

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

/* ============================= */
/* RESPONSIVE */
/* ============================= */

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

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

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

  .wish-hbd {
    font-size: 3rem;
  }

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

  .nine p {
    font-size: 3rem;
  }
}

/* Sửa lại z-index để bong bóng bay mượt mà hơn */
.seven {
  z-index: 2; /* Cho bong bóng bay trên các layer khác */
  pointer-events: none; /* Để không chặn click vào bánh kem */
}

.four p {
  font-size: 3rem;
  margin: 20px 0;
  color: #5F5F5F;
}