/* ======================================================
   MUSIC & LYRICS PAGE — Tomotomo Friends
   Aligned with Our Story visual language
====================================================== */

/* ── Page background (matches .os-page) ── */
.ml-page {
  background:
    radial-gradient(circle at 18% -5%, rgba(255, 220, 108, 0.44) 0%, rgba(255, 220, 108, 0) 32%),
    radial-gradient(circle at 95% 2%, rgba(88, 210, 255, 0.36) 0%, rgba(88, 210, 255, 0) 38%),
    linear-gradient(180deg, #e5f9ff 0%, #fff8e2 52%, #ffe9f5 100%);
}

.ml-page main {
  position: relative;
  isolation: isolate;
}

.ml-page main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 224, 126, 0.22) 0, rgba(255, 224, 126, 0) 36%),
    radial-gradient(circle at 90% 20%, rgba(138, 225, 255, 0.20) 0, rgba(138, 225, 255, 0) 35%),
    radial-gradient(circle at 28% 70%, rgba(255, 173, 221, 0.17) 0, rgba(255, 173, 221, 0) 32%);
}

.ml-page main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.30;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.52) 0 1px, transparent 1px 100%);
  background-size: 20px 20px;
}

/* Remove global dark vignette for sections */
.ml-page .sec::after { opacity: 0; }

/* ======================================================
   HERO
====================================================== */

#ml-hero {
  min-height: clamp(640px, var(--app-vh-stable, 100vh), 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 15%, rgba(255, 237, 140, 0.85) 0, rgba(255, 237, 140, 0.45) 16%, rgba(255, 237, 140, 0) 36%),
    radial-gradient(circle at 87% 14%, rgba(123, 204, 255, 0.80) 0, rgba(123, 204, 255, 0.45) 16%, rgba(123, 204, 255, 0) 38%),
    linear-gradient(175deg, #8ed8ff 0%, #86d6fd 36%, #9fd9ff 62%, #b3e3ff 100%);
}

#ml-hero::before {
  content: "";
  position: absolute;
  width: clamp(320px, 46vw, 620px);
  height: clamp(320px, 46vw, 620px);
  top: -180px;
  left: -100px;
  background: radial-gradient(circle, rgba(255, 244, 179, 0.92) 0%, rgba(255, 244, 179, 0.14) 58%, rgba(255, 244, 179, 0) 72%);
  z-index: 0;
  pointer-events: none;
  animation: mlPulseGlow 6.4s ease-in-out infinite;
}

.ml-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("images/Background.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  mix-blend-mode: soft-light;
  transform: scale(1.08);
}

/* Floating icons (matches .os-float-icons) */
.ml-float-icons {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.ml-fi {
  position: absolute;
  font-size: clamp(26px, 4.6vw, 50px);
  opacity: 0.92;
  filter: drop-shadow(0 8px 12px rgba(37, 58, 95, 0.24));
  transform-origin: center;
  animation: mlWobble var(--dur, 4.8s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
}

.ml-fi:nth-child(1) { top: 16%; left: 10%;  --dur: 4.2s; }
.ml-fi:nth-child(2) { top: 22%; right: 8%;  --dur: 3.7s; --del: -0.8s; }
.ml-fi:nth-child(3) { top: 56%; left: 5%;   --dur: 5.1s; --del: -1.4s; }
.ml-fi:nth-child(4) { top: 63%; right: 8%;  --dur: 4.1s; --del: -0.5s; }
.ml-fi:nth-child(5) { top: 77%; left: 15%;  --dur: 4.7s; --del: -1.8s; }
.ml-fi:nth-child(6) { top: 76%; right: 16%; --dur: 4.4s; --del: -1.2s; }

/* Hero inner */
#ml-hero .sec-inner {
  position: relative;
  z-index: 4;
  min-height: clamp(620px, var(--app-vh-stable, 100vh), 860px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(74px, 11vw, 120px) 20px 110px;
}

.ml-hero-inner {
  position: relative;
  width: min(860px, 95vw);
}

.ml-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(160deg, rgba(255, 248, 203, 0.98) 0%, rgba(255, 231, 128, 0.94) 100%);
  color: #7c5300;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: clamp(12px, 1.8vw, 16px);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  box-shadow: 0 9px 0 rgba(179, 123, 0, 0.24), 0 14px 24px rgba(74, 53, 0, 0.16);
  transform: rotate(-2deg);
  margin-bottom: 22px;
  animation: mlPopIn 650ms var(--ease-bounce) both;
}

.ml-hero-badge::before { content: "♪ "; }

.ml-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(52px, 12vw, 124px);
  line-height: 0.94;
  letter-spacing: clamp(2px, 0.7vw, 6px);
  color: #fff1a4;
  -webkit-text-stroke: clamp(2px, 0.55vw, 5px) #5d3f00;
  paint-order: stroke fill;
  text-shadow: 5px 5px 0 rgba(93, 63, 0, 0.34), 0 10px 26px rgba(93, 63, 0, 0.24), 0 0 30px rgba(255, 242, 152, 0.22);
  animation: mlPopIn 760ms var(--ease-bounce) 90ms both;
}

