<!DOCTYPE html>
<html>
<head>
  <title>🌀 Ultimate Chaos Central 3000 🌀</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      cursor: none;
    }

    @keyframes rainbow {
      0% { color: red; }
      20% { color: orange; }
      40% { color: yellow; }
      60% { color: green; }
      80% { color: blue; }
      100% { color: purple; }
    }

    body {
      font-family: 'Comic Sans MS', cursive;
      background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
      min-height: 100vh;
      overflow-x: hidden;
      perspective: 1000px;
    }

    .custom-cursor {
      width: 30px;
      height: 30px;
      background: radial-gradient(circle, #fff 0%, #ff0 100%);
      border-radius: 50%;
      position: fixed;
      pointer-events: none;
      mix-blend-mode: difference;
      z-index: 9999;
      transform: translate(-50%, -50%);
      box-shadow: 0 0 20px rgba(255,255,255,0.8);
    }

    .custom-cursor::after {
      content: '👆';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 20px;
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 2rem;
      transform-style: preserve-3d;
    }

    .floating-elements {
      position: fixed;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 100;
    }

    .floating-element {
      position: absolute;
      font-size: 2rem;
      animation: float 10s infinite linear;
      filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
    }

    @keyframes float {
      0% { transform: translate(0, 0) rotate(0deg) scale(1); }
      50% { transform: translate(50vw, 50vh) rotate(180deg) scale(1.5); }
      100% { transform: translate(100vw, 100vh) rotate(360deg) scale(1); }
    }

    .card {
      background: rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(10px);
      border-radius: 15px;
      padding: 2rem;
      margin: 2rem 0;
      transform-style: preserve-3d;
      transition: all 0.5s;
      border: 2px solid rgba(255,255,255,0.2);
      position: relative;
      overflow: hidden;
    }

    .card::before {
      content: '';
      position: absolute;
      top: -50%;
      left: -50%;
      width: 200%;
      height: 200%;
      background: linear-gradient(
        45deg,
        transparent,
        rgba(255,255,255,0.1),
        transparent
      );
      transform: rotate(45deg);
      animation: shine 3s infinite;
    }

    @keyframes shine {
      0% { transform: translateX(-100%) rotate(45deg); }
      100% { transform: translateX(100%) rotate(45deg); }
    }

    .card:hover {
      transform: scale(1.05) rotateY(20deg) translateZ(50px);
      box-shadow: 20px 20px 50px rgba(0,0,0,0.3);
    }

    .reverse-text {
      direction: rtl;
      unicode-bidi: bidi-override;
      animation: rainbow 3s infinite;
    }

    .spinning-text {
      animation: spin 5s linear infinite;
      display: inline-block;
      font-size: 2.5em;
      text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    }

    @keyframes spin {
      from { transform: rotate(0deg) scale(1); }
      50% { transform: rotate(180deg) scale(1.5); }
      to { transform: rotate(360deg) scale(1); }
    }

    .maze {
      position: relative;
      width: 400px;
      height: 400px;
      margin: 2rem auto;
      background: rgba(255,255,255,0.1);
      border-radius: 10px;
      border: 3px solid rgba(255,255,255,0.3);
      overflow: hidden;
    }

    .maze-player {
      width: 30px;
      height: 30px;
      background: radial-gradient(circle, #ff0 0%, #f00 100%);
      position: absolute;
      border-radius: 50%;
      transition: all 0.2s;
      box-shadow: 0 0 20px rgba(255,255,0,0.5);
    }

    .maze-goal {
      width: 40px;
      height: 40px;
      background: radial-gradient(circle, #0f0 0%, #0ff 100%);
      position: absolute;
      border-radius: 50%;
      right: 20px;
      bottom: 20px;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% { transform: scale(1); opacity: 1; }
      50% { transform: scale(1.2); opacity: 0.8; }
      100% { transform: scale(1); opacity: 1; }
    }

    .button-chaos {
      padding: 1rem 2rem;
      border: none;
      border-radius: 15px;
      margin: 0.5rem;
      cursor: pointer;
      transition: all 0.3s;
      background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
      color: white;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 2px;
      box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }

    .button-chaos:hover {
      transform: scale(1.1) rotate(var(--rotation));
      background: linear-gradient(45deg, #4ecdc4, #ff6b6b);
      box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    }

    #random-mover {
      position: fixed;
      background: radial-gradient(circle, #ff0 0%, #f90 100%);
      width: 60px;
      height: 60px;
      border-radius: 50%;
      box-shadow: 0 0 30px rgba(255,255,0,0.5);
      z-index: 1000;
    }

    .mirror {
      transform: scaleX(-1);
      display: inline-block;
      animation: rainbow 3s infinite;
    }

    #score-display {
      position: fixed;
      top: 20px;
      right: 20px;
      font-size: 24px;
      color: white;
      background: rgba(0,0,0,0.5);
      padding: 10px 20px;
      border-radius: 10px;
      z-index: 1000;
    }

    .particle {
      position: fixed;
      pointer-events: none;
      animation: particle 1s forwards;
    }

    @keyframes particle {
      0% { transform: translate(0, 0) scale(1); opacity: 1; }
      100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
    }

    #mini-game {
      position: fixed;
      bottom: 20px;
      left: 20px;
      background: rgba(255,255,255,0.1);
      backdrop-filter: blur(10px);
      padding: 20px;
      border-radius: 15px;
      z-index: 1000;
    }

    .target {
      width: 30px;
      height: 30px;
      background: red;
      border-radius: 50%;
      position: absolute;
      cursor: pointer;
    }

    #portal-entrance, #portal-exit {
      position: fixed;
      width: 50px;
      height: 100px;
      background: radial-gradient(ellipse, #9c27b0 0%, transparent 70%);
      animation: portal-pulse 2s infinite;
    }

    @keyframes portal-pulse {
      0% { transform: scale(1); filter: hue-rotate(0deg); }
      50% { transform: scale(1.1); filter: hue-rotate(180deg); }
      100% { transform: scale(1); filter: hue-rotate(360deg); }
    }
  </style>
</head>
<body>
  <div class="custom-cursor"></div>
  <div id="score-display">Score: 0</div>
  <div class="floating-elements"></div>
  <div id="portal-entrance"></div>
  <div id="portal-exit"></div>

  <div class="container">
    <h1 class="spinning-text">🌀 Welcome to the Chaos! 🌀</h1>
    
    <div class="card">
      <h2 class="reverse-text">↔️ Can you read this? ↔️</h2>
      <p>Normal text is boring! <span class="mirror">Let's make it weird!</span></p>
      <div id="click-counter">Click anywhere to spawn particles!</div>
    </div>

    <div class="card">
      <h2>🎮 Maze Challenge 🎮</h2>
      <div class="maze" id="maze">
        <div class="maze-player" id="maze-player"></div>
        <div class="maze-goal" id="maze-goal"></div>
      </div>
    </div>

    <div class="card">
      <h2>🎯 Button Chaos Zone 🎯</h2>
      <div id="button-container"></div>
    </div>
  </div>

  <div id="random-mover"></div>
  <div id="mini-game">
    <h3>Mini Game: Click the Targets!</h3>
    <div id="game-container"></div>
  </div>

  <script>
    let score = 0;
    const scoreDisplay = document.getElementById('score-display');
    
    // Custom cursor with trail effect
    const cursor = document.querySelector('.custom-cursor');
    const cursorTrail = [];
    const maxTrailLength = 10;

    document.addEventListener('mousemove', (e) => {
      cursor.style.left = e.clientX + 'px';
      cursor.style.top = e.clientY + 'px';
      
      // Create trail effect
      const trail = document.createElement('div');
      trail.className = 'custom-cursor';
      trail.style.left = e.clientX + 'px';
      trail.style.top = e.clientY + 'px';
      trail.style.opacity = '0.5';
      trail.style.transform = 'scale(0.5)';
      document.body.appendChild(trail);
      cursorTrail.push(trail);

      if (cursorTrail.length > maxTrailLength) {
        const oldTrail = cursorTrail.shift();
        oldTrail.remove();
      }

      cursorTrail.forEach((trail, index) => {
        trail.style.opacity = (index / maxTrailLength).toString();
      });
    });

    // Floating elements with improved animation
    const emojis = ['🦄', '🌈', '🍕', '🎨', '🎭', '🎪', '🎡', '🎢', '🌟', '🎵', '🎪', '🎭'];
    const floatingElements = document.querySelector('.floating-elements');

    for (let i = 0; i < 30; i++) {
      const element = document.createElement('div');
      element.className = 'floating-element';
      element.textContent = emojis[Math.floor(Math.random() * emojis.length)];
      element.style.left = Math.random() * 100 + 'vw';
      element.style.top = Math.random() * 100 + 'vh';
      element.style.animationDelay = (Math.random() * 5) + 's';
      element.style.animationDuration = (5 + Math.random() * 10) + 's';
      floatingElements.appendChild(element);
    }

    // Enhanced maze game with collision detection
    const mazePlayer = document.getElementById('maze-player');
    const mazeGoal = document.getElementById('maze-goal');
    let playerPos = { x: 0, y: 0 };
    let isGameWon = false;

    function checkCollision() {
      const playerRect = mazePlayer.getBoundingClientRect();
      const goalRect = mazeGoal.getBoundingClientRect();

      if (
        playerRect.left < goalRect.right &&
        playerRect.right > goalRect.left &&
        playerRect.top < goalRect.bottom &&
        playerRect.bottom > goalRect.top &&
        !isGameWon
      ) {
        isGameWon = true;
        score += 100;
        scoreDisplay.textContent = `Score: ${score}`;
        alert('You won! +100 points');
        playerPos = { x: 0, y: 0 };
        updatePlayerPosition();
        isGameWon = false;
      }
    }

    function updatePlayerPosition() {
      mazePlayer.style.left = playerPos.x + 'px';
      mazePlayer.style.top = playerPos.y + 'px';
      checkCollision();
    }

    document.addEventListener('keydown', (e) => {
      const speed = 15;
      switch(e.key) {
        case 'ArrowUp':
          playerPos.y = Math.max(0, playerPos.y - speed);
          break;
        case 'ArrowDown':
          playerPos.y = Math.min(370, playerPos.y + speed);
          break;
        case 'ArrowLeft':
          playerPos.x = Math.max(0, playerPos.x - speed);
          break;
        case 'ArrowRight':
          playerPos.x = Math.min(370, playerPos.x + speed);
          break;
      }
      updatePlayerPosition();
    });

    // Random moving element with smooth animation
    const randomMover = document.getElementById('random-mover');
    function moveRandomElement() {
      const x = Math.random() * (window.innerWidth - 60);
      const y = Math.random() * (window.innerHeight - 60);
      gsap.to(randomMover, {
        x: x,
        y: y,
        duration: 2,
        ease: "power2.inOut",
        onComplete: moveRandom


you are a innovative software designer . complete this code and make it more craziers