/* ============================================================
   Diablo 3 — Heroes page
   ============================================================ */

:root {
  --d3-page-gutter: 90px;
  --d3-page-width: calc(100vw - 112px);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-work-sans, "Work Sans", sans-serif);
  font-size: 14px;
  color: #fff;
  background: #1C1C24 url("https://files.supernova-analytics.com/sn-app-icons/Profile/Page-Background-dark.png") no-repeat center center / cover fixed;
  min-height: 100vh;
}

/* ── Mode tabs ── */
.mode-tabs-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  width: var(--d3-page-width);
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  left: var(--d3-page-gutter);
  margin-top: 92px;
  margin-bottom: 14px;
}

/* Mobile mode picklist — hidden by default, shown at ≤690px */
.mode-wrapper {
  display: none;
  position: relative;
  align-items: center;
}

.mode-icon {
  position: absolute;
  right: 10px;
  width: 10px;
  height: auto;
  pointer-events: none;
  filter: brightness(0) invert(1);
}

.mode-picklist {
  display: none;
  height: 36px;
  padding: 0 30px 0 12px;
  border-radius: 4px;
  background-color: var(--Obsidian);
  border: 1px solid #454857;
  color: #fff;
  font-family: var(--font-work-sans);
  font-size: 14px;
  appearance: none;
  cursor: pointer;
  box-sizing: border-box;
}

.mode-tabs {
  display: inline-flex;
  position: relative;
  border: 1px solid #454857;
  border-radius: 4px;
}

@media screen and (max-width: 690px) {
  .mode-tabs {
    display: none;
  }

  .mode-wrapper {
    display: flex;
    width: 100%;
  }

  .mode-picklist {
    display: block;
    width: 100%;
  }
}

.mode-tab {
  appearance: none;
  border: 0;
  background: var(--Obsidian);
  color: #A8AAB0;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  font-family: var(--font-work-sans);
}

.mode-tab+.mode-tab {
  border-left: 1px solid #454857;
}

.mode-tab:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.mode-tab:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.mode-tab:hover {
  background: #24252C;
  color: white;
}

.mode-tab.is-active {
  color: #fff;
  background: var(--Obsidian);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.mode-tab:focus-visible {
  outline: 2px solid #7aa2ff;
  outline-offset: 2px;
}

/* ── Hero selector rail ── */
.hero-selector-rail {
  display: flex;
  gap: 12px;
  width: var(--d3-page-width);
  box-sizing: border-box;
  position: relative;
  left: var(--d3-page-gutter);
  padding: 2px 0 18px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hero-selector-rail.fade-right {
  -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
  mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

.hero-selector-rail.fade-left {
  -webkit-mask-image: linear-gradient(to left, black 80%, transparent 100%);
  mask-image: linear-gradient(to left, black 80%, transparent 100%);
}

.hero-selector-rail.fade-both {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 80%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 80%, transparent 100%);
}

.hero-selector-rail::-webkit-scrollbar {
  height: 8px;
}

.hero-selector-rail::-webkit-scrollbar-track {
  background: transparent;
}

.hero-selector-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

/* ── Hero card ── */
.hero-card {
  flex: 0 0 140px;
  background: var(--Obsidian);
  border: 1px solid var(--Charcoal);
  border-radius: 9px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s ease;
  text-align: center;
  position: relative;
  user-select: none;
  box-sizing: border-box;
}

.hero-card .hero-card-portrait,
.hero-card .hero-card-body {
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.hero-card:hover .hero-card-portrait,
.hero-card:hover .hero-card-body {
  opacity: 1;
}

.hero-card.is-active .hero-card-portrait,
.hero-card.is-active .hero-card-body {
  opacity: 1;
}

.hero-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.hero-card.is-active {
  border-color: #4fd1da;
  box-shadow: 0 0 0 1px rgba(79, 209, 218, 0.22) inset;
}

.hero-card.is-dead {
  border-color: rgba(180, 50, 50, 0.5);
}


.hero-card.is-dead:hover {
  border-color: rgba(220, 70, 70, 0.7);
}

.hero-card.is-dead.is-active {
  border-color: rgba(220, 70, 70, 0.9);
  box-shadow: 0 0 0 1px rgba(200, 50, 50, 0.25) inset;
}

/* Circular portrait centred above the text body */
.hero-card-portrait {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--Charcoal);
  margin: 16px auto 0;
  position: relative;
  flex-shrink: 0;
}

.hero-card.is-active .hero-card-portrait {
  border-color: #4fd1da;
}

.hero-card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.hero-card-portrait::after {
  display: none;
}

/* No portrait: show initial letter centred */
.hero-card-portrait.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card-initial {
  font-size: 32px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.18);
  line-height: 1;
}

/* Text body below portrait */
.hero-card-body {
  padding: 10px 12px 12px;
}

.hero-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.hero-card-class {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.hero-card-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

.hero-card-badges {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ── Badges ── */
.badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 4px;
}

.badge--hc {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.35);
}

.badge--sc {
  background: rgba(52, 152, 219, 0.18);
  color: #5dade2;
  border: 1px solid rgba(52, 152, 219, 0.28);
}

.badge--s {
  background: rgba(155, 89, 182, 0.18);
  color: #a569bd;
  border: 1px solid rgba(155, 89, 182, 0.28);
}

.badge--dead {
  background: rgba(127, 140, 141, 0.18);
  color: #909090;
  border: 1px solid rgba(127, 140, 141, 0.28);
}

/* ── Hero detail panel ── */
.hero-detail-panel {
  width: var(--d3-page-width);
  box-sizing: border-box;
  position: relative;
  left: var(--d3-page-gutter);
  margin: 0 0 60px;
  padding-bottom: 40px;
}

.hero-detail-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  padding: 80px 0;
  font-size: 15px;
  border: 1px solid var(--Charcoal);
  border-radius: 9px;
  background: var(--Obsidian);
}

