function startGame() {




    // Button Bar
    addButtonsToButtonBar();
    addButtonsToButtonBar_sub();
    addButtonsToButtonBar_sub_more();
    add_stats_bar();

    const quickBoard = q_rouletteTable();
    
    inputBar.appendChild(quickBoard);

    updateBorderVisibility();


}

function runAfterUpdates()
{
  updateBuildMissAllNewNumber();
  showHistoryBoard();
  updatePatternNewNumber();
  v_number_container_update();
  update_alert();
  onSpin_frequency();
  update_stats();
  bouncyUpdate();
  comboUpdate();
  statsAfterSpin();
	updateBorderVisibility();
  updateNumbersCount();
}

function updateNumbersCount() {
  const span = document.getElementById('numbers-count');
  if (span) {
    span.textContent = `Count: ${numbers.length}`;
  }
}

document.addEventListener('DOMContentLoaded', function() {
  var myTable = document.getElementById('quick-table');
  var lastTapTime = 0;
  
  myTable.addEventListener('touchend', function(event) {
      var currentTime = new Date().getTime();
      var tapLength = currentTime - lastTapTime;
      if (tapLength < 300 && tapLength > 0) { // Adjust threshold as needed, 300ms is typical
          event.preventDefault(); // Prevents the double-tap zoom

      }
      lastTapTime = currentTime;
  });

  setupCoordinateDisplay();
});

function setupCoordinateDisplay() {
  const table = document.getElementById('rouletteTable');
  const coordsDisplay = document.getElementById('coords');

  table.addEventListener('mousemove', function(event) {
      // Calculate the coordinates relative to the element
      const rect = table.getBoundingClientRect();
      const x = event.clientX - rect.left; // x position within the element.
      const y = event.clientY - rect.top;  // y position within the element.

      // Display the coordinates
      coordsDisplay.style.display = 'block';
      coordsDisplay.style.left = `${event.clientX + 10}px`; // Offset by 10px to not overlap cursor
      coordsDisplay.style.top = `${event.clientY + 10}px`;
      coordsDisplay.textContent = `x: ${x}, y: ${y}`;
  });

  table.addEventListener('mouseleave', function() {
      coordsDisplay.style.display = 'none'; // Hide the coordinate display when not over the table
  });
}

function updateImageSize(img) {
  
}