:root {
  --bg: #0c0d10;
  --panel: #16171c;
  --panel-2: #1d1f25;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f6f8;
  --muted: #9b9fa9;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 25% 30%, rgba(190, 196, 215, 0.12), transparent 70%),
    radial-gradient(45% 40% at 78% 65%, rgba(150, 156, 180, 0.13), transparent 70%),
    radial-gradient(35% 30% at 55% 15%, rgba(255, 255, 255, 0.06), transparent 70%);
  filter: blur(30px);
  animation: drift 40s ease-in-out infinite alternate;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(5, 5, 8, 0.75) 100%);
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin-top: -100vh;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(56px + env(safe-area-inset-top)) 22px calc(56px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

main:not(.shown) header,
main:not(.shown) .link {
  animation-play-state: paused;
}

.intro {
  position: relative;
  z-index: 1;
  height: 220vh;
  pointer-events: none;
}

.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  will-change: transform, opacity;
}

.hero h2 {
  font-size: clamp(2.8rem, 10vw, 6.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff, #8f939e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rise 1.2s var(--ease) both;
}

.hero p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  animation: rise 1.2s var(--ease) 0.25s both;
}

.cue {
  position: absolute;
  bottom: calc(38px + env(safe-area-inset-bottom));
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  animation: rise 1.2s var(--ease) 0.6s both;
}

.cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: #ffffff;
  animation: cue 1.8s var(--ease) infinite;
}

@keyframes cue {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: rise 0.9s var(--ease) both;
}

.avatar {
  position: relative;
  width: 104px;
  height: 104px;
  border: 0;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, #ffffff, #5d616b, #ffffff, #3a3d45, #ffffff);
  animation: spin 9s linear infinite;
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #14151a center / cover no-repeat;
  font-size: 2.4rem;
  font-weight: 600;
  animation: spin 9s linear infinite reverse;
}

@keyframes spin { to { transform: rotate(360deg); } }

h1 {
  margin-top: 22px;
  font-size: 1.9rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff, #a9adb7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.discord-btn {
  margin-top: 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.discord-btn svg { width: 26px; height: 26px; fill: currentColor; }

.discord-btn:hover {
  transform: translateY(-3px) scale(1.06);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line-strong);
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.1);
}

.discord-btn:active { transform: scale(0.96); }

nav {
  width: 100%;
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  animation: rise 0.8s var(--ease) forwards;
  animation-delay: calc(var(--i) * 80ms + 350ms);
  transform: perspective(800px) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out, background 0.3s, border-color 0.3s, box-shadow 0.35s;
}

.link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}

.link:hover {
  --lift: -3px;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.link:hover::after { transform: translateX(120%); }
.link:active { --lift: 0px; scale: 0.985; }

.link b { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.01em; }
.link small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.8rem; }

.link svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease), stroke 0.3s;
}

.link:hover svg { transform: translate(3px, -3px); stroke: var(--text); }

@keyframes rise {
  from { opacity: 0; translate: 0 22px; }
  to { opacity: 1; translate: 0 0; }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 4, 7, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.overlay.open { opacity: 1; visibility: visible; }

.panel {
  width: 100%;
  max-width: 460px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1b1c22, #131418);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  transform: translateY(26px) scale(0.94);
  transition: transform 0.5s var(--ease);
}

.overlay.open .panel { transform: translateY(0) scale(1); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
}

.panel-head h2 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; }
.panel-head p { margin-top: 3px; color: var(--muted); font-size: 0.85rem; }

.close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.25s, transform 0.3s var(--ease);
}

.close:hover { background: rgba(255, 255, 255, 0.12); transform: rotate(90deg); }

.close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
}

.servers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 20px;
  overflow-y: auto;
}

.server {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  translate: 0 12px;
  transition: background 0.25s, border-color 0.25s, transform 0.35s var(--ease);
}

.overlay.open .server {
  animation: rise 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}

.server:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #2a2c34 center / cover no-repeat;
  font-weight: 650;
  font-size: 1.15rem;
}

.info { flex: 1; min-width: 0; }

.info b {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.loading .info b,
.loading .meta {
  color: transparent;
  border-radius: 6px;
  background: linear-gradient(90deg, #26282f, #34363e, #26282f);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.loading .meta { width: 42%; height: 12px; }

@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  .join { display: none; }
}

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

.link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

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

h1 {
  background: linear-gradient(110deg, #8f939e 20%, #ffffff 45%, #8f939e 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 6s linear infinite;
}

.hero h2 {
  background: linear-gradient(110deg, #8f939e 20%, #ffffff 45%, #8f939e 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation:
    titleIn 1.6s var(--ease) both,
    float 7s ease-in-out 1.6s infinite alternate,
    shine 6s linear infinite;
}

@keyframes shine {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes titleIn {
  from { opacity: 0; filter: blur(22px); scale: 1.25; }
  to { opacity: 1; filter: blur(0); scale: 1; }
}

@keyframes float {
  from { translate: 0 -8px; }
  to { translate: 0 8px; }
}

.avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  animation: halo 3.2s ease-out infinite;
}

@keyframes halo {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.55); }
}

.glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 460px;
  height: 460px;
  margin: -230px 0 0 -230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.11), transparent 65%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s;
  will-change: transform;
}

.glow.show { opacity: 1; }

.spotify-card {
  position: fixed;
  top: auto;
  left: auto;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 7;
  width: 50px;
  height: 50px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: width 0.4s var(--ease), min-height 0.4s var(--ease), transform 0.25s ease-out, background 0.3s, border-color 0.3s, box-shadow 0.35s;
}

