<div class="les-oublies-roll-dialog">
  <div class="sheet-grid sheet-grid-2">
    <section class="sheet-card">
      <h2>{{title}}</h2>
      <div class="field-row">
        <label>Difficulté attaquant</label>
        <input name="attackerDifficulty" type="number" value="{{values.attackerDifficulty}}" />
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.rolls.rollMode"}}</label>
        <select name="attackerRollMode">
          {{#each rollModes as |mode|}}
            <option value="{{mode.value}}" {{#if (eq mode.value @root.values.attackerRollMode)}}selected{{/if}}>{{mode.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.rolls.extraDie"}}</label>
        <select name="attackerExtraDie">
          {{#each extraDieModes as |mode|}}
            <option value="{{mode.value}}" {{#if (eq mode.value @root.values.attackerExtraDie)}}selected{{/if}}>{{mode.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>Prime</label>
        <select name="primeId">
          {{#each primeOptions as |option|}}
            <option value="{{option.value}}" {{#if (eq option.value @root.values.primeId)}}selected{{/if}}>{{option.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>Pénalité</label>
        <select name="penaltyId">
          {{#each penaltyOptions as |option|}}
            <option value="{{option.value}}" {{#if (eq option.value @root.values.penaltyId)}}selected{{/if}}>{{option.label}}</option>
          {{/each}}
        </select>
      </div>
      {{#if showIntimidateOptions}}
        <div class="field-row">
          <label>Effet</label>
          <select name="outcomeChoice">
            <option value="initiative">-4 initiative</option>
            <option value="action">-3 prochaine action</option>
            <option value="reaction">-3 prochaine réaction</option>
          </select>
        </div>
      {{/if}}
      {{#if showEvaluateOptions}}
        <div class="field-row">
          <label>Paramètre visé</label>
          <input name="targetLabel" type="text" value="{{values.targetLabel}}" />
        </div>
      {{/if}}
      {{#if showGrappleOptions}}
        <div class="field-row">
          <label>Suite</label>
          <select name="outcomeChoice">
            <option value="silence">Réduire au silence</option>
            <option value="otage">Prendre en otage</option>
            <option value="conforter">Conforter sa prise</option>
            <option value="etouffer">Étouffer</option>
            <option value="attacher">Attacher</option>
          </select>
        </div>
      {{/if}}
      <div class="field-row">
        <label>Notes</label>
        <input name="notes" type="text" value="{{values.notes}}" />
      </div>
      <p class="help-text">{{hint}}</p>
      <p class="help-text">{{localize "LESOUBLIES.rolls.resourceState"}} : Songes {{attackerResources.songesPoints}} / {{attackerResources.songesValue}} · Cauchemar {{attackerResources.cauchemarPoints}} / {{attackerResources.cauchemarValue}}</p>
    </section>

    <section class="sheet-card">
      <h2>{{localize "LESOUBLIES.rolls.defender"}}</h2>
      <p class="help-text target-status" data-target-status data-state="{{targetStatus.state}}">{{targetStatus.message}}</p>
      <div class="field-row">
        <label>Adversaire</label>
        <select name="defenderActorId">
          {{#each targetOptions as |entry|}}
            <option value="{{entry.value}}" {{#if (eq entry.value @root.values.defenderActorId)}}selected{{/if}}>{{entry.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>Compétence adverse</label>
        <input type="text" value="{{defenderSkillLabel}}" readonly />
      </div>
      <div class="field-row">
        <label>Cible</label>
        <input name="defenderLabel" type="text" value="{{values.defenderLabel}}" />
      </div>
      <div class="field-row">
        <label>Score défense</label>
        <input name="defenderScore" type="number" value="{{values.defenderScore}}" />
      </div>
      <div class="field-row">
        <label>Difficulté défense</label>
        <input name="defenderDifficulty" type="number" value="{{values.defenderDifficulty}}" />
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.rolls.rollMode"}}</label>
        <select name="defenderRollMode">
          {{#each rollModes as |mode|}}
            <option value="{{mode.value}}" {{#if (eq mode.value @root.values.defenderRollMode)}}selected{{/if}}>{{mode.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.rolls.extraDie"}}</label>
        <select name="defenderExtraDie">
          {{#each extraDieModes as |mode|}}
            <option value="{{mode.value}}" {{#if (eq mode.value @root.values.defenderExtraDie)}}selected{{/if}}>{{mode.label}}</option>
          {{/each}}
        </select>
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.ui.songes"}}</label>
        <input name="defenderSongesValue" type="number" value="{{defenderResources.songesValue}}" />
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.labels.pointsSonges"}}</label>
        <input name="defenderSongesPoints" type="number" value="{{defenderResources.songesPoints}}" />
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.ui.cauchemar"}}</label>
        <input name="defenderCauchemarValue" type="number" value="{{defenderResources.cauchemarValue}}" />
      </div>
      <div class="field-row">
        <label>{{localize "LESOUBLIES.labels.pointsCauchemar"}}</label>
        <input name="defenderCauchemarPoints" type="number" value="{{defenderResources.cauchemarPoints}}" />
      </div>
      <p class="help-text">Vous pouvez choisir un adversaire depuis la liste ou conserver la saisie manuelle des valeurs.</p>
    </section>
  </div>
</div>
