<section class="character-main character-main-{{ifThen isPlayMode 'play' 'edit'}}">
  {{!log "character-main" this}}

  <fieldset>
    <legend>{{localize "LETHALFANTASY.Label.pc"}}</legend>
    <div class="character-pc character-pc-{{ifThen isPlayMode 'play' 'edit'}}">
      <div class="character-left">
        <div class="character-left-image">
          <img class="character-img" src="{{actor.img}}" data-edit="img" data-action="editImage"
            data-tooltip="{{actor.name}}" />
        </div>

        <fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
          <div class="flexrow character-hp">
            <span class="name">{{localize "LETHALFANTASY.Label.HP"}}</span>
            {{formInput systemFields.hp.fields.value value=system.hp.value disabled=isPlayMode classes="character-hp"}}
            &nbsp;/&nbsp;
            {{formInput systemFields.hp.fields.max value=system.hp.max disabled=isPlayMode classes="character-hp"}}
          </div>
          <div class="flexrow character-hp">
            <span class="name">{{localize "LETHALFANTASY.Label.perception"}}</span>
            {{formInput systemFields.perception.fields.value value=system.perception.value disabled=isPlayMode classes="character-hp"}}
            <span class="name">{{localize "LETHALFANTASY.Label.bonus"}}</span>
            {{formInput systemFields.perception.fields.bonus value=system.perception.bonus disabled=isPlayMode classes="character-hp"}}
          </div>
          <div class="flexrow character-hp">
            <span class="name">{{localize "LETHALFANTASY.Label.grit"}}</span>
            {{formInput systemFields.grit.fields.current value=system.grit.current disabled=isPlayMode classes="character-hp"}}
            <span class="name">{{localize "LETHALFANTASY.Label.gritEarned"}}</span>
            {{formInput systemFields.grit.fields.earned value=system.grit.earned disabled=isPlayMode classes="character-hp"}}
          </div>
          <div class="flexrow character-hp">
            <span class="name">{{localize "LETHALFANTASY.Label.luck"}}</span>
            {{formInput systemFields.luck.fields.current value=system.luck.current disabled=isPlayMode classes="character-hp"}}
            <span class="name">{{localize "LETHALFANTASY.Label.luckEarned"}}</span>
            {{formInput systemFields.luck.fields.earned value=system.luck.earned disabled=isPlayMode classes="character-hp"}}
          </div>
        </fieldset>

      </div>
      <div class="character-right">
        <div class="character-name">
          {{formInput fields.name value=source.name rootId=partId disabled=isPlayMode}}
          <a class="control" data-action="toggleSheet" data-tooltip="LETHALFANTASY.ToggleSheet"
            data-tooltip-direction="UP">
            <i class="fa-solid fa-user-{{ifThen isPlayMode 'lock' 'pen'}}"></i>
          </a>
        </div>

        <fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
          <legend>{{localize "LETHALFANTASY.Label.Saves"}}</legend>
          <div class="character-saves">
            <div class="character-save">
              <span class="name">{{localize "LETHALFANTASY.Label.saves.will"}}</span>
              {{formField systemFields.saves.fields.will.fields.value value=system.saves.will.value disabled=isPlayMode
              classes="rollable" data-save-id="will" }}
              <span class="name">{{localize "LETHALFANTASY.Label.saves.dodge"}}</span>
              {{formField systemFields.saves.fields.dodge.fields.value value=system.saves.dodge.value disabled=isPlayMode
              classes="rollable" data-save-id="dodge" }}
              <span class="name">{{localize "LETHALFANTASY.Label.saves.toughness"}}</span>
              {{formField systemFields.saves.fields.toughness.fields.value value=system.saves.toughness.value
              disabled=isPlayMode classes="rollable" data-save-id="toughness" }}
            </div>
            <div class="character-save">
              <span class="name">{{localize "LETHALFANTASY.Label.saves.contagion"}}</span>
              {{formField systemFields.saves.fields.contagion.fields.value value=system.saves.contagion.value
              disabled=isPlayMode classes="rollable" data-save-id="contagion" }}
              <span class="name">{{localize "LETHALFANTASY.Label.saves.poison"}}</span>
              {{formField systemFields.saves.fields.poison.fields.value value=system.saves.poison.value
              disabled=isPlayMode classes="rollable" data-save-id="poison" }}
              <span class="name">{{localize "LETHALFANTASY.Label.saves.pain"}}</span>
              {{formField systemFields.saves.fields.pain.fields.value value=system.saves.pain.value disabled=isPlayMode
              classes="rollable" data-save-id="pain" }}
            </div>
          </div>
        </fieldset>

        <fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
          <legend>{{localize "LETHALFANTASY.Label.Challenges"}}</legend>
          <div class="character-challenges">
            <div class="character-challenge">
              <span class="name">{{localize "LETHALFANTASY.Label.challenges.strength"}}</span>
              {{formField systemFields.challenges.fields.str.fields.value value=system.challenges.str.value disabled=isPlayMode
              classes="rollable" data-challenge-id="str" }}
              <span class="name">{{localize "LETHALFANTASY.Label.challenges.agility"}}</span>
              {{formField systemFields.challenges.fields.agility.fields.value value=system.challenges.agility.value disabled=isPlayMode
              classes="rollable" data-challenge-id="agility" }}
              <span class="name">{{localize "LETHALFANTASY.Label.challenges.dying"}}</span>
              {{formField systemFields.challenges.fields.dying.fields.value value=system.challenges.dying.value
              disabled=isPlayMode classes="rollable" data-challenge-id="dying" }}
            </div>
          </div>
        </fieldset>

        <fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
          <legend>{{localize "LETHALFANTASY.Label.Movement"}}</legend>
          <div class="character-movements">
            <div class="character-movement">
              <span class="name">{{localize "LETHALFANTASY.Label.movement.walk"}}</span>
              {{formField systemFields.movement.fields.walk value=system.movement.walk disabled=isPlayMode}}
              <span class="name">{{localize "LETHALFANTASY.Label.movement.jog"}}</span>
              {{formField systemFields.movement.fields.jog value=system.challenges.movement.jog disabled=isPlayMode}}
              <span class="name">{{localize "LETHALFANTASY.Label.movement.sprint"}}</span>
              {{formField systemFields.movement.fields.sprint value=system.movement.sprint disabled=isPlayMode}}
              <span class="name">{{localize "LETHALFANTASY.Label.movement.run"}}</span>
              {{formField systemFields.movement.fields.run value=system.movement.run disabled=isPlayMode}}
            </div>
          </div>
        </fieldset>

      </div>
    </div>
  </fieldset>

  <fieldset class="character-characteristics character-characteristics-{{ifThen isPlayMode 'play' 'edit'}}">
    <legend>{{localize "LETHALFANTASY.Label.characteristics"}}</legend>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.str"}}
      {{formField systemFields.characteristics.fields.str.fields.value value=system.characteristics.str.value
      disabled=isPlayMode classes="rollable" data-char-id="str" }}
      {{formField systemFields.characteristics.fields.str.fields.percent value=system.characteristics.str.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.int"}}
      {{formField systemFields.characteristics.fields.int.fields.value value=system.characteristics.int.value
      disabled=isPlayMode classes="rollable" data-char-id="int" }}

      {{formField systemFields.characteristics.fields.int.fields.percent value=system.characteristics.int.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.wis"}}
      {{formField systemFields.characteristics.fields.wis.fields.value value=system.characteristics.wis.value
      disabled=isPlayMode classes="rollable" data-char-id="wis" }}

      {{formField systemFields.characteristics.fields.wis.fields.percent value=system.characteristics.wis.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.dex"}}
      {{formField systemFields.characteristics.fields.dex.fields.value value=system.characteristics.dex.value
      disabled=isPlayMode classes="rollable" data-char-id="wis" }}

      {{formField systemFields.characteristics.fields.dex.fields.percent value=system.characteristics.dex.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.con"}}
      {{formField systemFields.characteristics.fields.con.fields.value value=system.characteristics.con.value
      disabled=isPlayMode classes="rollable" data-char-id="con" }}

      {{formField systemFields.characteristics.fields.con.fields.percent value=system.characteristics.con.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.cha"}}
      {{formField systemFields.characteristics.fields.cha.fields.value value=system.characteristics.cha.value
      disabled=isPlayMode classes="rollable" data-char-id="cha" }}

      {{formField systemFields.characteristics.fields.cha.fields.percent value=system.characteristics.cha.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.luc"}}
      {{formField systemFields.characteristics.fields.luc.fields.value value=system.characteristics.luc.value
      disabled=isPlayMode classes="rollable" data-char-id="luc" }}

      {{formField systemFields.characteristics.fields.luc.fields.percent value=system.characteristics.luc.percent
      disabled=isPlayMode }}
    </div>
    <div class="character-characteristic" data-drag="true">
      {{localize "LETHALFANTASY.Label.app"}}
      {{formField systemFields.characteristics.fields.app.fields.value value=system.characteristics.app.value
      disabled=isPlayMode classes="rollable" data-char-id="app" }}

      {{formField systemFields.characteristics.fields.app.fields.percent value=system.characteristics.app.percent
      disabled=isPlayMode }}
    </div>
  </fieldset>

  <fieldset class="character-resources character-resources-{{ifThen isPlayMode 'play' 'edit'}}">
    <legend>{{localize "LETHALFANTASY.Label.resources"}}</legend>
    <div class="character-resource" data-drag="true" data-drag-type="resource">
    </div>
    <div class="character-resource" data-drag="true" data-drag-type="resource">
    </div>
    <div class="character-resource" data-drag="true" data-drag-type="resource">
    </div>
  </fieldset>

</section>