.character-content {
  .sheet-common();
  .character-sheet-common();
  overflow: scroll;
}

.sheet-tabs {
  background-color: var(--color-light-1);
  font-family: var(--font-title);

  a {
    color: var(--color-sheet-nav);
    font-size: 0.9rem;
  }
}

.character-main {
  display: flex;
  justify-content: center;

  .character-pc {
    display: flex;
    gap: 4px;
    flex: 1;

    .character-left {
      min-width: 220px;
      display: flex;
      flex-direction: column;

      .character-left-image {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-bottom: 8px;
        .character-img {
          height: 140px;
          width: auto;
          border: none;
        }
      }

      .character-hp {
        gap: 2px;
        align-items: center;
        input {
          flex: none;
          width: 2.5rem;
          margin-left: 2px;
          margin-right: 4px;
        }
        .hp-separator {
          font-size: calc(var(--font-size-standard) * 1.2);
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }

      .character-dv,
      .character-dmax {
        .form-fields {
          flex: none;
        }
      }
    }

    .character-right {
      display: flex;
      flex-direction: column;
      gap: 2px;

      .character-definition {
        .form-group {
          display: flex;
          align-items: center;
          margin-bottom: 4px;
        }
        .splitted {
          display: flex;
          flex-direction: row;
          gap: 4px;
        }
        label {
          max-width: 5rem;
          min-width: 5rem;
        }
        input {
          text-align: left;
          min-width: 9rem;
          max-width: 9rem;
          margin-bottom: auto;
        }
        .trait {
          min-width: 7rem;
          max-width: 7rem;
          margin-right: 1rem;
          margin-bottom: auto;
        }
        .item-controls {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          flex: 1;

          .item-name {
            flex: 1;
            min-width: 0;
          }

          .control {
            flex-shrink: 0;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.2s;

            &:hover {
              opacity: 1;
            }

            i {
              font-size: 0.9rem;
            }
          }
        }
      }
      .character-name {
        display: flex;
        input {
          font-family: var(--font-title);
          font-size: var(--font-size-title);
          width: 400px;
        }
      }
      label {
        min-width: 120px;
      }
    }
  }

  .character-pc-play {
    min-width: 660px;
  }

  .character-pc-edit {
    min-width: 660px;
  }

  .character-stats {
    /*background-color: var(--color-light-1);*/
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.2rem;
    }

    .character-stat {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.2rem;
      padding: 0.1rem 0.2rem;
      background: rgba(0, 0, 0, 0.1);
      border-radius: 0.25rem;

      .stat-label {
        flex: 1;
        min-width: 0;

        &.rollable:hover,
        &.rollable:focus {
          text-shadow: 0 0 8px var(--color-shadow-primary);
          cursor: pointer;
        }

        i {
          margin-right: 0.25rem;
        }
      }

      .stat-values {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        flex-shrink: 0;

        input {
          width: 3rem;
          text-align: center;
        }

        .stat-value {
          width: 3rem;
          text-align: center;
          display: inline-block;
        }

        .separator {
          font-weight: bold;
          color: var(--color-text-dark-secondary);
        }
      }
    }
  }

  .character-resistances {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;

    .resistances-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.2rem;
    }

    .resistance-stat {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.2rem;
      padding: 0.1rem 0.2rem;
      background: rgba(0, 0, 0, 0.1);
      border-radius: 0.25rem;

      .stat-label {
        flex: 1;
        min-width: 0;
      }

      .stat-values {
        display: flex;
        align-items: center;
        gap: 0.2rem;
        flex-shrink: 0;

        input {
          width: 3rem;
          text-align: center;
        }

        .stat-value {
          width: 3rem;
          text-align: center;
          display: inline-block;
        }

        .resistance-control {
          cursor: pointer;
          opacity: 0.8;
          transition: all 0.2s ease;
          padding: 0.15rem 0.35rem;
          background: rgba(0, 0, 0, 0.1);
          border-radius: 3px;
          color: var(--color-text-dark-primary);

          &:hover {
            opacity: 1;
            background: rgba(0, 100, 200, 0.2);
            transform: scale(1.1);
          }

          &:active {
            transform: scale(0.95);
          }

          i {
            font-size: 0.7rem;
          }
        }

        .separator {
          font-weight: bold;
          color: var(--color-text-dark-secondary);
        }
      }
    }
  }

  .character-stats-play {
    min-width: 120px;
  }

  .character-stats-edit {
    min-width: 120px;
  }
}

