:root {
  --bg: #05040a;
  --bg-elevated: #0e0a19;
  --bg-card: rgba(20, 14, 36, 0.56);
  --bg-card-hover: rgba(34, 23, 60, 0.72);
  --purple: #8b5cf6;
  --purple-deep: #5b21b6;
  --purple-soft: rgba(139, 92, 246, 0.2);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #f7f4ff;
  --text-muted: #b3a8cf;
  --gold: #e9c46a;
  --gold-bright: #f7de97;
  --gold-soft: rgba(233, 196, 106, 0.16);
  --red: #8b5cf6;
  --red-soft: rgba(139, 92, 246, 0.18);
  --green: #a78bfa;
  --green-soft: rgba(139, 92, 246, 0.24);
  --blue: #d8c4ff;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.65);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --radius: 24px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 14% 0%, rgba(124, 58, 237, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 88% 12%, rgba(233, 196, 106, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(91, 33, 182, 0.22) 0%, #05040a 62%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  opacity: 0.92;
}

.snow-front-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -24px;
  color: rgba(255, 253, 248, 0.96);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 0 26px rgba(233, 196, 106, 0.45);
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity;
  animation: fall linear infinite;
}

.snowflake-front {
  position: absolute;
  top: -20px;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 0 20px rgba(233, 196, 106, 0.35);
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity;
  animation: frontSnowLand var(--fall-dur, 11s) linear forwards;
}

@keyframes frontSnowLand {
  0% {
    transform: translate3d(0, -16px, 0) rotate(0deg) scale(0.92);
    opacity: 0;
  }
  10% {
    opacity: 0.95;
  }
  50% {
    transform: translate3d(var(--sway-x, 18px), calc(var(--land-y, 82vh) * 0.52), 0) rotate(110deg) scale(1);
    opacity: 0.92;
  }
  92% {
    transform: translate3d(var(--end-x, -8px), var(--land-y, 82vh), 0) rotate(210deg) scale(0.94);
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--end-x, -8px), calc(var(--land-y, 82vh) + 4px), 0) rotate(230deg) scale(0.35);
    opacity: 0;
  }
}

/* Snow Puffs Falling Off Bottom Nav Bar When Scrolling Up */
.dock-snow-drop {
  position: fixed;
  pointer-events: none;
  user-select: none;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
  will-change: transform, opacity;
  animation: dockSnowFallOff var(--drop-dur, 0.95s) cubic-bezier(0.32, 0, 0.78, 0.25) forwards;
}

.dock-snow-puff {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, rgba(238, 232, 255, 0.85) 65%, transparent 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  will-change: transform, opacity;
  animation: dockSnowFallOff var(--drop-dur, 0.95s) cubic-bezier(0.32, 0, 0.78, 0.25) forwards;
}

@keyframes dockSnowFallOff {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    opacity: 0.96;
  }
  30% {
    transform: translate3d(calc(var(--drift-x, 10px) * 0.45), 22px, 0) rotate(45deg) scale(0.95);
    opacity: 0.92;
  }
  100% {
    transform: translate3d(var(--drift-x, 14px), var(--drop-y, 145px), 0) rotate(185deg) scale(0.5);
    opacity: 0;
  }
}

/* Gathered Snow Cap on Top of Bottom Navigation Bar */
.dock-snow-drift {
  position: absolute;
  top: -11px;
  left: 16px;
  right: 16px;
  height: 15px;
  pointer-events: none;
  z-index: 4;
  transform-origin: center bottom;
  transform: scaleY(var(--snow-pile, 0));
  opacity: calc(var(--snow-pile, 0) * 1.15);
  filter: drop-shadow(0 -2px 6px rgba(255, 255, 255, 0.45));
  transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
}

.dock-snow-drift.shedding {
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.9, 0.4), opacity 0.34s ease;
  transform: translateY(5px) scaleY(var(--snow-pile, 0));
}

.dock-snow-svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes fall {
  0% {
    transform: translate3d(0, -18px, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.95;
  }
  50% {
    transform: translate3d(22px, 52vh, 0) rotate(120deg);
  }
  90% {
    opacity: 0.85;
  }
  100% {
    transform: translate3d(-12px, 106vh, 0) rotate(240deg);
    opacity: 0;
  }
}

/* Top Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: rgba(14, 9, 28, 0.34);
  backdrop-filter: blur(14px) saturate(185%);
  -webkit-backdrop-filter: blur(14px) saturate(185%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.42), inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.topbar-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.36), rgba(22, 14, 42, 0.72));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35), var(--glass-rim);
}

.brand-logo-svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.25px;
  background: linear-gradient(90deg, #fff4d2 0%, #e9c46a 55%, #d6b6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock-pill {
  font-size: 0.96rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  color: var(--gold-bright);
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), var(--glass-rim);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Buttons — Unified Black, Royal Purple & Champagne Gold Glass */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(28, 20, 50, 0.56);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32), var(--glass-rim);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease, box-shadow 0.2s ease;
}

