/* BeatDesk — site-wide design system (Spotify polish, BeatDesk colors) */

:root {
  --bd-violet: #7c3aed;
  --bd-violet-light: #a78bfa;
  --bd-violet-dark: #5b21b6;
  --bd-teal: #34d399;
  --bd-coral: #e879f9;
  --bd-cream: #f5f3ff;
  --bd-cream-muted: #b6afcc;
  --bd-ink: #07040f;
  --bd-ink-light: #130d25;
  --bd-surface: #181818;
  --bd-surface-raised: #1f1238;
  --bd-border: rgba(167, 139, 250, 0.2);
  --bd-radius-lg: 12px;
  --bd-radius-xl: 16px;
  --bd-shadow-card: 0 8px 32px rgba(7, 4, 15, 0.45);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bd-ink);
  color: var(--bd-cream);
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
}

::selection {
  background: rgba(124, 58, 237, 0.45);
  color: #fff;
}

.site-header {
  background: rgba(7, 4, 15, 0.82) !important;
  border-bottom-color: var(--bd-border) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 9999px;
}

.nav-link--active {
  background: rgba(124, 58, 237, 0.22) !important;
  color: var(--bd-cream) !important;
}

.btn-primary {
  min-height: 2.75rem;
}

.btn-secondary {
  color: var(--bd-cream);
  border: 1px solid var(--bd-border);
  border-radius: 9999px;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}

.action-chip {
  min-height: 2.5rem;
}

.filter-pill {
  font-weight: 600;
  min-height: 2.25rem;
}

/* Square playlist covers */
.playlist-card {
  background: var(--bd-surface-raised) !important;
  border-radius: var(--bd-radius-lg) !important;
  border-color: var(--bd-border) !important;
}

.playlist-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bd-shadow-card);
  border-color: rgba(167, 139, 250, 0.38) !important;
}

.playlist-card-art {
  aspect-ratio: 1 / 1 !important;
  width: 100% !important;
  height: auto !important;
  background-size: cover !important;
  background-position: center !important;
}

.playlist-card-art.h-28,
.playlist-card-art.h-36 {
  height: auto !important;
}

.playlist-card-play {
  width: 2.75rem !important;
  height: 2.75rem !important;
}

.page-hero {
  background: linear-gradient(180deg, rgba(31, 18, 56, 0.55) 0%, transparent 100%) !important;
  border-bottom-color: var(--bd-border) !important;
}

.text-gradient {
  background: linear-gradient(135deg, #c4b5fd, #7c3aed, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Playlist detail — Spotify-style header (new layout classes) */
.game-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(91, 33, 182, 0.55) 0%,
    rgba(19, 13, 37, 0.92) 55%,
    var(--bd-ink) 100%
  );
  pointer-events: none;
}

.game-hero-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  margin-top: 1rem;
}

.game-hero-cover {
  width: min(72vw, 220px);
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.game-hero-meta {
  min-width: 0;
  width: 100%;
}

.game-hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.game-hero-type {
  margin: 0.75rem 0 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bd-cream);
}

.game-hero-title {
  margin: 0.35rem 0 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--bd-cream);
  word-break: break-word;
}

.game-hero-desc {
  margin: 0.5rem auto 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--bd-cream-muted);
}

.game-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 1rem;
}

.bd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(245, 243, 255, 0.72);
  transition: color 0.15s;
}

.bd-back-link:hover {
  color: var(--bd-cream);
}

.bd-tier-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid transparent;
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bd-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(245, 243, 255, 0.65);
}

@media (min-width: 768px) {
  .game-hero-layout {
    flex-direction: row;
    align-items: flex-end;
    text-align: left;
    gap: 1.5rem;
  }

  .game-hero-cover {
    width: 192px;
  }

  .game-hero-badges,
  .game-hero-actions {
    justify-content: flex-start;
  }

  .game-hero-desc {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 1024px) {
  .game-hero-cover {
    width: 232px;
  }

  .game-hero-title {
    font-size: 2.5rem;
  }
}

.stat-card,
.flow-card {
  background: rgba(31, 18, 56, 0.65) !important;
  border-color: var(--bd-border) !important;
  border-radius: var(--bd-radius-lg) !important;
}

.empty-state {
  border-radius: var(--bd-radius-lg);
  border-color: var(--bd-border);
}

.admin-playlist-thumb,
.admin-cover-preview {
  aspect-ratio: 1 / 1 !important;
  width: 100%;
  max-width: 200px;
  height: auto !important;
  border-radius: 8px;
  background-size: cover !important;
  background-position: center !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--bd-violet-light);
  outline-offset: 2px;
}

/* Legacy playlist hero — square cover, Spotify-style layout */
.game-hero--detail {
  position: relative;
  min-height: 0 !important;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  gap: 0;
  background: linear-gradient(
    180deg,
    rgba(91, 33, 182, 0.55) 0%,
    rgba(19, 13, 37, 0.92) 55%,
    var(--bd-ink) 100%
  ) !important;
  border-bottom: 1px solid var(--bd-border);
  padding-bottom: 1.5rem;
}

.game-hero--detail .game-hero-overlay {
  display: none !important;
}

.game-hero--detail .relative.mx-auto {
  display: contents;
}

