.orientation-wrapper {
  transform: none;
  transform-origin: center center;
}

.rotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.rotate-overlay img {
  max-width: 80%;
  height: auto;
}

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: "Work Sans", sans-serif;
}

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

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

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

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

.one {
  font-size: clamp(2rem, 5vw, 4.5rem);
}

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

.two {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: lighter;
}

.three {
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.four .text-box {
  width: 100%;
  max-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: 5px;
  color: #fff;
  background-color: rgb(21, 161, 237);
  padding: 5px 8px;
  border-radius: 3px;
}

.five p {
  font-size: clamp(1.2rem, 3vw, 2rem);
  position: absolute;
  left: 0;
  right: 0;
}

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

.five .idea-5 {
  font-size: clamp(2rem, 5vw, 4rem);
}

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

.idea-6 span {
  font-size: clamp(6rem, 15vw, 15rem);
}

.six {
  position: relative;
}

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

.baloons img {
  display: inline-block;
  position: absolute;
  max-width: 35%;
  height: auto;
}

.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: clamp(1.8rem, 4vw, 3em);
  margin: 0;
  text-transform: uppercase;
}

.wish h5 {
  font-weight: lighter;
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin: 10px 0 0;
}

.nine p {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: lighter;
}

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

@media (max-width: 500px) {
  html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
  }

  .rotate-overlay {
    display: flex;
  }
  .orientation-wrapper {
    display: none;
  }

  .orientation-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(90deg) translateY(-100%);
    transform-origin: top left;
    width: 100vh;  /* swapped dimensions after rotation */
    height: 100vw;
    overflow: hidden;
  }

  section {
    width: 100vh;
    height: 100vw;
  }

  @keyframes fadeInTiltOut {
    0% {
      opacity: 0;
      transform: rotate(0deg);
    }
    20% {
      opacity: 1;
      transform: rotate(0deg);
    }
    60% {
      opacity: 1;
      transform: rotate(-90deg); /* Tilt left */
    }
    80% {
      opacity: 1;
      transform: rotate(-90deg);
    }
    100% {
      opacity: 0;
      transform: rotate(0deg);
    }
  }

  .rotate-overlay img {
    opacity: 0;
    animation: fadeInTiltOut 3s ease-in-out forwards;
  }
}
