<article class="mgne-chat-card mode-{{modeClass}} {{#if outcomeClass}}outcome-{{outcomeClass}}{{/if}}"
  {{#if showApplyButton}}data-damage-total="{{damageTotal}}" data-damage-critical="{{damageCritical}}"{{/if}}>
  <header class="chat-card-header">
    {{#if actorImg}}<img src="{{actorImg}}" alt="{{actorName}}" />{{/if}}
    <div>
      <h3>{{label}}</h3>
      <p class="chat-actor">{{actorName}}</p>
    </div>
  </header>
  <div class="chat-card-body">
    {{#if subtitle}}<p class="chat-subtitle"><strong>{{subtitle}}</strong></p>{{/if}}
    {{#if formula}}<p class="chat-formula"><code>{{formula}}</code></p>{{/if}}
    {{#if outcome}}
    <div class="chat-outcome {{#if diceTooltip}}has-tooltip{{/if}}" role="button" tabindex="0" data-action="toggle-dice-tooltip">
      <span class="chat-outcome-label">{{outcome}}</span>
      <span class="chat-outcome-total">{{total}}</span>
      {{#if diceTooltip}}<i class="chat-tooltip-icon fa-solid fa-dice"></i>{{/if}}
    </div>
    {{else if total}}
    <div class="chat-damage-total {{#if diceTooltip}}has-tooltip{{/if}}" role="button" tabindex="0" data-action="toggle-dice-tooltip">
      {{total}}
      {{#if diceTooltip}}<i class="chat-tooltip-icon fa-solid fa-dice"></i>{{/if}}
    </div>
    {{/if}}
    {{#if diceTooltip}}
    <div class="chat-dice-tooltip" hidden>{{{diceTooltip}}}</div>
    {{/if}}
    {{#if specialText}}<p class="chat-special">{{specialText}}</p>{{/if}}
    {{#if omenNeutralizeReminder}}<p class="chat-omen-remind chat-omen-neutralize">💡 {{omenNeutralizeReminder}}</p>{{/if}}
    {{#if omenRerollReminder}}<p class="chat-omen-remind">💡 {{omenRerollReminder}}</p>{{/if}}
    {{#if omenMaximized}}<p class="chat-omen-used">★ {{localize "MGNE.Roll.OmenMaximizedDamage"}}</p>{{/if}}
    {{#if showOmenRerollButton}}
    <div class="chat-card-actions">
      <button type="button" class="mgne-omen-reroll-btn"
        data-actor-id="{{omenRerollActorId}}"
        data-ability-id="{{omenRerollAbilityId}}"
        data-label="{{omenRerollLabel}}"
        data-base-dr="{{omenRerollBaseDR}}"
        data-modifier="{{omenRerollModifier}}"
        data-roll-type="{{omenRerollRollType}}"
        {{#if omenRerollItemId}}data-item-id="{{omenRerollItemId}}"{{/if}}>
        <i class="fa-solid fa-star"></i>
        {{localize "MGNE.Roll.RerollWithOmen"}}
      </button>
    </div>
    {{/if}}
    {{#if showDamageButton}}
    <div class="chat-card-actions">
      <button type="button" class="mgne-roll-damage-btn {{#if damageCritical}}is-critical{{/if}}"
        data-actor-id="{{damageActorId}}"
        data-item-id="{{damageItemId}}">
        <i class="fa-solid fa-burst"></i>
        {{localize "MGNE.Roll.RollDamage"}}
        <span class="dmg-formula">({{damageFormula}}{{#if damageCritical}} ×2{{/if}})</span>
      </button>
    </div>
    {{/if}}
    {{#if showApplyButton}}
    <div class="chat-card-actions chat-apply-actions">
      <select class="mgne-apply-damage-select">
        <option value="">— {{localize "MGNE.Roll.ApplyTo"}} —</option>
      </select>
    </div>
    {{/if}}
  </div>
</article>
