:root {
  --bg: #160f19;
  --bg-soft: rgba(32, 18, 31, 0.74);
  --panel: rgba(255, 244, 246, 0.08);
  --panel-strong: rgba(255, 244, 246, 0.16);
  --line: rgba(255, 232, 235, 0.18);
  --text: #fff7fa;
  --muted: rgba(255, 241, 244, 0.75);
  --accent: #ff6f91;
  --accent-2: #ffca6c;
  --accent-3: #79d7d6;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  /* Layout surfaces stay square; round radii are set only on real controls (buttons, transport, sliders). */
  --radius-xl: 0;
  --radius-lg: 0;
  --radius-md: 0;
  --radius-sm: 0;
  --scene-image: none;
  --scene-overlay: linear-gradient(180deg, rgba(18, 10, 18, 0.28), rgba(18, 10, 18, 0.86));
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 111, 145, 0.24), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 202, 108, 0.22), transparent 24%),
    radial-gradient(circle at bottom center, rgba(121, 215, 214, 0.12), transparent 30%),
    linear-gradient(180deg, #220f20 0%, #150812 48%, #090409 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Verdana", sans-serif;
}

html {
  height: 100%;
}

/* Boot: hide main UI until login.js knows gate vs player. */
body.app-boot-pending .shell.app,
body.app-boot-pending .player-scene {
  visibility: hidden;
  pointer-events: none;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 111, 145, 0.18), transparent 42%),
    radial-gradient(circle at 72% 78%, rgba(255, 202, 108, 0.14), transparent 40%),
    linear-gradient(180deg, #1a0f18 0%, #0d060c 100%);
}

body.app-boot-pending .app-loader {
  display: flex;
}

.app-loader-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 244, 246, 0.1);
  border-top-color: rgba(255, 202, 108, 0.9);
  border-right-color: rgba(255, 111, 145, 0.55);
  animation: app-loader-spin 0.78s linear infinite;
}

@keyframes app-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-loader-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

body.tracks-auth-locked .player-scene,
body.tracks-auth-locked .shell.app {
  visibility: hidden;
  pointer-events: none;
}

.tracks-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 111, 145, 0.2), transparent 36%),
    radial-gradient(circle at bottom right, rgba(255, 202, 108, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(18, 10, 18, 0.92), rgba(9, 4, 9, 0.96));
}

body.tracks-auth-locked .tracks-auth-gate {
  display: flex;
}

.tracks-auth-card {
  width: min(100%, 400px);
  padding: clamp(24px, 4vw, 36px);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tracks-auth-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
}

.tracks-auth-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.tracks-auth-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.tracks-auth-input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(8, 4, 10, 0.55);
  color: var(--text);
  font-size: 1rem;
}

.tracks-auth-input:focus {
  outline: 2px solid rgba(255, 202, 108, 0.45);
  outline-offset: 2px;
}

.tracks-auth-submit {
  width: 100%;
}

.tracks-auth-error {
  margin: 14px 0 0;
  color: #ffb4c0;
  font-size: 0.9rem;
}

.tracks-auth-imprint {
  margin: 18px 0 0;
  margin-bottom: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 244, 246, 0.12);
  font-size: 0.86rem;
  text-align: center;
}

.tracks-auth-imprint a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tracks-auth-imprint a:hover {
  color: var(--text);
}

body.app-shell,
body.singstar-shell {
  height: 100%;
  overflow: hidden;
}

body.app-shell .shell,
body.singstar-shell .shell {
  height: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.10), transparent 10%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.08), transparent 12%),
    radial-gradient(circle at 45% 75%, rgba(255, 255, 255, 0.08), transparent 9%),
    radial-gradient(circle at 14% 82%, rgba(255, 202, 108, 0.10), transparent 8%),
    radial-gradient(circle at 86% 72%, rgba(255, 111, 145, 0.10), transparent 7%);
  opacity: 0.7;
  mix-blend-mode: screen;
}

body.karaoke-mode-active .topbar,
body.karaoke-mode-active .player-layout,
body.karaoke-mode-active .player-scene {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.karaoke-mode-active .shell.app {
  padding: 0;
}

body.karaoke-mode-active .karaoke-overlay {
  display: block;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.player-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.player-scene .scene-layer,
.singstar-stage .scene-layer {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: scene-pan var(--scene-duration, 18s) ease-in-out infinite alternate;
  transition: opacity 1400ms ease, filter 1400ms ease;
  will-change: auto;
}

body.media-playing .player-scene .scene-layer,
body.media-playing .singstar-stage .scene-layer {
  will-change: transform, opacity, filter;
  animation-play-state: running;
}

body:not(.media-playing) .player-scene .scene-layer,
body:not(.media-playing) .singstar-stage .scene-layer {
  animation-play-state: paused;
}

.scene-layer-blur {
  --scene-extra-scale: 0.12;
  opacity: 0.78;
  filter: blur(48px) saturate(1.22) brightness(0.92) contrast(1.06);
  transform: scale(1.62);
  animation-direction: reverse;
  background-size: cover;
  background-position: center center;
  mix-blend-mode: normal;
}

.singstar-stage .scene-layer-blur {
  inset: -14%;
  opacity: 0.96;
  filter: blur(58px) saturate(1.28) brightness(0.96) contrast(1.06);
  transform: scale(1.92);
  mix-blend-mode: normal;
  z-index: 0;
}

.scene-layer-main {
  --scene-extra-scale: 0;
  opacity: 0.98;
  filter: saturate(1.1) contrast(1.05) brightness(1.02);
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  transform: none;
}

/* Normal player: only low-res thumb on the blurred layer; skip sharp full-res layer. */
.player-scene.scene-thumb-only-bg .scene-layer-main {
  animation: none !important;
  opacity: 0 !important;
  visibility: hidden;
  background-image: none !important;
}

.player-scene.scene-thumb-only-bg .scene-layer-blur {
  opacity: 0.92;
}

.scene-crossfade-wedge {
  pointer-events: none;
}

.player-scene::after,
.singstar-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 111, 145, 0.12), transparent 28%),
    radial-gradient(circle at 76% 18%, rgba(255, 202, 108, 0.10), transparent 24%),
    radial-gradient(circle at 50% 78%, rgba(121, 215, 214, 0.08), transparent 30%);
}

