/* music.css: /music/ only.

   Four hundred rows of text, so the job here is rhythm rather than ornament:
   one accent color, a rank column at a fixed width so every title starts on
   the same vertical line, and a year header that sticks while you read its
   twenty. The backdrop is an equaliser, drawn in CSS.

   Loaded after fanpages.css, which supplies .fan-hero / .subsec / the shell. */

body[data-fan="music"] { --a: var(--violet); }

/* ═════════════ the backdrop ═════════════ */
.mu-sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.mu-glow {
  position: absolute; left: 50%; top: 12%; width: 74vw; height: 74vw;
  max-width: 940px; max-height: 940px; transform: translate(-50%, -30%);
  background: radial-gradient(circle, rgba(169,140,240,0.08), transparent 62%);
}

/* the equaliser along the bottom edge: bars that breathe out of phase */
.mu-eq {
  position: absolute; left: 0; right: 0; bottom: 0; height: 32vh;
  display: flex; align-items: flex-end; gap: 0.7vw; padding: 0 2vw;
}

.mu-eq i {
  flex: 1 1 0; display: block; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--violet), rgba(169,140,240,0.02));
  opacity: .1; height: 40%; transform-origin: bottom;
  animation: muEq 3.4s var(--ease) infinite;
}

.mu-eq i:nth-child(3n)   { animation-delay: .4s;  height: 68%; }
.mu-eq i:nth-child(3n+1) { animation-delay: .9s;  height: 28%; }
.mu-eq i:nth-child(4n)   { animation-delay: 1.5s; height: 82%; }
.mu-eq i:nth-child(5n)   { animation-delay: 2.1s; height: 52%; }

@keyframes muEq {
  0%, 100% { transform: scaleY(0.3); opacity: .06; }
  50%      { transform: scaleY(1);   opacity: .16; }
}

@media (prefers-reduced-motion: reduce) {
  .mu-eq i { animation: none; }
}

/* ═════════════ the tally ═════════════ */
.mu-tally {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  max-width: var(--maxw); margin: 0 auto 2rem; padding: 0 var(--gutter);
}

.mu-tally span {
  flex: 1 1 140px; display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(13,13,16,0.6);
}

.mu-tally b {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  letter-spacing: -0.03em; color: var(--a);
}

.mu-tally i {
  font-style: normal; font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute);
}

/* ═════════════ the era chips ═════════════ */
.mu-filter {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  max-width: var(--maxw); margin: 0 auto 1.4rem; padding: 0 var(--gutter);
}

.mu-chip {
  display: flex; flex-direction: column; gap: 0.15rem; text-align: left;
  padding: 0.6rem 0.95rem; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(13,13,16,0.6); color: var(--ink-dim); cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease),
              background .25s var(--ease);
}

.mu-chip b {
  font-family: var(--serif); font-size: 0.86rem; font-weight: 600;
  letter-spacing: -0.01em; color: inherit;
}

.mu-chip i {
  font-style: normal; font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mute);
}

.mu-chip:hover { border-color: color-mix(in srgb, var(--a) 40%, var(--line)); color: var(--ink); }

.mu-chip.is-on {
  border-color: var(--a); color: var(--ink);
  background: color-mix(in srgb, var(--a) 10%, rgba(13,13,16,0.6));
}

.mu-chip.is-on i { color: color-mix(in srgb, var(--a) 70%, var(--mute)); }

.mu-chip:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; }

/* ═════════════ the jump strip ═════════════ */
.mu-jump {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  max-width: var(--maxw); margin: 0 auto 2.4rem; padding: 0 var(--gutter);
}

