/* ProfileCord renderer. Dimensions and layer rules follow the Discord desktop client
   (user profile popout, member list row, chat message) as measured Nov 2026. */

.dc {
  --dc-font: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --surface-high: #242429;
  --surface-higher: #2c2d32;
  --base-lower: #1a1a1e;
  --base-lowest: #121214;
  --text-default: #efeff1;
  --text-strong: #fbfbfb;
  --text-muted: #969aa2;
  --text-subtle: #b0b1b8;
  --mod-subtle: rgba(151, 151, 159, 0.12);
  --mod-strong: rgba(151, 151, 159, 0.2);
  --border-muted: rgba(151, 151, 159, 0.04);
  --border-subtle: rgba(151, 151, 159, 0.2);
  --input-bg: rgba(0, 0, 0, 0.12);
  font-family: var(--dc-font);
  font-size: 16px;
  line-height: 1.25;
  color: var(--text-default);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.dc.light {
  --surface-high: #ffffff;
  --surface-higher: #f3f3f4;
  --base-lower: #fbfbfb;
  --text-default: #2f3035;
  --text-strong: #1a1a1e;
  --text-muted: #6d6f78;
  --text-subtle: #4e5058;
  --mod-subtle: rgba(116, 116, 128, 0.1);
  --mod-strong: rgba(116, 116, 128, 0.18);
  --border-muted: rgba(116, 116, 128, 0.12);
  --border-subtle: rgba(116, 116, 128, 0.26);
  --input-bg: rgba(255, 255, 255, 0.4);
}
.dc * { box-sizing: border-box; }
.dc img { -webkit-user-drag: none; user-select: none; }

/* ---------- popout ---------- */
.dc-popout-root {
  position: relative;
  isolation: isolate;
  width: var(--cw-px, 300px);
  --cw: 300;
  --cw-px: 300px;
  --pad: 0px;
  --banner-h: 105px;
  --fw: 1200; --fot: 0; --fob: 0; --foh: 0;
  --fs: calc(var(--cw) / var(--fw));
}
.dc-popout-root.themed { --cw: 304; --cw-px: 304px; --pad: 2px; }

.dc-outer {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--surface-high);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.24);
}
.themed .dc-outer {
  padding: 2px;
  background: linear-gradient(var(--p) var(--banner-h), var(--s) 100%);
}
.framed .dc-outer { box-shadow: none; }
.long .dc-outer { min-height: 620px; }

.dc-inner {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
  padding-bottom: 4px;
  border-radius: 4px;
  overflow: hidden;
}
.themed .dc-inner {
  border-radius: 6px;
  background: linear-gradient(var(--overlay), var(--overlay));
}

.dc-header { position: relative; flex-shrink: 0; min-height: calc(var(--banner-h) + 35px); }
.themed .dc-header { min-height: calc(var(--banner-h) + 33px); }

