* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #ececec;
  --text-dim: #9a9aa3;
  --bg-panel: rgba(10, 10, 13, 0.7);
  --bg-panel-hover: rgba(18, 18, 22, 0.82);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  --radius: 3px;
}

html {
  background: #050507;
}

html, body {
  width: 100%;
  height: 100%;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  overflow: hidden;
  user-select: none;
}

body {
  background: transparent;
}

#bg-image {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  background: #050507;
  opacity: 0;
  transition: opacity 0.8s ease;
  filter: brightness(0.8) saturate(1.05);
}

#bg-image.loaded {
  opacity: 1;
}

.bg-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #0c0a14 0%, #050507 60%, #030305 100%);
  pointer-events: none;
}

.bg-fallback .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(35px);
  opacity: 0;
  animation: orbDrift var(--orb-duration, 12s) ease-in-out infinite;
  animation-delay: var(--orb-delay, 0s);
  will-change: transform, opacity;
}

@keyframes orbDrift {
  0%, 100% {
    opacity: 0.4;
    transform: translate(0, 0) scale(0.9);
  }
  50% {
    opacity: 1;
    transform: translate(var(--orb-tx, 40px), var(--orb-ty, -30px)) scale(1.2);
  }
}

#yt-player {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: -10;
}

.vignette {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 35%, rgba(0,0,0,0.55) 100%),
    rgba(0, 0, 0, 0.2);
  z-index: 2;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 5, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  transition: opacity 0.4s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.overlay-text {
  font-size: 28px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 300;
  transition: color 0.2s ease, letter-spacing 0.25s ease;
}

.overlay:hover .overlay-text {
  color: #fff;
  letter-spacing: 8px;
}

.volume-wrap {
  position: fixed;
  top: 18px;
  left: 18px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 50;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.volume-wrap:hover {
  border-color: var(--border-hover);
  background: var(--bg-panel-hover);
}

.volume-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.volume-btn:hover {
  color: #fff;
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  margin: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  opacity: 0;
  transition: width 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
  cursor: pointer;
}

.volume-wrap:hover #volume-slider,
.volume-wrap:focus-within #volume-slider {
  width: 110px;
  opacity: 1;
  margin-left: 8px;
  margin-right: 4px;
}

@media (hover: none) {
  .volume-wrap #volume-slider {
    width: 110px;
    opacity: 1;
    margin-left: 8px;
    margin-right: 4px;
  }
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  background: #fff;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

#volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: #fff;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

.friends-wrap {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 90px;
  height: 36px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 50;
  overflow: hidden;
  box-sizing: border-box;
  transition:
    width 0.28s cubic-bezier(0.2, 0.85, 0.4, 1),
    height 0.28s cubic-bezier(0.2, 0.85, 0.4, 1),
    border-color 0.2s ease,
    background 0.2s ease;
}

.friends-label {
  position: absolute;
  top: 0;
  right: 38px;
  height: 34px;
  display: flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.2px;
  text-transform: lowercase;
  font-family: inherit;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

.friends-wrap:hover .friends-label,
.friends-wrap.open .friends-label,
.friends-wrap:focus-within .friends-label {
  opacity: 0;
  transition: opacity 0.08s ease;
}

.friends-wrap:hover,
.friends-wrap.open,
.friends-wrap:focus-within {
  width: 200px;
  height: 250px;
  border-color: var(--border-hover);
  background: var(--bg-panel-hover);
}

.friends-btn {
  position: absolute;
  top: 0;
  right: 4px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: inherit;
  padding: 0;
  z-index: 2;
}

.friends-wrap:hover .friends-btn,
.friends-wrap.open .friends-btn,
.friends-wrap:focus-within .friends-btn {
  color: #fff;
}

.friends-search {
  position: absolute;
  top: 5px;
  left: 4px;
  right: 38px;
  height: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0 9px;
  margin: 0;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  transition:
    opacity 0.08s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.friends-search::placeholder {
  color: var(--text-dim);
}

.friends-search:focus {
  outline: none;
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.friends-wrap:hover .friends-search,
.friends-wrap.open .friends-search,
.friends-wrap:focus-within .friends-search {
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 0.18s ease 0.08s,
    border-color 0.15s ease,
    background 0.15s ease;
}

.friends-list {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  padding: 4px 5px 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.friends-wrap:hover .friends-list,
.friends-wrap.open .friends-list,
.friends-wrap:focus-within .friends-list {
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.18s ease 0.08s;
}

.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
}

.friend-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.friend-avatar-wrap {
  width: 32px;
  height: 32px;
  position: relative;
  flex-shrink: 0;
}

.friend-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a20;
  display: block;
}

.friend-decoration {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 40px;
  height: 40px;
  pointer-events: none;
  display: none;
}

.friend-avatar-wrap.decorated .friend-decoration {
  display: block;
}

.friend-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #80848e;
  border: 2.5px solid var(--bg-panel);
  box-sizing: border-box;
  z-index: 2;
}

.friend-status.online  { background: #23a55a; }
.friend-status.idle    { background: #f0b232; }
.friend-status.dnd     { background: #f23f43; }
.friend-status.offline { background: #80848e; }

.friend-status.idle::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-panel);
}

.friend-status.dnd::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 1.5px;
  background: var(--bg-panel);
  border-radius: 1px;
}

.friend-status.offline::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bg-panel);
}