.ml-hero-sub {
  margin: 20px auto 0;
  max-width: 640px;
  width: min(640px, calc(100vw - 32px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 13px 26px;
  border-radius: 28px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 244, 213, 0.90) 100%);
  color: #2f4f78;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(16px, 2.4vw, 24px);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  box-shadow: 0 10px 0 rgba(82, 123, 165, 0.22), 0 16px 30px rgba(53, 89, 132, 0.20);
  animation: mlPopIn 760ms var(--ease-bounce) 180ms both;
}

/* Scroll hint */
.ml-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  border: 2px solid rgba(255, 255, 255, 0.96);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 2px;
  color: #3c5680;
  text-transform: uppercase;
  box-shadow: 0 7px 16px rgba(58, 90, 131, 0.20);
  backdrop-filter: blur(6px);
  animation: mlHintFloat 2.2s ease-in-out infinite;
}

.ml-scroll-hint::after {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: mlArrowDrop 1.3s ease-in-out infinite;
}

/* ======================================================
   ALBUM TRAIL NAV
====================================================== */

.ml-album-trail-wrap {
  position: sticky;
  top: calc(var(--nav-h-desktop) - 2px);
  z-index: 22;
  padding: 14px clamp(16px, 4vw, 40px) 18px;
  background: linear-gradient(180deg, rgba(255, 250, 225, 0.90) 0%, rgba(255, 239, 248, 0.76) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.70);
  border-bottom: 1px solid rgba(122, 159, 196, 0.24);
  backdrop-filter: blur(10px);
}

.ml-album-trail-wrap::after {
  content: "";
  position: absolute;
  left: clamp(16px, 4vw, 44px);
  right: clamp(16px, 4vw, 44px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(115, 151, 196, 0) 0%, rgba(115, 151, 196, 0.45) 50%, rgba(115, 151, 196, 0) 100%);
}

.ml-album-trail {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.ml-trail-stop {
  --trail-accent: #ffb448;
  text-decoration: none;
  color: #1f2957;
  position: relative;
  overflow: hidden;
  background: linear-gradient(175deg, rgba(255, 255, 255, 0.95) 0%, color-mix(in srgb, var(--trail-accent) 17%, white) 100%);
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 11px 20px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 9px 0 rgba(44, 63, 112, 0.12), 0 14px 20px rgba(25, 37, 79, 0.12);
  transition: transform 220ms var(--ease-bounce, cubic-bezier(.22,1,.36,1)), box-shadow 220ms ease;
  font-family: var(--font-body);
  font-size: clamp(13px, 1.7vw, 15px);
  font-weight: 800;
}

.ml-trail-stop::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--trail-accent) 76%, white) 0%,
    color-mix(in srgb, var(--trail-accent) 34%, white) 100%);
}

.ml-trail-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  color: #113f61;
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--trail-accent) 42%, white) 0%,
    color-mix(in srgb, var(--trail-accent) 70%, white) 100%);
  border: 2px solid #fff;
  box-shadow: 0 3px 8px color-mix(in srgb, var(--trail-accent) 40%, transparent);
  flex-shrink: 0;
}

.ml-trail-stop:nth-child(odd)  { transform: rotate(-1.2deg); }
.ml-trail-stop:nth-child(even) { transform: rotate(1.1deg); }

.ml-trail-stop:hover,
.ml-trail-stop:focus-visible {
  transform: translateY(-5px) rotate(0deg);
  box-shadow: 0 12px 0 rgba(44, 63, 112, 0.15), 0 18px 24px rgba(25, 37, 79, 0.16);
}

