#panel-moba.panel[hidden] { display: none !important; }
#panel-moba.panel:not([hidden]),
#panel-moba.panel.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100dvh - 4.75rem);
  min-height: 36rem;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: #0b1014;
  color: #e8efe8;
}
body.mb-tab-active .site-footer { display: none; }

.mb-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mb-hud {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  align-items: center;
  padding: 0.4rem 0.7rem;
  background: #12181e;
  border-bottom: 1px solid #c9a227;
  font-family: Bahnschrift, "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
}
.mb-title { color: #c9a227; letter-spacing: 0.16em; font-weight: 800; }
.mb-gold { color: #e8d24a; }
.mb-kda { color: #9ad4ff; }
.mb-stage { flex: 1; min-height: 0; position: relative; }
#mb-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.mb-inv {
  position: absolute;
  left: 50%;
  bottom: 4.05rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.28rem;
  z-index: 3;
}
.mb-inv-slot {
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 2px solid #c9a227;
  background-color: rgba(10, 14, 18, 0.9);
  background-size: cover;
  background-position: center;
  color: #667;
  font-size: 0.72rem;
  cursor: pointer;
}
.mb-inv-slot.filled { color: transparent; }
.mb-skills {
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  pointer-events: none;
}
.mb-skill {
  width: 3.1rem;
  height: 3.1rem;
  border: 2px solid #c9a227;
  background-color: rgba(10, 14, 18, 0.86);
  background-size: cover;
  background-position: center;
  color: #e8d5a3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
.mb-skill span { font-size: 0.62rem; color: #9aa; }
.mb-help {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  font-size: 0.72rem;
  color: #b8c4bc;
  background: rgba(8, 10, 12, 0.7);
  padding: 0.35rem 0.5rem;
  pointer-events: none;
}
.mb-shop {
  position: absolute;
  inset: 0.4rem 0.4rem 3.15rem 0.4rem;
  width: auto;
  background: rgba(8, 12, 16, 0.96);
  border: 1px solid #c9a227;
  padding: 0.55rem 0.65rem 0.65rem;
  font-size: 0.78rem;
  display: grid;
  grid-template-columns: 11.6rem minmax(0, 1fr) 20rem;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.35rem 0.7rem;
  z-index: 4;
}
.mb-shop[hidden] { display: none !important; }
.mb-shop h3 { margin: 0; color: #c9a227; font-size: 0.92rem; letter-spacing: 0.1em; }
.mb-shop-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.mb-shop-count { color: #9aa; font-size: 0.72rem; }
.mb-shop-place { color: #c9b07a; font-size: 0.72rem; margin-right: auto; }
.mb-shop-cats {
  grid-column: 1;
  grid-row: 2 / 4;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding-right: 0.2rem;
  border-right: 1px solid #2a333c;
}
.mb-shop-cat-group {
  margin: 0.45rem 0 0.12rem;
  color: #c9a227;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mb-shop-cat {
  appearance: none;
  text-align: left;
  border: 0;
  background: transparent;
  color: #c5cec8;
  font: inherit;
  font-size: 0.76rem;
  padding: 0.22rem 0.35rem;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.mb-shop-cat:hover { color: #e8d5a3; background: rgba(201, 162, 39, 0.08); }
.mb-shop-cat.active {
  color: #e8d5a3;
  border-left-color: #c9a227;
  background: rgba(201, 162, 39, 0.14);
  font-weight: 700;
}
.mb-shop-search {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.35rem 0.5rem;
  background: #12181e;
  border: 1px solid #3a4550;
  color: #e8efe8;
}
.mb-shop-grid {
  grid-column: 2;
  grid-row: 3;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.15rem;
}
.mb-shop-band {
  margin: 0.35rem 0 0.1rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #c9a227;
  color: #c9a227;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.mb-shop-section h4 {
  margin: 0 0 0.4rem;
  color: #e8d5a3;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mb-shop-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr));
  gap: 0.5rem;
  align-content: start;
}
.mb-shop-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.18rem;
  padding: 0.4rem;
  border: 1px solid #3a4550;
  background: #0c1218;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.mb-shop-item.selected { border-color: #e8d5a3; box-shadow: inset 0 0 0 1px #e8d5a3; }
.mb-shop-item.studio { border-color: #7ecbff; }
.mb-shop-item.component { border-color: #4d5c50; }
.mb-shop-item.component .mb-shop-iname { color: #c5d0c4; font-weight: 600; }
.mb-shop-item.generating { outline: 1px dashed #c9a227; opacity: 0.85; }
.mb-shop-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #080c10;
  border: 1px solid #2a333c;
}
.mb-shop-iname {
  color: #e8d5a3;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.85em;
}
.mb-shop-iid {
  color: #8a96a0;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}
.mb-shop-item .mb-g {
  color: #e8d24a;
  font-size: 0.72rem;
  font-weight: 700;
}
.mb-shop-detail {
  grid-column: 3;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  overflow: auto;
  padding: 0.15rem 0 0 0.15rem;
  border-left: 1px solid #2a333c;
  padding-left: 0.7rem;
}
.mb-shop-detail[hidden] { display: none !important; }
.mb-shop-detail img {
  width: 7.2rem;
  height: 7.2rem;
  object-fit: cover;
  border: 1px solid #c9a227;
  background: #0c1218;
  flex: 0 0 auto;
}
.mb-shop-meta { min-width: 0; }
.mb-shop-meta strong { display: block; color: #e8d5a3; font-size: 1.02rem; line-height: 1.25; }
.mb-shop-id { display: block; color: #889; font-size: 0.7rem; margin-top: 0.15rem; }
.mb-shop-stats, .mb-shop-desc, .mb-shop-look { margin: 0.28rem 0; color: #b8c4bc; font-size: 0.74rem; line-height: 1.4; }
.mb-shop-look {
  max-height: 7.5rem;
  overflow: auto;
  white-space: pre-wrap;
  color: #d4c4a0;
  border-left: 2px solid #c9a227;
  padding-left: 0.4rem;
}
.mb-shop-kind {
  margin: 0 0 0.35rem;
  color: #c9a227;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mb-recipe-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  margin: 0.28rem 0;
  color: #9aa8a0;
  font-size: 0.68rem;
}
.mb-recipe-icon {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid #4a5560;
  background: #0c1218;
  cursor: pointer;
}
.mb-recipe-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mb-recipe-icon:hover { border-color: #e8d5a3; }
.mb-shop-alter {
  width: 100%;
  box-sizing: border-box;
  margin: 0.25rem 0;
  padding: 0.32rem 0.4rem;
  background: #12181e;
  border: 1px solid #3a4550;
  color: #e8efe8;
}
.mb-shop-actions { display: flex; flex-wrap: wrap; gap: 0.28rem; }
.mb-shop-actions button { margin: 0; }
.mb-shop-status { margin: 0.25rem 0 0; color: #e8d5a3; font-size: 0.72rem; min-height: 1em; }
@media (max-width: 900px) {
  .mb-shop {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }
  .mb-shop-cats { grid-column: 1; grid-row: 3; max-height: 7rem; flex-direction: row; flex-wrap: wrap; border-right: 0; }
  .mb-shop-search { grid-column: 1; grid-row: 2; }
  .mb-shop-grid { grid-column: 1; grid-row: 4; }
  .mb-shop-detail {
    grid-column: 1;
    grid-row: 5;
    border-left: 0;
    border-top: 1px solid #2a333c;
    padding-left: 0;
    padding-top: 0.5rem;
    max-height: 12rem;
    flex-direction: row;
  }
}
