/* 1. TOKENS & TEMA */
:root {
  --bg: #f2f1ed;
  --surface: #ffffff;
  --raised: #e8e7e1;
  --card: #ffffff;
  --card-h: #f7f6f2;
  --border: rgba(0, 0, 0, 0.09);
  --border-m: rgba(0, 0, 0, 0.15);
  --accent: #c8963e;
  --accent-l: #e0b060;
  --accent-d: rgba(200, 150, 62, 0.12);
  --accent-g: rgba(200, 150, 62, 0.3);
  --text: #18170f;
  --text-m: #4a4840;
  --text-d: #6b6960;
  --player-bg: rgba(242, 241, 237, 0.94);
  --nav-bg: rgba(242, 241, 237, 0.97);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --red: #d94f4f;
  --green: #4a9e6a;
}

[data-theme="dark"] {
  --bg: #0d0e14;
  --surface: #121318;
  --raised: #181a22;
  --card: #1a1c26;
  --card-h: #1f2130;
  --border: rgba(255, 255, 255, 0.07);
  --border-m: rgba(255, 255, 255, 0.13);
  --accent: #c8963e;
  --accent-l: #e0b060;
  --accent-d: rgba(200, 150, 62, 0.13);
  --accent-g: rgba(200, 150, 62, 0.3);
  --text: #eeede6;
  --text-m: #b0b0b0;
  --text-d: #808080ff;
  --player-bg: rgba(13, 14, 20, 0.95);
  --nav-bg: rgba(13, 14, 20, 0.97);
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.55);
}

/* 2. PRELOADER */
#app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-content {
  text-align: center;
}

.loader-logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: pulse 1.8s infinite ease-in-out;
  box-shadow: 0 10px 30px rgba(200, 150, 62, 0.3);
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* 3. RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Geist', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

button {
  font-family: 'Geist', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: 'Geist', sans-serif;
  border: none;
  outline: none;
  background: none;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-m);
  border-radius: 99px;
}

/* ══════ RANGE ══════ */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background: transparent;
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--border-m) var(--pct, 0%));
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -5px;
  transition: width 0.12s, height 0.12s;
}

input[type=range]:hover::-webkit-slider-thumb,
input[type=range]:active::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -5px;
}

/* ══════ LAYOUT ══════ */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ══════ SIDEBAR ══════ */
.sidebar {
  width: 252px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: background 0.25s;
  padding-bottom: 88px;
}

@media (max-width: 767px) {
  .sidebar {
    display: none;
  }
}

.s-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 16px;
}

.s-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
}

.s-logo-name {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

.s-nav {
  padding: 2px 10px;
}

.s-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-d);
  margin-bottom: 1px;
  transition: color 0.12s, background 0.12s;
  text-align: left;
}

.s-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.s-btn.active {
  color: var(--accent);
  background: var(--accent-d);
  font-weight: 600;
}

.s-btn.pl-item {
  padding-left: 26px;
  font-size: 12.5px;
  font-weight: 400;
}

.s-btn.pl-item.active {
  color: var(--accent);
  font-weight: 500;
}

.s-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 14px;
}

.s-sec {
  padding: 8px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
}

.accordion-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.12s;
  user-select: none;
  padding-right: 14px;
}

.accordion-header:hover {
  color: var(--text);
}

.accordion-header.active {
  color: var(--accent);
}

.acc-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.accordion-header.active .acc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.accordion-content.hidden {
  display: none !important;
}

.s-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.s-scroll.artists {
  max-height: 160px;
}

.art-btn {
  display: block;
  width: 100%;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-d);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s, background 0.12s;
}

.art-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.s-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
}

.s-scan-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-d);
  border: 1px solid var(--border);
  transition: all 0.12s;
}

.s-scan-btn:hover {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

.ico-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
  line-height: 1;
}

.ico-btn:hover {
  color: var(--text-m);
  background: var(--raised);
  border-color: var(--border-m);
}

.ico-btn.on {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* ══════ MAIN ══════ */
.main {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
  padding-bottom: 90px;
}

@media (max-width: 767px) {
  .main {
    padding-bottom: calc(136px + 60px);
  }
}

.v-hdr {
  padding: 0px 25px 0px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--player-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 767px) {
  .v-hdr {
    padding: 0px 16px 0px;
  }
}

.v-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

@media (max-width: 767px) {
  .v-title {
    font-size: 20px;
  }
}

.v-sub {
  font-size: 11.5px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
}

.v-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tog-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
}

.tog-btn:hover {
  color: var(--text-m);
  background: var(--raised);
}

.tog-btn.on {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

/* ══════ SONG GRID ══════ */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 12px;
  padding: 0 24px 24px;
}

