diff --git a/static/suitbuilder.js b/static/suitbuilder.js
index 066ea81e..72558a08 100644
--- a/static/suitbuilder.js
+++ b/static/suitbuilder.js
@@ -152,13 +152,32 @@ function setupEventListeners() {
// Main action buttons
document.getElementById('searchSuits').addEventListener('click', performSuitSearch);
document.getElementById('clearAll').addEventListener('click', clearAllConstraints);
-
+ document.getElementById('wardsSelectAll').addEventListener('click', toggleAllWards);
+
// Slot control buttons
document.getElementById('lockSelectedSlots').addEventListener('click', lockSelectedSlots);
document.getElementById('clearAllLocks').addEventListener('click', clearAllLocks);
document.getElementById('resetSlotView').addEventListener('click', resetSlotView);
}
+// Legendary Ward checkboxes (toggled together by the "Select All" button).
+const WARD_IDS = [
+ 'protection_flame', 'protection_frost', 'protection_acid', 'protection_storm',
+ 'protection_slashing', 'protection_piercing', 'protection_bludgeoning', 'protection_armor'
+];
+
+/**
+ * Toggle all Legendary Ward checkboxes. If every ward is already checked,
+ * clears them; otherwise selects all. The button label tracks the state.
+ */
+function toggleAllWards() {
+ const boxes = WARD_IDS.map(id => document.getElementById(id)).filter(Boolean);
+ const allChecked = boxes.every(cb => cb.checked);
+ boxes.forEach(cb => { cb.checked = !allChecked; });
+ const btn = document.getElementById('wardsSelectAll');
+ if (btn) btn.textContent = allChecked ? 'Select All' : 'Clear All';
+}
+
/**
* Setup slot interaction functionality
*/