/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-deep:      #06000f;
  --bg-card:      rgba(18, 4, 38, 0.72);
  --bg-card-2:    rgba(28, 8, 54, 0.65);
  --border:       rgba(139, 92, 246, 0.25);
  --border-hover: rgba(167, 139, 250, 0.55);

  --purple-1: #7c3aed;
  --purple-2: #8b5cf6;
  --purple-3: #a78bfa;
  --purple-4: #c4b5fd;
  --purple-5: #ede9fe;

  --text-primary:   #f0ebff;
  --text-secondary: #b9a8e0;
  --text-muted:     #7a6a9a;

  --glow-sm: 0 0 12px rgba(139, 92, 246, 0.45);
  --glow-md: 0 0 28px rgba(139, 92, 246, 0.35);
  --glow-lg: 0 0 60px rgba(139, 92, 246, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ============================================================
   Stars canvas — fixed, full-screen background
   ============================================================ */
#stars-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   Layout
   ============================================================ */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 60px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ============================================================
   Glass card
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--glow-md), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-lg), inset 0 1px 0 rgba(255,255,255,0.09);
}

/* ============================================================
   Hero / Profile
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 32px 36px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.avatar-wrap {
  position: relative;
  margin-bottom: 20px;
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--purple-2);
  box-shadow: var(--glow-sm), 0 0 0 4px rgba(139, 92, 246, 0.12);
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-1), var(--purple-3));
  border: 2px solid var(--purple-2);
  box-shadow: var(--glow-sm), 0 0 0 4px rgba(139, 92, 246, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.hero-name {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--purple-4) 0%, #fff 50%, var(--purple-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.hero-tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 380px;
  margin-bottom: 28px;
}

/* ── Social links ─────────────────────────────────────── */
.socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: rgba(139, 92, 246, 0.08);
  color: var(--purple-4);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.social-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--purple-3);
  color: #fff;
  box-shadow: var(--glow-sm);
  transform: translateY(-2px);
}

.social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Discord specific ─────────────────────────────────── */
.social-btn.discord:hover {
  background: rgba(88, 101, 242, 0.25);
  border-color: #7289da;
  box-shadow: 0 0 12px rgba(88,101,242,0.4);
}

/* ── GitHub specific ──────────────────────────────────── */
.social-btn.github:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

/* ── Last.fm specific ─────────────────────────────────── */
.social-btn.lastfm:hover {
  background: rgba(210, 0, 0, 0.2);
  border-color: #d20000;
  box-shadow: 0 0 12px rgba(210,0,0,0.3);
}

/* ── Instagram specific ───────────────────────────────── */
.social-btn.instagram:hover {
  background: rgba(225, 48, 108, 0.2);
  border-color: #e1306c;
  box-shadow: 0 0 12px rgba(225,48,108,0.35);
}

/* ============================================================
   Section heading
   ============================================================ */
.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-3);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

/* ============================================================
   Now Playing
   ============================================================ */
#now-playing-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 80px;
}

.steam-activity-card {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 80px;
}

.np-art {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: var(--glow-sm);
}

.np-art-placeholder {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.np-info {
  flex: 1;
  min-width: 0;
}

.np-status {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.np-status.playing {
  color: var(--purple-3);
}

.np-status.stale {
  color: var(--text-secondary);
}

/* Pulsing dot for "now playing" */
.np-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple-2);
  box-shadow: 0 0 6px var(--purple-2);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.np-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.88rem;
  color: var(--purple-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-album {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.np-idle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.np-idle code {
  font-family: 'Fira Code', 'Courier New', monospace;
  background: rgba(139,92,246,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--purple-4);
}

/* ============================================================
   Stats bar
   ============================================================ */
#lastfm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}

.stat-item {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
}

.stat-item:hover {
  border-color: var(--border-hover);
  background: rgba(139, 92, 246, 0.15);
}

.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-4), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   Top tracks / artists list
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 580px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.top-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition);
}

.top-item:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: var(--border);
}

.top-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--purple-3);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.top-info {
  flex: 1;
  min-width: 0;
}

.top-name {
  display: block;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-plays {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.steam-games-list {
  margin-top: 18px;
}

.steam-game-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.steam-link {
  color: inherit;
  text-decoration: none;
}

.steam-link:hover {
  color: var(--purple-4);
}

.no-data {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 0;
}

/* ============================================================
   Skeleton loader
   ============================================================ */
.skeleton-row {
  padding: 4px 0;
}

.skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.08) 25%,
    rgba(139, 92, 246, 0.18) 50%,
    rgba(139, 92, 246, 0.08) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 16px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer p + p {
  margin-top: 10px;
}

.footer a {
  color: var(--purple-3);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.uptime-counter {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--purple-4);
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--purple-1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-2); }

/* ============================================================
   Selection
   ============================================================ */
::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}
