Save countup timestamp to local storage

I’m completely new to stack and code and just looking for some assistance on saving elapsed time for a game.
When a seperate endGame function runs on completing all remaining questions, I want to add in the capability to save the timecount to local storage (to be viewable on a leaderboard).

My understanding is that I should look to store the start timestamp and the time elapsed (I have a start onclick button, and relying on the seperate endGame() to execute clearInterval / stop timer and save the timecount to localStorage.

I found a similar thread How to save countup timer upon browser refresh? which I am working to incorporate a similar solve however, I’ve broken the 00:00 minute:second layout which doesn’t seem to increment upwards or downwards randomly both) and the start timestamp in console log shows a long string.

I think it may have something to do with how I’ve set up the selectors minutes and seconds, but any guidance or help would be much appreciated to get me on track! thank you

Link to codepen here ~

  <div class="timer">
    <span class="minutes">
      00
    </span>
    :
    <span class="seconds">
      00
    </span>
  </div>
</div>


    <button class="btn btn-lg btn-success" data-action="start">
      Start
    </button>

______________________________________


const btnStartElement = document.querySelector('[data-action="start"]');
const minutes = document.querySelector('.minutes');
const seconds = document.querySelector('.seconds');
let timerTime = 0;
// changes here
let intervalId = null;
let startTimestamp = 0;

const start = () => {
  isRunning = true;
  interval = setInterval(incrementTimer, 1000)
}

const pad = (number) => {
  return (number < 10) ? '0' + number : number;
}

const incrementTimer = () => {
  let totalSeconds = (Date.now() - startTimestamp) / 1000;
  timerTime++;
  const numberMinutes = Math.floor(timerTime / 60);
  const numberSeconds = totalSeconds - (timerTime % 60);
  console.log(localStorage)
  
  minutes.innerText = pad(numberMinutes);
  seconds.innerText = pad(numberSeconds);

}
{
    const _startTimestamp = localStorage.getItem("start-timestamp");
    if (_startTimestamp) {
        startTimestamp = Number(_startTimestamp);
        intervalId = setInterval(incrementTimer, 1000);
    }
}

btnStartElement.addEventListener('click', startTimer = () => {
  start();
   if (!intervalId) {
      startTimestamp = Date.now();
      localStorage.setItem("start-timestamp", startTimestamp);
      intervalId = setInterval(incrementTimer, 1000);

}
});