.dps-page-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.dps-mode-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-strong, #24242b);
  padding: 3px 6px;
  border-radius: 6px;
}

.dps-update-rankings-btn {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #a1a1aa);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-strong, #24242b);
  cursor: pointer;
  transition: all 150ms ease;
}

/* ── Compact Minimal Pagination Bar Controls ───────────────────── */
.dps-pagination-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-strong, #24242b);
  padding: 3px 4px;
  border-radius: 6px;
}

.dps-page-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-secondary, #a1a1aa);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 120ms ease;
  padding: 0;
}

.dps-page-nav-btn:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.dps-page-nav-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.dps-page-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.dps-page-info {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #a1a1aa);
  user-select: none;
}

.dps-page-num {
  color: var(--text, #fafafa);
  font-weight: 700;
}

.dps-page-slash {
  color: var(--muted, #71717a);
  font-size: 10px;
}

.dps-page-total {
  color: var(--text-secondary, #a1a1aa);
}

.dps-update-rankings-btn:hover {
  color: var(--text, #fafafa);
  background: rgba(255, 255, 255, 0.05);
}

.dps-update-rankings-btn.needs-update {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  animation: dps-btn-glow-pulse 2s infinite alternate;
}

@keyframes dps-btn-glow-pulse {
  0% {
    box-shadow: 0 0 2px rgba(245, 158, 11, 0.1);
  }
  100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
  }
}

.dps-mode-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted, #71717a);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
}

.dps-mode-selector {
  display: flex;
  gap: 2px;
}

.dps-mode-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #a1a1aa);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 120ms ease;
}

.dps-mode-btn:hover {
  color: var(--text, #fafafa);
  background: rgba(255, 255, 255, 0.05);
}

.dps-mode-btn.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.45);
}

/* ── 5-Column Grid Layout (fills edge to edge) ── */
.dps-page-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  padding-bottom: 24px;
}

/* ── At 1440p+ bump image height so cards feel bigger ── */
@media (min-width: 2000px) {
  .dps-page-list {
    gap: 20px;
  }

  .dps-card-media {
    height: 260px;
  }
}

/* 4 columns for mid-range (roughly tablet / small laptop) */
@media (max-width: 1400px) and (min-width: 1101px) {
  .dps-page-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ── Sleek Responsive DPS Card Container ───────────── */
.dps-calculator-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(160deg, #0d0d12 0%, #060608 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: none !important;
}

/* ── Top Left Rank Badge (#1, #2, #3...) ───────────────────── */
.dps-rank-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 850;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  letter-spacing: 0.02em;
  box-shadow: none !important;
}

/* ── Vertical Image Overlay Header Block ── */
.dps-card-media {
  position: relative;
  width: 100%;
  height: 220px;
  background: radial-gradient(120% 80% at 50% 0%, #1a1a24 0%, #0c0c12 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.dps-card-portrait-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform var(--t-med) var(--ease);
}

.dps-calculator-card:hover .dps-card-portrait-full {
  transform: scale(1.04);
}

.dps-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
      rgba(8, 8, 11, 0.98) 0%,
      rgba(8, 8, 11, 0.45) 35%,
      rgba(8, 8, 11, 0) 65%);
  z-index: 1;
}

.dps-card-portrait-meta {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dps-portrait-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8.5px;
  font-weight: 750;
  padding: 3px 7px;
  border-radius: 5px;
  background: #08080c;
  border: 1px solid rgba(255, 255, 255, 0.16);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #ffffff;
  box-shadow: none !important;
}

.dps-portrait-badge img,
.dps-portrait-badge svg {
  width: 12px !important;
  height: 12px !important;
  max-width: 12px !important;
  max-height: 12px !important;
  flex-shrink: 0 !important;
  object-fit: contain !important;
}

/* ── Comprehensive Elemental & Archetype Badges Color Styles ── */
.element-dark,
.element-shadow,
.element-curse {
  background: rgba(59, 13, 94, 0.85) !important;
  border-color: rgba(168, 85, 247, 0.6) !important;
  color: #ffffff !important;
}

