:root {
  --bg: #05060a;
  --bg-elevated: #12141d;
  --bg-elevated-soft: rgba(18, 20, 29, 0.9);
  --accent: #66fcf1;
  --accent-soft: rgba(102, 252, 241, 0.16);
  --text: #e5e5e5;
  --muted: #8d8f92;
  --danger: #ff6b6b;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1b2838 0, #05060a 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 1150px;
  margin: 24px 16px 80px; /* снизу под мини-плеер */
  background: radial-gradient(circle at top left, #141821 0, #05060a 60%);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  overflow: hidden;
}

/* SIDEBAR */

.app-sidebar {
  padding: 18px 18px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top, #151923 0, #05060a 70%);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: radial-gradient(circle at top, var(--accent), #45a29e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #05060a;
  box-shadow: 0 12px 30px rgba(102, 252, 241, 0.35);
}

.brand-text-main {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-text-sub {
  font-size: 11px;
  color: var(--muted);
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.sidebar-nav a span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: var(--accent);
}

.sidebar-nav a.nav-primary {
  color: var(--accent);
  border-color: rgba(102, 252, 241, 0.5);
  background: radial-gradient(circle at left, var(--accent-soft), transparent 70%);
}

.sidebar-nav a.nav-danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.5);
}

.sidebar-nav a:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.8;
}

/* MAIN AREA */

.app-main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.app-header {
  padding: 16px 22px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f2f2f2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.app-main {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background-color: var(--bg-elevated-soft);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 16px;
}

/* SEARCH BAR */

.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(5, 6, 10, 0.96);
  color: var(--text);
  font-size: 14px;
}

.search-input-wrap input:focus {
  outline: none;
  border-color: rgba(102, 252, 241, 0.7);
  box-shadow: 0 0 0 1px rgba(102, 252, 241, 0.25);
}

.search-input-wrap span.hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
}

.button {
  border-radius: 999px;
  border: none;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #45a29e);
  color: #05060a;
  box-shadow: 0 10px 25px rgba(102, 252, 241, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button span.icon {
  font-size: 16px;
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* GRID OF CARDS */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.track-card {
  background: radial-gradient(circle at top left, #171c26 0, #0b0e16 60%);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.track-thumb-wrap {
  position: relative;
  overflow: hidden;
}

.track-thumb-wrap img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(1.1);
  transition: transform 180ms ease-out, filter 180ms ease-out;
}

.track-card:hover .track-thumb-wrap img {
  transform: scale(1.03);
  filter: saturate(1.3);
}

.track-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background-color: rgba(5, 6, 10, 0.85);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.track-body {
  padding: 10px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track-title {
  font-size: 13px;
  font-weight: 500;
  color: #f1f1f1;
  max-height: 2.6em;
  overflow: hidden;
}

.track-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.track-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.track-actions a {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  padding: 6px 8px;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.track-actions a.play {
  border-color: rgba(102, 252, 241, 0.6);
  color: var(--accent);
}

.track-actions a.youtube {
  color: var(--muted);
}

/* PLAYER PAGE */

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
}

.player-art {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top, var(--accent-soft), #0b0e16);
}

.player-art-inner {
  position: relative;
}

.player-art-inner img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.player-pill {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: rgba(5, 6, 10, 0.85);
  font-size: 11px;
  color: var(--muted);
}

.player-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-title {
  font-size: 18px;
  font-weight: 600;
}

.player-note {
  font-size: 13px;
  color: var(--muted);
}

/* CLEAR PAGE */

.clear-message {
  font-size: 14px;
  color: var(--text);
}

/* FOOTER */

.app-footer {
  padding: 8px 18px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

/* GLOBAL MINI PLAYER */

.global-player {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: 720px;
  width: calc(100% - 32px);
  background: linear-gradient(
    135deg,
    var(--accent-soft),
    rgba(5, 6, 10, 0.96)
  );
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 6px 12px;
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 999;
}

.global-player.visible {
  display: flex;
}

.gp-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.gp-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at center, var(--accent), #45a29e);
  box-shadow: 0 0 12px rgba(102, 252, 241, 0.9);
}

#global-player-title {
  font-size: 12px;
  color: #f1f1f1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.gp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

#global-player-audio {
  flex: 1;
}

.gp-button {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 6, 10, 0.9);
  color: var(--accent);
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}

/* RESPONSIVE */

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
    margin: 16px 10px 80px;
  }

  .app-sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-footer {
    display: none;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  #global-player-title {
    max-width: 110px;
  }
}