@keyframes scene-pan {
  from {
    transform:
      translate3d(var(--scene-from-x, -1.5%), var(--scene-from-y, -1%), 0)
      rotate(var(--scene-from-rot, -0.65deg))
      scale(calc(var(--scene-from-scale, 1.06) + var(--scene-extra-scale, 0)));
  }
  to {
    transform:
      translate3d(var(--scene-to-x, 1.5%), var(--scene-to-y, 1%), 0)
      rotate(var(--scene-to-rot, 0.65deg))
      scale(calc(var(--scene-to-scale, 1.14) + var(--scene-extra-scale, 0)));
  }
}

.editor-shell {
  min-height: 100vh;
  overflow: auto;
}

.editor-shell .shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: visible;
}

/* Editor (internal tool): reduce compositing cost — no full-screen decorative overlay, less blur on cards */
body.editor-shell::before {
  display: none;
}

.editor-shell .hero::after {
  display: none;
}

.editor-shell .stat-card,
.editor-shell .editor-card,
.editor-shell .tap-card,
.editor-shell .output-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hero {
  position: relative;
  border: 1px solid rgba(255, 244, 200, 0.22);
  border-radius: 0;
  overflow: hidden;
  background:
    var(--scene-overlay),
    var(--scene-image),
    linear-gradient(135deg, rgba(255, 111, 145, 0.24), rgba(255, 202, 108, 0.10), rgba(121, 215, 214, 0.06));
  background-size: cover;
  background-position: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 202, 108, 0.08) inset;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 111, 145, 0.16), transparent 30%),
    linear-gradient(300deg, rgba(255, 202, 108, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 18%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  padding: 28px;
  z-index: 1;
}

.headline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.22), rgba(255, 202, 108, 0.18));
  border: 1px solid rgba(255, 244, 200, 0.28);
  color: var(--muted);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
}

.hero h1 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(2.1rem, 4vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 22px rgba(255, 202, 108, 0.18);
}

.hero p {
  max-width: 60ch;
  margin: 0;
  color: rgba(255, 247, 250, 0.88);
  font-size: 1rem;
  line-height: 1.65;
}

.stats {
  display: grid;
  gap: 12px;
  align-content: start;
}

.stat-card,
.panel,
.track-card,
.editor-card,
.tap-card,
.output-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(32, 18, 31, 0.78);
  border: 1px solid rgba(255, 244, 200, 0.16);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 202, 108, 0.05) inset;
}

.app-shell .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(32, 18, 31, 0.46);
  border-color: rgba(255, 244, 200, 0.12);
}

.stat-card {
  padding: 18px 18px 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.stat-value {
  margin-top: 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel h2,
.panel h3,
.editor-card h2,
.tap-card h2,
.output-card h2 {
  margin: 0 0 12px;
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.track-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 202, 108, 0.62) rgba(255, 255, 255, 0.08);
}

.track-list > .track-card {
  flex: 0 0 auto;
  min-height: min-content;
}

.track-list::-webkit-scrollbar {
  width: 10px;
}

.track-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0;
}

.track-list::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 111, 145, 0.74), rgba(255, 202, 108, 0.74));
  border: 2px solid rgba(22, 15, 25, 0.76);
}

.track-card {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  align-self: stretch;
}

.track-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.10), transparent 28%),
    linear-gradient(315deg, rgba(255, 202, 108, 0.08), transparent 24%);
  pointer-events: none;
}

.track-cover {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 244, 200, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 10px 18px rgba(0, 0, 0, 0.18);
}

.track-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: max(56px, min-content);
  align-self: stretch;
  justify-content: center;
}

.track-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.track-sub {
  margin-top: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.button {
  border: 0;
  color: #160d13;
  background: linear-gradient(135deg, #ff7aa0 0%, #ffcf74 52%, #fff09c 100%);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(255, 111, 145, 0.28), 0 0 0 1px rgba(255, 244, 200, 0.22) inset;
}

.button.secondary {
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.18), rgba(255, 202, 108, 0.14));
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 244, 200, 0.18);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player {
  display: grid;
  gap: 18px;
}