.element-light,
.element-holy,
.element-divine {
  background: rgba(113, 63, 18, 0.85) !important;
  border-color: rgba(234, 179, 8, 0.6) !important;
  color: #ffffff !important;
}

.element-fire,
.element-flame,
.element-pyro,
.element-ignite {
  background: rgba(127, 29, 29, 0.85) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
}

.element-water,
.element-hydro,
.element-aqua {
  background: rgba(10, 37, 64, 0.92) !important;
  border-color: rgba(30, 110, 180, 0.7) !important;
  color: #ffffff !important;
}

.element-storm {
  background: rgba(15, 76, 73, 0.90) !important;
  border-color: rgba(45, 212, 191, 0.75) !important;
  color: #ffffff !important;
}

.element-lightning,
.element-electric,
.element-thunder {
  background: rgba(113, 63, 18, 0.85) !important;
  border-color: rgba(234, 179, 8, 0.6) !important;
  color: #ffffff !important;
}

.element-wind,
.element-gale,
.element-air {
  background: rgba(6, 78, 59, 0.85) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #ffffff !important;
}

.element-earth,
.element-terra {
  background: rgba(120, 53, 15, 0.85) !important;
  border-color: rgba(217, 119, 6, 0.6) !important;
  color: #ffffff !important;
}

.element-psychic,
.element-mind,
.element-telekinetic {
  background: rgba(112, 26, 117, 0.85) !important;
  border-color: rgba(217, 70, 239, 0.6) !important;
  color: #ffffff !important;
}

.element-ice,
.element-frost,
.element-cryo,
.element-freeze {
  background: rgba(12, 74, 110, 0.85) !important;
  border-color: rgba(56, 189, 248, 0.6) !important;
  color: #ffffff !important;
}

.element-neutral,
.element-none,
.element-untyped {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(100, 116, 139, 0.6) !important;
  color: #ffffff !important;
}

.archetype-physical {
  background: rgba(127, 29, 29, 0.85) !important;
  border-color: rgba(220, 38, 38, 0.6) !important;
  color: #ffffff !important;
}

.archetype-magic,
.archetype-magical {
  background: rgba(12, 74, 110, 0.85) !important;
  border-color: rgba(14, 165, 233, 0.6) !important;
  color: #ffffff !important;
}

.dps-card-nameplate-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dps-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-shadow:
    -1px -1px 0 #000000,
    1px -1px 0 #000000,
    -1px 1px 0 #000000,
    1px 1px 0 #000000,
    0px 2px 4px rgba(0, 0, 0, 0.95);
  margin: 0;
}

.dps-card-meta-chips {
  display: flex;
  gap: 3px;
  align-items: center;
}

.dps-mini-chip {
  font-size: 7.5px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.dps-mini-chip.ascend-chip {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.28);
}

/* ── Optimization Standings Rows ────────────────────────────────────────── */
.dps-optimized-container {
  padding: 6px;
}

.dps-options-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

.dps-fua-toggle-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}

.dps-fua-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}

.dps-fua-toggle:hover,
.dps-fua-toggle[aria-expanded="true"] {
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--text);
  background: rgba(99, 102, 241, 0.08);
}

.dps-fua-label {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
}

.dps-fua-summary {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font: 800 8.5px var(--font-mono);
}

.dps-fua-editor {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10030;
  width: 190px;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 6px;
  background: #09090d;
  box-shadow: none !important;
  animation: dpsPopoverIn 120ms var(--ease);
}

.dps-fua-editor-title {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
}

.dps-fua-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.dps-fua-editor-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dps-fua-editor-field span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.dps-fua-editor-input {
  width: 100%;
  height: 28px;
  padding: 2px 5px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font: 800 10px var(--font-mono);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  appearance: textfield;
}

.dps-fua-editor-input:focus {
  outline: none;
  border-color: var(--purple-strong);
  background: rgba(99, 102, 241, 0.1);
}

.dps-fua-editor-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

