/* DropX Style Effect Module: Neon Frame v7 — low-cost perimeter runner.
   No Houdini @property, conic masks, SVG, Canvas, JS timers or DOM observers. */

.dx-lightning-frame {
  --dx-lightning-color: #f5c542;
  --dx-lightning-opacity: 82%;
  position: relative;
  isolation: isolate;
  outline: 1px solid color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent);
  outline-offset: 0;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 5px 1px color-mix(in srgb, var(--dx-lightning-color) 70%, transparent),
    0 0 14px 2px color-mix(in srgb, var(--dx-lightning-color) 42%, transparent);
}

/* Feed: only the post card itself receives the frame, never its action row/buttons. */
.post-card.dx-lightning-frame,
.group-feed-post-card.dx-lightning-frame {
  outline: 1px solid color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 72%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--dx-lightning-color) 38%, transparent);
}

/* Profile hero and floating profile card. */
.dx-profile-hero.dx-lightning-frame,
.quick-card-popover-box.dx-lightning-frame {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 7px 1px color-mix(in srgb, var(--dx-lightning-color) 72%, transparent),
    0 0 18px 3px color-mix(in srgb, var(--dx-lightning-color) 40%, transparent),
    0 12px 36px rgba(0,0,0,.32);
}

.dx-profile-avatar-wrap.dx-lightning-frame,
.quick-card-avatar-wrapper.dx-lightning-frame {
  border-radius: 50%;
  outline-offset: 2px;
  overflow: visible;
}

/* Friends list: frame the entire compact row, including avatar and activity. */
.friend-top20-item-row.dx-lightning-frame {
  border-radius: 9px;
  overflow: visible;
}

/* Forum author panel must keep its own content height, not stretch with the post. */
.dx-forum-post-author.dx-lightning-frame {
  align-self: start;
  height: fit-content;
  min-height: 0;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: visible;
}

/* Global / room chat messages. */
#dx-pulse .dx-pulse-message.dx-lightning-frame {
  border-color: color-mix(in srgb, var(--dx-lightning-color) 62%, rgba(255,255,255,.12));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 70%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--dx-lightning-color) 36%, transparent),
    0 5px 18px rgba(0,0,0,.16);
}

/* Private and dedicated message views. */
.message-bubble.dx-lightning-frame,
.msg-bubble.dx-lightning-frame {
  border-color: color-mix(in srgb, var(--dx-lightning-color) 64%, rgba(255,255,255,.14));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 70%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--dx-lightning-color) 36%, transparent);
}

/* Online users: the avatar, name and status stay inside one highlighted row. */
#dx-pulse .dx-pulse-member.dx-lightning-frame {
  border-radius: 9px;
  border-bottom-color: color-mix(in srgb, var(--dx-lightning-color) 52%, rgba(255,255,255,.10));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 65%, transparent),
    0 0 14px 2px color-mix(in srgb, var(--dx-lightning-color) 34%, transparent);
}

/* The preview uses the same static neon frame as live content. */
.dx-style-preview.dx-lightning-demo,
.dx-style-feature-preview.dx-lightning-frame {
  border-color: color-mix(in srgb, var(--dx-lightning-color) 62%, rgba(255,255,255,.12));
}

/* Shared message skin: desktop + PWA. */
#message-list .message-item .message-bubble.dx-lightning-frame,
html.dx-pwa-standalone body #message-list .message-item .message-bubble.dx-lightning-frame {
  border-color: color-mix(in srgb, var(--dx-lightning-color) 64%, rgba(255,255,255,.14));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 70%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--dx-lightning-color) 36%, transparent);
}

