<div class="les-oublies-chat-card is-initiative">
  <header class="chat-card-header">
    <div class="chat-card-banner">
      <img class="chat-card-portrait" src="{{actor.img}}" alt="{{actor.name}}" />
      <div class="chat-card-heading">
        <p class="chat-card-kicker">{{localize "LESOUBLIES.rolls.test"}}</p>
        <h3>{{localize "LESOUBLIES.rolls.initiative"}}</h3>
        <p class="chat-card-subtitle"><strong>{{actor.name}}</strong> · {{result.rollModeLabel}}</p>
      </div>
      <div class="chat-card-badge neutral">{{result.initiativeScore}}</div>
    </div>
  </header>

  <section class="chat-card-body">
    <div class="roll-summary-grid">
      <div><span>{{localize "LESOUBLIES.rolls.score"}}</span><strong>{{result.score}}</strong></div>
      <div><span>{{localize "LESOUBLIES.rolls.natural"}}</span><strong>{{result.natural}}</strong></div>
      <div><span>{{localize "LESOUBLIES.rolls.final"}}</span><strong>{{result.final}}</strong></div>
      <div><span>{{localize "LESOUBLIES.rolls.initiative"}}</span><strong>{{result.initiativeScore}}</strong></div>
      <div><span>{{localize "LESOUBLIES.rolls.threshold"}}</span><strong>{{result.threshold}}+</strong></div>
      <div><span>{{localize "LESOUBLIES.rolls.margin"}}</span><strong>{{numberFormat result.margin sign=true}}</strong></div>
    </div>

    <p class="roll-formula"><strong>{{localize "LESOUBLIES.rolls.resolution"}}</strong> : {{result.natural}} + {{result.score}} = {{result.final}}, puis initiative = {{result.initiativeScore}}</p>

    <div class="dice-strip">
      {{#each result.dice as |die|}}
        <div class="die-chip {{#if (eq die.index @root.result.selectedDie.index)}}selected{{/if}}">
          <strong>{{die.typeLabel}}</strong>
          <span>{{die.breakdown}}</span>
          {{#if die.exploded}}<em>{{localize "LESOUBLIES.rolls.exploded"}}</em>{{/if}}
        </div>
      {{/each}}
    </div>

    <div class="chat-callouts">
      <div class="chat-callout">
        <span>{{localize "LESOUBLIES.rolls.selectedDie"}}</span>
        <strong>{{result.selectedSummary}}</strong>
        <em>{{result.choiceLabel}}</em>
      </div>
      <div class="chat-callout">
        <span>{{localize "LESOUBLIES.rolls.debt"}}</span>
        <strong>{{result.debt.label}}</strong>
      </div>
      {{#if result.spentResource}}
        <div class="chat-callout">
          <span>{{localize "LESOUBLIES.rolls.extraDie"}}</span>
          <strong>{{result.spentResource.label}}</strong>
        </div>
      {{/if}}
    </div>
  </section>
</div>
