/* ── inventory.css — stash panel, item detail popup, profile chips, repair animation, stash capacity pulse ── */

  /* ── INVENTORY ── */
  .inv-section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin: 12px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
  }

  .inv-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .inv-item {
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
  }

  .inv-item:active { border-color: var(--amber); background: rgba(232,137,12,0.06); }

  .inv-item-icon {
    font-size: 30px;
    flex-shrink: 0;
    width: 38px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .inv-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
  }

  .inv-icon-large {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
  }

  /* Generic inline icon helper */
  .ui-icon { width: 18px; height: 18px; margin-right: 6px; vertical-align: middle; }

  .inv-item-name {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    letter-spacing: 2px;
    color: var(--text);
    flex: 1;
  }

  .inv-item-qty {
    font-size: 22px;
    color: var(--amber);
    font-weight: bold;
    flex-shrink: 0;
    text-align: right;
    min-width: 32px;
  }

  .inv-item-qty-label {
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-align: right;
  }

  /* ── ITEM DETAIL POPUP ── */
  #item-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 56px;
  }

  #item-popup-overlay.open { display: flex; }

  #item-popup {
    background: var(--bg2);
    border: 1px solid var(--amber);
    border-bottom: none;
    width: 100%;
    max-width: 540px;
    padding: 24px 20px 28px;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  #item-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
  }

  #item-popup-icon { font-size: 48px; flex-shrink: 0; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }

  #item-popup-title-block { flex: 1; }

  #item-popup-name {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    letter-spacing: 3px;
    color: var(--amber);
    line-height: 1.1;
    margin-bottom: 4px;
  }

  #item-popup-qty {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 2px;
  }

  #item-popup-flavor {
    font-size: 15px;
    color: var(--amber-dim);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-left: 2px solid var(--amber-dim);
    background: rgba(232,137,12,0.05);
  }

  #item-popup-desc {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
  }

  #item-popup-close {
    width: 100%;
    padding: 13px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    cursor: pointer;
    text-transform: uppercase;
  }

  #item-popup-close:active { border-color: var(--amber); color: var(--amber); }

  #item-popup-use-btn {
    width: 100%;
    padding: 13px;
    background: rgba(232,137,12,0.08);
    border: 1px solid var(--amber);
    color: var(--amber);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    cursor: pointer;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  #item-popup-use-btn:active { background: rgba(232,137,12,0.2); }
  #item-popup-use-btn:disabled {
    border-color: var(--border);
    color: var(--text-dim);
    cursor: default;
    background: none;
  }

  #inv-storage-bar {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
  }

  /* ── Profile chips display (above XP bar) ── */
  #profile-chips-bar {
    margin: 10px 0 4px;
  }
  .profile-chips-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--amber);
    letter-spacing: 2px;
    text-align: center;
    padding: 8px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
  }

  /* ── Repair success: bar fill green-flash then row fades out ── */
  @keyframes repair-pulse {
    0%   { background: rgba(78,154,81,0.00); }
    20%  { background: rgba(78,154,81,0.28); }
    50%  { background: rgba(78,154,81,0.10); }
    80%  { background: rgba(78,154,81,0.28); }
    100% { background: rgba(78,154,81,0.00); }
  }
  .repair-row-done {
    animation: repair-pulse 1s ease-in-out 2;
    border-radius: 4px;
  }

  /* ── Stash button capacity pulse ── */
  @keyframes stash-pulse-yellow {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 6px #e8890c); }
  }
  @keyframes stash-pulse-red {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 6px #e83232); }
  }
  #nav-inventory.stash-near     { animation: stash-pulse-yellow 1.8s ease-in-out infinite; }
  #nav-inventory.stash-critical { animation: stash-pulse-red    1.2s ease-in-out infinite; }
  #nav-inventory.stash-full     { filter: drop-shadow(0 0 8px var(--danger)); }

  .inv-empty {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 2px;
    text-align: center;
    padding: 24px;
  }

/* ── Stash UI — craft-row style ──────────────────────────────────────────── */
.stash-row {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stash-row:active { background: rgba(232,137,12,0.06); }

.stash-qty-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.stash-qty-num {
  font-size: 20px;
  color: var(--amber);
  font-weight: bold;
  line-height: 1;
  text-align: right;
}
.stash-equipped-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stash-equipped-label {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--amber);
  text-align: center;
  white-space: nowrap;
}
.stash-dur-bar-track {
  height: 3px;
  width: 36px;
  background: var(--bg3);
  border-radius: 2px;
}
.stash-dur-bar-fill { height: 100%; border-radius: 2px; }
.stash-dur-pct { font-size: 8px; letter-spacing: 1px; text-align: center; }

/* ── Item popup — stats + equip button ───────────────────────────────────── */
#item-popup-equip-btn {
  width: 100%;
  padding: 13px;
  background: rgba(232,137,12,0.08);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 3px;
  cursor: pointer;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#item-popup-equip-btn:active { background: rgba(232,137,12,0.2); }

/* ── Item popup — discard / sell button ─────────────────────────────────── */
#item-popup-discard-btn {
  flex-shrink: 0;
  align-self: flex-start;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#item-popup-discard-btn:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
#item-popup-discard-btn:disabled { opacity: 0.3; cursor: default; }
#item-popup-discard-btn.is-sell {
  width: auto;
  height: auto;
  padding: 4px 6px;
  gap: 2px;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--amber);
  border: none;
}
#item-popup-discard-btn.is-sell:hover:not(:disabled) { color: var(--amber); background: rgba(232,137,12,0.12); }
#item-popup-discard-hint {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-align: right;
  margin-top: -10px;
  margin-bottom: 10px;
}

.popup-stats-title {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.popup-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.popup-stat-row:last-child { border-bottom: none; }
.popup-stat-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.popup-stat-val {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--amber);
}
