/* AI Music Floating Player */
#music-fixed-player {
  position: fixed;
  right: -360px;
  top: 50%;
  transform: translateY(-50%);
  width: 360px;
  height: 580px;
  z-index: 9999;
  border-radius: 12px 0 0 12px;
  overflow: hidden;
  box-shadow: -2px 0 15px rgba(0, 0, 0, 0.25);
  transition: right 0.35s ease;
  background: #111;
  display: flex;
  flex-direction: column;
}

#music-fixed-player.open {
  right: 0;
}

#music-iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
  background: #111;
}

/* Tab bar */
#music-tab-bar {
  display: flex;
  height: 36px;
  background: #1a1a2e;
  flex-shrink: 0;
}

#music-tab-bar button {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

#music-tab-bar button:hover {
  color: #ccc;
}

#music-tab-bar button.active {
  color: #fff;
  border-bottom-color: #6c5ce7;
}

/* Shuffle / next button inside panel */
#music-shuffle {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10001;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(108, 92, 231, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#music-shuffle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.6);
}

#music-shuffle.spin {
  animation: shuffle-spin 0.6s ease;
}

@keyframes shuffle-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Turntable toggle button — Option C: Vintage Badge */
#music-toggle {
  position: fixed;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10000;
  width: 76px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: right 0.35s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#music-toggle.open {
  right: 364px;
}

#music-toggle:not(.open):hover {
  right: 0;
}

/* Turntable body / casing */
.mt-case {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a1f14, #1a1208);
  border: 2px solid #3d2b1f;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 0 3px #12101e,
    0 0 0 5px #2a1d14;
  position: relative;
  overflow: hidden;
}

.mt-case::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255,255,255,0.01) 0deg, transparent 3deg, transparent 6deg
  );
}

/* Vinyl disc */
.mt-vinyl {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ddd 1.5px, transparent 2px),
    radial-gradient(circle, #d4a052 5px, #b8860b 5.5px, transparent 6px),
    repeating-radial-gradient(circle,
      transparent 7px, rgba(255,255,255,0.08) 8px, transparent 9px,
      transparent 10px, rgba(255,255,255,0.06) 11px, transparent 12px,
      transparent 14px, rgba(255,255,255,0.07) 15px, transparent 16px,
      transparent 17px, rgba(255,255,255,0.06) 18px, transparent 19px),
    conic-gradient(from 45deg,
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.14) 10%,
      rgba(255,255,255,0) 20%,
      rgba(255,255,255,0.08) 42%,
      rgba(255,255,255,0) 52%,
      rgba(255,255,255,0.14) 75%,
      rgba(255,255,255,0) 88%);
  background-color: #0a0a0a;
  box-shadow:
    inset 3px -2px 8px rgba(255,255,255,0.07),
    0 1px 4px rgba(0,0,0,0.4);
}

#music-toggle.open .mt-vinyl {
  animation: vinyl-rotate 2.5s linear infinite;
}

/* Tonearm */
.mt-arm {
  position: absolute;
  right: 11px;
  top: 9px;
  width: 4px;
  height: 34px;
  transform-origin: 2px 4px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: rotate(-25deg);
}

#music-toggle.open .mt-arm {
  transform: rotate(20deg);
}

.mt-arm-pivot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0d48a, #d4a052);
  position: absolute;
  top: 0;
  left: -2.5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.mt-arm-shaft {
  width: 2.5px;
  height: 24px;
  background: linear-gradient(to right, #c9953a, #d4a052, #c9953a);
  position: absolute;
  top: 6px;
  left: 0.5px;
  border-radius: 1px;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.mt-arm-needle {
  width: 4px;
  height: 7px;
  background: linear-gradient(to bottom, #b8860b, #777);
  position: absolute;
  bottom: 0;
  left: 0;
  border-radius: 0 0 1.5px 1.5px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* LED dot-matrix display */
.mt-led {
  margin-top: 6px;
  padding: 2px 8px;
  background: #0a0908;
  border-radius: 3px;
  border: 1px solid #2a2218;
  font-family: 'Courier New', monospace;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #d4a052;
  text-shadow: 0 0 4px rgba(212, 160, 82, 0.6);
  text-align: center;
  line-height: 1;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

#music-toggle.open .mt-led {
  color: #4ade80;
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

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

@media screen and (max-width: 768px) {
  #music-fixed-player {
    width: 300px;
    height: 480px;
    right: -300px;
  }
  #music-toggle.open {
    right: 304px;
  }
  .mt-case {
    width: 60px;
    height: 60px;
  }
  .mt-vinyl {
    width: 36px;
    height: 36px;
    left: 6px;
    top: 6px;
  }
  .mt-arm {
    right: 9px;
    top: 7px;
    height: 28px;
  }
  .mt-arm-shaft {
    height: 18px;
  }
}
