html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow: hidden;
  touch-action: manipulation;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  width: 100vw;
  background-image: url('assets/background.png');
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Pixelify Sans", serif;
  -webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
  user-select: none;
}

.logo {
  position: absolute;
  top: 40px;
  left: 40px;
  z-index: 100;
}

.tree-stage {
  width: auto;
  height: auto;
}

  .platform-container {
    position: absolute;
    bottom: 10%;
    left: 50%;
    max-width: 450px;
    width: 100%;
    transform: translateX(-50%);
    animation: float 3s ease-in-out infinite;
  }
  
  #platform {
    width: 100%;
    pointer-events: none;
  }
  
  #tree-image {
    width: 118px;
    position: absolute;
    bottom: 56%;
    left: 50%;
    transform: translateX(-50%);
    animation: sway-frames-1 2s steps(4) infinite;
    transform-origin: center bottom;
    transition: transform 0.1s ease;
    pointer-events: none;
  }

  #tree-image.clicked {
    transform: translateX(-50%) scale(1.05);
  }

  #tree-image.glowing-and-blinking {
    animation: glow-and-blink 1.5s ease-in-out;
  }

@keyframes glow-and-blink {
  0%, 100% {
      opacity: 1;
      filter: brightness(1) drop-shadow(0px 0px 0px rgba(255, 255, 255, 0));
  }
  20%, 60% {
      opacity: 0;
  }
  30%, 70% {
      opacity: 1;
      filter: brightness(1.5) drop-shadow(0px 0px 20px rgba(255, 255, 255, 0.8));
  }
  90% {
      filter: brightness(1) drop-shadow(0px 0px 0px rgba(255, 255, 255, 0));
      opacity: 1;
  }
}
  
  .hidden {
    display: none;
  }
  
  @keyframes float {
    0%, 100% {
      transform: translate(-50%, 0);
    }
    50% {
      transform: translate(-50%, -10px); 
    }
  }
  
  @keyframes sway-frames-1 {
    0% {
      content: url('assets/first1.png');
    }
    33% {
      content: url('assets/first2.png');
    }
    66% {
      content: url('assets/first3.png');
    }
    100% {
      content: url('assets/first1.png');
    }
  }

  @keyframes sway-frames-2 {
    0% {
      content: url('assets/second1.png');
    }
    33% {
      content: url('assets/second2.png');
    }
    66% {
      content: url('assets/second3.png');
    }
    100% {
      content: url('assets/second1.png');
    }
  }

  @keyframes sway-frames-3 {
    0% {
      content: url('assets/third1.png');
    }
    33% {
      content: url('assets/third2.png');
    }
    66% {
      content: url('assets/third3.png');
    }
    100% {
      content: url('assets/third1.png');
    }
  }

  @keyframes sway-frames-4 {
    0% {
      content: url('assets/fourth1.png');
    }
    33% {
      content: url('assets/fourth2.png');
    }
    66% {
      content: url('assets/fourth3.png');
    }
    100% {
      content: url('assets/fourth1.png');
    }
  }
  
  #click-hint {
    width: 50px;
    position: absolute;
    left: 58%;
    top: 20%;
    transform: translate(-50%, -50%);
    opacity: 1;
    animation: blink 1s ease-in-out infinite;
  }
  
  @keyframes blink {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0;
    }
  }
  
  #promo-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: url('assets/popup_final.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 80vw;
    height: auto;
    max-width: 400px;
    max-height: 500px;
    aspect-ratio: 1.3;
    display: none;
    z-index: 100;
}
  
  #promo-modal p {
    position: absolute;
    margin: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 50px;
    font-weight: 500;
    color: #002C47;
  }

  #promo-modal span {
    position: absolute;
    margin: auto;
    top: 9%;
    left: 20%;
    font-size: 14px;
    font-weight: 500;
    color: black;
  }
  
  #activate-button {
    position: absolute;
    width: 80%;
    height: 20%;
    bottom: 0%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: auto;
    text-align: center;
    color: white;
    font-size: 30px;
    background-color: #fdd481;
    border-radius: 5%;
    border: 3px solid white;
    cursor: pointer;
    font-family: "Pixelify Sans", serif;
    animation: blink-button 1s infinite alternate;
  }

  @media (max-width: 768px) {
    #activate-button {
      font-size: 120%;
    }

    .logo {
      top: 20px;
      left: 20px;
      width: 100px;
    }
  }
  
  @keyframes blink-button {
    0% {
      background-color: #fdd481;
      border: 3px solid white;
    }
    100% {
      background-color: #7eb5df;
      border: 3px solid #fdd481;
    }
  }

  #progress-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    aspect-ratio: 9.6;
    background-image: url('assets/progress_border.png');
    background-size: cover;
    border-radius: 15px;
    overflow: hidden;
    max-width: 500px;
  }

#progress-bar {
    position: absolute;
    height: 60%;
    left: 5%;
    top: 21%;
    width: 0%;
    background-image: url('assets/progress_green.png');
    background-size: cover;
    border-radius: 15px;
    transition: width 0.3s ease;
  }

.cloud {
    position: absolute;
    right: -300px;
    background-size: contain;
    background-repeat: no-repeat;
    animation: moveClouds 30s linear infinite;
}

#cloud1 {
    background-image: url('assets/cloud1.png');
    top: 5%;
    width: 200px;
    height: 100px;
    animation-duration: 20s;
}

#cloud2 {
    background-image: url('assets/cloud2.png');
    top: 30%;
    width: 300px;
    height: 150px;
    animation-duration: 25s;
    animation-delay: 5s;
}

#cloud3 {
    background-image: url('assets/cloud3.png');
    top: 25%;
    width: 250px;
    height: 120px;
    animation-duration: 30s;
    animation-delay: 10s;
}

@keyframes moveClouds {
    0% {
        right: -300px;
    }
    100% {
        right: 100vw;
    }
}

.bird {
  position: absolute;
  width: 50px;
  height: 70px;
  background-size: cover;
  background-repeat: no-repeat;
  animation: flyBirdFrames 0.5s steps(2) infinite, moveBirdAcross 15s linear infinite;
}

#bird1 {
  background-image: url('assets/bird1.png');
  top: 20%;
}

#bird2 {
  background-image: url('assets/bird1.png');
  top: 40%;
  right: -100px;
  animation-delay: 8s;
}

@keyframes flyBirdFrames {
  0% {
      background-image: url('assets/bird1.png');
  }
  50% {
      background-image: url('assets/bird2.png');
  }
  100% {
      background-image: url('assets/bird1.png');
  }
}

@keyframes moveBirdAcross {
  0% {
      right: -100px;
  }
  100% {
      right: 100vw;
  }
}

.leaf {
  position: absolute;
  pointer-events: none;
  width: 20px;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

@keyframes fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(0, 400px) rotate(360deg);
    opacity: 0;
  }
}

.falling {
  animation: fall 3s ease-in-out forwards;
}

@keyframes coin-fall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(400px);
    opacity: 0;
  }
}

.coin.falling {
  width: 24px;
  height: 24px;
  pointer-events: none;
  position: absolute;
  animation: coin-fall 1.5s linear;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 99;
  display: none;
}