/* ======================================================
   ALBUM SECTIONS
====================================================== */

#ml-albums { position: relative; }

.ml-album-section {
  position: relative;
  overflow: clip;
}

/* Cycling background colors (matches our-story sections) */
.ml-album-section:nth-child(5n+1) { background: linear-gradient(180deg, #fff3bf 0%, #ffe6aa 100%); --al-bg-top: #fff3bf; }
.ml-album-section:nth-child(5n+2) { background: linear-gradient(180deg, #dcf8cf 0%, #c9efba 100%); --al-bg-top: #dcf8cf; }
.ml-album-section:nth-child(5n+3) { background: linear-gradient(180deg, #ffe0f1 0%, #ffd2e8 100%); --al-bg-top: #ffe0f1; }
.ml-album-section:nth-child(5n+4) { background: linear-gradient(180deg, #d8f3ff 0%, #c6eaff 100%); --al-bg-top: #d8f3ff; }
.ml-album-section:nth-child(5n+0) { background: linear-gradient(180deg, #eedcff 0%, #e0c8ff 100%); --al-bg-top: #eedcff; }

/* Floating blobs per section */
.ml-album-section::before {
  content: "";
  position: absolute;
  width: clamp(180px, 34vw, 360px);
  height: clamp(180px, 34vw, 360px);
  right: -88px;
  top: 12%;
  border-radius: 50%;
  opacity: 0.50;
  background: radial-gradient(circle, color-mix(in srgb, var(--al-accent) 58%, white) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
  z-index: 0;
  animation: mlBlobFloat 12s ease-in-out infinite;
}

.ml-album-section::after {
  content: "";
  position: absolute;
  width: clamp(140px, 28vw, 260px);
  height: clamp(140px, 28vw, 260px);
  left: -72px;
  bottom: 8%;
  border-radius: 50%;
  opacity: 0.38;
  background: radial-gradient(circle, color-mix(in srgb, var(--al-accent) 40%, white) 0%, rgba(255, 255, 255, 0) 76%);
  pointer-events: none;
  z-index: 0;
  animation: mlBlobFloat 14s ease-in-out infinite reverse;
}

.ml-album-section > * { position: relative; z-index: 1; }

/* ── Album Banner ── */
.ml-album-banner {
  position: relative;
  margin: clamp(14px, 2vw, 20px) clamp(12px, 2vw, 16px) 0;
  height: clamp(340px, 44vw, 520px);
  overflow: hidden;
  border-radius: clamp(20px, 3vw, 30px);
  border: 2px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 34px rgba(20, 37, 88, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(148deg,
    color-mix(in srgb, var(--al-accent) 55%, white) 0%,
    color-mix(in srgb, var(--al-accent) 45%, #1a1060) 100%);
  isolation: isolate;
}

/* Gradient overlay on top of poster background */
.ml-album-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(17, 34, 72, 0.10) 0%, rgba(17, 34, 72, 0.52) 82%),
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.22) 0 18%, transparent 38%);
}

/* Full-bleed poster background image */
.ml-album-banner-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.86) saturate(1.06);
  z-index: 0;
}

/* Album label chip (like os-sec-banner data-chapter) */
.ml-album-chip {
  position: absolute;
  left: clamp(14px, 2.2vw, 24px);
  top: clamp(14px, 2.2vw, 24px);
  z-index: 4;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.90);
  background: linear-gradient(160deg, color-mix(in srgb, var(--al-accent) 38%, white) 0%, rgba(255, 255, 255, 0.88) 100%);
  box-shadow: 0 8px 18px rgba(20, 37, 88, 0.20);
  color: #26476c;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.2vw, 12px);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}


.ml-album-banner-title {
  position: relative;
  z-index: 3;
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(34px, 6.5vw, 76px);
  letter-spacing: clamp(2px, 0.5vw, 5px);
  line-height: 1.0;
  color: var(--al-accent);
  -webkit-text-stroke: clamp(2px, 0.35vw, 4px) #fff;
  paint-order: stroke fill;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.26), 0 8px 28px rgba(0, 0, 0, 0.16);
}

.ml-album-banner-meta {
  position: relative;
  z-index: 3;
  margin: 12px 0 0;
  font-family: var(--font-body);
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.10em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
}

/* Wave bottom of banner */
.ml-album-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: clamp(36px, 5.5vw, 65px);
  z-index: 2;
  display: block;
  overflow: visible;
}

.ml-album-wave path { fill: var(--al-bg-top); }

/* ── Album Content ── */
.ml-album-content {
  position: relative;
  z-index: 2;
  margin: clamp(-44px, -5.5vw, -28px) 0 0;
  padding: 0 0 56px;
}

/* Album card (matches .os-card) */
.ml-album-card {
  position: relative;
  width: min(1100px, calc(100% - clamp(20px, 4vw, 44px)));
  margin: 0 auto;
  border-radius: clamp(24px, 3vw, 36px);
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 253, 245, 0.93) 100%);
  padding: clamp(28px, 4vw, 48px) clamp(18px, 5vw, 56px) clamp(32px, 5vw, 52px);
  box-shadow: 0 24px 45px rgba(20, 37, 88, 0.20);
  overflow: visible;
}

.ml-album-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.40) 0%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--al-accent) 15%, white) 0%, rgba(255, 255, 255, 0) 44%);
}

