/* ==========================================================================
   Just Dance: Koali Edition — Design System
   A galaxy/nebula visual language: deep space voids, aurora gradients,
   and three signal colors (cyan / magenta / gold) borrowed from the
   provided star + gold-move assets so the UI feels like it belongs to
   the same object language as the in-game HUD.
   ========================================================================== */

@font-face {
  font-family: "Koali Display";
  src: url("../assets/fonts/Black-1.otf") format("opentype");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Koali Display";
  src: url("../assets/fonts/Bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Koali UI";
  src: url("../assets/fonts/Condensed.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Koali Text";
  src: url("../assets/fonts/Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* -- core palette -- */
  --void-0: #05061c;
  --void-1: #0a0d2e;
  --void-2: #11154a;
  --nebula-purple: #7a3bf0;
  --nebula-blue: #2e5cf2;
  --cyan: #2fe4e0;
  --cyan-dim: #1c8f92;
  --magenta: #ff3ea8;
  --gold: #ffd23f;
  --gold-dim: #b98f1d;
  --ink: #f4f2ff;
  --ink-dim: #a9a6d6;
  --ink-faint: #6a6798;

  /* -- glass / surfaces -- */
  --panel: rgba(20, 20, 58, 0.55);
  --panel-border: rgba(160, 150, 255, 0.18);
  --panel-solid: #12123a;

  /* -- type scale -- */
  --step-1: clamp(0.8rem, 0.77rem + 0.15vw, 0.9rem);
  --step-2: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --step-3: clamp(1.3rem, 1.2rem + 0.5vw, 1.7rem);
  --step-4: clamp(1.9rem, 1.6rem + 1.4vw, 2.8rem);
  --step-5: clamp(2.6rem, 2.1rem + 2.4vw, 4.2rem);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 26px;
  --ease: cubic-bezier(0.22, 0.68, 0, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Koali Text", system-ui, sans-serif;
  color: var(--ink);
  background: var(--void-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Koali Display", sans-serif;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.02;
}

.ui-label {
  font-family: "Koali UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}

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

/* -- Space backdrop: nebula blobs + canvas starfield, shared across pages -- */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(122, 59, 240, 0.35), transparent 60%),
    radial-gradient(55% 45% at 90% 15%, rgba(46, 92, 242, 0.30), transparent 60%),
    radial-gradient(70% 60% at 50% 100%, rgba(47, 228, 224, 0.14), transparent 60%),
    var(--void-0);
}
#starfield { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* -- Top navigation -- */
.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(18px, 4vw, 48px);
  position: relative;
  z-index: 5;
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: "Koali Display", sans-serif;
  font-size: var(--step-3);
}
.topnav .brand .dot { color: var(--cyan); }
.topnav nav { display: flex; gap: 6px; align-items: center; }
.topnav nav a {
  font-family: "Koali UI", sans-serif;
  font-size: var(--step-1);
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  padding: 10px 14px;
  border-radius: var(--radius-s);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.topnav nav a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.topnav nav a.active { color: var(--void-0); background: var(--cyan); }
.topnav .profile {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}
.profile .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--nebula-blue), var(--magenta));
  display: flex; align-items: center; justify-content: center;
  font-family: "Koali Display"; font-size: 14px;
}
.profile .name { font-family: "Koali UI"; font-size: var(--step-1); letter-spacing: 0.04em; }

/* -- Buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  font-family: "Koali UI", sans-serif;
  font-size: var(--step-1);
  letter-spacing: 0.05em;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(120deg, var(--cyan), #7cf5e6);
  color: #032323;
  box-shadow: 0 8px 24px rgba(47, 228, 224, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px rgba(47, 228, 224, 0.4); }
.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--cyan); }
.btn-magenta {
  background: linear-gradient(120deg, var(--magenta), #ff8fd0);
  color: #2b0018;
  box-shadow: 0 8px 24px rgba(255, 62, 168, 0.28);
}
.btn-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--panel-border); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}

/* -- Panels / cards -- */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-l);
  backdrop-filter: blur(18px);
}

.song-card {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--void-2);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.song-card:hover { transform: translateY(-6px); border-color: var(--cyan); }
.song-card img.cover { width: 100%; height: 100%; object-fit: cover; }
.song-card .gradient {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(5,6,28,0.92) 0%, rgba(5,6,28,0.1) 55%, transparent 75%);
}
.song-card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; }
.song-card .title { font-family: "Koali Display"; font-size: var(--step-2); }
.song-card .difficulty { display: flex; gap: 3px; margin-top: 6px; }
.song-card .bar { width: 14px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.25); }
.song-card .bar.on { background: var(--cyan); }
.song-card .fav {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(5,6,28,0.6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.song-card .fav.is-fav, .fav.is-fav { color: var(--magenta); }

/* Previews stay alive on their own — used on song grid covers and the
   song-detail hero so browsing always feels animated, no click required. */
.song-card img.cover {
  animation: cardzoom 9s ease-in-out infinite alternate;
}
@keyframes cardzoom { from { transform: scale(1); } to { transform: scale(1.09); } }

/* -- section headers -- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 40px clamp(18px,4vw,48px) 16px;
}
.section-head h2 { font-size: var(--step-3); }
.section-head .see-all { font-family: "Koali UI"; font-size: var(--step-1); color: var(--cyan); }

.grid {
  display: grid;
  gap: 20px;
  padding: 0 clamp(18px,4vw,48px) 40px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* -- scrollbar -- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 48px); }

.tag {
  font-family: "Koali UI"; font-size: 12px; letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: var(--ink-dim);
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 720px) {
  .topnav nav { display: none; }
  .section-head { margin: 28px 16px 12px; }
  .grid { padding: 0 16px 28px; grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
}
