.mc-inventory-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  isolation: isolate;
}

.mc-inventory-shell { position: relative; flex: none; }

.mc-inventory {
  position: absolute;
  inset: 0 auto auto 0;
  width: 195px;
  height: 192px;
  transform-origin: 0 0;
  font-family: var(--mc-font, monospace);
  font-size: 8px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1;
  image-rendering: pixelated;
  user-select: none;
  color: #404040;
}

.mc-inventory *, .mc-inventory *::before, .mc-inventory *::after { box-sizing: border-box; }
.mc-inventory [hidden] { display: none !important; }
.mc-inventory-panel {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 28px;
  width: 195px;
  height: 136px;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 256px 256px;
  image-rendering: pixelated;
}

.mc-inventory button {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  color: inherit;
  font: inherit;
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.mc-inventory .mc-inventory-tab {
  z-index: 1;
  width: 26px;
  height: 32px;
  background-size: 26px 32px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.mc-inventory .mc-inventory-tab-selected { z-index: 3; }
.mc-inventory-tab-icon {
  position: absolute;
  top: 9px;
  left: 5px;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  pointer-events: none;
  transform: scale(.9);
  transform-origin: center;
}
.mc-inventory-tab[data-row="bottom"] .mc-inventory-tab-icon { top: 7px; }

.mc-inventory-title {
  position: absolute;
  left: 8px;
  top: 6px;
  max-width: 161px;
  height: 9px;
  font-size: 8px;
  line-height: 9px;
  white-space: nowrap;
  pointer-events: none;
}

.mc-inventory .mc-inventory-search {
  position: absolute;
  z-index: 5;
  left: 82px;
  top: 6px;
  width: 80px;
  height: 9px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-family: var(--mc-font, monospace);
  font-size: 8px;
  line-height: 9px;
  color: #fff;
  caret-color: #fff;
  -webkit-appearance: none;
  appearance: none;
  user-select: text;
}
.mc-inventory-search::-webkit-search-decoration,
.mc-inventory-search::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.mc-inventory-search::selection { background: #0000aa; color: #fff; }

.mc-inventory .mc-inventory-slot {
  width: 16px;
  height: 16px;
  z-index: 4;
}
.mc-inventory-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.mc-inventory .mc-inventory-slot:hover::before,
.mc-inventory .mc-inventory-slot:focus-visible::before { background: rgb(255 255 255 / 48%); }
.mc-inventory .mc-inventory-slot-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid #ffff80;
  pointer-events: none;
}
.mc-inventory-item {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  transform: scale(.9);
  transform-origin: center;
}
.mc-inventory button:focus-visible { outline: 1px solid #fff; outline-offset: -1px; }
.mc-inventory .mc-inventory-slot:focus-visible { outline: none; }

.mc-inventory-scroll {
  position: absolute;
  left: 175px;
  top: 18px;
  width: 12px;
  height: 112px;
  z-index: 4;
  cursor: ns-resize;
  touch-action: none;
}
.mc-inventory-scroll[aria-disabled="true"] { cursor: default; }
.mc-inventory-scroll:focus-visible { outline: 1px solid #fff; outline-offset: 1px; }
.mc-inventory-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 15px;
  background-size: 12px 15px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
}

.mc-inventory-tooltip {
  position: absolute;
  z-index: 20;
  width: max-content;
  max-width: 192px;
  padding: 3px 4px;
  border: 1px solid #25005e;
  background: rgb(16 0 16 / 96%);
  box-shadow: 0 0 0 1px rgb(16 0 16 / 96%), inset 0 1px #5000a0;
  font-family: var(--mc-font, monospace);
  font-size: 8px;
  line-height: 10px;
  color: #fff;
  text-shadow: 1px 1px #3f3f3f;
  pointer-events: none;
  overflow-wrap: anywhere;
}
.mc-inventory-tooltip-id { color: #aaa; font-size: 7px; }
.mc-inventory-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
