:root {
  --bg-deep: #05080f;
  --bg-mid: #0a1628;
  --bg-soft: #12263d;
  --ink: #f5f0e6;
  --muted: #9aabbf;
  --accent: #d4a017;
  --accent-2: #e8c547;
  --gold-deep: #a67c00;
  --danger: #ff6b6b;
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(18, 60, 110, 0.45), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(212, 160, 23, 0.18), transparent 50%),
    linear-gradient(160deg, var(--bg-deep), var(--bg-mid) 45%, #000000);
  min-height: 100vh;
}

#app { min-height: 100vh; position: relative; }
.view { display: none; min-height: 100vh; }
.view.active { display: block; animation: rise 0.45s ease; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0.4rem 0;
}
.brand-logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 12px 36px rgba(0,0,0,0.4); }
.brand-logo.sm { width: 64px; height: 64px; border-radius: 16px; }
.splash-tag { color: var(--muted); margin: 0.25rem 0 0; letter-spacing: 0.04em; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.7rem; color: var(--accent); margin: 0; }
.muted, .lead-text { color: var(--muted); }
.app-page-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 1.5rem 1rem 2rem;
  letter-spacing: 0.06em;
}
.auth-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
}
.auth-head img { border-radius: 10px; }
.auth-head h2 { margin: 0; font-family: var(--font-display); }
.splash-view {
  display: none;
  place-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.splash-view.active { display: grid; }
.splash-glow {
  position: absolute;
  inset: 20% 10%;
  background: radial-gradient(circle, rgba(212,160,23,0.28), transparent 70%);
  filter: blur(20px);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}
.splash-content { position: relative; z-index: 1; }
.splash-loader {
  width: 42px; height: 42px; margin: 1.5rem auto 0;
  border: 3px solid rgba(245,240,230,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.welcome-panel, .auth-panel {
  max-width: 460px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}
.cta-row { display: grid; gap: 0.75rem; margin-top: 2rem; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0800;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #0a0800; }
.btn-outline-light { border-color: rgba(245,240,230,0.35); }
.form-control {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink);
}
.form-control:focus {
  background: rgba(255,255,255,0.09);
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(212,160,23,0.25);
}

.shell-view { padding-bottom: 160px; }
.app-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem 0.55rem;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  background: rgba(5,8,15,0.82);
  border-bottom: 1px solid rgba(212,160,23,0.14);
  z-index: 5;
}
.app-top-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.top-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}
.app-top h1 { font-family: var(--font-display); font-size: 1.35rem; margin: 0; }
.page-scroll { padding: 0.5rem 1.1rem 2rem; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.4rem 0 0.7rem;
}
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 160px);
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x mandatory;
}
.rail::-webkit-scrollbar { height: 0; }
.tile {
  scroll-snap-align: start;
  background: linear-gradient(180deg, rgba(18,38,61,0.85), rgba(5,8,15,0.9));
  border: 1px solid rgba(212,160,23,0.12);
  border-radius: var(--radius);
  padding: 0.7rem;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tile:hover { transform: translateY(-3px); border-color: rgba(212,160,23,0.55); }
.tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: #12263d;
  margin-bottom: 0.55rem;
}
.tile strong, .list-row strong { display: block; font-size: 0.92rem; }
.tile small, .list-row small { color: var(--muted); }

.banner-rail { grid-auto-columns: minmax(260px, 85%); }
.banner-tile {
  min-height: 140px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #0a1628, #3a2d12);
  display: grid;
  align-content: end;
  padding: 1rem;
  border: 1px solid rgba(212,160,23,0.2);
}
.banner-tile img { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; margin: 0; }

.list-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
}
.list-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #12263d; }

.bottom-nav {
  position: fixed;
  left: 0.55rem;
  right: 0.55rem;
  bottom: calc(0.45rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  padding: 0.4rem 0.35rem;
  background: linear-gradient(180deg, rgba(10,22,40,0.96), rgba(0,0,0,0.98));
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(14px);
  z-index: 20;
}
.nav-item {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.2rem 0.3rem;
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  border-radius: 14px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.nav-item .nav-ico {
  width: 36px;
  height: 28px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 999px;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.nav-item .nav-ico svg {
  width: 22px;
  height: 22px;
  grid-area: 1 / 1;
}
.nav-item .ico-fill { opacity: 0; transform: scale(0.86); transition: opacity 0.16s ease, transform 0.16s ease; }
.nav-item .ico-outline { opacity: 1; transition: opacity 0.16s ease; }
.nav-item .nav-label { line-height: 1; }
.nav-item:hover { color: var(--ink); }
.nav-item:active { transform: scale(0.96); }
.nav-item.active {
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active .nav-ico {
  background: rgba(212,160,23,0.16);
  box-shadow: 0 0 0 1px rgba(212,160,23,0.22);
}
.nav-item.active .ico-outline { opacity: 0; }
.nav-item.active .ico-fill { opacity: 1; transform: scale(1); color: var(--accent-2); }

.mini-player {
  position: fixed;
  left: 0.7rem; right: 0.7rem;
  bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  background: rgba(10,22,40,0.96);
  border: 1px solid rgba(212,160,23,0.25);
  z-index: 25;
  animation: rise 0.3s ease;
}
.mini-info {
  flex: 1;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
}
.mini-info img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; }
.mini-info small { display: block; color: var(--muted); }
.icon-btn {
  background: rgba(255,255,255,0.08);
  border: 0;
  color: var(--ink);
  width: 40px; height: 40px;
  border-radius: 50%;
}
.play-main { width: 64px; height: 64px; background: var(--accent); color: #0a0800; font-size: 1.3rem; }
.mini-volume {
  width: 72px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.volume-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 360px;
  margin: 0.85rem auto 0.4rem;
  padding: 0 0.5rem;
}
.volume-slider {
  flex: 1;
  accent-color: var(--accent);
}
.volume-pct {
  min-width: 2.6rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.85rem;
}
.form-range::-webkit-slider-thumb { background: var(--accent); }
.form-range::-moz-range-thumb { background: var(--accent); border: 0; }

.full-player {
  position: fixed;
  inset: 0;
  z-index: 40;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(212,160,23,0.18), transparent 60%),
    radial-gradient(600px 300px at 80% 100%, rgba(18,60,110,0.35), transparent 55%),
    #000000;
  padding: 1.2rem;
  overflow: auto;
  text-align: center;
  animation: rise 0.35s ease;
}
.player-cover {
  width: min(72vw, 320px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  margin: 1.2rem auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
}
.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9rem;
  margin: 1rem 0;
}
.player-times, .player-extra {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.player-extra { margin-top: 1rem; }
.lyrics-box, .queue-box {
  text-align: left;
  margin-top: 1rem;
  background: rgba(18,38,61,0.55);
  border: 1px solid rgba(212,160,23,0.12);
  border-radius: 12px;
  padding: 0.9rem;
  white-space: pre-wrap;
}
.link-back {
  background: transparent;
  border: 0;
  color: var(--accent-2);
  padding: 0;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  color: var(--ink);
  background: rgba(18,38,61,0.5);
}
.sub-card {
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.8rem;
  background: rgba(10,22,40,0.7);
}
@media (min-width: 900px) {
  .shell-view, .welcome-panel, .auth-panel { max-width: 98%; margin-left: auto; margin-right: auto; }
  .rail { grid-auto-columns: minmax(170px, 180px); }
}