/* Decorative top stripe (matches .os-card::after) */
.ml-album-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 42%;
  height: 12px;
  left: 50%;
  top: 0;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.35) 0%,
    color-mix(in srgb, var(--al-accent) 50%, white) 52%,
    rgba(255, 255, 255, 0.35) 100%);
  box-shadow: 0 2px 10px rgba(20, 37, 88, 0.14);
  pointer-events: none;
}

.ml-album-card > * { position: relative; z-index: 2; }

/* Album icon badge (matches .os-card-icon) */
.ml-album-icon {
  width: clamp(68px, 9vw, 90px);
  height: clamp(68px, 9vw, 90px);
  margin: clamp(-52px, -5.5vw, -34px) auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--al-accent) 28%, transparent);
  animation: mlBob 3.8s ease-in-out infinite;
  position: relative;
  z-index: 6;
}

.ml-album-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Song List ── */
.ml-song-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Song Item ── */
.ml-song-item {
  border-radius: 18px;
  background: color-mix(in srgb, var(--al-accent) 6%, white);
  border: 1.5px solid color-mix(in srgb, var(--al-accent) 28%, white);
  overflow: hidden;
  transition: transform 0.20s var(--ease-bounce, cubic-bezier(.34,1.56,.64,1)), box-shadow 0.20s ease;
}

.ml-song-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--al-accent) 22%, transparent);
}

.ml-song-head {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 12px;
  padding: 14px 20px 12px;
  flex-wrap: nowrap;
}

.ml-song-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-family: var(--font-title);
  font-size: 18px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--al-accent), color-mix(in srgb, var(--al-accent) 55%, #ff4ba8));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--al-accent) 38%, transparent);
  flex-shrink: 0;
}

/* Yellow/light accent needs dark text */
.ml-album-section:nth-child(5n+1) .ml-song-num,
.ml-album-section:nth-child(5n+5) .ml-song-num { color: #4a2800; }

.ml-song-info {
  flex: 1;
  min-width: 0;
  text-align: right;
}

.ml-song-title {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(15px, 2.2vw, 22px);
  line-height: 1.2;
  color: #1a0a3d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-song-by {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: #9f7fc0;
  margin-top: 2px;
}

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

.ml-song-dur {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  color: #5a3090;
  background: color-mix(in srgb, var(--al-accent) 12%, white);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-feature-settings: "tnum";
}

/* ── Play button ── */
.ml-play-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--al-accent), color-mix(in srgb, var(--al-accent) 55%, #ff4ba8));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--al-accent) 40%, transparent);
  transition: transform 0.18s var(--ease-spring, cubic-bezier(.34,1.56,.64,1)), box-shadow 0.18s ease;
}

.ml-play-btn:hover {
  transform: scale(1.12);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--al-accent) 55%, transparent);
}

.ml-play-btn.playing {
  animation: mlPulsePlaying 1.8s ease-in-out infinite;
}

.ml-play-btn svg { width: 18px; height: 18px; fill: currentColor; }
.ml-play-btn .ml-icon-play { margin-left: 2px; }

