/* NPC detail page */

.npc-detail-shell {
  min-width: 0;
}

.npc-detail-shell.is-map-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.85rem;
  align-items: start;
}

.npc-detail-content {
  min-width: 0;
}

.npc-map-trigger {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid rgba(51, 255, 167, 0.28);
  border-radius: 50%;
  background: rgba(51, 255, 167, 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}

.npc-map-trigger img {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
}

.npc-map-trigger:hover,
.npc-map-trigger:focus-visible {
  border-color: var(--accent);
  background: rgba(51, 255, 167, 0.14);
  outline: none;
}

.npc-property-elements {
  display: grid;
  grid-template-columns: minmax(9rem, auto) minmax(0, 1fr);
  gap: 0.8rem 1.25rem;
  align-items: center;
  margin: 0;
  padding: 0 0.85rem 0.8rem;
}

.npc-property-elements .npc-property {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
}

.npc-property-elements dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.npc-property-elements dd {
  margin: 0;
}

.npc-property--attack dd {
  display: flex;
  align-items: center;
  min-height: 1.65rem;
}

.npc-property--resistance dd {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.npc-attack-attribute {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 700;
}

.npc-property__muted {
  color: var(--text-muted);
  font-weight: 600;
}

.npc-attack-attribute i,
.npc-attribute i {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #b6c2bd;
}

.npc-attribute-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.npc-attribute {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.8rem;
  padding: 0.25rem 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.78rem;
}

.npc-attribute strong {
  color: var(--text);
}

.npc-attribute--fire i {
  background: #ef7455;
}

.npc-attribute--water i {
  background: #55a9d5;
}

.npc-attribute--wind i {
  background: #42c9af;
}

.npc-attribute--earth i {
  background: #cfad55;
}

.npc-attribute--holy i {
  background: #e9df83;
}

.npc-attribute--unholy i {
  background: #9274c4;
}

.npc-location-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.npc-location-chip {
  min-width: 0;
}

.npc-location-chip__link {
  display: block;
  min-height: 100%;
  padding: 0.58rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--link);
  text-decoration: none;
}

.npc-location-chip__link:hover,
.npc-location-chip__link:focus-visible {
  border-color: rgba(51, 255, 167, 0.26);
  background: rgba(51, 255, 167, 0.045);
  outline: none;
}

.npc-location-chip__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.npc-location-chip__main {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
}

.npc-location-chip__sub {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-location-more {
  margin-top: 0.5rem;
}

.npc-location-more > summary {
  width: max-content;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.npc-location-list--more {
  margin-top: 0.5rem;
}

.npc-relations .entity-link-grid {
  gap: 0.35rem 0.75rem;
}

.npc-relations .entity-link-grid > li {
  padding: 0.48rem 0;
  border-bottom: 0;
}

.npc-loot-panel {
  display: none;
}

.npc-loot-panel.is-active {
  display: block;
}

.npc-loot--single > h2 {
  margin-bottom: 0.7rem;
}

.npc-drop-groups {
  display: grid;
  gap: 0.65rem;
}

.npc-drop-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: var(--radius-table);
  background: rgba(255, 255, 255, 0.018);
}

.npc-drop-group__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.58rem 0.72rem;
  background: rgba(51, 255, 167, 0.045);
  color: #9fc5b4;
  font-size: 0.76rem;
}

.npc-drop-group__title strong {
  color: var(--accent);
  font-size: 0.78rem;
}

.npc-drop-list {
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
}

.npc-drop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(5rem, auto);
  gap: 0.25rem 0.7rem;
  align-items: center;
  padding: 0.58rem 0.72rem;
}

.npc-drop-row + .npc-drop-row {
  margin-top: 0.1rem;
}

.npc-drop-row__item {
  min-width: 0;
}

.npc-drop-row__amount {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.npc-drop-row__chance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  white-space: nowrap;
}

.npc-drop-row__chance strong {
  color: var(--text);
  font-size: 0.9rem;
}

.npc-drop-row__chance span {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.npc-drop-row__bar {
  grid-column: 1 / -1;
  height: 2px;
  margin-left: 2.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.npc-drop-row__bar i {
  display: block;
  height: 100%;
  background: #52dca1;
}

@media (max-width: 900px) {
  .npc-detail-shell.is-map-open {
    display: block;
  }
}

@media (max-width: 620px) {
  .npc-property-elements {
    grid-template-columns: 1fr;
  }

  .npc-drop-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .npc-drop-row__chance {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    padding-left: 2.6rem;
  }

  .npc-drop-row__bar {
    margin-left: 2.6rem;
  }
}
