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

  {{!-- Miracle header --}}
  <div class="spell-header">
    <img src="{{miracleImg}}" class="weapon-img-sm" alt="{{miracleName}}" />
    <div class="spell-header-info">
      <span class="weapon-name-lg">{{miracleName}}</span>
      <div class="weapon-badges">
        {{#if isRitual}}
          <span class="dv-badge">DV {{dv}} — {{localize "OATHHAMMER.Label.Ritual"}}</span>
        {{else}}
          <span class="dv-badge">DV = {{localize "OATHHAMMER.Dialog.MiracleDVNote"}}</span>
        {{/if}}
        <span class="tradition-badge">{{traditionLabel}}</span>
        {{#if range}}<span class="range-badge">{{range}}</span>{{/if}}
        {{#if duration}}<span class="duration-badge">{{duration}}</span>{{/if}}
      </div>
      {{#if spellSave}}<div class="save-info">{{localize "OATHHAMMER.Label.SpellSave"}}: {{spellSave}}</div>{{/if}}
    </div>
  </div>

  {{!-- Failure warning --}}
  <div class="miracle-warning">
    <i class="fa-solid fa-triangle-exclamation"></i>
    {{localize "OATHHAMMER.Dialog.MiracleFailWarning"}}
  </div>

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

    <div class="pool-info-line">
      {{localize "OATHHAMMER.Skill.Magic"}} ({{localize "OATHHAMMER.Attribute.Willpower"}} {{wpRank}})
      + {{localize "OATHHAMMER.Label.SkillRank"}} {{magicRank}}
      = <strong>{{basePool}}d6</strong>
    </div>

    {{#unless isRitual}}
    <div class="roll-option-row">
      <label>{{localize "OATHHAMMER.Dialog.MiracleCount"}}</label>
      <select name="miracleCount">
        {{#each miracleCountOptions}}<option value="{{value}}"{{#if selected}} selected{{/if}}>{{label}}</option>{{/each}}
      </select>
      <span class="roll-option-hint">{{localize "OATHHAMMER.Dialog.MiracleCountHint"}}</span>
    </div>
    {{/unless}}

    <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>

    {{#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="miracleLuckIsHuman">{{localize "OATHHAMMER.Dialog.LuckHuman"}}</label>
      <input type="checkbox" id="miracleLuckIsHuman" 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}}

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

  </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>
