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

        // Update element position
        currentSheep.element.style.transform = `translate(${currentSheep.x}px, ${currentSheep.y}px)`;
      }

      // Check for collisions with obstacles
      function checkObstacleCollision(sheep) {
        for (const obstacle of obstacles) {
          const sheepRect = sheep.element.getBoundingClientRect();
          const obstacleRect = obstacle.element.getBoundingClientRect();

          if