@keyframes dpsPopoverIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dps-shinigami-toggle,
.dps-show-more-builds,
.dps-view-builds-btn {
  border: 1px solid var(--border);
  background: var(--background-elevated);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 7.5px;
  font-weight: 700;
  padding: 2px 5px;
  transition: all var(--t-fast) var(--ease);
}

.dps-shinigami-toggle:hover,
.dps-show-more-builds:hover,
.dps-view-builds-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.dps-shinigami-toggle.active {
  border-color: rgba(129, 140, 248, 0.45);
  background: rgba(129, 140, 248, 0.14);
  color: #c7d2fe;
}

.dps-trait-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dps-trait-row {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.005);
  border: 1px solid rgba(255, 255, 255, 0.015);
  border-radius: 4px;
}

.dps-trait-row-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.dps-trait-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.dps-row-trait-header {
  display: flex;
  align-items: center;
  gap: 3px;
  width: auto;
  height: 22px;
  overflow: visible;
}

.dps-row-trait-icon {
  width: 24px !important;
  height: 24px !important;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: -1px;
}

/* ── Breakdown Icon Button (Dark Style Matching Builds Button) ── */
.dps-expand-trigger {
  border: 1px solid var(--border);
  background: var(--background-elevated);
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
  box-shadow: none !important;
}

.dps-expand-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--card-hover);
}

.dps-expand-trigger svg {
  width: 12px;
  height: 12px;
}

/* ── Relic Icons Row ── */
.dps-loadout-icons-col {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.dps-relic-icon-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  border: none !important;
  background-color: transparent !important;
  background-image: url("../../icons/relics/RelicBackground.png") !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  border-radius: 4px !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  flex-shrink: 0;
}

.dps-relic-icon-wrap.locked {
  border: 0.25px solid #3a3a3a !important;
}

.dps-relic-icon-wrap:hover {
  z-index: 100 !important;
}

.dps-relic-icon-wrap img {
  width: 86% !important;
  height: 86% !important;
  object-fit: contain !important;
  border: none !important;
  background: transparent !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) !important;
  transform: none !important;
}

/* Floating Tooltip General */
.dps-relic-icon-wrap::after {
  content: attr(data-relic-name);
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 999;
  width: max-content;
  max-width: 180px;
  padding: 4px 8px;
  border: 1px solid rgba(129, 140, 248, 0.4);
  border-radius: 5px;
  background: #0d0d14;
  color: #f1f5f9;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  box-shadow: none !important;
  white-space: normal;
  word-break: break-word;
}

.dps-relic-icon-wrap:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dps-trait-result-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.dps-result-val {
  font-size: 11.5px !important;
  font-weight: 800;
  color: var(--purple-strong);
  font-family: var(--font-mono) !important;
  white-space: nowrap;
}

.dps-result-unit {
  font-size: 8px !important;
  font-weight: 600;
  opacity: 0.85;
  margin-left: 2px;
}

.dps-result-val-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.dps-view-builds-btn {
  white-space: nowrap;
}

/* ── Deep Obsidian Dark Backdrop ── */
.dps-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

/* ── Builds Modal Leaderboard (Fixed Height Constraints) ── */
.dps-builds-modal-v2 {
  width: min(840px, 95vw);
  max-height: min(650px, 85vh);
  height: min(650px, 85vh);
  display: grid;
  grid-template-columns: 320px 1fr;
  background: #050508;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none !important;
  animation: dps-modal-in 140ms ease-out;
}

.dps-modal-unit-standalone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(120% 80% at 50% 0%, #12121a 0%, #050508 75%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.dps-modal-unit-img-only {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transform: scale(1.12);
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6));
}

.dps-leaderboard-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  max-height: 100%;
  background: #07070b;
  overflow: hidden;
}

.dps-leaderboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.dps-leaderboard-header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dps-modal-unit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dps-lh-main {
  font-size: 15px;
  font-weight: 850;
  color: #ffffff;
  line-height: 1.2;
}

.dps-modal-trait-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 750;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2px 7px;
  border-radius: 5px;
}