@media (max-width: 767px) {
  .song-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px 20px;
    width: 100%;
    box-sizing: border-box;
  }

  .song-card {
    min-width: 0;
    width: 100%;
    overflow: hidden;
  }
}

@media (min-width: 1280px) {
  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  }
}

.song-card {
  background: var(--card);
  border-radius: 13px;
  padding: 11px;
  cursor: pointer;
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.14s, transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.song-card:hover {
  background: var(--card-h);
  transform: translateY(-2px);
  border-color: var(--border-m);
  box-shadow: var(--shadow);
}

.song-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-g), var(--shadow);
}

.c-cover {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--raised);
  margin-bottom: 10px;
  position: relative;
}

.c-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.c-cover-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
}

.c-overlay {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  pointer-events: none;
}

.song-card:hover .c-overlay,
.song-card.active .c-overlay,
.song-card.playing .c-overlay,
.song-card.active-paused .c-overlay {
  opacity: 1;
}


.c-play-ico {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 18px rgba(200, 150, 62, 0.45);
  transform: scale(0.88);
  transition: transform 0.14s;
}

.song-card:hover .c-play-ico {
  transform: scale(1);
}

.c-acts {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.14s;
  z-index: 2;
}

.song-card:hover .c-acts,
.song-card.active .c-acts,
.song-card.playing .c-acts,
.song-card.active-paused .c-acts {
  opacity: 1;
}


.c-act {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border-m);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-m);
  font-size: 9px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
  backdrop-filter: blur(6px);
}

.c-act:hover {
  color: var(--accent);
  background: var(--accent-d);
  border-color: var(--accent-g);
}

.c-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0px;
  line-height: 1.2;
}

.c-artist {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.c-time {
  font-size: 10px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
  line-height: 1;
}

.c-eq {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.song-card.playing .c-eq {
  display: flex;
}

.eq-b {
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.eq-b:nth-child(1) {
  animation: eq 0.55s 0s ease-in-out infinite alternate;
}

.eq-b:nth-child(2) {
  animation: eq 0.55s 0.18s ease-in-out infinite alternate;
}

.eq-b:nth-child(3) {
  animation: eq 0.55s 0.09s ease-in-out infinite alternate;
}

@keyframes eq {
  from {
    height: 2px;
  }

  to {
    height: 12px;
  }
}

/* ══════ LIST MODE ══════ */
.song-list-wrap {
  padding: 0 20px 20px;
}

@media (max-width: 767px) {
  .song-list-wrap {
    padding: 0 12px 16px;
  }
}

.s-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.s-list-item:hover {
  background: var(--card);
  border-color: var(--border);
}

.s-list-item.active {
  background: var(--card);
  border-color: var(--accent);
}

.li-cov {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  flex-shrink: 0;
  background: var(--raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.li-info {
  flex: 1;
  min-width: 0;
}

.li-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.li-sub {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.li-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.li-acts .li-dots-wrap {
  opacity: 1;
}

.li-act {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  color: var(--text-d);
  transition: color 0.1s, background 0.1s;
}

.li-act:hover {
  color: var(--accent);
  background: var(--accent-d);
}

.li-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-d);
  transition: color 0.1s, background 0.1s;
}

.li-dots:hover {
  color: var(--text-m);
  background: var(--raised);
}

.li-dots.active {
  color: var(--accent);
  background: var(--accent-d);
}

.li-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 100;
  min-width: 140px;
  display: none;
  flex-direction: column;
}

.li-menu.show {
  display: flex;
}

.li-m-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  transition: background 0.1s;
  text-align: left;
}

.li-m-btn:hover {
  background: var(--raised);
}

.li-time {
  font-size: 11px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  flex-shrink: 0;
}

/* ══════ SEARCH ══════ */
.search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 24px 20px;
}

@media (max-width: 767px) {
  .search-wrap {
    margin: 0 16px 16px;
  }
}

.search-ico-pos {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-d);
  pointer-events: none;
}

.search-inp {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px 11px 40px;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.search-inp::placeholder {
  color: var(--text-d);
}

/* ══════ PLAYER ══════ */
.player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--player-bg);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border-top: 1px solid var(--border);
  transition: background 0.25s;
}

/* Desktop player: compact bar */
.p-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  padding: 0 18px;
  gap: 10px;
}

@media (max-width: 767px) {
  .p-desktop {
    display: none;
  }
}

/* Mobile player: tall panel above bottom nav */
.p-mobile {
  display: none;
  flex-direction: column;
  padding: 14px 18px 12px;
}

@media (max-width: 767px) {
  .player {
    bottom: 60px;
  }

  .p-mobile {
    display: flex;
  }
}