.btn:hover {
  background: rgba(139, 92, 246, 0.26);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.88), rgba(91, 33, 182, 0.92));
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9d71ff, #6d28d9);
}

.btn-gold {
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #140d24;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(233, 196, 106, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #ffe9ab, #ddb052);
}

.btn-green {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.44), rgba(233, 196, 106, 0.2));
  border-color: transparent;
  color: #fff6dc;
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-red-soft {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e4d4ff;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 0.79rem;
  border-radius: 999px;
}

.btn-icon {
  padding: 7px 10px;
}

/* Audio Unlock Notice */
.audio-unlock-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(233, 196, 106, 0.1));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.audio-unlock-bar.hidden {
  display: none;
}

/* Main Grid */
.main-layout {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 18px;
  padding: 18px 22px 28px;
  max-width: 1580px;
  margin: 0 auto;
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: rgba(18, 12, 36, 0.28);
  backdrop-filter: blur(12px) saturate(175%);
  -webkit-backdrop-filter: blur(12px) saturate(175%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  box-shadow: var(--shadow), var(--glass-rim);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.search-input {
  flex: 1;
  min-width: 140px;
  background: rgba(9, 6, 18, 0.56);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.86rem;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, box-shadow 0.22s ease;
}

.search-input:focus {
  border-color: transparent;
  background: rgba(20, 14, 38, 0.78);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(139, 92, 246, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

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

.tab-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.38), rgba(233, 196, 106, 0.16));
  border-color: transparent;
  color: var(--gold-bright);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

/* Drop zone & Song list */
.dropzone {
  margin: 10px 16px 0;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 11px 14px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(139, 92, 246, 0.07);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.22s ease;
}

.dropzone.dragover {
  border-color: transparent;
  background: rgba(139, 92, 246, 0.26);
  box-shadow: 0 10px 26px rgba(124, 58, 237, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}

.song-list {
  padding: 10px 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: calc(100vh - 235px);
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.song-list::-webkit-scrollbar {
  width: 6px;
}

.song-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.song-card {
  flex-shrink: 0;
  background: rgba(26, 18, 50, 0.26);
  backdrop-filter: blur(6px) saturate(155%);
  -webkit-backdrop-filter: blur(6px) saturate(155%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  padding: 10px 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.11);
  transition: background 0.24s ease, border-color 0.24s ease, box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.song-card:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.song-card:active {
  transform: scale(0.985);
}

.song-card.active {
  border-color: transparent;
  transform: translateY(-2px) scale(1.012);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(38, 24, 70, 0.44) 62%, rgba(233, 196, 106, 0.16));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.58),
    0 6px 24px rgba(124, 58, 237, 0.34),
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    inset 0 -10px 24px rgba(124, 58, 237, 0.14);
}

.song-card.active .song-title {
  color: #ffffff;
}

.song-card.active .song-artist {
  color: #f3e4c3;
}

.song-card.dragging,
.song-card.touch-dragging {
  opacity: 0.88;
  border-color: transparent;
  transform: scale(1.025);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.72), 0 8px 30px rgba(139, 92, 246, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  z-index: 20;
}

.song-card.drag-over {
  border-color: transparent;
  box-shadow: 0 -3px 14px rgba(233, 196, 106, 0.55), 0 10px 24px rgba(0, 0, 0, 0.45);
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  padding: 8px 4px;
  opacity: 0.72;
}

.drag-handle:active {
  cursor: grabbing;
  color: var(--gold);
  opacity: 1;
}

.song-thumb-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d0919;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.48);
}

.song-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-thumb-num {
  position: absolute;
  left: 3px;
  bottom: 3px;
  background: rgba(8, 5, 16, 0.78);
  backdrop-filter: blur(8px);
  color: var(--gold-bright);
  font-size: 0.64rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  border: none;
}

.btn-card-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.88), rgba(91, 33, 182, 0.92));
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.btn-card-play:active {
  transform: scale(0.92);
}

.btn-card-play svg {
  width: 15px;
  height: 15px;
  margin-left: 1px;
}

