/* =========================================================
   FANTASY MATCH: THE SHATTERED REALMS
   Equipment Paperdoll, Inventory Grid & Tooltip Diffs
   ========================================================= */

/* ── Inventory Modal Window & Body ── */
#modal-inventory .modal-window,
.inventory-modal-window {
  max-width: 580px;
  max-height: 96vh;
}

#modal-inventory .modal-body,
.inventory-modal-body {
  padding: 12px 16px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 156, 18, 0.4) transparent;
  display: flex;
  flex-direction: column;
}

/* ── Character Preview Paperdoll ───────────────────────── */
.char-preview-wrapper {
  display: flex;
  align-items: stretch;
  gap: 10px;
  background: #191424;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px 10px;
  margin-bottom: 8px;
  min-height: 168px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.char-preview-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.char-preview-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  flex-shrink: 0;
  gap: 4px;
}

.char-preview-figure {
  width: 86px;
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 60%, rgba(120,80,200,0.18) 0%, transparent 70%);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
}

.char-preview-figure img,
.char-preview-figure svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.char-preview-name {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
}

/* Individual paperdoll slot in preview */
.preview-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #231c30;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 36px;
  height: 36px;
  overflow: hidden;
  box-sizing: border-box;
}

.preview-slot:hover {
  border-color: var(--gold);
  background: #2d2240;
}

.preview-slot.slot-filled {
  border-style: solid;
}

.preview-slot.slot-empty {
  opacity: 0.5;
  cursor: default;
}

.preview-slot.slot-empty:hover {
  border-color: rgba(255,255,255,0.15);
  background: #231c30;
}

.preview-slot-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 4px;
}

.preview-slot-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.preview-slot-type {
  font-size: 0.56rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 2px;
}

.preview-slot-name {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

/* Rarity border colors on preview slot */
.preview-slot.common   { border-color: var(--rarity-common); }
.preview-slot.uncommon { border-color: var(--rarity-uncommon); }
.preview-slot.rare     { border-color: var(--rarity-rare); }
.preview-slot.epic     { border-color: var(--rarity-epic); }
.preview-slot.legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 6px rgba(255,152,0,0.35); }
.preview-slot.mythic   { border-color: var(--rarity-mythic); box-shadow: 0 0 8px rgba(233,30,99,0.5); }

/* ── Filter Tabs ───────────────────────────────────────── */
.inv-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 3px;
}

.modal-tab-btn {
  background: #231c30;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.modal-tab-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.modal-tab-btn.active {
  background: rgba(243,156,18,0.18);
  border-color: var(--gold);
  color: var(--gold);
}

/* "No items" placeholder */
.inv-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* Upgrade cost line in inspect panel */
.upgrade-cost-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
  color: var(--text-muted);
}

.upgrade-cost-value {
  color: var(--gold);
  font-weight: 800;
  font-family: 'Cinzel', serif;
}

/* Paperdoll Equipment Slots Layout */
.equipment-paperdoll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #191424;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 14px;
}

.equip-slot {
  aspect-ratio: 1;
  background: #231c30;
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
}

.equip-slot.filled {
  border-style: solid;
}

.equip-slot:hover {
  filter: brightness(1.2);
  border-color: var(--gold);
}

.equip-slot-icon {
  width: 75%;
  height: 75%;
}

.equip-slot-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Inventory Grid (Fixed 2-row paginated grid, perfectly square slots) */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  background: #191424;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px;
  box-sizing: border-box;
  margin-bottom: 6px;
}

/* Pagination Bar for Backpack */
.inv-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  padding: 2px 8px;
  background: rgba(25, 20, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 26px;
}

.inv-page-btn {
  background: #231c30;
  border: 1px solid rgba(243, 156, 18, 0.4);
  color: var(--gold-glow);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.inv-page-btn:hover:not(:disabled) {
  background: rgba(243, 156, 18, 0.25);
  border-color: var(--gold);
  color: #fff;
  transform: translateY(-1px);
}

.inv-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.inv-page-text {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  min-width: 75px;
  text-align: center;
}

/* Empty placeholder slot to preserve uniform 2-row layout */
.inv-item-slot.slot-placeholder {
  background: rgba(25, 20, 36, 0.35);
  border: 1.5px dashed rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: default;
  pointer-events: none;
}

.inv-item-slot.slot-placeholder:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.06);
}

/* Dedicated Item Inspection Popup Modal */
.inspect-modal-overlay {
  z-index: 150 !important;
  background: rgba(8, 6, 12, 0.88);
  backdrop-filter: blur(5px);
}

.inspect-popup-window {
  max-width: 440px !important;
  border: 2px solid var(--panel-border-inner) !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 0, 0, 0.6) !important;
}

