/* ============================================================
   Tokens
   ============================================================ */
:root {
  --void: #0a0712;
  --sky-top: #150c29;
  --sky-mid: #3a1c66;
  --bloom: #c9a6ff;
  --ember: #ff9fd6;
  --card-bg: rgba(21, 13, 36, 0.55);
  --card-border: rgba(255, 255, 255, 0.09);
  --glass-hi: rgba(255, 255, 255, 0.06);
  --ink: #f4eeff;
  --ink-dim: #b3a2d6;
  --ink-faint: #7c6da0;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: "Instrument Serif", serif;
  --font-body: "Sora", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--void);
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100vh; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--bloom);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   Ambient sky background
   ============================================================ */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, var(--sky-mid) 0%, var(--sky-top) 45%, var(--void) 85%);
}

.cloud-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  object-fit: cover;
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 0.5;
  filter: blur(2px) saturate(1.1);
  mix-blend-mode: screen;
}
.cloud-layer--back {
  animation: driftA 70s var(--ease) infinite alternate;
  opacity: 0.35;
}
.cloud-layer--front {
  animation: driftB 46s var(--ease) infinite alternate;
  opacity: 0.4;
}

@keyframes driftA {
  from { transform: translate(-52%, -48%) scale(1.08) rotate(0deg); }
  to   { transform: translate(-48%, -52%) scale(1.15) rotate(1.5deg); }
}
@keyframes driftB {
  from { transform: translate(-49%, -51%) scale(1.05) rotate(0deg); }
  to   { transform: translate(-51%, -49%) scale(1.12) rotate(-1.5deg); }
}

.horizon-glow {
  position: absolute;
  left: 50%;
  bottom: -20%;
  width: 140%;
  height: 60%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 159, 214, 0.22), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ============================================================
   Enter gate
   ============================================================ */
.enter-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 10%, var(--sky-mid) 0%, var(--void) 70%);
  cursor: pointer;
  transition: opacity 0.9s var(--ease), visibility 0.9s var(--ease);
}
.enter-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  transition: transform 0.9s var(--ease), opacity 0.7s var(--ease);
}
.enter-screen.hidden .enter-content {
  transform: scale(0.85);
  opacity: 0;
}

.enter-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 0deg, var(--bloom), var(--ember), var(--bloom));
  animation: spin 6s linear infinite;
  box-shadow: 0 0 40px rgba(201, 166, 255, 0.35);
}
.enter-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--void);
  background: #1a1030;
}
@keyframes spin { to { transform: rotate(360deg); } }

.enter-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ============================================================
   Page / card
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px 60px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s var(--ease) 0.15s, transform 0.8s var(--ease) 0.15s;
}
.page.revealed {
  opacity: 1;
  transform: translateY(0);
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
}

/* Banner + avatar */
.banner {
  position: relative;
  height: 128px;
  background: linear-gradient(180deg, var(--sky-mid), var(--card-bg));
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 7, 18, 0) 40%, rgba(15, 9, 27, 0.9) 100%);
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 28px 22px;
}

.avatar-wrap {
  margin-top: -52px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--bloom), var(--ember));
  box-shadow: 0 0 0 6px var(--card-bg), 0 0 30px rgba(201, 166, 255, 0.3);
  animation: glowPulse 4s ease-in-out infinite;
}
.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #150c29;
  background: #1a1030;
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 6px var(--card-bg), 0 0 24px rgba(201, 166, 255, 0.28); }
  50%      { box-shadow: 0 0 0 6px var(--card-bg), 0 0 42px rgba(255, 159, 214, 0.38); }
}

.name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  margin: 14px 0 2px;
  letter-spacing: 0.01em;
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-dim);
  margin: 0 0 18px;
}

.socials {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--glass-hi);
  border: 1px solid var(--card-border);
  color: var(--ink);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.social-link:hover, .social-link:focus-visible {
  transform: translateY(-3px);
  background: rgba(201, 166, 255, 0.16);
  box-shadow: 0 8px 18px -6px rgba(201, 166, 255, 0.45);
}
.social-link svg { width: 16px; height: 16px; fill: currentColor; }

/* ============================================================
   Player
   ============================================================ */
.player {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 6px 20px 0;
  padding: 12px;
  background: var(--glass-hi);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}
.player-cover {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1a1030;
}
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
}

.player-info { flex: 1; min-width: 0; }
.track-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist {
  margin: 1px 0 8px;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: linear-gradient(160deg, var(--bloom), var(--ember));
  color: #17092b;
}
.play-btn svg { fill: currentColor; }

.seek {
  flex: 1;
  padding: 8px 0;
}
.seek-track {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}
.seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--bloom), var(--ember));
}
.seek-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.time {
  font-size: 11px;
  color: var(--ink-faint);
  min-width: 32px;
  text-align: right;
}

/* ============================================================
   Stats row
   ============================================================ */
.stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 20px 0;
}
.like-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--glass-hi);
  color: var(--ink-dim);
  font-size: 13px;
  transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}
.like-btn .heart { fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill 0.2s, stroke 0.2s; }
.like-btn.liked { color: var(--ember); }
.like-btn.liked .heart { fill: var(--ember); stroke: var(--ember); }
.like-btn:active { transform: scale(0.94); }
.like-btn.burst .heart { animation: heartPop 0.4s var(--ease); }
@keyframes heartPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.discord-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--glass-hi);
  font-size: 12px;
  color: var(--ink-dim);
}
.discord-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57f287;
  box-shadow: 0 0 6px #57f287;
}

/* ============================================================
   Comments
   ============================================================ */
.comments {
  margin: 22px 20px 0;
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
}
.comments-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--ink-dim);
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  resize: none;
}
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--ink-faint); }
.comment-form button {
  align-self: flex-end;
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--bloom), var(--ember));
  color: #17092b;
  font-weight: 600;
  font-size: 13px;
}

.comments-empty {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0 0 8px;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  line-height: 1.5;
}
.comment-item .c-name {
  font-weight: 600;
  color: var(--bloom);
  margin-right: 6px;
}
.comment-item .c-time {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-faint);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 18px 0 24px;
  font-size: 11px;
  color: var(--ink-faint);
}
.footer-heart { color: var(--ember); }

/* ============================================================
   External link modal
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 3, 10, 0.72);
  backdrop-filter: blur(4px);
  padding: 20px;
}
.modal-box {
  width: 100%;
  max-width: 340px;
  background: #180f2c;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 8px;
}
.modal-body {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 0 0 6px;
  line-height: 1.5;
}
.modal-url {
  font-size: 12px;
  color: var(--bloom);
  word-break: break-all;
  margin: 0 0 18px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-ghost, .btn-solid {
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--card-border);
}
.btn-solid {
  background: linear-gradient(160deg, var(--bloom), var(--ember));
  color: #17092b;
}

/* ============================================================
   Motion & accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .cloud-layer, .enter-ring, .enter-label, .avatar-wrap {
    animation: none !important;
  }
  .page, .enter-screen, .enter-content {
    transition: none !important;
  }
}

/* ============================================================
   Small screens
   ============================================================ */
@media (max-width: 380px) {
  .name { font-size: 27px; }
  .player { margin: 6px 14px 0; }
  .stats, .comments { margin-left: 14px; margin-right: 14px; }
}
