<section class="dnc-chat-card dnc-chat-card-damage">
  <header class="chat-card-header">
    <div class="chat-card-heading">
      <p class="chat-card-kicker">Impact</p>
      <h2>{{title}}</h2>
      {{#if subtitle}}<p class="chat-card-subtitle">{{subtitle}}</p>{{/if}}
    </div>
    <div class="chat-card-total">
      <span>Total</span>
      <strong>{{total}}</strong>
    </div>
  </header>
  <div class="chat-pill-row">
    {{#if modeLabel}}<span class="chat-pill">{{modeLabel}}</span>{{/if}}
    <span class="chat-pill success">Dé {{keptDieLabel}}</span>
    {{#if damageCapped}}<span class="chat-pill">{{localize "DNC.Chat.DamageCapped" damage=effectiveDamage dv=martialDvLabel}}</span>{{/if}}
  </div>
  <p class="chat-formula">{{formula}}</p>
  {{#if rollDieLabels.[1]}}
    <div class="chat-keyline">
      <span class="chat-keyline-label">Dés</span>
      <p class="roll-values">{{#each rollDieLabels}}<span>{{this}}</span>{{/each}}</p>
    </div>
  {{/if}}
  <p class="chat-note"><strong>Base</strong> : {{baseDamage}}{{#if damageCapped}} · <strong>{{localize "DNC.Chat.MartialDv"}}</strong> : {{martialDvLabel}} · <strong>{{localize "DNC.Chat.EffectiveDamage"}}</strong> : {{effectiveDamage}}{{/if}}</p>
  <div class="chat-targeting">
    <label class="chat-control">
      <span class="chat-keyline-label">Cible</span>
      <select class="chat-select" data-role="damage-target" {{#unless hasTargets}}disabled{{/unless}}>
        {{#if hasTargets}}
          {{#each targets}}
            <option value="{{this.tokenUuid}}"{{#if this.isSelected}} selected{{/if}}>{{this.label}}</option>
          {{/each}}
        {{else}}
          <option value="">Aucune cible sur la scène</option>
        {{/if}}
      </select>
    </label>
    <div class="chat-actions chat-actions-inline">
      <button type="button" class="chat-action-button" data-action="applyDamage" data-damage="{{total}}" data-use-armor="false" data-source-label="{{sourceLabel}}" {{#unless hasTargets}}disabled{{/unless}}>
        <i class="fa-solid fa-heart-crack"></i> Appliquer
      </button>
      <button type="button" class="chat-action-button" data-action="applyDamage" data-damage="{{total}}" data-use-armor="true" data-source-label="{{sourceLabel}}" {{#unless hasTargets}}disabled{{/unless}}>
        <i class="fa-solid fa-shield-halved"></i> Avec armure
      </button>
    </div>
  </div>
  {{#if showDamageUsageButton}}
    <div class="chat-actions">
      <button type="button" class="chat-action-button" data-action="rollDamageUsage" data-item-uuid="{{itemUuid}}">
        <i class="fa-solid fa-hourglass-half"></i> {{localize "DNC.Chat.RollDamageUsage"}}
      </button>
    </div>
  {{/if}}
</section>