.inv-item-slot {
  aspect-ratio: 1;
  background: #221a30;
  border: 2px solid #3c2f4d;
  border-radius: 8px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.inv-item-slot:hover {
  transform: scale(1.06);
  border-color: var(--gold);
  z-index: 10;
}

.inv-item-slot.selected {
  border-color: var(--gold-glow);
  box-shadow: 0 0 10px var(--gold);
  transform: scale(1.08);
}

.inv-item-slot.common { border-color: var(--rarity-common); }
.inv-item-slot.uncommon { border-color: var(--rarity-uncommon); }
.inv-item-slot.rare { border-color: var(--rarity-rare); }
.inv-item-slot.epic { border-color: var(--rarity-epic); }
.inv-item-slot.legendary { border-color: var(--rarity-legendary); box-shadow: 0 0 8px rgba(255, 152, 0, 0.4); }
.inv-item-slot.mythic { border-color: var(--rarity-mythic); box-shadow: 0 0 12px rgba(233, 30, 99, 0.6); }

/* In-Inventory Sell / Dismantle Mode Selection Styles */
.inventory-grid.in-sell-mode .inv-item-slot {
  cursor: pointer;
}

.inventory-grid.in-sell-mode .inv-item-slot.sell-selected {
  border-color: #e74c3c !important;
  background: rgba(231, 76, 60, 0.25) !important;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.8), inset 0 0 8px rgba(231, 76, 60, 0.5) !important;
  transform: scale(0.96);
}

.item-sell-check {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  box-shadow: 0 0 4px #000;
  z-index: 5;
  pointer-events: none;
}

.inventory-grid.in-sell-mode .inv-item-slot.is-equipped,
.inventory-grid.in-sell-mode .inv-item-slot.is-consumable {
  opacity: 0.35;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.item-count-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #fff;
  background: rgba(0,0,0,0.75);
  padding: 0 4px;
  border-radius: 4px;
}

/* Item Detail & Comparison Card */
.item-detail-panel {
  margin-top: 12px;
  background: #231c30;
  border: 1px solid var(--panel-border-inner);
  border-radius: 10px;
  padding: 12px;
}

.item-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.item-detail-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
}

.item-detail-rarity {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.item-detail-req {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  font-family: 'Cinzel', serif;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.item-detail-req.req-met {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border-color: #2ecc71;
}

.item-detail-req.req-unmet {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
}

/* Slot Badges for Req Level & Equipped */
.item-reqlvl-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.6rem;
  font-weight: 800;
  color: #cbd5e1;
  background: rgba(15, 10, 25, 0.85);
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
  line-height: 1.2;
}

.item-reqlvl-badge.locked {
  color: #ff6b6b;
  border-color: #ff4757;
  background: rgba(45, 10, 20, 0.9);
}

.item-equipped-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 0.6rem;
  font-weight: 900;
  color: #ffd700;
  background: rgba(25, 18, 5, 0.9);
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid #ffd700;
  pointer-events: none;
  line-height: 1.2;
}

.inv-item-slot.is-equipped {
  border-color: #ffd700 !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.45);
}

.inv-item-slot.req-locked {
  opacity: 0.72;
}

.rpg-btn.disabled,
.rpg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed !important;
  filter: grayscale(0.5);
  pointer-events: auto;
}

.item-detail-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

.stat-diff-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.stat-diff-pos { color: #2ecc71; font-weight: 800; }
.stat-diff-neg { color: #e74c3c; font-weight: 800; }

.item-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Shop Item Cards */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-card {
  background: #231c30;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.shop-card-header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.shop-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.shop-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
}

.shop-price-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  color: var(--gold);
}

/* Skill Tree Visual Layout */
.skill-path-header {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  margin: 12px 0 6px;
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: 8px;
}

.skill-nodes-row {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 16px;
}

.skill-node {
  background: #251e33;
  border: 2px solid var(--panel-border-inner);
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.skill-node.unlocked {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

.skill-node.maxed {
  border-color: #2ecc71;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

.skill-node-rank {
  font-size: 0.65rem;
  font-weight: 800;
  position: absolute;
  bottom: -4px;
  background: #110e17;
  padding: 1px 5px;
  border-radius: 6px;
  border: 1px solid var(--gold);
}

/* ── Backpack Header with Quick Dismantle ────────────────── */
.inv-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2px 0 3px;
  padding: 0 2px;
  font-family: 'Cinzel', serif;
}

.inv-header-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.04em;
}

.inv-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rpg-btn-sm {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  line-height: 1.3;
}

.rpg-btn-sm.danger {
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.85), rgba(142, 28, 20, 0.95));
  border-color: #e74c3c;
  color: #fff;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.rpg-btn-sm.danger:hover {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.5);
  transform: translateY(-1px);
}

/* ── Rarity Filter Bar ───────────────────────────────────── */
.inv-rarity-filter-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 0 3px;
  margin-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}
.inv-rarity-filter-bar::-webkit-scrollbar {
  display: none;
}

.rarity-filter-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-right: 2px;
  flex-shrink: 0;
}

.rarity-pill {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: #1e1929;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #bdc3c7;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.rarity-pill:hover {
  background: #2b233a;
  color: #fff;
}

