/* ============================
   RESET & BASE
============================ */
html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: #fce1ff;
  font-family: "Comic Sans MS", cursive;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: background 0.4s ease;
}

/* ============================
   TOPBAR
============================ */
.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  box-sizing: border-box;
  background: transparent;
}

.logo {
  font-family: "Pixel Emulator", monospace;
  font-size: 30px;
  letter-spacing: 2px;
  color: #ff7de9;
  text-shadow: 0 0 8px white, 0 0 4px #ffb3f6;
  font-weight: bold;
  margin: 0;
}

/* ============================
   COLOR PICKER
============================ */
.color-btn-main {
  background: white;
  border: 2px solid #ffb3f6;
  padding: 8px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 10px #ffb3f6;
  font-size: 14px;
  font-family: "Comic Sans MS", cursive;
  color: #ff7de9;
}

.color-options {
  display: none;
  padding: 10px;
  margin: 0 28px 10px auto;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  gap: 10px;
  width: fit-content;
}

.color-options.active {
  display: flex;
}

.color-choice {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 6px #fff;
  transition: transform 0.15s ease;
}

.color-choice:hover {
  transform: scale(1.2);
}

/* ============================
   LAYOUT CENTRAL
============================ */
.main-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1100px;
  flex-grow: 1;
  margin-top: 0;
  gap: 40px;
}

/* ============================
   UI WRAPPER
============================ */
.ui-wrapper {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 0 0 auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ui-wrapper.hidden {
  opacity: 0;
  transform: translateX(-20px);
  pointer-events: none;
}

/* ============================
   CONTROLS PRINCIPALS
============================ */
.controls {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

input[type="text"] {
  padding: 12px 14px;
  width: 260px;
  border-radius: 14px;
  border: 2px solid #ffb3f6;
  background: white;
  box-shadow: 0 0 8px #ffb3f6;
  font-family: "Comic Sans MS", cursive;
  font-size: 13px;
  box-sizing: border-box;
  color: #888;
}

input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 14px #ff7de9;
}

.play-btn {
  padding: 10px 22px;
  background: #cc66e0;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 0 10px #cc66e0;
  font-weight: bold;
  font-family: "Comic Sans MS", cursive;
  font-size: 14px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 18px #ff7de9;
}

/* ============================
   CONTROLS DE MÚSICA
============================ */
.music-controls {
  display: flex;
  gap: 10px;
}

.music-controls button {
  padding: 10px 16px;
  border-radius: 14px;
  border: none;
  background: #ffb3f6;
  cursor: pointer;
  box-shadow: 0 0 8px #ffb3f6;
  font-weight: bold;
  font-family: "Comic Sans MS", cursive;
  font-size: 13px;
  transition: transform 0.1s ease;
}

.music-controls button:hover {
  transform: scale(1.08);
}

/* ============================
   QUEUE / PLAYLIST
============================ */
.queue {
  background: rgba(255,255,255,0.35);
  padding: 16px;
  border-radius: 16px;
  backdrop-filter: blur(6px);
  width: 300px;
}

.queue h3 {
  margin: 0 0 12px 0;
  color: #ff7de9;
  font-size: 17px;
}

.queue-input {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.queue-input input {
  width: 100%;
  flex: 1;
}

#addToQueue {
  padding: 8px 13px;
  border-radius: 12px;
  border: none;
  background: #ffb3f6;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 0 8px #ffb3f6;
  transition: transform 0.1s ease;
}

#addToQueue:hover {
  transform: scale(1.1);
}

#queueList {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}

#queueList::-webkit-scrollbar {
  width: 6px;
}
#queueList::-webkit-scrollbar-thumb {
  background: #ffb3f6;
  border-radius: 6px;
}

#queueList li {
  background: white;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  box-shadow: 0 0 6px #ffb3f6;
  cursor: pointer;
  transition: background 0.2s ease;
}

#queueList li.active {
  background: #ffb3f6;
}

#queueList li:hover {
  background: #fff0fd;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  box-shadow: 0 0 6px #ffb3f6;
}

.drag-handle {
  cursor: grab;
  font-size: 18px;
  padding: 0 6px;
  user-select: none;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1; /* ← això fa que el títol ocupi l'espai central */
}

.song-title {
  flex: 1;
  max-width: 150px; /* ← ajusta-ho al gust */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  color: #ff7de9;
}

.delete-btn:hover {
  color: #cc0077;
}


/* ============================
   VINIL PIXEL ART
============================ */
.turntable {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  position: relative;
}

.vinyl {
  width: 458px;
  height: 360px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 24px rgba(220, 80, 80, 0.9));
}

.vinyl svg {
  width: 100%;
  height: 100%;
}

#disc {
  transform-origin: 185px 140px;
}

.vinyl.spin #disc {
  animation: spin 2.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================
   VINIL — POSICIÓ I ANIMACIÓ
============================ */
#vinyl {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.6s ease;
  z-index: 10;
}

.vinyl-center {
  right: 50%;
  transform: translate(50%, -50%);
}

/* ============================
   IFRAME INVISIBLE
============================ */
.video-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  z-index: -1;
}

/* ============================
   ZONA REVEAL
============================ */
.reveal-zone {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  z-index: 999;
}
