import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App.jsx';
import engine from './audio/AudioEngine.js';
import { useStore } from './state/store.js';
import './styles/global.css';

// Connect the audio engine to the store once, before anything renders.
// (The engine never imports the store — this is the one wiring point.)
engine.connectStore(useStore);

createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
);
