/* Pure-Code Translucent Winter Turntable in 3D Tabletop Perspective (Concept 05) */
.turntable-rig {
  position: relative;
  width: min(460px, 45vw, 54dvh);
  aspect-ratio: 1.08 / 1;
  perspective: 1200px;
  transform-style: preserve-3d;
  transform: rotateX(18deg) rotateY(14deg) rotateZ(-3.5deg) translateZ(24px);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  flex-shrink: 0;
}

.turntable-rig:hover {
  transform: rotateX(12deg) rotateY(8deg) rotateZ(-2deg) translateZ(38px);
}

/* Hinged 3D Acrylic Dust Cover Lid */
.tt-dustcover {
  position: absolute;
  inset: -12% 2% 62% 2%;
  border-radius: 18px 18px 6px 6px;
  background:
    linear-gradient(155deg, rgba(255, 245, 228, 0.16) 0%, rgba(255, 255, 255, 0.02) 48%, rgba(255, 192, 110, 0.12) 100%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 245, 225, 0.45),
    inset 0 0 0 1px rgba(255, 226, 186, 0.22),
    0 -14px 32px rgba(0, 0, 0, 0.45);
  transform: rotateX(34deg) translateZ(16px);
  transform-origin: bottom center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.tt-dustcover-crest {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 240, 215, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.tt-dustcover-rule {
  width: 78px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(224, 72, 72, 0.88), transparent);
}

/* Translucent Acrylic Plinth with 3D Extruded Depth */
.tt-plinth {
  position: absolute;
  inset: 10% 0 4% 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 42% 52%, var(--tt-glow, rgba(255, 162, 64, 0.34)), rgba(22, 13, 9, 0.72) 70%),
    linear-gradient(145deg, rgba(255, 236, 206, 0.18), rgba(24, 14, 10, 0.82));
  border: 0;
  box-shadow:
    -18px 34px 58px rgba(0, 0, 0, 0.88),
    0 10px 0 rgba(78, 52, 34, 0.55),
    0 0 48px var(--tt-glow, rgba(255, 158, 58, 0.32)),
    inset 0 2px 3px rgba(255, 246, 230, 0.48),
    inset 0 -14px 28px rgba(255, 148, 48, 0.24);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: box-shadow 0.45s ease;
}

.turntable-rig.is-playing .tt-plinth {
  box-shadow:
    -20px 38px 64px rgba(0, 0, 0, 0.92),
    0 10px 0 rgba(112, 72, 42, 0.65),
    0 0 68px var(--tt-glow, rgba(255, 166, 68, 0.54)),
    inset 0 2px 4px rgba(255, 248, 236, 0.58),
    inset 0 -16px 34px rgba(255, 156, 52, 0.38);
}

/* Brushed aluminum isolation feet */
.tt-foot {
  position: absolute;
  width: 38px;
  height: 20px;
  border-radius: 6px 6px 12px 12px;
  background: linear-gradient(90deg, #4d3d2f, #e2ceb4 38%, #7a6652 72%, #2e231a);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.88);
  z-index: 2;
}
.tt-foot.fl { bottom: -4px; left: 24px; }
.tt-foot.fr { bottom: -4px; right: 24px; }
.tt-foot.bl { top: 12%; left: 18px; opacity: 0.65; transform: scale(0.86); }
.tt-foot.br { top: 12%; right: 18px; opacity: 0.65; transform: scale(0.86); }

/* Amber LED under-platter ring */
.tt-amber-ring {
  position: absolute;
  left: 6.5%;
  top: 7%;
  width: 71%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 174, 66, 0.42) 45%, rgba(255, 140, 24, 0.72) 66%, transparent 74%);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0.78;
}

.turntable-rig.is-playing .tt-amber-ring {
  opacity: 1;
  animation: ttAmberPulse 2.6s ease-in-out infinite alternate;
}

@keyframes ttAmberPulse {
  from { transform: scale(0.99); filter: blur(5px) brightness(0.96); }
  to   { transform: scale(1.03); filter: blur(8px) brightness(1.2); }
}

/* Platter & Vinyl Disc Container */
.tt-platter-well {
  position: absolute;
  left: 8%;
  top: 9%;
  width: 68%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.88),
    inset 0 0 0 3px rgba(255, 214, 156, 0.28);
  cursor: pointer;
}

.tt-disc-mover {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.tt-disc-mover.is-swapping-out {
  transform: translate3d(-46%, -12%, 40px) scale(0.86) rotate(-28deg);
  opacity: 0;
}

.tt-disc-mover.is-swapping-in {
  transform: translate3d(38%, -10%, 30px) scale(0.9);
  opacity: 0;
}

.tt-vinyl-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

/* Spinning Center Label (rotates with JS angle) */
.tt-center-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%) rotate(var(--tt-angle, 0deg));
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b1d19, #100907 78%);
  border: 2px solid var(--tt-label-accent, #e89b3c);
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.85),
    0 0 0 3px rgba(15, 10, 8, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  pointer-events: none;
  overflow: hidden;
}

.tt-center-label::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 224, 180, 0.36);
}

.tt-label-monogram {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--tt-label-accent, #f0b44c);
  text-transform: uppercase;
  line-height: 1.1;
}

.tt-label-community {
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  color: rgba(255, 240, 220, 0.84);
  text-transform: uppercase;
  max-width: 86%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.tt-spindle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff5e4, #b59874 60%, #3b2d1f);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* Tonearm Assembly (SVG) */
.tt-tonearm-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(-6px 12px 10px rgba(0, 0, 0, 0.72));
}

.tt-tonearm-pivot {
  transform-origin: 83% 23%;
  transform: rotate(var(--tt-arm-deg, 0deg));
  transition: transform 0.52s cubic-bezier(0.25, 0.9, 0.35, 1);
}

.turntable-rig.is-tracking .tt-tonearm-pivot {
  transition: transform 0.18s linear;
}

/* Hardware Deck Controls on Plinth */
.tt-deck-controls {
  position: absolute;
  left: 8%;
  bottom: 6%;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}

.tt-rpm-btn {
  background: rgba(18, 12, 8, 0.72);
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 224, 180, 0.28);
  color: rgba(255, 232, 204, 0.72);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tt-rpm-btn.is-active {
  background: rgba(232, 155, 60, 0.32);
  color: #fff3df;
  box-shadow: 0 0 12px rgba(255, 168, 60, 0.45), inset 0 1px 0 rgba(255, 235, 200, 0.6);
}

.tt-strobe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6a2b;
  box-shadow: 0 0 8px #ff6a2b;
  opacity: 0.45;
}

.turntable-rig.is-playing .tt-strobe-dot {
  opacity: 1;
  box-shadow: 0 0 12px #ff8533, 0 0 22px #ff5500;
}

@media (max-width: 960px) {
  .turntable-rig {
    width: min(260px, 66vw, 30dvh);
    transform: rotateX(12deg) rotateY(6deg) rotateZ(-2deg);
  }
}
