/* ═══════════════════════════════════════
ТАЙМЕР — ИСПРАВЛЕННЫЙ
═══════════════════════════════════════ */
var endDate = new Date('2025-06-15T23:59:59').getTime();
function hpPad(n) {
return n < 10 ? '0' + n : '' + n;
}
function hpUpdateTimer() {
var now = Date.now();
var diff = Math.max(0, endDate - now);
var d = Math.floor(diff / 86400000);
var h = Math.floor((diff % 86400000) / 3600000);
var m = Math.floor((diff % 3600000) / 60000);
var s = Math.floor((diff % 60000) / 1000);
var el;
el = document.getElementById('hp-timer-days');
if (el) el.textContent = hpPad(d);
el = document.getElementById('hp-timer-hours');
if (el) el.textContent = hpPad(h);
el = document.getElementById('hp-timer-mins');
if (el) el.textContent = hpPad(m);
el = document.getElementById('hp-timer-secs');
if (el) el.textContent = hpPad(s);
}
hpUpdateTimer();
setInterval(hpUpdateTimer, 1000);