:root {
  --bg: #05040a;
  --bg-elevated: #0e0a19;
  --purple: #8b5cf6;
  --purple-deep: #5b21b6;
  --text: #f7f4ff;
  --text-muted: #b3a8cf;
  --gold: #e9c46a;
  --gold-bright: #f7de97;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 22px 54px rgba(0, 0, 0, 0.65);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.24);
}

* {
  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 {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Calm See-Through Snowfall Behind Glass */
.snow-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  opacity: 0.9;
}

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

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

/* Minimal Top Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 14px 32px;
  background: rgba(14, 9, 28, 0.36);
  backdrop-filter: blur(16px) saturate(185%);
  -webkit-backdrop-filter: blur(16px) saturate(185%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.topbar-main-row {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.38), rgba(22, 14, 42, 0.75));
  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 h1 {
  margin: 0;
  font-size: 1.28rem;
  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;
}

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

/* Main PC Workspace */
.pc-stage {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

/* ---------- SCREEN 1: Large Song Tiles Grid (PC Optimized) ---------- */
.tiles-view {
  animation: smoothViewEnter 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.song-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.song-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 215px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 28px;
  background: rgba(24, 16, 46, 0.34);
  backdrop-filter: blur(14px) saturate(175%);
  -webkit-backdrop-filter: blur(14px) saturate(175%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.46), var(--glass-rim);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.24s ease;
}

.song-tile-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.36;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  pointer-events: none;
}

.song-tile-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 6, 22, 0.22) 0%,
    rgba(12, 8, 26, 0.52) 48%,
    rgba(8, 5, 18, 0.88) 100%
  );
  pointer-events: none;
}

.song-tile:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: transparent;
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.68),
    0 8px 30px rgba(124, 58, 237, 0.34),
    inset 0 1px 1px rgba(255, 255, 255, 0.28);
}

.song-tile:hover .song-tile-bg {
  transform: scale(1.06);
  opacity: 0.48;
}

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

.song-tile.active {
  border-color: transparent;
  transform: translateY(-3px) scale(1.012);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.72),
    0 8px 34px rgba(139, 92, 246, 0.44),
    inset 0 1px 1px rgba(255, 255, 255, 0.34),
    inset 0 -16px 36px rgba(124, 58, 237, 0.22);
}

.song-tile.dragging {
  opacity: 0.45;
  transform: scale(0.96);
  cursor: grabbing;
}

.song-tile.drag-over {
  border-color: transparent;
  transform: translateY(-6px) scale(1.03);
  box-shadow:
    0 26px 56px rgba(0, 0, 0, 0.72),
    0 0 0 3px rgba(233, 196, 106, 0.52),
    0 8px 34px rgba(139, 92, 246, 0.48),
    inset 0 1px 1px rgba(255, 255, 255, 0.36);
}

.song-tile-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: auto;
}

.song-tile-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 54px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(10, 6, 22, 0.68);
  backdrop-filter: blur(12px);
  color: var(--gold-bright);
  font-size: 1.55rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.song-tile-playing-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #160f03;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(233, 196, 106, 0.35);
}

.song-tile-title {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- SCREEN 2: Simple Song Player (Matches Wireframe 2) ---------- */
.player-view {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: smoothViewEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes smoothViewEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.player-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-back-large,
.btn-lyrics-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 16, 46, 0.44);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 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-lyrics-preview {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.38), rgba(233, 196, 106, 0.18));
  color: var(--gold-bright);
}

.btn-back-large:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateX(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-lyrics-preview:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.54), rgba(233, 196, 106, 0.26));
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-back-large:active,
.btn-lyrics-preview:active {
  transform: scale(0.96);
}

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

.simple-player-card {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 36px 40px;
  border-radius: 34px;
  background: linear-gradient(155deg, rgba(28, 18, 54, 0.42), rgba(14, 9, 28, 0.56));
  backdrop-filter: blur(18px) saturate(185%);
  -webkit-backdrop-filter: blur(18px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: var(--shadow), var(--glass-rim);
}

/* Top Row: [ 17. ] Song Name */
.player-hero {
  display: flex;
  align-items: center;
  gap: 24px;
}

.player-num-box {
  position: relative;
  width: 116px;
  height: 116px;
  border-radius: 26px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 6, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.58), var(--glass-rim);
}

