:root {
  --player-bg:   #101010;
  --cassette-bg: #1d1812;
  --btn-bg:      #242424;
  --text:        #e8e8e8;
  --accent:      #f3a024;
  --accent-dark: #d48a18;
  --muted:       #585858;
  --border:      #282828;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
               'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% 10%, #f7b23a 0%, #bf6010 100%);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(calc(100vh - 48px), auto) auto auto;
  justify-items: center;
  align-items: center;
  min-height: 100vh;
  padding: 24px;
}

/* ── Player shell ──────────────────────────────────────── */
.player-container {
  width: 480px;
  background: var(--player-bg);
  border-radius: 24px;
  padding: 26px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 36px 90px rgba(0, 0, 0, 0.85),
    0 12px 30px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════════
   WALKMAN BODY
   ══════════════════════════════════════════════════════════════ */

.walkman-body {
  /* Brushed-metal horizontal lines + gunmetal dark gradient */
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,        transparent 2px,
      rgba(255,255,255,0.015) 2px, rgba(255,255,255,0.015) 4px
    ),
    linear-gradient(160deg, #545454 0%, #3e3e3e 35%, #2e2e2e 70%, #242424 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.70);
  margin-bottom: 20px;
  position: relative;
  overflow: visible;   /* cassette must be able to eject above the walkman */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 20px 60px rgba(0, 0, 0, 0.85),
    0 8px 24px  rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

/* ── Brand strip ──────────────────────────────────────────── */
.walkman-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
}

.wb-logo {
  font-size: 0.50em;
  font-weight: 800;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
}

/* Playback indicator LED */
.wb-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1c1c1c;
  border: 1px solid rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: background 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
}

