* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: "Lato", sans-serif;
  color: #e0e0e0;
  background-image: url("../../assets/img/Background2.jpg");
  background-color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-size: cover;
  background-attachment: fixed;
  overflow-x: hidden;
  /* Prevent horizontal scrollbar from character */
}

a {
  color: #00bcd4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Adjusted padding for main-content to accommodate nav and footer */
main.main-content {
  flex-grow: 1;
  max-width: 900px;
  margin: 0 auto;
  /* Padding-top is explicitly 0 here, to be set by JS */
  /* Adjusted right padding for consistency */
  padding: 0 25px 40px 25px;
  color: #e0e0e0;
  font-size: 18px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 250px;
  /* This min-height is for the content, not to push footer */
  position: relative;
}

.main-action-aria a {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #00bcd4;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.about-content {
  background-color: rgba(0, 0, 0, 0.75);
  color: #e0e0e0;
  border: 1px solid #00bcd4;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 188, 212, 0.6);
  max-width: 700px;
  text-align: center;
  font-size: 18px;
  line-height: 1.15;
  position: relative;
  z-index: 2;
}

.about-text {
  text-indent: 30px;
}

@keyframes floatGuy {
  0% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-55%) translateX(5px);
  }

  100% {
    transform: translateY(-50%) translateX(0);
  }
}

.about-float-image {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 220px;
  z-index: 9999;
  pointer-events: none;
  animation: floatGuy 3s ease-in-out infinite;
}

@media (max-width: 600px) {
  .about-float-image {
    max-width: 130px;
    right: -20px;
  }
}

.main-action-aria a {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #00bcd4;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.main-action-aria a:hover {
  background-color: #0097a7;
}

.help-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #00bcd4;
  color: #fff;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  box-shadow: 0 0 10px #00bcd4;
  cursor: pointer;
  z-index: 1300;
}

.help-button:hover {
  background-color: #008ba3;
}

.help-popup {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 320px;
  max-width: 90%;
  background-color: #1c1c1c;
  color: #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 0 20px #00bcd4;
  display: none;
  z-index: 1300;
  padding: 15px;
}

@media (max-width: 480px) {
  .help-popup {
    width: 90%;
    bottom: 20px;
    right: 5%;
    left: 5%;
  }
}

.help-popup-header {
  background-color: #00bcd4;
  color: #fff;
  padding: 10px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  font-weight: bold;
}

.help-popup-body {
  padding: 10px 0;
}

.help-popup input,
.help-popup textarea,
.help-popup button {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #555;
  background-color: #333;
  color: #e0e0e0;
  font-size: 14px;
  font-family: inherit;
}

.help-popup button {
  background-color: #00bcd4;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.help-popup button:hover {
  background-color: #008ba3;
}

/* Responsive adjustments for main content and character */
@media (max-width: 768px) {
  main.main-content {
    /* Padding-top is now handled only by JS, so set to 0 here */
    padding: 0 20px 20px 20px;
    min-height: unset;
    /* Allow content to dictate height, flex-grow handles stretch */
  }

  .leaf-blower-character img {
    height: 90px;
  }

  .dust-particle {
    width: 15px;
    height: 15px;
  }
}

@media (orientation: landscape) and (max-width: 1024px) {
  main.main-content {
    max-width: 90vw;
    margin: 60px auto 0 auto;
    /* Ensure padding-top is 0 here as well if JS is setting it */
    padding: 0 20px 40px 20px;
  }
}

/* 🍃 Leaf Blower Character Styles */
.leaf-blower-character {
  position: fixed;
  bottom: 20px;
  z-index: 1000;
  /* Ensure character is above background */
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  /* Allow clicks through to content behind */
}

.leaf-blower-character img {
  height: 140px;
  animation: bounce 1s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes walkAcrossLeftToRight {
  0% {
    left: -200px;
  }

  100% {
    left: 100vw;
  }
}

@keyframes walkAcrossRightToLeft {
  0% {
    left: 100vw;
  }

  100% {
    left: -200px;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* Dust Blowing Effect Styles */
.dust-particle {
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: rgba(180, 160, 140, 0.7);
  /* Brownish gray, semi-transparent */
  opacity: 0;
  z-index: 1001;
  /* Above the character image */
  border-radius: 50%;
  /* Make them circular */
  /* animation properties set by JS via CSS variables */
  animation: blowDust var(--dust-animation-duration) ease-out forwards;
}

@keyframes blowDust {
  0% {
    transform: translate(0, 0) scale(0.5);
    /* Start smaller */
    opacity: 1;
    /* Fully opaque at start */
  }

  100% {
    /* --dust-direction will be 1 for right, -1 for left */
    transform: translate(
        calc(var(--dust-direction) * var(--dust-distance-x)),
        var(--dust-distance-y)
      )
      rotate(calc(var(--dust-direction) * 360deg)) scale(1.5);
    /* Grow, move, rotate, fade */
    opacity: 0;
  }
}