.rarity-pill.active {
  background: rgba(241, 196, 15, 0.18);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 6px rgba(241, 196, 15, 0.3);
}

.rarity-pill.common { color: #b0bec5; }
.rarity-pill.uncommon { color: #4caf50; }
.rarity-pill.rare { color: #2196f3; }
.rarity-pill.epic { color: #9c27b0; }
.rarity-pill.legendary { color: #ff9800; }
.rarity-pill.mythic { color: #e91e63; }

.rarity-pill.common.active { border-color: #b0bec5; background: rgba(176, 190, 197, 0.2); color: #fff; }
.rarity-pill.uncommon.active { border-color: #4caf50; background: rgba(76, 175, 80, 0.2); color: #fff; }
.rarity-pill.rare.active { border-color: #2196f3; background: rgba(33, 150, 243, 0.2); color: #fff; }
.rarity-pill.epic.active { border-color: #9c27b0; background: rgba(156, 39, 176, 0.2); color: #fff; }
.rarity-pill.legendary.active { border-color: #ff9800; background: rgba(255, 152, 0, 0.2); color: #fff; }
.rarity-pill.mythic.active { border-color: #e91e63; background: rgba(233, 30, 99, 0.2); color: #fff; }

/* ── Quick Dismantle Modal ───────────────────────────────── */
.quick-dismantle-window {
  max-width: 480px;
  max-height: 88vh;
  background: linear-gradient(160deg, #221831 0%, #120e1e 100%);
  border: 2px solid #e74c3c;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(231, 76, 60, 0.35);
  display: flex;
  flex-direction: column;
}

.quick-dismantle-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.quick-dismantle-hint {
  font-size: 0.74rem;
  line-height: 1.35;
  color: #bdc3c7;
  background: rgba(14, 11, 22, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0;
  text-align: left;
}

/* Quick Select Shortcuts */
.qd-shortcuts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.qd-shortcuts-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-right: 2px;
}

.qd-shortcut-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1e1929;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #bdc3c7;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qd-shortcut-btn:hover {
  background: #2b233a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.qd-shortcut-btn.common { color: #b0bec5; border-color: rgba(176, 190, 197, 0.4); }
.qd-shortcut-btn.uncommon { color: #4caf50; border-color: rgba(76, 175, 80, 0.4); }
.qd-shortcut-btn.rare { color: #2196f3; border-color: rgba(33, 150, 243, 0.4); }
.qd-shortcut-btn.epic { color: #9c27b0; border-color: rgba(156, 39, 176, 0.4); }
.qd-shortcut-btn.secondary { color: #f1c40f; border-color: rgba(241, 196, 15, 0.4); }

/* Items List Container */
.qd-items-list-container {
  max-height: 240px;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  background: rgba(18, 14, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.qd-empty-notice {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

/* Individual Item Row in Dismantle List */
.qd-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #221a30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.qd-item-row:hover {
  background: #2d2340;
  border-color: rgba(255, 255, 255, 0.2);
}

.qd-item-row.selected {
  background: rgba(231, 76, 60, 0.15);
  border-color: #e74c3c;
}

.qd-item-chk {
  width: 16px;
  height: 16px;
  accent-color: #e74c3c;
  cursor: pointer;
}

.qd-item-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #171222;
  border: 1.5px solid #444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qd-item-icon-wrap.common { border-color: var(--rarity-common); }
.qd-item-icon-wrap.uncommon { border-color: var(--rarity-uncommon); }
.qd-item-icon-wrap.rare { border-color: var(--rarity-rare); }
.qd-item-icon-wrap.epic { border-color: var(--rarity-epic); }
.qd-item-icon-wrap.legendary { border-color: var(--rarity-legendary); }
.qd-item-icon-wrap.mythic { border-color: var(--rarity-mythic); }

.qd-item-icon-wrap img {
  width: 75%;
  height: 75%;
}

.qd-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.qd-item-title {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qd-item-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

.qd-item-gold {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.dismantle-summary-box {
  background: rgba(16, 12, 24, 0.9);
  border: 1px solid rgba(241, 196, 15, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
}

.quick-dismantle-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 2px;
}

/* Responsive Inventory on Mobile */
@media (max-width: 480px) {
  #modal-inventory .modal-body,
  .inventory-modal-body {
    padding: 8px 10px 10px;
  }

  .char-preview-wrapper {
    padding: 6px 6px;
    gap: 6px;
    min-height: 150px;
  }

  .char-preview-center {
    width: 72px;
  }

  .char-preview-figure {
    width: 68px;
    height: 98px;
  }

  .preview-slot {
    padding: 2px 5px;
    min-height: 32px;
    height: 32px;
    gap: 5px;
  }

  .preview-slot-icon {
    width: 22px;
    height: 22px;
  }

  .preview-slot-name {
    font-size: 0.62rem;
  }

  .inventory-grid {
    gap: 4px;
    padding: 5px;
  }

  .inv-filter-btn {
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .inv-rarity-pill {
    padding: 2px 6px;
    font-size: 0.56rem;
  }
}