.ml-play-btn.playing .ml-icon-pause  { display: block; }
.ml-play-btn.playing .ml-icon-play   { display: none; }
.ml-play-btn:not(.playing) .ml-icon-pause { display: none; }
.ml-play-btn:not(.playing) .ml-icon-play  { display: block; }

/* ── Lyrics toggle button ── */
.ml-lyrics-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--al-accent) 58%, white);
  background: transparent;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 800;
  color: color-mix(in srgb, var(--al-accent) 70%, #1a0a3d);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.ml-lyrics-btn:hover {
  background: color-mix(in srgb, var(--al-accent) 14%, white);
}

.ml-lyrics-btn.open {
  background: var(--al-accent);
  color: #fff;
  border-color: var(--al-accent);
}

.ml-toggle-icon {
  font-style: normal;
  font-size: 11px;
  transition: transform 0.22s ease;
  display: inline-block;
}

.ml-lyrics-btn.open .ml-toggle-icon { transform: rotate(180deg); }

/* ── Audio player bar ── */
.ml-song-player-bar {
  padding: 2px 20px 12px;
}

.ml-audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--al-accent) 8%, white);
  border: 1.5px solid color-mix(in srgb, var(--al-accent) 20%, white);
}

.ml-progress-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.ml-progress-bar {
  width: 100%;
  height: 7px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  background: color-mix(in srgb, var(--al-accent) 20%, white);
}

.ml-progress-bar::-webkit-slider-runnable-track {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--al-accent) 20%, white);
}

.ml-progress-bar::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--al-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 4px 10px color-mix(in srgb, var(--al-accent) 42%, transparent);
}

.ml-progress-bar::-moz-range-track {
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--al-accent) 20%, white);
}

.ml-progress-bar::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--al-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 4px 10px color-mix(in srgb, var(--al-accent) 42%, transparent);
}

.ml-time-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  color: #9f7fc0;
}

/* ── Lyrics panel ── */
.ml-song-lyrics {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px 18px;
}

/* .ml-song-lyrics.visible overridden in animations section below */

.ml-lyrics-block {
  padding: 14px 18px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--al-accent) 6%, white);
  border: 1.5px solid color-mix(in srgb, var(--al-accent) 24%, white);
}

.ml-lyrics-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 7px;
  background: color-mix(in srgb, var(--al-accent) 18%, white);
  color: color-mix(in srgb, var(--al-accent) 72%, #1a0a3d);
}

.ml-lyrics-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.9;
  color: #3a1860;
  white-space: pre-line;
  font-weight: 600;
}

/* ======================================================
   DIVIDERS (matches .os-divider)
====================================================== */

.ml-divider {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.44) 0%, rgba(255, 255, 255, 0.24) 100%);
}

.ml-divider::before,
.ml-divider::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(152, 176, 214, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
}

.ml-divider::before { top: 0; }
.ml-divider::after  { bottom: 0; }

.ml-divider span {
  display: inline-block;
  border-radius: 50%;
  animation: mlBobDot 850ms ease-in-out infinite alternate;
}

.ml-divider span:nth-child(1) { width: 14px; height: 14px; background: #ff9ed0; animation-delay: 0ms; }
.ml-divider span:nth-child(2) { width: 10px; height: 10px; background: #ffd35a; animation-delay: 110ms; }
.ml-divider span:nth-child(3) { width: 18px; height: 18px; background: #80ddff; animation-delay: 180ms; }
.ml-divider span:nth-child(4) { width: 10px; height: 10px; background: #95e56d; animation-delay: 110ms; }
.ml-divider span:nth-child(5) { width: 14px; height: 14px; background: #ffa86b; animation-delay: 0ms; }

/* ======================================================
   KEYFRAMES
====================================================== */

@keyframes mlPopIn {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mlWobble {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%       { transform: translateY(-10px) rotate(7deg); }
  65%       { transform: translateY(6px) rotate(-5deg); }
}

@keyframes mlBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes mlBobDot {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

@keyframes mlBlobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-12px) scale(1.06); }
}

@keyframes mlHintFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-4px); }
}

@keyframes mlArrowDrop {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.8; }
  50%       { transform: rotate(45deg) translate(3px, 3px); opacity: 1; }
}

@keyframes mlPulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.06); opacity: 0.85; }
}

@keyframes mlPulsePlaying {
  0%, 100% { box-shadow: 0 6px 16px color-mix(in srgb, var(--al-accent) 40%, transparent); }
  50%       { box-shadow: 0 6px 32px color-mix(in srgb, var(--al-accent) 72%, transparent); }
}

