.change-outfit {
  display: flex;
}

.change-outfit-inner {
  display: flex;
  flex: 1 1 auto;
  flex-basis: 100%;
  margin: 2px;
}

.change-outfit-inner span {
  display: flex;
  flex: 1 1 auto;
  background-image: url("/png/bg2.png");
  align-items: center;
  justify-content: center;
}

.change-outfit-inner button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.outfit-face-picker.on {
  background-image: url("/png/bg2.png");
  border: 2px solid #ffcc00;
  color: #ffcc00;
}

.outfit-color-picker {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: center;
}

.outfit-color-picker-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.outfit-color-picker-row > button {
  display: flex;
  flex: 0 1 auto;
  background-image: none;
  margin: 1px;
  height: 12px;
  width: 12px;
}

#outfit-modal .outfit-canvas-wrapper {
  position: relative;
  flex: 0 0 auto;
}

#outfit-modal .button-wrapper {
  position: absolute;
  left: 4px;
  top: 4px;
}

#outfit-modal .modal-body > .change-outfit-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-content: stretch;
  align-items: stretch;
  height: 128px;
}

.outfit-color-picker-wrapper {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: stretch;
  align-content: stretch;
}

.outfit-color-picker-wrapper .outfit-button-row {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
}

.outfit-color-picker-wrapper .outfit-button-row button {
  flex: 1 1 auto;
  margin: 2px;
}

/* Hide mount selector row, checkboxes (addons, mount, animated) — not used in Tibia 7.4 */
#outfit-modal .change-outfit .change-outfit-inner:last-child {
  display: none;
}

#outfit-modal .checkboxes {
  display: none;
}

/* Mobile responsive outfit modal */
@media (max-width: 768px), (max-height: 500px) {

  #outfit-modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    bottom: auto !important;
    width: auto;
    max-width: 90vw;
    max-height: 70vh;
    overflow: hidden;
    z-index: 99999;
  }

  #outfit-modal .modal-body {
    padding: 6px;
    max-height: calc(70vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Stack preview canvas and color picker vertically */
  #outfit-modal .modal-body > .change-outfit-wrapper {
    flex-direction: column;
    height: auto;
    align-items: center;
  }

  /* Shrink preview canvas on mobile */
  #outfit-modal .outfit-canvas-wrapper {
    margin-bottom: 0px;
  }

  #outfit-modal #outfit-example {
    width: 96px;
    height: 96px;
  }

  #outfit-modal .button-wrapper {
    display: none;
  }

  /* Color swatches: 19 per row, fit within ~280px
     each button = 13px + 1px margin each side = 15px → 15×19 = 285px */
  .outfit-color-picker-row > button {
    height: 13px;
    width: 13px;
    margin: 1px;
    padding: 0;
    min-width: 0;
    min-height: 0;
  }

  /* Remove extra stretch on color picker */
  .outfit-color-picker-wrapper {
    flex: 0 0 auto;
  }

  .outfit-color-picker {
    height: auto;
  }

  /* Part selector buttons (Head, Body, Legs, Feet) */
  .outfit-color-picker-wrapper .outfit-button-row button {
    padding: 4px 2px;
    font-size: 10px;
    margin: 1px;
  }

  /* Outfit navigation arrows */
  .change-outfit-inner button {
    padding: 4px 8px;
    font-size: 14px;
  }

  .change-outfit-inner span {
    font-size: 11px;
  }

  /* Footer buttons */
  #outfit-modal .modal-footer button {
    padding: 6px 12px;
    font-size: 12px;
  }

}