.now-playing {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.now-playing strong {
  display: block;
  font-size: 1.2rem;
}

.now-playing small {
  color: var(--muted);
}

.progress-wrap {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.progress-wrap > .progress-bar {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}

.progress-wrap > .progress-bar::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.progress-wrap > .progress-bar::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: 0;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.progress-wrap > .progress-bar::-moz-range-track {
  height: 16px;
  background: transparent;
}

.progress-wrap > .progress-bar::-moz-range-thumb {
  width: 16px;
  height: 16px;
  margin-top: 0;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.progress-wrap > .progress-bar:active::-webkit-slider-thumb,
.progress-wrap > .progress-bar:active::-moz-range-thumb {
  cursor: grabbing;
}

.progress-bar {
  display: none;
}

.editor-progress .progress-bar {
  display: block;
  width: 100%;
  height: 16px;
  margin: 0;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}

.editor-progress .progress-bar::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.editor-progress .progress-bar::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -1px;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.editor-progress .progress-bar::-moz-range-track {
  height: 16px;
  background: transparent;
}

.editor-progress .progress-bar::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.88rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.transport {
  display: grid;
  gap: 12px;
}

.transport-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.player-transport-dock {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.player-transport-dock .transport {
  flex: 0 0 auto;
  min-width: 0;
}

.player-transport-dock .progress-wrap {
  flex: 0 0 auto;
  min-width: 0;
}

.control-btn {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #160d13;
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.24), rgba(255, 202, 108, 0.20));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 244, 200, 0.18) inset;
  cursor: pointer;
}

.control-btn:hover {
  transform: translateY(-1px);
}

.control-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.control-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.control-btn.primary {
  background: linear-gradient(135deg, #ff7aa0 0%, #ffcf74 52%, #fff09c 100%);
}

.control-btn.active {
  background: rgba(255, 255, 255, 0.30);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.control-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.control-btn:disabled:hover {
  transform: none;
}

.volume-popover-wrap {
  position: relative;
}

.volume-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 220px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(18, 10, 18, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

.volume-popover-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.volume-popover-bar {
  width: 100%;
  height: 8px;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.volume-popover-bar::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #ffd1dc);
  border: 2px solid rgba(22, 13, 19, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.volume-popover-bar::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #ffd1dc);
  border: 2px solid rgba(22, 13, 19, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.lyric-stage {
  position: relative;
  min-height: 360px;
  padding: 22px;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.22)),
    rgba(10, 6, 10, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.lyric-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 111, 145, 0.16), transparent 18%),
    radial-gradient(circle at 80% 20%, rgba(255, 202, 108, 0.12), transparent 16%);
  pointer-events: none;
}

.lyric-view {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 12px;
  min-height: 0;
}

.lyric-line {
  display: grid;
  gap: 10px;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding-right: 2px;
  font-size: clamp(0.96rem, 1.25vw, 1.45rem);
  width: 100%;
  line-height: 1.35;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.lyric-flow {
  display: grid;
  gap: 0.4rem;
  font-size: clamp(0.98rem, 1.35vw, 1.4rem);
  line-height: 1.4;
  min-height: 0;
  width: 100%;
}

.lyric-flow-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 247, 250, 0.88);
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

@keyframes lyric-section-shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.lyric-section-heading {
  align-self: center;
  max-width: 100%;
  text-align: center;
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.25;
  padding: 4px 14px;
  border-radius: 0;
  color: rgba(255, 247, 250, 0.94);
  background: linear-gradient(
    90deg,
    rgba(255, 143, 177, 0.28),
    rgba(255, 202, 108, 0.36),
    rgba(255, 143, 177, 0.28)
  );
  background-size: 200% 100%;
  animation: lyric-section-shimmer 4.8s ease-in-out infinite;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lyric-line-main-text {
  display: block;
  width: 100%;
}

.lyric-flow-line.active .lyric-section-heading {
  color: #4a1530;
  background: linear-gradient(
    90deg,
    rgba(255, 111, 145, 0.52),
    rgba(255, 217, 140, 0.58),
    rgba(255, 111, 145, 0.52)
  );
  background-size: 200% 100%;
  box-shadow:
    0 0 0 1px rgba(74, 21, 48, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.1);
}

.lyric-flow-line.preview .lyric-section-heading {
  color: rgba(255, 247, 250, 0.96);
  background: linear-gradient(
    90deg,
    rgba(255, 202, 108, 0.32),
    rgba(255, 143, 177, 0.34),
    rgba(255, 202, 108, 0.32)
  );
  background-size: 200% 100%;
}

.lyric-flow-line.past .lyric-section-heading,
.lyric-flow-line.future .lyric-section-heading {
  opacity: 0.82;
}

.lyric-flow-break {
  height: 0.9rem;
}

.lyric-flow-line.past {
  opacity: 0.7;
}

.lyric-flow-line.future {
  opacity: 0.42;
}

.lyric-flow-line.preview,
.karaoke-line.preview {
  opacity: 0.82;
  color: #fff2c9;
  background: rgba(255, 202, 108, 0.10);
  box-shadow:
    0 0 0 1px rgba(255, 202, 108, 0.14),
    0 0 22px rgba(255, 202, 108, 0.10);
  animation: incoming-line-pulse 1.4s ease-in-out infinite;
}

.lyric-flow-line.active {
  opacity: 1;
  color: #160d13;
  background: linear-gradient(135deg, #fff7c7 0%, #ffd07a 48%, #ff8fb1 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42), 0 14px 30px rgba(255, 143, 177, 0.28), 0 0 24px rgba(255, 202, 108, 0.24);
  transform: translateY(-2px) scale(1.01);
  text-shadow: none;
}

.lyric-flow-line.effect-highlight,
.karaoke-line.effect-highlight {
  position: relative;
}

.lyric-flow-line.effect-highlight.active,
.karaoke-line.effect-highlight.active {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.48),
    0 18px 38px rgba(255, 202, 108, 0.24),
    0 0 34px rgba(255, 111, 145, 0.18),
    0 0 84px rgba(255, 239, 184, 0.18);
  animation: line-highlight-pulse 1.7s ease-in-out infinite;
}

@keyframes line-highlight-pulse {
  0% {
    filter: saturate(1);
    transform: translateY(-2px) scale(1.01);
  }
  100% {
    filter: saturate(1.16);
    transform: translateY(-2px) scale(1.035);
  }
}

.lyric-next {
  display: none;
}

.lyric-track {
  position: relative;
  width: 100%;
  display: grid;
  gap: 8px;
  isolation: isolate;
}

.lyric-track-large {
  gap: 10px;
}

.lyric-track-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.lyric-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--lyric-progress, 0%);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(255, 241, 166, 0.18), rgba(255, 143, 177, 0.72), rgba(255, 241, 166, 0.2));
  box-shadow: 0 0 24px rgba(255, 143, 177, 0.28);
  transition: width 60ms linear;
  pointer-events: none;
}

.lyric-track-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  line-height: 1.25;
}

.lyric-track-text span {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 0;
  color: rgba(255, 247, 250, 0.84);
  background: rgba(255, 255, 255, 0.03);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.lyric-flow .word {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 0;
  color: rgba(255, 247, 250, 0.82);
  background: rgba(255, 255, 255, 0.03);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.lyric-track-text .word.past {
  opacity: 0.72;
}

.lyric-track-text .word.active {
  color: #160d13;
  background: linear-gradient(135deg, #fff1a6, #ff8fb1);
  box-shadow: 0 10px 22px rgba(255, 143, 177, 0.18);
  transform: translateY(-1px);
}

.lyric-flow .word.past {
  opacity: 0.72;
}

.lyric-flow .word.active {
  color: #160d13;
  background: linear-gradient(135deg, #fff1a6, #ff8fb1);
  box-shadow: 0 10px 22px rgba(255, 143, 177, 0.18);
  transform: translateY(-1px);
}

.lyric-queue {
  display: grid;
  gap: 6px;
  color: rgba(255, 247, 250, 0.64);
  font-size: 0.88rem;
}

.lyric-queue span {
  padding-left: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  transition: opacity 220ms ease, transform 220ms ease, color 220ms ease;
}

.lyric-queue .fade-1 {
  opacity: 0.82;
  transform: translateX(0);
}

.lyric-queue .fade-2 {
  opacity: 0.56;
  transform: translateX(3px);
}

.lyric-queue .fade-3 {
  opacity: 0.34;
  transform: translateX(6px);
}

.scene-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  padding: 8px 12px;
  border-radius: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.28), rgba(255, 202, 108, 0.24));
  border: 1px solid rgba(255, 244, 200, 0.24);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.track-detail {
  display: none;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-height: 0;
}

.editor-layout > .editor-card {
  grid-column: 1;
}

.editor-layout > .lyrics-board {
  grid-column: 1;
  min-height: 0;
}

.editor-layout > .output-card {
  grid-column: 1;
}

.editor-controls {
  position: sticky;
  top: 16px;
  z-index: 12;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

.phase-ui {
  display: grid;
  gap: 20px;
}

.phase-ui[hidden] {
  display: none !important;
}

.editor-toolbar,
.tap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.editor-toolbar.tight {
  gap: 8px;
}

.editor-card,
.tap-card,
.output-card {
  padding: 16px;
}

.phase-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  margin-top: 16px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phase-tab {
  min-width: 110px;
}

.phase-tab[aria-selected="true"],
.phase-tab.active {
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.24), rgba(255, 202, 108, 0.22));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(255, 111, 145, 0.12);
}

.textarea,
.draft-box,
.output-box {
  width: 100%;
  min-height: 220px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  background: rgba(10, 8, 14, 0.58);
  resize: vertical;
  line-height: 1.55;
}

.draft-box {
  min-height: 320px;
  white-space: pre-wrap;
}

.raw-card .raw-input {
  min-height: 420px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.tap-preview {
  display: grid;
  gap: 14px;
}

.tap-preview.compact {
  gap: 10px;
}

.phase-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.phase-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.phase-strip.compact {
  gap: 10px;
}

.phase-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phase-card.active {
  background: rgba(255, 111, 145, 0.12);
  border-color: rgba(255, 111, 145, 0.24);
}

.phase-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
}

.phase-title {
  margin-top: 6px;
  font-weight: 800;
}

.phase-copy {
  margin-top: 6px;
  color: rgba(255, 247, 250, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.phase-strip.compact .phase-card {
  padding: 12px 14px;
}

.phase-strip.compact .phase-title {
  font-size: 0.96rem;
}

.tap-lines {
  display: grid;
  gap: 10px;
}

.lyrics-board .tap-lines {
  overflow: visible;
  padding-right: 4px;
}

.editor-shell .lyrics-board {
  display: block;
  min-height: 0;
}

.editor-shell .tap-preview {
  min-height: 0;
}

.lyrics-gap {
  height: 12px;
}

.tap-line-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 198px;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  text-align: left;
  cursor: default;
}

.tap-line-row.current {
  background: rgba(255, 111, 145, 0.12);
  border-color: rgba(255, 111, 145, 0.25);
}

.tap-line-row.selected {
  background: rgba(255, 202, 108, 0.10);
  border-color: rgba(255, 202, 108, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 202, 108, 0.12) inset;
}

.tap-line-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.74rem;
}

.tap-line-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tap-line-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  font-size: clamp(0.96rem, 1.25vw, 1.15rem);
  line-height: 1.25;
}

.tap-line-section {
  padding: 2px 10px;
  border-radius: 0;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(255, 247, 250, 0.95);
  background: linear-gradient(
    90deg,
    rgba(255, 143, 177, 0.38),
    rgba(255, 202, 108, 0.42),
    rgba(255, 143, 177, 0.38)
  );
  background-size: 200% 100%;
  animation: lyric-section-shimmer 5s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tap-line-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tap-time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 0;
  min-height: 24px;
  font-size: 0.68rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tap-time-chip.set {
  background: rgba(255, 202, 108, 0.18);
  border-color: rgba(255, 202, 108, 0.26);
  color: rgba(255, 247, 250, 0.96);
}

.tap-time-chip.inferred {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 250, 0.62);
}

.tap-line-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 198px;
  width: 198px;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.tap-line-set,
.tap-line-merge {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  cursor: pointer;
}

.tap-line-set {
  min-width: 64px;
  height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation;
}

.tap-line-merge {
  width: 30px;
  height: 30px;
  padding: 0;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  touch-action: manipulation;
}

.tap-line-set:hover,
.tap-line-merge:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.32), rgba(255, 202, 108, 0.26));
}

