@keyframes cw-hue-spin {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(360deg); }
}

:root {
  --glass-bg:   linear-gradient(145deg, rgba(8,14,26,0.90), rgba(4,8,18,0.82));
  --glass-bdr:  rgba(255,255,255,0.07);
  --glass-blur: blur(18px) saturate(160%);
  --glass-shad: 0 12px 44px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.25),
                inset 0 1px 0 rgba(255,255,255,0.08);
  --panel-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

/* ─── macOS-style top dock ─── */
#social-nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 5px;
  font-family: var(--panel-font);
  background: rgba(5,8,18,0.85);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 60px;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.12);
}

#social-nav::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.18) 35%,
    rgba(255,255,255,0.18) 65%,
    transparent
  );
  pointer-events: none;
}

.dock-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.24s cubic-bezier(0.23,1,0.32,1);
}

.dock-item:hover { transform: translateY(-3px) scale(1.05); }

.dock-icon-wrap {
  width: 16px; height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.dock-icon-svg {
  width: 16px; height: 16px;
  pointer-events: none;
  flex-shrink: 0;
}

[data-social="discord"]   .dock-icon-svg { fill: #5865f2; }
[data-social="steam"]     .dock-icon-svg { fill: #c7d5e0; }
[data-social="instagram"] .dock-icon-svg { fill: #c13584; }
[data-social="twitter"]   .dock-icon-svg { fill: #1da1f2; }

.dock-fa-icon {
  font-size: 16px;
  color: #8fbcbb;
  animation: cw-hue-spin 3s linear infinite;
  pointer-events: none;
  flex-shrink: 0;
}

.dock-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
}

[data-social="discord"]   .dock-label { background: linear-gradient(135deg,#7289da,#5865f2); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-social="steam"]     .dock-label { background: linear-gradient(135deg,#c7d5e0,#66c0f4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-social="instagram"] .dock-label { background: linear-gradient(45deg,#833ab4,#c13584,#f77737); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-social="twitter"]   .dock-label { background: linear-gradient(135deg,#1da1f2,#0084ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-social="comments"]  .dock-label { color: #8fbcbb; }

.dock-item:focus-visible { outline: 2px solid rgba(143,188,187,0.75); outline-offset: 3px; border-radius: 50px; }

@media (max-width: 768px) {
  #social-nav   { transform: translateX(-50%) scale(1.05); gap: 2px; padding: 4px 6px; }
  #bottom-panel { transform: translateX(-50%) scale(1.05); }
  .dock-label   { display: none; }
  .dock-item    { padding: 8px 9px; }
}

#bottom-panel {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  width: 268px;
  max-width: calc(100vw - 40px);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-bdr);
  border-radius: 18px;
  box-shadow: var(--glass-shad);
  overflow: visible;
  font-family: var(--panel-font);
  font-size: 12px;
  color: rgba(255,255,255,0.9);
}

#bottom-panel::before { display: none; }

#banner-strip {
  width: 100%; height: 0;
  flex-shrink: 0; overflow: hidden;
  border-radius: 18px 18px 0 0;
  transition: height 0.4s cubic-bezier(0.4,0,0.2,1);
}
#banner-strip.expanded { height: 84px; }
#banner-strip img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}

#banner-pill-row {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 5;
}
#banner-pill {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 50%;
  width: 22px; height: 22px;
  color: rgba(255,255,255,0.28);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
#banner-pill:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.65);
}
#banner-pill .banner-chevron { font-size: 0.50rem; transition: transform 0.3s ease; }

#bp-who { position: relative; padding: 8px 12px 10px; }

#discord-watermark {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 1.05rem;
  color: #5865f2;
  opacity: 0.18;
  pointer-events: none;
}

.view-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.26);
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.view-stat i { font-size: 0.65rem; }

#bp-activities {
  padding: 8px 12px 10px;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.presence-header { display: flex; align-items: center; gap: 10px; }

.avatar-container { position: relative; flex-shrink: 0; margin-top: -36px; margin-left: 4px; }

/* When banner is expanded, less overlap needed */
#banner-strip.expanded + #bp-who { padding-top: 10px; }
#banner-strip.expanded + #bp-who .avatar-container { margin-top: -30px; }

.avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(8,14,26,0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  cursor: pointer;
  transition: transform 0.22s var(--spring, ease);
  display: block;
  flex-shrink: 0;
}
.avatar:hover { transform: scale(1.06); }

