<div class="coc7 chat-card chat-card-v2 roll-card opposed {{#if combat}}combat{{/if}}">
  <div class="title flexrow-coc7">
    <div class="opposed-card-flag gm-visible-only {{#if combat}}active{{/if}}">
      <a data-action='toggle-combat'><i class="game-icon game-icon-crossed-swords"></i></a>
    </div>
    <div>{{localize 'CoC7.OpposedRollCard'}} {{#if isAttackManeuver}}({{localize 'CoC7.AttackManeuver'}}){{/if}}</div>
  </div>

  {{#if combat}}
    {{#if closed}}
      <div>
        {{#if isTie}}<span class="tag">{{localize 'CoC7.Tie'}}</span>{{/if}}
        {{#if needsTieBreaker}}
          {{#if advantageAttacker}}<span class="tag">{{localize 'CoC7.AdvantageAttacker'}}</span>{{/if}}
          {{#if advantageDefender}}<span class="tag">{{localize 'CoC7.AdvantageDefender'}}</span>{{/if}}
        {{/if}}
        {{#if defenderIsDodging}}<span class="tag">Defender is dodging</span>{{/if}}
      </div>
    {{else}}
      {{#if needsTieBreaker}}
        <div class="flexrow-coc7 gm-visible-only toggle">
          <span class="flex1 toggle-switch gm-select-only {{#if advantageAttacker}}switched-on{{/if}} " title="{{localize 'CoC7.AdvantageAttacker'}}" data-flag="advantageAttacker" data-selected={{advantageAttacker}}>{{localize 'CoC7.AdvantageAttacker'}}</span>
          <span class="flex1 toggle-switch gm-select-only {{#if advantageDefender}}switched-on{{/if}}" title="{{localize 'CoC7.AdvantageDefender'}}" data-flag="advantageDefender" data-selected={{advantageDefender}}>{{localize 'CoC7.AdvantageDefender'}}</span>
        </div>
        <div class='user-visible-only'>
          {{#if advantageAttacker}}
            <span class="tag">{{localize 'CoC7.AdvantageAttacker'}}</span>
          {{/if}}
          {{#if advantageDefender}}
            <span class="tag">{{localize 'CoC7.AdvantageDefender'}}</span>
          {{/if}}
        </div>
      {{/if}}
    {{/if}}
  {{else}}
    <div>
      {{#if isTie}}<span class="tag">{{localize 'CoC7.Tie'}}</span>{{/if}}
    </div>
  {{/if}}

  <ol>
    {{#each rolls as |r id| }}
      <li class='actor-roll{{#if r.winner}} won{{/if}}{{#if r.tie}} tie{{/if}}{{#if r.attacker}} attacker{{/if}}' data-rank='{{id}}' data-actor-key="{{r.actor.actorKey}}">
        <img class="open-actor" data-actor-key="{{r.actor.actorKey}}" src="{{rollActorImg r.actorKey}}" title="{{r.actor.name}}" />
        <div class="roll-details">
          <div class="header">
            <div class='name'>
              {{#if r.item}}
                <span class="tag">{{r.item.name}}</span>
              {{else}}
                <span class="tag">{{r.shortName}}</span>
              {{/if}}
              {{#if r.maneuver}}
                <span class='tag'>{{localize 'CoC7.WeaponProperyManeuver'}} ({{localize 'CoC7.Build'}}: {{r.actor.build}})</span>
              {{/if}}
            </div>
            {{#unless ../closed}}
              <a class="gm-visible-only" data-action="remove-roll" title="{{localize 'CoC7.remove'}}"><i class="far fa-times-circle"></i></a>
            {{/unless}}
          </div>
          {{#if r.rolled}}
            {{#if ../combat}}
              {{#if ../closed}}
                {{{r._htmlRoll}}}
              {{else}}
                <div class='flexrow-coc7 owner-only'>{{{r._htmlRoll}}}</div>
              {{/if}}
            {{else}}
              {{{r._htmlRoll}}}
            {{/if}}
          {{else}}
            {{#if r.rawValue}}
              <div class='card-buttons actor-card-buttons owner-only'>
                <button data-action='roll-check'>{{ r.fullName }}: ({{r.rawValue}}%)</button>
              </div>
            {{else}}
              <div class='card-buttons actor-card-buttons'>
                <button data-action='roll-check'>{{ r.fullName }}</button>
              </div>
            {{/if}}
          {{/if}}
        </div>
      </li>
    {{/each}}
  </ol>

  {{#if resultText}}
    <div class='card-result'>{{resultText}}</div>
  {{/if}}

  {{#unless closed}}
    {{#if winnerRollsDamage}}
      <div class='card-buttons gm-visible-only'>
        <button data-action='roll-damage'>{{localize 'CoC7.RollDamage'}}</button>
      </div>
    {{else}}
      <div class='card-buttons gm-visible-only'>
        <button data-action='close-card'>{{localize 'CoC7.CloseCard'}}</button>
      </div>
    {{/if}}
  {{/unless}}
</div>