.right-hud-overlay-stack {
  position: absolute;
  top: calc(var(--ui-topbar-height, 48px) + 9px);
  right: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  width: min(310px, calc(100% - 24px));
  pointer-events: none;
}

.right-hud-overlay-stack > * {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 0;
  overflow-wrap: anywhere;
  pointer-events: auto;
}

.active-effects-display {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  /* Empty space between icons stays transparent to scene clicks. */
  pointer-events: none;
}

.active-effects-display .active-effect-icon {
  --effect-color: #C7A34D;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--effect-color);
  border-radius: 5px;
  background: var(--mg-surface-window, #24211d);
  color: var(--ui-text);
  box-shadow: inset 0 1px 0 #ffffff0a;
  cursor: pointer;
  pointer-events: auto;
}
.active-effect-icon.is-buff { --effect-color: #5F9B65; }
.active-effect-icon.is-debuff { --effect-color: #B85B55; }
.active-effect-icon:focus-visible { outline: 2px solid var(--effect-color); outline-offset: 2px; }
.active-effect-icon:hover { filter: brightness(1.15); }
.active-effect-icon:disabled { opacity: .6; cursor: wait; }
.active-effect-icon .item-icon-wrap,
.active-effect-icon .active-effect-image,
.active-effect-icon .item-composite-icon { width: 22px; height: 22px; object-fit: contain; }
.active-effect-icon .item-icon-badge { right: -2px; top: -3px; }

#activeEffectsTooltip {
  max-width: min(360px, calc(100vw - 24px));
  box-sizing: border-box;
  overflow-wrap: anywhere;
  pointer-events: none;
}
