  wolf.y = Math.max(5, Math.min(wolf.y, gameContainer.offsetHeight - 15));

            wolf.element.style.left = wolf.x + "px";
            wolf.element.style.top = wolf.y + "px";
          }
        });
      }

      // Check if sheep are in the pen
      function checkWinCondition() {
        const pen = document.querySelector(".pen");
        const penRect = pen.getBoundingClientRect();
        let sheepInPen = 0;

        for (const s of sheep) {
          const sheepRect = s.element.getBoundingClient