.hero-detail {
  display: grid;
  gap: 16px;
  align-items: start;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

/* ── Hero identity column ── */
.hero-identity {
  background: var(--Obsidian);
  border: 1px solid var(--Charcoal);
  border-radius: 9px;
  overflow: hidden;
  padding: 16px;
  grid-column: 1 / 4;
  align-self: stretch;
}

/* Full-bleed portrait area */
.hero-portrait-area {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--Charcoal);
  flex-shrink: 0;
  margin-bottom: 20px;
}

.hero-portrait-area.is-dead {
  filter: grayscale(0.65);
}

.hero-portrait-area::after {
  display: none;
}

.hero-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 0;
  border: none;
}

.hero-dead-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 600;
  color: #e74c3c;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2;
}

.hero-detail-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.hero-detail-class {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--Silver);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 12px;
}

.hero-detail-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding-left: 1px;
}

/* Quick stats row — Level + Paragon + Best GR */
.hero-level-row {
  display: flex;
  gap: 26px;
  margin-bottom: 19px;
  padding-left: 1px;
}

.hero-level-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-level-label {
  font-size: 12px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--Silver);
}

.hero-level-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}


/* Stats section */
.hero-stats-section {
  margin: 0 -15px;
  padding: 13px 15px 0;
  border-top: 1px solid var(--Charcoal);
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--color-white);
  margin-bottom: 11px;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-row .label {
  font-size: 14px;
  color: var(--Silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-row .value {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Equipment panel ── */
.hero-equipment {
  background: var(--Obsidian);
  border: 1px solid var(--Charcoal);
  border-radius: 9px;
  padding: 16px;
  grid-column: 4 / 10;
}

.hero-equipment h3,
.hero-skills h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  text-align: left;
  margin: 0 0 12px;
}

.hero-equipment h3::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-image: url("https://files.supernova-analytics.com/supernova-app-assets/Diablo%203/Icons/Icon_loudout.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Equipped build eb-* layout (mirrors analytics widget) ── */
.eb-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.eb-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.eb-section {
  display: flex;
  flex-direction: column;
  background: var(--Graphite, #24252c);
  border-radius: 9px;
  padding: 13px 16px 12px;
  flex: 1 1 0;
  justify-content: start;
  min-width: 0;
  overflow: hidden;
}

.eb-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  margin-bottom: 8px;
}

.eb-section-heading::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.eb-columns>.eb-section>.eb-section-heading::before {
  background-image: url("https://files.supernova-analytics.com/supernova-app-assets/Diablo%203/Icons/Icon_Armour.png");
}

.eb-right-col>.eb-section:first-child>.eb-section-heading::before {
  background-image: url("https://files.supernova-analytics.com/supernova-app-assets/Diablo%203/Icons/Icon_Jewellery.png");
}

.eb-right-col>.eb-section:last-child>.eb-section-heading::before {
  width: 15px;
  height: 15px;
  background-image: url("https://files.supernova-analytics.com/supernova-app-assets/Diablo%203/Icons/Icon_Weapon.png");
}

.eb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  min-height: 31px;
  border-bottom: var(--Charcoal) 1px solid;
}

.eb-row:last-child {
  border-bottom: none;
}

.eb-row--empty {
  opacity: 0.4;
}

.eb-quality-sq {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 0.5px rgba(69, 72, 87, 0.95);
}

.eb-quality-sq::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.eb-quality-sq img {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 4px 1px 4px 0;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.eb-lbl {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--Silver);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.eb-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.eb-row--empty .eb-quality-sq {
  background: var(--Obsidian) !important;
}

.eb-row--empty .eb-quality-sq::after {
  display: none;
}

.eb-row--empty .eb-name {
  color: var(--Silver);
}

/* Rarity colours */
.rarity-white {
  color: #c8c8c8;
}

.rarity-blue {
  color: #6fa3ef;
}

.rarity-yellow {
  color: #f4d03f;
}

.rarity-green {
  color: #00c569;
}

.rarity-orange {
  color: #e07b39;
}

/* Item badges */
.item-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 3px;
}

.item-badge--ancient {
  background: rgba(201, 163, 53, 0.16);
  color: #c8a435;
  border: 1px solid rgba(201, 163, 53, 0.35);
}

.item-badge--primal {
  background: rgba(224, 93, 46, 0.18);
  color: #e05c2e;
  border: 1px solid rgba(224, 93, 46, 0.4);
}

/* Legendary gem details */
.item-gems {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.gem-entry {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.gem-icon {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.gem-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.gem-rank {
  font-weight: 600;
  color: rgba(201, 163, 53, 0.85);
  white-space: nowrap;
}

/* ── Skills panel ── */
.hero-skills {
  background: var(--Obsidian);
  border: 1px solid var(--Charcoal);
  border-radius: 9px;
  padding: 16px;
  grid-column: 10 / 13;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.skills-section-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.25);
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--Silver);
}

.skill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-row:last-child {
  border-bottom: none;
}

.skill-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.skill-icon-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.skill-info {
  min-width: 0;
}

.skill-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-rune {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Loading states ── */
.hero-selector-rail.is-loading,
.hero-detail-panel.is-loading {
  opacity: 0.5;
  pointer-events: none;
}



@media screen and (max-width: 768px) {
  :root {
    --d3-page-gutter: 16px;
    --d3-page-width: calc(100vw - 32px);
  }

}

@media screen and (max-width: 1420px) {


  .hero-skills {
    grid-column: 7 / 13;
  }

  .hero-identity {
    grid-column: 1 / 7;
  }

  .hero-equipment {
    background: var(--Obsidian);
    border: 1px solid var(--Charcoal);
    border-radius: 9px;
    padding: 16px;
    grid-column: 1 / 13;
    grid-row: 2;
  }

}


@media screen and (max-width: 680px) {

  .eb-columns {
    grid-template-columns: 1fr;
  }

  .eb-section {
    flex: unset;
}

}


@media screen and (max-width: 550px) {

  .hero-skills {
    grid-column: 1 / 13;
    grid-row: 2;
  }

  .hero-identity {
    grid-column: 1 / 13;
  }

  .hero-equipment {
    grid-row: 3;
  }
}