.dc-banner {
  position: relative;
  height: var(--banner-h);
  width: 100%;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background-color: var(--banner-color, #5865f2);
  -webkit-mask-image: radial-gradient(circle 46px at 56px calc(100% - 4px), transparent 0, transparent 45.5px, #000 46px);
  mask-image: radial-gradient(circle 46px at 56px calc(100% - 4px), transparent 0, transparent 45.5px, #000 46px);
}
.themed .dc-banner { border-radius: 0; }
.dc-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.dc-avatar { position: absolute; left: 16px; top: 61px; width: 80px; height: 80px; z-index: 1; }
.dc-avatar-clip {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #313338;
  -webkit-mask-image: radial-gradient(circle 14px at 68px 68px, transparent 13.5px, #000 14px);
  mask-image: radial-gradient(circle 14px at 68px 68px, transparent 13.5px, #000 14px);
}
.dc-avatar-clip img, .dc-av-s img.av { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-deco { position: absolute; left: -10%; top: -10%; width: 120%; height: 120%; pointer-events: none; }
.dc-status { position: absolute; left: 60px; top: 60px; width: 16px; height: 16px; border-radius: 50%; }
.dc-status[data-s="online"] { background: #43a25a; }
.dc-status[data-s="idle"] { background: #ca9654; -webkit-mask-image: radial-gradient(circle 6px at 4px 4px, transparent 5.5px, #000 6px); mask-image: radial-gradient(circle 6px at 4px 4px, transparent 5.5px, #000 6px); }
.dc-status[data-s="dnd"] { background: #d83a42; -webkit-mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000); -webkit-mask-composite: xor; mask-composite: exclude; -webkit-mask-size: 100% 100%, 62% 26%; mask-size: 100% 100%, 62% 26%; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.dc-status[data-s="offline"] { background: #82838b; -webkit-mask-image: radial-gradient(circle at center, transparent 3.6px, #000 4px); mask-image: radial-gradient(circle at center, transparent 3.6px, #000 4px); }

.dc-bubble-wrap { position: relative; margin: -10px 12px 0 105px; z-index: 2; }
.dc-bubble {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--bubble, var(--surface-higher));
  border: 1px solid var(--border-muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  font-size: 14px;
  line-height: 18px;
  color: var(--text-default);
  word-break: break-word;
}
.dc-bubble::before, .dc-bubble::after {
  content: ""; position: absolute; border-radius: 50%; background: var(--bubble, var(--surface-higher));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}
.dc-bubble::before { width: 12px; height: 12px; left: 2px; top: -9px; }
.dc-bubble::after { width: 8px; height: 8px; left: -8px; top: -18px; }
.dc-bubble .emo { margin-right: 4px; }

.dc-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 8px; flex: 1 1 auto; }
.dc-mutuals { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 18px; color: var(--text-subtle); }
.dc-mutuals i { width: 16px; height: 16px; border-radius: 50%; background: #43a25a; flex: none; }
.dc-mutuals .dc-dot { background: var(--text-subtle); }
.dc-card { border-radius: 8px; padding: 12px; background: color-mix(in srgb, var(--text-strong) 6%, transparent); border: 1px solid var(--border-muted); display: flex; flex-direction: column; gap: 10px; }
.dc-card-h { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; line-height: 18px; color: var(--text-strong); }
.dc-card-h u { width: 24px; height: 24px; border-radius: 6px; background: var(--mod-strong); }
.dc-card-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dc-card-row i { aspect-ratio: 1.25; border-radius: 8px; background: var(--mod-subtle); }
.dc-names { margin-bottom: -4px; }
.dc-dname { display: flex; align-items: center; gap: 4px; line-height: 24px; font-size: 20px; font-weight: 600; color: var(--text-default); word-break: break-word; min-height: 24px; }
.dc-urow { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; min-height: 24px; font-size: 14px; line-height: 18px; color: var(--text-strong); }
.dc-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-default); margin: 0 1px; }
.dc-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 5px; border-radius: 4px;
  background: var(--mod-subtle); border: 1px solid var(--border-muted);
  font-size: 12px; font-weight: 600; line-height: 16px; color: var(--text-strong);
}
.dc-tag i { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, #43a25a, #1f6f3a); display: inline-block; }
/* Many badges wrap onto more rows inside the card instead of running out of it. */
.dc-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 1px 2px; min-height: 24px; max-width: 100%; box-sizing: border-box; border-radius: 6px; background: var(--mod-subtle); border: 1px solid var(--border-muted); width: fit-content; }
.dc-badges img { width: 20px; height: 20px; display: block; }
.dc-bio { font-size: 14px; line-height: 18px; color: var(--text-default); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.dc-sec h4 { margin: 0 0 4px; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--text-default); }
.dc-sec p { margin: 0; font-size: 14px; line-height: 18px; color: var(--text-default); }
.dc-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.dc-role { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 8px; background: var(--mod-subtle); border: 1px solid var(--border-muted); font-size: 12px; font-weight: 500; }
.dc-role i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.dc-footer { padding: 0 16px 12px; }
.dc-msg { height: 46px; border-radius: 8px; background: var(--input-bg); border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 15px; font-size: 16px; color: var(--text-muted); }
.dc-msg span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dc-msg svg { flex: none; opacity: 0.8; }

/* profile effect layers */
.dc-effects { position: absolute; inset: var(--pad); border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 2; }
.dc-effects img { position: absolute; top: 0; left: 0; width: 100%; height: auto; display: block; }

/* profile frame layers (ported from the client's rules) */
.dc-framec { position: absolute; inset: 0; pointer-events: none; }
.dc-framec::before {
  content: ""; position: absolute; width: 100%; height: 100%; z-index: -1; border-radius: 8px;
  background: var(--surface-high); box-shadow: 20px 20px 30px rgba(0, 0, 0, 0.22);
}
.dc-frame {
  --soh: calc(var(--foh) * var(--fs) * 1px);
  --sot: calc(var(--fot) * var(--fs) * 1px);
  --sob: calc(var(--fob) * var(--fs) * 1px);
  position: absolute; top: 0; height: 100%;
  left: calc(var(--soh) * -1);
  width: calc(100% + var(--soh) * 2);
}
.dc-fl { position: absolute; left: 0; right: 0; width: 100%; }
.dc-fl.front { z-index: 4; }
.dc-fl.back { z-index: -1; }
img.dc-fl { display: block; height: auto; }
.dc-fl.staple.top { top: calc(var(--sot) * -1); }
.dc-fl.staple.bottom { bottom: calc(var(--sob) * -1); }
.dc-fl.staple.center { top: 50%; transform: translateY(-50%); }
.dc-fl.rail { height: 100%; overflow: hidden; background-repeat: no-repeat; background-size: 100% auto; }
.dc-fl.rail.center { background-position: 50% center; }
.dc-fl.rail.top { background-position: center top; }
.dc-fl.rail.bottom { background-position: center bottom; }
.short .dc-fl.rail.responsive { display: none; }
.dc-fl.border { height: 100%; overflow: hidden; }
.dc-fl.border > img { display: block; width: 100%; height: auto; }

/* ---------- display name styles ---------- */
.dns { display: inline-flex; max-width: 100%; min-width: 0; position: relative; z-index: 0; perspective: 1px; font-synthesis: none; }
.dns-in { flex: 1 1 0%; min-width: 0; white-space: nowrap; }
.dns.wrap .dns-in { white-space: normal; }
.dns .fx { position: relative; }
.dns .solid { color: var(--n1); }
.dns .gradient { background: linear-gradient(to right, var(--n1), var(--n2), var(--n1)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; position: relative; z-index: 0; }
.dns .prism { background-image: linear-gradient(90deg, var(--n1), var(--n2), var(--n3), var(--n1)); background-repeat: repeat; background-size: var(--prism-cycle, 160px) auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; position: relative; z-index: 0; }
.dns .neon { --r: calc(4px + 0.12em); paint-order: stroke; -webkit-text-stroke-width: calc(0.04em + 1px); -webkit-text-stroke-color: var(--n-dark); color: #fff; margin: calc(var(--r) * -1); padding: var(--r); text-shadow: 0 0 var(--r) var(--n1); z-index: 0; }
.dns .toon { --sw: calc(1.6px + 0.04em); --tm: calc(var(--sw) * -1); paint-order: stroke; -webkit-text-stroke-width: var(--sw); -webkit-text-stroke-color: var(--n-dark); color: var(--n-dark); margin-inline-start: var(--tm); margin-bottom: var(--tm); margin-inline-end: var(--tm); padding-bottom: var(--sw); padding-inline: var(--sw); display: inline-block; }
.dns .toon::before { content: attr(data-t); position: absolute; inset: 0; padding-inline: var(--sw); padding-bottom: var(--tm); background: linear-gradient(to bottom, var(--n-light) 0%, var(--n1) 25%, var(--n2) 75%, var(--n-light) 100%); background-size: 100% 400%; background-position: 50% 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; -webkit-text-stroke: 0 transparent; white-space: inherit; overflow: hidden; }
.dns .pop { --sw: calc(1.2px + 0.04em); --ty: 0.08em; color: #fff; display: inline-block; paint-order: stroke; vertical-align: top; -webkit-text-stroke-width: var(--sw); -webkit-text-stroke-color: var(--n-dark2); margin-bottom: calc(var(--sw) * -1 - var(--ty)); margin-inline-start: calc(var(--sw) * -1); padding-bottom: calc(var(--sw) + var(--ty)); padding-inline-start: var(--sw); }
.dns .pop::before { content: attr(data-t); position: absolute; top: 0; bottom: calc(var(--ty) * -1 - var(--sw)); inset-inline-start: var(--sw); margin-inline-start: calc(var(--sw) * -1); padding-inline-start: var(--sw); width: calc(100% - var(--sw)); z-index: -1; -webkit-text-stroke-width: var(--sw); -webkit-text-stroke-color: transparent; background: linear-gradient(135deg, var(--n1), var(--n2), var(--n1)); background-size: 200% 200%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; transform: translate3d(0, var(--ty), 0); white-space: inherit; overflow: hidden; }
.dns .gummy { font-kerning: none; font-variant-ligatures: none; color: var(--n1); }
.dns .gummy b { display: inline-block; white-space: pre; font-weight: inherit; transform-origin: 50% 100%; background: linear-gradient(to bottom, var(--n-light), var(--n1) 55%, var(--n2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.dns.anim .gradient { animation: dns-grad 3s linear infinite; }
.dns.anim .prism { animation: dns-prism 2s linear infinite; }
.dns.anim .neon { animation: dns-neon 4s cubic-bezier(0.24, 0.31, 0.36, 0.93) infinite; }
.dns.anim .toon::before { animation: dns-toon 4s cubic-bezier(0.44, 0.29, 0.48, 1) infinite; }
.dns.anim .pop { animation: dns-pop 4s cubic-bezier(0.44, 0.29, 0.48, 1) infinite; }
.dns.anim .pop::before { animation: dns-pop-shadow 4s cubic-bezier(0.44, 0.29, 0.48, 1) infinite; }
.dns.anim .gummy { --head: 0.12em; margin-block: calc(var(--head) * -1); padding-block: var(--head); }
.dns.anim .gummy b { animation: dns-gummy 4s cubic-bezier(0.44, 0.29, 0.48, 1) infinite; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes dns-grad { 0% { background-position: 0% 50%; } 100% { background-position: -200% 50%; } }
@keyframes dns-prism { 0% { background-position-x: 0; } 100% { background-position-x: calc(var(--prism-cycle, 160px) * -1); } }
@keyframes dns-neon { 0%, 15%, 18%, 20%, 23%, 25%, 50% { color: #fff; } 16%, 22%, 28% { color: var(--n-light); } 51%, 100% { color: #fff; } }
@keyframes dns-toon { 0%, 5% { background-position: 50% 0; } 55%, 100% { background-position: 50% 100%; } }
@keyframes dns-pop { 0% { transform: translateZ(0); } 18% { transform: translate3d(0, -0.05em, 0); } 35% { transform: translate3d(0, 0.08em, 0); } 50%, 100% { transform: translateZ(0); } }
@keyframes dns-pop-shadow { 0% { background-position: 100% 0; transform: translate3d(0, 0.08em, 0); } 18% { transform: translate3d(0, 0.13em, 0); } 35% { transform: translateZ(0); } 50%, 100% { background-position: 0 100%; transform: translate3d(0, 0.08em, 0); } }
@keyframes dns-gummy { 0%, 35%, 100% { transform: scaleX(1) scaleY(1); } 7% { transform: scaleX(1.28) scaleY(0.72); } 14% { transform: scaleX(0.82) scaleY(1.18); } 21% { transform: scaleX(1.1) scaleY(0.9); } 28% { transform: scaleX(0.96) scaleY(1.04); } }

.f-default { font-family: var(--dc-font); }
.f-tempo { font-family: "Zilla Slab", var(--dc-font); font-weight: 600; letter-spacing: 0.03em; }
.f-sakura { font-family: "Cherry Bomb One", var(--dc-font); font-weight: 400; letter-spacing: 0.04em; }
.f-jellybean { font-family: "Chicle", var(--dc-font); font-weight: 400; }
.f-modern { font-family: "MuseoModerno", var(--dc-font); font-weight: 500; letter-spacing: 0.01em; }
.f-medieval { font-family: "Almendra", var(--dc-font); font-weight: 700; letter-spacing: 0.02em; }
.f-8bit { font-family: "Pixelify Sans", var(--dc-font); font-weight: 400; letter-spacing: 0.02em; }
.f-vampyre { font-family: "Grenze Gotisch", var(--dc-font); font-weight: 600; letter-spacing: 0.01em; }
.f-monkeybars { font-family: "Playpen Sans", var(--dc-font); font-weight: 700; }
.f-mainframe { font-family: "Orbitron", var(--dc-font); font-weight: 700; letter-spacing: 0.03em; }
.f-headbang { font-family: "New Rocker", var(--dc-font); font-weight: 400; }
.f-journal { font-family: "Kalam", var(--dc-font); font-weight: 700; }

/* ---------- member list + chat ---------- */
.dc-panel { background: var(--base-lower); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.06); overflow: hidden; }
.dc-panel-h { padding: 14px 16px 6px; font-size: 14px; line-height: 18px; font-weight: 500; color: var(--text-muted); }
.dc-members { padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.dc-member { position: relative; display: flex; align-items: center; height: 42px; padding: 0 8px; border-radius: 8px; }
.dc-member.hov { background: var(--mod-subtle); }
.dc-np { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.dc-np img, .dc-np video { position: absolute; right: 0; top: 0; height: 100%; width: auto; object-position: right center; opacity: 0.6; transition: opacity 0.3s; }
.dc-np video { display: none; }
.dc-member.hov .dc-np img, .dc-member.hov .dc-np video { opacity: 1; }
.dc-member.hov .dc-np video { display: block; }
.dc-member.hov .dc-np video + img, .dc-member.hov .dc-np img:has(+ video) { visibility: hidden; }
.dc-member { cursor: default; }
.dc-av-s { position: relative; flex: none; width: 32px; height: 32px; margin-right: 12px; }
.dc-av-s .clip { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #313338; -webkit-mask-image: radial-gradient(circle 8px at 27px 27px, transparent 7.5px, #000 8px); mask-image: radial-gradient(circle 8px at 27px 27px, transparent 7.5px, #000 8px); }
.dc-av-s .st { position: absolute; left: 22px; top: 22px; width: 10px; height: 10px; border-radius: 50%; }
.dc-av-s .st[data-s="online"] { background: #43a25a; }
.dc-av-s .st[data-s="idle"] { background: #ca9654; }
.dc-av-s .st[data-s="dnd"] { background: #d83a42; }
.dc-av-s .st[data-s="offline"] { background: #82838b; }
.dc-av-s .dc-deco { left: -10%; top: -10%; width: 120%; height: 120%; }
.dc-mtext { position: relative; min-width: 0; flex: 1; padding-right: 24px; }
.dc-mname { display: flex; align-items: center; gap: 4px; font-size: 16px; line-height: 20px; font-weight: 500; color: var(--text-subtle); white-space: nowrap; overflow: hidden; }
.dc-member.hov .dc-mname, .dc-member.np .dc-mname { color: var(--text-strong); }
.dc-msub { font-size: 12px; line-height: 16px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-member.np .dc-msub { color: var(--text-default); }
.dc-ghost { display: flex; align-items: center; height: 42px; padding: 0 8px; gap: 12px; opacity: 0.55; }
.dc-ghost i { width: 32px; height: 32px; border-radius: 50%; background: var(--mod-subtle); flex: none; }
.dc-ghost b { height: 12px; border-radius: 6px; background: var(--mod-subtle); display: block; }

.dc-chat { padding: 6px 0 14px; }
.dc-line { position: relative; padding: 2px 16px 2px 72px; min-height: 44px; margin-top: 14px; }
.dc-line .dc-av-m { position: absolute; left: 16px; top: 2px; width: 40px; height: 40px; }
.dc-av-m .clip { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #313338; }
.dc-av-m .clip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-av-m .dc-deco { left: -10%; top: -10%; width: 120%; height: 120%; }
.dc-line h5 { margin: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; font-size: 16px; line-height: 22px; font-weight: 500; color: var(--text-strong); }
.dc-line h5 time { flex: none; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.dc-line p { margin: 0; font-size: 16px; line-height: 22px; color: #dfe0e2; }
.dc-line.ghost .clip { background: var(--mod-subtle); }
.dc-line.ghost h5 b, .dc-line.ghost p b { display: inline-block; height: 12px; border-radius: 6px; background: var(--mod-subtle); }

.dc-tag i.img { background: center / contain no-repeat; border-radius: 0; }
