Anchor the countdown to a real end timestamp instead of a plain per-tick decrement, and resync on visibilitychange so returning to a backgrounded tab shows the correct elapsed time immediately.
Anchor the countdown to a real end timestamp instead of a plain per-tick decrement, and resync on visibilitychange so returning to a backgrounded tab shows the correct elapsed time immediately.