.friend-meta {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.friends-empty {
  padding: 14px 8px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.view-counter {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  pointer-events: none;
  user-select: none;
  opacity: 0.75;
  z-index: 2;
}

.view-counter svg {
  opacity: 0.85;
}

.card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, 90vw);
  padding: 18px 26px 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  z-index: 10;
}

.pfp {
  width: 96px;
  height: 96px;
  margin: 0 auto 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pfp .avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #1a1a20;
  display: block;
}

.pfp.decorated .avatar {
  width: 78px;
  height: 78px;
}

.pfp .decoration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.pfp.decorated .decoration {
  display: block;
}

.pfp-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--text-dim);
  font-weight: 300;
  z-index: -1;
}

.pfp.no-img .pfp-fallback {
  z-index: 1;
}

.name {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

.desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 2px;
  margin-bottom: 14px;
}

.card:has(.activity-generic.show) .desc {
  margin-bottom: 6px;
}

.pfp-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #80848e;
  border: 4px solid #0a0a0d;
  z-index: 3;
  display: none;
  box-sizing: border-box;
}

.pfp.decorated .pfp-status {
  bottom: 8px;
  right: 8px;
}

.pfp-status.show       { display: block; }
.pfp-status.online     { background: #23a55a; }
.pfp-status.idle       { background: #f0b232; }
.pfp-status.dnd        { background: #f23f43; }
.pfp-status.offline    { background: #80848e; }

.pfp-status.idle::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0a0a0d;
}

.pfp-status.dnd::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 2px;
  background: #0a0a0d;
  border-radius: 1px;
}

.pfp-status.offline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0a0a0d;
}

.pfp .decoration { z-index: 1; }

.activity-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.activity-spotify-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.activity-spotify-card.listening:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.activity-spotify-body {
  display: none;
  flex-direction: column;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
}

.activity-spotify-card.listening .activity-spotify-body {
  display: flex;
}

.activity-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.18s ease;
}

.activity-spotify-card.listening .activity-head {
  color: rgb(30, 215, 96);
}

.activity-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}

.activity-art {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  object-fit: cover;
  background: #1a1a20;
  flex-shrink: 0;
}

.activity-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.activity-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.activity-sub {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.activity-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.activity-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.activity-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  transition: width 1s linear;
  border-radius: 2px;
}

.activity-times {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

.activity-generic {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 auto 16px;
  letter-spacing: 0.2px;
  line-height: 1.3;
  text-transform: lowercase;
}

.activity-generic.show {
  display: inline-flex;
}

.activity-generic .activity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #23a55a;
  box-shadow: 0 0 0 2px rgba(35, 165, 90, 0.18);
  flex-shrink: 0;
}

.activity-generic .activity-icon {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  display: none;
  background: #1a1a20;
}

.activity-generic.has-icon .activity-icon {
  display: block;
}

.activity-generic #generic-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.social {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.social:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-hover);
}

.social-favicon {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  filter: grayscale(1) brightness(0.85) contrast(0.9);
  transition: filter 0.18s ease;
}

.social:hover .social-favicon {
  filter: grayscale(0) brightness(1) contrast(1);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: min(420px, 92vw);
  max-height: 75vh;
  background: rgba(14, 14, 18, 0.97);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.18s ease;
}

.modal-backdrop.show .modal {
  transform: scale(1);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 2px;
  transition: color 0.15s ease, background 0.15s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.friend-list {
  padding: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 2px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background 0.15s ease;
}

.friend:hover {
  background: rgba(255, 255, 255, 0.05);
}

.friend-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-url {
  font-size: 12px;
  color: var(--text-dim);
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-list:empty::after {
  content: "no friends added yet";
  display: block;
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

.social:focus-visible,
.friends-btn:focus-visible,
.volume-btn:focus-visible,
.modal-close:focus-visible,
.friend:focus-visible,
.overlay:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
  border-radius: 3px;
}

.name.skeleton,
.desc.skeleton {
  color: transparent;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  border-radius: 3px;
  animation: skeletonPulse 1.6s ease-in-out infinite;
  display: inline-block;
}
.name.skeleton { min-width: 140px; height: 22px; }
.desc.skeleton { min-width: 200px; height: 14px; }
@keyframes skeletonPulse {
  0%, 100% { background-position: 200% 0; }
  50%      { background-position: 0% 0; }
}

@media (max-width: 400px) {
  .card { padding: 24px 18px 18px; }
  .activity-spotify-card { padding: 10px; }
  .activity-art { width: 52px; height: 52px; }
}

.custom-status {
  position: absolute;
  left: calc(50% + 58px);
  top: 50px;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 10px;
  background: rgba(28, 28, 31, 0.96);
  border-radius: 14px;
  font-size: 12.5px;
  color: var(--text);
  max-width: 200px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.custom-status.show {
  display: inline-flex;
}

.custom-status::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 24px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(28, 28, 31, 0.96);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.75);
}

.custom-status::after {
  content: "";
  position: absolute;
  left: -17px;
  top: 36px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(28, 28, 31, 0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.custom-status-emoji {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: none;
  flex-shrink: 0;
}

.custom-status.has-emoji-img .custom-status-emoji {
  display: block;
}

.custom-status-emoji-char {
  font-size: 14px;
  line-height: 1;
  display: none;
  flex-shrink: 0;
}

.custom-status.has-emoji-char .custom-status-emoji-char {
  display: inline;
}

.custom-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.clock {
  position: fixed;
  left: 18px;
  bottom: 14px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  user-select: none;
  z-index: 50;
  opacity: 0.8;
}