/* ======================================================
   RESPONSIVE
====================================================== */

@media (max-width: 980px) {
  .ml-album-trail-wrap {
    top: calc(var(--nav-h-desktop) - 2px);
  }
}

@media (max-width: 768px) {
  #ml-hero {
    min-height: calc(var(--app-vh-stable, 100vh) - var(--nav-h-mobile, 70px) + 100px);
  }

  #ml-hero .sec-inner {
    min-height: calc(var(--app-vh-stable, 100vh) - var(--nav-h-mobile, 70px) + 100px);
    padding-top: 48px;
    padding-bottom: 86px;
  }

  .ml-album-trail-wrap {
    position: relative;
    top: auto;
    padding: 12px 12px 18px;
    backdrop-filter: none;
  }

  .ml-album-trail {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    justify-content: flex-start;
  }

  .ml-album-trail::-webkit-scrollbar { height: 6px; }
  .ml-album-trail::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(37, 81, 124, 0.35); }

  .ml-trail-stop {
    min-width: 180px;
    flex-shrink: 0;
    scroll-snap-align: center;
  }

  .ml-album-banner {
    margin: 10px 10px 0;
    height: clamp(280px, 72vw, 400px);
    border-radius: 20px;
  }

  .ml-album-card {
    width: calc(100% - 20px);
    border-radius: 22px;
    padding: 22px 14px 28px;
  }

  .ml-song-head {
    gap: 10px;
    padding: 12px 16px 10px;
  }
}

@media (max-width: 520px) {
  .ml-hero-title { letter-spacing: 2px; }

  .ml-album-banner-title { font-size: clamp(28px, 9vw, 44px); }

  .ml-song-head { padding: 11px 14px 9px; gap: 8px; }

  .ml-song-title { font-size: 16px; }

  .ml-song-actions { gap: 6px; }

  .ml-song-dur { font-size: 12px; padding: 3px 8px; }

  .ml-play-btn { width: 38px; height: 38px; }
  .ml-play-btn svg { width: 16px; height: 16px; }

  .ml-lyrics-btn { padding: 7px 12px; font-size: 11px; }

  .ml-song-player-bar { padding: 2px 14px 10px; }
  .ml-song-lyrics { padding: 0 14px 14px; }
}

/* Performance */
.ml-album-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 80vh;
}

@media (prefers-reduced-motion: reduce) {
  .ml-page * {
    animation: none !important;
    transition: none !important;
  }
}

/* ======================================================
   ALBUM SHOWCASE SLIDESHOW
====================================================== */

.ml-showcase-section {
  position: relative;
  padding: clamp(44px, 7vw, 80px) 0 clamp(36px, 5vw, 60px);
  background:
    radial-gradient(circle at 12% 0%, rgba(255,237,140,0.60) 0%, transparent 38%),
    radial-gradient(circle at 90% 5%, rgba(123,204,255,0.50) 0%, transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(255,180,220,0.32) 0%, transparent 42%),
    linear-gradient(180deg, #bde9ff 0%, #e5f9ff 30%, #fff5e8 70%, #ffe8f7 100%);
  overflow: hidden;
}

/* Floating deco blobs */
.ml-showcase-section::before {
  content: "";
  position: absolute;
  width: clamp(220px, 38vw, 440px);
  height: clamp(220px, 38vw, 440px);
  top: -100px; right: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,228,100,0.38) 0%, transparent 70%);
  pointer-events: none;
}

.ml-showcase-section::after {
  content: "";
  position: absolute;
  width: clamp(160px, 28vw, 300px);
  height: clamp(160px, 28vw, 300px);
  bottom: -60px; left: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,210,255,0.35) 0%, transparent 70%);
  pointer-events: none;
}

/* Header badge */
.ml-sc-header {
  text-align: center;
  margin-bottom: clamp(28px, 4vw, 46px);
  position: relative;
  z-index: 2;
}

.ml-sc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.97);
  background: linear-gradient(160deg, rgba(255,252,215,0.98) 0%, rgba(255,225,100,0.94) 100%);
  color: #7c5000;
  font-family: var(--font-display);
  font-size: clamp(13px, 2vw, 17px);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  box-shadow: 0 10px 0 rgba(179,123,0,0.22), 0 16px 28px rgba(74,53,0,0.14);
  animation: mlPopIn 650ms var(--ease-bounce) both;
}