.dps-modal-trait-badge img {
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.dps-lh-sub {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.dps-builds-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.dps-builds-modal-close:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.dps-builds-table-header {
  display: grid;
  grid-template-columns: 40px 116px 1fr 50px 16px;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 9.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 9px 14px;
}

.dps-leaderboard-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.dps-table-build-row {
  display: grid;
  grid-template-columns: 40px 116px 1fr 50px 16px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  position: relative;
  min-height: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease;
}

.dps-table-build-row:hover {
  background: rgba(255, 255, 255, 0.03);
  z-index: 10;
}

.row-rank-col {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rank-badge-text {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #64748b;
}

.rank-gold .rank-badge-text {
  color: #f59e0b;
}

.row-relics-col {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.row-relics-col .dps-loadout-icons-col {
  gap: 2px;
}

.row-relics-col .dps-relic-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Flip tooltip to appear BELOW icon in the builds table to avoid overflow:hidden clip */
.row-relics-col .dps-relic-icon-wrap::after {
  top: calc(100% + 6px);
  bottom: auto;
  transform: translateY(-4px);
}

.row-relics-col .dps-relic-icon-wrap:hover::after {
  transform: translateY(0);
}

.row-dps-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.row-dps-val {
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #ffffff !important;
}

.rank-gold .row-dps-val {
  font-weight: 850 !important;
  color: #f59e0b !important;
}

.row-diff-col {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: right;
  min-width: 0;
}

.diff-best {
  color: #34d399;
}

.diff-loss {
  color: #f43f5e;
}

.row-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
}

.row-action-icon svg {
  width: 14px;
  height: 14px;
  transition: transform 120ms ease, color 120ms ease;
}

@keyframes dps-modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Modal Relics Display Details ── */
.dps-relic-cards {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
}

.dps-relic-detail {
  flex: 1;
  background: linear-gradient(135deg, #09090e 0%, #030305 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md, 8px);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
  box-shadow: none !important;
}

.dps-relic-detail.unit-equip {
  border-color: rgba(250, 204, 21, 0.25);
}

.dps-relic-detail img {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain;
}

.dps-relic-detail-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dps-relic-detail-tag {
  font-size: 8px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 1px;
}

.loadout-mods {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loadout-mod {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 4px);
  padding: 3px 6px;
}

.loadout-mod-icon {
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loadout-mod-label {
  color: var(--text-secondary);
}

.loadout-mod-value {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
}

/* ── Clean Relic Passive Box in Breakdown Cards ── */
.dps-relic-passive-box {
  margin-top: 6px;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: var(--radius-sm, 4px);
  padding: 6px 8px;
  box-sizing: border-box;
  box-shadow: none !important;
}

.dps-passive-toggle-btn {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  cursor: pointer;
  outline: none;
}

.dps-passive-btn-header {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
  text-align: left;
}

.dps-relic-passive-glow {
  background: linear-gradient(90deg, #22d3ee, #38bdf8, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 850;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dps-relic-passive-name {
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.dps-passive-toggle-arrow {
  width: 12px !important;
  height: 12px !important;
  color: #94a3b8;
  transition: transform var(--t-med) var(--ease);
}

.dps-passive-toggle-arrow.rotated {
  transform: rotate(180deg);
}

.dps-relic-passive-desc {
  font-family: "Montserrat", sans-serif !important;
  font-size: 10.5px !important;
  line-height: 1.4 !important;
  color: var(--text-secondary, #a1a1aa);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 8px;
  border-radius: 4px;
  margin-top: 6px;
  box-shadow: none !important;
}

.dps-relic-passive-desc.hidden {
  display: none !important;
}

/* ==========================================================================
   ── DPS BREAKDOWN MODAL UI (OBSIDIAN DARK THEME & ALWAYS VISIBLE FOOTER) ──
   ========================================================================== */

.dps-modal-container {
  display: flex;
  flex-direction: row;
  gap: 14px;
  max-width: min(1080px, 96vw);
  height: 86vh;
  max-height: 860px;
  width: max-content;
  min-height: 0;
  overflow: hidden !important;
  align-items: stretch;
}

.dps-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  background: linear-gradient(170deg, #08080d 0%, #030305 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none !important;
}

.dps-panel.summons-panel {
  width: min(92vw, 320px);
  flex-shrink: 0;
  z-index: 25 !important;
  border-color: rgba(45, 212, 191, 0.22);
}

.dps-panel.main-panel {
  z-index: 10 !important;
  width: min(92vw, 620px);
  flex: 1;
  min-width: 0;
  border-color: rgba(99, 102, 241, 0.22);
}

/* ── Panel Headers ── */
.dps-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: #060609;
}

.dps-panel-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.dps-panel-sub {
  margin-top: 2px;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
}

.dps-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all 120ms ease;
  box-shadow: none !important;
}

.dps-panel-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* ── Summon Tab Bar ── */
.dps-summon-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(45, 212, 191, 0.15);
  flex-shrink: 0;
}

.dps-summon-tab-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 120ms ease;
  box-shadow: none !important;
}

.dps-summon-tab-btn:hover {
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.06);
}

.dps-summon-tab-btn.active {
  color: #ffffff;
  background: rgba(45, 212, 191, 0.18);
  border-color: #2dd4bf;
}

.dps-panel-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 1 1 0%;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* ── Panel Footer (ALWAYS VISIBLE FOOTER FOR DPS TOTAL) ── */
.dps-panel-footer {
  flex-shrink: 0;
  padding: 10px 12px;
  background: #050508;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Section Cards (Dark Glassmorphism Math Boxes) ── */
.dps-section {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  background: #060609;
  padding: 12px;
  box-shadow: none !important;
  transition: border-color 140ms ease;
}

.dps-section:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.dps-section-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #a5b4fc;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dps-section-hd::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: none !important;
}

/* Color Themed Banners */
.section-damage .dps-section-hd {
  color: #f87171;
}

.section-crit .dps-section-hd {
  color: #c084fc;
}

.section-spa .dps-section-hd {
  color: #38bdf8;
}

.section-range .dps-section-hd {
  color: #fbbf24;
}

.section-dot .dps-section-hd {
  color: #34d399;
}

.section-summons .dps-section-hd {
  color: #2dd4bf;
}

/* ── High Contrast Dark Table Rows ── */
.dps-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dps-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 25px;
  padding: 3px 6px;
  border-radius: 4px;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: none !important;
}

.dps-table-row.indented {
  padding-left: 18px;
  background: transparent;
}

.dps-table-lbl {
  min-width: 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}

.dps-table-row.indented .dps-table-lbl {
  color: #64748b;
  font-size: 10.5px;
  font-weight: 500;
}

.dps-table-val {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

/* Multiplier Chip Tags */
.faint-mult {
  font-size: 9.5px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  display: inline-block;
  box-shadow: none !important;
}

/* ── Primary Callout / Total Rows ── */
.dps-table-row.primary {
  min-height: 30px;
  margin-top: 3px;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none !important;
}

.section-damage .dps-table-row.primary {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  border-left: 3px solid #f87171;
}

.section-crit .dps-table-row.primary {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.22);
  border-left: 3px solid #c084fc;
}

.section-spa .dps-table-row.primary {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.22);
  border-left: 3px solid #38bdf8;
}

.section-range .dps-table-row.primary {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.22);
  border-left: 3px solid #fbbf24;
}