.tap-line-merge:disabled {
  opacity: 0.25;
  cursor: default;
}

.tap-line-row:hover {
  border-color: rgba(255, 241, 166, 0.22);
}

.tap-line-row.current {
  background: rgba(255, 111, 145, 0.12);
  border-color: rgba(255, 111, 145, 0.25);
}

.line-label {
  color: rgba(255, 247, 250, 0.86);
  flex: 1 1 auto;
  min-width: 0;
}

.line-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.2em;
  padding: 1px 6px;
  border-radius: 0;
  background: rgba(255, 202, 108, 0.16);
  color: rgba(255, 247, 250, 0.96);
  font-size: 0.66rem;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.line-time.placeholder {
  visibility: hidden;
}

.tap-status {
  color: var(--muted);
}

.output-box {
  min-height: 260px;
  font-family: "Consolas", "Menlo", monospace;
  font-size: 0.94rem;
}

.helper {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 20px;
}

@media (max-width: 1100px) {
  .hero-grid,
  .main-grid,
  .split,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-layout > .editor-card,
  .editor-layout > .lyrics-board,
  .editor-layout > .output-card {
    grid-column: auto;
    grid-row: auto;
  }

  .editor-shell {
    height: auto;
    overflow: auto;
  }

  .editor-shell .shell {
    height: auto;
    min-height: 100vh;
  }
}