/* Mobile top row: cover + info + play */
.pm-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pm-cov {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}

.pm-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pm-cov-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
}

.pm-cov.glow {
  box-shadow: 0 2px 14px var(--accent-g);
}

.pm-text {
  flex: 1;
  min-width: 0;
}

.pm-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-artist {
  font-size: 11.5px;
  color: var(--text-d);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile progress row */
.pm-prog {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pm-time {
  font-size: 10px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  width: 28px;
  flex-shrink: 0;
}

.pm-time.r {
  text-align: right;
}

.pm-bar {
  flex: 1;
}

/* Mobile controls row */
.pm-ctrls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.pm-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.pm-play:active {
  transform: scale(0.93);
}

.pm-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  padding: 6px;
  border-radius: 8px;
  transition: color 0.12s;
}

.pm-ctrl:hover,
.pm-ctrl:active {
  color: var(--text-m);
}

.pm-ctrl.on {
  color: var(--accent);
}

/* Desktop shared styles */
.p-info {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 30%;
  min-width: 180px;
}

.p-cov {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
}

.p-cov img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p-cov-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p-cov.glow {
  box-shadow: 0 3px 20px var(--accent-g);
}

.p-text {
  min-width: 0;
}

.p-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.p-artist {
  font-size: 11.5px;
  color: var(--text-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
  margin-top: 1px;
}

.p-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  max-width: 560px;
}

.p-ctrls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-d);
  padding: 4px;
  border-radius: 7px;
  transition: color 0.12s;
}

.ctrl:hover {
  color: var(--text-m);
}

.ctrl.on {
  color: var(--accent);
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.play-btn:hover {
  transform: scale(1.07);
}

.play-btn:active {
  transform: scale(0.95);
}

.p-prog {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
}

.p-time {
  font-size: 10.5px;
  color: var(--text-d);
  font-family: 'Geist Mono', monospace;
  width: 30px;
  flex-shrink: 0;
}

.p-time.r {
  text-align: right;
}

.p-bar {
  flex: 1;
}

.p-right {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 30%;
  min-width: 180px;
  justify-content: flex-end;
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.vol-bar {
  width: 78px;
}

@media (max-width: 1023px) {
  .vol-row {
    display: none;
  }
}

/* ══════ MOBILE NAV ══════ */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 10px;
  transition: background 0.25s;
}

@media (max-width: 767px) {
  .mob-nav {
    display: flex;
  }
}

.mob-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-d);
  font-size: 9.5px;
  font-weight: 600;
  padding: 0 8px;
  transition: color 0.12s;
}

.mob-btn.active {
  color: var(--accent);
}

/* ══════ LYRICS ══════ */
#lyricsPanel {
  position: fixed;
  inset: 0;
  bottom: 88px;
  z-index: 60;
  background: var(--player-bg);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  display: flex;
  flex-direction: column;
  transition: opacity 0.22s, transform 0.22s;
  border-top: 1px solid var(--border);
}

#lyricsPanel.off {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

@media (max-width: 767px) {
  #lyricsPanel {
    bottom: 213px;
    /* 60px (nav) + 153px (player mobile approx) */
  }
}

.ly-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

@media (max-width: 767px) {
  .ly-hdr {
    padding: 14px 16px;
  }
}

.ly-info {
  min-width: 0;
}

.ly-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ly-artist {
  font-size: 12px;
  color: var(--text-d);
  margin-top: 2px;
}

.ly-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--text-d);
  transition: all 0.12s;
}

.ly-close:hover {
  color: var(--text);
  background: var(--card);
}

.ly-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.ly-layout {
  display: flex;
  min-height: 100%;
}

.ly-side {
  width: 400px;
  padding: 60px 0 60px 60px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.ly-img-box {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--raised);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-m);
}

.ly-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.ly-img-box:hover img {
  transform: scale(1.05);
}

.ly-img-ph {
  color: var(--text-d);
  opacity: 0.5;
}

.ly-main {
  flex: 1;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
}

#lyricsContent {
  font-size: 19px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  opacity: 0.95;
  font-family: 'Geist', sans-serif;
  max-width: 600px;
}

@media (max-width: 1100px) {
  .ly-side {
    width: 320px;
    padding: 40px 0 40px 40px;
  }

  .ly-main {
    padding: 40px 50px;
  }

  #lyricsContent {
    font-size: 17px;
  }
}

@media (max-width: 767px) {
  .ly-layout {
    flex-direction: column;
  }

  .ly-side {
    width: 100%;
    padding: 30px 20px 0;
    position: static;
  }

  .ly-img-box {
    width: 200px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  .ly-main {
    padding: 30px 20px;
    text-align: left;
    align-items: flex-start;
  }

  #lyricsContent {
    font-size: 15px;
    line-height: 1.6;
    max-width: none;
    font-weight: 400;
  }
}

