.shell[data-scene="inventory"] .story-wrap {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto 1rem;
  padding-block-start: 4.5rem;
}
.shell[data-scene="inventory"] #game { padding: .4rem; }
.bag {
  max-inline-size: 32rem;
  margin-inline: auto;
  padding: .75rem;
  color: #f5e2ba;
  background: #171412;
  border: 1px solid #82684b;
  border-radius: .65rem;
}
.bag-tabs, .bag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .3rem;
  margin-block: .75rem;
}
.story-wrap .bag-tabs button {
  margin: 0;
  text-align: center;
  min-block-size: 44px;
  padding: .25rem .1rem;
  font-size: .75rem;
  overflow-wrap: anywhere;
}
.story-wrap .bag-tabs [aria-pressed="true"] { background: #694725; color: #fff5da; }
.bag-slot, .bag-rarity { --slot-border: #8e8073; }
.bag [data-rarity="common"] { --slot-border: #a8a8a8; }
.bag [data-rarity="uncommon"] { --slot-border: #60c36b; }
.bag [data-rarity="rare"] { --slot-border: #58adff; }
.bag [data-rarity="legendary"] { --slot-border: #c58aff; }
.story-wrap .bag-slot {
  margin: 0;
  text-align: center;
  display: grid;
  place-items: center;
  inline-size: 100%;
  min-block-size: 44px;
  aspect-ratio: 1;
  padding: .2rem;
  color: inherit;
  background: #211c19;
  border: 2px solid var(--slot-border);
  border-radius: .4rem;
  overflow-wrap: anywhere;
  font-size: .7rem;
}
.bag-slot[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #f5e2ba; }
.bag-slot img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.bag-empty { grid-column: 1 / -1; }
.story-wrap .bag-detail {
  padding: .65rem;
  background: #211c19;
  border: 1px solid #82684b;
  border-radius: .4rem;
}
.bag-detail h3, .bag-detail p { margin: 0 0 .35rem; }
.bag-detail p:last-child { margin-bottom: 0; }
.bag-rarity {
  display: inline-block;
  padding: .1rem .45rem;
  border: 1px solid var(--slot-border);
  border-radius: .35rem;
}

.bag-layout { display: grid; gap: .65rem; align-items: start; }
.bag-layout .bag-grid { margin-block: 0; }
.bag-slot { position: relative; }
.bag-quantity, .bag-equipped {
  position: absolute;
  padding: 0 .2rem;
  border-radius: .2rem;
  background: #18110e;
}
.bag-quantity { bottom: .15rem; right: .15rem; }
.bag-equipped { top: .15rem; left: .15rem; }
@media (min-width: 560px) {
  .bag-layout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}
