
:root {
  --accent: 220, 70%, 95%;
  --accent-color: hsl(var(--accent));
  --accent-10: hsla(var(--accent), .10);
  --accent-20: hsla(var(--accent), .20);
  --accent-40: hsla(var(--accent), .40);

  --bg: #060608;
  --card-bg: rgba(40, 12, 20, .35);
  --border: rgba(255, 255, 255, .06);
  --border-hover: rgba(255, 255, 255, .12);

  --text: #e8e8ec;
  --text-dim: #a8a8a8;
  --text-muted: #3a3a42;

  --radius: 18px;
  --radius-sm: 10px;
  --blur: 10px;
  --card-w: 860px;
  --bg-brightness: .32;
  --bg-saturate: 1.1;

  /* Music reactivity vars (set by JS) */
  --music-energy: 0;
  --music-bass: 0;
  --music-glow: 0px;
  --beat-scale: 1;
  --prog-glow: 0px;
  --hue-shift: 0deg;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:focus { outline: none; }
html { -webkit-font-smoothing: antialiased; }
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
}

::selection { background: var(--accent-40); color: #fff; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
img { display: block; }

/* ═══ REVEAL SCREEN ═══ */
.reveal-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  clip-path: circle(150% at 50% 50%);
  transition: clip-path 0.9s cubic-bezier(0.77, 0, 0.175, 1);
  overflow: hidden;
}

.reveal-screen.out {
  clip-path: circle(0% at 50% 50%);
  pointer-events: none;
}

/* ═══ PULSING RINGS ═══ */
.reveal-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.reveal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: ringPulse 4s ease-in-out infinite;
}

.reveal-ring:nth-child(1) {
  width: 120px;
  height: 120px;
  animation-delay: 0s;
}

.reveal-ring:nth-child(2) {
  width: 220px;
  height: 220px;
  animation-delay: 0.6s;
}

.reveal-ring:nth-child(3) {
  width: 340px;
  height: 340px;
  animation-delay: 1.2s;
}

/* ═══ FLOATING ORBS ═══ */
.reveal-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reveal-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 200, 255, 0.12) 0%, transparent 70%);
  filter: blur(1px);
}

.reveal-orb:nth-child(1) {
  width: 6px;
  height: 6px;
  top: 30%;
  left: 25%;
  animation: orbFloat1 8s ease-in-out infinite;
}

.reveal-orb:nth-child(2) {
  width: 4px;
  height: 4px;
  top: 55%;
  left: 70%;
  animation: orbFloat2 10s ease-in-out infinite;
}

.reveal-orb:nth-child(3) {
  width: 8px;
  height: 8px;
  top: 20%;
  left: 65%;
  animation: orbFloat3 12s ease-in-out infinite;
}

.reveal-orb:nth-child(4) {
  width: 3px;
  height: 3px;
  top: 70%;
  left: 30%;
  animation: orbFloat2 9s ease-in-out infinite reverse;
}

.reveal-orb:nth-child(5) {
  width: 5px;
  height: 5px;
  top: 45%;
  left: 80%;
  animation: orbFloat1 11s ease-in-out infinite reverse;
}

/* ═══ REVEAL CONTENT ═══ */
.reveal-content {
  text-align: center;
  position: relative;
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.4s ease,
              filter 0.5s ease;
}

.reveal-screen.out .reveal-content {
  transform: scale(0.85);
  opacity: 0;
  filter: blur(12px);
}

/* ═══ SHIMMER LINE ═══ */
.reveal-shimmer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(200, 215, 255, 0) 20%,
    rgba(200, 215, 255, 0.15) 50%,
    rgba(200, 215, 255, 0) 80%,
    transparent 100%
  );
  animation: shimmerSweep 3s ease-in-out infinite;
  pointer-events: none;
}

.reveal-text {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  opacity: .85;
  animation: textBreath 3s ease-in-out infinite;
}

.reveal-hint {
  display: block;
  margin-top: 14px;
  font-size: .7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-dim);
  animation: hintPulse 2.5s ease-in-out infinite;
}

/* ═══ BACKGROUND VIDEO — MUSIC REACTIVE ═══ */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(var(--bg-brightness)) saturate(var(--bg-saturate)) blur(8px) hue-rotate(var(--hue-shift));
  transform: scale(1.02);
  transition: filter .3s ease;
  background: #090909;
}

body.audio-reactive .bg {
  transition: filter .08s ease;
}

.bg.video-fallback {
  opacity: 0;
}

/* ═══ VISUALIZER ═══ */
.visualizer {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(88vw, 820px);
  height: min(40vh, 360px);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  filter: blur(0px) saturate(1.3);
  mix-blend-mode: screen;
  transition: opacity .45s ease;
}

