
:root {
  --bg: #090711;
  --panel: #14111f;
  --panel-light: #1c172b;
  --purple: #a855f7;
  --pink: #ec4899;
  --text: #f8f5ff;
  --muted: #a9a2ba;
  --line: rgba(255,255,255,.09);
}

* { box-sizing: border-box; }

html { background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #d8b4fe;
  outline-offset: 3px;
}
.hidden { display: none !important; }

.app {
  width: 100%;
  max-width: 620px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: 94px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 90% 0%, rgba(112, 48, 180, .11), transparent 32%),
    var(--bg);
}

.topbar {
  height: 68px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(9,7,17,.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.2px;
}
.brand b { color: #c084fc; }

.brand-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #a855f7, #5724a8 70%, #24123c);
  box-shadow: 0 0 22px #9333ea42;
  font-size: 12px;
  color: white;
}

.round-button {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: white;
  background: #ffffff08;
  font-size: 24px;
}

.search-panel { padding: 12px 20px; }
.search-panel input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #423054;
  border-radius: 12px;
  color: white;
  background: var(--panel);
}

.hero {
  min-height: 410px;
  margin: 16px 14px 0;
  padding: 28px 22px;
  border-radius: 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(9,7,17,.98) 0%, rgba(14,8,30,.91) 45%, rgba(20,8,43,.25) 100%),
    url("https://images.unsplash.com/photo-1470252649378-9c29740c9fa8?auto=format&fit=crop&w=1000&q=85") center/cover,
    #211337;
  border: 1px solid #a855f733;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #0c0819, transparent 40%);
}

