/* ── Entity refs ── */
.er-se-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  vertical-align: -0.22em;
  text-decoration: none;
  color: #A8D8FF;
}
.er-se-link:hover {
  color: #CCE8FF;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.er-se-icon {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
  flex-shrink: 0;
}
.er-se-tooltip {
  position: fixed;
  z-index: 9999;
  max-width: 280px;
  background: #1a0800;
  border: 1px solid rgba(255,155,70,0.45);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  pointer-events: none;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.er-se-tooltip-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-top: 1px;
}
.er-se-tooltip-name {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,155,70,1);
  margin-bottom: 3px;
}
.er-se-tooltip-desc {
  font-size: .68rem;
  color: rgba(255,232,208,0.85);
  line-height: 1.4;
}
.er-num {
  color: #FFD9A0;
  font-weight: 700;
}
.er-char-link,
.er-weapon-link,
.er-item-link {
  text-decoration: none;
  color: #FFD080;
}
.er-char-link:hover,
.er-weapon-link:hover,
.er-item-link:hover {
  color: #FFE8A0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.er-item-link {
  cursor: default;
}

/* ── Custom autocomplete dropdown (replaces unstylable native datalist) ── */
.er-autocomplete-wrap {
  position: relative;
  display: inline-block;
}
.er-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: #1c1f2e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(180,150,80,0.4) rgba(10,8,2,0.3);
}
.er-autocomplete-dropdown::-webkit-scrollbar { width: 5px; }
.er-autocomplete-dropdown::-webkit-scrollbar-track { background: rgba(10,8,2,0.3); }
.er-autocomplete-dropdown::-webkit-scrollbar-thumb { background: rgba(180,150,80,0.4); border-radius: 4px; }
.er-autocomplete-option {
  padding: 6px 10px;
  font-size: 0.78rem;
  color: #d0d0d0;
  cursor: pointer;
}
.er-autocomplete-option:hover,
.er-autocomplete-option.active {
  background: rgba(200,160,80,0.25);
  color: #fff;
}

/* ── Character / Weapon entity hover tooltips ── */
.er-entity-tooltip-wrap {
  max-width: 360px;
  padding: 12px 14px;
}
.er-entity-tooltip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
}
.er-entity-tooltip-portrait {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 4px;
}
.er-entity-tooltip-portrait .character-portrait {
  width: 80px;
  height: 80px;
  transform: scale(0.7);
  transform-origin: top left;
}
.er-entity-tooltip-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}
.er-entity-tooltip-body {
  flex: 1;
  min-width: 0;
}
.er-entity-tooltip-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFB347;
  margin-bottom: 4px;
}
.er-entity-tooltip-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.er-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255,179,71,0.12);
  border: 1px solid rgba(255,155,70,0.3);
  color: #FFB347;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.er-entity-tooltip-section-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: rgba(255,179,71,0.8);
  margin-top: 8px;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.er-entity-tooltip-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 12px;
  margin-bottom: 4px;
}
.er-entity-tooltip-stat {
  font-size: 0.64rem;
  color: rgba(255,232,208,0.75);
}
.er-entity-tooltip-stat b {
  color: rgba(255,232,208,0.9);
  font-weight: 700;
}
.er-skill-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 3px;
}
.er-entity-tooltip-desc {
  font-size: 0.68rem;
  color: rgba(255,232,208,0.85);
  line-height: 1.45;
  margin-bottom: 4px;
}
.er-entity-tooltip-desc .er-num { color: #FFD9A0; font-weight: 700; }
.er-entity-tooltip-desc .er-se-link { font-size: 0.68rem; }
.er-entity-tooltip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.er-entity-tooltip-list li {
  font-size: 0.66rem;
  color: rgba(255,232,208,0.78);
  line-height: 1.45;
  padding: 2px 0;
}
.er-entity-tooltip-list li::before {
  content: '•';
  color: rgba(255,179,71,0.5);
  margin-right: 5px;
}
.er-skill-meta {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  background: rgba(255,179,71,0.10);
  border: 1px solid rgba(255,179,71,0.22);
  color: rgba(255,179,71,0.85);
  white-space: nowrap;
}
.er-skill-meta b {
  font-weight: 700;
  color: rgba(255,179,71,0.7);
}
.er-weapon-tier {
  margin-bottom: 6px;
}
.er-weapon-tier-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255,179,71,0.65);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.er-weapon-meta {
  font-size: 0.6rem;
  color: rgba(255,232,208,0.55);
  margin-top: 2px;
}

/* ── Weapon portrait in tooltip ── */
.er-weapon-portrait {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}
.er-weapon-portrait-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.er-weapon-portrait-icon-slot {
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.er-weapon-portrait-icon {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.er-weapon-portrait-rim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.er-weapon-portrait-elem {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  z-index: 3;
}
.er-weapon-portrait-wt {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  z-index: 3;
}
