/* ============================================================================
   Discord profile popout of LauBou  --  component styles, all prefixed .dcp-
   Markup: see profile-card.html.  No image paths live in this file: every asset
   is an <img>/<video> in the HTML (paths relative to index.html: media/discord/..).

   Variants:
     .dcp            popout  (300px wide, banner 105px, avatar 80px)
     .dcp.dcp--row   compact row for message headers (avatar 40px + nameplate name row)
     .dcp.dcp--hero  wide card (100% up to 520px, banner 180px, avatar 120px)
   ========================================================================== */

.dcp {
  /* geometry */
  --dcp-w: 300px;
  --dcp-av: 80px;                                   /* avatar diameter */
  --dcp-ring: 6px;                                  /* body-coloured ring around the avatar */
  --dcp-banner: 105px;
  --dcp-overlap: calc(var(--dcp-av) * 0.55);        /* how far the avatar climbs into the banner */
  --dcp-radius: 16px;
  --dcp-pad: 12px;
  /* palette (Discord dark) */
  --dcp-bg: #111214;
  --dcp-panel: #232428;
  --dcp-panel-2: #2B2D31;
  --dcp-text: #F2F3F5;
  --dcp-text-2: #DBDEE1;
  --dcp-muted: #B5BAC1;
  --dcp-line: rgba(255, 255, 255, 0.08);
  --dcp-blurple: #5865F2;
  --dcp-blurple-hover: #4752C4;
  --dcp-secondary: #4E5058;
  --dcp-secondary-hover: #6D6F78;
  --dcp-online: #23A55A;
  --dcp-neon: #C8CECA;                              /* display_name_styles.colors[0] = 13160138 */
  --dcp-name-size: 20px;

  position: relative;
  box-sizing: border-box;
  width: var(--dcp-w);
  max-width: 100%;
  overflow: hidden;
  border-radius: var(--dcp-radius);
  background: var(--dcp-bg);
  color: var(--dcp-text);
  font: 400 16px/1.25 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.dcp *, .dcp *::before, .dcp *::after { box-sizing: border-box; }
.dcp img, .dcp video { display: block; }

/* ---- banner ------------------------------------------------------------- */
.dcp-banner {
  position: relative;
  height: var(--dcp-banner);
  overflow: hidden;
  background: #000;
}
.dcp-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ---- head: the strip between banner and panel that holds the avatar ------ */
.dcp-head {
  position: relative;
  height: calc(var(--dcp-av) - var(--dcp-overlap) + 10px);
}

/* ---- avatar + decoration + status --------------------------------------- */
.dcp-avatar {
  position: absolute;
  left: 16px;
  top: calc(-1 * var(--dcp-overlap));
  width: var(--dcp-av);
  height: var(--dcp-av);
  flex: none;
}
.dcp-avatar__ring {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--dcp-panel-2);
  box-shadow: 0 0 0 var(--dcp-ring) var(--dcp-bg);
}
.dcp-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
/* Discord draws decorations for a round avatar that fills 0.78 of the frame */
.dcp-avatar__deco {
  position: absolute;
  z-index: 2;
  width: calc(var(--dcp-av) / 0.78);
  height: calc(var(--dcp-av) / 0.78);
  max-width: none;
  left: calc((var(--dcp-av) - var(--dcp-av) / 0.78) / 2);
  top: calc((var(--dcp-av) - var(--dcp-av) / 0.78) / 2);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.dcp-avatar__status {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  width: calc(var(--dcp-av) * 0.3);
  height: calc(var(--dcp-av) * 0.3);
  border-radius: 50%;
  border: calc(var(--dcp-av) * 0.05) solid var(--dcp-bg);
  background: #80848E;
}
.dcp-avatar__status--online  { background: var(--dcp-online); }
.dcp-avatar__status--idle    { background: #F0B232; }
.dcp-avatar__status--dnd     { background: #F23F43; }
.dcp-avatar__status--offline { background: #80848E; }

/* ---- inner panel --------------------------------------------------------- */
.dcp-body {
  margin: 0 var(--dcp-pad) var(--dcp-pad);
  padding: var(--dcp-pad);
  border-radius: 8px;
  background: var(--dcp-panel);
}

/* ---- nameplate strip behind the name row --------------------------------- */
.dcp-plate {
  position: relative;
  overflow: hidden;
  margin: calc(-1 * var(--dcp-pad)) calc(-1 * var(--dcp-pad)) 0;
  padding: var(--dcp-pad);
  border-radius: 8px 8px 0 0;
  isolation: isolate;
}
.dcp-plate__fade {                 /* palette colour, like the member-list row: solid right, gone left */
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.38) 45%, rgba(0, 0, 0, 0.72) 100%);
}
.dcp-plate__img,
.dcp-plate__vid {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: scale(1.22) translateX(4%);
  transform-origin: right center;
  pointer-events: none;
  user-select: none;
}
.dcp-plate__vid { z-index: 2; }
.dcp-plate__shade {                /* keeps the name readable: darker on the left where the text sits */
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(90deg, rgba(17, 18, 20, 0.62) 0%, rgba(17, 18, 20, 0.30) 50%, rgba(17, 18, 20, 0.10) 100%);
}
.dcp-names {
  position: relative;
  z-index: 4;
  min-width: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 10px rgba(0, 0, 0, 0.5);
}
.dcp-names__top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.dcp-name {
  font-size: var(--dcp-name-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dcp-text);
}
/* Discord "Neon" display-name style: the colour itself plus a soft glow of the same colour */
.dcp-name--neon {
  color: var(--dcp-neon);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.35),
    0 0 6px var(--dcp-neon),
    0 0 14px rgba(200, 206, 202, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.7);
}
.dcp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px 0 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--dcp-text-2);
  text-shadow: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.dcp-tag__badge { width: 14px; height: 14px; image-rendering: auto; }
