// Doubling cube UI overlay
export function renderCubeDisplay(container, cubeValue, cubeOwner, myColor) {
  let existing = container.querySelector('.bgg-cube-display');
  if (!existing) {
    existing = document.createElement('div');
    existing.className = 'bgg-cube-display';
    container.appendChild(existing);
  }

  if (!cubeValue || cubeValue === 1) {
    existing.style.display = 'none';
    return;
  }

  existing.style.display = '';
  const position = cubeOwner === null ? 'center' : cubeOwner === myColor ? 'bottom' : 'top';

  existing.innerHTML = `
    <div class="bgg-cube bgg-cube-${position}">
      <span class="bgg-cube-val">${cubeValue}</span>
    </div>
  `;
}