.wb-led.active {
  background: var(--accent);
  box-shadow:
    0 0 7px rgba(243, 160, 36, 0.90),
    0 0 2px var(--accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

/* ── Cassette compartment ────────────────────────────────── */
.cassette-compartment {
  margin: 0 12px;
  border-radius: 10px;
  background: #0e0e0e;
  position: relative;
  perspective: 900px;
  perspective-origin: 50% -20%;   /* vanishing point above = realistic lid hinge */
  overflow: visible;
  z-index: 5;
  box-shadow:
    inset 0 4px 18px rgba(0, 0, 0, 0.97),
    inset 0 0 0 1px rgba(0, 0, 0, 0.90),
    0 2px 0 rgba(255, 255, 255, 0.04);
}

/* ── Compartment lid ─────────────────────────────────────── */
.compartment-lid {
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: 10px;

  /* Transparent window in the centre; opaque metal frame around the edges */
  background: transparent;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,        transparent 2px,
      rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 4px
    );

  /* The "frame" is created via inset box-shadow — see-through centre */
  box-shadow:
    inset 0 0 0 14px rgba(56, 56, 56, 0.97),
    inset 0 0 0 15px rgba(0, 0, 0, 0.55),
    0 3px 6px rgba(0, 0, 0, 0.50);

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.50);

  /* Hinge at the TOP of the lid — opens backward */
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lid open state */
.compartment-lid.open {
  transform: rotateX(-105deg);
}

/* Hinge bar at the very top of the lid */
.lid-hinge {
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #606060 0%, #363636 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ── Cassette scene — perspective wrapper for cassette flip ─ */
.cassette-scene {
  perspective: 900px;
  perspective-origin: 50% 50%;
}

/* ── Cassette body ─────────────────────────────────────── */
.cassette {
  width: 100%;
  border: 1px solid #0c0c0c;
  border-radius: 14px;
  margin-bottom: 0;
  overflow: hidden;
  position: relative;

  /* Warm dark-brown plastic + corner screw holes + surface sheen */
  background-color: #1d1812;
  background-image:
    radial-gradient(circle at 18px 18px,
      #070707 3.5px, #2d2822 3.5px, #2d2822 5.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 18px) 18px,
      #070707 3.5px, #2d2822 3.5px, #2d2822 5.5px, transparent 5.5px),
    radial-gradient(circle at 18px calc(100% - 18px),
      #070707 3.5px, #2d2822 3.5px, #2d2822 5.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 18px) calc(100% - 18px),
      #070707 3.5px, #2d2822 3.5px, #2d2822 5.5px, transparent 5.5px),
    linear-gradient(175deg, #272118 0%, #1d1812 45%, #141008 100%);
  background-repeat: no-repeat;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -2px 0 rgba(0, 0, 0, 0.65),
    inset 1px 0 0 rgba(255, 255, 255, 0.025),
    inset -1px 0 0 rgba(255, 255, 255, 0.025),
    0 8px 28px rgba(0, 0, 0, 0.55);
  will-change: transform;
  transform-origin: center center;
}

/* Three-column row: left well | label | right well */
.cassette-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
}

/* ── Reel well — dark circular opening in the cassette shell ── */
.reel-well {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #040404 0%, #0b0b0b 55%, #141414 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    inset 0 6px 18px rgba(0, 0, 0, 0.97),
    inset 0 0 0 1px rgba(0, 0, 0, 0.9),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Centre label / sticker ────────────────────────────── */
.cassette-label {
  flex: 1;
  margin: 0 12px;
  height: 100px;
  position: relative;
  border: 1px solid #2e2922;
  border-radius: 7px;
  overflow: hidden;
  background: #1a1510;
}

/* Cassette sticker — cream/ivory like a real tape label */
.sticker {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  background: linear-gradient(160deg, #f2ede4 0%, #e8e0d2 100%);
}

.sticker-brand {
  font-size: 0.52em;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.sticker-reels {
  font-size: 1.0em;
  color: #c0b8a8;
  letter-spacing: 10px;
}

.track-title {
  font-size: 0.60em;
  color: #6a5a48;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

/* Album art fills the label */
.album-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* Track title bar overlaid on album art */
.art-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.58em;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  display: none;
}

/* ── Reels ─────────────────────────────────────────────── */
.reel {
  position: relative;
  width: 98px;
  height: 98px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  /* 5-spoke design: 10 × 36° alternating dark gap / warm spoke */
  background: repeating-conic-gradient(
    from 18deg,
    #0d0d0d  0deg 20deg,
    #262018  20deg 36deg
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.75);
}

/* Tape coil — border-width driven by JS (22 → 2 px on left, 2 → 22 px on right) */
.reel-tape {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 22px solid #6b4e2e;
  transition: border-width 0.4s ease;
  pointer-events: none;
}

/* Hub — metallic radial gradient with specular highlight */
.hub {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 36% 28%,
    #d0d0d0 0%,
    #909090 25%,
    #505050 60%,
    #282828 100%
  );
  border: 1.5px solid #1a1a1a;
  position: relative;
  z-index: 1;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.70),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.hub::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  background: #0e0e0e;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Spin animations: left CCW (paying out), right CW (taking up) */
@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
.reel-left.spin  { animation: spin-ccw 2s linear infinite; }
.reel-right.spin { animation: spin-cw  2s linear infinite; }

/* ── Tape path (cassette window) ───────────────────────── */
.tape-path {
  height: 28px;
  margin: 0 16px 18px;
  background: #060606;
  border: 1.5px solid #1c1c1c;
  border-top-color: #111;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Guide pegs — small metallic cylinders on each side of the tape window */
.tape-path::before,
.tape-path::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 20px;
  border-radius: 3px;
  background: linear-gradient(90deg, #222 0%, #3c3c3c 45%, #242424 100%);
  border: 1px solid #111;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.tape-path::before { left: 7px; }
.tape-path::after  { right: 7px; }

.tape-strand {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 18px;   /* runs between the guide pegs */
  right: 18px;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #5c4228 0px,  #5c4228 10px,
    #4a3318 10px, #4a3318 12px
  );
  background-size: 12px 100%;
}

.tape-strand.rolling {
  animation: tape-roll 0.22s linear infinite;
}

@keyframes tape-roll {
  from { background-position-x: 0; }
  to   { background-position-x: 12px; }
}

/* ── Now Playing ───────────────────────────────────────── */
.now-playing {
  text-align: center;
  padding: 4px 4px 14px;
}

.track-name {
  font-size: 1.0em;
  font-weight: 600;
  color: #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.1px;
}

.track-meta {
  font-size: 0.78em;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Seek bar ──────────────────────────────────────────── */
.seek-container {
  margin-bottom: 18px;
}

.seek-bar {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 3px;
  background: #1e1e1e;
  outline: none;
  cursor: pointer;
  display: block;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

.seek-bar:disabled {
  opacity: 0.22;
  cursor: default;
}

.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 38% 32%,
    #ffd070 0%,
    var(--accent) 55%,
    var(--accent-dark) 100%
  );
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(243, 160, 36, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.seek-bar:hover:not(:disabled)::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow:
    0 3px 14px rgba(243, 160, 36, 0.70),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

.seek-bar::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.70em;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

/* ── Controls ──────────────────────────────────────────── */
.control-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.file-input { display: none; }

.ctrl-btn {
  background: linear-gradient(180deg, #2c2c2c 0%, #1e1e1e 100%);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-color: rgba(0, 0, 0, 0.5);
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.95em;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s, box-shadow 0.1s;
  line-height: 1;
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.ctrl-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #383838 0%, #2a2a2a 100%);
  box-shadow:
    0 3px 7px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.ctrl-btn:active:not(:disabled) {
  transform: scale(0.92) translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  background: linear-gradient(180deg, #1e1e1e 0%, #282828 100%);
}

.ctrl-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Circular play / pause button */
.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 34%,
    #ffc848 0%,
    var(--accent) 48%,
    var(--accent-dark) 100%
  );
  color: #111;
  font-size: 1.1em;
  font-weight: 700;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 5px 22px rgba(243, 160, 36, 0.58),
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 0.12s, box-shadow 0.14s;
  cursor: pointer;
}

.play-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 8px 30px rgba(243, 160, 36, 0.72),
    0 3px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.play-btn:active:not(:disabled) {
  transform: scale(0.93) translateY(1px);
  box-shadow:
    0 2px 10px rgba(243, 160, 36, 0.38),
    inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ── Audio info strip ──────────────────────────────────── */
.info {
  display: flex;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 12px 6px;
  margin-bottom: 14px;
}

.info-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.info-item + .info-item {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
  font-size: 0.60em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.info-value {
  font-size: 0.86em;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Playlist ──────────────────────────────────────────── */
.playlist-section {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  max-height: 176px;
  display: flex;
  flex-direction: column;
}

.playlist-header {
  padding: 8px 14px;
  font-size: 0.66em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.playlist {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

/* Thin custom scrollbar */
.playlist::-webkit-scrollbar        { width: 3px; }
.playlist::-webkit-scrollbar-track  { background: transparent; }
.playlist::-webkit-scrollbar-thumb  { background: #333; border-radius: 2px; }

.playlist li {
  padding: 8px 14px;
  font-size: 0.80em;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #666;
  transition: background 0.12s, color 0.12s;
}

.playlist li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-handle {
  cursor: grab;
  touch-action: none;
  user-select: none;
  color: #555;
  font-size: 1.1em;
  line-height: 1;
  padding: 2px 2px;
  border-radius: 4px;
}

.pl-handle:hover,
.pl-handle:focus-visible { color: var(--accent); outline: none; }

.pl-remove {
  background: none;
  border: none;
  color: #555;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}

.playlist li:hover .pl-remove,
.pl-remove:focus-visible { opacity: 1; }
.pl-remove:hover { color: #e55; }
@media (hover: none) { .pl-remove { opacity: 1; } }

.playlist.reordering { cursor: grabbing; user-select: none; }
.playlist li.dragging {
  background: rgba(243, 160, 36, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  color: var(--accent);
}

.playlist li:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #aaa;
}

.playlist li.active {
  color: var(--accent);
  background: rgba(243, 160, 36, 0.07);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   PLAYER TOP BAR  (view tabs + theme toggle)
   ══════════════════════════════════════════════════════════════ */

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.view-tabs { display: flex; gap: 6px; }

.view-tab {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 1.0em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, transform 0.12s, box-shadow 0.14s, opacity 0.14s;
  opacity: 0.42;
}
.view-tab:hover {
  background: #3a3a3a;
  transform: scale(1.1);
  opacity: 0.78;
}
.view-tab.active {
  opacity: 1;
  background: rgba(243, 160, 36, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(243, 160, 36, 0.40);
}

/* ══════════════════════════════════════════════════════════════
   VINYL TURNTABLE VIEW
   ══════════════════════════════════════════════════════════════ */

/* ── Turntable chassis ─────────────────────────────────── */
.vinyl-body {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,                transparent 3px,
      rgba(255,255,255,0.008) 3px, rgba(255,255,255,0.008) 6px
    ),
    linear-gradient(160deg, #2e2e2e 0%, #1e1e1e 50%, #181818 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.70);
  margin-bottom: 6px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 20px 60px rgba(0, 0, 0, 0.88),
    0 8px 24px  rgba(0, 0, 0, 0.50),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.turntable-surface {
  display: flex;
  align-items: center;
  padding: 22px 16px 18px;
  gap: 0;
  position: relative;
}

/* ── Platter wrap + platter rim ────────────────────────── */
.platter-wrap {
  flex: 0 0 auto;
  position: relative;
  width: 214px;
  height: 214px;
}

.platter {
  width: 214px;
  height: 214px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    #111 0%, #111 103px,
    #2c2c2c 103px, #1a1a1a 107px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    inset 0 4px 16px rgba(0, 0, 0, 0.85),
    inset 0 -2px 8px rgba(255, 255, 255, 0.03),
    0 4px 22px rgba(0, 0, 0, 0.65);
}

/* Strobe-dot calibration ring on the platter rim — purely decorative,
   evokes the speed-strobe markings on a real turntable mat */
.platter::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255, 255, 255, 0.09) 0deg 1.6deg,
    transparent 1.6deg 9deg
  );
  -webkit-mask: radial-gradient(circle at center, transparent 0, transparent 100px, #000 101px, #000 106px, transparent 107px);
          mask: radial-gradient(circle at center, transparent 0, transparent 100px, #000 101px, #000 106px, transparent 107px);
  pointer-events: none;
}

/* ── Vinyl record (rotates during playback) ────────────── */
.vinyl {
  width: 196px;
  height: 196px;
  border-radius: 50%;
  position: relative;
  z-index: 1; /* keep beneath the tonearm */
  /* Groove bands + label separator ring */
  background:
    radial-gradient(circle at center,
      transparent 0%, transparent 36px,
      rgba(0, 0, 0, 0.55) 36px, rgba(0, 0, 0, 0.55) 39px,
      transparent 39px
    ),
    repeating-radial-gradient(circle at center,
      #111111 0px, #111111 1px,
      #080808 1px, #080808 3px
    ),
    #090909;
  will-change: transform;
  transform-origin: center center;
  /* Rotation itself is driven frame-by-frame in JS (see setVinylMotor /
     vinylMotorTick) so the platter can spin up and coast down with real
     motor inertia instead of snapping instantly to speed. */
  box-shadow: 0 0 0 1px #000;
  transition: box-shadow 0.4s;
}
.vinyl.spinning {
  box-shadow: 0 0 0 1px #000, 0 0 22px rgba(243, 160, 36, 0.10);
}

/* ── Vinyl centre label (rotates with the record) ─────── */
.vinyl-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at center, #1e1408 0%, #2c1e0e 55%, #1a1008 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  border-radius: 50%;
}

.vinyl-label-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  z-index: 1;
  pointer-events: none;
}

.vl-brand {
  font-size: 0.37em;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.vl-sub {
  font-size: 0.30em;
  color: rgba(243, 160, 36, 0.50);
  letter-spacing: 1px;
}

/* Centre spindle hole */
.vinyl-spindle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #050505;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.95);
  z-index: 2;
}

/* ── Shine overlay (sibling of .vinyl — does NOT rotate) ─ */
.vinyl-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg at 50% 50%,
    transparent            0deg,
    rgba(255,255,255,0.11) 20deg,
    transparent            46deg,
    transparent            196deg,
    rgba(255,255,255,0.06) 217deg,
    transparent            238deg
  );
  pointer-events: none;
  z-index: 10;
}

/* ── Tonearm area (right of platter) ───────────────────── */
.tonearm-area {
  /* shrink container so the pivot can sit adjacent to the record edge
     rather than at the far right of a flex-grown area */
  flex: 0 0 8px;
  width: 8px;
  position: relative;
  height: 214px;
}

/* Circular pivot bearing */
.tonearm-base {
  position: absolute;
  top: 16px;
  /* match the wrapper pivot offset so the bearing lines up */
  right: 17px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #909090 0%, #585858 40%, #303030 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 2;
}

/* Cue lever — clicking it lifts/drops the stylus, same as the Play/Pause
   transport button, but styled as the small mechanical lever real
   turntables use to cue a track. */
.cue-lever-mount {
  position: absolute;
  bottom: 6px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 28%, #7a7a7a 0%, #444 55%, #222 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 3;
  cursor: pointer;
}
.cue-lever {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 16px;
  margin: -1px 0 0 -1.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, #d8b46a 0%, #9c7a34 100%);
  transform-origin: 50% 10%;
  transform: rotate(20deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.cue-lever-mount.raised .cue-lever {
  transform: rotate(-18deg);
}

/* Rotating arm assembly — pivot point is at (0, 0) i.e. top-left of this div */
.tonearm-wrapper {
  position: absolute;
  top: 27px;
  right: 17px; /* moved left to align pivot with record edge */
  /* pivot at the wrapper's top-right so the arm rotates toward the record */
  transform-origin: 100% 0;
  transform: rotate(-45deg);   /* start (leftmost) position */
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5; /* highest stacking so arm sits over vinyl */
}

/* Counterweight — small drum behind the pivot, rotates rigidly with the arm */
.tonearm-counterweight {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6a6a6a 0%, #333 55%, #1c1c1c 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 1;
}

/* Lift group — everything below the pivot that rises off the record when
   cueing. translateY + a growing drop-shadow together sell "elevation" in
   a flat 2-D scene. */
.tonearm-lift-group {
  transform: translateY(0);
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.4s ease;
}
.tonearm-lift-group.lifted {
  transform: translateY(-9px);
  filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.55));
}

/* The arm shaft — tapered from base to headshell */
.tonearm-arm {
  width: 7px;
  height: 115px;
  background: linear-gradient(90deg, #3e3e3e 0%, #686868 50%, #3a3a3a 100%);
  border-radius: 3px 3px 1px 1px;
  clip-path: polygon(12% 0%, 88% 0%, 72% 100%, 28% 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

/* Headshell (cartridge mount at the tip) */
.tonearm-headshell {
  width: 16px;
  height: 18px;
  background: linear-gradient(140deg, #585858 0%, #363636 100%);
  border-radius: 2px 2px 5px 5px;
  margin: -3px auto 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  position: relative;
  display: flex;
  justify-content: center;
}

/* Stylus needle */
.tonearm-stylus {
  width: 2px;
  height: 11px;
  background: linear-gradient(180deg, #bbb 0%, #666 100%);
  border-radius: 0 0 1px 1px;
  position: absolute;
  bottom: -10px;
}

/* ── Deck control strip: motor LED + 33⅓ / 45 speed selector ──── */
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 16px 14px;
}

.motor-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a2410;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
  transition: background 0.4s, box-shadow 0.4s;
  flex: 0 0 auto;
}
.motor-led.on {
  background: var(--accent);
  box-shadow: 0 0 6px 1px rgba(243, 160, 36, 0.75);
}

.deck-controls-label {
  font-size: 0.62rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.30);
}
body.light .deck-controls-label { color: rgba(0, 0, 0, 0.34); }

.speed-selector {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
body.light .speed-selector {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

.speed-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
body.light .speed-btn { color: rgba(0, 0, 0, 0.55); }

.speed-btn:hover { color: #fff; }
body.light .speed-btn:hover { color: #000; }

.speed-btn.active {
  background: var(--accent);
  color: #1a1200;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ── Vinyl view — light theme ──────────────────────────── */
body.light .vinyl-body {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,        transparent 3px,
      rgba(0,0,0,0.014) 3px, rgba(0,0,0,0.014) 6px
    ),
    linear-gradient(160deg, #dedad4 0%, #ccc8c2 50%, #c4c0ba 100%);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.22),
    0 4px 14px  rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
/* Vinyl record itself stays dark — it's a black disc regardless of theme */

body.light .view-tab { background: var(--btn-bg); }
body.light .view-tab:hover { background: #d8d4ce; }
body.light .view-tab.active {
  background: rgba(212, 133, 14, 0.14);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(212, 133, 14, 0.30);
}

/* ── Walkman display panel ─────────────────────────────── */
.walkman-display {
  margin: 8px 12px 4px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top-color: rgba(0, 0, 0, 0.12);
  /* track-name + track-meta inside inherit the existing rules */
}

/* ── Walkman transport controls ────────────────────────── */
.walkman-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px 16px;
}

/* Physical Walkman button — raised 3-D look */
.transport-btn {
  background: linear-gradient(180deg, #484848 0%, #2e2e2e 100%);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(0, 0, 0, 0.80);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.92em;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  /* Bottom shadow simulates a raised physical key */
  box-shadow:
    0 4px 0 #161616,
    0 5px 10px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transition: transform 0.07s, box-shadow 0.07s, background 0.10s;
}

.transport-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #545454 0%, #383838 100%);
}

.transport-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #161616,
    0 2px 5px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(0, 0, 0, 0.10);
}

.transport-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

/* Load (eject) button — same shape, slightly wider emoji */
.tb-load {
  cursor: pointer;
  display: inline-block;
  padding: 10px 14px;
  font-size: 1.0em;
}

/* Play / Pause button — round amber key */
.transport-btn.play-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at 40% 34%,
    #ffc848 0%,
    var(--accent) 48%,
    var(--accent-dark) 100%
  );
  color: #111;
  font-size: 1.0em;
  font-weight: 700;
  border: none;
  box-shadow:
    0 4px 0 #8a5800,
    0 6px 22px rgba(243, 160, 36, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transition: transform 0.07s, box-shadow 0.10s;
}

.transport-btn.play-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 5px 0 #8a5800,
    0 8px 28px rgba(243, 160, 36, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.transport-btn.play-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #8a5800,
    0 3px 10px rgba(243, 160, 36, 0.38),
    inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ── Ambient audio-reactive background ────────────────── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  transform-origin: center center;
}

/* Bass — warm orange/red, top-left */
.orb-1 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 70, 10, 0.9) 0%, transparent 65%);
  filter: blur(110px);
  top: -300px;
  left: -280px;
}

/* Treble — indigo/violet, bottom-right */
.orb-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(110, 30, 255, 0.85) 0%, transparent 65%);
  filter: blur(110px);
  bottom: -280px;
  right: -260px;
}

/* Mids — teal/emerald, bottom-centre */
.orb-3 {
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(0, 220, 150, 0.75) 0%, transparent 65%);
  filter: blur(110px);
  bottom: -240px;
  left: calc(50% - 290px);
}

/* ── Marquee for long track names ──────────────────────── */
.track-name {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right, transparent 0%, black 6%, black 94%, transparent 100%
  );
  mask-image: linear-gradient(
    to right, transparent 0%, black 6%, black 94%, transparent 100%
  );
}

.marquee-inner {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 12s linear infinite;
}

@keyframes marquee-scroll {
  0%,  8%  { transform: translateX(0); }
  92%, 100% { transform: translateX(-50%); }
}

/* ── Theme toggle button ───────────────────────────────── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, transform 0.12s;
  z-index: 10;
}

.theme-toggle:hover {
  background: #3a3a3a;
  transform: scale(1.1) rotate(15deg);
}

/* ── YouTube input section ─────────────────────────────── */
.yt-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.yt-badge {
  flex-shrink: 0;
  background: #e00;
  color: #fff;
  font-size: 0.60em;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
}

.yt-url-input {
  flex: 1;
  min-width: 0;
  background: var(--btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.78em;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  font-family: inherit;
}

.yt-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 160, 36, 0.14);
}

.yt-url-input::placeholder {
  color: var(--muted);
}

.yt-load-btn {
  flex-shrink: 0;
  background: #e00;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 0.82em;
  font-weight: 700;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.14s, transform 0.1s;
  letter-spacing: 0.3px;
  font-family: inherit;
}

.yt-load-btn:hover  { background: #c00; }
.yt-load-btn:active { transform: scale(0.93); }

/* ── About / FAQ and footer (below the player) ─────────── */
.site-info {
  width: 100%;
  max-width: 480px;
  margin-top: 16px;
  background: var(--player-bg);
  color: var(--text);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 22px 24px;
  font-size: 0.9em;
  line-height: 1.5;
}

.site-info h2 {
  font-size: 1.1em;
  margin-bottom: 8px;
  color: var(--text);
}

.site-info h3 {
  font-size: 1em;
  margin-top: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.site-info p {
  margin: 0;
}

.site-footer {
  width: 100%;
  max-width: 480px;
  margin-top: 16px;
  padding: 12px 24px;
  background: var(--player-bg);
  color: var(--text);
  border-radius: 24px;
  font-size: 0.85em;
  text-align: center;
}

.site-footer a,
.site-info a {
  color: var(--accent);
}

body.light .site-footer a {
  color: #8a4b00;
  text-decoration: underline;
}

/* Hidden YouTube IFrame container */
#ytPlayerEl {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 200px;
  height: 200px;
  opacity: 0;
  pointer-events: none;
}

/* ── Light theme ───────────────────────────────────────── */
body.light {
  --player-bg:   #f4f1ec;
  --cassette-bg: #dedad4;
  --btn-bg:      #e6e2dc;
  --text:        #1a1a1a;
  --accent:      #d4850e;
  --accent-dark: #b87010;
  --muted:       #8a8680;
  --border:      #cac6c0;

  background: radial-gradient(ellipse at 50% 10%, #fde68a 0%, #f59e20 100%);
}

body.light .player-container {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.22),
    0 4px 14px  rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.07);
}

body.light .theme-toggle {
  border-color: rgba(0, 0, 0, 0.10);
}

body.light .theme-toggle:hover {
  background: #d8d4ce;
}

/* Walkman body — silver-beige */
body.light .walkman-body {
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,    transparent 2px,
      rgba(0,0,0,0.018) 2px, rgba(0,0,0,0.018) 4px
    ),
    linear-gradient(160deg, #c8c4be 0%, #b8b4ae 35%, #acacaa 70%, #a4a0a0 100%);
  border-color: rgba(0, 0, 0, 0.15);
  border-bottom-color: rgba(0, 0, 0, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12),
    0 16px 50px rgba(0, 0, 0, 0.28),
    0 6px 18px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
}

body.light .wb-logo { color: rgba(0, 0, 0, 0.28); }

body.light .wb-led {
  background: #9a9692;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.20);
}

body.light .cassette-compartment {
  background: #d0ccc6;
  box-shadow:
    inset 0 3px 14px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.20);
}

body.light .compartment-lid {
  box-shadow:
    inset 0 0 0 14px rgba(176, 172, 166, 0.97),
    inset 0 0 0 15px rgba(0, 0, 0, 0.12),
    0 3px 6px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.10);
  border-bottom-color: rgba(0, 0, 0, 0.20);
}

body.light .lid-hinge {
  background: linear-gradient(180deg, #c0bcb8 0%, #a0a09e 100%);
}

body.light .walkman-display {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
  border-top-color: rgba(0, 0, 0, 0.12);
}

body.light .transport-btn {
  background: linear-gradient(180deg, #ccc8c2 0%, #b4b0aa 100%);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.22);
  border-bottom-color: rgba(0, 0, 0, 0.38);
  box-shadow:
    0 4px 0 #7a7672,
    0 5px 10px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.light .transport-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #d8d4ce 0%, #c0bcb6 100%);
}

body.light .transport-btn:active:not(:disabled) {
  box-shadow:
    0 1px 0 #7a7672,
    0 2px 5px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* Cassette shell — warm beige plastic */
body.light .cassette {
  background-color: #dedad4;
  background-image:
    radial-gradient(circle at 18px 18px,
      #b0aca6 3.5px, #c8c4be 3.5px, #c8c4be 5.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 18px) 18px,
      #b0aca6 3.5px, #c8c4be 3.5px, #c8c4be 5.5px, transparent 5.5px),
    radial-gradient(circle at 18px calc(100% - 18px),
      #b0aca6 3.5px, #c8c4be 3.5px, #c8c4be 5.5px, transparent 5.5px),
    radial-gradient(circle at calc(100% - 18px) calc(100% - 18px),
      #b0aca6 3.5px, #c8c4be 3.5px, #c8c4be 5.5px, transparent 5.5px),
    linear-gradient(175deg, #e4e0da 0%, #d8d4ce 45%, #ccc8c2 100%);
  border-color: #b8b4b0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(0, 0, 0, 0.10),
    0 6px 18px rgba(0, 0, 0, 0.15);
}

body.light .reel-well {
  background: radial-gradient(circle at center, #888480 0%, #9e9a96 55%, #b0aca8 100%);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 0, 0, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.2);
}

body.light .reel {
  background: repeating-conic-gradient(
    from 18deg,
    #b8b4ae 0deg 20deg,
    #d0ccc6 20deg 36deg
  );
  border-color: rgba(0, 0, 0, 0.10);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light .hub {
  background: radial-gradient(
    circle at 36% 28%,
    #e0dcd8 0%, #b0aca8 30%, #888480 65%, #6a6662 100%
  );
  border-color: #aaa;
}

body.light .hub::after {
  background: #f0ece8;
}

body.light .cassette-label {
  background: #d0ccc6;
  border-color: #bbbbb5;
}

body.light .sticker {
  background: linear-gradient(160deg, #faf7f2 0%, #f0ece6 100%);
}

body.light .sticker-reels {
  color: #c8c0b0;
}

body.light .track-title {
  color: #6a5a48;
}

/* Tape path stays dark */
body.light .tape-path {
  background: #2a2a2a;
  border-color: #444;
}

body.light .tape-path::before,
body.light .tape-path::after {
  background: linear-gradient(90deg, #3c3c3c 0%, #565656 45%, #3c3c3c 100%);
  border-color: #2a2a2a;
}

/* Light theme — controls */
body.light .ctrl-btn {
  background: linear-gradient(180deg, #eae6e0 0%, #dedad4 100%);
  border-color: rgba(0, 0, 0, 0.10);
  border-bottom-color: rgba(0, 0, 0, 0.20);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

body.light .ctrl-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f0ece6 0%, #e6e2dc 100%);
}

body.light .ctrl-btn:active:not(:disabled) {
  background: linear-gradient(180deg, #d8d4ce 0%, #e0dcd6 100%);
}

/* YouTube input — light theme */
body.light .yt-url-input {
  border-color: rgba(0, 0, 0, 0.10);
}

body.light .yt-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 133, 14, 0.15);
}

/* ── Drag-over highlight ───────────────────────────────── */
.player-container.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
  .site-info,
  .site-footer {
    border-radius: 0;
  }

  .player-container {
    width: 100%;
    border-radius: 0;
    padding: 18px;
  }

  .walkman-body,
  .vinyl-body {
    border-radius: 0;
  }

  .platter-wrap,
  .platter {
    width: 174px;
    height: 174px;
  }

  .vinyl {
    width: 160px;
    height: 160px;
  }

  .vinyl-label {
    width: 60px;
    height: 60px;
  }

  .tonearm-area {
    height: 174px;
    flex: 0 0 8px;
    width: 8px;
  }

  .tonearm-arm {
    height: 88px;
  }

  .cassette-compartment {
    margin: 0 8px;
  }

  .walkman-transport {
    gap: 6px;
    padding: 8px 10px 14px;
  }

  .transport-btn {
    padding: 9px 12px;
    font-size: 0.82em;
  }

  .transport-btn.play-btn {
    width: 46px;
    height: 46px;
  }

  .reel-well {
    width: 84px;
    height: 84px;
  }

  .reel {
    width: 74px;
    height: 74px;
  }

  .hub {
    width: 26px;
    height: 26px;
  }

  .hub::after {
    width: 8px;
    height: 8px;
  }

  .cassette-label {
    height: 76px;
  }
}

/* ── Vynx player specific styles ───────────────────────────────────────── */
body.vynx-player {
  background: radial-gradient(circle at center, #0a0a0a, #202020);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.vp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  width: 100%;
  max-width: 480px;
}

.vp-header-left {
  display: flex;
  flex-direction: column;
}

.vp-title {
  font-size: 1.5em;
  margin: 0;
}

.vp-tagline {
  font-size: 0.9em;
  color: var(--muted);
  margin-top: 4px;
}

.vp-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
}

.vp-visualiser {
  margin: 24px 0;
}

.vp-spinner {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #333, #111);
  box-shadow: 0 0 0 8px var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vp-record {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #222, #000);
  position: relative;
}

.vp-label {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.vp-spinner.spin .vp-record {
  animation: spin-cw 3s linear infinite;
}

/* subtle glow around the spinner */
.vp-spinner::before {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(243, 160, 36, 0.4);
  pointer-events: none;
}

/* tighten up button sizes on very small screens */
@media (max-width: 520px) {
  .vp-btn {
    padding: 6px 8px;
    font-size: 1em;
  }
}

.vp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.vp-btn {
  background: var(--btn-bg);
  color: var(--text);
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 1.1em;
  cursor: pointer;
}

.vp-controls .vp-seek {
  flex: 1;
}

.vp-info {
  margin-top: 16px;
  text-align: center;
}

.vp-playlist {
  margin-top: 16px;
  width: 100%;
}

.vp-playlist-list {
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
  padding: 0 16px;
}

.vp-footer {
  margin-top: 24px;
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.vp-load-btn {
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* Sound wave container */
.sound-wave-container {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 120px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s;
}

.sound-wave-bar {
  width: 4px;
  margin: 0 2px;
  background: var(--accent);
  /* height controlled by JS */
}

/* remove generic animation: heights are updated directly */

/* ══════════════════════════════════════════════════════════════
   HELP ICONS & TOOLTIPS
   ══════════════════════════════════════════════════════════════ */

.help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: none;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.help-icon:hover,
.help-icon:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 260px;
  padding: 8px 12px;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  white-space: normal;
  word-break: break-word;
}

.tooltip a {
  color: var(--accent);
  text-decoration: underline;
}

.tooltip--visible {
  display: block;
}

/* Playlist section scrolls via .playlist (overflow-y: auto; flex: 1).
   Override overflow: hidden so tooltips inside the header can escape. */
.playlist-section { overflow: visible; }

/* Visually hidden but readable by screen readers and crawlers (used for the page h1) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