/* ══════ MODALS ══════ */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-bg.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transition: background 0.25s;
}

.accordion-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
  user-select: none;
}

.accordion-header:hover {
  color: var(--text);
}

.accordion-header.active {
  color: var(--accent);
}

.acc-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.accordion-header.active .acc-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.accordion-content {
  transition: all 0.3s ease;
}

.accordion-content.hidden {
  display: none !important;
}

.m-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.m-sub {
  font-size: 12.5px;
  color: var(--text-d);
  margin-bottom: 20px;
}

.m-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-d);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-prog {
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 22px;
}

.scan-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-l));
  border-radius: 99px;
  animation: sani 1.4s ease-in-out infinite;
}

@keyframes sani {
  0% {
    width: 20%;
    margin-left: 0;
  }

  50% {
    width: 50%;
    margin-left: 30%;
  }

  100% {
    width: 20%;
    margin-left: 80%;
  }
}

.pl-inp {
  width: 100%;
  padding: 10px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.pl-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.pl-inp::placeholder {
  color: var(--text-d);
}

.m-btn {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  transition: opacity 0.12s, transform 0.12s;
  font-family: 'Geist', sans-serif;
}

.m-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.m-btn.sec {
  background: var(--raised);
  color: var(--text-m);
  margin-top: 7px;
  border: 1px solid var(--border);
}

.m-btn.sec:hover {
  background: var(--card);
  transform: none;
}

.pl-list-pick {
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.pl-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s;
}

.pl-pick:hover {
  background: var(--raised);
}

.pl-pick-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--accent-d);
  border: 1px solid var(--accent-g);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.pl-pick-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.pl-pick-count {
  font-size: 11px;
  color: var(--text-d);
  margin-top: 1px;
  font-family: 'Geist Mono', monospace;
}

/* Settings */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.set-row:last-child {
  border-bottom: none;
}

.set-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.set-sub {
  font-size: 11.5px;
  color: var(--text-d);
  margin-top: 2px;
}

.sw {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.sw input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sw-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--border-m);
  cursor: pointer;
  transition: background 0.2s;
}

.sw input:checked+.sw-track {
  background: var(--accent);
}

.sw-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  pointer-events: none;
}

.sw input:checked~.sw-thumb {
  transform: translateX(18px);
}

/* ══════ AUTH ══════ */
#authScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  transition: opacity 0.3s;
}

#authScreen.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.auth-logomark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-name {
  font-size: 25px;
  font-weight: 800;
  line-height: 50px;
  color: var(--text);
  margin-left: 12px;
  letter-spacing: -0.4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-d);
  margin-bottom: 24px;
}

.auth-inp {
  width: 100%;
  padding: 12px 14px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.auth-inp:focus {
  border-color: var(--accent-g);
  box-shadow: 0 0 0 3px var(--accent-d);
}

.auth-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  transition: opacity 0.12s;
  margin-bottom: 16px;
}

.auth-btn:hover {
  opacity: 0.9;
}

.auth-link {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  display: block;
  margin-bottom: 8px;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-err {
  color: var(--red);
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 500;
  text-align: center;
}

/* ══════ EMPTY ══════ */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-d);
}

.e-ico {
  font-size: 38px;
  margin-bottom: 12px;
}

.empty h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-m);
  margin-bottom: 5px;
}

.empty p {
  font-size: 12.5px;
}

/* ══════ UTILS ══════ */
.hidden {
  display: none !important;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════ 404 PAGE ══════ */
.page-404 {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background .3s, color .3s;
}

.page-404-container {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  position: relative;
  z-index: 10;
}

.page-404-err-code {
  font-size: clamp(120px, 15vw, 180px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
  animation: float404 6s ease-in-out infinite;
}

@keyframes float404 {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.page-404-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.page-404-desc {
  font-size: 16px;
  color: var(--text-d);
  margin-bottom: 32px;
  line-height: 1.6;
  max-width: 400px;
  margin-inline: auto;
}

.page-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 99px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 10px 20px rgba(200, 150, 62, .3);
}

.page-404-btn:hover {
  background: var(--accent-l);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(200, 150, 62, .4);
}

/* Decorative elements */
.page-404-bg-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: var(--accent);
  filter: blur(150px);
  opacity: 0.15;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.page-404-gl-1 {
  top: -10%;
  left: -10%;
}

.page-404-gl-2 {
  bottom: -10%;
  right: -10%;
}

.page-404-mono {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  opacity: 0.5;
  margin-top: 40px;
}