body.audio-reactive .visualizer {
  opacity: .65;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ═══ MAIN LAYOUT ═══ */
.main {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 30px 16px;
}

.main.hide { display: none; }
.main.show { display: flex; }

.main.show .card {
  animation: cardEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ═══ CARD — MUSIC REACTIVE ═══ */
.card {
  width: 100%;
  max-width: var(--card-w);
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(6px) saturate(1.15);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  will-change: transform, opacity;
  transform: scale(var(--beat-scale));
  transition: transform .12s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
}

/* Card glow on music */
body.audio-reactive .card {
  box-shadow:
    0 0 var(--music-glow) rgba(200, 215, 255, 0.08),
    0 0 calc(var(--music-glow) * 2) rgba(180, 200, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, calc(0.06 + var(--music-energy) * 0.08));
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255,255,255,.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

/* ═══ CARD INNER GLOW OVERLAY ═══ */
body.audio-reactive .card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(180, 200, 255, calc(var(--music-bass) * 0.06)) 0%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
  transition: background .15s ease;
}

.uid {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(0,0,0,.35);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  letter-spacing: .5px;
  transition: color .25s, border-color .25s;
}

.uid:hover {
  color: var(--accent-color);
  border-color: var(--accent-20);
}

.avatar-area {
  display: flex;
  justify-content: center;
  margin-top: -44px;
  position: relative;
  z-index: 5;
}

.avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 30%;
  border: 1px solid var(--bg);
  object-fit: cover;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
}

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

/* Avatar glow on music */
body.audio-reactive .avatar {
  box-shadow: 0 0 calc(var(--music-glow) * 0.8) rgba(200, 215, 255, 0.15);
}

.status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: #3ba55c;
}

/* Status pulse on beat */
body.audio-reactive .status {
  animation: statusPulse 0.6s ease infinite;
}

.name-block {
  text-align: center;
  padding: 14px 20px 0;
  position: relative;
  z-index: 2;
}

.name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.3px;
  transition: text-shadow .2s ease;
}

/* Name glow on music */
body.audio-reactive .name {
  text-shadow: 0 0 calc(var(--music-glow) * 0.6) rgba(200, 220, 255, 0.2);
}

.badges {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  position: relative;
  color: var(--accent-color);
  opacity: .7;
  transition: .25s ease;
  cursor: default;
  padding: 3px;
}

.badge:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.badge::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(.92);
  padding: 3px 10px;
  background: rgba(0,0,0,.85);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .6rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.badge:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.bio {
  text-align: center;
  padding: 6px 32px;
  font-size: .82rem;
  line-height: 1.65;
  color: var(--text-dim);
  position: relative;
  z-index: 2;
}

.bio strong {
  color: var(--text);
  font-weight: 600;
}

.accent-text {
  color: var(--accent-color);
  font-weight: 600;
  font-size: .82rem;
}

.chip {
  display: inline-block;
  background: var(--accent-10);
  color: var(--text-dim);
  padding: 1px 10px;
  border-radius: 5px;
  font-size: .75rem;
  margin-bottom: 10px;
}

.sep {
  border: none;
  height: 1px;
  background: var(--border);
  width: 400px;
  max-width: 100%;
  margin: 8px auto;
}

.gif-slot {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #0a0a10;
}

.gif-slot img,
.gif-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ═══ SOCIALS ═══ */
.socials {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px 20px 16px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.soc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  border: 1px solid var(--border);
  transition: .25s ease;
}

.soc:hover {
  color: var(--accent-color);
  border-color: var(--accent-20);
  background: var(--accent-10);
  transform: translateY(-3px);
}

/* Social icons glow on music */
body.audio-reactive .soc {
  border-color: rgba(255, 255, 255, calc(0.06 + var(--music-energy) * 0.06));
}

.soc::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.92);
  padding: 3px 10px;
  background: rgba(0,0,0,.85);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .6rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}

.soc:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ═══ PRESENCE ═══ */
.presence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 2;
  transition: border-color .25s;
}

.presence:hover { border-color: var(--border-hover); }

.presence-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.presence-av {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.presence-av img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--card-bg);
  background: #3ba55c;
}

.presence-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.presence-tag {
  font-size: .72rem;
  color: var(--text-dim);
}

.presence-activity {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══ PLAYER — MUSIC REACTIVE ═══ */
.player {
  margin: 0 20px 20px;
  padding: 14px 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 2;
  transition: border-color .25s, box-shadow .2s ease;
}

.player:hover { border-color: var(--border-hover); }

/* Player glow when music plays */
body.audio-reactive .player {
  border-color: rgba(255, 255, 255, calc(0.06 + var(--music-energy) * 0.1));
  box-shadow: 0 0 calc(var(--music-glow) * 0.5) rgba(200, 215, 255, 0.06);
}

.player-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.bars i {
  display: block;
  width: 2.5px;
  background: var(--accent-color);
  border-radius: 1px;
  opacity: .55;
}

.bars i:nth-child(1) { height: 4px; animation: bar .7s ease-in-out infinite 0s; }
.bars i:nth-child(2) { height: 10px; animation: bar .7s ease-in-out infinite .12s; }
.bars i:nth-child(3) { height: 14px; animation: bar .7s ease-in-out infinite .24s; }
.bars i:nth-child(4) { height: 8px; animation: bar .7s ease-in-out infinite .36s; }

/* Bars glow when music is reactive */
body.audio-reactive .bars i {
  box-shadow: 0 0 4px rgba(200, 220, 255, 0.3);
}

.bars.paused i {
  animation: none !important;
  height: 3px !important;
  box-shadow: none !important;
}

.track-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--text-dim);
  transition: color .25s;
}