.section-dot .dps-table-row.primary {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
  border-left: 3px solid #34d399;
}

.section-summons .dps-table-row.primary {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.22);
  border-left: 3px solid #2dd4bf;
}

.damage-highlight {
  color: #f87171 !important;
  font-weight: 850;
}

.crit-highlight {
  color: #c084fc !important;
  font-weight: 850;
}

.spa-highlight {
  color: #38bdf8 !important;
  font-weight: 850;
}

.range-highlight {
  color: #fbbf24 !important;
  font-weight: 850;
}

.dot-highlight {
  color: #34d399 !important;
  font-weight: 850;
}

.summons-highlight {
  color: #2dd4bf !important;
  font-weight: 850;
}

.combined-highlight {
  color: #a5b4fc !important;
  font-weight: 850;
}

.dps-table-row.divider {
  min-height: 1px;
  height: 1px;
  padding: 0;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Placement DPS Total Block (Pinned to Bottom Footer) ── */
.dps-formula-total {
  border: 1px solid rgba(129, 140, 248, 0.25) !important;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(6, 6, 10, 0.98) 100%) !important;
  box-shadow: none !important;
}

.dps-formula-total .dps-section-hd {
  color: #a5b4fc;
}

.dps-formula-total .dps-table-row.primary.total-row {
  background: rgba(99, 102, 241, 0.18) !important;
  border: 1px solid rgba(129, 140, 248, 0.35) !important;
  border-left: 4px solid #818cf8 !important;
  box-shadow: none !important;
}