.spotify-card::before,
.spotify-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spotify-card::before {
  background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.spotify-card::after {
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}

.spotify-card:hover {
  --lift: -3px;
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.spotify-card:hover::before { opacity: 1; }
.spotify-card:hover::after { transform: translateX(120%); }
.spotify-card:active { scale: 0.985; }
.spotify-card.is-playing { width: min(286px, calc(100vw - 36px)); height: auto; min-height: 76px; justify-content: flex-start; padding: 9px 12px 9px 9px; }
.spotify-card.expanded { width: min(356px, calc(100vw - 36px)); min-height: 116px; }
.spotify-card.is-playing.minimized { width: 50px; height: 50px; min-height: 50px; justify-content: center; padding: 8px; }

.spotify-idle-icon { position: relative; z-index: 1; display: grid; place-items: center; }
.spotify-idle-icon svg { display: block; width: 27px; height: 27px; color: #1ed760; }
.spotify-card.is-playing .spotify-idle-icon { display: none; }
.spotify-card:not(.is-playing) .spotify-copy { display: none; }
.spotify-card.is-playing.minimized .spotify-idle-icon { display: grid; }
.spotify-card.is-playing.minimized .spotify-art,
.spotify-card.is-playing.minimized .spotify-copy { display: none; }

.spotify-art {
  position: relative;
  z-index: 1;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, #263b31, #111714);
  transition: width 0.4s var(--ease), height 0.4s var(--ease);
}

.spotify-card.expanded .spotify-art { width: 88px; height: 88px; }
.spotify-copy { position: relative; z-index: 1; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.spotify-label { display: flex; align-items: center; gap: 6px; color: #c3c8c5; font-size: 0.68rem; line-height: 1.3; }
.spotify-mark { color: #1ed760; font-size: 0.65rem; }
.spotify-title { margin-top: 4px; overflow: hidden; color: #fff; font-size: 0.84rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.spotify-artist { margin-top: 2px; overflow: hidden; color: #aeb4b0; font-size: 0.73rem; text-overflow: ellipsis; white-space: nowrap; }
.spotify-time { display: none; }
.spotify-card.expanded .spotify-time { display: block; margin-top: 5px; color: #9da49f; font-size: 0.66rem; font-variant-numeric: tabular-nums; }

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
}

.profile-overlay.open { opacity: 1; visibility: visible; }

.profile-dialog {
  width: min(404px, 100%);
  max-height: min(760px, calc(100dvh - 32px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #1b1c20;
  color: #f2f3f5;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s var(--ease);
}

.profile-overlay.open .profile-dialog { transform: translateY(0) scale(1); }
.profile-cover { position: relative; height: 142px; background: rgba(5, 6, 8, 0.12); background-position: center; background-size: cover; }
.profile-identity { position: relative; display: flex; align-items: flex-end; gap: 14px; min-height: 94px; padding: 0 24px 18px; }
.profile-avatar-wrap { position: relative; flex: none; width: 88px; height: 88px; margin-top: -42px; padding: 5px; border-radius: 50%; background: #1b1c20; }
.profile-avatar { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #34363e; }
.profile-presence { position: absolute; right: 2px; bottom: 3px; width: 20px; height: 20px; border: 4px solid #1b1c20; border-radius: 50%; background: #80848e; }
.presence-online { background: #23a55a; }
.presence-idle { background: #f0b232; }
.presence-dnd { background: #f23f43; }
.profile-names { flex: 1; min-width: 0; padding-bottom: 3px; }
.profile-names h2 { overflow: hidden; font-size: 1.25rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.profile-names p { margin-top: 3px; color: #b5bac1; font-size: 0.88rem; }
.profile-status-label { flex: none; margin-bottom: 4px; padding: 4px 8px; border-radius: 5px; background: #292a30; color: #c5c7cb; font-size: 0.68rem; }
.profile-content { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.profile-about, .profile-member, .profile-activity, .profile-connections { min-width: 0; padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.profile-connections { border-bottom: 0; }
.profile-content h3 { margin-bottom: 12px; color: #b5bac1; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.profile-about p, .profile-member p { color: #e1e2e5; font-size: 0.88rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.profile-activity-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.profile-activity-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: #30323a; color: #e1e2e5; font-size: 1rem; font-weight: 700; }
.profile-activity-icon img { width: 100%; height: 100%; object-fit: cover; }
.spotify-activity-icon { background: #191414; }
.profile-activity-icon .profile-activity-art { width: 100%; height: 100%; object-fit: cover; }
.profile-activity-detail { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.profile-activity-detail b, .profile-activity-detail span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-activity-detail b { font-size: 0.83rem; }
.profile-activity-detail span, .profile-empty { color: #b5bac1; font-size: 0.75rem; }
@media (max-width: 520px) {
  .profile-overlay { padding: 12px; }
  .profile-dialog { max-height: calc(100dvh - 24px); }
  .profile-cover { height: 116px; }
  .profile-identity { gap: 10px; padding: 0 16px 16px; }
  .profile-avatar-wrap { width: 74px; height: 74px; margin-top: -34px; }
  .profile-names h2 { font-size: 1.08rem; }
  .profile-status-label { display: none; }
  .profile-about, .profile-member, .profile-activity { padding: 16px 18px; }
}

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.servers::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.servers {
  scrollbar-width: none;
}

.glow {
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.035), transparent 70%);
}

.glow {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  background: none;
  z-index: 6;
}

.glow svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.85));
  animation: starSpin 6s linear infinite, starPulse 1.8s ease-in-out infinite alternate;
  transition: scale 0.35s var(--ease);
}

.glow.big svg { scale: 1.7; }

@keyframes starSpin {
  to { rotate: 360deg; }
}

@keyframes starPulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

.glow {
  z-index: 50;
}