.status-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 2.5px solid rgba(8,14,26,0.90);
  background: #747f8d;
  --glow-spread: 0px;
  transition: background 0.4s, --glow-spread 0.4s;
  box-shadow: 0 0 var(--glow-spread) currentColor;
}
.status-badge.online  { background: #3ba55c; --glow-spread: 7px; color: rgba(59,165,92,0.6); }
.status-badge.idle    { background: #faa61a; --glow-spread: 7px; color: rgba(250,166,26,0.6); }
.status-badge.dnd     { background: #ed4245; --glow-spread: 7px; color: rgba(237,66,69,0.6); }
.status-badge.offline { background: #747f8d; --glow-spread: 0px; }

.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; justify-content: center; }

.username {
  font-size: 0.92rem; font-weight: 700; color: #fff;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.username .secondary {
  display: block;
  font-size: 0.70rem; font-weight: 400;
  color: rgba(255,255,255,0.38);
  margin-top: 1px;
}

#discord-display-name, #discord-username { cursor: pointer; transition: opacity 0.15s; }
#discord-display-name:hover, #discord-username:hover { opacity: 0.68; }

.status { display: none; }
.status-icon {
  width: 6px; height: 6px; border-radius: 50%;
  background: #747f8d; flex-shrink: 0;
  display: inline-block; transition: background 0.3s;
}
.online  .status-icon { background: #3ba55c; }
.idle    .status-icon { background: #faa61a; }
.dnd     .status-icon { background: #ed4245; }

.custom-status {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.68rem; color: rgba(255,255,255,0.48);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%; line-height: 1.2;
}
.custom-status img { flex-shrink: 0; }

.user-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; margin-bottom: 1px; }
.user-badge {
  display: inline-flex; align-items: center;
  line-height: 1; cursor: default; opacity: 0.82;
  transition: opacity 0.15s, transform 0.15s;
}
.user-badge:hover { opacity: 1; transform: scale(1.22); }
.user-badge i { font-size: 13px; }

.discord-hint-dot { display: none; }

.platform-indicators { display: none; }
.platform-indicator {
  width: 20px; height: 20px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: default;
}
.platform-indicator i { font-size: 10px; color: rgba(255,255,255,0.28); transition: color 0.3s; }
.platform-indicator.active {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.platform-indicator.active i { color: rgba(255,255,255,0.85); }

.activity-list {
  display: flex; flex-direction: column;
  max-height: 220px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.activity-list::-webkit-scrollbar { width: 3px; }
.activity-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }
.activity-list::-webkit-scrollbar-track { background: transparent; }

.activity-block {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  transition: all 0.28s ease;
  position: relative; overflow: hidden;
}
.activity-block::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg,transparent,rgba(255,255,255,0.09) 30%,rgba(255,255,255,0.09) 70%,transparent);
  opacity: 0.5;
}
.activity-block:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.activity-title {
  font-size: 0.67rem; font-weight: 700;
  color: rgba(255,255,255,0.42);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 5px;
}
.activity-pause-icon { font-size: 0.8em; margin-left: 6px; opacity: 0.8; color: #ff6b6b; }

.activity-content { display: flex; align-items: flex-start; gap: 10px; }
.activity-details { flex: 1; min-width: 0; }

.activity-detail {
  font-size: 0.80rem; color: rgba(255,255,255,0.70);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.activity-state {
  font-size: 0.74rem; color: rgba(255,255,255,0.58);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paused-state { display: flex; align-items: center; gap: 6px; color: #ff6b6b; font-weight: 500; margin-top: 4px; }

.activity-image-container {
  flex-shrink: 0; width: 48px; height: 48px;
  border-radius: 6px; overflow: hidden;
  background: rgba(0,0,0,0.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.28s ease;
}
.activity-image { width: 100%; height: 100%; object-fit: cover; display: block; }

.activity-img-fallback {
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: rgba(255,255,255,0.28);
  border-radius: 6px;
}

.progress-container { margin-top: 8px; width: 100%; }
.progress-time {
  display: flex; justify-content: space-between;
  font-size: 0.67rem; color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
}
.progress-bar {
  width: 100%; height: 3px;
  background: rgba(255,255,255,0.09);
  border-radius: 2px; overflow: hidden;
}
.activity-block:not(.spotify-activity) .progress {
  background: var(--activity-accent, #8fbcbb);
  box-shadow: 0 0 8px var(--activity-accent, rgba(143,188,187,0.5));
}
.activity-block.spotify-activity .progress { background: #1db954; box-shadow: 0 0 8px rgba(29,185,84,0.5); }
.progress { height: 100%; width: 0%; transition: width 0.1s linear; border-radius: 2px; }

.spotify-container {
  display: flex; gap: 12px; margin-top: 8px; padding: 10px;
  background: rgba(0,0,0,0.28);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  position: relative; overflow: hidden;
  transition: all 0.38s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}
.spotify-container::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    var(--spotify-gradient-start, rgba(255,255,255,0.04)) 0%,
    transparent 50%,
    var(--spotify-gradient-end, rgba(0,0,0,0.02)) 100%);
  pointer-events: none; opacity: 0;
  transition: opacity 0.38s ease;
}
.spotify-container.color-extracted::before { opacity: 1; }
.spotify-container:hover {
  background: var(--spotify-bg-hover, rgba(0,0,0,0.38));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--spotify-shadow-hover, rgba(0,0,0,0.4));
  border-color: var(--spotify-border, rgba(255,255,255,0.14));
}

.album-art-container { position: relative; flex-shrink: 0; }
.album-art {
  width: 50px; height: 50px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: block; transition: all 0.28s ease;
}
.album-art:hover { transform: scale(1.06); }

.spotify-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}
.spotify-details .activity-detail { font-size: 0.87rem; font-weight: 600; color: #fff; margin-bottom: 3px; letter-spacing: -0.01em; }
.spotify-details .activity-state  { font-size: 0.74rem; color: #b3b3b3; margin-bottom: 2px; font-weight: 400; }

.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 0;
  color: rgba(255,255,255,0.38); font-size: 0.76rem;
}
.loading-spinner {
  width: 13px; height: 13px;
  border: 1.5px solid rgba(255,255,255,0.10);
  border-top-color: rgba(255,255,255,0.48);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-activity {
  color: rgba(255,255,255,0.28); font-size: 0.74rem;
  text-align: center; padding: 16px 0; font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  #bottom-panel   { animation: none !important; }
  .dock-icon-wrap { transition: none !important; }
  .dock-icon-svg  { transition: none !important; }
  .dock-fa-icon   { transition: none !important; animation: none !important; }
}
