/* Direct calls, rich profiles and online media pickers */
#direct-call-root:empty { display: none; }
.direct-call-backdrop {
  position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center;
  padding: 24px; background: rgba(2, 5, 14, .76); backdrop-filter: blur(18px);
}
.direct-call-backdrop::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, rgba(111, 76, 255, .24), transparent 42%),
    radial-gradient(circle at 20% 80%, rgba(31, 202, 255, .12), transparent 30%);
}
.direct-call-ringing-card {
  position: relative; width: min(420px, 94vw); padding: 36px 32px 30px; text-align: center;
  border: 1px solid rgba(148, 137, 255, .32); border-radius: 28px;
  background: linear-gradient(155deg, rgba(19, 25, 47, .98), rgba(10, 13, 28, .98));
  box-shadow: 0 32px 100px rgba(0, 0, 0, .55), 0 0 70px rgba(92, 73, 255, .13);
}
.direct-call-brand { color: #a99cff; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.direct-call-live-dot, .direct-call-connected-dot {
  display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #42dfa5;
  box-shadow: 0 0 16px rgba(66, 223, 165, .75);
}
.direct-call-avatar-wrap { position: relative; width: 122px; height: 122px; margin: 32px auto 20px; }
.direct-call-avatar-wrap img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid #6e59ff; box-shadow: 0 16px 42px rgba(0,0,0,.38); }
.direct-call-ring { position: absolute; inset: -10px; border: 1px solid rgba(117, 92, 255, .65); border-radius: 50%; animation: directCallPulse 2.1s infinite; }
.direct-call-ring.ring-two { inset: -24px; animation-delay: .7s; opacity: .45; }
@keyframes directCallPulse { 0% { transform: scale(.88); opacity: .75; } 100% { transform: scale(1.22); opacity: 0; } }
.direct-call-ringing-card h2 { margin: 0; color: #fff; font: 800 26px/1.2 var(--font-heading); }
.direct-call-ringing-card p { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 9px 0 28px; color: var(--text-muted); font-size: 13px; }
.direct-call-ringing-card p svg { width: 15px; }
.direct-call-ringing-actions { display: flex; justify-content: center; gap: 52px; }
.call-round-action { display: grid; justify-items: center; gap: 9px; border: 0; color: #fff; background: transparent; cursor: pointer; font-size: 11px; }
.call-round-action svg { width: 24px; height: 24px; padding: 16px; box-sizing: content-box; border-radius: 50%; transition: transform .2s, filter .2s; }
.call-round-action:hover svg { transform: translateY(-3px); filter: brightness(1.12); }
.call-round-action.decline svg { background: linear-gradient(145deg, #ef4444, #c62828); }
.call-round-action.accept svg { background: linear-gradient(145deg, #35d894, #13a66c); box-shadow: 0 10px 34px rgba(32, 208, 134, .25); }
.direct-call-active-shell {
  position: relative; width: min(1180px, 96vw); height: min(760px, 92vh); display: grid; grid-template-rows: 68px 1fr 92px;
  overflow: hidden; border: 1px solid rgba(143, 133, 230, .26); border-radius: 24px; background: #080b15;
  box-shadow: 0 36px 120px rgba(0,0,0,.66);
}
.direct-call-active-shell > header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.07); background: rgba(15,20,37,.9); }
.direct-call-peer-title { display: flex; align-items: center; }
.direct-call-peer-title div { display: grid; gap: 2px; }
.direct-call-peer-title strong { color: #fff; font-size: 14px; }
.direct-call-peer-title small { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.direct-call-encryption { display: flex; gap: 6px; align-items: center; color: #76dfb6; font-size: 11px; }
.direct-call-encryption svg { width: 15px; }
.direct-call-stage { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 35%, #222644, #080a12 68%); }
#direct-call-remote-video { width: 100%; height: 100%; object-fit: cover; background: #05060b; }
.direct-call-video-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(circle, #1a1d34, #080a12 65%); }
.direct-call-video-placeholder.is-hidden { display: none; }
.direct-call-video-placeholder img { width: 112px; height: 112px; object-fit: cover; border-radius: 50%; border: 2px solid #6358e7; }
.direct-call-video-placeholder strong { color: #fff; font-size: 18px; }
.direct-call-video-placeholder span { color: var(--text-muted); font-size: 12px; }
.direct-call-local-preview { position: absolute; right: 18px; bottom: 18px; width: min(250px, 27%); aspect-ratio: 16/10; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: #111526; box-shadow: 0 14px 38px rgba(0,0,0,.35); }
.direct-call-local-preview video, .direct-call-local-preview img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.direct-call-audio-hero { height: 100%; display: grid; place-content: center; justify-items: center; }
.direct-call-audio-hero .direct-call-avatar-wrap { width: 152px; height: 152px; }
.direct-call-audio-hero h2 { margin: 16px 0 5px; color: #fff; font: 800 25px var(--font-heading); }
.direct-call-audio-hero p { margin: 0; color: var(--text-muted); }
.direct-call-controls { display: flex; justify-content: center; align-items: center; gap: 14px; background: rgba(15,20,37,.96); border-top: 1px solid rgba(255,255,255,.07); }
.call-control { min-width: 88px; display: grid; justify-items: center; gap: 5px; border: 0; color: #e8eaff; background: transparent; cursor: pointer; font-size: 10px; }
.call-control svg { width: 20px; height: 20px; padding: 12px; box-sizing: content-box; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: #20263a; }
.call-control.is-off svg { background: #34384b; color: #ff858e; }
.call-control.hangup svg { color: #fff; background: #e33d45; border-color: #e33d45; padding-inline: 20px; }

@media (max-width: 720px) {
  .direct-call-backdrop { padding: 10px; }
  .direct-call-active-shell { width: 100%; height: 96vh; border-radius: 18px; grid-template-rows: 60px 1fr 84px; }
  .direct-call-encryption { display: none; }
  .call-control { min-width: 70px; }
  .direct-call-local-preview { width: 36%; }
}

.profile-trigger { cursor: pointer; }
button.message-author { padding: 0; border: 0; background: none; font: inherit; color: inherit; }
button.message-author:hover { color: #a9a2ff; text-decoration: underline; }
button.member-row { width: 100%; border: 0; color: inherit; background: transparent; font: inherit; text-align: left; }
button.member-row:hover { background: rgba(99,102,241,.08); }
.user-profile-modal { width: min(690px, 94vw); max-height: min(820px, 92vh); overflow: auto; border: 1px solid rgba(135,128,221,.28); border-radius: 24px; background: #101624; color: var(--text-primary); box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.user-profile-banner { position: relative; height: 148px; border-radius: 23px 23px 0 0; background: linear-gradient(125deg,#253c83,#6b43cf 58%,#332356); background-size: cover; background-position: center; }
.profile-close { position: absolute; top: 15px; right: 15px; color: #fff; background: rgba(4,7,17,.52); }
.user-profile-main { padding: 0 26px 26px; }
.user-profile-identity { display: flex; align-items: flex-end; gap: 15px; margin-top: -46px; }
.user-profile-avatar { position: relative; width: 104px; height: 104px; flex: 0 0 auto; padding: 5px; border-radius: 50%; background: #101624; }
.user-profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-profile-avatar .status-indicator { width: 18px; height: 18px; right: 7px; bottom: 8px; border: 4px solid #101624; }
.user-profile-identity > div:last-child { padding-bottom: 8px; }
.profile-name-line { display: flex; align-items: center; gap: 7px; }
.profile-name-line h2 { margin: 0; color: #fff; font: 800 24px var(--font-heading); }
.profile-name-line .profile-premium-badge { width: 18px; color: #9e85ff; }
.user-profile-identity p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.user-profile-actions { display: flex; justify-content: flex-end; gap: 8px; min-height: 38px; margin-top: -40px; }
.user-profile-actions .btn { padding: 8px 12px; font-size: 10px; }
.user-profile-actions .btn svg { width: 14px; }
.user-profile-content { display: grid; gap: 12px; margin-top: 30px; }
.user-profile-content > section { padding: 16px; border: 1px solid var(--border-subtle); border-radius: 15px; background: rgba(9,14,25,.6); }
.user-profile-content label { display: block; margin-bottom: 9px; color: #9ba2b8; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.user-profile-content section > p { margin: 0; color: #d7d9e6; font-size: 12px; line-height: 1.65; }
.profile-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.profile-facts > div { display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 11px; background: #111a2c; }
.profile-facts svg { width: 17px; color: #8982ff; }
.profile-facts span { display: grid; gap: 2px; }
.profile-facts small { color: var(--text-muted); font-size: 8px; }
.profile-facts strong { color: #fff; font-size: 10px; text-transform: capitalize; }
.profile-role-groups { display: grid; gap: 10px; }
.profile-role-groups > div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; }
.profile-role-groups > div > small { color: var(--text-muted); font-size: 10px; }
.profile-role-groups span { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-role-groups b { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid rgba(139,126,255,.32); border: 1px solid color-mix(in srgb,var(--role-color),transparent 65%); border-radius: 999px; background: rgba(97,84,190,.14); background: color-mix(in srgb,var(--role-color),transparent 88%); color: #eef0ff; font-size: 9px; }
.profile-role-groups b i { width: 6px; height: 6px; border-radius: 50%; background: var(--role-color); }
.profile-mutual-servers { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-mutual-servers > span { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 10px; background: #111a2c; }
.profile-mutual-servers img, .profile-mutual-servers i { display: grid; place-items: center; width: 24px; height: 24px; object-fit: cover; border-radius: 8px; background: #4c4fc4; color: #fff; font-size: 8px; font-style: normal; }
.profile-mutual-servers b { color: #fff; font-size: 9px; }
@media (max-width: 620px) {
  .user-profile-main { padding-inline: 16px; }
  .user-profile-actions { margin-top: 16px; justify-content: flex-start; flex-wrap: wrap; }
  .profile-facts { grid-template-columns: 1fr; }
  .profile-role-groups > div { grid-template-columns: 1fr; }
}

.media-picker-popover { position: fixed; z-index: 5000; overflow: hidden; border: 1px solid rgba(136,128,231,.32); border-radius: 18px; background: #111827; box-shadow: 0 24px 70px rgba(0,0,0,.58); }
.media-picker-header { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 0 12px 0 15px; border-bottom: 1px solid rgba(255,255,255,.07); background: #151d30; }
.media-picker-header > div { display: flex; align-items: center; gap: 9px; }
.media-picker-header > div > svg { width: 17px; color: #8e86ff; }
.media-picker-header span { display: grid; gap: 1px; }
.media-picker-header strong { color: #fff; font-size: 11px; }
.media-picker-header small { color: var(--text-muted); font-size: 8px; }
.discx-emoji-picker { width: 100%; height: min(430px, 55vh); --background: #111827; --border-color: rgba(255,255,255,.08); --button-active-background: rgba(110,89,255,.28); --button-hover-background: rgba(110,89,255,.16); --category-emoji-padding: .45rem; --indicator-color: #7466ff; --input-border-color: rgba(255,255,255,.11); --input-font-color: #fff; --input-placeholder-color: #798198; --outline-color: #7466ff; }
.gif-media-picker { max-height: min(620px, 74vh); display: grid; grid-template-rows: auto auto auto minmax(100px,1fr) auto; }
.gif-search-box { display: flex; align-items: center; gap: 8px; margin: 12px 12px 7px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #0b1120; }
.gif-search-box svg { width: 15px; color: var(--text-muted); }
.gif-search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font-size: 11px; }
.gif-results-status { min-height: 18px; padding: 0 13px 6px; color: var(--text-muted); font-size: 8px; }
.media-picker-spinner { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 2px solid rgba(255,255,255,.15); border-top-color: #887eff; border-radius: 50%; animation: gifSpinner .8s linear infinite; }
@keyframes gifSpinner { to { transform: rotate(360deg); } }
.gif-results-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; min-height: 0; overflow: auto; padding: 0 10px 10px; }
.gif-result-card { position: relative; min-height: 105px; overflow: hidden; border-radius: 10px; background: #080d19; }
.gif-result-card button { width: 100%; height: 100%; min-height: 105px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.gif-result-card img { display: block; width: 100%; height: 100%; min-height: 105px; max-height: 190px; object-fit: cover; transition: transform .2s; }
.gif-result-card:hover img { transform: scale(1.035); }
.gif-result-card a { position: absolute; right: 5px; bottom: 5px; left: 5px; overflow: hidden; padding: 4px 6px; border-radius: 6px; background: rgba(3,6,14,.72); color: #d6d8e6; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; opacity: 0; transition: opacity .2s; }
.gif-result-card:hover a { opacity: 1; }
.gif-media-picker > footer { padding: 8px 12px; border-top: 1px solid rgba(255,255,255,.07); color: #707a91; font-size: 7px; }
.gif-media-picker > footer a { color: #958dff; }
.message-gif-embed { width: min(390px, 100%); margin: 7px 0 0; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 13px; background: #090e19; }
.message-gif-embed img { display: block; width: 100%; max-height: 330px; object-fit: contain; background: #05070d; }
.message-gif-embed figcaption { display: flex; align-items: center; gap: 6px; padding: 7px 9px; }
.message-gif-embed figcaption svg { width: 11px; color: #8178ff; }
.message-gif-embed figcaption a { color: var(--text-muted); font-size: 8px; text-decoration: none; }
