*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple-950: #0d0517;
  --purple-900: #1a0533;
  --purple-800: #2d1057;
  --purple-700: #4c1d95;
  --purple-600: #6d28d9;
  --purple-500: #7c3aed;
  --purple-400: #8b5cf6;
  --purple-300: #a78bfa;
  --purple-200: #c4b5fd;
  --purple-100: #ede9fe;
  --black: #050208;
  --card-bg: rgba(18, 6, 35, 0.85);
  --border: rgba(139, 92, 246, 0.2);
  --border-hover: rgba(139, 92, 246, 0.5);
  --text-primary: #f0e8ff;
  --text-secondary: rgba(196, 181, 253, 0.7);
  --text-muted: rgba(167, 139, 250, 0.5);
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Enter Screen ── */
.enter-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #050208;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.enter-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(109, 40, 217, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.enter-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.enter-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.enter-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.8rem, 9vw, 5.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  display: flex;
  overflow: hidden;
}

.enter-name .letter {
  display: inline-block;
  color: #fff;
  opacity: 0;
  transform: translateY(110%);
  animation: letter-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letter-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.enter-divider {
  width: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(139, 92, 246, 0.6), transparent);
  opacity: 0;
  animation: divider-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

@keyframes divider-in {
  to {
    width: clamp(160px, 35vw, 320px);
    opacity: 1;
  }
}

.enter-sub {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.5);
  opacity: 0;
  animation: fade-up 0.7s ease 1.6s forwards;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes sub-pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 0.9; }
}

.enter-sub.visible {
  animation: sub-pulse 2.2s ease-in-out infinite;
}

/* ── Background Video ── */
.bg-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-filter: blur(18px) saturate(1.8) brightness(0.5);
  filter: blur(18px) saturate(1.8) brightness(0.5);
  -webkit-transform: scale(1.08);
  transform: scale(1.08);
  will-change: transform;
}

.bg-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 2, 8, 0.55);
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px 120px;
}

/* ── Card ── */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px 24px;
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
  -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  will-change: transform;
  overflow: visible;
  contain: layout style;
}

.card-glow {
  display: none;
}

/* ── Pixel Dog ── */
#pixel-dog {
  position: absolute;
  width: 80px;
  height: 58px;
  pointer-events: none;
  z-index: 10;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ── Card Header ── */
.card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Speech Bubble ── */
.speech-bubble {
  position: relative;
  background: rgba(109, 40, 217, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 7px 14px;
  font-size: 0.8rem;
  color: var(--purple-200);
  font-weight: 500;
  letter-spacing: 0.01em;
  order: -1;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid rgba(109, 40, 217, 0.18);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 9px solid rgba(139, 92, 246, 0.3);
  z-index: -1;
}

/* ── Avatar ── */
.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #6d28d9, #a78bfa, #7c3aed, #4c1d95, #6d28d9);
  animation: spin 4s linear infinite;
  z-index: 0;
  will-change: transform;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.avatar {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--purple-900);
  border: 3px solid var(--black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  z-index: 2;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--black);
  animation: pulse-green 2.5s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Name / Handle / Badges ── */
.name-block {
  min-width: 0;
}

.name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-word;
}

.handle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  font-size: 0.72rem;
  font-weight: 600;
  color: #4ade80;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-green 2.5s ease-in-out infinite;
}

.relationship-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 100px;
  background: rgba(236, 72, 153, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.25);
  font-size: 0.72rem;
  font-weight: 600;
  color: #f472b6;
  letter-spacing: 0.03em;
}

.relationship-badge svg {
  color: #f472b6;
  flex-shrink: 0;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin-bottom: 20px;
}

/* ── Bio ── */
.bio-section {
  margin-bottom: 18px;
  text-align: center;
}

.bio {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.tag {
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(109, 40, 217, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.28);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--purple-300);
  letter-spacing: 0.02em;
  cursor: default;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.tag:hover {
  background: rgba(109, 40, 217, 0.32);
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--purple-200);
}

/* ── Stats ── */
.stats-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(109, 40, 217, 0.08);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 0;
  margin-bottom: 20px;
  overflow: hidden;
}

.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  min-width: 0;
}

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(0.75rem, 2vw, 1rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 2px 0;
}

/* ── Social Links ── */
.social-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 12px;
  background: rgba(109, 40, 217, 0.1);
  border: 1px solid var(--border);
  color: var(--purple-300);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.social-btn:hover {
  background: rgba(109, 40, 217, 0.25);
  border-color: var(--border-hover);
  color: var(--purple-200);
  transform: translateY(-2px);
}

.social-btn:active {
  transform: translateY(0);
}

/* ── Contact Bar ── */
.contact-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(109, 40, 217, 0.12);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  min-width: 0;
  word-break: break-all;
}

.contact-item svg {
  color: var(--purple-500);
  flex-shrink: 0;
}

/* ── Music Player ── */
.player {
  position: fixed;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  left: calc(20px + env(safe-area-inset-left, 0px));
  z-index: 100;
  width: 280px;
  max-width: calc(100vw - 40px);
  background: rgba(10, 3, 20, 0.93);
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 18px;
  padding: 14px 16px 12px;
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  contain: layout style;
}

.player-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.player-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--purple-500);
  animation: pulse-green 2s ease-in-out infinite;
}

.player-track {
  margin-bottom: 10px;
}

.player-track-bar {
  position: relative;
  height: 3px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: 100px;
  margin-bottom: 5px;
}

.player-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, #7c3aed, #c4b5fd);
  border-radius: 100px;
  pointer-events: none;
  width: 0%;
  transition: width 0.1s linear;
}

.player-seek {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: 20px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}

.player-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(109, 40, 217, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: var(--purple-200);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.player-btn:hover {
  background: rgba(109, 40, 217, 0.45);
  border-color: rgba(139, 92, 246, 0.55);
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.player-mute {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.player-mute:hover {
  color: var(--purple-300);
}

.player-vol-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #7c3aed 50%, rgba(139,92,246,0.2) 50%);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  min-width: 0;
}

.player-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple-400);
  cursor: pointer;
}

.player-vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple-400);
  cursor: pointer;
  border: none;
}

/* ── Mobile ── */
@media (max-width: 520px) {
  .container {
    padding: 16px 12px 130px;
  }

  .card {
    padding: 24px 18px 20px;
    border-radius: 20px;
  }

  .name {
    font-size: 1.25rem;
  }

  .social-links {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .social-btn {
    font-size: 0.7rem;
    padding: 9px 4px;
    gap: 4px;
  }

  .social-btn svg {
    width: 15px;
    height: 15px;
  }

  .stat-value {
    font-size: 0.82rem;
  }

  .player {
    left: calc(12px + env(safe-area-inset-left, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: 100%;
    border-radius: 14px;
  }
}

@media (max-width: 360px) {
  .social-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-header {
    gap: 8px;
  }
}

/* ── Touch devices — disable 3D tilt ── */
@media (hover: none) {
  .card {
    transform: none !important;
    transition: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .avatar-ring,
  .badge-dot,
  .status-dot,
  .player-label-dot {
    animation: none;
  }
  .card {
    transition: none;
  }
}
