<section class="{{cssClass}} les-oublies-sheet item-sheet" autocomplete="off">
  <header class="sheet-header hero-banner">
    <img class="profile-img" data-edit="img" data-action="editImage" src="{{item.img}}" title="{{item.name}}" />
    <div class="header-fields hero-copy">
      <p class="sheet-kicker">Référence de création</p>
      <h1 class="sheet-title"><input name="name" type="text" value="{{item.name}}" placeholder="Nom" {{#if isPlayMode}}disabled{{/if}} /></h1>
      <p class="sheet-subtitle">{{localize (concat "TYPES.Item." item.type)}}</p>
      <button class="mode-button" type="button" data-action="toggleSheet">{{#if isEditMode}}{{localize "LESOUBLIES.ui.playMode"}}{{else}}{{localize "LESOUBLIES.ui.editMode"}}{{/if}}</button>
    </div>
  </header>

  {{#if isRace}}
    <section class="sheet-card summary-card">
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.taille"}}</label><select name="system.size" {{#if isPlayMode}}disabled{{/if}}>{{#each choiceSets.raceSizeOptions as |option|}}<option value="{{option.value}}" {{#if (eq option.value @root.system.size)}}selected{{/if}}>{{option.label}}</option>{{/each}}</select></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.esperanceVie"}}</label><input name="system.lifeExpectancy" type="number" value="{{system.lifeExpectancy}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.langue"}}</label><input name="system.language" type="text" value="{{system.language}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <h2>{{localize "LESOUBLIES.ui.profils"}}</h2>
      <div class="profile-grid">
        {{#each system.profiles as |value key|}}
          <div class="profile-cell"><label>{{profileLabel key}}</label><input name="system.profiles.{{key}}" type="number" value="{{value}}" {{#if @root.isPlayMode}}disabled{{/if}} /></div>
        {{/each}}
      </div>
    </section>
  {{/if}}

  {{#if isTribu}}
    <section class="sheet-card summary-card">
      <div class="field-row"><label>Race principale</label><select name="system.mainRace" {{#if isPlayMode}}disabled{{/if}}><option value="">—</option>{{#each choiceSets.mainRaceOptions as |option|}}<option value="{{option.value}}" {{#if (eq option.value @root.system.mainRace)}}selected{{/if}}>{{option.label}}</option>{{/each}}</select></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.langue"}}</label><input name="system.spokenLanguage" type="text" value="{{system.spokenLanguage}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.territoire"}}</label><input name="system.territory" type="text" value="{{system.territory}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.philosophie"}}</label><input name="system.philosophy" type="text" value="{{system.philosophy}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.fierte"}}</label><input name="system.pride" type="text" value="{{system.pride}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.mytheNature"}}</label><input name="system.mythNature" type="text" value="{{system.mythNature}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <div class="field-row"><label>{{localize "LESOUBLIES.labels.mytheEdenia"}}</label><input name="system.mythEdenia" type="text" value="{{system.mythEdenia}}" {{#if isPlayMode}}disabled{{/if}} /></div>
      <h2>Bonus de compétences</h2>
      <ul class="reference-list">
        {{#each system.skillBonuses as |bonus|}}
          <li>{{formatSkillBonus bonus}}</li>
        {{/each}}
      </ul>
    </section>
  {{/if}}

  {{#if isMetier}}
    <section class="sheet-card summary-card">
      <h2>Bonus de compétences</h2>
      <ul class="reference-list">
        {{#each system.skillBonuses as |bonus|}}
          <li>{{formatSkillBonus bonus}}</li>
        {{/each}}
      </ul>
      <h2>Équipement de départ</h2>
      <ul class="reference-list">
        {{#each system.startingEquipment as |entry|}}
          <li>{{formatEquipmentEntry entry}}</li>
        {{/each}}
      </ul>
      <h2>Sortilèges octroyés</h2>
      <ul class="reference-list">
        {{#each system.spellGrants as |grant|}}
          <li>{{formatSpellGrant grant}}</li>
        {{/each}}
      </ul>
      <p><strong>Revenus :</strong> débutant {{formatPrice system.revenues.beginner}}, intermédiaire {{formatPrice system.revenues.intermediate}}, expert {{formatPrice system.revenues.expert}}</p>
    </section>
  {{/if}}

  <section class="sheet-card notes-card">
    <h2>{{localize "LESOUBLIES.labels.description"}}</h2>
    {{formInput systemFields.description enriched=enriched.description value=system.description name="system.description" toggled=true}}
    {{#if isRace}}
      <h2>Apparence et interprétation</h2>
      {{formInput systemFields.appearance enriched=enriched.appearance value=system.appearance name="system.appearance" toggled=true}}
    {{/if}}
    <h2>{{localize "LESOUBLIES.labels.reglesSpeciales"}}</h2>
    {{#if isRace}}
      {{formInput systemFields.specialRules enriched=enriched.specialRules value=system.specialRules name="system.specialRules" toggled=true}}
    {{/if}}
    {{#if isTribu}}
      {{formInput systemFields.specialRules enriched=enriched.specialRules value=system.specialRules name="system.specialRules" toggled=true}}
      <h2>Interprétation</h2>
      {{formInput systemFields.roleplayNotes enriched=enriched.roleplayNotes value=system.roleplayNotes name="system.roleplayNotes" toggled=true}}
    {{/if}}
    {{#if isMetier}}
      {{formInput systemFields.specialRules enriched=enriched.specialRules value=system.specialRules name="system.specialRules" toggled=true}}
      <h2>Interprétation</h2>
      {{formInput systemFields.roleplayNotes enriched=enriched.roleplayNotes value=system.roleplayNotes name="system.roleplayNotes" toggled=true}}
    {{/if}}
    <h2>{{localize "LESOUBLIES.labels.notes"}}</h2>
    {{formInput systemFields.notes enriched=enriched.notes value=system.notes name="system.notes" toggled=true}}
  </section>
</section>
