/* Forest Frontier v0.9.21 — unified premium Hero + Inventory equipment polish. */

/* Shared premium paper-doll ------------------------------------------------ */
body.theme-ashen .hero-premium-paperdoll,
body.theme-ashen .inventory-paperdoll {
  --paper-slot-w: clamp(66px, 19.5vw, 86px);
  --paper-slot-h: clamp(82px, 24vw, 103px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-areas:
    ". head ."
    "weapon wanderer offhand"
    "armor wanderer gloves"
    ". boots .";
  grid-template-columns: var(--paper-slot-w) minmax(118px, 1fr) var(--paper-slot-w);
  grid-template-rows: var(--paper-slot-h) minmax(82px, 1fr) minmax(82px, 1fr) var(--paper-slot-h);
  gap: 4px clamp(7px, 2.2vw, 13px);
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 10px clamp(8px, 2.2vw, 14px) 12px;
  isolation: isolate;
}
body.theme-ashen .inventory-equipment-board {
  height: auto;
  min-height: clamp(324px, 91vw, 382px);
}

/* Quieter, more premium equipment slots ---------------------------------- */

/* Inventory repair -------------------------------------------------------- */
body.theme-ashen.screen-inventory-active .inventory-screen-panel {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px);
  scroll-padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px);
}
body.theme-ashen .inventory-inline-detail { scroll-margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 18px); }
body.theme-ashen .inventory-equipment-panel { gap: 12px; }
body.theme-ashen .inventory-category-toolbar { position:relative; z-index:2; }
body.theme-ashen .inventory-icon-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 7px !important;
}
body.theme-ashen .inventory-icon-cell {
  min-width:0;
  min-height:0;
  aspect-ratio:1/1;
  overflow:visible;
}
body.theme-ashen .inventory-detail-card { margin-bottom: 12px; }

/* The detail card must remain readable on phones. */
@media (max-width: 560px) {
  body.theme-ashen .inventory-detail-main {
    grid-template-columns: 92px minmax(0,1fr);
    gap: 9px;
    padding: 9px;
  }
  body.theme-ashen .inventory-detail-runes {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2,minmax(0,1fr));
    padding: 9px 0 0;
    border-top: 1px solid rgba(151,117,59,.23);
    border-left: 0;
  }
  body.theme-ashen .inventory-detail-subtitle { grid-column:1/-1; }
  body.theme-ashen .inventory-detail-footer { grid-template-columns:1fr; gap:7px; }
  body.theme-ashen .inventory-detail-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.theme-ashen .inventory-detail-actions button { width:100%; min-width:0; }
}

/* Compact 320–374px ------------------------------------------------------- */
@media (max-width: 374px) {
  body.theme-ashen .hero-premium-paperdoll,
  body.theme-ashen .inventory-paperdoll {
    --paper-slot-w: 65px;
    --paper-slot-h: 82px;
    grid-template-columns: var(--paper-slot-w) minmax(110px,1fr) var(--paper-slot-w);
    grid-template-rows: var(--paper-slot-h) minmax(76px,1fr) minmax(76px,1fr) var(--paper-slot-h);
    gap: 3px 5px;
    padding: 8px 5px 10px;
  }
  body.theme-ashen .inventory-equipment-board { min-height: 320px; }
  body.theme-ashen .inventory-icon-grid { gap:5px !important; }
  body.theme-ashen .inventory-category-button { flex-basis:43px; }
  body.theme-ashen .inventory-sort-compact { flex-basis:122px; }
}

/* Standard 375–429px ------------------------------------------------------ */

/* Wide mobile and tablet -------------------------------------------------- */
@media (min-width: 430px) {
  body.theme-ashen .inventory-paperdoll {
    --paper-slot-w: 82px;
    --paper-slot-h: 98px;
    grid-template-columns:var(--paper-slot-w) minmax(140px,1fr) var(--paper-slot-w);
    gap:5px 13px;
  }
}

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