.dcp-user {
  margin-top: 2px;
  font-size: 14px;
  line-height: 18px;
  color: var(--dcp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- sections ------------------------------------------------------------ */
.dcp-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--dcp-line);
}
.dcp-section + .dcp-section { margin-top: 12px; }
.dcp-section__title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: var(--dcp-text);
}
.dcp-section__text {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  color: var(--dcp-text-2);
  overflow-wrap: anywhere;
}

/* ---- buttons ------------------------------------------------------------- */
.dcp-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.dcp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: var(--dcp-secondary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.dcp-btn:hover  { background: var(--dcp-secondary-hover); color: #fff; }
.dcp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dcp-btn--primary        { background: var(--dcp-blurple); }
.dcp-btn--primary:hover  { background: var(--dcp-blurple-hover); }
.dcp-btn--secondary      { background: var(--dcp-secondary); }
.dcp-btn--secondary:hover{ background: var(--dcp-secondary-hover); }
.dcp-btn.is-copied       { background: var(--dcp-online); }
.dcp-btn__icon { width: 16px; height: 16px; flex: none; }

/* ============================================================================
   .dcp--row  compact: avatar + nameplate name row, for message headers
   ========================================================================== */
.dcp--row {
  --dcp-av: 40px;
  --dcp-ring: 0px;
  --dcp-name-size: 16px;
  --dcp-bg: var(--dcp-row-bg, #313338);             /* ring/status cut-out colour = chat background */
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: auto;
  max-width: 100%;
  overflow: visible;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}
.dcp--row .dcp-avatar {
  position: relative;
  left: auto;
  top: auto;
}
.dcp--row .dcp-plate {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 5px 96px 5px 10px;      /* room on the right so the art sits beside the text, not under it */
  border-radius: 8px;
}
.dcp--row .dcp-plate__shade {
  background: linear-gradient(90deg, rgba(17, 18, 20, 0.70) 0%, rgba(17, 18, 20, 0.55) 55%, rgba(17, 18, 20, 0.08) 100%);
}
.dcp--row .dcp-plate__img,
.dcp--row .dcp-plate__vid {
  width: 72%;                      /* art anchored right; the left of the strip is palette only */
  left: auto;
  right: 0;
  transform: scale(1.12) translateX(2%);
}
.dcp--row .dcp-names__top { flex-wrap: nowrap; gap: 8px; }
.dcp--row .dcp-name { font-weight: 500; }
.dcp--row .dcp-user {
  margin-top: 0;
  font-size: 12px;
  line-height: 16px;
}
.dcp--row .dcp-user--inline {
  display: inline;
  margin-left: 2px;
  font-size: 12px;
}

/* ============================================================================
   .dcp--hero  wide card, up to 520px, avatar 120px
   ========================================================================== */
.dcp--hero {
  --dcp-w: 520px;
  --dcp-av: 120px;
  --dcp-ring: 6px;
  --dcp-banner: 180px;
  --dcp-pad: 16px;
  --dcp-name-size: 26px;
  width: 100%;
  max-width: var(--dcp-w);
}
.dcp--hero .dcp-avatar { left: 20px; }
.dcp--hero .dcp-head { height: calc(var(--dcp-av) - var(--dcp-overlap) + 12px); }
.dcp--hero .dcp-user { font-size: 15px; line-height: 20px; }
.dcp--hero .dcp-tag { height: 22px; font-size: 13px; }
.dcp--hero .dcp-section__title { font-size: 13px; }
.dcp--hero .dcp-section__text { font-size: 15px; line-height: 20px; }
.dcp--hero .dcp-btn { height: 36px; font-size: 15px; }
@media (min-width: 440px) {
  .dcp--hero .dcp-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 439px) {
  .dcp--hero { --dcp-av: 96px; --dcp-banner: 140px; --dcp-name-size: 22px; }
}

/* ---- phones: the popout stretches to the column like Discord's mobile profile sheet */
@media (max-width: 480px) {
  .dcp:not(.dcp--row) { --dcp-w: 100%; }
  .dcp:not(.dcp--row):not(.dcp--hero) { --dcp-banner: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .dcp-plate__vid { display: none; }
  .dcp-btn { transition: none; }
}
