<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>
      <div class="weapon-badges">
        <span class="damage-formula-badge">{{damageLabel}} → {{baseDamageDice}}d6</span>
        <span class="roll-color-badge color-badge-{{damageColorType}}">{{damageColorLabel}} {{damageThreshold}}+</span>
        {{#if apValue}}<span class="ap-badge">AP{{apValue}}</span>{{/if}}
        {{#if isRanged}}<span class="range-badge">{{shortRange}}/{{longRange}}ft</span>{{/if}}
      </div>
      {{#if traits}}
      <div class="weapon-traits-row">
        {{#each traits}}<span class="trait-tag-sm">{{this}}</span>{{/each}}
      </div>
      {{/if}}
    </div>
  </div>

  {{!-- Attack roll config --}}
  <fieldset class="attack-options-block">
    <legend>{{localize "OATHHAMMER.Dialog.Attack"}}</legend>

    <div class="pool-info-line">
      {{skillLabel}} ({{attrLabel}} {{attrRank}}) + {{localize "OATHHAMMER.Label.SkillRank"}} {{skillRank}}
      {{#if autoAttackBonus}} + <span class="auto-bonus">+{{autoAttackBonus}} auto</span>{{/if}}
      = <strong>{{baseAttackPool}}d6</strong>
    </div>

    {{#if hasNimble}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.Attribute"}}</label>
      <select name="attrOverride">
        <option value="might">{{mightLabel}} ({{mightRank}})</option>
        <option value="agility">{{agilityLabel}} ({{agilityRank}}) — {{localize "OATHHAMMER.Dialog.NimbleHint"}}</option>
      </select>
    </div>
    {{/if}}

    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.AttackModifier"}}</label>
      <select name="attackBonus">
        {{#each attackBonusOptions}}<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>

    {{#if isRanged}}
    <div class="roll-option-block">
      <label class="roll-option-block-label">{{localize "OATHHAMMER.Dialog.RangeConditions"}}</label>
      <div class="range-conditions">
        {{#each rangeConditions}}
        <div class="roll-option-check">
          <input type="checkbox" id="{{name}}" name="{{name}}" value="true" />
          <label for="{{name}}">{{label}}</label>
        </div>
        {{/each}}
      </div>
    </div>
    {{/if}}

    <div class="roll-option-row roll-option-check">
      <label for="attackExplodeOn5">{{localize "OATHHAMMER.Dialog.ExplodeOn5"}}</label>
      <input type="checkbox" id="attackExplodeOn5" 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="attackLuckIsHuman">{{localize "OATHHAMMER.Dialog.LuckHuman"}}</label>
      <input type="checkbox" id="attackLuckIsHuman" 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>