/* Stage: arrow + viewport + arrow */
.ml-sc-stage {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 20px);
  padding: 0 clamp(8px, 3vw, 28px);
  position: relative;
  z-index: 2;
}

/* Viewport: clips the track */
.ml-sc-viewport {
  flex: 1;
  overflow: hidden;
  padding: 14px 0 20px; /* room for shadow */
}

/* Track: horizontal sliding flex */
.ml-sc-track {
  display: flex;
  gap: clamp(14px, 2.5vw, 24px);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  /* Initial padding so first/last card can center */
  padding: 0 var(--sc-side-pad, 24px);
}

/* ── Album Card (1:1 square) ── */
.ml-sc-card {
  flex: 0 0 var(--sc-card-w, clamp(200px, 34vw, 340px));
  aspect-ratio: 1 / 1;
  border-radius: clamp(20px, 3vw, 34px);
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow:
    0 4px 0 rgba(255,255,255,0.6),
    0 20px 40px rgba(20, 37, 88, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(16px, 2.5vw, 26px);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition:
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.38s ease,
    opacity 0.38s ease;
  transform: scale(0.86);
  opacity: 0.72;
  isolation: isolate;
}

.ml-sc-card.ml-sc-active {
  transform: scale(1.0);
  opacity: 1;
  box-shadow:
    0 6px 0 rgba(255,255,255,0.6),
    0 28px 56px rgba(20, 37, 88, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.ml-sc-card:hover {
  transform: scale(1.04) translateY(-5px);
  opacity: 1;
}
.ml-sc-card.ml-sc-active:hover {
  transform: scale(1.04) translateY(-7px);
}

/* Shimmer overlay */
.ml-sc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255,255,255,0.28) 0%, transparent 55%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

/* Polka-dot texture */
.ml-sc-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* Floaters layer */
.ml-sc-floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ml-sc-floater {
  position: absolute;
  animation: mlScFloat var(--dur, 3.8s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.22));
  line-height: 1;
  user-select: none;
}

/* Main icon */
.ml-sc-icon {
  position: relative;
  z-index: 3;
  line-height: 1;
  font-size: clamp(54px, 12vw, 96px);
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.30));
  animation: mlBob 3.8s ease-in-out infinite;
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 4px;
}

/* Bottom info block */
.ml-sc-info {
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: center;
  margin-top: auto;
}

.ml-sc-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  border: 1.5px solid rgba(255,255,255,0.72);
  font-family: var(--font-display);
  font-size: clamp(9px, 1.1vw, 11px);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.98);
  text-shadow: 0 1px 4px rgba(0,0,0,0.28);
  margin-bottom: 6px;
}

.ml-sc-title {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(14px, 2.6vw, 23px);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.38), 0 4px 20px rgba(0,0,0,0.22);
  -webkit-text-stroke: 0.5px rgba(0,0,0,0.12);
}

/* Arrow buttons */
.ml-sc-arrow {
  flex-shrink: 0;
  width: clamp(44px, 5vw, 58px);
  height: clamp(44px, 5vw, 58px);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.95);
  background: linear-gradient(160deg, #fff 0%, #e8f2ff 100%);
  color: #2c4890;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 7px 0 rgba(44,72,144,0.20), 0 12px 22px rgba(20,37,88,0.18);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s ease;
  position: relative;
  z-index: 3;
}

.ml-sc-arrow:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 0 rgba(44,72,144,0.22), 0 16px 28px rgba(20,37,88,0.22);
}

.ml-sc-arrow:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 3px 0 rgba(44,72,144,0.20), 0 8px 14px rgba(20,37,88,0.14);
}

/* Dots */
.ml-sc-dots-wrap {
  display: flex;
  justify-content: center;
  margin-top: clamp(18px, 3vw, 28px);
  position: relative;
  z-index: 2;
}

.ml-sc-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ml-sc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.90);
  background: rgba(44, 72, 144, 0.28);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(20,37,88,0.18);
  transition: all 0.30s var(--ease-bounce);
}

.ml-sc-dot.ml-sc-dot-active {
  width: 36px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4acfff, #3b7dff);
  border-color: rgba(255,255,255,0.98);
  box-shadow: 0 4px 16px rgba(74,207,255,0.50);
}

