@mixin tab($darkmode: false) {

  display: grid;

  grid-template-columns: 1fr 320px;
  grid-template-rows: 32px 32px 32px 1fr;
  grid-template-areas: "res res" "wounds wounds" "fatigue fatigue" "effects effects" "effects effects";
  padding: 8px;
  gap: 8px;

  div.combatline {
    grid-area: res;
    display: flex;
    flex-direction: row;
    justify-self: center;
    height: unset;
    padding: 0;
    gap: 0 8px;


    input {
      width: 48px;
      height: 32px;
    }

    span, label {
      line-height: 32px;
      height: 32px;
      vertical-align: middle;
    }

  }

  .wounds, .fatigue {
    position: relative;
    height: 24px;
    display: flex;
    flex-direction: unset;
    gap: unset;
    padding: unset;
    margin-bottom: 8px;
    padding-left: 130px;
    grid-area: wounds;

    label {
      position: absolute;
      left: 0;
      top: 0;
      line-height: 24px;
      width: 120px;
      bottom: 0;
      vertical-align: middle;
      text-align: left;
      height: 24px;
      display: inline-block;
      z-index: 2;
    }

    .filled-segment {
      border: 1px solid black;
      background-image: url('/systems/DSA_4-1/assets/gradient.png');
      background-size: 24px 100%;
      position: relative;
      flex: 1;
      text-align: center;
      vertical-align: middle;
      line-height: 24px;
      color: white;
      text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
      background-color: rgba(255, 0, 0, 0.8);
      background-blend-mode: multiply;

    }

    .empty-segment {
      border: 1px solid black;
      background-image: url('/systems/DSA_4-1/assets/gradient.png');
      background-size: 32px 100%;
      position: relative;
      flex: 1;
      text-align: center;
      vertical-align: middle;
      line-height: 24px;
      color: gold;
      text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
      background-color: rgba(0, 0, 0, 0.8);
      background-blend-mode: multiply;

    }

  }

  .fatigue {
    grid-area: fatigue;
    flex-direction: row;

    label {
      span {
        display: inline-block;
        height: 26px;
        line-height: 26px;
        vertical-align: middle;
      }

      input {
        position: absolute;
        right: 0;
        height: 26px;
        text-align: center;
        padding: 0;
        margin: 0;
        width: 28px;
      }
    }

    .filled-segment {
      background-color: rgba(0, 128, 0, 0.8);

      &.danger {
        background-color: rgba(255, 0, 0, 0.8);
      }
    }

  }

  .effects {
    grid-area: effects;
  }


  &.zones {
    grid-template-areas: "res res" "wounds wounds" "fatigue fatigue" "effects paperdoll" "effects paperdoll";

    .paperdoll {
      grid-area: paperdoll;

      div {
        position: relative;
        margin-left: 9px;
        margin-top: 42px;

        .wound {
          position: absolute;
          width: 32px;
          height: 32px;
          border-radius: 16px;
          border: 1px solid black;
          background-color: rgba(0, 0, 0, 0.5);
          box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
          line-height: 32px;
          vertical-align: middle;
          text-align: center;
          color: red;


          &.armlinks {
            top: 146px;
            left: 210px;
          }

          &.armrechts {
            top: 146px;
            left: 60px;
          }

          &.beinlinks {
            top: 346px;
            left: 210px;
          }

          &.beinrechts {
            top: 346px;
            left: 60px;
          }

          &.bauch {
            top: 166px;
            left: 136px;
          }

          &.kopf {
            top: 6px;
            left: 136px
          }

          &.brust {
            top: 86px;
            left: 110px;
          }

          &.ruecken {
            top: 86px;
            left: 160px;
          }

        }

        .armor {
          position: absolute;
          width: 32px;
          height: 32px;
          border-radius: 0 0 16px 16px;
          line-height: 32px;
          vertical-align: middle;
          text-align: center;
          border: 1px solid silver;
          background-color: rgba(0, 0, 0, 0.5);
          box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
          color: silver;

          &.armlinks {
            top: 180px;
            left: 210px;
          }

          &.armrechts {
            top: 180px;
            left: 60px;
          }

          &.beinlinks {
            top: 380px;
            left: 210px;
          }

          &.beinrechts {
            top: 380px;
            left: 60px;
          }

          &.bauch {
            top: 200px;
            left: 136px;
          }

          &.kopf {
            top: 40px;
            left: 136px
          }

          &.ruecken {
            top: 120px;
            left: 160px;
          }

          &.brust {
            top: 120px;
            left: 110px;
          }
        }
      }

    }

  }

}

.mini-health {
  @include tab;

  display: flex;
  flex-direction: column;
  padding: 0;

  input {
    height: 26px !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 28px !important;
  }

  .side-by-side {
    display: flex;

    > * {
      flex: 1;
    }
  }

  .paperdoll {

    div {
      position: relative;

      .wound {
        position: absolute;
        width: 32px;
        height: 32px;
        border-radius: 16px;
        border: 1px solid black;
        background-color: rgba(0, 0, 0, 0.5);
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
        line-height: 32px;
        vertical-align: middle;
        text-align: center;
        color: red;


        &.armlinks {
          top: 146px;
          left: 210px;
        }

        &.armrechts {
          top: 146px;
          left: 60px;
        }

        &.beinlinks {
          top: 346px;
          left: 210px;
        }

        &.beinrechts {
          top: 346px;
          left: 60px;
        }

        &.bauch {
          top: 166px;
          left: 136px;
        }

        &.kopf {
          top: 6px;
          left: 136px
        }

        &.brust {
          top: 86px;
          left: 110px;
        }

        &.ruecken {
          top: 86px;
          left: 160px;
        }

      }

      .armor {
        position: absolute;
        width: 32px;
        height: 32px;
        border-radius: 0 0 16px 16px;
        line-height: 32px;
        vertical-align: middle;
        text-align: center;
        border: 1px solid silver;
        background-color: rgba(0, 0, 0, 0.5);
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
        color: silver;

        &.armlinks {
          top: 180px;
          left: 210px;
        }

        &.armrechts {
          top: 180px;
          left: 60px;
        }

        &.beinlinks {
          top: 380px;
          left: 210px;
        }

        &.beinrechts {
          top: 380px;
          left: 60px;
        }

        &.bauch {
          top: 200px;
          left: 136px;
        }

        &.kopf {
          top: 40px;
          left: 136px
        }

        &.ruecken {
          top: 120px;
          left: 160px;
        }

        &.brust {
          top: 120px;
          left: 110px;
        }
      }
    }
  }
}