@media (min-width: 1200px) {
  .lyrics-board {
    min-height: calc(100vh - 220px);
  }

  .lyrics-board .tap-lines {
    overflow: visible;
  }

  .lyric-line {
    max-height: min(62vh, 700px);
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .hero-grid {
    padding: 20px;
  }

  .track-card {
    grid-template-columns: 1fr;
  }

  .track-cover {
    width: 100%;
    height: 180px;
  }
}

.app {
  display: grid;
  gap: 20px;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.site-footer {
  flex-shrink: 0;
  padding: 8px 4px 2px;
  text-align: center;
  font-size: 0.84rem;
}

.site-footer a {
  color: rgba(255, 241, 244, 0.72);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--text);
}

/* Standalone karaoke page: keep footer visible without shrinking the stage layout */
.site-footer-karaoke-standalone {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  padding: 0;
  text-align: right;
  pointer-events: none;
}

.site-footer-karaoke-standalone a {
  pointer-events: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 0;
  border: 1px solid rgba(255, 244, 200, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.26), rgba(255, 202, 108, 0.16), rgba(121, 215, 214, 0.08)),
    rgba(22, 15, 25, 0.84);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 202, 108, 0.06) inset;
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 255, 255, 0.10), transparent 10%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.08), transparent 12%);
  pointer-events: none;
}

/* Full-screen player scene sits under .shell; frosted topbar would show every photo swap. Keep header visually stable. */
body.app-shell .topbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background:
    linear-gradient(135deg, rgba(255, 111, 145, 0.26), rgba(255, 202, 108, 0.16), rgba(121, 215, 214, 0.08)),
    var(--bg);
}

.topbar h1 {
  margin: 6px 0 4px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 3.2rem);
  line-height: 0.96;
  text-shadow: 0 0 22px rgba(255, 202, 108, 0.18), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
  align-items: center;
}

.karaoke-transport-toggle {
  margin-left: auto;
  flex: 0 0 auto;
}

.eyebrow-solid {
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.22), rgba(255, 202, 108, 0.18));
}

.player-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

.player-mobile-tabs {
  display: none;
}

/* Unified player card: desktop = sidebar + header/lyrics grid; mobile = column + tabs + sticky dock */
.player-now {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  gap: 0;
}

.player-now .player-tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.player-now .playlist-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.player-now .playlist-panel > .panel-header {
  flex-shrink: 0;
}

.player-now .track-detail {
  display: none;
}

.playlist-panel,
.now-panel,
.singstar-sidebar .panel {
  padding: 20px;
}

.player-now.now-panel {
  padding: 20px;
}

.player-now .playlist-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

@media (min-width: 901px) {
  .player-now {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1.15fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "pl hd"
      "pl ly"
      "dk dk";
    column-gap: 20px;
    row-gap: 18px;
    align-items: stretch;
  }

  .player-now .now-header {
    grid-area: hd;
  }

  .player-now .player-mobile-tabs {
    display: none;
  }

  .player-now .player-tab-panels {
    display: contents;
  }

  .player-now .playlist-panel {
    grid-area: pl;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
  }

  .player-now .lyrics-panel {
    grid-area: ly;
    min-height: 0;
  }

  .player-now .player-transport-dock {
    grid-area: dk;
    align-self: stretch;
    gap: 18px;
  }

  .player-now .track-detail {
    display: none;
  }

  /* Desktop: both tab panels participate in grid; ignore mobile tab visibility */
  .player-tab-panels > .playlist-panel,
  .player-tab-panels > .lyrics-panel {
    display: flex !important;
  }
}

.now-panel {
  /* Legacy hook: .player-now.now-panel combines roles */
  min-height: 0;
}

/* —— Mobile player: tabs + scrollable region + sticky transport —— */
@media (max-width: 900px) {
  body.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .shell.app {
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
  }

  .shell.app > .topbar {
    display: none !important;
  }

  .shell.app > .player-layout {
    min-height: 0;
  }

  .app {
    gap: 0;
  }

  #loop-btn {
    display: none !important;
  }

  .player-transport-dock .volume-popover-wrap {
    display: none !important;
  }

  .app-shell .player-now {
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: rgba(22, 15, 25, 0.42);
  }

  .player-now {
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px 12px 8px;
  }

  .player-now .now-header {
    flex-shrink: 0;
    align-items: flex-start;
  }

  .player-now .now-header #now-title {
    font-size: clamp(0.92rem, 3.8vw, 1.12rem);
    line-height: 1.28;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
  }

  .player-now .now-thumb {
    display: none !important;
  }

  .player-mobile-tabs {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 244, 200, 0.12);
  }

  .player-mobile-tab {
    flex: 1 1 50%;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    color: rgba(255, 247, 250, 0.72);
    background: transparent;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
  }

  .player-mobile-tab.is-active {
    color: #160d13;
    background: linear-gradient(135deg, #ff7aa0 0%, #ffcf74 52%, #fff09c 100%);
    box-shadow: 0 6px 18px rgba(255, 111, 145, 0.22);
  }

  .player-mobile-tab:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
  }

  .player-now .player-tab-panels {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: block;
  }

  .player-tab-panels > [data-player-tab] {
    display: none;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .player-tab-panels > [data-player-tab].is-active {
    display: flex;
  }

  .player-now .playlist-panel {
    padding: 0;
  }

  .player-transport-dock {
    flex-shrink: 0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 40;
    overflow: visible;
    padding-top: 12px;
    padding-bottom: 10px;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    background:
      linear-gradient(180deg, transparent 0%, rgba(22, 15, 25, 0.55) 28%, rgba(22, 15, 25, 0.94) 55%, rgba(22, 15, 25, 0.98) 100%);
    border-top: 1px solid rgba(255, 244, 200, 0.12);
    backdrop-filter: blur(12px);
  }

  .player-transport-dock .transport {
    gap: 8px;
    overflow: visible;
  }

  .player-transport-dock .transport-controls {
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: center;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }

  .player-transport-dock .transport-controls::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .player-transport-dock .control-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .player-transport-dock .control-btn svg {
    width: 18px;
    height: 18px;
  }

  .player-transport-dock .karaoke-transport-toggle {
    margin-left: 0;
    flex-shrink: 0;
  }

  .volume-popover {
    bottom: calc(100% + 10px);
    top: auto;
  }

  .player-now.now-panel {
    padding: 10px 12px 8px;
  }
}

