// Shared ZERO ERROR game. Loaded before the main application.
function ZeroErrorBrandMark({ white = false, className = '' }) {
const primary = window.ZERO_ERROR_CONFIG?.brand?.[white ? 'whiteMark' : 'blackMark'];
const fallback = white ? 'blanco.png' : 'negro.png';
const [src, setSrc] = React.useState(primary || fallback);
return { if (src !== fallback) setSrc(fallback); else event.currentTarget.style.visibility = 'hidden'; }} />;
}
function ZeroErrorFigure({ state }) {
return
{contextLabel || exercise?.title}
{state === 'ready' &&{training ? 'Tres preguntas. Un solo error anula los tres puntos. Después continúa tu ruta.' : `Supera las ${questions.length} preguntas sin fallar para desbloquear la siguiente casilla.`}
{secondsPerQuestion > 0 &&{secondsPerQuestion} segundos por pregunta.
}{state === 'won' ? `${questions.length} de ${questions.length}. Cero errores.` : training ? '0 de 3 puntos. Tu ruta continúa.' : 'Esta casilla sigue pendiente. Vuelve a intentarlo desde el mapa.'}
{!training && state === 'lost' && lastAnswer?.isCorrect === false &&{lastAnswer.explanation}