(function() {
  const el = document.getElementById('fortune-quote');
  if (!el) return;
  const quotes = JSON.parse(el.dataset.quotes);
  if (!quotes || quotes.length === 0) return;
  const q = quotes[Math.floor(Math.random() * quotes.length)];
  el.querySelector('.fortune-text').textContent = '"' + q.text + '"';
  el.querySelector('.fortune-author').textContent = '— ' + q.author;
})();
