/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Quicksand', sans-serif;
  background: #1a2a1a;
}

body.is-loading {
  overflow: hidden;
}

body.is-loading .landing-page {
  visibility: hidden;
}

/* ========================================
   CUTE FIRST LOAD SCREEN
   ======================================== */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fffdf7;
  color: #2f3b2f;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

body.is-ready #app-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-card {
  width: min(320px, 100%);
  padding: 24px 22px;
  text-align: center;
}

.loader-lottie {
  display: block;
  width: min(198px, 68vw);
  height: 96px;
  margin: 0 auto -8px;
}

.loader-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: #37523b;
}

.loader-track {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eadf;
}

#loader-bar {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8bd26f, #f6d365);
  transition: width 0.25s ease;
}

/* ========================================
   LANDING PAGE CONTAINER
   ======================================== */
.landing-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ========================================
   BACKGROUND HERO IMAGE
   ======================================== */
.bg-hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.bg-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Dark gradient overlay — darkens the bottom for readability
   🔧 ADJUST HERE: Change rgba alpha values to darken/lighten the background */
.bg-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.4) 0%,
      rgba(0, 0, 0, 0.05) 30%,
      rgba(0, 0, 0, 0.25) 60%,
      rgba(0, 0, 0, 0.55) 85%,
      rgba(0, 0, 0, 0.7) 100%);
  z-index: 1;
}

/* ========================================
   CONTENT (above background)
   ======================================== */
.content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}

/* ========================================
   TITLE IMAGE
   ======================================== */
.title-container {
  width: 90%;
  max-width: 500px;
  margin-bottom: 8px;
  animation: titleFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.4));
}

.title-container img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes titleFloat {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }
}

/* ========================================
   SUBTITLE
   ======================================== */
.subtitle {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  margin-bottom: 40px;
  letter-spacing: 2px;
  opacity: 0.9;
}

.subtitle .sparkle {
  display: inline-block;
  animation: sparkleRotate 2s ease-in-out infinite;
}

@keyframes sparkleRotate {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.2) rotate(15deg);
  }
}

/* ========================================
   START BUTTON (wooden banner)
   🔧 ADJUST HERE: Change width/max-width to resize the banner
   ======================================== */
.start-btn-container {
  position: relative;
  width: 220px;
  max-width: 80%;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  animation: btnPulse 2.5s ease-in-out infinite;

}

.start-btn-container:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.start-btn-container:active {
  transform: scale(0.96);
  filter: brightness(0.95);
  animation: none;
}

/* 🔧 ADJUST HERE: The banner image size — use max-height to cap its height */
.start-btn-container img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  /* max-height: 60px;    ← uncomment & tweak to limit banner height */
  /* object-fit: contain; ← keep this if using max-height */
}

.start-btn-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 2px 0 #8B5E34,
    0 3px 6px rgba(0, 0, 0, 0.4);
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

@keyframes btnPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }
}

/* Click animation — press down + bounce */
.start-btn-container.clicked {
  animation: btnClick 0.4s ease forwards;
  opacity: 1;
  pointer-events: none;
}

@keyframes btnClick {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  30% {
    transform: scale(0.88);
    filter: brightness(0.85);
  }

  60% {
    transform: scale(1.08);
    filter: brightness(1.15);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* ========================================
   INSTRUCTION HINT
   ======================================== */
.instruction {
  margin-top: 24px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.instruction .icon-cam {
  font-size: 1.1rem;
  animation: camBounce 2s ease-in-out infinite;
}

@keyframes camBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

/* ========================================
   FLOATING PARTICLES (decorative)
   ======================================== */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 200, 0.6);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

.particle:nth-child(1) {
  left: 10%;
  animation-duration: 8s;
  animation-delay: 0s;
  width: 4px;
  height: 4px;
}

.particle:nth-child(2) {
  left: 25%;
  animation-duration: 10s;
  animation-delay: 1s;
  width: 5px;
  height: 5px;
}

.particle:nth-child(3) {
  left: 40%;
  animation-duration: 7s;
  animation-delay: 2s;
  width: 3px;
  height: 3px;
}

.particle:nth-child(4) {
  left: 55%;
  animation-duration: 9s;
  animation-delay: 0.5s;
  width: 6px;
  height: 6px;
}

.particle:nth-child(5) {
  left: 70%;
  animation-duration: 11s;
  animation-delay: 3s;
  width: 4px;
  height: 4px;
}

.particle:nth-child(6) {
  left: 85%;
  animation-duration: 8s;
  animation-delay: 1.5s;
  width: 5px;
  height: 5px;
}

.particle:nth-child(7) {
  left: 15%;
  animation-duration: 12s;
  animation-delay: 4s;
  width: 3px;
  height: 3px;
}

.particle:nth-child(8) {
  left: 60%;
  animation-duration: 9s;
  animation-delay: 2.5s;
  width: 4px;
  height: 4px;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateY(90vh) scale(1);
  }

  90% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-10vh) scale(0.5);
    opacity: 0;
  }
}

/* ========================================
   MUSIC TOGGLE
   ======================================== */
.music-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.music-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: scale(1.1);
}

.music-toggle:active {
  transform: scale(0.92);
}

.music-icon {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
  line-height: 1;
}

/* When music is playing */
.music-toggle.playing {
  background: rgba(139, 94, 52, 0.45);
}

.music-toggle.playing .music-icon {
  color: #fff;
  animation: noteBounce 1s ease-in-out infinite;
}

@keyframes noteBounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-2px) rotate(-5deg);
  }

  75% {
    transform: translateY(-2px) rotate(5deg);
  }
}

/* ========================================
   FOOTER CREDITS
   ======================================== */
.footer-credits {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  z-index: 3;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  white-space: nowrap;
}

/* ========================================
   FADE-IN ANIMATION ON LOAD
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-delay-1 {
  animation-delay: 0.3s;
}

.fade-in-delay-2 {
  animation-delay: 0.6s;
}

.fade-in-delay-3 {
  animation-delay: 0.9s;
}

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

/* ========================================
   RESPONSIVE — LARGER SCREENS
   ======================================== */
@media (min-width: 768px) {
  .title-container {
    max-width: 600px;
  }

  .subtitle {
    font-size: 1.3rem;
  }

  .start-btn-container {
    width: 320px;
  }

  .start-btn-text {
    font-size: 1.6rem;
  }

  .instruction {
    font-size: 1rem;
  }
}

@media (min-width: 1200px) {
  .title-container {
    max-width: 700px;
  }

  .start-btn-container {
    width: 360px;
  }
}
