.inventory-panel {
  padding: 12px;

  border: 1px dashed rgba(148, 163, 184, 0.38);
  border-radius: 8px;

  background: rgba(15, 23, 42, 0.4);

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.2);
}

.inventory-header {
  display: flex;
  align-items: anchor-center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.inventory-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
}

.inventory-summary span {
  min-height: 34px;
  padding: 8px 10px;

  border: 1px solid rgba(167, 243, 208, 0.2);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.06);

  color: #d1fae5;
  font-size: 0.86rem;
  font-weight: 800;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.inventory-slot {
  position: relative;

  display: grid;

  min-width: 0;
  min-height: 176px;
  padding: 10px;

  overflow: hidden;

  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;

  background: rgba(255, 255, 255, 0.06);
}

.inventory-slot.has-item-footer,
.shelter-storage-slot.has-item-footer {
  position: relative;
  padding-bottom: 72px;
}

.inventory-slot.is-empty {
  place-items: center;

  min-height: 156px;

  border-style: dashed;
}

.empty-slot-label {
  color: #cbd5e1;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.item-info {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 8px;

  width: 100%;
  min-width: 0;
  min-height: 100%;
}

.item-image {
  width: min(96px, 80%);
  height: 90px;

  object-fit: contain;

  filter:
    drop-shadow(
      0 12px 18px rgba(0, 0, 0, 0.28)
    );

  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

.item-info strong {
  align-self: end;

  max-width: 100%;

  overflow: hidden;

  color: inherit;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quantity-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 24px;
  height: 24px;
  padding: 0 5px;

  box-sizing: border-box;

  border-radius: 999px;

  background: rgba(15, 23, 42, 0.9);

  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.slot-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;

  display: flex;
  gap: 6px;

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 140ms ease;
}

.inventory-slot:hover .slot-actions,
.inventory-slot:focus-within .slot-actions {
  opacity: 1;
  pointer-events: auto;
}

.inventory-slot:hover .item-image,
.inventory-slot:focus-within .item-image {
  opacity: 0.52;
  transform: scale(0.96);
}

.slot-action {
  display: grid;
  place-items: center;

  width: 22px;
  height: 22px;

  padding: 0;

  border: 1px solid transparent;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.35);

  color: rgba(255, 255, 255, 0.7);

  cursor: pointer;

  font-size: 0;
  font-weight: 900;

  box-shadow: none;

  transition:
    transform 150ms ease,
    opacity 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.slot-action:hover {
  transform: translateY(-1px);
}

.use-action,
.wear-action {
  border-color: rgba(52, 211, 153, 0.35);
  color: #eff6ff;
}

.use-action:hover,
.wear-action:hover {
  border-color: rgba(134, 239, 172, 0.75);

  background: rgba(34, 197, 94, 0.88);

  color: #ffffff;
}

.drop-action {
  border-color: rgba(244, 63, 94, 0.35);
}

.drop-action:hover {
  background: rgba(220, 38, 38, 0.85);
  color: #ffffff;
}

.use-action::before {
  content: "✓";

  font-size: 12px;
}

.wear-action::before {
  content: "◆";

  font-size: 12px;
}

.drop-action::before {
  content: "×";

  font-size: 12px;
  line-height: 1;
}

.inventory-slot > .item-footer,
.shelter-storage-slot > .item-footer,
.inventory-slot > .item-footer-box,
.shelter-storage-slot > .item-footer-box,
.inventory-slot > .item-footer-metric,
.shelter-storage-slot > .item-footer-metric {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 3;

  width: auto;
}

.item-footer-box {
  display: flex;
  flex-direction: column;
  gap: 5px;

  width: 100%;
  min-width: 0;
  padding: 7px 8px;

  box-sizing: border-box;

  border: 1px solid rgba(95, 210, 255, 0.35);
  border-radius: 8px;

  background: rgba(20, 30, 45, 0.78);
}

.item-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
}

.item-footer-main-value {
  min-width: 0;

  color: #f4fbff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-footer-bar {
  width: 100%;
  height: 5px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.12);
}

.item-footer-bar-fill {
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #d99024,
      #f2c94c
    );

  transition:
    width 180ms ease;
}


.item-footer-weight,
.item-footer-inline-weight {
  flex-shrink: 0;

  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;

  white-space: nowrap;
}

.item-footer-metric {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;

  box-sizing: border-box;

  overflow: hidden;

  border: 1px solid rgba(95, 210, 255, 0.35);
  border-radius: 8px;

  background: rgba(20, 30, 45, 0.78);
}

.item-footer-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-width: 0;
}

.item-footer-main-info {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;

  overflow: hidden;
}

.item-footer-metric-title {
  min-width: 0;

  overflow: hidden;

  color: #f3f8ff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-footer-metric-value {
  flex-shrink: 0;

  color: #a7f3ff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;

  white-space: nowrap;
}

.item-footer-metric-subtext {
  margin-top: 3px;

  color: rgba(220, 235, 255, 0.78);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1;
}

.item-footer-metric-bar {
  width: 100%;
  height: 5px;
  margin-top: 5px;

  overflow: hidden;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.12);
}

.item-footer-metric-fill {
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      #2997c7,
      #5cccf2
    );

  transition:
    width 180ms ease;
}

.item-container-info.is-empty {
  border-color: rgba(150, 160, 175, 0.24);

  background: rgba(30, 36, 48, 0.68);
}

.item-container-info.is-empty
.item-footer-metric-title,
.item-container-info.is-empty
.item-footer-metric-value,
.item-container-info.is-empty
.item-footer-metric-subtext {
  color: rgba(220, 225, 235, 0.55);
}

.item-container-info.is-empty
.item-footer-metric-fill {
  width: 0;
}

.inventory-slot:not(.is-empty):not(.has-item-footer) {
  padding-bottom: 38px;
}

.inventory-slot:not(.has-item-footer) .item-info {
  min-height: 0;
}

.inventory-slot > .item-standalone-weight {
  position: absolute;
  right: 10px;
  bottom: 9px;
  z-index: 5;

  padding: 4px 9px;

  border: 1px solid rgba(70, 140, 255, 0.3);
  border-radius: 999px;

  background: rgba(8, 18, 40, 0.92);

  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;

  white-space: nowrap;
}