:root {
  --bg: #0a0a0a;
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.68);
  --text-darker: rgba(255, 255, 255, 0.45);
  --glass: rgba(10, 10, 12, 0.38);
  --glass-inner: rgba(0, 0, 0, 0.28);
  --bg-dim: rgba(0, 0, 0, 0.48);
  --bg-dim-center: rgba(0, 0, 0, 0.22);
  --glass-border: 1px solid rgba(255, 255, 255, 0.11);
  --card-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --card-max: 40rem;
  --radius: 22px;
  --radius-sm: 14px;
  --discord-online: #43b581;
  --discord-idle: #faa61a;
  --discord-dnd: #f04747;
  --discord-offline: #747f8d;
  --font: "Onest", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 32px;
  overflow-x: hidden;
}

body.entered .enter-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.has-cursor-effect > canvas {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg) center / cover no-repeat;
  filter: grayscale(100%);
}

.background-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.background-video-wrap[hidden] {
  display: none;
}

.background-video-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-dim);
  pointer-events: none;
}

body.has-video-bg .background-video-wrap::after {
  background: radial-gradient(
    ellipse 85% 75% at 50% 42%,
    var(--bg-dim-center) 0%,
    rgba(0, 0, 0, 0.38) 50%,
    var(--bg-dim) 100%
  );
}

.background-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

body.has-video-bg .background {
  background-image: none !important;
}

body.has-video-bg .background::after {
  display: none;
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-dim);
  pointer-events: none;
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.35;
  animation: float linear infinite;
}

@keyframes float {
  from {
    transform: translateY(100vh);
  }
  to {
    transform: translateY(-100vh);
  }
}

.enter-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.enter-overlay p {
  font-size: clamp(1.25rem, 4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 20px;
}

/* Volume — top-left glass pill, slider on hover */
.volume-control.hidden {
  display: none;
}

.volume-control {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 110;
  display: flex;
  align-items: center;
  gap: 0;
  height: 38px;
  min-width: 38px;
  padding: 0 8px 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition:
    gap 0.28s ease,
    padding 0.28s ease,
    width 0.28s ease,
    background 0.28s ease;
  width: 46px;
}

.volume-control:hover,
.volume-control:focus-within,
.volume-control.is-dragging {
  width: 172px;
  gap: 8px;
  padding-right: 10px;
  background: rgba(10, 10, 12, 0.68);
}

.volume-toggle {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.volume-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.volume-icon {
  width: 18px;
  height: 18px;
  opacity: 0.95;
}

.volume-icon-off {
  display: none;
}

body.volume-muted .volume-icon-on {
  display: none;
}

body.volume-muted .volume-icon-off {
  display: block;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 3px;
  margin: 0;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  outline: none;
  opacity: 0;
  pointer-events: none;
  transition: width 0.28s ease, opacity 0.22s ease;
  cursor: pointer;
}

.volume-control:hover .volume-slider,
.volume-control:focus-within .volume-slider,
.volume-control.is-dragging .volume-slider {
  width: 100px;
  opacity: 1;
  pointer-events: auto;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.glass {
  background: var(--glass);
  border: var(--glass-border);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
}

body.has-video-bg .profile-card.glass {
  background: rgba(8, 8, 10, 0.32);
  box-shadow:
    var(--card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--card-max);
  animation: card-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* Profile header */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px 16px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}


.profile-meta {
  min-width: 0;
  flex: 1;
  padding-top: 4px;
}

.profile-meta h1 {
  font-size: clamp(1.65rem, 4.5vw, 2.15rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.profile-tagline {
  margin-top: 6px;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0.01em;
}

.profile-tagline:empty {
  display: none;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  min-height: 0;
}

.badge-row:empty {
  display: none;
}

.badge-row img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  opacity: 0.95;
}

/* Discord nested panel */
.discord-presence.hidden {
  display: none;
}

.discord-presence {
  margin: 0 18px 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--glass-inner);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.discord-presence-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discord-presence.is-setup .discord-presence-inner {
  display: none;
}

.discord-setup-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.discord-setup-hint.hidden {
  display: none;
}

.discord-setup-hint code {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.discord-setup-hint a {
  color: #fff;
}

.discord-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
}

.discord-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.discord-status-ring {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(12, 12, 12, 0.95);
  background: var(--discord-offline);
}

.discord-status-ring[data-status="online"] {
  background: var(--discord-online);
}

.discord-status-ring[data-status="idle"] {
  background: var(--discord-idle);
}

.discord-status-ring[data-status="dnd"] {
  background: var(--discord-dnd);
}

.discord-info {
  min-width: 0;
  flex: 1;
}

.discord-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.discord-username {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.discord-server-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  padding: 2px 7px 2px 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.discord-server-tag[hidden] {
  display: none;
}

.discord-server-tag-badge {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.discord-status-line {
  margin-top: 3px;
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.35;
}

.discord-status-line:empty {
  display: none;
}

.discord-last-seen {
  margin-top: 2px;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-darker);
  line-height: 1.35;
}

.discord-last-seen:empty {
  display: none;
}

/* Social row */
.socials {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 24px 22px;
}

.social-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.social-pill:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.social-pill:active {
  transform: translateY(-1px) scale(0.97);
}

.socials .social-btn {
  padding: 0;
}

.socials a.hidden,
.socials .social-btn.hidden {
  display: none;
}

.socials.socials--hidden {
  display: none;
}

/* Card footer — view count */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.15);
}

.view-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.view-stat.hidden {
  display: none;
}

.view-stat-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.9;
}

.view-stat-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.view-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-darker);
}

.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  z-index: 200;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
  body {
    padding: 52px 12px 24px;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 18px 12px;
  }

  .profile-meta {
    text-align: center;
  }

  .badge-row {
    justify-content: center;
  }

  .discord-info {
    text-align: left;
  }

  .socials {
    gap: 18px;
    padding: 6px 18px 16px;
  }

  .card-footer {
    gap: 16px;
    padding: 12px 18px 16px;
  }

  .volume-control:hover,
  .volume-control:focus-within,
  .volume-control.is-dragging {
    width: 158px;
  }

  .volume-control {
    top: 12px;
    left: 12px;
  }
}