.now-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

.now-thumb {
  width: 120px;
  height: 120px;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background-color: rgba(255, 255, 255, 0.06);
}

.lyrics-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
  overflow: hidden;
}

.lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.lyric-stage-compact {
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

.lyric-stage {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 202, 108, 0.62) rgba(255, 255, 255, 0.08);
  padding-right: 6px;
}

.lyric-stage::-webkit-scrollbar {
  width: 10px;
}

.lyric-stage::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0;
}

.lyric-stage::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255, 111, 145, 0.74), rgba(255, 202, 108, 0.74));
  border: 2px solid rgba(22, 15, 25, 0.76);
}

.lyric-view {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.lyric-next {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: rgba(255, 247, 250, 0.72);
}

.lyric-next span {
  padding-left: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  transition: opacity 220ms ease, transform 220ms ease, color 220ms ease;
}

.lyric-next .fade-1 {
  opacity: 0.82;
  transform: translateX(0);
}

.lyric-next .fade-2 {
  opacity: 0.56;
  transform: translateX(4px);
}

.lyric-next .fade-3 {
  opacity: 0.34;
  transform: translateX(8px);
}

.track-card.active {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.track-card:hover {
  transform: translateY(-1px);
}

.singstar-shell {
  min-height: 100vh;
  overflow: hidden;
}

.singstar-app {
  position: relative;
  display: block;
  min-height: 100vh;
  padding: 20px;
  overflow: hidden;
}

.singstar-stage {
  position: relative;
  min-height: calc(100vh - 40px);
  border-radius: 0;
  overflow: hidden;
  background: rgba(5, 4, 7, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.singstar-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.08) contrast(1.02) brightness(1.01);
  opacity: 1;
  animation: scene-pan var(--scene-duration, 18s) ease-in-out infinite alternate;
  z-index: 1;
}

.singstar-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.26)),
    radial-gradient(circle at top left, rgba(255, 111, 145, 0.05), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255, 202, 108, 0.04), transparent 28%);
  z-index: 2;
}

.singstar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 40;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: rgba(10, 7, 12, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
}

.singstar-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.singstar-close:hover {
  background: rgba(10, 7, 12, 0.78);
}

.singstar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 0;
  background: rgba(10, 7, 12, 0.52);
  border: 1px solid rgba(255, 244, 200, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  transition: opacity 220ms ease, transform 220ms ease;
}

.singstar-header .singstar-meta,
.singstar-header .karaoke-meta {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: none;
}

.singstar-header .singstar-pill {
  width: auto;
  max-width: 100%;
}

.singstar-header .singstar-close {
  position: relative;
  top: auto;
  right: auto;
  flex-shrink: 0;
}

.singstar-content > .singstar-header {
  align-self: stretch;
  width: 100%;
}

.singstar-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 4vw, 64px);
  padding-top: clamp(16px, 3vh, 28px);
  padding-bottom: clamp(110px, 14vh, 190px);
  text-align: center;
}

/* Standalone karaoke page: keep pill top-left, lyrics + preview near bottom (above dock). */
.singstar-content > .singstar-line {
  margin-top: auto;
}

.singstar-meta {
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  align-items: center;
  width: min(100%, 1180px);
}

.singstar-pill {
  padding: 12px 18px;
  width: 100%;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(255, 111, 145, 0.24), rgba(255, 202, 108, 0.18));
  border: 1px solid rgba(255, 244, 200, 0.26);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.singstar-time {
  display: none;
}

.singstar-line {
  width: 100%;
  max-width: min(100%, 1180px);
  font-size: clamp(2rem, 4vw, 5rem);
  line-height: 1.18;
  font-family: "Georgia", "Times New Roman", serif;
  white-space: normal;
  margin: 0 auto;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  box-sizing: border-box;
}

.singstar-line .lyric-flow {
  width: 100%;
}

.singstar-next {
  width: min(100%, 980px);
  display: grid;
  gap: 10px;
  color: rgba(255, 247, 250, 0.82);
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  margin-bottom: 10px;
}

.singstar-next span {
  padding-left: 16px;
  border-left: 2px solid rgba(255, 255, 255, 0.14);
}