.song-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.song-title {
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.song-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.song-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge-gold {
  background: rgba(233, 196, 106, 0.16);
  border: none;
  color: var(--gold-bright);
}

.badge-green {
  background: rgba(139, 92, 246, 0.24);
  border: none;
  color: #e4d6ff;
}

.badge-red {
  background: rgba(139, 92, 246, 0.16);
  border: none;
  color: #d7c7f7;
}

.badge-blue {
  background: rgba(139, 92, 246, 0.18);
  border: none;
  color: #dcd0ff;
}

.song-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.schedule-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.schedule-inline input[type="time"] {
  background: rgba(9, 6, 18, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Studio (Right Panel) */
.studio-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ui-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ui-ico-sm {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.now-playing-card {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(20, 13, 38, 0.32) 55%, rgba(233, 196, 106, 0.08));
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 26px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), var(--glass-rim);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.now-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.now-profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  width: 100%;
}

.now-profile-thumb {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.56);
}

.now-title {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
  color: #fff;
}

.now-artist {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.player-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.clean-transport-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-circle-sm {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(139, 92, 246, 0.14);
  backdrop-filter: blur(16px);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.18s ease, box-shadow 0.2s ease, transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-circle-sm svg {
  width: 17px;
  height: 17px;
}

.btn-circle-sm:hover {
  background: rgba(139, 92, 246, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-circle-sm:active {
  transform: scale(0.92);
}

.btn-play-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #5b21b6);
  color: #fff6de;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), filter 0.18s ease, box-shadow 0.2s ease;
}

.btn-play-pill:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-play-pill:active {
  transform: scale(0.95);
}

.btn-play-pill svg {
  width: 16px;
  height: 16px;
  color: var(--gold-bright);
}

.seek-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

input[type="range"] {
  accent-color: var(--gold);
  cursor: pointer;
}

/* Unified Frosted-Glass Pill Rockers (Seek, Master, Volume, Speed, Music, Voice) */
.glass-slider-pill {
  position: relative;
  height: 36px;
  width: 100%;
  border-radius: 999px;
  background: rgba(8, 5, 16, 0.64);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.glass-slider-pill.seek-pill {
  height: 32px;
}

.glass-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.56), rgba(233, 196, 106, 0.52));
  border-radius: 999px;
  pointer-events: none;
  transition: width 0.07s linear;
}

.glass-slider-fill.music-fill {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.6), rgba(196, 165, 255, 0.44));
}

.glass-slider-fill.voice-fill {
  background: linear-gradient(90deg, rgba(233, 196, 106, 0.58), rgba(167, 139, 250, 0.46));
}

.glass-slider-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px;
  pointer-events: none;
}

.glass-slider-pct {
  font-size: 0.84rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.glass-slider-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 248, 230, 0.94);
}

.pill-inline-btn {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

.glass-slider-pill input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 3;
  touch-action: pan-y;
}

.clean-stem-mix .glass-slider-pill {
  flex: 1 1 155px;
}

.seek-wrap .glass-slider-pill {
  flex: 1;
}

.sub-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.control-pill-box {
  background: rgba(14, 9, 30, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.11);
}

.control-pill-inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.control-pill-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
}

