/*
 * Suitcase record player. Every rule is scoped under .dsp-suitcase-portable.
 * Sizes are in cqw (1cqw = 1% of the stage width) or inside an SVG viewBox.
 * The script places each part with inline cqw offsets; this file styles them.
 */

.dsp-suitcase-portable {
  background: #3b2415;
  color: #3d2a1a;
  font-family: "Jost", "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
}

.dsp-suitcase-portable .sp-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.dsp-suitcase-portable .sp-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.dsp-suitcase-portable .sp-part {
  position: absolute;
  display: block;
  pointer-events: none;
}

.dsp-suitcase-portable .sp-part > svg,
.dsp-suitcase-portable .sp-fill {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dsp-suitcase-portable .sp-moves {
  will-change: transform;
}

/* ---- type ----------------------------------------------------------------- */

.dsp-suitcase-portable .sp-caps {
  font-family: "Jost", "Futura", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 600;
}

.dsp-suitcase-portable .sp-script {
  font-family: "Yellowtail", "Brush Script MT", "Snell Roundhand", cursive;
}

.dsp-suitcase-portable .sp-hand {
  font-family: "Caveat", "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
}

/*
 * ---- the case ----------------------------------------------------------------
 * The case is its own container, so inside it 1cqw is 1% of the case's width
 * and every part keeps the unit coordinates it was drawn in.
 */

.dsp-suitcase-portable .sp-case {
  position: absolute;
  container-type: inline-size;
  pointer-events: none;
}

/* Its box reaches up behind the lid, so it takes no pointer; only its controls do. */
.dsp-suitcase-portable .sp-base {
  position: absolute;
  pointer-events: none;
}

.dsp-suitcase-portable .sp-shadows {
  overflow: visible;
}

/* The lid stands up: the script tilts its free edge toward the camera, about the hinge. */
.dsp-suitcase-portable .sp-lid {
  transform-origin: 50% 100%;
}

/* ---- platter and record ---------------------------------------------------- */

.dsp-suitcase-portable .sp-spin {
  transform-origin: 50% 50%;
}

.dsp-suitcase-portable .sp-shade {
  border-radius: 50%;
  background:
    radial-gradient(circle 23cqw at 51.2% 51.6%, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0.55) 95.8%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0.16) 100%);
}

.dsp-suitcase-portable .sp-shine {
  border-radius: 50%;
  transform-origin: 50% 50%;
  background:
    conic-gradient(
      from 0deg,
      rgba(255, 255, 255, 0) 0deg,
      rgba(255, 255, 255, 0) 96deg,
      rgba(255, 255, 255, 0.05) 112deg,
      rgba(255, 255, 255, 0.2) 131deg,
      rgba(255, 255, 255, 0.07) 148deg,
      rgba(255, 255, 255, 0) 166deg,
      rgba(255, 255, 255, 0) 268deg,
      rgba(255, 255, 255, 0.07) 286deg,
      rgba(255, 255, 255, 0.2) 300deg,
      rgba(255, 252, 240, 0.5) 313deg,
      rgba(255, 255, 255, 0.22) 324deg,
      rgba(255, 255, 255, 0.06) 340deg,
      rgba(255, 255, 255, 0) 356deg
    );
  -webkit-mask-image: radial-gradient(circle closest-side, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 51.4%, #000 52.4%, #000 60.6%, rgba(0, 0, 0, 0.72) 61.6%, rgba(0, 0, 0, 0.72) 95.6%, #000 96.4%, #000 97.2%, rgba(0, 0, 0, 0) 98.2%);
  mask-image: radial-gradient(circle closest-side, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 51.4%, #000 52.4%, #000 60.6%, rgba(0, 0, 0, 0.72) 61.6%, rgba(0, 0, 0, 0.72) 95.6%, #000 96.4%, #000 97.2%, rgba(0, 0, 0, 0) 98.2%);
}

/* ---- speaker ---------------------------------------------------------------- */

.dsp-suitcase-portable .sp-cone {
  border-radius: 50%;
  transform-origin: 50% 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(255, 240, 215, 0.22) 0, rgba(255, 240, 215, 0) 30%),
    repeating-radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 5.5%, rgba(0, 0, 0, 0.22) 6.5%, rgba(0, 0, 0, 0) 7.5%),
    radial-gradient(circle at 50% 50%, #8a7a66 0, #7a6a58 13%, #2a221b 15.5%, #6f6253 19%, #5d5145 44%, #3f362d 72%, #17120e 75%, #241d17 84%, #4d443a 88%, #2b241d 100%);
}

.dsp-suitcase-portable .sp-cone-glint {
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 236, 200, 0.75) 0, rgba(255, 226, 180, 0.4) 16%, rgba(255, 226, 180, 0.22) 44%, rgba(255, 226, 180, 0) 74%);
  will-change: opacity;
}

