<section class="flexcol cde-sheet cde-actor {{cssClass}}">
  <header class="cde-header cde-actor-header">
    <img class="profile-img" src="{{actor.img}}" data-action="editImage" data-edit="img" title="{{actor.name}}" />
    <div class="header-fields">
      <div class="cde-header-top">
        <h1 class="charname">
          <input name="name" type="text" value="{{actor.name}}" placeholder="{{ localize 'CDE.NPCName' }}" />
        </h1>
      </div>
      <div class="cde-grid two">
        <div class="cde-field">
          <label>{{ localize "CDE.TypeOfCreature" }}</label>
          <select name="system.type">
            <option value="" {{#if (eq systemData.type "")}}selected{{/if}}>—</option>
            <option value="mortel" {{#if (eq systemData.type "mortel")}}selected{{/if}}>{{ localize "CDE.CreatureMortel" }}</option>
            <option value="demon" {{#if (eq systemData.type "demon")}}selected{{/if}}>{{ localize "CDE.CreatureDemon" }}</option>
            <option value="esprit" {{#if (eq systemData.type "esprit")}}selected{{/if}}>{{ localize "CDE.CreatureEsprit" }}</option>
            <option value="esprit-animal" {{#if (eq systemData.type "esprit-animal")}}selected{{/if}}>{{ localize "CDE.CreatureEspritAnimal" }}</option>
            <option value="fantome" {{#if (eq systemData.type "fantome")}}selected{{/if}}>{{ localize "CDE.CreatureFantome" }}</option>
            <option value="jiugwaai" {{#if (eq systemData.type "jiugwaai")}}selected{{/if}}>{{ localize "CDE.CreatureJiugwaai" }}</option>
            <option value="dieu" {{#if (eq systemData.type "dieu")}}selected{{/if}}>{{ localize "CDE.CreatureDieu" }}</option>
          </select>
        </div>
        <div class="cde-field">
          <label>{{ localize "CDE.Nuisance" }}</label>
          <select name="system.nuisance">
            <option value="0" {{#if (eq systemData.nuisance 0)}}selected{{/if}}>{{ localize "CDE.Figurant" }}</option>
            <option value="1" {{#if (eq systemData.nuisance 1)}}selected{{/if}}>{{ localize "CDE.Minion" }}</option>
            <option value="2" {{#if (eq systemData.nuisance 2)}}selected{{/if}}>{{ localize "CDE.Adversary" }}</option>
            <option value="3" {{#if (eq systemData.nuisance 3)}}selected{{/if}}>{{ localize "CDE.Ally" }}</option>
            <option value="4" {{#if (eq systemData.nuisance 4)}}selected{{/if}}>{{ localize "CDE.Boss" }}</option>
            <option value="5" {{#if (eq systemData.nuisance 5)}}selected{{/if}}>{{ localize "CDE.Divinity" }}</option>
          </select>
        </div>
      </div>
      <div class="cde-grid two">
        <div class="cde-field">
          <label>{{ localize "CDE.Threat" }}</label>
          <select name="system.threat">
            <option value="0" {{#if (eq systemData.threat 0)}}selected{{/if}}>{{ localize "CDE.Profane" }}</option>
            <option value="1" {{#if (eq systemData.threat 1)}}selected{{/if}}>{{ localize "CDE.Apprentice" }}</option>
            <option value="2" {{#if (eq systemData.threat 2)}}selected{{/if}}>{{ localize "CDE.Initiate" }}</option>
            <option value="3" {{#if (eq systemData.threat 3)}}selected{{/if}}>{{ localize "CDE.Accomplished" }}</option>
            <option value="4" {{#if (eq systemData.threat 4)}}selected{{/if}}>{{ localize "CDE.Renowned" }}</option>
          </select>
        </div>
        <div class="cde-initiative-card">
          <div class="cde-initiative-header">
            <i class="fa-solid fa-bolt cde-initiative-icon"></i>
            <span class="cde-initiative-title">{{ localize "CDE.Initiative" }}</span>
          </div>
          <div class="cde-initiative-controls">
            <button
              type="button"
              class="click-initiative-npc cde-init-btn cde-init-btn--minus"
              data-libel-id="minus"
              title="{{ localize 'CDE.MinusInitiative' }}"
            ><i class="fa-solid fa-chevron-down"></i></button>
            <div class="cde-initiative-values">
              <span class="cde-initiative-value">{{systemData.initiative}}</span>
              <span class="cde-anti-initiative-value"><i class="fa-solid fa-ranking-star"></i> {{systemData.anti_initiative}}</span>
            </div>
            <button
              type="button"
              class="click-initiative-npc cde-init-btn cde-init-btn--roll"
              data-libel-id="create"
              title="{{ localize 'CDE.DeterminateNPCInitiative' }}"
            ><i class="fa-solid fa-dice-d10"></i></button>
            <button
              type="button"
              class="click-initiative-npc cde-init-btn cde-init-btn--plus"
              data-libel-id="plus"
              title="{{ localize 'CDE.PlusInitiative' }}"
            ><i class="fa-solid fa-chevron-up"></i></button>
          </div>
        </div>
      </div>
      <div class="cde-tag">
        <span class="cde-pill npc">{{ localize "CDE.PNJ" }}</span>
        <span>Chroniques de l'Étrange</span>
      </div>
    </div>
  </header>

  <nav class="sheet-tabs tabs cde-neon-tabs" data-group="primary">
    <a class="item" data-action="tab" data-group="primary" data-tab="description">{{ localize "CDE.Description" }}</a>
    <a class="item" data-action="tab" data-group="primary" data-tab="aptitudes">{{ localize "CDE.Aptitudes" }}</a>
    <a class="item" data-action="tab" data-group="primary" data-tab="supernaturals">{{ localize "CDE.SuperNatural" }}</a>
    <a class="item" data-action="tab" data-group="primary" data-tab="spells">{{ localize "CDE.Spells" }}</a>
    <a class="item" data-action="tab" data-group="primary" data-tab="kungfus">{{ localize "CDE.MartialArts" }}</a>
    <a class="item" data-action="tab" data-group="primary" data-tab="items">{{ localize "CDE.Items" }}</a>
  </nav>

  <section class="sheet-body cde-tab-body">
    <div class="tab" data-group="primary" data-tab="description">
      <div class="cde-card cde-notes-editor">
        {{formInput systemFields.description enriched=descriptionHTML value=system.description name="system.description" toggled=true}}
      </div>
    </div>

    <div class="tab" data-group="primary" data-tab="aptitudes">
      <div class="cde-card">
        <div class="tab-sous-titre">{{ localize "CDE.Aptitudes" }}</div>
        <table class="cde-skills-table cde-aptitudes-table">
          <tr>
            <td class="cde-skill-label"><b>{{ localize "CDE.Physical" }}</b></td>
            <td class="cde-val-cell">
              <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.aptitudes.physical.value" value="{{systemData.aptitudes.physical.value}}" />
            </td>
            <td class="cde-spec-cell">
              <input type="text" placeholder="{{ localize 'CDE.Specialities' }}…" name="system.aptitudes.physical.speciality" value="{{systemData.aptitudes.physical.speciality}}" />
            </td>
            <td class="cde-roll-cell">
              <a class="cde-roll-trigger" data-libel-id="physical-aptitude" title="{{ localize 'CDE.Roll' }}"><i class="fas fa-dice-d10"></i></a>
            </td>
          </tr>
          <tr>
            <td class="cde-skill-label"><b>{{ localize "CDE.Martial" }}</b></td>
            <td class="cde-val-cell">
              <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.aptitudes.martial.value" value="{{systemData.aptitudes.martial.value}}" />
            </td>
            <td class="cde-spec-cell">
              <input type="text" placeholder="{{ localize 'CDE.Specialities' }}…" name="system.aptitudes.martial.speciality" value="{{systemData.aptitudes.martial.speciality}}" />
            </td>
            <td class="cde-roll-cell">
              <a class="cde-roll-trigger" data-libel-id="martial-aptitude" title="{{ localize 'CDE.Roll' }}"><i class="fas fa-dice-d10"></i></a>
            </td>
          </tr>
          <tr>
            <td class="cde-skill-label"><b>{{ localize "CDE.Mental" }}</b></td>
            <td class="cde-val-cell">
              <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.aptitudes.mental.value" value="{{systemData.aptitudes.mental.value}}" />
            </td>
            <td class="cde-spec-cell">
              <input type="text" placeholder="{{ localize 'CDE.Specialities' }}…" name="system.aptitudes.mental.speciality" value="{{systemData.aptitudes.mental.speciality}}" />
            </td>
            <td class="cde-roll-cell">
              <a class="cde-roll-trigger" data-libel-id="mental-aptitude" title="{{ localize 'CDE.Roll' }}"><i class="fas fa-dice-d10"></i></a>
            </td>
          </tr>
          <tr>
            <td class="cde-skill-label"><b>{{ localize "CDE.Social" }}</b></td>
            <td class="cde-val-cell">
              <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.aptitudes.social.value" value="{{systemData.aptitudes.social.value}}" />
            </td>
            <td class="cde-spec-cell">
              <input type="text" placeholder="{{ localize 'CDE.Specialities' }}…" name="system.aptitudes.social.speciality" value="{{systemData.aptitudes.social.speciality}}" />
            </td>
            <td class="cde-roll-cell">
              <a class="cde-roll-trigger" data-libel-id="social-aptitude" title="{{ localize 'CDE.Roll' }}"><i class="fas fa-dice-d10"></i></a>
            </td>
          </tr>
          <tr>
            <td class="cde-skill-label"><b>{{ localize "CDE.Spiritual" }}</b></td>
            <td class="cde-val-cell">
              <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.aptitudes.spiritual.value" value="{{systemData.aptitudes.spiritual.value}}" />
            </td>
            <td class="cde-spec-cell">
              <input type="text" placeholder="{{ localize 'CDE.Specialities' }}…" name="system.aptitudes.spiritual.speciality" value="{{systemData.aptitudes.spiritual.speciality}}" />
            </td>
            <td class="cde-roll-cell">
              <a class="cde-roll-trigger" data-libel-id="spiritual-aptitude" title="{{ localize 'CDE.Roll' }}"><i class="fas fa-dice-d10"></i></a>
            </td>
          </tr>
        </table>
      </div>

      <div class="cde-card cde-npc-tracks">
        <div class="tab-sous-titre">{{ localize "CDE.Vitality" }} &amp; {{ localize "CDE.Hei" }}</div>
        <div class="cde-track-row">
          <div class="cde-track-label">
            <i class="fa-solid fa-heart-pulse"></i>
            <span>{{ localize "CDE.Vitality" }}</span>
          </div>
          <div class="cde-track-value">
            <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.vitality.value" value="{{systemData.vitality.value}}" />
            <span class="cde-track-sep">/</span>
            <span class="cde-track-max">{{systemData.vitality.calcul}}</span>
          </div>
          <div class="cde-track-note">
            <input type="text" placeholder="{{ localize 'CDE.Notes' }}…" name="system.vitality.note" value="{{systemData.vitality.note}}" />
          </div>
        </div>
        <div class="cde-track-row">
          <div class="cde-track-label">
            <i class="fa-solid fa-yin-yang"></i>
            <span>{{ localize "CDE.HEI2" }}</span>
          </div>
          <div class="cde-track-value">
            <input class="cde-circle-input" type="number" min="0" placeholder="0" name="system.hei.value" value="{{systemData.hei.value}}" />
            <span class="cde-track-sep">/</span>
            <span class="cde-track-max">{{systemData.hei.calcul}}</span>
          </div>
          <div class="cde-track-note">
            <input type="text" placeholder="{{ localize 'CDE.Notes' }}…" name="system.hei.note" value="{{systemData.hei.note}}" />
          </div>
        </div>
      </div>
    </div>

    <div class="tab" data-group="primary" data-tab="supernaturals">
      <div class="cde-card cde-data-table">
        {{> "systems/fvtt-chroniques-de-l-etrange/templates/actor/parts/cde-npc-supernaturals.html"}}
      </div>
    </div>

    <div class="tab" data-group="primary" data-tab="spells">
      <div class="cde-card cde-data-table">
        {{> "systems/fvtt-chroniques-de-l-etrange/templates/actor/parts/cde-npc-spells.html"}}
      </div>
    </div>

    <div class="tab" data-group="primary" data-tab="kungfus">
      <div class="cde-card cde-data-table">
        {{> "systems/fvtt-chroniques-de-l-etrange/templates/actor/parts/cde-npc-kungfus.html"}}
      </div>
    </div>

    <div class="tab" data-group="primary" data-tab="items">
      <div class="cde-card cde-data-table">
        {{> "systems/fvtt-chroniques-de-l-etrange/templates/actor/parts/cde-npc-items.html"}}
      </div>
    </div>
  </section>
</section>
