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

body {
  background: #0a0a0a;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  cursor: default;
  user-select: none;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/bg.png') center/cover no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

#canvas {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#watermark-left, #watermark-right {
  position: fixed;
  bottom: 24px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

#watermark-left {
  left: 24px;
}

#watermark-right {
  right: 24px;
}

/* === Album Sleeve (standalone card) === */

.album-sleeve {
  position: absolute;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.album-sleeve:active {
  cursor: grabbing;
}

.album-sleeve-img {
  width: 180px;
  height: 186px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.album-sleeve-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.album-sleeve-links.open {
  max-height: 200px;
  opacity: 1;
  margin-top: 10px;
}

.album-sleeve-link {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color 0.15s;
}

a.album-sleeve-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* === Vinyl Player === */

.player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  z-index: 1;
  transition: z-index 0s;
}

.player.hidden {
  display: none;
}

.player.dragging {
  cursor: grabbing;
  z-index: 9999;
}

.player.tucking .tonearm-pivot,
.player.tucking .player-controls {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Vinyl disc */
.vinyl-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  --vc: var(--vinyl-color, #1a1a1a);
  --vl: var(--vinyl-light, #2a2a2a);
  background: radial-gradient(
    circle,
    var(--vc) 28%,
    color-mix(in srgb, var(--vc), black 20%) 30%,
    var(--vc) 31%,
    var(--vl) 33%,
    var(--vc) 35%,
    var(--vl) 50%,
    var(--vc) 52%,
    var(--vl) 54%,
    var(--vc) 56%,
    var(--vl) 70%,
    var(--vc) 72%,
    var(--vl) 74%,
    var(--vc) 76%,
    var(--vl) 90%,
    var(--vc) 92%,
    var(--vl) 100%
  );
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.05),
    0 8px 32px rgba(0, 0, 0, 0.6);
  animation: spin 2s linear infinite;
  animation-play-state: paused;
}

.player.playing .vinyl-disc {
  animation-play-state: running;
}

.vinyl-cover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #2a2a2a;
  background-size: cover;
  background-position: center;
  border: 2px solid #111;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.vinyl-cover::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0a0a0a;
  border: 1px solid #333;
}

.tonearm-pivot {
  position: absolute;
  top: 12px;
  right: -42px;
  width: 30px;
  height: 120px;
  transform-origin: top center;
  transform: rotate(0deg);
  transition: transform 0.4s ease;
  z-index: 3;
  cursor: grab;
  touch-action: none;
}

.tonearm-pivot:active {
  cursor: grabbing;
}

.tonearm {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 110px;
  background: linear-gradient(to bottom, #555, #333);
  border-radius: 2px;
  pointer-events: none;
}

.tonearm::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #444;
  border: 1px solid #555;
}

.tonearm::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 6px;
  background: #666;
  border-radius: 0 0 3px 3px;
}

.progress-ring {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 188px;
  height: 188px;
  pointer-events: none;
}

.progress-ring circle {
  fill: none;
  stroke-width: 2;
}

.progress-ring .progress-bg {
  stroke: rgba(255, 255, 255, 0.04);
}

.progress-ring .progress-bar {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s linear;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player:hover .player-controls {
  opacity: 1;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 50px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

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

/* Album strings */
.album-string {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.album-pin {
  fill: rgba(255, 255, 255, 0.35);
}

#album-strings {
  transition: opacity 0.3s ease;
}

/* No-cover placeholder */
.vinyl-cover.no-cover {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
