.getElementById('brushes');
    brushesEl.addEventListener('click', (e)=>{
      const btn = e.target.closest('button[data-shape]');
      if (!btn) return;
      state.shape = btn.getAttribute('data-shape');
      brushesEl.querySelectorAll('button').forEach(b=>b.classList.remove('active'));
      btn.classList.add('active');
    });

    const sizeEl = document.getElementById('size');
    const sizeVal = document.getElementById('sizeVal');
    function syncSize(){ state.size = +sizeEl.value; sizeVal.textC