@import url('https://fonts.googleapis.com/css2?family=Rubik&display=swap');

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background-color: #fff9f2;
font-family: 'Rubik', sans-serif;

  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative; /* Buraya ekledik */
  background-image: url('tree.webp');
  background-repeat: repeat;          /* Görseli döngü şeklinde tekrarlar */
  background-size: auto;              /* Orijinal boyut */
  background-attachment: fixed;       /* Sayfa kayarken sabit kalır */
  background-position: center center; /* Ortalanmış */
  /* Performans için ekstra filtre, opacity veya animasyon koymamak iyi */
}

.container {
  position: relative; /* Kapsayıcıyı göreli yaptık ki absolute konumlama buna göre olsun */
  width: 90vw;
  max-width: 320px;
  height: 90vh;
  max-height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cookie-whole {
  width: 60vw;
  max-width: 200px;
  transition: opacity 0.5s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
/* Lights banner */
.lights {
  position: absolute;
  bottom: 30%; /* Daha aşağı kaydırdık */
  left: 50%;
  transform: translateX(-50%);
  width: 250px; /* Büyüttük, istediğin boyutu ayarlayabilirsin */
  max-width: 80%; /* ekran küçüldüğünde taşmasın */
  z-index: 5; /* diğer öğelerin üstünde */
  opacity: 0;
  transition: opacity 0.6s ease;


}

.lights.show {
  opacity: 1;
}





.cookie-pieces {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70vw;
  max-width: 220px;
  height: 100px;
  transform: translate(-50%, -50%);
  z-index: 6;
  /* Burada position: absolute kaldı, çünkü container relative */
}

.cookie-piece {
  width: 70%;
  max-width: 170px;
  position: absolute;
  top: 0;
  transition: transform 1s ease, opacity 1s ease;
}

.left {
  left: 0;
  transform: translateX(0);
}

.right {
  right: 0;
  transform: translateX(0);
}

.broken-left {
  transform: translateX(-100px) rotate(-20deg);
  opacity: 1;
}

.broken-right {
  transform: translateX(100px) rotate(20deg);
  opacity: 1;
}

.hidden {
  display: none;
}

.message {
font-family: 'Rubik', sans-serif;
  font-size: 1.05rem;
  /*background-color: #d6efd4;*/
  padding: 14px 18px;
  border-radius: 12px;
  max-width: 90%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-align: center;
  color: #4b2e2e;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
  transition: opacity 1s ease;
  position: absolute;

  /* Kırık kurabiyenin ortasıyla aynı hizaya alınır */
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  opacity: 0;
}

.message.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 480px) {
  .message {
    font-size: 1rem;
    padding: 12px 14px;
  }
}


/* Sallanma animasyonu */
@keyframes shake {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  20% { transform: translate(-50%, -50%) rotate(2deg); }
  40% { transform: translate(-50%, -50%) rotate(-2deg); }
  60% { transform: translate(-50%, -50%) rotate(2deg); }
  80% { transform: translate(-50%, -50%) rotate(-2deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.shake {
  animation: shake 0.30s ease-in-out;
}

/* Kurabiyeye parlama efekti (drop-shadow ile) */
.glow {
  animation: glowPulse 2s infinite ease-in-out;
  filter: drop-shadow(0 0 40px rgba(255, 180, 0, 1)); /* Daha koyu, altın ton */
  border-radius: 50%;
}

@keyframes glowPulse {
  0% {
    filter: drop-shadow(0 0 40px rgba(255, 160, 0, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 180, 0, 1));
  }
  100% {
    filter: drop-shadow(0 0 40px rgba(255, 160, 0, 0.7));
  }
}

/* Kırık kurabiye parçalarına parlama efekti */
.cookie-glow {
  animation: cookieGlow 2s infinite ease-in-out;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes cookieGlow {
  0% {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.9));
  }
  100% {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
  }
}
.click-hint {
  position: absolute;
  top: 70%;  /* Kurabiyenin biraz altına veya yanına ayarla */
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Rubik', sans-serif;
  color: rgba(75, 64, 5, 0.8);
  font-weight: 700;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.9);
  animation: blink 1.8s infinite;
  user-select: none;
  pointer-events: none; /* Metin tıklanabilir olmasın */
  z-index: 10;
  filter: blur(0.3px);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}