html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

.song {
  visibility: hidden;
}

.music-start {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
  transition: all 0.5s ease;
  overflow: hidden;
}

.music-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255, 192, 203, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 40% 40%, rgba(255, 228, 225, 0.2) 0%, transparent 50%);
  animation: floatingBubbles 6s ease-in-out infinite;
}

.music-start.hidden {
  opacity: 0;
  pointer-events: none;
}

.music-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  position: relative;
}

.music-start h1 {
  font-size: 4.5rem;
  font-weight: 400;
  color: #333;
  text-align: center;
  margin: 0 0 1rem 0;
  animation: fadeInUp 1s ease 0.5s both;
}

.music-start p {
  font-size: 1.2rem;
  font-weight: lighter;
  color: #666;
  text-align: center;
  margin: 2rem 0;
  animation: fadeInUp 1s ease 0.7s both;
}

.music-btn {
  background: none;
  border: 2px solid #333;
  color: #333;
  padding: 12px 24px;
  font-size: 1rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeInUp 1s ease 0.9s both;
}

.music-btn:hover,
.music-btn:active,
.music-btn:focus {
  background: #333;
  color: white;
  outline: none;
}

.music-btn:active {
  transform: scale(0.98);
}

.sparkles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: sparkleFloat 4s infinite;
}

.sparkle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 80%; left: 20%; animation-delay: 1s; }
.sparkle:nth-child(3) { top: 40%; left: 80%; animation-delay: 2s; }
.sparkle:nth-child(4) { top: 70%; left: 70%; animation-delay: 0.5s; }
.sparkle:nth-child(5) { top: 10%; left: 60%; animation-delay: 1.5s; }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes floatingBubbles {
  0%, 100% { 
    transform: translateY(0px) translateX(0px) rotate(0deg); 
    opacity: 0.3;
  }
  33% { 
    transform: translateY(-8px) translateX(3px) rotate(1deg); 
    opacity: 0.4;
  }
  66% { 
    transform: translateY(2px) translateX(-2px) rotate(-0.5deg); 
    opacity: 0.5;
  }
}

@keyframes pulseGlow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.3);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 25px 50px rgba(255, 107, 157, 0.5);
  }
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sparkleFloat {
  0%, 100% { 
    transform: translateY(0px) scale(1);
    opacity: 0.7;
  }
  50% { 
    transform: translateY(-20px) scale(1.2);
    opacity: 1;
  }
}

/* Performance optimizations for mobile */
.eight svg,
.baloons img,
.sparkle,
.music-icon::after {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.container,
.music-start {
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.one {
  font-size: 4.5rem;
}

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

.three {
  font-size: 3rem;
}

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

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

.text-box span {
  visibility: hidden;
}

.text-box .fake-btn {
  background-color: rgb(21, 161, 237);
  border-radius: 3px;
  bottom: -50px;
  color: #fff;
  padding: .5rem 1rem;
  position: absolute;
  right: 5px;
}

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

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

.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;
  top: 10vh;
  z-index: 1;
}

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

.six .hat {
  position: absolute;
  /* transform: scale(0.1); */
  top: -45%;
  left: 48.5%;
  width: 80px;
}

.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%;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#replay {
  cursor: pointer;
  z-index: 3;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  padding: 10px;
  margin: -10px;
  touch-action: manipulation;
}

/* iPhone specific optimizations */
@supports (-webkit-touch-callout: none) {
  .container {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .music-start {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Media Queries for iPhone sizes */
@media screen and (max-width: 430px) {
  /* iPhone 14 Pro Max and similar */
  .one {
    font-size: 3.5rem;
  }
  
  .music-start h1 {
    font-size: 3.5rem;
  }
  
  .three {
    font-size: 2.2rem;
  }
}

@media screen and (max-width: 390px) {
  /* iPhone 14 Pro and similar */
  .one {
    font-size: 3rem;
  }
  
  .music-start h1 {
    font-size: 3rem;
  }
  
  .three {
    font-size: 2rem;
  }
  
  .idea-6 span {
    font-size: 8rem;
  }
}

@media screen and (max-width: 375px) {
  /* iPhone SE and older models */
  .one {
    font-size: 2.8rem;
  }
  
  .music-start h1 {
    font-size: 2.8rem;
  }
  
  .three {
    font-size: 1.8rem;
  }
  
  .container > div {
    top: 15vh;
  }
  
  .six .hat {
    left: 35%;
    width: 45px;
  }
  
  .wish-hbd {
    font-size: 2rem;
  }
  
  .wish h5 {
    font-size: 1.2rem;
  }
  
  .idea-6 span {
    font-size: 7rem;
  }
}

/* Mobile bubble size fix */
@media screen and (max-width: 430px) {
  .eight svg {
    width: 15px;
  }
}

@media screen and (max-width: 375px) {
  .eight svg {
    width: 12px;
  }
}

/* Landscape orientation fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .container > div {
    top: 10vh;
  }
  
  .music-start h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }
  
  .music-start p {
    margin: 1rem 0;
  }
  
  .six .hat {
    width: 40px;
  }
  
  .eight svg {
    width: 10px;
  }
}
