:root {
  color-scheme: dark;
  --bg: #121217;
  --panel: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f7f7fb;
  --muted: #a9a9b8;
  --primary: #6a98d5;
  --primary-text: #19140b;
  --danger: #ff8a8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(106, 152, 213, 0.16), transparent 34rem),
    linear-gradient(180deg, #191923 0%, var(--bg) 42%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app {
  min-height: 100vh;
  padding: max(2rem, env(safe-area-inset-top)) 1rem 8.75rem;
}

.wrap {
  margin: 0 auto;
  width: min(100%, 56rem);
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

h1 {
  margin: 0;
  max-width: 42rem;
  font-size: clamp(1.75rem, 7vw, 2.35rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.subtitle {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.status.online {
  border-color: rgba(106, 152, 213, 0.35);
  color: var(--primary);
}

.card,
.list {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.sync-card {
  padding: 1rem;
}

.sync-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.count {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary {
  min-height: 2.65rem;
  border-radius: 0.7rem;
  background: var(--primary);
  color: var(--primary-text);
  cursor: pointer;
  padding: 0 1.05rem;
  font-size: 0.9rem;
  font-weight: 800;
}

.primary:disabled,
.icon:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.bar {
  height: 0.42rem;
  margin-top: 0.95rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar > span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 200ms ease;
}

.sync-message,
.error {
  margin: 0.65rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error {
  border-radius: 0.7rem;
  background: rgba(255, 80, 80, 0.13);
  color: var(--danger);
  padding: 0.7rem 0.8rem;
  white-space: normal;
}

h2 {
  margin: 2rem 0 0.8rem;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.empty {
  padding: 2.5rem 1rem;
  color: var(--muted);
  text-align: center;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.track {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.25rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.track:last-child {
  border-bottom: 0;
}

.track.current {
  background: rgba(106, 143, 213, 0.1);
}

.track-main,
.now {
  min-width: 0;
  flex: 1 1 auto;
}

.track-title,
.now-title {
  margin: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.number,
.track-meta {
  color: var(--muted);
}

.number {
  margin-right: 0.45rem;
}

.track-meta {
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
}

.icon,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
}

.player {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  border-top: 1px solid var(--border);
  background: rgba(18, 18, 23, 0.92);
  backdrop-filter: blur(20px);
  padding: 0.8rem 1rem max(0.8rem, env(safe-area-inset-bottom));
}

.player-inner {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 auto;
  width: min(100%, 56rem);
}

.now-title {
  font-size: 0.9rem;
}

.seek {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.time {
  width: 2.6rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.time:first-child {
  text-align: right;
}

input[type="range"] {
  min-width: 0;
  width: 100%;
  accent-color: var(--primary);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ghost {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
}

.play-main {
  width: 3rem;
  height: 3rem;
  box-shadow: 0 0.75rem 2rem rgba(106, 149, 213, 0.24);
}

.icon img,
.ghost img {
  width: 55%;
  height: 55%;
  pointer-events: none;
  display: block;
}

.ghost {
  opacity: 0.85;
}

.ghost.active {
  opacity: 1;
  color: var(--primary);
}

.ghost.active img {
  filter: drop-shadow(0 0 0.35rem rgba(106, 143, 213, 0.6));
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .app {
    padding-top: max(1.35rem, env(safe-area-inset-top));
  }

  header,
  .sync-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary {
    width: 100%;
  }

  .player-inner {
    gap: 0.55rem;
  }

  .ghost {
    width: 2rem;
  }
}