${this.t('Shadbala')}
${this.t('{{count}} planets ranked by strength', { count: sorted.length })}
${renderFrameCaption(this.effectiveLang(), d.frame, this.translator)}
${sorted.map((p) => this.renderPlanetRow(p))}
${BALA_COMPONENTS.map(
(b) => html`
${this.t('{{component}} Bala', { component: this.t(b.source) })}
`,
)}
`;
}
private renderPlanetRow(p: Planet) {
const glyph = planetGlyph(p.planet) ?? '';
// Compute positive component values (drikBala can be negative)
const values = BALA_COMPONENTS.map((b) => Math.max(0, p[b.key] as number));
const total = values.reduce((s, v) => s + v, 0);
const isAdequate =
typeof p.strengthRatio === 'number' && p.strengthRatio >= 1;
const badgeClass = isAdequate
? 'adequacy-badge--adequate'
: 'adequacy-badge--weak';
const badgeLabel = isAdequate ? 'adequate' : 'weak';
const rupasStr =
formatNumber(this.effectiveLang(), p.totalRupas, 2) &&
formatNumber(this.effectiveLang(), p.minRequired, 2)
? `${formatNumber(this.effectiveLang(), p.totalRupas, 2)} / ${formatNumber(this.effectiveLang(), p.minRequired, 2)} R`
: '';
return html`