<div class="luck-group attribute" data-attrib="lck">
  <label
    class="attribute-label rollable"
    draggable="true"
    data-context-menu="{{#if data.system.flags.locked}}skill-roll{{/if}}" data-target-type="attribute">{{localize 'CoC7.Luck'}}</label>
  <input class="attribute-value" type="text" name="system.attribs.lck.value" value="{{data.system.attribs.lck.value}}" data-dtype="Number" data-attrib="lck">
  <input class="attribute-value invisible" type="text" name="system.attribs.lck.max" value="99" data-dtype="Number" data-attrib="lck" readonly>
</div>

<div class="hp-group">
  <div class="hp-text attribute" data-attrib="hp">
    <label class="{{#unless data.system.flags.locked}} auto-toggle {{#unless data.system.attribs.hp.auto}}manual-override{{/unless}}{{/unless}}">{{localize 'CoC7.HitPoints'}}</label>
    <div class="monitor hp-value">
      <div class="current-value">
        <input class="attribute-value" type="text" name="system.attribs.hp.value" value="{{data.system.attribs.hp.value}}" data-dtype="Number" />
      </div>
      <div class="separator">/</div>
      <div class="max-value">
        {{#if data.system.attribs.hp.auto}}
          <input type="text" name="system.attribs.hp.max" value="{{data.system.attribs.hp.max}}" data-dtype="Number" readonly />
        {{else}}
          <input type="text" name="system.attribs.hp.max" value="{{data.system.attribs.hp.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
        {{/if}}
      </div>
    </div>
    <div class="status">
      <a class="condition-monitor {{#if data.system.conditions.prone.value}}status-on{{/if}}" title="{{localize 'CoC7.Prone'}}" data-condition="prone"><i class="game-icon game-icon-falling"></i></a>
      <a class="condition-monitor {{#if data.system.conditions.unconscious.value}}status-on{{/if}}" title="{{localize 'CoC7.Unconsious'}}" data-condition="unconscious"><i class="game-icon game-icon-knocked-out-stars"></i></a>
      <a class="condition-monitor {{#if data.system.conditions.criticalWounds.value}}status-on{{/if}}" title="{{localize 'CoC7.CriticalWounds'}}" data-condition="criticalWounds"><i class="game-icon game-icon-arm-sling"></i></a>
      <a class="condition-monitor {{#if data.system.conditions.dying.value}}status-on{{/if}}" title="{{localize 'CoC7.Dying'}}" data-condition="dying"><i class="game-icon game-icon-heart-beats"></i></a>
    </div>

    <div class="status">
      {{#if data.system.conditions.dead.value}}
        <a class="condition-monitor status-on" title="{{localize 'CoC7.Dead'}}" data-condition="dead"><i class="game-icon game-icon-tombstone"></i></a>
      {{else}}
        <a class="{{#if data.system.conditions.dying.value}}condition-monitor dying-check{{else}}inative-status{{/if}}" title="{{#if data.system.conditions.dying.value}}{{localize 'CoC7.DyingCheck'}}{{/if}}"><i class="game-icon game-icon-d10"></i></a>
      {{/if}}
    </div>
  </div>
</div>

<div class="san-group">
  <div class="san-text attribute" data-attrib="san">
    <label
      class="{{#if data.system.flags.locked}} attribute-label rollable{{else}} auto-toggle{{#unless data.system.attribs.san.auto}} manual-override{{/unless}}{{/if}}"
      draggable="true"
      data-context-menu="{{#if data.system.flags.locked}}san-roll{{/if}}" data-target-type="attribute">{{localize 'CoC7.Sanity'}}</label>
    <div class="monitor san-value">
      <div class="current-value">
        <input class="attribute-value" type="text" name="system.attribs.san.value" value="{{data.system.attribs.san.value}}" data-dtype="Number" />
      </div>
      <div class="separator">/</div>
      <div class="max-value">
        {{#if data.system.attribs.san.auto}}
          <input type="text" name="system.attribs.san.max" value="{{data.system.attribs.san.max}}" data-dtype="Number" readonly />
        {{else}}
          <input type="text" name="system.attribs.san.max" value="{{data.system.attribs.san.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
        {{/if}}
      </div>
    </div>
    <div>
      <label>{{localize 'CoC7.DailyLoss'}}: {{data.system.attribs.san.dailyLoss}}/{{data.system.attribs.san.dailyLimit}}</label>
    </div>
    <div class="status">
      <div class="invisible">
        <input class="locked" type="text" name="system.attribs.san.dailyLoss" value="{{data.system.attribs.san.dailyLoss}}" data-dtype="Number" readonly />
        <input class="locked" type="text" name="system.attribs.san.dailyLimit" value="{{data.system.attribs.san.dailyLimit}}" data-dtype="Number" readonly />
      </div>
      <a class="condition-monitor {{#if data.system.conditions.tempoInsane.value}}status-on{{/if}}" title="{{localize 'CoC7.BoutOfMadness'}}{{#if actor.getTempoInsaneDurationText}}: {{actor.getTempoInsaneDurationText}}{{/if}}" data-condition="tempoInsane"><i class="game-icon game-icon-hanging-spider"></i></a>
      <a class="condition-monitor {{#if data.system.conditions.indefInsane.value}}status-on{{/if}}" title="{{#if data.system.conditions.indefInsane.value}}{{localize 'CoC7.UnderlyingInsanity'}}{{else}}{{localize 'CoC7.IndefiniteInsanity'}}{{/if}}" data-condition="indefInsane"><i class="game-icon game-icon-tentacles-skull"></i></a>
    </div>
    <div class="control">
      <a class="reset-counter" title="{{localize 'CoC7.DailySanIconOver'}}" data-counter="system.attribs.san.dailyLoss"><i class="fas fa-undo"></i></a>
    </div>

  </div>
</div>

<div class="magic-group attribute" data-attrib="mp">
  <label class="{{#unless data.system.flags.locked}} auto-toggle{{#unless data.system.attribs.mp.auto}} manual-override{{/unless}}{{/unless}}">{{localize 'CoC7.MagicPoints'}}</label>
  <div class="monitor mp-value">
    <div class="current-value">
      <input class="attribute-value" type="text" name="system.attribs.mp.value" value="{{data.system.attribs.mp.value}}" data-dtype="Number" />
    </div>
    <div class="separator">/</div>
    <div class="max-value">
      {{#if data.system.attribs.mp.auto}}
        <input type="text" name="system.attribs.mp.max" value="{{data.system.attribs.mp.max}}" data-dtype="Number" readonly />
      {{else}}
        <input type="text" name="system.attribs.mp.max" value="{{data.system.attribs.mp.max}}" data-dtype="Number" {{#if data.system.flags.locked}}readonly{{/if}} />
      {{/if}}
    </div>
  </div>
</div>