.pill-val {
  margin-left: auto;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.mini-reset-btn {
  border: none;
  background: rgba(139, 92, 246, 0.24);
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.clean-stem-mix {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.clean-stem-mix .control-pill-box {
  flex: 1 1 140px;
}

.clean-select,
.clean-time-input,
.clean-num-input {
  background: rgba(9, 6, 18, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.clean-select:focus,
.clean-time-input:focus,
.clean-num-input:focus {
  border-color: transparent;
  background: rgba(20, 14, 38, 0.82);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.clean-num-input {
  width: 52px;
  text-align: center;
  padding: 5px 6px;
}

.clean-check-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

/* YouTube embed area */
.youtube-box {
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  max-height: 250px;
  width: 100%;
}

.youtube-box.hidden {
  display: none;
}

/* Tempo Studio */
.tempo-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: rgba(18, 12, 36, 0.3);
  backdrop-filter: blur(12px) saturate(175%);
  -webkit-backdrop-filter: blur(12px) saturate(175%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), var(--glass-rim);
  padding: 14px 18px;
}

@media (max-width: 720px) {
  .tempo-strip {
    grid-template-columns: 1fr;
  }
}

.bpm-readout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.beat-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f7de97, #7c3aed);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.55);
  transition: transform 0.07s ease, box-shadow 0.07s ease;
}

.beat-orb.pulse {
  transform: scale(1.45);
  background: radial-gradient(circle at 35% 35%, #ffffff, var(--gold));
  box-shadow: 0 0 22px rgba(233, 196, 106, 0.95);
}

.bpm-number {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.bpm-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.tempo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Lyrics Box — Apple Music–Style Living Gradient Aura */
@keyframes appleLyricsAuraA {
  0% {
    transform: translate3d(-12%, -10%, 0) scale(1) rotate(0deg);
    filter: blur(46px) hue-rotate(0deg);
    opacity: 0.62;
  }
  50% {
    transform: translate3d(16%, 14%, 0) scale(1.18) rotate(16deg);
    filter: blur(52px) hue-rotate(28deg);
    opacity: 0.78;
  }
  100% {
    transform: translate3d(-6%, 22%, 0) scale(1.06) rotate(-12deg);
    filter: blur(48px) hue-rotate(-20deg);
    opacity: 0.66;
  }
}

@keyframes appleLyricsAuraB {
  0% {
    transform: translate3d(18%, 18%, 0) scale(1.08) rotate(0deg);
    filter: blur(50px) hue-rotate(0deg);
    opacity: 0.52;
  }
  50% {
    transform: translate3d(-14%, -8%, 0) scale(1.22) rotate(-18deg);
    filter: blur(54px) hue-rotate(-26deg);
    opacity: 0.68;
  }
  100% {
    transform: translate3d(10%, -14%, 0) scale(1.02) rotate(14deg);
    filter: blur(48px) hue-rotate(22deg);
    opacity: 0.56;
  }
}

.lyrics-card {
  position: relative;
  isolation: isolate;
  background: rgba(16, 10, 32, 0.34);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), var(--glass-rim);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 360px;
}

.lyrics-card::before,
.lyrics-card::after {
  content: "";
  position: absolute;
  inset: -28%;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.lyrics-card::before {
  background:
    radial-gradient(circle at 26% 30%, rgba(139, 92, 246, 0.42) 0%, transparent 52%),
    radial-gradient(circle at 78% 72%, rgba(91, 33, 182, 0.38) 0%, transparent 54%);
  animation: appleLyricsAuraA 16s ease-in-out infinite alternate;
}

.lyrics-card::after {
  background:
    radial-gradient(circle at 74% 24%, rgba(233, 196, 106, 0.24) 0%, transparent 48%),
    radial-gradient(circle at 28% 78%, rgba(168, 85, 247, 0.3) 0%, transparent 50%);
  animation: appleLyricsAuraB 21s ease-in-out infinite alternate;
}

.lyrics-toolbar,
.lyrics-display,
.lyrics-editor,
.sync-bar {
  position: relative;
  z-index: 1;
}

.lyrics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.lyrics-display {
  position: relative;
  padding: 24px 24px 96px;
  max-height: 450px;
  overflow-y: auto;
  line-height: 1.75;
  font-size: 1.12rem;
  white-space: pre-wrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.lyric-line {
  padding: 9px 16px;
  margin: 5px 0;
  border-radius: 18px;
  border: none;
  color: rgba(244, 240, 255, 0.56);
  transition: background 0.26s ease, color 0.25s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease;
  cursor: pointer;
}

.lyric-line:hover {
  background: rgba(139, 92, 246, 0.14);
  color: rgba(244, 240, 255, 0.9);
}

.lyric-line.past {
  color: rgba(190, 179, 214, 0.36);
}

.lyric-line.active {
  font-weight: 800;
  font-size: 1.28em;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.32), rgba(233, 196, 106, 0.12));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateX(6px) scale(1.02);
  transform-origin: left center;
}

.lyric-line.active .lyric-text {
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(233, 196, 106, 0.35);
}

.lyric-line .lyric-ts {
  display: inline-block;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  background: rgba(233, 196, 106, 0.16);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
}

.sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(233, 196, 106, 0.14));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
}

.lyrics-editor {
  width: 100%;
  min-height: 340px;
  background: rgba(7, 5, 14, 0.75);
  border: none;
  padding: 16px;
  font-size: 0.96rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 2, 10, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  background: rgba(20, 14, 38, 0.76);
  backdrop-filter: blur(34px) saturate(190%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.76), var(--glass-rim);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field input, .field select, .field textarea {
  background: rgba(8, 5, 16, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.34);
  transition: background 0.2s ease, box-shadow 0.22s ease;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: transparent;
  background: rgba(20, 14, 38, 0.84);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(139, 92, 246, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lookup-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 10px;
}

.lookup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(25, 17, 46, 0.56);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.18s ease;
}

.lookup-item:hover {
  transform: translateY(-1px);
  background: rgba(139, 92, 246, 0.24);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* Undo Song Reorder Pop-Up (Borderless Deep Glass Pill) */
.undo-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(28, 18, 54, 0.8), rgba(12, 8, 24, 0.86));
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 6px 24px rgba(124, 58, 237, 0.3), var(--glass-rim);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  transition: opacity 0.24s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.undo-popup.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
}

.undo-popup-text {
  color: #f6f1ff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.undo-popup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.undo-dismiss-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #d6cceb;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.undo-dismiss-btn:hover {
  background: rgba(139, 92, 246, 0.34);
  color: #ffffff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
  background: rgba(22, 15, 42, 0.82);
  backdrop-filter: blur(26px) saturate(185%);
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #fff6de;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65), var(--glass-rim);
  font-size: 0.88rem;
  font-weight: 600;
  transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

/* Stage / Projector Page */
.stage-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  background: radial-gradient(circle at top center, #1b3d33 0%, #091512 60%, #050c0a 100%);
  overflow: hidden;
  transition: background 0.35s ease;
}

.stage-body[data-stage-theme="midnight"] {
  background: radial-gradient(circle at top center, #19294d 0%, #091124 60%, #040711 100%);
}

.stage-body[data-stage-theme="crimson"] {
  background: radial-gradient(circle at top center, #46131c 0%, #1d070c 60%, #0a0305 100%);
}

.stage-body[data-stage-theme="black"] {
  background: #000000;
}

.stage-hud {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(244, 197, 94, 0.16);
  background: rgba(5, 12, 10, 0.55);
}

.stage-song-info h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 2.1rem);
  color: var(--gold);
}

.stage-song-info p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: clamp(0.9rem, 1.4vw, 1.15rem);
}

.stage-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stage-lyrics-wrap {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 5vw;
  text-align: center;
  overflow-y: auto;
  scrollbar-width: thin;
}

.stage-synced-list {
  display: flex;
  flex-direction: column;
  align-items: var(--stage-flex-align, center);
  gap: 14px;
  max-width: min(1140px, 92vw);
  width: 100%;
  flex: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24vh 20px 30vh;
  scrollbar-width: none;
  text-align: var(--stage-align, center);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
}

.stage-synced-list::-webkit-scrollbar {
  display: none;
}

.stage-line {
  width: 100%;
  max-width: min(1060px, 88vw);
  padding: 10px 18px;
  font-size: var(--stage-font, clamp(1.55rem, 2.9vw, 2.45rem));
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: normal;
  color: #f7f4ec;
  opacity: var(--stage-inactive-opacity, 0.48);
  transform: scale(0.95);
  transform-origin: var(--stage-origin, center center);
  will-change: transform, opacity;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage-line.past {
  opacity: var(--stage-past-opacity, 0.24);
  transform: scale(0.93);
}

.stage-line.active {
  opacity: 1;
  font-weight: 800;
  color: var(--stage-active-color, #ffffff);
  background: transparent;
  box-shadow: none;
  transform: scale(1.05);
}

.stage-line.active .lyric-text {
  color: var(--stage-active-color, #ffffff);
  text-shadow: 0 4px 26px var(--stage-active-glow, rgba(255, 255, 255, 0.38));
}

.stage-plain-lyrics {
  margin: auto 0;
  max-width: min(1040px, 90vw);
  width: 100%;
  padding: 18px 20px;
  font-size: var(--stage-font, clamp(1.45rem, 2.6vw, 2.2rem));
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  text-align: var(--stage-align, center);
  color: #f9f6ee;
}

.stage-footer {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 28px;
  border-top: 1px solid rgba(244, 197, 94, 0.14);
  background: rgba(5, 12, 10, 0.55);
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .stage-hud {
    padding: 10px 14px;
    gap: 10px;
  }

  .stage-right {
    gap: 6px;
  }

  .stage-lyrics-wrap {
    padding: 10px 12px;
  }

  .stage-synced-list {
    max-width: 100%;
    padding: 22vh 6px 26vh;
    gap: 10px;
  }

  .stage-line {
    max-width: 100%;
    padding: 10px 14px;
    font-size: var(--stage-font, clamp(1.2rem, 5vw, 1.7rem));
  }

  .stage-plain-lyrics {
    max-width: 100%;
    padding: 12px 8px;
    font-size: var(--stage-font, clamp(1.1rem, 4.5vw, 1.5rem));
  }

  .stage-footer {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}

/* ---------- Song Number Quick-Jump & Mobile Multi-Page Navigation ---------- */
.song-jump-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 5, 16, 0.28);
}

.jump-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}

.jump-num-input {
  width: 62px;
  background: rgba(9, 6, 18, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  text-align: center;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.32);
  transition: background 0.18s ease, box-shadow 0.2s ease;
}

.jump-num-input:focus {
  border-color: transparent;
  background: rgba(20, 14, 38, 0.8);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.jump-song-select {
  flex: 1;
  min-width: 0;
  background: rgba(9, 6, 18, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.32);
  transition: background 0.18s ease, box-shadow 0.2s ease;
}

.jump-song-select:focus {
  border-color: transparent;
  background: rgba(20, 14, 38, 0.8);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.mobile-bottom-nav,
.mobile-tools-panel,
.mobile-only-song-jump,
.mobile-popup-backdrop {
  display: none;
}

/* ---------- Comprehensive Mobile & Tablet Responsiveness ---------- */
@media (max-width: 900px) {
  body:not(.stage-body) {
    padding-bottom: 138px;
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: 10px 14px;
    gap: 8px;
  }

  .topbar-main-row {
    gap: 10px;
  }

  .topbar-actions {
    display: none !important;
  }

  .main-layout {
    padding: 10px 12px 16px;
    gap: 12px;
  }

  .mobile-only-song-jump {
    display: block;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 5, 16, 0.24);
  }

  /* Floating Frosted-Glass Bottom Navigation Dock */
  .mobile-bottom-nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 55;
    padding: 7px 11px 10px;
    border-radius: 28px;
    background: linear-gradient(155deg, rgba(24, 16, 48, 0.48), rgba(10, 7, 22, 0.56));
    backdrop-filter: blur(16px) saturate(190%);
    -webkit-backdrop-filter: blur(16px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.72), 0 6px 26px rgba(124, 58, 237, 0.22), var(--glass-rim);
  }

  .mobile-dock-swipe-area {
    display: flex;
    flex-direction: column;
    gap: 5px;
    touch-action: pan-x;
  }

  .dock-grab-pill {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    margin: 0 auto;
  }

  .mobile-dock-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-dock-track-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    padding: 2px;
    text-align: left;
    cursor: pointer;
  }

  .mobile-dock-thumb {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.52);
  }

  .mobile-dock-text-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-dock-title-text {
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dock-hint {
    font-size: 0.68rem;
    color: var(--gold-bright);
    font-weight: 600;
    opacity: 0.9;
  }

  .mobile-dock-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
  }

  .mobile-dock-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.72), rgba(91, 33, 182, 0.86));
    color: var(--gold-bright);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-dock-play-btn:active {
    transform: scale(0.92);
  }

  .mobile-dock-play-btn svg {
    width: 16px;
    height: 16px;
  }

  .mobile-dock-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 18px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: #cfc6e8;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.15;
    transition: background 0.24s ease, color 0.22s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
  }

  .mobile-nav-btn:active {
    transform: scale(0.94);
  }

  .mobile-nav-svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-btn.active {
    background: linear-gradient(135deg, #f7de97, #cfa045);
    border: none;
    color: #160f03;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(233, 196, 106, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  /* Smooth Page Transitions on Mobile */
  body[data-mobile-page] #lineupPanel,
  body[data-mobile-page] #studioPanel,
  body[data-mobile-page] #mobileToolsPanel {
    animation: mobilePageFadeSlide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
  }

  @keyframes mobilePageFadeSlide {
    from {
      opacity: 0.38;
      transform: translateY(12px) scale(0.99);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* Two-Stage Pop-Up Glass Sheet (Controls + Spotify-Style Live Lyrics) */
  .mobile-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(4, 2, 10, 0.64);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px 10px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-popup-backdrop.hidden {
    display: none;
  }

  .mobile-popup-sheet {
    width: 100%;
    max-width: 470px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    animation: mobilePopupSlideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes mobilePopupSlideUp {
    from {
      opacity: 0;
      transform: translateY(40px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .mobile-popup-handle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 2px;
    touch-action: none;
  }

  .mobile-popup-handle {
    width: 46px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    margin: 0 auto;
    transform: translateX(34px);
  }

  .mobile-popup-stage-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-popup-pill-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(139, 92, 246, 0.28);
    backdrop-filter: blur(18px);
    color: var(--gold-bright);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.14s ease, background 0.18s ease;
  }

  .mobile-popup-pill-btn:active {
    transform: scale(0.94);
  }

  .mobile-popup-close-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(22, 14, 42, 0.72);
    backdrop-filter: blur(18px);
    color: #ffffff;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .mobile-popup-controls-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-popup-lyrics-view {
    position: relative;
    isolation: isolate;
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-radius: 28px;
    background: rgba(14, 9, 28, 0.62);
    backdrop-filter: blur(22px) saturate(195%);
    -webkit-backdrop-filter: blur(22px) saturate(195%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.76), var(--glass-rim);
    overflow: hidden;
  }

  .mobile-popup-lyrics-view::before,
  .mobile-popup-lyrics-view::after {
    content: "";
    position: absolute;
    inset: -30%;
    z-index: 0;
    pointer-events: none;
    will-change: transform, opacity, filter;
  }

  .mobile-popup-lyrics-view::before {
    background:
      radial-gradient(circle at 22% 26%, rgba(139, 92, 246, 0.52) 0%, transparent 54%),
      radial-gradient(circle at 80% 76%, rgba(109, 40, 217, 0.48) 0%, transparent 56%);
    animation: appleLyricsAuraA 14s ease-in-out infinite alternate;
  }

  .mobile-popup-lyrics-view::after {
    background:
      radial-gradient(circle at 76% 22%, rgba(233, 196, 106, 0.3) 0%, transparent 48%),
      radial-gradient(circle at 24% 78%, rgba(192, 132, 252, 0.36) 0%, transparent 52%);
    animation: appleLyricsAuraB 19s ease-in-out infinite alternate;
  }

  .spotify-lyrics-header,
  .spotify-lyrics-scroll {
    position: relative;
    z-index: 1;
  }

  #mobilePopupBackdrop[data-stage="lyrics"] .mobile-popup-sheet {
    height: 86dvh;
  }

  #mobilePopupBackdrop[data-stage="lyrics"] .mobile-popup-controls-view {
    display: none;
  }

  #mobilePopupBackdrop[data-stage="lyrics"] .mobile-popup-lyrics-view {
    display: flex;
    animation: mobilePageFadeSlide 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .lyrics-pull-cue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(22, 14, 42, 0.64);
    backdrop-filter: blur(22px);
    color: var(--gold-bright);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  .spotify-lyrics-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.24);
  }

  .spotify-lyrics-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
  }

  .spotify-lyrics-title {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .spotify-lyrics-artist {
    font-size: 0.8rem;
    color: rgba(236, 224, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .spotify-lyrics-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 22px 64px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
  }

  .spotify-lyric-line {
    font-size: 1.32rem;
    font-weight: 800;
    line-height: 1.42;
    color: rgba(236, 224, 255, 0.46);
    cursor: pointer;
    transition: color 0.25s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    transform-origin: left center;
  }

  .spotify-lyric-line.past {
    color: rgba(215, 200, 245, 0.28);
  }

  .spotify-lyric-line.active {
    color: var(--gold-bright);
    transform: scale(1.05);
    text-shadow: 0 4px 22px rgba(233, 196, 106, 0.5);
  }

  .spotify-plain-lyrics {
    font-size: 1.15rem;
    line-height: 1.75;
    white-space: pre-wrap;
    color: rgba(246, 241, 255, 0.88);
  }

  .glass-card {
    background: linear-gradient(155deg, rgba(28, 18, 54, 0.44), rgba(12, 8, 26, 0.54));
    backdrop-filter: blur(16px) saturate(190%);
    -webkit-backdrop-filter: blur(16px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 26px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6), var(--glass-rim);
    padding: 13px;
  }

  .mobile-vol-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
  }

  .mobile-stem-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mobile-stem-pills.hidden {
    display: none;
  }

  .mobile-vol-card .glass-slider-pill {
    height: 46px;
  }

  .mobile-vol-card .glass-slider-content {
    padding: 0 16px;
  }

  .mobile-vol-card .glass-slider-pct {
    font-size: 0.92rem;
  }

  .mobile-vol-card .glass-slider-label {
    font-size: 0.82rem;
  }

  .mobile-track-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
  }

  .mobile-track-top {
    display: flex;
    align-items: center;
    gap: 11px;
  }

  .mobile-track-art-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  }

  .mobile-track-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .mobile-track-num-chip {
    position: absolute;
    left: 3px;
    bottom: 3px;
    background: rgba(8, 5, 16, 0.8);
    color: var(--gold-bright);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
  }

  .mobile-track-meta {
    flex: 1;
    min-width: 0;
  }

  .mobile-track-title {
    font-size: 0.98rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-track-artist {
    font-size: 0.78rem;
    color: rgba(226, 215, 247, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-mode-pills {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
  }

  .mini-pill {
    border: none;
    background: rgba(139, 92, 246, 0.16);
    color: #efe9ff;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mini-pill.active {
    background: linear-gradient(135deg, #f7de97, #cfa045);
    border: none;
    color: #160f03;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), 0 2px 12px rgba(233, 196, 106, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  .mobile-seek-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .popup-seek-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 26px;
    margin: 0;
    background: transparent;
    outline: none;
  }

  .popup-seek-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      #8b5cf6 0%,
      #e9c46a var(--seek-pct, 0%),
      rgba(255, 255, 255, 0.18) var(--seek-pct, 0%),
      rgba(255, 255, 255, 0.18) 100%
    );
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  .popup-seek-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--gold-bright);
    border: 2.5px solid #2b1457;
    box-shadow: 0 2px 12px rgba(233, 196, 106, 0.7);
  }

  .popup-seek-range::-moz-range-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
  }

  .popup-seek-range::-moz-range-progress {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #8b5cf6, #e9c46a);
  }

  .popup-seek-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold-bright);
    border: 2.5px solid #2b1457;
    box-shadow: 0 2px 12px rgba(233, 196, 106, 0.7);
  }

  .mobile-seek-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: rgba(226, 215, 247, 0.74);
    font-variant-numeric: tabular-nums;
  }

  .mobile-transport-card {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 14px;
  }

  .transport-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(139, 92, 246, 0.14);
    color: #ffffff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: background 0.18s ease, box-shadow 0.22s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .transport-icon-btn:active {
    transform: scale(0.92);
  }

  .transport-icon-btn svg {
    width: 19px;
    height: 19px;
  }

  .transport-icon-btn.active {
    background: rgba(139, 92, 246, 0.48);
    border: none;
    color: var(--gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  }

  .transport-main-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.84), rgba(91, 33, 182, 0.92));
    color: var(--gold-bright);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .transport-main-btn:active {
    transform: scale(0.93);
  }

  .transport-main-btn svg {
    width: 26px;
    height: 26px;
  }

  /* Mobile Page Switching */
  body[data-mobile-page="lineup"] #studioPanel,
  body[data-mobile-page="lineup"] #mobileToolsPanel {
    display: none;
  }

  body[data-mobile-page="lineup"] .song-list {
    max-height: none;
    overflow-y: visible;
    padding-bottom: 16px;
  }

  body[data-mobile-page="playing"] #lineupPanel,
  body[data-mobile-page="playing"] #mobileToolsPanel,
  body[data-mobile-page="playing"] #stemStudioCard {
    display: none;
  }

  body[data-mobile-page="studio"] #lineupPanel,
  body[data-mobile-page="studio"] #mobileToolsPanel,
  body[data-mobile-page="studio"] .lyrics-card,
  body[data-mobile-page="studio"] .now-playing-card .sub-controls,
  body[data-mobile-page="studio"] #youtubeOfflineActions {
    display: none !important;
  }

  body[data-mobile-page="tools"] #lineupPanel,
  body[data-mobile-page="tools"] #studioPanel {
    display: none;
  }

  body[data-mobile-page="tools"] #mobileToolsPanel {
    display: flex;
  }

  .mobile-tools-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .mobile-tool-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(20, 14, 38, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 22px;
    padding: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), var(--glass-rim);
  }

  .mobile-tool-heading {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
  }

  .mobile-tool-group .btn,
  .mobile-tool-group a.btn {
    width: 100%;
    justify-content: center;
  }

  .studio-body {
    padding: 12px;
    gap: 12px;
  }

  .undo-popup {
    left: 12px;
    right: 12px;
    bottom: 132px;
    border-radius: 24px;
    padding: 10px 12px 10px 16px;
  }
}

