/* Forest Frontier v0.9.22 — responsive Hero dashboard and inventory workspace. */

/* Wider working canvas only where horizontal space is useful. */
@media (min-width: 900px) {
  body.theme-ashen.screen-hero-active .app,
  body.theme-ashen.screen-inventory-active .app {
    width: min(1120px, calc(100% - 32px));
  }
}

/* -----------------------------------------------------------------------
   Inventory
   ----------------------------------------------------------------------- */
body.theme-ashen.screen-inventory-active .inventory-screen-panel {
  padding: clamp(10px, 1.8vw, 16px);
  overflow: visible;
}

body.theme-ashen .inventory-equipment-panel {
  gap: 12px;
}

body.theme-ashen .inventory-category-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 158px);
  align-items: stretch;
  gap: 7px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.theme-ashen .inventory-category-scroll {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(151,117,59,.28);
  border-radius: 10px;
  background: rgba(3,9,7,.72);
  scrollbar-width: none;
}
body.theme-ashen .inventory-category-scroll::-webkit-scrollbar { display: none; }

body.theme-ashen .inventory-category-button {
  flex: 0 0 47px;
  min-height: 42px;
  border: 1px solid transparent;
}
body.theme-ashen .inventory-category-button.active {
  border-color: rgba(61,211,180,.46);
  box-shadow: none;
}

body.theme-ashen .inventory-sort-compact {
  min-width: 0;
  margin: 0;
  padding: 5px 7px;
  border: 1px solid rgba(151,117,59,.28);
  border-radius: 10px;
  background: rgba(3,9,7,.72);
}
body.theme-ashen .inventory-sort-compact select {
  min-width: 0;
  border: 1px solid rgba(151,117,59,.18);
  border-radius: 6px;
}

body.theme-ashen .inventory-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
}
body.theme-ashen .inventory-list-pane {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

body.theme-ashen .inventory-icon-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 7px !important;
}
body.theme-ashen .inventory-icon-cell {
  min-height: 0;
  aspect-ratio: 1;
  border-color: rgba(var(--slot-color),.58);
  border-radius: 9px;
  box-shadow: inset 0 0 15px rgba(var(--slot-color),.08), 0 5px 12px rgba(0,0,0,.2);
}
body.theme-ashen .inventory-icon-cell.active-item {
  transform: none;
  box-shadow: inset 0 0 18px rgba(var(--slot-color),.14), 0 0 0 2px rgba(var(--slot-color),.7);
}
body.theme-ashen .inventory-cell-icon,
body.theme-ashen .inventory-cell-icon > .item-icon {
  width: min(58px, 84%);
  height: min(58px, 84%);
}

body.theme-ashen .inventory-inline-detail {
  min-width: 0;
}
body.theme-ashen .inventory-detail-card {
  margin: 0;
  border-color: rgba(var(--detail-color),.48);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.012), 0 10px 22px rgba(0,0,0,.24);
}
body.theme-ashen .inventory-detail-close {
  position: absolute;
  z-index: 8;
  top: 7px;
  right: 7px;
  display: none;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(189,177,148,.25);
  border-radius: 50%;
  background: rgba(3,8,7,.9);
  color: #c9c2b0;
  font-size: 23px;
  line-height: 1;
}

body.theme-ashen .inventory-detail-main {
  grid-template-columns: 104px minmax(0,1fr);
  gap: 10px;
  padding: 12px;
}
body.theme-ashen .inventory-detail-portrait {
  min-height: 132px;
  border-color: rgba(var(--detail-color),.62);
  box-shadow: inset 0 0 18px rgba(var(--detail-color),.1);
}
body.theme-ashen .inventory-detail-portrait .item-icon {
  width: 82px;
  height: 104px;
}
body.theme-ashen .inventory-detail-copy h3 {
  padding-right: 28px;
  font-size: clamp(19px, 2.2vw, 24px);
}
body.theme-ashen .inventory-detail-status {
  display: flex;
  width: fit-content;
  max-width: 100%;
  line-height: 1.3;
}
body.theme-ashen .inventory-detail-runes {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 7px;
  padding: 9px 0 0;
  border-top: 1px solid rgba(151,117,59,.18);
  border-left: 0;
}
body.theme-ashen .inventory-detail-subtitle { grid-column: 1 / -1; }
body.theme-ashen .inventory-detail-footer {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 12px 12px;
}
body.theme-ashen .inventory-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 7px;
}
body.theme-ashen .inventory-detail-actions button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}
body.theme-ashen .inventory-detail-actions .sell-button:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 760px) {
  body.theme-ashen .inventory-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 430px);
    align-items: start;
    gap: 16px;
  }
  body.theme-ashen .inventory-inline-detail {
    position: sticky;
    top: 12px;
  }
  body.theme-ashen .inventory-icon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  body.theme-ashen .inventory-detail-main {
    grid-template-columns: 96px minmax(0,1fr);
  }
}

@media (min-width: 1020px) {
  body.theme-ashen .inventory-icon-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  body.theme-ashen .inventory-category-toolbar {
    grid-template-columns: minmax(0,1fr) 112px;
  }
  body.theme-ashen .inventory-sort-compact {
    align-content: center;
    padding: 5px;
  }
  body.theme-ashen .inventory-sort-compact > span { display: none; }
  body.theme-ashen .inventory-sort-compact select {
    min-height: 42px;
    padding-inline: 7px 22px;
    font-size: 9px;
  }
  body.theme-ashen .inventory-inline-detail {
    position: fixed;
    z-index: 72;
    left: 6px;
    right: 6px;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 5px);
    display: none;
    max-height: min(72dvh, 610px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 14px;
    background: #030806;
    box-shadow: 0 -100vh 0 100vh rgba(0,0,0,.68), 0 -14px 38px rgba(0,0,0,.78);
  }
  body.theme-ashen .inventory-inline-detail.is-open { display: block; }
  body.theme-ashen .inventory-detail-close { display: grid; place-items: center; }
  body.theme-ashen .inventory-detail-card { border-radius: 14px; }
  body.theme-ashen .inventory-detail-main {
    grid-template-columns: 82px minmax(0,1fr);
    padding: 12px 11px 10px;
  }
  body.theme-ashen .inventory-detail-portrait { min-height: 108px; }
  body.theme-ashen .inventory-detail-portrait .item-icon { width: 68px; height: 86px; }
  body.theme-ashen .inventory-detail-copy h3 { font-size: 19px; }
  body.theme-ashen .inventory-detail-runes { grid-template-columns: 1fr; }
  body.theme-ashen .inventory-detail-subtitle { grid-column: auto; }
  body.theme-ashen .inventory-detail-actions button { min-height: 46px; }
}

@media (max-width: 374px) {
  body.theme-ashen .inventory-category-toolbar { grid-template-columns: minmax(0,1fr) 96px; }
  body.theme-ashen .inventory-category-button { flex-basis: 43px; }
  body.theme-ashen .inventory-icon-grid { gap: 5px !important; }
  body.theme-ashen .inventory-detail-main { grid-template-columns: 72px minmax(0,1fr); gap: 8px; }
  body.theme-ashen .inventory-detail-portrait { min-height: 96px; }
  body.theme-ashen .inventory-detail-portrait .item-icon { width: 58px; height: 74px; }
}

/* -----------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  body.theme-ashen .inventory-icon-cell,
  body.theme-ashen .hero-premium-paperdoll .equipment-socket { transition: none; }
}