.tab.character-competences .main-div {
  /*background-color: var(--color-light-1);*/
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  legend {
    a {
      font-size: calc(var(--font-size-standard) * 1.4);
      padding-left: 5px;
    }
  }

  .competences-group {
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 8px;

    .competences-type-header {
      font-weight: bold;
      font-size: calc(var(--font-size-standard) * 1.1);
      color: var(--color-text-dark-primary);
      margin-bottom: 8px;
      padding: 4px 8px;
      border-left: 3px solid var(--color-border-dark-primary);
    }
  }

  .competences {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;

    .competence {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 6px;
      background: rgba(255, 255, 255, 0.6);
      border: 1px solid rgba(0, 0, 0, 0.1);
      border-radius: 3px;
      transition: all 0.2s ease;

      &:hover {
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }

      .item-img {
        width: 28px;
        height: 28px;
        border-radius: 3px;
        flex-shrink: 0;
      }

      .name {
        flex: 1;
        min-width: 0;
        font-weight: 500;

        a {
          color: var(--color-text-dark-primary);
          text-decoration: none;
          cursor: pointer;

          &:hover {
            color: var(--color-text-hyperlink);
            text-decoration: underline;
          }
        }
      }

      .carte {
        font-size: 0.85rem;
        padding: 2px 6px;
        background: rgba(0, 0, 0, 0.08);
        border-radius: 3px;
        white-space: nowrap;
      }

      .niveau {
        font-size: 0.85rem;
        padding: 2px 6px;
        background: rgba(0, 100, 200, 0.1);
        color: var(--color-text-dark-primary);
        border-radius: 3px;
        white-space: nowrap;
        font-weight: 500;
      }

      .controls {
        display: flex;
        gap: 4px;
        font-size: 0.85rem;
        flex-shrink: 0;

        a {
          padding: 2px 4px;
          color: var(--color-text-dark-secondary);
          cursor: pointer;
          transition: color 0.2s ease;

          &:hover {
            color: var(--color-text-dark-primary);
          }
        }
      }
    }
  }

  .add-competence-section {
    text-align: center;
    padding: 12px;

    .add-competence-button {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      background: rgba(0, 100, 200, 0.1);
      border: 1px solid rgba(0, 100, 200, 0.3);
      border-radius: 4px;
      color: var(--color-text-dark-primary);
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;

      &:hover {
        background: rgba(0, 100, 200, 0.2);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }

      i {
        font-size: 1rem;
      }
    }
  }

  .mortality {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    min-width: 12rem;
    max-width: 12rem;
    label {
      min-width: 5rem;
      max-width: 5rem;
    }
  }

  .counters {
    display: flex;
    direction: column;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    .characteristics-label {
      color: grey;
      font-size: small;
    }
    label {
      min-width: 4rem;
      max-width: 4rem;
    }
    .spaced-left {
      margin-left: 0.8rem;
    }
    input {
      min-width: 2.5rem;
      max-width: 2.5rem;
    }
  }
  .ailments {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    .ailment {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
      min-width: 8rem;
      max-width: 8rem;
      label {
        min-width: 5rem;
        max-width: 5rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }
}

.tab.character-sortileges .main-div {
  /*background-color: var(--color-light-1);*/
  display: grid;
  grid-template-columns: 1fr;
  legend {
    a {
      font-size: calc(var(--font-size-standard) * 1.4);
      padding-left: 5px;
    }
  }

  .sortileges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    .malefica {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 20rem;
      max-width: 20rem;
      .controls {
        font-size: 0.7rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
      }
      .name {
        min-width: 10rem;
        max-width: 10rem;
      }
      .damage {
        min-width: 3.2rem;
        max-width: 3.2rem;
      }
      .domain {
        min-width: 4rem;
        max-width: 4rem;
      }
      .level {
        min-width: 2rem;
        max-width: 2rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }
}

.tab.character-equipment .main-div {
  /*background-color: var(--color-light-1);*/
  display: grid;
  grid-template-columns: 1fr;
  legend {
    a {
      font-size: calc(var(--font-size-standard) * 1.4);
      padding-left: 5px;
    }
  }

  .limboes {
    display: flex;
    flex-direction: row;
    .limboes-line {
      display: flex;
      flex-direction: row;
    }
    .form-group {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
      min-width: 6rem;
      max-width: 6rem;
    }
    .ammo-quantity {
      text-align: left;
      max-width: 3rem;
      min-width: 3rem;
    }
    input {
      text-align: left;
      min-width: 8rem;
      max-width: 8rem;
    }
  }

  .weapons {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 4px;
    .weapon {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 13rem;
      max-width: 13rem;
      .rollable:hover,
      .rollable:focus {
        text-shadow: 0 0 8px var(--color-shadow-primary);
        cursor: pointer;
      }
      .controls {
        font-size: 0.7rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
      }
      .properties {
        min-width: 16.3rem;
        max-width: 16.3rem;
      }
      .range {
        min-width: 4.5rem;
        max-width: 4.5rem;
      }
      .ammo {
        min-width: 4.5rem;
        max-width: 4.5rem;
      }
      .ammoQuantity {
        min-width: 4.2rem;
        max-width: 4.2rem;
      }
      .type {
        min-width: 3rem;
        max-width: 3rem;
      }
      .damage {
        min-width: 4rem;
        max-width: 4rem;
      }
      .name {
        min-width: 10rem;
        max-width: 10rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }

  .armors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    .armor {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 13rem;
      max-width: 13rem;
      .controls {
        font-size: 0.7rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
      }
      .bonus {
        min-width: 2rem;
        max-width: 2rem;
      }
      .resilience {
        min-width: 2rem;
        max-width: 2rem;
      }
      .reduction {
        min-width: 2rem;
        max-width: 2rem;
      }
      .name {
        min-width: 13.5rem;
        max-width: 13.5rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }

  .equipments {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    .equipment {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 13rem;
      max-width: 13rem;
      .rollable:hover,
      .rollable:focus {
        text-shadow: 0 0 8px var(--color-shadow-primary);
        cursor: pointer;
      }
      .controls {
        font-size: 0.7rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
      }
      .name {
        min-width: 10rem;
        max-width: 10rem;
      }
      .quantity {
        min-width: 2rem;
        max-width: 2rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }

  prose-mirror.inactive {
    min-height: 40px;
  }
  prose-mirror.active {
    min-height: 150px;
  }
}

.tab.character-biography .main-div {
  /*background-color: var(--color-light-1);*/
  display: grid;
  grid-template-columns: 1fr;
  legend {
    a {
      font-size: calc(var(--font-size-standard) * 1.4);
      padding-left: 5px;
    }
  }
  .splitted-text {
    display: flex;
    flex-direction: row;
    gap: 4px;
    fieldset {
      width: 100%;
    }
  }
  .deals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    .deal {
      display: flex;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
      min-width: 12rem;
      max-width: 12rem;
      .rollable:hover,
      .rollable:focus {
        text-shadow: 0 0 8px var(--color-shadow-primary);
        cursor: pointer;
      }
      .controls {
        font-size: 0.7rem;
        min-width: 1.8rem;
        max-width: 1.8rem;
      }
      .name {
        min-width: 10rem;
        max-width: 10rem;
      }
      .item-img {
        width: 24px;
        height: 24px;
        margin: 4px 0 0 0;
      }
    }
  }
  .aliases {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 4px;
    margin-left: 4px;
    .form-group {
      label {
        min-width: 6rem;
        max-width: 6rem;
      }
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
    }
    input {
      text-align: left;
      min-width: 41rem;
      max-width: 41rem;
    }
  }
  .biodata {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    .experience {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
    }
    .form-group {
      label {
        min-width: 6rem;
        max-width: 6rem;
      }
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 4px;
      margin-left: 4px;
      min-width: 14rem;
      max-width: 14rem;
    }
    input {
      text-align: left;
      min-width: 8rem;
      max-width: 8rem;
    }
  }

  prose-mirror.inactive {
    min-height: 40px;
  }
  prose-mirror.active {
    min-height: 150px;
  }
}
