<!DOCTYPE html>
<html lang="id">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Undian Angka</title>
  <style>
    body {
      font-family: 'Segoe UI', sans-serif;
      text-align: center;
      padding: 2em;
      background: linear-gradient(to right, #83a4d4, #b6fbff);
    }
    h1 {
      color: #333;
    }
    #hasil {
      font-size: 4em;
      margin: 1em 0;
      color: #222;
    }
    button {
      padding: 1em 2em;
      font-size: 1.2em;
      border: none;
      border-radius: 10px;
      background-color: #007bff;
      color: white;
      cursor: pointer;
    }
    button:hover {
      background-color: #0056b3;
    }
  </style>
</head>
<body>

  <h1>🎲 Undian Angka</h1>
  <div id="hasil">❓</div>
  <button onclick="undi()">UNDIIII!</button>

  <script>
    function undi() {
      const angka = Math.floor(Math.random() * 10) + 1; // 1 sampai 10
      document.getElementById('hasil').textContent = angka;

      const suara = new Audio(`tts.php?text=${encodeURIComponent('Angka kamu adalah ' + angka)}&lang=id`);
      suara.play();
    }
  </script>

</body>
</html>
