{{! Template for opposed roll result }}
<div class="cthulhu-eternal-roll opposed-roll-result">
  <div class="opposed-header">
    <h3>{{localize "CTHULHUETERNAL.Label.opposedRollResult"}}</h3>
  </div>

  <div class="opposed-content">
    <div class="opposed-winner">
      <div class="character-info">
        <img src="{{winner.actor.img}}" alt="{{winner.actor.name}}" />
        <div class="character-name">
          <strong>{{localize "CTHULHUETERNAL.Label.opposedRollWinner"}}</strong>
          <span class="winner-name">{{winner.actor.name}}</span>
        </div>
      </div>
      <div class="roll-result winner-result">
        <span class="roll-value">{{winner.rollData.rollResult}}</span>
        {{#if winner.rollData.isCritical}}
          <span class="critical-badge">{{localize
              "CTHULHUETERNAL.Label.critical"
            }}</span>
        {{/if}}
      </div>
    </div>

    <div class="versus-separator">
      <i class="fas fa-swords"></i>
      <span>{{localize "CTHULHUETERNAL.Label.defeats"}}</span>
    </div>

    <div class="opposed-loser">
      <div class="character-info">
        <img src="{{loser.actor.img}}" alt="{{loser.actor.name}}" />
        <div class="character-name">
          <span class="loser-name">{{loser.actor.name}}</span>
        </div>
      </div>
      <div class="roll-result loser-result">
        <span class="roll-value">{{loser.rollData.rollResult}}</span>
        {{#if loser.rollData.isCritical}}
          <span class="critical-badge">{{localize
              "CTHULHUETERNAL.Label.critical"
            }}</span>
        {{/if}}
      </div>
    </div>
  </div>

  {{#if canApplyDamage}}
    <div class="chat-actions">
      <a
        class="damage-roll chat-action-button"
        data-roll-value="{{winner.rollData.weapon.system.damage}}"
        data-tooltip="{{localize 'CTHULHUETERNAL.Label.rollDamage'}}"
      >
        {{#if (eq winner.rollData.weapon.system.weaponType "rangedfirearm")}}
          <i class="fa-solid fa-gun"></i>
        {{else}}
          <i class="fa-solid fa-sword"></i>
        {{/if}}
      </a>
    </div>
  {{/if}}
</div>