// Papeles Para Todos - Actualización del HUD

function updateDisplay() {
    if (!gameState) return;

    const diaEl = document.getElementById('hud-dia');
    if (diaEl) diaEl.textContent = `Jornada ${gameState.dia}/${TOTAL_DIAS}`;

    const scoreTotalEl = document.getElementById('hud-score-total');
    if (scoreTotalEl) scoreTotalEl.textContent = `${gameState.scoreTotal} pts`;

    const scoreDiaEl = document.getElementById('hud-score-dia');
    if (scoreDiaEl) scoreDiaEl.textContent = `+${gameState.scoreDia}`;

    const alineEl = document.getElementById('hud-alineacion');
    if (alineEl) {
        alineEl.textContent = `${gameState.alineacionMinisterial}%`;
        alineEl.className = 'hud-value';
        if (gameState.alineacionMinisterial >= 75) alineEl.classList.add('hud-good');
        else if (gameState.alineacionMinisterial <= 35) alineEl.classList.add('hud-bad');
    }

    const strikesEl = document.getElementById('hud-strikes');
    if (strikesEl) {
        strikesEl.innerHTML = '';
        for (let i = 0; i < STRIKES_MAX; i++) {
            const s = document.createElement('span');
            s.className = 'strike' + (i < gameState.strikes ? ' strike-filled' : '');
            s.textContent = '✖';
            strikesEl.appendChild(s);
        }
    }

    const progresoEl = document.getElementById('hud-progreso');
    if (progresoEl) {
        const total = gameState.pilaDia.length;
        const actual = Math.min(gameState.candidatoIndex, total);
        progresoEl.textContent = `${actual}/${total}`;
    }

    const aciertosOfEl = document.getElementById('hud-aciertos-oficiales');
    if (aciertosOfEl) {
        const aciertosOficiales = gameState.stats?.decisionesDiaActual?.aciertosOficiales || 0;
        aciertosOfEl.textContent = String(aciertosOficiales);
        aciertosOfEl.className = 'hud-value';
    }
}