.track-link:hover { color: var(--accent-color); }

.track-link svg {
  opacity: 0;
  transition: opacity .25s;
  stroke: var(--accent-color);
}

.track-link:hover svg { opacity: 1; }

.player-mid {
  display: flex;
  align-items: center;
  gap: 8px;
}

.t {
  font-size: .6rem;
  color: var(--text-dim);
  min-width: 26px;
  font-variant-numeric: tabular-nums;
}

.t:last-child { text-align: right; }

.prog {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height .15s;
}

.prog:hover { height: 5px; }

.prog-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  border-radius: 3px;
  transition: width .1s linear, box-shadow .2s ease;
}

/* Progress bar glow on music */
body.audio-reactive .prog-fill {
  box-shadow: 0 0 var(--prog-glow) rgba(200, 220, 255, 0.35),
              0 0 calc(var(--prog-glow) * 2) rgba(180, 200, 255, 0.15);
}

.player-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.pbtn {
  color: var(--text-dim);
  padding: 4px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.pbtn:hover {
  color: var(--accent-color);
  background: var(--accent-10);
}

.hide { display: none !important; }

.vol {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.vol input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
}

.vol input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border: none;
  border-radius: 50%;
}

/* ═══ KEYFRAMES ═══ */
@keyframes pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: .8; }
}

@keyframes bar {
  0%, 100% { height: 3px; }
  50% { height: 16px; }
}

@keyframes cardEnter {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(59, 165, 92, 0.4);
  }
  50% {
    box-shadow: 0 0 6px 2px rgba(59, 165, 92, 0.25);
  }
}

/* ═══ REVEAL SCREEN KEYFRAMES ═══ */
@keyframes ringPulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.3;
    border-color: rgba(255, 255, 255, 0.03);
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
    border-color: rgba(200, 215, 255, 0.08);
  }
}

@keyframes orbFloat1 {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.3;
  }
  25% {
    transform: translate(30px, -20px);
    opacity: 0.7;
  }
  50% {
    transform: translate(-15px, -40px);
    opacity: 0.4;
  }
  75% {
    transform: translate(-25px, 10px);
    opacity: 0.8;
  }
}

@keyframes orbFloat2 {
  0%, 100% {
    transform: translate(0, 0);
    opacity: 0.4;
  }
  33% {
    transform: translate(-20px, 35px);
    opacity: 0.7;
  }
  66% {
    transform: translate(25px, -15px);
    opacity: 0.3;
  }
}

@keyframes orbFloat3 {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.2;
  }
  30% {
    transform: translate(15px, 25px) scale(1.3);
    opacity: 0.6;
  }
  60% {
    transform: translate(-30px, 10px) scale(0.8);
    opacity: 0.4;
  }
}

@keyframes shimmerSweep {
  0% {
    width: 0px;
    opacity: 0;
  }
  30% {
    width: 200px;
    opacity: 1;
  }
  70% {
    width: 200px;
    opacity: 1;
  }
  100% {
    width: 0px;
    opacity: 0;
  }
}

@keyframes textBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.95;
  }
}

@keyframes hintPulse {
  0%, 100% {
    opacity: 0.3;
    letter-spacing: 4px;
  }
  50% {
    opacity: 0.75;
    letter-spacing: 6px;
  }
}

/* ═══ STAGGERED ENTRY ═══ */
.main.show .gif-slot    { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .15s both; }
.main.show .avatar-area { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .25s both; }
.main.show .name-block  { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .35s both; }
.main.show .bio         { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .45s both; }
.main.show .socials     { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .55s both; }
.main.show .presence    { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .65s both; }
.main.show .player      { animation: fadeUp .5s cubic-bezier(.16,1,.3,1) .75s both; }

/* ═══ MOBILE ═══ */
@media (max-width: 520px) {
  .avatar-wrap { width: 76px; height: 76px; }
  .avatar-area { margin-top: -38px; }
  .name { font-size: 1.15rem; }
  .bio { padding: 14px 20px; }
  .presence { flex-wrap: wrap; }
  .presence-activity { width: 100%; justify-content: center; }
  .card { border-radius: 14px; }
  .sep { width: 100%; }
}
