:root {
  --bg: #050816;
  --bg-soft: #0f172a;
  --accent: #5865f2; /* Discord blurple */
  --accent-soft: rgba(88, 101, 242, 0.15);
  --accent-strong: rgba(88, 101, 242, 0.6);
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.4);
  --radius-xl: 22px;
  --radius-full: 999px;
  --shadow-soft: 0 24px 80px rgba(15, 23, 42, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: #020617;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Fullscreen video background (optional) */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* put the video above the page background color */
  z-index: 0;
  /* Keep it dark but still clearly visible */
  filter: brightness(0.6) saturate(1.1);
}

/* Glow overlay on top of the video */
.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.2), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(34, 197, 94, 0.12), transparent 55%);
  filter: blur(18px);
  opacity: 0.55;
  z-index: 1;
}

.card {
  width: 100%;
  max-width: 520px;
  padding: 40px 36px 26px;
  border-radius: 32px;
  /* Extra transparent glass so the video is very visible */
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.14))
      border-box;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px) saturate(1.5);
}

.shell {
  width: 100%;
  max-width: 1040px;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Hide main content until after click-to-enter */
body:not(.entered) .shell {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}

body.entered .shell {
  opacity: 1;
  transform: scale(1);
}

.profile-card {
  margin: 0 auto;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Ensure card is above video, glow, and stars */
  z-index: 3;
}

.avatar-wrap {
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
  border-radius: 999px;
  padding: 3px;
  background: conic-gradient(from 180deg, #4f46e5, #a855f7, #eab308, #4f46e5);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.95);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #000;
  display: block;
}

.display-name {
  margin: 4px 0 2px;
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #a855f7;
}

.subtitle {
  margin: 0;
  font-size: 0.96rem;
  color: #e5e7eb;
}

.presence-card {
  margin: 26px auto 22px;
  padding: 14px 18px;
  max-width: 320px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(31, 41, 55, 0.95);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.95);
}

.presence-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #000;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.95);
}

.presence-main {
  flex: 1;
  text-align: left;
}

.presence-username {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f9fafb;
  margin-bottom: 2px;
}

.presence-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.status-online {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

.link-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.link-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.link-icon span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.link-icon .icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Specific icon colors */
.link-icon--yt {
  background: radial-gradient(circle at 30% 0%, rgba(248, 250, 252, 0.16), transparent 50%),
    linear-gradient(135deg, #ef4444, #b91c1c);
}

.link-icon--yt span {
  font-size: 1.1rem;
}

/* Minecraft / NameMC icon */
.link-icon--mc {
  background: radial-gradient(circle at 30% 0%, rgba(248, 250, 252, 0.18), transparent 55%),
    linear-gradient(135deg, #16a34a, #14532d);
}

.link-icon--dc {
  background: radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.14), transparent 40%),
    linear-gradient(135deg, #5865f2, #4f46e5);
}

.link-icon--tw {
  background: linear-gradient(135deg, #8b5cf6, #4c1d95);
}

.link-icon--custom {
  background: linear-gradient(135deg, #0f172a, #020617);
}

.link-icon:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
  border-color: rgba(88, 101, 242, 0.9);
}

.link-icon:active {
  transform: translateY(0) scale(0.98);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn.primary {
  background: radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.3), transparent 45%),
    linear-gradient(120deg, var(--accent), #8b5cf6);
  border-color: transparent;
  box-shadow: 0 14px 40px rgba(88, 101, 242, 0.6);
}

.btn.subtle {
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
}

.btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.7);
}

.btn.primary:hover {
  box-shadow: 0 18px 55px rgba(88, 101, 242, 0.8);
}

.btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.9);
}

.meta-row {
  margin-top: 22px;
  display: flex;
  justify-content: flex-start;
}

.views-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.views-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca3af;
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(248, 250, 252, 0.9), transparent),
    radial-gradient(1px 1px at 80px 120px, rgba(248, 250, 252, 0.9), transparent),
    radial-gradient(1px 1px at 160px 220px, rgba(248, 250, 252, 0.9), transparent),
    radial-gradient(1px 1px at 260px 40px, rgba(248, 250, 252, 0.9), transparent);
  background-size: 260px 260px;
  opacity: 0.7;
  z-index: 2;
  animation: stars-drift 40s linear infinite;
}

@keyframes stars-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-80px, -40px, 0);
  }
}

.music-toggle {
  position: fixed;
  left: 18px;
  top: 18px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 160ms ease, background 160ms ease;
}

.music-toggle .music-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.music-toggle.active {
  border-color: rgba(88, 101, 242, 0.95);
  background: radial-gradient(circle at 0% 0%, rgba(248, 250, 252, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(88, 101, 242, 0.9), rgba(129, 140, 248, 0.95));
}

.music-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.98);
}

.music-toggle:active {
  transform: translateY(0);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.96);
}

/* Click-to-enter overlay */
.enter-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(18px);
  z-index: 4;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.enter-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.enter-countdown {
  font-size: 0.95rem;
  color: #e5e7eb;
  opacity: 0.8;
}

.enter-button {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
}

.enter-button:disabled {
  opacity: 0.4;
  cursor: default;
}

body.entered .enter-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hide volume button until after entering */
body:not(.entered) .music-toggle {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .card {
    padding: 22px 18px 16px;
    border-radius: 18px;
  }

  .profile {
    gap: 14px;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  .text h1 {
    font-size: 1.05rem;
  }
}