.mu-jump a {
  padding: 0.3rem 0.6rem; border-radius: 7px; border: 1px solid transparent;
  font-family: var(--mono); font-size: 0.74rem; color: var(--mute);
  text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.mu-jump a:hover { color: var(--a); border-color: color-mix(in srgb, var(--a) 35%, transparent); }

/* ═════════════ a year ═════════════ */
.mu-years { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* the jump clearance comes from base.css's scroll-padding-top now; 4.5rem here
   added to it */
.mu-year { margin-bottom: 3.2rem; }

/* the filter hides years rather than removing them, so the anchors survive */
#muRoot[data-era="10s"] .mu-year:not([data-era="10s"]),
#muRoot[data-era="20s"] .mu-year:not([data-era="20s"]),
#muRoot[data-era="00s"] .mu-year:not([data-era="00s"]),
#muRoot[data-era="now"] .mu-year:not([data-era="now"]) { display: none; }

.mu-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.7rem 0 0.6rem; margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 70%, rgba(8,8,10,0.85));
  backdrop-filter: blur(6px);
}

.mu-y {
  font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700; letter-spacing: -0.04em; color: var(--a);
  line-height: 1;
}

.mu-grade {
  font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim); padding: 0.2rem 0.55rem;
  border: 1px solid var(--line); border-radius: 999px;
}

.mu-n {
  margin-left: auto; font-family: var(--mono); font-size: 0.72rem;
  color: var(--mute);
}

.mu-note {
  max-width: 68ch; margin-bottom: 1rem;
  font-size: 0.84rem; line-height: 1.7; color: var(--ink-dim);
}

/* ═════════════ the rows ═════════════ */
/* Two columns on a wide screen, because twenty rows in one column makes every
   year a full screen of scrolling and the point is to compare them. */
.mu-list {
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: 2.4rem;
}

@media (max-width: 760px) { .mu-list { columns: 1; } }

.mu-row {
  display: flex; align-items: baseline; gap: 0.8rem;
  padding: 0.5rem 0.4rem; border-radius: 8px;
  break-inside: avoid; -webkit-column-break-inside: avoid;
  transition: background .2s var(--ease);
}

/* the play button sits hard right, so four hundred of them make one clean
   column down the page rather than a ragged edge chasing the titles */
.mu-song { flex: 1 1 auto; }

.mu-row:hover { background: rgba(255,255,255,0.025); }

.mu-rank {
  flex: 0 0 2ch; font-family: var(--mono); font-size: 0.78rem;
  color: var(--mute); text-align: right;
}

.mu-row.is-top .mu-rank { color: var(--a); }