.player-thumb-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
}

.player-num-text {
  position: relative;
  z-index: 2;
  font-size: 2.75rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(233, 196, 106, 0.45);
}

.player-hero-text {
  min-width: 0;
  flex: 1;
}

.player-song-title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.24;
  color: #ffffff;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

/* YouTube fallback container (only shown if song has no local file) */
.youtube-box {
  border-radius: 22px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 240px;
  width: 100%;
}

/* Row 2 & 3: Music & Voice Sliders */
.rocker-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 18px;
}

.rocker-label {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.38rem;
  font-weight: 800;
  color: #ffffff;
}

.rocker-ico {
  width: 24px;
  height: 24px;
  color: var(--gold-bright);
  flex-shrink: 0;
}

/* Unified Frosted-Glass Pill Rockers */
.glass-slider-pill {
  position: relative;
  height: 52px;
  width: 100%;
  border-radius: 999px;
  background: rgba(8, 5, 16, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  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.08);
}

.glass-slider-pill.seek-pill {
  height: 54px;
  flex: 1;
}

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

.glass-slider-fill.master-fill {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.62), rgba(233, 196, 106, 0.62));
}

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

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

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

.glass-slider-pct {
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.glass-slider-label {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 248, 230, 0.92);
  font-variant-numeric: tabular-nums;
}

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

/* Row 4: Big Play Button + Seek Bar */
.transport-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 6px;
}

.btn-big-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  flex-shrink: 0;
  background: linear-gradient(135deg, #8b5cf6, #5b21b6);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.34);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), filter 0.18s ease, box-shadow 0.2s ease;
}

