* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #121212;
  color: #fff;
  overflow-x: hidden;
}
.hidden { display: none!important; }

#profileScreen {
  position: fixed;
  inset: 0;
  background: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.profile-box {
  background: #181818;
  padding: 32px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
}
.profile-box h2 { margin-bottom: 24px; font-size: 24px; }
.profile-box input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
}
.profile-box button {
  width: 100%;
  padding: 14px;
  background: #b9411d;
  border: none;
  border-radius: 24px;
  color: #000;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

#app { display: none; padding-bottom: 80px; }

.header {
  padding: 20px;
  background: linear-gradient(180deg, #b9411d 0%, #121212 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.logo { font-size: 24px; font-weight: 900; }
.stats { display: flex; gap: 16px; font-size: 12px; }
.stat-item { text-align: center; }
.stat-value { font-size: 18px; font-weight: 700; color: #b9411b; }
.stat-label { color: #b3b3b3; font-size: 10px; }

.controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  
}
.controls button {
  flex: 1;
  min-width: 60px;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.controls button.active { background: #1db954; color: #000; font-weight: 600; }
.controls button.loading { opacity: 0.5; pointer-events: none; }

.modes {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.modes button {
  flex: 1;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.modes button.active { background: #fff; color: #000; font-weight: 600; }

#langSelect {
  width: 100%;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 9px;
}

#searchInput {
  width: 100%;
  padding: 12px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  outline: none;
}
#searchInput:focus { border-color: #1db954; }

.player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}
#player { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

#audioOverlay {
  position: absolute;
  inset: 0;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
#audioOverlay.show { display: flex; }

.now-playing {
  padding: 10px;
  background: #121212;
  border-bottom: 0px solid #282828;
  margin-bottom: 7px;
}
.np-label { font-size: 11px; color: #b3b3b3; margin-bottom: 4px; }
#npArtist { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
#npSong { font-size: 12px; color: #b3b3b3; }

.action-btns {
  display: flex;
  gap: 12px;
  padding: 10px 8px;
  background: #181818;
}
.action-btns button {
  flex: 1;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

#playlist {
  max-height: 45vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #121212;
}
#playlist::-webkit-scrollbar { width: 6px; }
#playlist::-webkit-scrollbar-thumb { background: #535353; border-radius: 3px; }
.playlist-item {
  padding: 12px 20px;
  border-bottom: 1px solid #282828;
  cursor: pointer;
  font-size: 14px;
}
.playlist-item:hover { background: #282828; }
.playlist-item.active { background: #1f1f1f; color: #b9411d; }

.bottom-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #181818;
  border-top: 1px solid #282828;
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  z-index: 100;
}
.bottom-controls button {
  flex: 1;
  padding: 8px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

#loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  padding: 20px 40px;
  border-radius: 12px;
  display: none;
  z-index: 2000;
}
#loader.show { display: block; }

#manageModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: none;
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}
#manageModal.show { display: block; }
.manage-content {
  background: #181818;
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
  margin: 0 auto;
}
.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.manage-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.manage-tabs button {
  flex: 1;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}
.manage-tabs button.active { background: #b9411d; color: #000; font-weight: 600; }
#manageSubtext {
  font-size: 12px;
  color: #e22134;
  margin-bottom: 12px;
  display: none;
}
#manageSubtext.show { display: block; }
.manage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #2a2a2a;
  border-radius: 8px;
  margin-bottom: 8px;
}
.delete-btn {
  padding: 6px 12px;
  background: #e22134;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
#closeManage {
  padding: 8px 16px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}