*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --card: #16161f;
  --border: #2a2a38;
  --accent: #e8c840;
  --accent2: #ff5e3a;
  --text: #f0ede8;
  --muted: #6b6878;
  --active: #1e1e2c;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(232,200,64,.05) 0, transparent 70%);
  pointer-events: none;
}

.app {
  width: 900px;
  max-width: 98vw;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.8);
  position: relative;
  z-index: 1;
}
.player-panel {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

.vinyl-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #2a2a2a 0%, #1a1a1a 30%, #0f0f0f 60%, #1c1c1c 100%);
  position: relative;
  box-shadow: 0 0 0 2px #333, 0 8px 40px rgba(0,0,0,.8), inset 0 0 30px rgba(0,0,0,.5);
}

.vinyl.spinning {
  animation: spin 4s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.vinyl::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at 50% 50%,
    transparent 20px,
    rgba(255,255,255,.012) 21px,
    transparent 22px,
    transparent 24px,
    rgba(255,255,255,.008) 25px,
    transparent 26px
  );
}

.vinyl-label {
  position: absolute;
  width: 70px;
  height: 70px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .5s;
}

.vinyl-label::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: #0a0a0f;
  border-radius: 50%;
  z-index: 3;
}
.tonearm {
  position: absolute;
  top: -10px;
  right: 20px;
  width: 3px;
  height: 95px;
  background: linear-gradient(to bottom, #888, #555);
  border-radius: 2px;
  transform-origin: top center;
  transform: rotate(25deg);
  transition: transform .8s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.tonearm.playing {
  transform: rotate(18deg);
}

.tonearm::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent2);
}

.tonearm-base {
  position: absolute;
  top: -14px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #aaa, #555);
  border-radius: 50%;
  z-index: 5;
}

.song-info {
  margin-bottom: 18px;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}

.song-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%;
}

.song-artist {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.song-artist span {
  color: var(--accent);
}

.progress-wrap {
  margin-bottom: 18px;
}

.loading-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 100%;
  animation: loading 1.5s linear infinite;
  display: none;
  margin-bottom: 4px;
}

.loading-bar.show {
  display: block;
}

@keyframes loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  margin-bottom: 7px;
  transition: height .15s;
  overflow: visible;
}

.progress-track:hover {
  height: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  width: 0%;
  transition: width .3s linear;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 0 4px rgba(0,0,0,.5);
}

.progress-track:hover .progress-fill::after {
  opacity: 1;
}

.time-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 22px;
}

.btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color .2s, transform .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
}

.btn:hover  { color: var(--text); transform: scale(1.1); }
.btn:active { transform: scale(.95); }

.btn-play {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(232,200,64,.4);
}

.btn-play:hover  { background: #f0d050; transform: scale(1.05); box-shadow: 0 6px 28px rgba(232,200,64,.6); }
.btn-play:active { transform: scale(.97); }

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

.volume-icon { color: var(--muted); flex-shrink: 0; }

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform .15s;
}

.volume-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

.volume-pct {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  width: 28px;
  text-align: right;
}
.playlist-panel {
  background: var(--card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.playlist-header {
  padding: 28px 28px 14px;
  border-bottom: 1px solid var(--border);
}

.playlist-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 2px;
}

.playlist-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.playlist-meta span { color: var(--accent); }

.playlist-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
  max-height: 400px;       
  -webkit-overflow-scrolling: touch; 
}

.playlist-list::-webkit-scrollbar { width: 3px; }
.playlist-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.track {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 28px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}

.track:hover  { background: var(--active); }
.track.active { background: var(--active); border-left-color: var(--accent); }

.track-num {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.track.active        .track-num { display: none; }
.track.active.paused .track-num { display: block; color: var(--accent); }

.track-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; justify-content: flex-end; }
.track.active        .track-eq { display: flex; }
.track.active.paused .track-eq { display: none; }

.eq-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq .6s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { height: 6px;  animation-delay: 0s; }
.eq-bar:nth-child(2) { height: 10px; animation-delay: .15s; }
.eq-bar:nth-child(3) { height: 7px;  animation-delay: .3s; }

@keyframes eq {
  0%   { transform: scaleY(.3); }
  100% { transform: scaleY(1); }
}

.track-info { min-width: 0; }

.track-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  transition: color .15s;
}

.track.active .track-name { color: var(--accent); }

.track-artist {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-duration {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.extras {
  padding: 12px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  text-transform: uppercase;
}

.tag.on    { background: rgba(232,200,64,.1); border-color: var(--accent); color: var(--accent); }
.tag:hover { border-color: var(--muted); color: var(--text); }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: var(--active);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  transition: border-color .2s;
}

.search-wrap:focus-within {
  border-color: var(--accent);
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  display: none;
  transition: color .15s;
  flex-shrink: 0;
}

.search-clear:hover { color: var(--accent2); }
.search-clear.visible { display: block; }

.track.hidden { display: none; }

.no-results {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 32px 16px;
  font-family: 'Space Mono', monospace;
  letter-spacing: 1px;
}

.playlist-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;        
  width: 100%;          
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;       
  padding: 12px 4px;
  font-weight: 500;
  padding: 14px 8px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--active);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--active);
}

@media (max-width: 700px) {

  body {
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    width: 100%;
    max-width: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    min-height: 100vh;
  }

  .player-panel {
  padding: 20px 20px 16px;
  flex-shrink: 0;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

  .vinyl-wrap {
    display: none;
  }

  .song-title {
    font-size: 26px;
  }

  .playlist-panel {
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .playlist-list {
    overflow-y: auto;
    flex: 1;
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  .playlist-header {
    padding: 16px 20px 12px;
    flex-shrink: 0;
  }


  .track {
    padding: 12px 20px;
  }

  .extras {
    padding: 10px 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
  }

  .search-wrap {
    padding: 7px 10px;
  }

  .search-input {
    font-size: 13px;
  }

  .btn-play {
    width: 52px;
    height: 52px;
  }
}