.btn-big-play:hover {
  filter: brightness(1.09);
  transform: scale(1.05);
  box-shadow: 0 16px 40px rgba(139, 92, 246, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btn-big-play:active {
  transform: scale(0.94);
}

.btn-big-play svg {
  width: 30px;
  height: 30px;
}

/* Row 5: Extend Song Without Voice + Time Selector */
.extend-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 26px;
  background: rgba(12, 8, 26, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.extend-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.extend-heading {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.extend-time-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.time-pill {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(139, 92, 246, 0.16);
  color: #efe9ff;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, box-shadow 0.2s ease, color 0.18s ease;
}

.time-pill:hover {
  background: rgba(139, 92, 246, 0.32);
  transform: translateY(-1px);
}

.time-pill.active {
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #160f03;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 196, 106, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.extend-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-extend-primary,
.btn-extend-undo,
.btn-extend-loop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 999px;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease, box-shadow 0.24s ease, filter 0.18s ease;
}

.btn-extend-primary {
  flex: 1.5 1 260px;
  background: linear-gradient(135deg, #8b5cf6, #5b21b6);
  color: #fff6de;
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-extend-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-extend-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-extend-undo {
  flex: 0.85 1 160px;
  background: rgba(233, 196, 106, 0.2);
  color: var(--gold-bright);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-extend-undo:hover {
  background: rgba(233, 196, 106, 0.32);
  transform: translateY(-2px);
}

.btn-extend-loop {
  flex: 1 1 180px;
  background: rgba(139, 92, 246, 0.18);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-extend-loop:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.btn-extend-loop.active {
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #160f03;
  box-shadow: 0 12px 30px rgba(233, 196, 106, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-extend-primary:active,
.btn-extend-undo:active,
.btn-extend-loop:active {
  transform: scale(0.97);
}

/* ---------- Live Lyrics Preview Overlay (Apple Music Living Aura) ---------- */
@keyframes appleLyricsAuraA {
  0% {
    transform: translate3d(-12%, -10%, 0) scale(1) rotate(0deg);
    filter: blur(46px) hue-rotate(0deg);
    opacity: 0.65;
  }
  50% {
    transform: translate3d(16%, 14%, 0) scale(1.18) rotate(16deg);
    filter: blur(52px) hue-rotate(28deg);
    opacity: 0.82;
  }
  100% {
    transform: translate3d(-6%, 22%, 0) scale(1.06) rotate(-12deg);
    filter: blur(48px) hue-rotate(-20deg);
    opacity: 0.7;
  }
}

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

.lyrics-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(4, 2, 10, 0.74);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lyrics-modal-card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 900px;
  height: min(82vh, 760px);
  border-radius: 32px;
  background: rgba(14, 9, 28, 0.72);
  backdrop-filter: blur(28px) saturate(195%);
  -webkit-backdrop-filter: blur(28px) saturate(195%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.78), var(--glass-rim);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: smoothViewEnter 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.lyrics-modal-card::before {
  background:
    radial-gradient(circle at 24% 28%, rgba(139, 92, 246, 0.52) 0%, transparent 54%),
    radial-gradient(circle at 78% 74%, rgba(109, 40, 217, 0.46) 0%, transparent 56%);
  animation: appleLyricsAuraA 14s ease-in-out infinite alternate;
}

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

.lyrics-modal-header,
.lyrics-modal-body {
  position: relative;
  z-index: 1;
}

.lyrics-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.24);
}

.lyrics-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.lyrics-modal-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.lyrics-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lyrics-modal-sub {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.lyrics-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-stage-open,
.btn-close-lyrics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, filter 0.18s ease;
}

.btn-stage-open {
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #160f03;
  box-shadow: 0 8px 22px rgba(233, 196, 106, 0.32);
}

.btn-close-lyrics {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.btn-stage-open:hover,
.btn-close-lyrics:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.lyrics-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  text-align: center;
}

.preview-lyric-line {
  font-size: clamp(1.3rem, 2.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.45;
  color: rgba(238, 228, 255, 0.45);
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}

.preview-lyric-line:hover {
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.06);
}

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

.preview-lyric-line.active {
  color: var(--gold-bright);
  transform: scale(1.06);
  background: rgba(139, 92, 246, 0.22);
  text-shadow: 0 4px 22px rgba(233, 196, 106, 0.45);
}

.preview-plain-lyrics {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.8;
  white-space: pre-wrap;
  color: rgba(250, 246, 255, 0.92);
}

.preview-empty-lyrics {
  margin: auto;
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* Undo Song Reorder Pop-Up */
.undo-popup {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px 11px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(28, 18, 54, 0.86), rgba(12, 8, 24, 0.9));
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) 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.32), var(--glass-rim);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 700;
  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;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.btn-undo-order {
  border: none;
  border-radius: 999px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #160f03;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(233, 196, 106, 0.34);
}

.undo-dismiss-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #e6ddff;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  background: rgba(22, 15, 42, 0.86);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #fff6de;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65), var(--glass-rim);
  font-size: 0.94rem;
  font-weight: 700;
  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);
}

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1180px) {
  .song-tiles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    padding: 12px 16px;
  }

  .brand h1 {
    font-size: 1.02rem;
  }

  .clock-pill {
    font-size: 0.88rem;
    padding: 6px 13px;
  }

  .pc-stage {
    padding: 16px 14px 36px;
  }

  .song-tiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .song-tile {
    min-height: 165px;
    padding: 15px;
    border-radius: 22px;
  }

  .song-tile-number {
    min-width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .song-tile-title {
    font-size: 1.05rem;
  }

  .simple-player-card {
    padding: 22px 18px;
    gap: 20px;
    border-radius: 26px;
  }

  .player-hero {
    gap: 16px;
  }

  .player-num-box {
    width: 82px;
    height: 82px;
    border-radius: 20px;
  }

  .player-num-text {
    font-size: 2rem;
  }

  .rocker-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rocker-label {
    font-size: 1.12rem;
  }

  .btn-big-play {
    width: 60px;
    height: 60px;
  }

  .extend-actions-row {
    grid-template-columns: 1fr;
  }

  .lyrics-modal-backdrop {
    padding: 12px;
  }

  .lyrics-modal-body {
    padding: 24px 18px 56px;
  }
}

/* ---------- Preserved Stage / Projector Page Styles (/stage) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(28, 20, 50, 0.56);
  backdrop-filter: blur(16px);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-gold {
  background: linear-gradient(135deg, #f7de97, #cfa042);
  color: #140d24;
  border-color: transparent;
}

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

.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);
  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;
}