/* ---- controls --------------------------------------------------------------- */

.dsp-suitcase-portable button {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.dsp-suitcase-portable button:focus {
  outline: none;
}

.dsp-suitcase-portable .sp-key:focus-visible,
.dsp-suitcase-portable .sp-repeat:focus-visible,
.dsp-suitcase-portable .sp-lever:focus-visible,
.dsp-suitcase-portable .sp-knob:focus-visible,
.dsp-suitcase-portable .sp-disc-hit:focus-visible {
  outline: max(2px, 0.5cqw) solid #fffdf5;
  outline-offset: 0.2cqw;
  box-shadow: 0 0 0 1.1cqw rgba(16, 38, 60, 0.82);
}

.dsp-suitcase-portable .sp-key {
  border-radius: 1.4cqw;
}

.dsp-suitcase-portable .sp-key-cap {
  transform-origin: 50% 60%;
}

/* The key reads PLAY at rest; the script shows STOP while the song plays. */
.dsp-suitcase-portable .sp-key-stop {
  opacity: 0;
}

.dsp-suitcase-portable .sp-key-glow {
  opacity: 0;
  will-change: opacity;
}

.dsp-suitcase-portable .sp-lever {
  border-radius: 1.2cqw;
}

.dsp-suitcase-portable .sp-repeat {
  border-radius: 1.6cqw;
}

.dsp-suitcase-portable .sp-repeat-cap {
  transform-origin: 50% 50%;
}

.dsp-suitcase-portable .sp-knob {
  border-radius: 50%;
  touch-action: none;
  cursor: grab;
}

.dsp-suitcase-portable .sp-knob:active {
  cursor: grabbing;
}

/* An SVG group measures its origin from the user-space origin, which is the knob's center. */
.dsp-suitcase-portable .sp-knob-rot {
  transform-origin: 0 0;
}

.dsp-suitcase-portable .sp-disc-hit {
  border-radius: 50%;
}

.dsp-suitcase-portable .sp-lamp-glow {
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff7d6 0, #ffb07a 16%, #ff4a2a 30%, rgba(255, 64, 30, 0.42) 46%, rgba(255, 64, 30, 0) 70%);
  will-change: opacity;
}

/* ---- tonearm ---------------------------------------------------------------- */

.dsp-suitcase-portable .sp-arm,
.dsp-suitcase-portable .sp-arm-shadow {
  transform-origin: 50% 14.8148%;
}

.dsp-suitcase-portable .sp-arm {
  pointer-events: none;
  touch-action: none;
  cursor: grab;
}

.dsp-suitcase-portable .sp-arm-hit {
  pointer-events: all;
  touch-action: none;
  cursor: grab;
}

.dsp-suitcase-portable .sp-arm.is-held .sp-arm-hit {
  cursor: grabbing;
}

.dsp-suitcase-portable .sp-arm-ring {
  opacity: 0;
}

.dsp-suitcase-portable .sp-arm:focus-visible .sp-arm-ring {
  opacity: 1;
}

.dsp-suitcase-portable .sp-arm-shadow {
  opacity: 0.55;
}

/* ---- one lamp, one lens: a warm bloom from the upper left and a soft vignette ---- */

.dsp-suitcase-portable .sp-light {
  background:
    radial-gradient(90cqw 80cqw at 16cqw 6cqw, rgba(255, 238, 205, 0.16) 0, rgba(255, 238, 205, 0) 60%),
    radial-gradient(120cqw 120cqw at 46cqw 44cqw, rgba(0, 0, 0, 0) 52%, rgba(24, 12, 2, 0.3) 100%);
}

/*
 * ---- scene: the table runs out across the band ------------------------------
 * The backdrop paints the same walnut over the whole band, so the square's own
 * table hides. The lamplight layer grows to the band's size with its gradients
 * pinned to the same stage points, so the light falls exactly as it did.
 */

.dsp-scene .dsp-suitcase-portable {
  background: transparent;
}

.dsp-scene .dsp-suitcase-portable .sp-ground {
  display: none;
}

.dsp-scene .dsp-suitcase-portable .sp-light {
  inset: auto;
  left: -150cqw;
  top: -30cqw;
  width: 400cqw;
  height: 160cqw;
  background:
    radial-gradient(90cqw 80cqw at 166cqw 36cqw, rgba(255, 238, 205, 0.16) 0, rgba(255, 238, 205, 0) 60%),
    radial-gradient(120cqw 120cqw at 196cqw 74cqw, rgba(0, 0, 0, 0) 52%, rgba(24, 12, 2, 0.3) 100%);
}

.dsp-backdrop-suitcase-portable .sp-bd {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