@media (max-width: 640px) {
  .brand h1 {
    font-size: 0.96rem;
  }

  .brand p {
    font-size: 0.72rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
  }

  .brand-logo-svg {
    width: 22px;
    height: 22px;
  }

  .clock-pill {
    font-size: 0.82rem;
    padding: 5px 11px;
  }

  .audio-unlock-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 8px;
    font-size: 0.84rem;
  }

  .main-layout {
    padding: 8px 8px 14px;
    gap: 10px;
  }

  .panel-header {
    flex-wrap: wrap;
    padding: 11px 12px;
    gap: 8px;
  }

  .toolbar {
    padding: 8px 12px;
  }

  .song-jump-bar {
    padding: 7px 12px;
  }

  .dropzone {
    margin: 8px 12px 0;
    padding: 9px 10px;
    font-size: 0.78rem;
  }

  .song-list {
    padding: 8px 10px 20px;
  }

  .song-card {
    padding: 9px 11px;
  }

  .song-card-bottom {
    flex-wrap: wrap;
    gap: 6px;
  }

  .studio-body {
    padding: 10px;
    gap: 10px;
  }

  .now-playing-card {
    padding: 13px;
    gap: 11px;
  }

  .now-header > div {
    min-width: 0;
    max-width: 100%;
  }

  .now-title {
    font-size: 1.18rem;
    overflow-wrap: anywhere;
  }

  .player-controls-row {
    gap: 8px;
  }

  .player-controls-row #playPauseBtn {
    flex: 1;
    min-width: 0 !important;
  }

  .seek-wrap {
    flex: 1 1 100%;
    min-width: 0;
    order: 10;
    padding-top: 2px;
  }

  .sub-controls {
    gap: 9px;
  }

  .sub-controls .control-group {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .sub-controls .control-group input[type="range"] {
    flex: 1;
    min-width: 110px;
    width: auto !important;
  }

  #stemStudioCard {
    padding: 12px 13px;
  }

  #stemStudioCard select {
    max-width: 100%;
    flex: 1 1 160px;
  }

  #stemMixSliders {
    width: 100%;
    gap: 8px !important;
  }

  #stemMixSliders .glass-slider-pill {
    flex: 1 1 135px;
    min-width: 0;
  }

  .lyrics-card {
    min-height: 260px;
  }

  .lyrics-toolbar {
    padding: 9px 12px;
    gap: 8px;
  }

  .lyrics-display {
    padding: 16px 12px 64px;
    max-height: 52vh;
    font-size: 1rem;
  }

  .lyric-line {
    padding: 6px 10px;
  }

  .lyric-line.active {
    font-size: 1.14em;
    transform: translateX(2px) scale(1.01);
  }

  .lyrics-editor {
    min-height: 240px;
    padding: 12px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    padding: 16px;
    max-height: 94dvh;
    border-radius: 24px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 128px;
    text-align: center;
    font-size: 0.84rem;
  }
}

@media (max-width: 390px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .stage-hud {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .stage-right {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .stage-hud {
    padding: 6px 14px;
  }

  .stage-synced-list {
    padding: 12vh 12px 16vh;
  }

  .stage-footer {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

@media (pointer: coarse) {
  .btn {
    min-height: 36px;
  }

  .btn-sm {
    min-height: 33px;
  }

  input[type="range"]:not(.clean-slider):not(.popup-seek-range) {
    min-height: 28px;
  }
}

.hidden {
  display: none !important;
}