/* ── New keyframe ── */
@keyframes mlScFloat {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  35%       { transform: translateY(-10px) rotate(7deg) scale(1.05); }
  68%       { transform: translateY(5px) rotate(-5deg) scale(0.96); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .ml-sc-card {
    --sc-card-w: clamp(180px, 52vw, 290px);
  }
}

@media (max-width: 640px) {
  .ml-sc-card {
    --sc-card-w: clamp(200px, 76vw, 310px);
  }

  .ml-sc-card,
  .ml-sc-card.ml-sc-active {
    transform: scale(1) !important;
    opacity: 1 !important;
    box-shadow: 0 20px 40px rgba(20, 37, 88, 0.26) !important;
  }

  .ml-sc-card:hover {
    transform: scale(1.02) translateY(-4px) !important;
  }

  .ml-sc-arrow {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }

  .ml-sc-stage {
    gap: 8px;
    padding: 0 8px;
  }
}

@media (max-width: 400px) {
  .ml-sc-card {
    --sc-card-w: min(86vw, 280px);
  }
}

/* ================================================================
   LYRICS PANEL — FADE-IN + STAGGER ANIMATIONS
================================================================ */

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

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

/* Override static display rule — add fade animation on open */
.ml-song-lyrics.visible {
  display: flex;
  animation: mlLyricsIn 0.40s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Each block slides in staggered (delay set inline by JS) */
.ml-song-lyrics.visible .ml-lyrics-block {
  animation: mlBlockIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ================================================================
   SHOWCASE — POSTER IMAGE SUPPORT
================================================================ */

/* Poster image layer behind all card content */
.ml-sc-poster-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
  z-index: 0;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Subtle parallax zoom on hover */
.ml-sc-card.ml-sc-has-poster:hover .ml-sc-poster-bg {
  transform: scale(1.07);
}

/* Dark gradient overlay for readability */
.ml-sc-card.ml-sc-has-poster::before {
  background: linear-gradient(
    175deg,
    rgba(0, 0, 0, 0.10) 0%,
    rgba(0, 0, 0, 0.38) 65%,
    rgba(0, 0, 0, 0.65) 100%
  ) !important;
  z-index: 1;
}

/* Shimmer overlay keeps z-index: 1 — handled by above rule */

/* All content layers above the poster */
.ml-sc-card.ml-sc-has-poster .ml-sc-floaters,
.ml-sc-card.ml-sc-has-poster .ml-sc-icon,
.ml-sc-card.ml-sc-has-poster .ml-sc-info {
  position: relative;
  z-index: 2;
}

/* Type badge adapts to dark background */
.ml-sc-card.ml-sc-has-poster .ml-sc-type-badge {
  background: rgba(255, 255, 255, 0.20);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Album title stands out on poster */
.ml-sc-card.ml-sc-has-poster .ml-sc-title {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* Tone down polka dots on photo-backed cards */
.ml-sc-card.ml-sc-has-poster::after {
  opacity: 0.06;
}

/* ── Pure image poster card (no text, no emoji) ── */
.ml-sc-card.ml-sc-poster-only {
  padding: 0;
  overflow: hidden;
}

/* Remove all pseudo-element overlays for pure poster */
.ml-sc-card.ml-sc-poster-only::before,
.ml-sc-card.ml-sc-poster-only::after {
  display: none;
}

.ml-sc-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  -webkit-user-drag: none;
}

/* Zoom on hover */
.ml-sc-card.ml-sc-poster-only:hover .ml-sc-poster-img,
.ml-sc-card.ml-sc-poster-only.ml-sc-active:hover .ml-sc-poster-img {
  transform: scale(1.06);
}

/* Active card: full opacity, normal scale */
.ml-sc-card.ml-sc-poster-only.ml-sc-active {
  transform: scale(1.0);
  opacity: 1;
  box-shadow:
    0 0 0 4px #fff,
    0 12px 40px rgba(20, 37, 88, 0.28),
    0 4px 16px rgba(0, 0, 0, 0.18);
}

/* Inactive: slight dim + scale down */
.ml-sc-card.ml-sc-poster-only:not(.ml-sc-active) {
  transform: scale(0.87);
  opacity: 0.75;
}
