<div class="pf2e-hud-rk pf2e-hud-colors">
    <h4 class="action">
        <span class="pf2-icon larger">A</span>
        <strong>
            {{localize 'PF2E.RecallKnowledge.Label'}}
            {{#if alternate}}
            ({{alternate}})
            {{/if}}
        </strong>
    </h4>
    {{#if target}}
    <div class="target-dc">
        <span data-visibility="all" data-whose="target">{{@root.i18n 'target'}}:
            {{target.name}}</span>
    </div>
    {{/if}}
    <div class="tags">
        <span class="tag" data-slug="concentrate"
            data-description="PF2E.TraitDescriptionConcentrate">
            {{localize 'PF2E.TraitConcentrate'}}
        </span>
        <span class="tag" data-slug="secret" data-description="PF2E.TraitDescriptionSecret">
            {{localize 'PF2E.TraitSecret'}}
        </span>
    </div>
    <hr>
    {{!-- if target --}}
    {{#if target}}
    <div class="rk-skills" style="--nb-rows: {{add skills.length 2}};">
        <span></span>
        <span></span>
        <span class="header">{{@root.i18n 'first'}}</span>
        <span class="header">{{@root.i18n 'second'}}</span>
        <span class="header">{{@root.i18n 'third'}}</span>
        <span class="header">{{@root.i18n 'fourth'}}</span>

        <span class="header">{{@root.i18n 'skill'}}</span>
        <span></span>
        {{#each skillsDCs as |dc|}}
        <span class="header">{{#if dc}}{{@root.i18n 'dc'}} {{dc}}{{else}}-{{/if}}</span>
        {{/each}}

        {{#each skills as |skill|}}
        <span class="name rank {{skill.rank}}" data-tooltip="{{skill.rankLabel}}">
            {{skill.label}}
        </span>
        <u class="success {{@root.dieSuccess}}" data-tooltip="{{skill.tooltip}}">
            {{skill.total}}
        </u>
        {{#each skill.checks as |check|}}
        <span class="success {{check.success}}" data-tooltip="PF2E.Check.Result.Degree.Check.{{check.name}}">
            {{{check.icon}}}
        </span>
        {{/each}}
        {{/each}}
    </div>
    {{#if lores.length}}
    <hr>
    <div class="rk-lores" style="--nb-rows: 3;">
        <span class="header">{{@root.i18n 'lore'}}</span>
        <span class="header">{{@root.i18n 'first'}}</span>
        <span class="header">{{@root.i18n 'second'}}</span>
        <span class="header">{{@root.i18n 'third'}}</span>
        <span class="header">{{@root.i18n 'fourth'}}</span>
        <span class="header">{{@root.i18n 'fifth'}}</span>
        <span class="header">{{@root.i18n 'sixth'}}</span>

        {{#each loresDCs as |dcs|}}
        <span>
            {{#if @index}}
            {{@root.i18n 'specific'}}
            {{else}}
            {{@root.i18n 'unspecific'}}
            {{/if}}
        </span>
        {{#each dcs as |dc|}}
        <span>{{#if dc}}{{dc}}{{else}}-{{/if}}</span>
        {{/each}}
        {{/each}}
    </div>
    <hr>
    <div class="rk-lores-rolls" style="--nb-rows: {{add lores.length 1}};">
        <span class="header">{{@root.i18n 'lore'}}</span>
        <span class="header">{{@root.i18n 'proficiency'}}</span>
        <span class="header">{{@root.i18n 'modifier'}}</span>
        <span class="header">{{@root.i18n 'result'}}</span>
        {{> skillsRows skills=lores}}
    </div>
    {{/if}}
    {{!-- else no target --}}
    {{else}}
    <div class="rk" style="--nb-rows: {{add skills.length 1}};">
        <span class="header">{{@root.i18n 'skill'}}</span>
        <span class="header">{{@root.i18n 'proficiency'}}</span>
        <span class="header">{{@root.i18n 'modifier'}}</span>
        <span class="header">{{@root.i18n 'result'}}</span>
        {{> skillsRows skills=skills}}
    </div>
    {{!-- end if target --}}
    {{/if}}
</div>

{{#*inline 'skillsRows'}}
{{#each skills as |skill|}}
<span class="name">{{skill.label}}</span>
<span class="rank {{skill.rank}}">
    {{#if skill.rank includeZero=true}}
    {{skill.rankLabel}}
    {{else}}
    '-'
    {{/if}}
</span>
<span>{{skill.modifier}}</span>
<u class="success {{dieSuccess}}" data-tooltip="{{skill.tooltip}}">
    {{add @root.dieResult skill.mod}}
</u>
{{/each}}
{{/inline}}
