<div class="tab main sheet-part" data-group="sheet" data-tab="main">
  {{> "systems/vermine2047/templates/actor/appv2/character-header.hbs"}}
  {{!-- Toggle Edit/Play --}}
  <div class="sheet-header-toggle">
    {{#if isEditMode}}
      <button type="button" data-action="toggleSheet">{{localize "VERMINE.playMode"}}</button>
    {{else}}
      <button type="button" data-action="toggleSheet">{{localize "VERMINE.editMode"}}</button>
    {{/if}}
  </div>

  {{!-- Logo --}}
  <img class="logo mx-auto" src="systems/vermine2047/assets/images/ui/logo.webp"
    width="150" alt="logo Vermine" />

  {{!-- Sidebar: Profile Image + Totem Dice --}}
  <div class="image-wrapper">
    <img class="profile-img" src="{{actor.img}}" data-action="editImage" data-edit="img"
      title="{{actor.name}}" height="100" width="100" />
  </div>
    <div class="minor-totems">
      {{!-- Totem Evolution --}}
      <h3>{{localize "ITEMS.evolution"}}</h3>
      <div class="totem-row">
        <h5 class="human
        {{#ifgt system.adaptation.totems.human.value system.adaptation.totems.adapted.value}}
          major
        {{/ifgt}}
        ">{{localize "TOTEMS.human.name"}}
          <img class="img-totem"
            src="/systems/vermine2047/assets/images/ui/totems/human.webp" />
        </h5>

        <h5 class="adapted
        {{#ifgt system.adaptation.totems.adapted.value system.adaptation.totems.human.value}}
          major
        {{/ifgt}}">{{localize "TOTEMS.adapted.name"}}
          <img class="img-totem"
            src="/systems/vermine2047/assets/images/ui/totems/adapted.webp" />
        </h5>
      </div>

      <div class="totem-dice flexrow flex-group-center">
      <div class="human-dice flexrow">
        {{#repeat system.adaptation.totems.human.max 1 "humantotem"}}
        <div class="hexa{{#ifgteq system.adaptation.totems.human.value @humantotem}} checked{{/ifgteq}}"
          data-totem-name="human" data-totem-value="{{@humantotem}}">
          {{#if @root.isEditMode}}
          <input type="radio" data-dtype="Number"
            name="system.adaptation.totems.human.value" value="{{@humantotem}}"
            data-action="clickRadio" />
          {{/if}}
          {{#ifgteq system.adaptation.totems.human.value @humantotem}}
          <div class="human-die"><i class="fas fa-dice-d10"></i></div>
          {{/ifgteq}}
        </div>
        {{/repeat}}
      </div>

      <div class="adapted-dice flexrow">
        {{#repeat system.adaptation.totems.adapted.max 1 "adaptedtotem"}}
        <div class="hexa{{#ifgteq system.adaptation.totems.adapted.value @adaptedtotem}} checked{{/ifgteq}}"
          data-totem-name="adapted" data-totem-value="{{@adaptedtotem}}">
          {{#if @root.isEditMode}}
          <input type="radio" data-dtype="Number"
            name="system.adaptation.totems.adapted.value" value="{{@adaptedtotem}}"
            data-action="clickRadio" />
          {{/if}}
          {{#ifgteq system.adaptation.totems.adapted.value @adaptedtotem}}
          <div class="adapted-die"><i class="fas fa-dice-d10"></i></div>
          {{/ifgteq}}
        </div>
        {{/repeat}}
      </div>
    </div>

    {{!-- Influence + gestion des Dés de Totems --}}
    <div class="totem-influence-row">
      <span class="totem-influence-label">
        {{ localize "VERMINE.influence" }}:
        {{#ifgt system.adaptation.totems.human.value system.adaptation.totems.adapted.value}}
          <strong class="totem-human">{{ localize "TOTEMS.human.name" }}</strong>
        {{else ifgt system.adaptation.totems.adapted.value system.adaptation.totems.human.value}}
          <strong class="totem-adapted">{{ localize "TOTEMS.adapted.name" }}</strong>
        {{else}}
          <strong>{{ localize "VERMINE.totem_neutral" }}</strong>
        {{/ifgt}}
      </span>
      <button type="button" class="totem-manage-btn" data-action="openTotemDice"
        title="{{ localize 'VERMINE.totem_manage' }}"><i class="fas fa-sliders"></i></button>
    </div>

  </div>
  <ul class="padding-with-frieze unstyled paper">
    {{#if system.identity.totem }}
    <li class="row lgb major-totem">
      <div class="flexcol flex-group-center items-center w-full">
        <img
          class="img-totem"
          src="/systems/vermine2047/assets/images/ui/totems/{{ system.identity.totem }}.webp"
          alt="{{ smarttl 'TOTEMS' system.identity.totem 'name' }}" width="64"
          height="64" />
        <h4>{{ smarttl 'TOTEMS' system.identity.totem 'name' }}</h4>
      </div>
    </li>
    {{/if}}
    {{#if system.identity.theme}}
    <li>
      <div class="flexcol flex-group-center items-center w-full">
        <label for="system.identity.theme"
          class="resource-label flexlarge align-left"><h4>{{ localize
            "IDENTITY.theme"}}</h4></label>
        <p>{{{ system.identity.theme }}}</p>
      </div>
    </li>
    {{/if}}
    {{#if system.identity.instincts}}
    <li>
      <div class="flexcol flex-group-center items-center  w-full">
        <label for="system.identity.instincts"
          class="resource-label flexlarge align-left"><h4>{{ localize
            "IDENTITY.instincts"}}</h4></label>
        <p>{{{ system.identity.instincts }}}</p>
      </div>
    </li>
    {{/if}}
    {{#if system.identity.prohibits}}
    <li>
      <div class="flexcol flex-group-center items-center  w-full">
        <label for="system.identity.prohibits"
          class="resource-label flexlarge align-left"><h4>{{ localize
            "IDENTITY.prohibits"}}</h4></label>
        <p>{{{ system.identity.prohibits }}}</p>
      </div>
    </li>
    {{/if}}
    {{#if system.identity.objectives}}
    <li>
      <div class="flexcol flex-group-center items-center  w-full">
        <label for="system.identity.objectives"
          class="resource-label flexlarge align-left"><h4>{{ localize
            "IDENTITY.objectives"}}</h4></label>
        <p>{{{ system.identity.objectives }}}</p>
      </div>
    </li>
    {{/if}}
    {{#if system.identity.relations}}
    <li>
      <div class="flexcol flex-group-center items-center  w-full">
        <label for="system.identity.relations"
          class="resource-label flexlarge align-left"><h4>{{ localize
            "IDENTITY.relations"}}</h4></label>
        {{{ system.identity.relations }}}
      </div>
    </li>
    {{/if}}
  </ul>

</div>