.singstar-dock {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.singstar-dock-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 8px;
  border-radius: 0;
  background: rgba(10, 7, 12, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.singstar-dock-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.singstar-dock-progress {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(78vw, 760px);
}

.singstar-dock-time {
  color: rgba(255, 247, 250, 0.72);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  min-width: 3.25em;
  text-align: center;
}

.singstar-dock-range {
  width: 100%;
  height: 4px;
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.singstar-dock-range::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.singstar-dock-range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.singstar-dock-range::-moz-range-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.singstar-dock-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(22, 13, 19, 0.55);
  background: linear-gradient(180deg, #fff, #ffd1dc);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.dock-btn {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
}

.dock-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.dock-btn.primary {
  color: #160d13;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

.dock-btn.active {
  background: rgba(255, 255, 255, 0.22);
}

.singstar-app.controls-hidden .singstar-dock {
  opacity: 0;
  transform: translateY(24px);
}

.singstar-app.controls-hidden .singstar-dock,
.singstar-app.controls-hidden .singstar-dock * {
  pointer-events: none;
}

.singstar-app.controls-hidden .singstar-header {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.singstar-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.karaoke-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 0;
}

.karaoke-overlay[hidden] {
  display: none !important;
}

.karaoke-stage {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.karaoke-fx-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.karaoke-fx {
  position: absolute;
  left: var(--fx-x, 50%);
  top: var(--fx-y, 50%);
  transform: translate(-50%, -50%);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 4.8rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff8e4;
  text-shadow:
    0 12px 28px rgba(0, 0, 0, 0.58),
    0 0 34px rgba(255, 202, 108, 0.38),
    0 0 70px rgba(255, 111, 145, 0.16);
  white-space: nowrap;
  opacity: 0;
  animation: karaoke-fly 8200ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  will-change: transform, opacity, filter;
}

/* Trailing (...) “flying word” effects: one smooth zoom + linear fade (no stepped opacity/scale). */
.karaoke-fx--flyingword {
  animation-name: karaoke-fly-word;
  animation-duration: 9000ms;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  text-shadow:
    0 10px 22px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(255, 202, 108, 0.32),
    0 0 52px rgba(255, 111, 145, 0.12);
}

@keyframes karaoke-fly-word {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) scale(0.78) rotate(0deg);
    filter: blur(0);
  }
  11% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--fx-dx, 160px) * 0.1), calc(var(--fx-dy, -220px) * 0.1)) scale(1) rotate(calc(var(--fx-rot, 0deg) * 0.1));
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--fx-dx, 160px), var(--fx-dy, -220px)) scale(var(--fx-scale-end, 3.25)) rotate(var(--fx-rot, 0deg));
    filter: blur(7px);
  }
}

.karaoke-fx--heartburst {
  color: #ffd7e2;
  text-shadow:
    0 12px 28px rgba(0, 0, 0, 0.54),
    0 0 36px rgba(255, 111, 145, 0.42),
    0 0 78px rgba(255, 160, 190, 0.18);
}

.karaoke-fx--sparkleburst {
  color: #fff4c5;
  font-size: clamp(1.4rem, 2.4vw, 3.8rem);
  letter-spacing: 0.12em;
  text-shadow:
    0 10px 24px rgba(0, 0, 0, 0.54),
    0 0 28px rgba(255, 202, 108, 0.5),
    0 0 74px rgba(255, 244, 197, 0.22);
}

.karaoke-fx--goldflash {
  color: #fff1b8;
  text-shadow:
    0 12px 28px rgba(0, 0, 0, 0.54),
    0 0 32px rgba(255, 202, 108, 0.48),
    0 0 84px rgba(255, 226, 132, 0.24);
}

.karaoke-fx--glowpulse {
  color: #fff9dc;
  text-shadow:
    0 12px 28px rgba(0, 0, 0, 0.54),
    0 0 40px rgba(255, 202, 108, 0.42),
    0 0 92px rgba(255, 111, 145, 0.16);
}

@keyframes karaoke-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(0, 0) scale(0.62) rotate(0deg);
    filter: blur(0) saturate(1.04);
  }
  12% {
    opacity: 0.92;
    transform: translate(-50%, -50%) translate(calc(var(--fx-dx, 160px) * 0.06 + var(--fx-dx2, 0px) * 0.02), calc(var(--fx-dy, -220px) * 0.06 + var(--fx-dy2, 0px) * 0.02)) scale(0.92) rotate(calc(var(--fx-rot, 0deg) * 0.2));
    filter: blur(0) saturate(1.06);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(calc(var(--fx-dx, 160px) * 0.18 + var(--fx-dx2, 0px) * 0.06), calc(var(--fx-dy, -220px) * 0.18 + var(--fx-dy2, 0px) * 0.06)) scale(calc(var(--fx-scale-mid, 1.85) * 0.92)) rotate(calc(var(--fx-rot, 0deg) * 0.35));
    filter: blur(0.4px) saturate(1.08);
  }
  50% {
    opacity: 0.94;
    transform: translate(-50%, -50%) translate(calc(var(--fx-dx, 160px) * 0.38 + var(--fx-dx2, 0px) * 0.12), calc(var(--fx-dy, -220px) * 0.38 + var(--fx-dy2, 0px) * 0.12)) scale(var(--fx-scale-mid, 1.85)) rotate(var(--fx-rot, 0deg));
    filter: blur(0.8px) saturate(1.07);
  }
  72% {
    opacity: 0.66;
    transform: translate(-50%, -50%) translate(calc(var(--fx-dx, 160px) * 0.68 + var(--fx-dx2, 0px) * 0.2), calc(var(--fx-dy, -220px) * 0.68 + var(--fx-dy2, 0px) * 0.2)) scale(calc(var(--fx-scale-mid, 1.85) + 0.7)) rotate(calc(var(--fx-rot, 0deg) * 1.15));
    filter: blur(1.8px) saturate(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--fx-dx, 160px), var(--fx-dy, -220px)) scale(var(--fx-scale-end, 4.15)) rotate(calc(var(--fx-rot, 0deg) * 1.2));
    filter: blur(var(--fx-blur-end, 7px)) saturate(0.96);
  }
}

.karaoke-content {
  width: 100%;
  align-self: stretch;
  padding-top: clamp(8px, 1.5vh, 20px);
  padding-bottom: 72px;
  gap: 10px;
}

/* In-app karaoke overlay: full-width header (pill + close); lyrics block anchors above the dock. */
.karaoke-content > .karaoke-header {
  margin-top: 0;
  flex-shrink: 0;
  align-self: stretch;
}

.karaoke-content > .karaoke-viewport {
  margin-top: auto;
}

