.performance-controls {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  pointer-events: none;
  z-index: 10;
}

.foot-stream-panel {
  position: fixed;
  inset: 17.5vh auto auto 0;
  width: max(20vw, 320px);
  max-width: 100vw;
  height: 82.5vh;
  overflow: hidden;
  border-bottom: 1px solid rgb(255 255 255 / 18%);
  border-radius: 0 0 0.8rem 0;
  background: linear-gradient(90deg, rgb(3 7 17 / 68%), rgb(12 16 31 / 52%));
  box-shadow: 0.8rem 0.8rem 2.2rem rgb(0 0 0 / 28%);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  pointer-events: none;
  z-index: 5;
}

.lyrics-panel {
  position: fixed;
  inset: 0 auto auto 0;
  width: max(20vw, 320px);
  max-width: 100vw;
  height: 17.5vh;
  overflow: hidden;
  background: linear-gradient(90deg, rgb(3 7 17 / 68%), rgb(12 16 31 / 52%));
  box-shadow: 0.8rem 0.8rem 2.2rem rgb(0 0 0 / 28%);
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  pointer-events: none;
  z-index: 5;
}

/* Keep the source canvases measurable and rendering while their Three.js
   counterparts provide the visible, camera-mounted HUD. */
.camera-hud-active .foot-stream-panel,
.camera-hud-active .lyrics-panel {
  opacity: 0;
}

#lyrics {
  display: block;
  width: 100%;
  height: 100%;
}

#dance-leg-preview,
#foot-stream {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
}

#dance-leg-preview {
  top: 0;
  height: var(--foot-now-position, 30%);
  z-index: 2;
}

#foot-stream {
  top: 0;
  bottom: 0;
  height: 100%;
  z-index: 1;
}

@media (max-width: 639px) {
  .foot-stream-panel,
  .lyrics-panel {
    background: linear-gradient(90deg, rgb(3 7 17 / 34%), rgb(12 16 31 / 26%));
    backdrop-filter: blur(7px) saturate(125%);
    -webkit-backdrop-filter: blur(7px) saturate(125%);
  }
}

.play-song {
  min-width: 12rem;
  padding: 1rem 1.6rem;
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: 999px;
  color: #fff;
  background: rgb(10 12 24 / 78%);
  box-shadow: 0 0.8rem 3rem rgb(0 0 0 / 55%), inset 0 0 1.2rem rgb(106 172 255 / 16%);
  backdrop-filter: blur(12px);
  font: 700 1.05rem/1 system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease;
}

.play-song:hover:not(:disabled) {
  transform: scale(1.04);
  background: rgb(22 28 52 / 88%);
}

.play-song:disabled {
  cursor: wait;
  opacity: 0.7;
}

.play-song.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-status {
  max-width: min(34rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 0.55rem;
  color: #ffd9df;
  background: rgb(48 8 18 / 82%);
  text-align: center;
  font: 500 0.9rem/1.4 system-ui, sans-serif;
}

.song-menu {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgb(2 3 8 / 48%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.song-menu[hidden] {
  display: none;
}

.song-menu-card {
  width: min(30rem, 100%);
  max-height: min(42rem, calc(100vh - 2.5rem));
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgb(18 23 43 / 96%), rgb(7 9 20 / 96%));
  box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 62%);
  text-align: center;
}

.song-menu-card h1 {
  margin: 0;
  font: 900 clamp(1.45rem, 5vw, 2.2rem)/1.1 system-ui, sans-serif;
}

.song-menu-card p {
  margin: 0.65rem 0 1.1rem;
  color: rgb(232 237 255 / 72%);
  font: 600 0.9rem/1.35 system-ui, sans-serif;
}

.song-list {
  display: grid;
  gap: 0.65rem;
}

.song-choice {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 0.75rem;
  color: #fff;
  background: rgb(38 48 86 / 72%);
  font: 800 1rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.song-choice:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgb(58 75 132 / 88%);
}

.song-choice:disabled {
  cursor: wait;
  opacity: 0.5;
}
