<div class="oh-roll-dialog oh-weapon-dialog">

  {{!-- Weapon header --}}
  <div class="weapon-header">
    <img src="{{weaponImg}}" class="weapon-img-sm" alt="{{weaponName}}" />
    <div class="weapon-header-info">
      <span class="weapon-name-lg">{{weaponName}}</span>
      {{#if traits}}
      <div class="weapon-traits-row">
        {{#each traits}}<span class="trait-tag-sm">{{this}}</span>{{/each}}
      </div>
      {{/if}}
    </div>
  </div>

  {{!-- Pool preview --}}
  <div class="pool-info-line">
    {{localize "OATHHAMMER.Skill.Defense"}} ({{localize "OATHHAMMER.Attribute.Agility"}} {{agiRank}})
    + {{localize "OATHHAMMER.Label.SkillRank"}} {{defRank}}
    {{#if armorPenalty}} {{armorPenalty}} {{localize "OATHHAMMER.Dialog.ArmorPenalty"}}{{/if}}
  </div>

  {{!-- Active trait indicators --}}
  {{#if hasParry}}
  <div class="oh-trait-info">
    <i class="fa-solid fa-shield-halved"></i>
    {{localize "OATHHAMMER.Dialog.ParryActive"}}{{#if (gte parryCount 2)}} (+1){{/if}}
  </div>
  {{/if}}
  {{#if hasBlock}}
  <div class="oh-trait-info">
    <i class="fa-solid fa-shield-halved"></i>
    {{localize "OATHHAMMER.Dialog.BlockActive"}}
  </div>
  {{/if}}

  <fieldset class="attack-options-block">
    <legend>{{localize "OATHHAMMER.Dialog.DefenseOptions"}}</legend>

    {{!-- Attack type --}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.AttackType"}}</label>
      <select name="attackType">
        {{#each attackTypeOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
    </div>

    {{!-- Governing attribute (melee can use Might) --}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.GoverningAttr"}}</label>
      <select name="attribute">
        {{#each attrOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.MightMeleeHint"}}</span>
    </div>

    {{!-- Diminishing defense penalty --}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.DiminishingDefense"}}</label>
      <select name="diminish">
        {{#each diminishOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.DiminishingDefenseHint"}}</span>
    </div>

    {{!-- Manual bonus/penalty --}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.Modifier"}}</label>
      <select name="bonus">
        {{#each bonusOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.AttackModifierHint"}}</span>
    </div>

    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.DiceColor"}}</label>
      <select name="colorOverride">
        {{#each colorOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.DiceColorHint"}}</span>
    </div>

    <div class="roll-option-row roll-option-check">
      <label for="defenseExplodeOn5">{{localize "OATHHAMMER.Dialog.ExplodeOn5"}}</label>
      <input type="checkbox" id="defenseExplodeOn5" name="explodeOn5" />
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.ExplodeOn5Hint"}}</span>
    </div>

    {{#if availableLuck}}
    <div class="roll-option-row roll-option-luck">
      <label>{{localize "OATHHAMMER.Dialog.LuckSpend"}} <i class="fa-solid fa-clover luck-icon"></i></label>
      <select name="luckSpend">
        {{#each luckOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <label class="luck-human-label" for="defenseLuckIsHuman">{{localize "OATHHAMMER.Dialog.LuckHuman"}}</label>
      <input type="checkbox" id="defenseLuckIsHuman" name="luckIsHuman" value="true" {{#if isHuman}}checked{{/if}} />
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.LuckHint"}} ({{availableLuck}} {{localize "OATHHAMMER.Dialog.Available"}})</span>
    </div>
    {{/if}}

  </fieldset>

  {{!-- Visibility --}}
  <fieldset class="roll-visibility-block">
    <legend>{{localize "OATHHAMMER.Dialog.Visibility"}}</legend>
    <select name="visibility">
      {{selectOptions rollModes selected=visibility localize=true}}
    </select>
  </fieldset>

</div>
