:root {
  --bg: #08080b;
  --text: #e8e8ee;
  --muted: #9a9aa6;
  --line: rgba(255, 255, 255, 0.08);
  --fill: rgba(255, 255, 255, 0.04);
  --accent: #5c7fff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 24rem 22rem at 50% 50%,
    transparent 55%,
    rgba(92, 127, 255, 0.14) 72%,
    rgba(114, 92, 255, 0.09) 82%,
    transparent 95%);
}

#glow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s;
  pointer-events: none;
}

#glow.on {
  opacity: 1;
}

nav a {
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(80px at var(--mx, 50%) var(--my, 50%), rgba(122, 150, 255, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

nav a:hover::after {
  opacity: 1;
}

.card {
  position: relative;
  width: min(400px, 100%);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  border-radius: 24px;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--fill);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--line);
}

.card > * {
  margin: 0;
}

.avatar {
  --ring: #80848e;
  display: inline-block;
  padding: 3px;
  border-radius: 50%;
  border: 3px solid var(--ring);
  cursor: grab;
  touch-action: none;
  transition: border-color 0.4s, transform 0.2s;
}

.avatar:hover {
  transform: translateZ(8px) scale(1.06);
}

.avatar[data-status="online"] { --ring: #23a55a; }
.avatar[data-status="idle"] { --ring: #f0b232; }
.avatar[data-status="dnd"] { --ring: #f23f43; }

.avatar img {
  display: block;
  border-radius: 50%;
}

h1 {
  font-size: 22px;
  font-weight: 600;
}

.status,
.activity {
  min-height: 1.5em;
  color: var(--muted);
  font-size: 14px;
}

.activity {
  font-size: 13px;
  margin-top: -10px;
}

.track {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: 24px 24px;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fill);
  color: inherit;
  text-decoration: none;
  text-align: left;
  transition: background 0.2s, filter 0.2s;
}

.track[href]:hover {
  background: rgba(255, 255, 255, 0.07);
}

.track[href]:hover,
nav a:hover {
  filter: brightness(1.3);
}

.track:not([href]) {
  pointer-events: none;
}

.track img {
  grid-row: 1 / 3;
  border-radius: 8px;
  background: var(--line);
}

.track .name,
.track .sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}

.track .sub {
  color: var(--muted);
  font-size: 13px;
}

.track .when:not(:empty)::before {
  content: " · ";
}

.track[data-live] .when {
  color: #7a96ff;
}

.bars {
  display: none;
}

.track[data-live] .bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  margin-left: 6px;
}

.bars i {
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: #7a96ff;
  animation: bounce 1.1s ease-in-out infinite;
}

.bars i:nth-child(2) {
  animation-delay: -0.37s;
}

.bars i:nth-child(3) {
  animation-delay: -0.74s;
}

@keyframes bounce {
  0%, 100% { height: 4px; }
  50% { height: 10px; }
}

.track:not([href]) .name::before,
.track:not([href]) .sub::before {
  content: "";
  display: inline-block;
  width: 8em;
  height: 0.7em;
  border-radius: 4px;
  background: var(--line);
}

.track:not([href]) .sub::before {
  width: 5em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

nav a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--muted);
  transition: color 0.2s, background 0.2s, transform 0.2s, filter 0.2s;
}

nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

nav svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