.karaoke-meta {
  width: min(100%, 1120px);
  justify-content: flex-start;
  align-items: center;
  min-height: 44px;
}

.karaoke-viewport {
  width: min(100%, 1120px);
  max-height: min(51vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px clamp(72px, 10vh, 120px);
  margin: 0 auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 8%, black 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, black 8%, black 88%, transparent 100%);
}

.karaoke-viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.karaoke-lines {
  display: grid;
  gap: 10px;
  align-content: end;
  width: 100%;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.karaoke-lines::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.karaoke-gap {
  height: 0.65rem;
}

.karaoke-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 8px 14px;
  border-radius: 0;
  text-align: center;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 4.8rem);
  line-height: 1.22;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 247, 250, 0.78);
  background: rgba(255, 255, 255, 0.03);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  transition: opacity 180ms ease, transform 180ms ease, color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.karaoke-line .lyric-section-heading {
  font-size: max(11px, 0.28em);
  letter-spacing: 0.18em;
  text-shadow: none;
}

.karaoke-line .lyric-line-main-text {
  text-align: center;
}

.karaoke-line.active {
  color: #160d13;
  background: linear-gradient(135deg, #fff7c7 0%, #ffd07a 48%, #ff8fb1 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42), 0 16px 32px rgba(255, 143, 177, 0.28), 0 0 24px rgba(255, 202, 108, 0.26);
  transform: translateY(-2px) scale(1.01);
  opacity: 1;
  text-shadow: none;
}

.karaoke-line.active .lyric-section-heading {
  color: #4a1530;
  background: linear-gradient(
    90deg,
    rgba(255, 111, 145, 0.48),
    rgba(255, 217, 140, 0.55),
    rgba(255, 111, 145, 0.48)
  );
  background-size: 200% 100%;
  box-shadow: 0 0 0 1px rgba(74, 21, 48, 0.1);
}

.karaoke-line.preview .lyric-section-heading {
  color: rgba(255, 247, 250, 0.96);
  background: linear-gradient(
    90deg,
    rgba(255, 202, 108, 0.34),
    rgba(255, 143, 177, 0.36),
    rgba(255, 202, 108, 0.34)
  );
  background-size: 200% 100%;
}

.karaoke-line.past {
  transform: translateY(-1px);
}

.karaoke-line.future {
  transform: translateY(1px);
}

@keyframes incoming-line-pulse {
  0% {
    transform: translateY(0) scale(0.995);
    filter: saturate(1);
  }
  50% {
    transform: translateY(-1px) scale(1.012);
    filter: saturate(1.08);
  }
  100% {
    transform: translateY(0) scale(0.995);
    filter: saturate(1);
  }
}

.karaoke-line.past-1 {
  opacity: 0.9;
}

.karaoke-line.past-2 {
  opacity: 0.76;
}

.karaoke-line.past-3 {
  opacity: 0.62;
}

.karaoke-line.past-4 {
  opacity: 0.48;
}

.karaoke-line.past-5,
.karaoke-line.past-6 {
  opacity: 0.32;
}

.karaoke-line.future-1 {
  opacity: 0.7;
}

.karaoke-line.future-2 {
  opacity: 0.56;
}

.karaoke-line.future-3 {
  opacity: 0.44;
}

.karaoke-line.future-4 {
  opacity: 0.34;
}

.karaoke-line.future-5,
.karaoke-line.future-6 {
  opacity: 0.24;
}

.karaoke-overlay.controls-hidden .singstar-dock {
  opacity: 0;
  transform: translateY(24px);
}

.karaoke-overlay.controls-hidden .singstar-dock,
.karaoke-overlay.controls-hidden .singstar-dock * {
  pointer-events: none;
}

.karaoke-overlay.controls-hidden .singstar-header {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

@media (max-width: 1100px) {
  .hero-grid,
  .main-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .singstar-stage {
    min-height: 70vh;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .now-header,
  .lyrics-header,
  .singstar-meta {
    flex-direction: column;
    align-items: start;
  }

  .now-thumb {
    width: 100%;
    height: 220px;
  }

  .singstar-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .singstar-dock-strip {
    gap: 8px;
    padding: 10px 12px;
  }

  .dock-btn {
    width: 48px;
    height: 48px;
  }
}

/* --- Narrow viewports: cut compositing cost (mobile Safari flicker from backdrop-blur + huge animated filters) --- */
@media (max-width: 900px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body.app-shell::before,
  body.singstar-shell::before {
    display: none;
  }

  .player-scene .scene-layer,
  .singstar-stage .scene-layer {
    animation: none !important;
    animation-play-state: paused !important;
    transition: opacity 420ms ease !important;
  }

  .singstar-backdrop {
    animation: none !important;
  }

  body.media-playing .player-scene .scene-layer,
  body.media-playing .singstar-stage .scene-layer {
    will-change: auto !important;
  }

  .scene-layer-blur {
    filter: blur(12px) saturate(1.04) brightness(0.93) contrast(1.02);
    transform: scale(1.12);
  }

  .singstar-stage .scene-layer-blur {
    filter: blur(14px) saturate(1.05) brightness(0.95) contrast(1.02);
    transform: scale(1.14);
  }

  .stat-card,
  .panel,
  .track-card,
  .app-shell .panel,
  .topbar,
  .tracks-auth-gate,
  .eyebrow,
  .eyebrow-solid,
  .volume-popover,
  .singstar-dock-strip,
  .singstar-header,
  .singstar-close,
  .player-transport-dock {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .lyric-flow-line.preview,
  .karaoke-line.preview {
    animation: none !important;
  }

  .lyric-flow-line.effect-highlight.active,
  .karaoke-line.effect-highlight.active {
    animation: none !important;
    filter: none;
  }

  .karaoke-viewport {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .karaoke-fx {
    will-change: auto;
  }

  .singstar-header {
    background: rgba(10, 7, 12, 0.82);
  }

  .singstar-close {
    background: rgba(10, 7, 12, 0.85);
  }
}