html body .chat-popup-wrapper .chat-popup:not(.dx-event-chat-popup) .chat-popup-messages .message-group .msg-bubble.dx-lightning-frame,
html body .chat-popup-wrapper .chat-popup:not(.dx-event-chat-popup) .chat-popup-messages .message-group.msg-left .msg-bubble.dx-lightning-frame,
html body .chat-popup-wrapper .chat-popup:not(.dx-event-chat-popup) .chat-popup-messages .message-group.msg-right .msg-bubble.dx-lightning-frame,
html.dx-pwa-standalone body .chat-popup-wrapper > .chat-popup .chat-popup-messages .message-group .msg-bubble.dx-lightning-frame,
html.dx-pwa-standalone body .chat-popup-wrapper > .chat-popup .chat-popup-messages .msg-bubble.dx-lightning-frame {
  border-color: color-mix(in srgb, var(--dx-lightning-color) 64%, rgba(255,255,255,.14));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 0 1px color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 70%, transparent),
    0 0 16px 2px color-mix(in srgb, var(--dx-lightning-color) 36%, transparent);
}

/* Static neon perimeter. The pulse animates opacity only (compositor-friendly). */
.dx-lightning-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--dx-lightning-color) var(--dx-lightning-opacity), transparent);
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  opacity: .76;
  box-shadow:
    inset 0 0 4px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 6px 1px color-mix(in srgb, var(--dx-lightning-color) 48%, transparent),
    0 0 13px 2px color-mix(in srgb, var(--dx-lightning-color) 25%, transparent);
  animation: dx-neon-frame-pulse 32s ease-in-out infinite;
}

/* A single bright, color-matched runner rotates around the actual frame edge.
   The conic gradient is masked to a 2px perimeter ring; rotation uses transform,
   not an animated custom property, background resizing, timers or JS. */
.dx-lightning-frame:not(.dx-profile-avatar-wrap):not(.quick-card-avatar-wrapper)::after {
  content: "";
  position: absolute;
  inset: -1px;
  box-sizing: border-box;
  padding: 2px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 5;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 345deg,
    color-mix(in srgb, var(--dx-lightning-color) 58%, white) 350deg,
    color-mix(in srgb, var(--dx-lightning-color) 82%, white) 354deg,
    #ffffff 357deg,
    color-mix(in srgb, var(--dx-lightning-color) 72%, white) 359deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transform-origin: center;
  animation: dx-neon-perimeter-rotate 28s linear infinite;
}

/* Avatar rings stay static: no orbit/radar effect around profile photos. */
.dx-profile-avatar-wrap.dx-lightning-frame::before,
.quick-card-avatar-wrapper.dx-lightning-frame::before {
  animation: none;
  opacity: .76;
}
.dx-profile-avatar-wrap.dx-lightning-frame::after,
.quick-card-avatar-wrapper.dx-lightning-frame::after {
  content: none;
}

@keyframes dx-neon-perimeter-rotate {
  from { transform: rotate(0turn); }
  to   { transform: rotate(1turn); }
}

/* One soft brightness swell after each complete perimeter lap. */
@keyframes dx-neon-frame-pulse {
  0%, 88%, 100% { opacity: .76; }
  93% { opacity: 1; }
  97% { opacity: .82; }
}

/* PWA/mobile: slower rotation and pulse, with no extra paint-heavy effects. */
@media (max-width: 768px), (display-mode: standalone) {
  .dx-lightning-frame::before {
    animation-duration: 40s;
  }
  .dx-lightning-frame:not(.dx-profile-avatar-wrap):not(.quick-card-avatar-wrapper)::after {
    animation-duration: 40s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dx-lightning-frame::before,
  .dx-lightning-frame::after {
    animation: none;
  }
  .dx-lightning-frame::before { opacity: .82; }
  .dx-lightning-frame::after { opacity: 0; }
}


/* Quick profile card: keep the neon frame, never render the moving runner.
   The runner's narrow vertical segment was appearing as a yellow slider on
   the right edge of the popover. The rest of the site keeps its animation. */
.quick-card-popover-box.dx-lightning-frame::after {
  content: none;
  display: none;
  animation: none;
  background: none;
  opacity: 0;
}