.hero-content { max-width: 310px; position: relative; z-index: 1; }
.eyebrow {
  color: #c084fc;
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
}
.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(35px, 9vw, 51px);
  line-height: .99;
  letter-spacing: -2px;
}
.hero h1 span {
  color: #c084fc;
  text-shadow: 0 0 24px #a855f755;
}
.hero p, .page-heading p {
  color: #c1bacf;
  line-height: 1.65;
  font-size: 13px;
}
.primary-button {
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  color: white;
  background: linear-gradient(110deg, #9333ea, #6d28d9);
  box-shadow: 0 7px 24px #7e22ce35;
  font-weight: 750;
}
.hero .primary-button { margin-top: 12px; font-size: 12px; }
.hero .primary-button span { margin-left: 9px; }
.hero-caption {
  position: absolute;
  bottom: 15px;
  left: 20px;
  color: #bcb0d3;
  font-size: 8px;
  letter-spacing: 1.6px;
}
.hero-caption span { color: #d946ef; padding: 0 5px; }
.hero-orb {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -75px;
  top: 55px;
  border-radius: 50%;
  border: 1px solid #c084fc3b;
  box-shadow: 0 0 65px #9333ea25, inset 0 0 45px #9333ea18;
}

.section { margin-top: 32px; }
.section-heading {
  padding: 0 20px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}
.section-heading h2, .page-heading h1 {
  margin: 7px 0 0;
  font-size: 23px;
  letter-spacing: -.7px;
}
.text-button {
  color: #c084fc;
  background: none;
  border: 0;
  white-space: nowrap;
  font-size: 11px;
  padding: 8px 0;
}
.horizontal-list {
  display: flex;
  gap: 13px;
  padding: 0 20px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.horizontal-list::-webkit-scrollbar, .filter-list::-webkit-scrollbar { display: none; }

.audio-card {
  min-width: 145px;
  max-width: 145px;
  scroll-snap-align: start;
}
.cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 14px;
  background: #241436;
  border: 1px solid #ffffff12;
  cursor: pointer;
}
.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
  transition: transform .35s;
}
.cover:hover::before { transform: scale(1.05); }
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #09071100 10%, #0907111c 40%, #090711ed 100%);
}
.cover-label {
  position: absolute;
  top: 11px;
  left: 10px;
  padding: 5px 7px;
  border-radius: 5px;
  background: #09071199;
  color: #e9d5ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}
.cover-title {
  position: absolute;
  bottom: 30px;
  left: 11px;
  right: 10px;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 900;
  text-shadow: 0 2px 12px #000;
}
.cover-category {
  position: absolute;
  bottom: 12px;
  left: 11px;
  color: #d8b4fe;
  font-size: 9px;
  font-weight: 700;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 9px;
}
.card-duration { color: var(--muted); font-size: 10px; }
.favorite-button {
  background: none;
  color: #d8b4fe;
  border: 0;
  padding: 3px 5px;
  font-size: 20px;
}
.card-subtitle {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 5px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  padding: 0 20px;
}
.category-tile {
  min-height: 85px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: white;
  text-align: left;
  background: linear-gradient(135deg, #241633, #12101c);
  position: relative;
  overflow: hidden;
}
.category-tile::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  right: -15px;
  bottom: -25px;
  border-radius: 50%;
  background: var(--tile-color, #a855f7);
  filter: blur(30px);
  opacity: .45;
}
.category-tile strong { display: block; font-size: 13px; position: relative; z-index: 1; }
.category-tile small { display: block; color: var(--muted); margin-top: 7px; font-size: 10px; position: relative; z-index: 1; }

.page-view { padding-top: 26px; }
.page-heading { padding: 0 20px 20px; }
.page-heading h1 { font-size: 30px; }
.filter-list {
  display: flex;
  gap: 8px;
  padding: 0 20px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chip {
  flex-shrink: 0;
  border: 1px solid #3a2b4c;
  border-radius: 22px;
  padding: 9px 13px;
  color: #d0c6df;
  background: #151020;
  font-size: 11px;
}
.filter-chip.active { background: #7e22ce; border-color: #a855f7; color: white; }
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 22px 13px;
  padding: 0 20px 30px;
}
.library-card { min-width: 0; }
.library-card .cover { aspect-ratio: 3/4; }
.library-card .cover-title { font-size: 17px; }
.library-card .card-meta { margin-top: 7px; }
.empty-message { text-align: center; color: var(--muted); padding: 35px 25px; font-size: 13px; }

.bottom-nav {
  width: min(100%, 620px);
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  background: rgba(14,11,23,.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav-item {
  border: 0;
  background: transparent;
  color: #81798f;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px;
}
.nav-item span { font-size: 22px; line-height: 1.2; }
.nav-item small { font-size: 9px; }
.nav-item.active { color: #c084fc; }

.settings-card {
  margin: 0 20px 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
}
.settings-card label, .settings-card h3 { display: block; margin: 0 0 10px; font-size: 13px; font-weight: 750; }
.settings-card select, .player-options select {
  width: 100%;
  color: white;
  background: #21182e;
  border: 1px solid #49365e;
  border-radius: 10px;
  padding: 12px;
}
.setting-note, .settings-card p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.full-button { width: 100%; margin-top: 12px; }

.player {
  position: fixed;
  z-index: 50;
  inset: 0;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  overflow-y: auto;
  padding: max(15px, env(safe-area-inset-top)) 22px 25px;
  background: linear-gradient(180deg, #1b1030 0%, #0c0915 55%, #090711 100%);
}
.player-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-size: cover;
  background-position: center;
  filter: blur(50px);
}
.player-header, .player-info, .player-options, .time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.player-header { position: relative; }
.player-header-label { font-size: 9px; letter-spacing: 2px; color: #c8b5e1; font-weight: 800; }
.player-cover {
  width: min(70vw, 310px);
  max-width: 100%;
  aspect-ratio: 3/4;
  margin: 25px auto 25px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #ffffff18;
  box-shadow: 0 18px 60px #0007;
  background: #241436;
}
.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
}
.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #09071100 25%, #090711eF 100%);
}
.cover-kicker { font-size: 9px; letter-spacing: 2px; color: #e9d5ff; font-weight: 900; }
.player-cover h2 { margin: 10px 0; font-size: 28px; line-height: 1.05; text-shadow: 0 2px 15px black; }
.player-cover .cover-category { position: static; }
.player-info { margin-bottom: 20px; }
.player-info h2 { font-size: 18px; margin: 0 0 5px; }
.player-info p { font-size: 11px; margin: 0; color: var(--muted); }
.audio-mode {
  border: 1px solid #a855f744;
  border-radius: 8px;
  padding: 7px 9px;
  color: #d8b4fe;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.progress-area input { width: 100%; accent-color: #c084fc; }
.time-row { color: var(--muted); font-size: 10px; }
.player-controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin: 20px 0; }
.control-button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #ffffff08; color: white; font-size: 19px;
}
.play-button {
  width: 64px; height: 64px; border: 0; border-radius: 50%;
  background: linear-gradient(140deg, #c084fc, #7e22ce); color: white;
  font-size: 23px; box-shadow: 0 0 28px #9333ea50;
}
.player-options { margin-top: 20px; }
.player-options label { color: var(--muted); font-size: 11px; width: 95px; }
.player-options select { margin-top: 7px; }
.secondary-button {
  padding: 11px 12px; border-radius: 11px; border: 1px solid #61437c;
  color: #e9d5ff; background: #241633; font-size: 11px;
}
.player-message { text-align: center; font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 20px; }
.lock-overlay {
  position: fixed; z-index: 100; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; text-align: center; background: #090711f5; backdrop-filter: blur(20px);
}
.lock-symbol {
  width: 78px; height: 78px; display: grid; place-items: center;
  border-radius: 50%; background: #241633; color: #d8b4fe; font-size: 32px;
  border: 1px solid #a855f755;
}
.lock-overlay h2 { margin: 22px 0 5px; }
.lock-overlay p { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 270px; }
.lock-overlay button { margin-top: 18px; }

@media (min-width: 621px) {
  body { padding: 0 0 30px; }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .player { left: 50%; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (max-width: 360px) {
  .hero { padding: 22px 16px; min-height: 380px; }
  .hero h1 { font-size: 35px; }
  .audio-card { min-width: 132px; max-width: 132px; }
  .player { padding-left: 16px; padding-right: 16px; }
}