.mu-song { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.mu-title {
  font-family: var(--serif); font-size: 0.92rem; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1.35;
}

.mu-row.is-top .mu-title { color: var(--a); }

.mu-artist {
  font-style: normal; font-size: 0.76rem; line-height: 1.4; color: var(--ink-dim);
}

/* Peak, Peak Peak, Peak Peak Peak: the songs that are more than just kept.
   Each level a step brighter: an outlined gold pill, then a filled one, then
   a filled one with a glow, and the row's wash deepens with it. */
.mu-row.is-peak-1 { background: color-mix(in srgb, var(--gold) 5%, transparent); }
.mu-row.is-peak-2 { background: color-mix(in srgb, var(--gold) 9%, transparent); }
.mu-row.is-peak-3 { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.mu-row.is-peak:hover { background: color-mix(in srgb, var(--gold) 17%, transparent); }
.mu-peak {
  display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 100px;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold); vertical-align: 0.12em; white-space: nowrap;
}
.mu-peak--2 { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.mu-peak--3 {
  background: var(--gold); color: #1a1405; border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent), 0 0 18px -2px var(--gold);
}
/* a song that was never on the chart: a + where the rank would be */
.mu-row.is-extra .mu-rank { color: var(--green-2); }
.mu-note {
  font-style: normal; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.04em; color: var(--green-2);
}

/* ═════════════ the play button ═════════════ */
/* A SEARCH on YouTube Music rather than an embedded player: see the comment in
   music.js. It is an <a> and not a <button> because it genuinely navigates. */
.mu-play {
  flex: 0 0 auto; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
  color: var(--mute); text-decoration: none;
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background .2s var(--ease), transform .2s var(--ease);
}

.mu-play svg { width: 13px; height: 13px; fill: currentColor; margin-left: 1px; }

.mu-row:hover .mu-play { color: var(--ink-dim); border-color: color-mix(in srgb, var(--a) 30%, var(--line)); }

.mu-play:hover {
  color: var(--bg); background: var(--a); border-color: var(--a);
  transform: scale(1.1);
}

.mu-play:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; color: var(--ink); }

/* The two kinds of button, told apart at a glance: a song that plays here is
   filled in the accent, one that leaves for a search stays an outline. Both are
   the same size and in the same column, so the difference reads as a property
   of the song rather than as two different controls. */
.mu-play--yt {
  border-color: color-mix(in srgb, var(--a) 45%, var(--line));
  background: color-mix(in srgb, var(--a) 14%, transparent);
  color: color-mix(in srgb, var(--a) 85%, var(--ink));
  cursor: pointer;
}

.mu-row:hover .mu-play--yt { color: var(--a); border-color: var(--a); }

/* playing: the icon becomes a stop square via CSS, no second svg */
.mu-play--yt.is-playing {
  color: var(--bg); background: var(--a); border-color: var(--a);
}

.mu-play--yt.is-playing svg { display: none; }

.mu-play--yt.is-playing::after {
  content: ''; width: 9px; height: 9px; border-radius: 1.5px;
  background: currentColor;
}

/* THE PLAYER PANEL INSIDE A TWO-COLUMN LIST.
   ytplay.js inserts its panel as a sibling of the row it was launched from,
   which here means a direct child of .mu-list, and .mu-list is a two-column
   CSS-columns layout. Left alone the video would be squeezed into one narrow
   column and could be split across the column break, which is the one place a
   video must never be. A playing list drops to a single column for as long as
   the panel is open: the rows reflow, the player gets the full width, and
   nothing is ever cut in half. */
.mu-list:has(.fan-stage) { columns: 1; }

.mu-list .fan-stage {
  list-style: none; margin: 0.6rem 0 1rem;
  break-inside: avoid; -webkit-column-break-inside: avoid;
}

/* :has() is not everywhere yet. Without it the columns stay, so cap the panel
   to the column width and keep it whole rather than letting it overflow. */
@supports not selector(:has(*)) {
  .mu-list .fan-stage { max-width: 100%; }
}

/* Touch has no hover, so the button never gets its cue there. Keep it visible
   from the start and drop the scale, which only reads as a flicker on tap. */
@media (hover: none) {
  .mu-play { color: var(--ink-dim); }
  .mu-play:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mu-play { transition: none; }
  .mu-play:hover { transform: none; }
}


/* ═════════════ order and group ═════════════ */
.mu-view {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem;
  max-width: var(--maxw); margin: 0 auto 1.4rem; padding: 0 var(--gutter);
}
.mu-view-l { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.mu-view-s {
  min-height: 40px; padding: 0.45rem 2rem 0.45rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 0.85rem; color-scheme: dark;
}
.mu-years[hidden], .mu-jump[hidden] { display: none; }
/* the era chips filter the grouped views too, song by song */
#muRoot[data-era="10s"] .mu-alt .mu-row:not([data-era="10s"]),
#muRoot[data-era="20s"] .mu-alt .mu-row:not([data-era="20s"]),
#muRoot[data-era="00s"] .mu-alt .mu-row:not([data-era="00s"]),
#muRoot[data-era="now"] .mu-alt .mu-row:not([data-era="now"]) { display: none; }
/* the Show filter: one Peak level, or every Peak (music.js recounts the blocks
   and marks the ones left empty) */
#muRoot[data-peak="any"] .mu-row:not(.is-peak),
#muRoot[data-peak="1"] .mu-row:not(.is-peak-1),
#muRoot[data-peak="2"] .mu-row:not(.is-peak-2),
#muRoot[data-peak="3"] .mu-row:not(.is-peak-3),
#muRoot .mu-year.is-unpeaked,
#muRoot .mu-jump a.is-unpeaked { display: none; }

/* ═════════════ the worlds' themes ═════════════ */
.mu-themes { margin-top: 1rem; }
.mu-theme .mu-rank { color: var(--a); }
.mu-theme .mu-artist a { color: var(--ink-dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.mu-theme .mu-artist a:hover { color: var(--a); border-color: var(--a); }
