/* =========================================================
   Top Right Pill
   ========================================================= */

.topright-pill{
  position:relative;
  display:flex;
  align-items:center;
}

.pill{
  display:flex;
  gap:10px;
  padding: 8px 10px;
  border-radius: 14px;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);

  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* =========================================================
   Base Pill Button
   ========================================================= */

.pill-btn{
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;

  display:flex;
  align-items:center;
  justify-content:center;

  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.06);
  cursor:pointer;

  transition:
    background 0.2s ease,
    opacity 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.25s ease;
}

.pill-btn:hover{ background: rgba(255,255,255,0.08); }
.pill-btn:disabled{ opacity: .55; cursor: default; }

.pill-icn{
  width: 18px;
  height: 18px;
  display:block;
  opacity: .95;
}

.pill-btn--profile{ width: 46px; gap: 6px; }
.pill-caret{ font-size: 12px; opacity: .7; margin-left: 2px; }

/* =========================================================
   Badge
   ========================================================= */

.pill-badge{
  position:absolute;
  top: -6px;
  right: -6px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.10);
}

/* =========================================================
   Blue Karma Button (frameless + radial cooldown)
   ========================================================= */

.pill-btn--blue-karma{
  width: 40px;
  height: 40px;

  background: transparent !important;
  border: none !important;
  box-shadow: none !important;

  /* cooldown default */
  opacity: 0.55;
  filter: grayscale(0.4);
  cursor: not-allowed;
}

.pill-btn--blue-karma.is-available{
  opacity: 1;
  filter: none;
  cursor: pointer;
}

.pill-btn--blue-karma.is-available:hover{
  background: rgba(120, 220, 255, 0.06) !important;
}

/* --- Icon stacking (PNG -> GIF on hover) --- */
.bk-icn{
  position: relative;
  width: 22px;
  height: 22px;
  display: block;
  z-index: 2; /* above ring */
}

.bk-icn img{
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  display: block;
}

.bk-icn__png{ opacity: 1; }
.bk-icn__gif{ opacity: 0; }

/* swap only when available */
.pill-btn--blue-karma.is-available:hover .bk-icn__png{ opacity: 0; }
.pill-btn--blue-karma.is-available:hover .bk-icn__gif{ opacity: 1; }

/* --- 360° radial cooldown ring --- */
/* Uses conic-gradient and masks it into a donut ring. */
.bk-ring{
  --p: 0; /* 0..100 */
  position: absolute;
  inset: 2px; /* ring thickness / placement */
  border-radius: 999px;
  z-index: 1;
  pointer-events: none;

  background:
    conic-gradient(
      rgba(120,220,255,0.85) calc(var(--p) * 1%),
      rgba(120,220,255,0.12) 0
    );

  /* cut hole to make a ring */
  -webkit-mask: radial-gradient(transparent 62%, #000 64%);
  mask: radial-gradient(transparent 62%, #000 64%);
}

/* Optional: slightly dim the ring when not hovered (still visible) */
.pill-btn--blue-karma.is-cooldown .bk-ring{
  opacity: 0.9;
}

/* =========================================================
   Popover Pane
   ========================================================= */

.pill-pane{
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  width: 320px;
  z-index: 999;

  border-radius: 16px;
  background: rgba(18,18,18,0.92);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow:hidden;
}

.pill-pane__head{ padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.pill-pane__title{ font-weight: 700; }
.pill-pane__sub{ font-size: 12px; opacity: .75; margin-top: 2px; }
.pill-pane__body{ padding: 10px 14px; display:flex; flex-direction:column; gap:8px; }

.kv{ display:flex; justify-content:space-between; }

/* =========================================================
   Pane Items
   ========================================================= */

.pill-item{
  display:block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration:none;
}
.pill-item:hover{ background: rgba(255,255,255,0.06); }
.pill-item--danger{
  color:#ff8b8b;
  background: transparent;
  border:none;
  text-align:left;
}
.pill-item--danger:hover{ background: rgba(255,139,139,0.10); }

/* =========================================================
   Hard override: stop any global svg/img rules from blowing up the topbar
   ========================================================= */

.pill-btn > svg.pill-icn,
.pill-btn > img.pill-icn{
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
}

.pill-btn{
  overflow: hidden; /* prevents any weird bleed */
}

/* =========================================================
   Server Avatar
   ========================================================= */

.server-avatar{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
}

.server-avatar svg{
  width: 100%;
  height: 100%;
  display: block;
}

.server-avatar--fallback{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
}