/* ── Mobile Layout Support (< 850px) ───────────────────────────────────── */
.dps-modal-mobile-tabs {
  display: none;
}

@media (max-width: 850px) {
  .dps-page-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .dps-mode-toggle-group {
    padding: 2px 4px;
    border-radius: 4px;
  }

  .dps-mode-label {
    font-size: 8.5px;
    padding-left: 2px;
  }

  .dps-mode-btn {
    padding: 3px 6px;
    font-size: 10px;
    border-radius: 3px;
  }

  .dps-pagination-controls {
    margin-left: 0;
    padding: 2px 3px;
    border-radius: 4px;
  }

  .dps-page-nav-btn {
    width: 20px;
    height: 20px;
  }

  .dps-page-info {
    font-size: 10px;
    padding: 0 4px;
  }

  .dps-update-rankings-btn {
    margin-left: auto;
    padding: 5px 10px;
    font-size: 10px;
    border-radius: 4px;
  }

  @media (max-width: 600px) {
    .dps-update-rankings-btn {
      margin-left: 0;
      width: 100%;
      text-align: center;
    }
  }

  .dps-page-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 10px !important;
  }

  .dps-calculator-card {
    max-width: 100% !important;
    margin: 0 !important;
  }

  .dps-builds-modal-v2 {
    grid-template-columns: 1fr !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
  }

  .dps-modal-unit-standalone {
    min-height: 180px !important;
    height: 180px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .dps-modal-mobile-tabs {
    display: flex !important;
    gap: 6px;
    width: 100%;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-strong, #24242b);
    border-radius: 8px;
    padding: 4px;
    box-sizing: border-box;
    flex-shrink: 0;
  }

  .dps-modal-mtab {
    flex: 1;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, #a1a1aa);
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    text-align: center;
    transition: all 120ms ease;
  }

  .dps-modal-mtab.active {
    color: #ffffff;
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
  }

  .dps-modal-container {
    flex-direction: column !important;
    width: 95vw !important;
    max-width: 95vw !important;
    height: 85vh !important;
    max-height: 85vh !important;
    overflow-y: hidden !important;
    align-items: stretch !important;
  }

  .dps-panel.summons-panel,
  .dps-panel.main-panel {
    display: none !important;
  }

  .dps-panel.mobile-active {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    flex: 1 !important;
  }

  .dps-relic-cards {
    flex-direction: column !important;
    gap: 10px !important;
  }
}

/* ── Passive Modal Styling for Mobile ── */
.dps-passive-modal-content {
  width: min(420px, 90vw);
  background: #050508;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  animation: dps-modal-in 140ms ease-out;
  display: flex;
  flex-direction: column;
}

.dps-passive-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.dps-passive-modal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #a1a1aa);
}

.dps-relic-passive-glow {
  color: #818cf8;
}

.dps-relic-passive-name-modal {
  color: #ffffff;
  font-weight: 800;
}

.dps-passive-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, #a1a1aa);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.dps-passive-modal-close:hover {
  color: #ffffff;
}

.dps-passive-modal-body {
  padding: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.dps-relic-passive-desc-modal {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #a1a1aa);
}