:root {
  --bg: #03040a;
  --ice: #e7f1fb;
  --ice-2: #9fb8d0;
  --glow: rgba(186, 214, 245, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ice);
  font-family: Outfit, system-ui, sans-serif;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

body.live,
body.live * {
  cursor: none;
}

@media (pointer: coarse) {
  body.live,
  body.live * {
    cursor: auto;
  }
  .cursor {
    display: none !important;
  }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 80;
  width: 28px;
  height: 34px;
  margin: -3px 0 0 -3px;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 5px rgba(218, 236, 255, 0.18));
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.cursor svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 4px 4px;
  transition: transform 0.15s ease;
}

body.cursor-hover .cursor {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(218, 236, 255, 0.48));
}

body.cursor-hover .cursor svg {
  transform: scale(0.9);
}

body.live .cursor {
  opacity: 1;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7) contrast(1.12) brightness(0.42);
  transform: scale(1.06);
  z-index: 0;
}

.bg-dim {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(8, 12, 20, 0.12), rgba(2, 3, 8, 0.78) 68%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.72));
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.grain {
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  box-shadow: inset 0 0 220px 50px #000;
}

.scan {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.08) 2px 3px
  );
  opacity: 0.35;
}

.stage {
  position: relative;
  z-index: 5;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 24px;
}

.hidden-until {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}

.stage.in {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.profile {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 360px);
}

.avatar-glow {
  position: absolute;
  top: -10px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(186, 214, 245, 0.28), transparent 68%);
  filter: blur(8px);
  animation: breathe 3.4s ease-in-out infinite;
}

.avatar-wrap {
  position: relative;
  width: 138px;
  height: 138px;
  margin-bottom: 22px;
}

.avatar-spin {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #f4f9ff,
    transparent 22%,
    #7f9db8 48%,
    transparent 72%,
    #f4f9ff
  );
  animation: spin 5.5s linear infinite;
  filter: drop-shadow(0 0 10px var(--glow));
}

.avatar {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #05060c;
  background: #000;
}

.name {
  position: relative;
  margin: 0;
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-shadow: 0 0 calc(18px + var(--music-glow, 0px)) var(--glow);
  overflow: hidden;
  transform: translateY(calc(var(--music-lift, 0) * -1px)) scale(var(--music-scale, 1));
  transition: transform 0.12s ease, text-shadow 0.12s ease;
}

.name::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: shine 4.2s ease-in-out 1.1s infinite;
}

.memory {
  display: grid;
  gap: 3px;
  margin: 0 0 26px;
  color: rgba(231, 241, 251, 0.7);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.memory span {
  opacity: 0;
  transform: translateY(7px);
  animation: line-in 0.55s ease forwards;
}

.stage.in .memory span:nth-child(1) { animation-delay: 0.48s; }
.stage.in .memory span:nth-child(2) { animation-delay: 0.64s; }
.stage.in .memory span:nth-child(3) {
  animation-delay: 0.8s;
  color: var(--ice);
}

.socials {
  display: grid;
  gap: 10px;
  width: 100%;
}

.orb {
  position: relative;
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px 1fr 22px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 0 18px 0 12px;
  border: 1px solid rgba(231, 241, 251, 0.16);
  border-radius: 15px;
  background: linear-gradient(108deg, rgba(231, 241, 251, 0.12), rgba(231, 241, 251, 0.035));
  color: var(--ice);
  font: inherit;
  backdrop-filter: blur(12px);
  text-decoration: none;
  isolation: isolate;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(105deg, rgba(232, 244, 255, 0.18), transparent 56%);
  transition: opacity 0.22s ease;
}

.orb-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 241, 251, 0.16);
  border-radius: 12px;
  background: rgba(2, 4, 10, 0.42);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.orb-icon svg {
  width: 20px;
  height: 20px;
}

.orb-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: left;
}

.orb-copy strong {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.orb-copy small {
  overflow: hidden;
  color: rgba(231, 241, 251, 0.56);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orb-arrow {
  color: rgba(231, 241, 251, 0.58);
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.22s ease, color 0.22s ease;
}

.orb:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(231, 241, 251, 0.52);
  background: rgba(231, 241, 251, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), 0 0 22px rgba(186, 214, 245, 0.16);
}

.orb:hover::before {
  opacity: 1;
}

.orb:hover .orb-arrow {
  color: var(--ice);
  transform: translate(2px, -2px);
}

.watchers {
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ice);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.eye,
.eye svg {
  width: 18px;
  height: 18px;
  display: grid;
}

#viewCount {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.sound {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(231, 241, 251, 0.2);
  border-radius: 50%;
  background: rgba(8, 10, 16, 0.62);
  color: var(--ice);
  backdrop-filter: blur(10px);
}

.sound svg {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: #03040a;
  color: var(--ice);
  font: inherit;
  transition: opacity 0.65s ease;
}

.gate.out {
  opacity: 0;
  pointer-events: none;
}

.clickme {
  font-family: Syne, sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.3rem);
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  text-transform: lowercase;
  text-shadow: 0 0 28px var(--glow);
  animation: pulse 1.7s ease-in-out infinite;
}

.click-line {
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e7f1fb, transparent);
  box-shadow: 0 0 12px var(--glow);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(231, 241, 251, 0.2);
  background: rgba(8, 10, 16, 0.88);
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes shine {
  0%,
  55% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .stage {
    align-items: end;
    padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  }

  .avatar-wrap {
    width: 112px;
    height: 112px;
    margin-bottom: 18px;
  }

  .avatar-glow {
    width: 154px;
    height: 154px;
  }

  .name {
    font-size: clamp(2.15rem, 12vw, 2.8rem);
  }

  .memory {
    margin-bottom: 22px;
    font-size: 0.82rem;
  }

  .sound {
    right: 14px;
    bottom: 14px;
  }

  .watchers {
    margin-top: 17px;
  }
}

@media (max-height: 680px) and (min-width: 481px) {
  .avatar-wrap { width: 112px; height: 112px; margin-bottom: 16px; }
  .memory { margin-bottom: 18px; }
  .watchers { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
