:root {
  --bg: #12141a;
  --panel: #1b1e27;
  --accent: #ff5f6d;
  --text: #eee;
  --muted: #9aa0ac;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  height: 100vh;
  background: var(--panel);
  padding: 1.2rem;
  overflow-y: auto;
  border-right: 1px solid #2a2e3a;
}

.sidebar h2 {
  margin: 0 0 0.8rem;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.track-list li {
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
}

.track-list li:hover {
  background: #262a36;
}

.track-list li.active {
  background: var(--accent);
  color: #1b1e27;
  font-weight: 600;
}

.stage {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  overflow: hidden;
}

.title {
  margin: 0 0 1.2rem;
  font-size: 2rem;
  letter-spacing: 0.03em;
  background: linear-gradient(90deg, #ff5f6d, #ffc371);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dj-gif {
  display: block;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.now-playing {
  margin: 1.2rem 0;
  font-size: 1.1rem;
  color: var(--muted);
  min-height: 1.4em;
}

.player {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
}

.seek-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.seek-row input[type="range"] {
  flex: 1;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.controls-row button {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

.controls-row button:hover {
  background: #262a36;
}

#btn-play {
  font-size: 1.8rem;
  color: var(--accent);
}

.volume {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1rem;
  color: var(--muted);
}

input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  background: #2a2e3a;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

/* Browsers block audio.play() without a user gesture. When a client joins
   mid-playback and the browser refuses to start audio, this overlay lets one
   tap unlock it. */
.resume-overlay[hidden] {
  display: none;
}

.resume-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
}

.resume-overlay button {
  font-size: 1.1rem;
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #1b1e27;
  font-weight: 600;
  cursor: pointer;
}

/* Mobile: stack sidebar above stage, each independently scrollable/fixed. */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 38vh;
    border-right: none;
    border-bottom: 1px solid #2a2e3a;
    padding: 0.8rem 1rem;
  }

  .stage {
    height: 62vh;
    padding: 1rem;
  }

  .title {
    font-size: 1.4rem;
    margin-bottom: 0.7rem;
  }

  .dj-gif {
    max-width: 55vw;
  }

  .now-playing {
    font-size: 0.95rem;
    margin: 0.7rem 0;
  }

  .player {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
  }

  .controls-row {
    gap: 0.6rem;
  }

  .controls-row button {
    font-size: 1.7rem;
    padding: 0.5rem 0.7rem;
  }

  #btn-play {
    font-size: 2.1rem;
  }

  .volume {
    margin-left: 0.6rem;
  }

  .track-list li {
    padding: 0.7rem 0.6rem;
  }

  input[type="range"] {
    height: 6px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}