.game-hero--detail .relative.mx-auto > a.inline-flex {
  grid-row: 1;
  padding: 1.5rem max(1rem, calc((100% - 72rem) / 2 + 1rem)) 0.75rem;
  color: rgba(245, 243, 255, 0.72);
  font-weight: 600;
}

.game-hero--detail .relative.mx-auto > a.inline-flex:hover {
  color: var(--bd-cream);
}

.game-hero--detail .game-hero-bg {
  position: relative !important;
  inset: auto !important;
  grid-row: 2;
  width: min(72vw, 220px) !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
  background-size: cover !important;
  background-position: center !important;
}

.game-hero--detail .mt-5.flex {
  grid-row: 3;
  margin-top: 1.25rem !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center;
  gap: 1.25rem !important;
  padding-inline: max(1rem, calc((100% - 72rem) / 2 + 1rem));
}

.game-hero--detail h1 {
  font-family: "Sora", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.game-hero--detail .action-chip {
  min-height: 2.75rem;
  font-weight: 600;
}

@media (min-width: 768px) {
  .game-hero--detail {
    grid-template-columns: 192px 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 1.5rem;
    row-gap: 0;
    align-items: end;
    padding-inline: max(1rem, calc((100% - 72rem) / 2 + 1rem));
    padding-bottom: 2rem;
  }

  .game-hero--detail .relative.mx-auto > a.inline-flex {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 1.5rem 0 0.75rem;
  }

  .game-hero--detail .game-hero-bg {
    grid-column: 1;
    grid-row: 2;
    width: 192px !important;
    margin: 0 !important;
    justify-self: start;
  }

  .game-hero--detail .mt-5.flex {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0 !important;
    align-items: flex-start !important;
    text-align: left;
    padding-inline: 0;
    padding-bottom: 0.25rem;
  }

  .game-hero--detail .mt-5.flex > div:first-child {
    width: 100%;
  }

  .game-hero--detail .mt-5.flex > div:last-child {
    margin-top: 0.5rem;
  }
}

@media (min-width: 1024px) {
  .game-hero--detail {
    grid-template-columns: 232px 1fr;
  }

  .game-hero--detail .game-hero-bg {
    width: 232px !important;
  }
}

/* Nav & footer */
.site-footer {
  border-top: 1px solid var(--bd-border);
  background: rgba(7, 4, 15, 0.9);
}

.logo-mark {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.btn-primary {
  background: linear-gradient(135deg, var(--bd-violet) 0%, #6d28d9 100%) !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45);
}

.filter-pill--active {
  background: rgba(124, 58, 237, 0.28) !important;
  border-color: rgba(167, 139, 250, 0.45) !important;
  color: var(--bd-cream) !important;
}

.modal-panel {
  border-color: var(--bd-border) !important;
  border-radius: var(--bd-radius-xl) !important;
  background: var(--bd-ink-light) !important;
}

.modal-header {
  border-bottom-color: var(--bd-border) !important;
}

.scrollbar-hide {
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.stagger-children > * {
  transition: transform 0.2s ease;
}

.section-kicker,
.eyebrow {
  letter-spacing: 0.12em;
}

.hero-proof {
  gap: 1.25rem;
}

/* Playlist cards — typography & spacing */
.playlist-card-body {
  padding: 1rem 1.125rem 1.125rem !important;
}

.playlist-card-body h3 {
  font-family: "Sora", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.playlist-card:hover .playlist-card-body h3 {
  color: var(--bd-cream) !important;
}

.playlist-card-shine {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.playlist-card:hover .playlist-card-shine {
  opacity: 1;
}

/* Home & library heroes */
.page-hero {
  position: relative;
  overflow: hidden;
}

.page-hero .hero-orb {
  opacity: 0.55;
  filter: blur(40px);
}

.page-hero h1,
.page-hero .font-display {
  font-family: "Sora", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.page-hero .section-kicker {
  color: var(--bd-teal);
  font-weight: 700;
}

/* How-it-works flow */
.flow-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.flow-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.35) !important;
  box-shadow: var(--bd-shadow-card);
}

.flow-step {
  font-family: "Sora", system-ui, sans-serif;
}

/* Action chips — clearer tap targets */
.action-chip {
  min-height: 2.75rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: background 0.2s, transform 0.15s, border-color 0.2s;
}

.action-chip:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(167, 139, 250, 0.35) !important;
}

/* Playlist grid — consistent gutters */
.playlist-grid,
[class*="grid"][class*="gap-"] .playlist-card {
  height: 100%;
}

/* Tier badges — BeatDesk palette */
.bg-teal-500\/20 {
  background: rgba(52, 211, 153, 0.15) !important;
}

.text-teal-300 {
  color: #6ee7b7 !important;
}

.border-teal-500\/30 {
  border-color: rgba(52, 211, 153, 0.35) !important;
}

/* Admin polish */
.admin-playlist-row,
.admin-song-row {
  border-color: var(--bd-border) !important;
  border-radius: var(--bd-radius-lg) !important;
}

.admin-input,
.admin-label {
  font-size: 0.9375rem;
}

.admin-btn-secondary {
  border-radius: 9999px;
  font-weight: 600;
}
