/* ============================================================================
   J.A.R.V.I.S. MUSIC — folha de estilo própria (v2, redesenho «clean»)
   ----------------------------------------------------------------------------
   Porquê um ficheiro só para isto: a app de música vivia em pedaços espalhados
   pelo style.css, camada sobre camada de remendos — parecia «presa por arames»
   e no iPhone (.ipa) desfazia-se. Aqui está tudo num sítio, com um sistema de
   design coerente: fundo violeta profundo, cartões arredondados, tipografia
   clara e alvos de toque a sério.

   REGRA: nenhum nome de classe usado pelo js/music.js muda de nome sem se mudar
   também lá. Este ficheiro é a ÚNICA fonte de verdade do visual da música.

   Estrutura:
     1. Tokens e chassis          6. Listas de faixas
     2. Cabeçalho e pesquisa      7. Barra de reprodução (mini no telemóvel)
     3. Navegação (dock/abas)     8. Ecrã «A tocar»
     4. Barra lateral e coluna    9. Letras, estatísticas, diálogos
     5. Cartões e prateleiras    10. Telemóvel (o caso que mais dói)
   ========================================================================== */

/* ===== 1. TOKENS E CHASSIS ================================================ */
.music-app {
  /* Paleta própria: a música é o único sítio do Jarvis que foge do âmbar/ciano
     do HUD. É de propósito — é uma app dentro do sistema, não um painel dele. */
  --m-ink: #f6f2ff;
  --m-dim: #a79ec6;
  --m-dim-2: #7e769b;
  --m-a1: #a06bff;                /* violeta */
  --m-a2: #e364d8;                /* magenta */
  --m-a: #b47cff;                 /* violeta de leitura (texto/ícones ativos) */
  --m-grad: linear-gradient(135deg, var(--m-a1), var(--m-a2));
  /* MAIS VIVO (31 jul 2026: "muito murchas, não tão opacas"): os cartões a
     branco 5% liam-se como cinzento morto. Sobe o branco e entra um sopro do
     violeta/magenta da casa — cor, não leite. */
  --m-card: linear-gradient(160deg, rgba(160, 107, 255, 0.13), rgba(227, 100, 216, 0.07) 55%, rgba(255, 255, 255, 0.06));
  --m-card-2: linear-gradient(160deg, rgba(160, 107, 255, 0.20), rgba(227, 100, 216, 0.11) 55%, rgba(255, 255, 255, 0.10));
  --m-line: rgba(255, 255, 255, 0.14);
  --m-line-2: rgba(255, 255, 255, 0.22);
  --m-r: 20px;                    /* raio dos cartões */
  --m-r-s: 12px;                  /* raio pequeno (capas de lista, botões) */
  --m-dock: 0px;                  /* altura do dock de baixo (só no telemóvel) */
  --m-pad: 24px;

  position: fixed;
  inset: 0;
  z-index: 82;
  display: flex;
  flex-direction: column;
  color: var(--m-ink);
  background:
    radial-gradient(90% 60% at 8% -6%, rgba(160, 107, 255, 0.30), transparent 62%),
    radial-gradient(80% 55% at 100% 4%, rgba(227, 100, 216, 0.18), transparent 60%),
    radial-gradient(120% 70% at 50% 108%, rgba(94, 62, 175, 0.24), transparent 65%),
    linear-gradient(180deg, #150c28 0%, #0e0819 46%, #07040e 100%);
  background-color: #07040e;      /* sela a safe-area (o shorthand deixava-a transparente) */
  animation: fadeIn 0.2s ease-out;
}
.music-app.hidden { display: none; }
/* Sela a página a escuro enquanto a música está aberta — mata a barra branca da
   safe-area (home indicator) no iPhone, seja qual for o tema por trás. */
html.music-open, html.music-open body { background: #07040e !important; }

/* Véu com a capa do que está a tocar: dá vida sem atrapalhar a leitura.
   NOTA: a .music-app já é position:fixed (contém este ::before) — NÃO voltar a
   pôr position:relative, senão a app perde a altura fixa e deixa de rolar. */
.music-app::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--mu-cover, none); background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.3); opacity: 0.20; transition: opacity 0.6s;
}
.mu-head, .mu-body, .mu-bar, .mu-nav { position: relative; z-index: 1; }

.mu-loading { color: var(--m-dim); text-align: center; padding: 44px 16px; font-size: 15px; line-height: 1.6; }
/* host do leitor YouTube — renderizado (áudio) mas fora de vista */
#ytHost { position: fixed; left: -9999px; bottom: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0.01; pointer-events: none; z-index: -1; }

/* ===== 2. CABEÇALHO E PESQUISA ============================================ */
.mu-head {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'hi acts' 'search search';
  align-items: center;
  gap: 14px;
  padding: calc(16px + var(--safe-top)) var(--m-pad) 14px;
}
.mu-hi { grid-area: hi; min-width: 0; }
.mu-hi-1 { font-size: 13px; letter-spacing: 0.3px; color: var(--m-dim); margin-bottom: 2px; }
.mu-hi-2 {
  font-size: 25px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15;
  background: linear-gradient(100deg, #ffffff, #d9c8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mu-head-acts { grid-area: acts; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mu-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--m-line); background: var(--m-card); color: var(--m-ink);
  cursor: pointer; padding: 0; font: inherit;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s;
}
.mu-ico svg { display: block; }
.mu-ico:hover { background: var(--m-card-2); border-color: var(--m-line-2); color: #fff; }
.mu-ico:active { transform: scale(0.94); }
.mu-ico.mu-ico-x:hover { color: #ff8fa3; border-color: rgba(255, 143, 163, 0.5); }

.mu-searchrow { grid-area: search; position: relative; display: flex; align-items: center; }
.mu-searchrow::before {
  content: ""; position: absolute; left: 18px; width: 16px; height: 16px; pointer-events: none;
  background: currentColor; color: var(--m-dim); opacity: 0.9;
  -webkit-mask: var(--mu-lupa) center / contain no-repeat; mask: var(--mu-lupa) center / contain no-repeat;
}
.music-app { --mu-lupa: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><line x1='16.5' y1='16.5' x2='21' y2='21'/></svg>"); }
.mu-search {
  width: 100%; height: 46px; padding: 0 18px 0 44px;
  border-radius: 14px; border: 1px solid var(--m-line);
  background: var(--m-card); color: var(--m-ink);
  font: inherit; font-size: 15px; outline: none;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.mu-search:focus { border-color: rgba(180, 124, 255, 0.7); background: rgba(160, 107, 255, 0.10); box-shadow: 0 0 0 4px rgba(160, 107, 255, 0.12); }
.mu-search::placeholder { color: var(--m-dim-2); }
.mu-search::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Em ecrã largo o cabeçalho é uma linha só: saudação | pesquisa | ações. */
@media (min-width: 901px) {
  .mu-head { grid-template-columns: auto 1fr auto; grid-template-areas: 'hi search acts'; gap: 20px; padding-bottom: 16px; }
  .mu-hi { max-width: 260px; }
  .mu-searchrow { max-width: 520px; }
}

/* ===== 3. NAVEGAÇÃO ======================================================= */
/* Ecrã largo: abas em pastilha no topo do conteúdo.
   Telemóvel: dock fixo em baixo, com ícone + rótulo (secção 10). */
.mu-nav {
  flex-shrink: 0; display: flex; gap: 6px; align-items: center;
  padding: 4px var(--m-pad) 14px;
  overflow-x: auto; scrollbar-width: none;
}
.mu-nav::-webkit-scrollbar { display: none; }
.mu-nav.hidden { display: none; }
.mu-navb {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--m-card); border: 1px solid transparent; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--m-dim);
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}
.mu-navb-ic { display: inline-flex; }
.mu-navb-ic svg { display: block; width: 17px; height: 17px; }
.mu-navb:hover { color: var(--m-ink); background: var(--m-card-2); }
.mu-navb.on { color: #fff; background: var(--m-grad); border-color: transparent; box-shadow: 0 6px 20px rgba(160, 107, 255, 0.35); }

/* ===== 4. CORPO, BARRA LATERAL E COLUNA DA DIREITA ======================== */
.mu-body { flex: 1; display: flex; min-height: 0; }
.mu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.mu-home, .mu-results, .mu-stats {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 var(--m-pad) 28px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.mu-results.hidden, .mu-home.hidden, .mu-stats.hidden { display: none; }
.mu-pane.hidden { display: none; }
/* Listas grandes (a biblioteca tem ~15 mil faixas): só se pinta o que se vê. */
.mu-results .mu-item, .mu-home .mu-item { content-visibility: auto; contain-intrinsic-size: auto 62px; }

.mu-side {
  width: 250px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0;
  padding: 0 10px 16px 16px; gap: 10px;
}
.mu-side-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--m-dim-2);
  padding: 0 6px;
}
.mu-side-new {
  width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--m-line);
  background: var(--m-card); color: var(--m-a); cursor: pointer; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.mu-side-new:hover { background: rgba(160, 107, 255, 0.18); border-color: rgba(180, 124, 255, 0.5); }
.mu-side-search {
  height: 38px; border-radius: 11px; border: 1px solid var(--m-line); background: var(--m-card);
  color: var(--m-ink); font: inherit; font-size: 13.5px; padding: 0 14px; outline: none;
}
.mu-side-search:focus { border-color: rgba(180, 124, 255, 0.6); }
.mu-side-list { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.mu-side-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: 12px;
  border: none; background: none; cursor: pointer; color: var(--m-ink); text-align: left; width: 100%;
  transition: background 0.12s;
}
.mu-side-item:hover { background: var(--m-card); }
.mu-side-item.drop { background: rgba(160, 107, 255, 0.22); outline: 1.5px dashed var(--m-a); }
.mu-side-ic {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3a2260, #1a1030); color: rgba(255, 255, 255, 0.5); font-size: 17px;
}
.mu-side-ic img { width: 100%; height: 100%; object-fit: cover; }
.mu-side-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mu-side-ct { font-size: 11px; color: var(--m-dim-2); flex-shrink: 0; }
.mu-side-pin { flex-shrink: 0; font-size: 12px; opacity: 0; cursor: pointer; padding: 0 2px; transition: opacity 0.12s, transform 0.12s; }
.mu-side-item:hover .mu-side-pin { opacity: 0.5; }
.mu-side-pin:hover { opacity: 1 !important; transform: scale(1.15); }
.mu-side-item.pinned .mu-side-pin { opacity: 1; }
.mu-side-item.pinned .mu-side-nm { font-weight: 600; }
.mu-side-empty { color: var(--m-dim-2); font-size: 13px; padding: 12px 8px; line-height: 1.5; }

.mu-right {
  width: 340px; flex-shrink: 0; display: flex; flex-direction: column;
  min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 20px; gap: 16px;
}
.mu-right.hidden { display: none; }
/* Só em ecrãs largos (Mac/Surface) — no telemóvel não cabe e gastava CPU à toa. */
@media (max-width: 1099px) { .mu-right { display: none !important; } }
/* Sem videoclipe ainda carregado ficava um retângulo preto pendurado no topo da
   coluna — por isso só se mostra depois de haver leitor. NÃO usar :has(#muClip:empty):
   a API do YouTube SUBSTITUI a <div id="muClip"> por um <iframe>, e um iframe está
   sempre "vazio" — a regra escondia o videoclipe para sempre (regressão 30 jul). */
.mu-clip { display: none; position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; flex-shrink: 0; border-radius: var(--m-r-s); overflow: hidden; }
.mu-clip.on { display: block; }
.mu-artist-panel:has(> #muArtistTop:empty) .mu-artist-toptitle { display: none; }
.mu-clip iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.mu-clip-tag {
  position: absolute; left: 8px; bottom: 8px; font-size: 10px; letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.9); background: rgba(0, 0, 0, 0.55);
  padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.mu-artist-panel { padding-bottom: 8px; }
.mu-artist-name { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.mu-artist-intro { font-size: 13.5px; line-height: 1.6; color: var(--m-dim); margin-bottom: 18px; }
.mu-artist-toptitle { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--m-a); margin-bottom: 8px; }
.mu-artist-top { display: flex; flex-direction: column; gap: 2px; }
.mu-artist-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: var(--m-ink); cursor: pointer;
  padding: 8px; border-radius: 10px; font: inherit;
}
.mu-artist-row:hover { background: var(--m-card); }
.mu-artist-n { width: 18px; text-align: right; color: var(--m-dim-2); font-size: 12px; flex-shrink: 0; }
.mu-artist-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.mu-artist-row.mu-artist-loading .mu-artist-t { opacity: 0.5; }
.mu-artist-vazio { font-size: 13px; line-height: 1.5; color: var(--m-dim-2); padding: 4px 8px; }

/* ===== 5. CARTÃO DO DJ, PRATELEIRAS E CARTÕES ============================= */
.mu-dj {
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 26px; margin-bottom: 28px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(227, 100, 216, 0.55), transparent 58%),
    linear-gradient(135deg, #7b3fe4 0%, #4c1d95 62%, #2a1055 100%);
  box-shadow: 0 22px 50px rgba(76, 29, 149, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.mu-dj::after {                       /* disco/onda decorativa no canto */
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 62%);
}
.mu-dj-title { position: relative; font-size: 24px; font-weight: 800; letter-spacing: -0.3px; color: #fff; margin-bottom: 6px; }
.mu-dj-sub { position: relative; color: rgba(255, 255, 255, 0.82); margin-bottom: 18px; font-size: 14px; line-height: 1.5; max-width: 46ch; }
.mu-dj-row { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.mu-vibe {
  flex: 1; min-width: 200px; height: 50px; padding: 0 18px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 4, 24, 0.42); color: #fff; font: inherit; font-size: 15px; outline: none;
}
.mu-vibe::placeholder { color: rgba(255, 255, 255, 0.5); }
.mu-vibe:focus { border-color: rgba(255, 255, 255, 0.6); background: rgba(10, 4, 24, 0.6); }
.mu-dj-go {
  height: 50px; padding: 0 26px; border-radius: 14px; border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 15px; color: #2b0b48;
  background: linear-gradient(180deg, #ffffff, #e7d9ff);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.12s, box-shadow 0.12s;
}
.mu-dj-go:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36); }
.mu-dj-go:active { transform: scale(0.97); }
.mu-chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mu-chip {
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.12s, border-color 0.12s;
}
.mu-chip:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.45); }

.mu-shelf { margin-bottom: 30px; }
.mu-shelf h3 {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.2px; color: var(--m-ink);
  margin-bottom: 14px;
}
.mu-shelf-row {
  display: flex; gap: 16px; overflow-x: auto; padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch; scroll-behavior: smooth; scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.mu-shelf-row::-webkit-scrollbar { height: 4px; }
.mu-shelf-row::-webkit-scrollbar-thumb { background: rgba(180, 124, 255, 0.3); border-radius: 4px; }
.mu-shelf-row::-webkit-scrollbar-track { background: transparent; }
.mu-card {
  position: relative; flex: 0 0 auto; width: 156px; scroll-snap-align: start;
  background: none; border: none; cursor: pointer; text-align: left; color: var(--m-ink); padding: 0;
}
.mu-card img, .mu-tile {
  width: 100%; height: 156px; border-radius: 18px; object-fit: cover; display: block;
  background: linear-gradient(135deg, #2c1a4d, #150c28);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.mu-card:hover img, .mu-card:hover .mu-tile { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(160, 107, 255, 0.32); }
.mu-card:active { transform: scale(0.98); }
/* Botão ▶ que aparece sobre a capa (como no Spotify) */
.mu-card::after {
  content: ""; position: absolute; right: 10px; top: 108px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--m-grad) center / 40% no-repeat, var(--m-grad);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  -webkit-mask: none;
  opacity: 0; transform: translateY(8px) scale(0.9);
  transition: opacity 0.16s, transform 0.16s;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5.5v13l11-6.5z'/></svg>"),
    linear-gradient(135deg, #a06bff, #e364d8);
  background-size: 15px, cover; background-position: center, center; background-repeat: no-repeat;
  pointer-events: none;
}
.mu-card:hover::after { opacity: 1; transform: translateY(0) scale(1); }
.mu-card-name { font-size: 14px; font-weight: 600; margin-top: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-card-artist { font-size: 12.5px; color: var(--m-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mosaico de género/vibe: sem legenda por baixo (o nome está dentro). */
.mu-tile {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 14px;
  font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.mu-tile::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 18% 0%, rgba(255, 255, 255, 0.26), transparent 55%),
    linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.42));
}
.mu-tile::after { content: "♪"; position: absolute; top: 8px; right: 13px; font-size: 26px; color: rgba(255, 255, 255, 0.3); font-weight: 700; }
.mu-tile-lb { position: relative; z-index: 1; }
.mu-card-vibe .mu-card-name, .mu-card-vibe .mu-card-artist { display: none; }
.mu-card-vibe .mu-tile { font-size: 16px; line-height: 1.2; }
.mu-card-vibe::after { top: auto; bottom: 12px; }

/* Esqueletos enquanto as prateleiras editoriais carregam. */
.mu-skel { background: none; pointer-events: none; }
.mu-skel::after { display: none; }
.mu-skel::before {
  content: ""; display: block; width: 100%; height: 156px; border-radius: 18px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045) 30%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.045) 70%);
  background-size: 200% 100%; animation: muShimmer 1.3s infinite;
}
@keyframes muShimmer { to { background-position: -200% 0; } }

/* Grelha (biblioteca) — quebra linha em vez de rolar na horizontal. */
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 20px 16px; }
.mu-grid .mu-card { width: 100%; }
.mu-grid .mu-card img, .mu-grid .mu-card .mu-tile { height: auto; aspect-ratio: 1 / 1; }
.mu-grid .mu-card::after { top: auto; bottom: 62px; }
.mu-tile-pl { background: linear-gradient(135deg, #4b2a8c, #1c1033); align-items: center; justify-content: center; }
.mu-tile-pl::after { content: "♪"; position: static; font-size: 42px; color: rgba(255, 255, 255, 0.4); }
.mu-tile-pl::before { display: none; }

/* Botões de importação (Biblioteca) — discretos, alinhados, sem parecer um
   painel de administração. O do Spotify mantém o verde da marca. */
.mu-imp-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  padding: 10px 18px 10px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--m-dim);
  border: 1px dashed var(--m-line-2); background: none;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}
.mu-imp-toggle:hover, .mu-imp-toggle.on { color: var(--m-ink); border-color: rgba(180, 124, 255, 0.6); background: rgba(160, 107, 255, 0.10); }
.mu-imp-toggle.on { border-style: solid; }
.mu-imp-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.mu-imp-wrap.hidden { display: none; }
.mu-import {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: #fff;
  border: 1px solid rgba(30, 215, 96, 0.45);
  background: linear-gradient(180deg, rgba(30, 215, 96, 0.20), rgba(30, 215, 96, 0.07));
  transition: border-color 0.14s, background 0.14s;
}
.mu-import:hover { border-color: #1ed760; background: rgba(30, 215, 96, 0.24); }
.mu-import-alt {
  border-color: var(--m-line); background: var(--m-card); color: var(--m-dim);
}
.mu-import-alt:hover { border-color: rgba(180, 124, 255, 0.55); background: rgba(160, 107, 255, 0.14); color: var(--m-ink); }
.mu-spbox { display: flex; gap: 10px; width: 100%; margin-top: 4px; }
.mu-spbox.hidden { display: none; }
.mu-sparea { min-height: 84px; resize: vertical; padding: 13px 16px; line-height: 1.5; font-size: 13.5px; border-radius: 14px; }

.mu-libbar { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.mu-libsearch { flex: 1; min-width: 180px; height: 46px; border-radius: 14px; background: var(--m-card); border-color: var(--m-line); }
.mu-newpl { flex-shrink: 0; height: 46px; }

/* Aba «Sets do DJ» — lista vertical: a vibe é uma frase e tem de se ler toda. */
.mu-djsets-top { padding: 0 0 18px; }
.mu-djsets-top h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.mu-djsets-top p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--m-dim); max-width: 62ch; }
.mu-djset {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 10px;
  border: 1px solid var(--m-line); border-radius: 16px; background: var(--m-card);
  transition: border-color 0.14s, background 0.14s;
}
.mu-djset:hover { border-color: var(--m-line-2); background: var(--m-card-2); }
.mu-djset.mu-djset-on { border-color: rgba(180, 124, 255, 0.6); background: rgba(160, 107, 255, 0.14); }
.mu-djset-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: none; border: none; cursor: pointer; font: inherit; color: inherit; padding: 0;
}
.mu-djset-vibe { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-djset-meta { font-size: 12px; color: var(--m-dim-2); }
.mu-djset.mu-djset-on .mu-djset-meta { color: var(--m-a); }
.mu-djset-act { font-size: 14px; }

/* ===== 6. LISTAS DE FAIXAS ================================================ */
.mu-listhead {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px; font-size: 14px; color: var(--m-dim);
}
.mu-listhead > span { flex: 1; min-width: 160px; line-height: 1.5; }
.mu-back {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--m-line); background: var(--m-card); color: var(--m-ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.mu-back:hover { background: var(--m-card-2); }
.mu-playall {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: #fff;
  background: var(--m-grad); padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(160, 107, 255, 0.4); flex-shrink: 0;
  transition: transform 0.12s, box-shadow 0.12s;
}
.mu-playall:hover { box-shadow: 0 10px 26px rgba(160, 107, 255, 0.55); }
.mu-playall:active { transform: scale(0.97); }
.mu-playall.mu-shufall { background: var(--m-card); color: var(--m-ink); border: 1px solid var(--m-line); box-shadow: none; }
.mu-playall.mu-shufall:hover { background: var(--m-card-2); border-color: var(--m-line-2); }

.mu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 14px; cursor: pointer;
  transition: background 0.12s;
}
.mu-item:hover { background: var(--m-card); }
.mu-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: #1a1030; }
.mu-item-meta { flex: 1; min-width: 0; }
.mu-item-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-item-artist { font-size: 13px; color: var(--m-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-item-dur { font-size: 12px; color: var(--m-dim-2); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mu-item-q {
  background: none; border: none; color: var(--m-dim); width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 16px; flex-shrink: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.mu-item-q:hover { color: var(--m-ink); background: var(--m-card-2); }
.mu-item-q.on { color: #ff6ba9; }
/* Puxador de reordenar: touch-action:none senão o scroll do iPhone rouba o gesto. */
.mu-item-q.mu-grip { cursor: grab; touch-action: none; }
.mu-item-q.mu-grip:active { cursor: grabbing; }
.mu-item.mu-dragging { opacity: 0.8; background: rgba(160, 107, 255, 0.16); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.mu-item.mu-drop-above { box-shadow: inset 0 3px 0 0 var(--m-a); }
.mu-item.mu-drop-below { box-shadow: inset 0 -3px 0 0 var(--m-a); }
.mu-item[draggable="true"] { cursor: grab; }
.mu-item[draggable="true"]:active { cursor: grabbing; }
/* Faixa ainda sem áudio encontrado: aparece na mesma (sei o nome e o artista),
   apagada, e resolve-se ao toque. Escondê-la fazia a playlist parecer incompleta. */
.mu-item-todo { opacity: 0.55; }
.mu-item-agora { opacity: 0.85; }
.mu-item-agora .mu-item-dur { animation: muPulsa 1s ease-in-out infinite; }
@keyframes muPulsa { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
/* Faixa a tocar: equalizador animado + destaque violeta. */
.mu-eq { display: none; width: 16px; height: 16px; align-items: flex-end; gap: 2px; flex-shrink: 0; margin-right: -2px; }
.mu-eq i { width: 3px; background: var(--m-a); border-radius: 2px; animation: muEq 0.9s ease-in-out infinite; }
.mu-eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.mu-eq i:nth-child(2) { height: 90%; animation-delay: 0.2s; }
.mu-eq i:nth-child(3) { height: 60%; animation-delay: 0.4s; }
@keyframes muEq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
.mu-item-playing { background: rgba(160, 107, 255, 0.12); }
.mu-item-playing .mu-eq { display: flex; }
.mu-item-playing .mu-item-title { color: var(--m-a); font-weight: 700; }
/* Selo EXPLÍCITO «E» (como no Spotify) */
.mu-e {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-right: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.55); color: #14082a;
  font-size: 9px; font-weight: 800; line-height: 1; vertical-align: middle; flex-shrink: 0;
}

/* ===== 7. BARRA DE REPRODUÇÃO ============================================= */
/* Ecrã largo: barra de três zonas colada em baixo.
   Telemóvel: pastilha flutuante por cima do dock (secção 10). */
.mu-bar {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 10px 18px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--m-line);
  background: rgba(10, 5, 20, 0.86);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.mu-bar.hidden { display: none; }
.mu-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mu-art { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); flex-shrink: 0; background: #1a1030; }
.mu-meta { min-width: 0; }
.mu-np { cursor: pointer; }
.mu-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-artist { font-size: 12.5px; color: var(--m-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-bar-center { display: flex; flex-direction: column; align-items: center; gap: 8px; width: clamp(320px, 40vw, 620px); }
.mu-ctrls { display: flex; align-items: center; gap: 12px; justify-content: center; }
.mu-bar-center .mu-prog { width: 100%; }
.mu-bar-right { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.mu-vol {
  width: 92px; height: 4px; -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, 0.2); border-radius: 4px; cursor: pointer;
}
.mu-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; }
.mu-vol::-moz-range-thumb { width: 13px; height: 13px; border: none; border-radius: 50%; background: #fff; }

.mu-icon {
  background: none; border: none; color: var(--m-ink); font-size: 17px; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; opacity: 0.85; padding: 0; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: opacity 0.12s, background 0.12s, color 0.12s, transform 0.12s;
}
.mu-icon svg, .mu-item-q svg, .mu-back svg, .mu-side-new svg, .mu-rel-add svg, .mu-playall svg, .mu-volic svg { display: block; }
.mu-icon:hover { opacity: 1; background: var(--m-card-2); }
.mu-icon:active { transform: scale(0.92); }
.mu-icon.on { color: var(--m-a); opacity: 1; }
.mu-tog { font-size: 15px; opacity: 0.5; }
.mu-tog.on { opacity: 1; color: var(--m-a); background: rgba(160, 107, 255, 0.16); }
.mu-play, #muToggle {
  background: var(--m-grad); color: #fff; width: 46px; height: 46px; font-size: 17px;
  box-shadow: 0 8px 20px rgba(160, 107, 255, 0.45); opacity: 1;
}
#muToggle:hover { background: linear-gradient(135deg, #b184ff, #ef7ce5); }
#muLike.on, #muNowLike.on { color: #ff6ba9; opacity: 1; }

.mu-prog { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--m-dim-2); font-variant-numeric: tabular-nums; }
.mu-track { flex: 1; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.16); cursor: pointer; position: relative; }
.mu-fill { height: 100%; width: 0; background: var(--m-grad); border-radius: 5px; position: relative; }
.mu-fill::after {
  content: ""; position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.14s;
}
.mu-track:hover .mu-fill::after { opacity: 1; }

/* ===== 8. ECRÃ «A TOCAR» ================================================== */
.mu-now {
  /* z-index alto de propósito: no telemóvel a pastilha de reprodução e o dock são
     position:fixed — com um z-index baixo apareciam POR CIMA do ecrã "A tocar". */
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column;
  overflow: hidden; animation: muNowUp 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  /* Base OPACA: sem capa (ou enquanto ela carrega) via-se a lista por trás e o
     ecrã parecia meio transparente. O véu da capa entra por cima disto. */
  background: linear-gradient(180deg, #150c28 0%, #0c0718 55%, #07040e 100%);
}
.mu-now.hidden { display: none; }
@keyframes muNowUp { from { transform: translateY(7%); opacity: 0; } to { transform: none; opacity: 1; } }
.mu-now-bg {
  position: absolute; inset: -12%; background-size: cover; background-position: center;
  filter: blur(80px) saturate(1.5) brightness(0.55); transform: scale(1.15);
}
.mu-now-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 6, 24, 0.42), rgba(7, 4, 14, 0.9)); }
.mu-now-inner {
  position: relative; z-index: 1; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: calc(58px + var(--safe-top)) 24px calc(28px + var(--safe-bottom));
}
.mu-now-down {
  position: absolute; top: calc(14px + var(--safe-top)); left: 18px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--m-line);
  background: rgba(255, 255, 255, 0.08); color: var(--m-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mu-now-down:hover { background: rgba(255, 255, 255, 0.16); }
.mu-now-art {
  /* flex-shrink:0 é obrigatório: o .mu-now-inner é uma coluna que rola e, sem
     isto, a capa era esmagada na vertical (ficava um retângulo 16:9 em vez do
     quadrado) sempre que a fila/relacionadas faziam o conteúdo transbordar. */
  flex-shrink: 0;
  width: min(52vh, 78vw, 400px); height: min(52vh, 78vw, 400px);
  border-radius: 26px; object-fit: cover; margin-top: 4px; background: #1a1030;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.mu-now-info, .mu-now-prog, .mu-now-ctrls, .mu-now-sec { flex-shrink: 0; }
.mu-now-info { text-align: center; width: 100%; max-width: 460px; }
.mu-now-title { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin-bottom: 6px; }
.mu-now-artist { font-size: 16px; color: var(--m-dim); }
.mu-now-prog { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 460px; font-size: 12px; color: var(--m-dim-2); font-variant-numeric: tabular-nums; }
.mu-now-prog .mu-track { height: 6px; }
.mu-now-prog .mu-fill::after { opacity: 1; }
.mu-now-ctrls { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 400px; }
.mu-now-ctrls .mu-icon { width: 52px; height: 52px; font-size: 22px; }
.mu-now-ctrls #muNowToggle {
  width: 70px; height: 70px; font-size: 26px;
  background: var(--m-grad); color: #fff; box-shadow: 0 14px 34px rgba(160, 107, 255, 0.5);
}
/* Segunda fila: gosto, letra, adicionar, volume — no telemóvel é aqui que
   vivem, porque a barra de baixo (que os tinha) é uma pastilha compacta. */
.mu-now-sec { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 460px; flex-wrap: wrap; }
.mu-now-sec .mu-icon { width: 44px; height: 44px; font-size: 18px; border: 1px solid var(--m-line); background: rgba(255, 255, 255, 0.05); }
.mu-now-volwrap { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 44px; border-radius: 999px; border: 1px solid var(--m-line); background: rgba(255, 255, 255, 0.05); }
.mu-now-volwrap .mu-vol { width: 90px; }
.mu-volic { display: inline-flex; color: var(--m-dim); }
.mu-now-queue { width: 100%; max-width: 460px; margin-top: 4px; }
.mu-now-qh { font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--m-dim-2); margin-bottom: 10px; }
.mu-now-qrow {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px; border: none; background: none; cursor: pointer; border-radius: 12px;
  color: var(--m-ink); text-align: left;
}
.mu-now-qrow:hover { background: rgba(255, 255, 255, 0.07); }
.mu-now-qrow img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #1a1030; }
.mu-now-qmeta { flex: 1; min-width: 0; }
.mu-now-qt { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-now-qa { font-size: 12px; color: var(--m-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-rel-add {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--m-line); background: rgba(255, 255, 255, 0.05);
  color: var(--m-dim); cursor: pointer; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.mu-rel-add:hover { border-color: rgba(180, 124, 255, 0.55); color: var(--m-a); }

/* ===== 9. LETRAS, ESTATÍSTICAS, MENUS E DIÁLOGOS ========================== */
.mu-lyrics {
  position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 8, 28, 0.98), rgba(7, 4, 14, 0.99));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease-out;
}
.mu-lyrics.hidden { display: none; }
.mu-lyrics-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-top)) 18px 14px; border-bottom: 1px solid var(--m-line); flex-shrink: 0;
}
.mu-lyrics-title { display: flex; flex-direction: column; min-width: 0; }
.mu-lyrics-title > span:first-child { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-lyrics-artist { font-size: 13px; color: var(--m-dim); }
.mu-lyrics-ctrls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mu-lyrics-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 32vh 24px 44vh; text-align: center; scroll-behavior: smooth; }
.mu-lyrics-line {
  font-size: 23px; line-height: 1.5; font-weight: 600; padding: 7px 0;
  color: var(--m-dim); opacity: 0.42; cursor: pointer;
  transition: color 0.25s, opacity 0.25s, transform 0.25s;
}
.mu-lyrics-line.static { cursor: default; font-size: 18px; opacity: 0.8; }
.mu-lyrics-line.on { color: #fff; opacity: 1; transform: scale(1.06); text-shadow: 0 0 26px rgba(180, 124, 255, 0.6); }
.mu-lyrics-msg { color: var(--m-dim); text-align: center; padding: 12vh 0; font-size: 15px; }

.mu-stats-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.mu-stats-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; flex: 1; min-width: 140px; }
.mu-stats-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mu-tab {
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  border: 1px solid var(--m-line); background: var(--m-card); color: var(--m-dim);
}
.mu-tab:hover { color: var(--m-ink); background: var(--m-card-2); }
.mu-tab.on { color: #fff; background: var(--m-grad); border-color: transparent; }
.mu-stats-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.mu-stats-big > div { background: var(--m-card); border: 1px solid var(--m-line); border-radius: var(--m-r); padding: 20px 14px; text-align: center; }
.mu-stats-big b { display: block; font-size: 28px; font-weight: 800; color: #fff; }
.mu-stats-big span { font-size: 11.5px; color: var(--m-dim-2); text-transform: uppercase; letter-spacing: 1px; }
.mu-stats-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mu-stats-col h4 { font-size: 13px; letter-spacing: 1.4px; color: var(--m-dim-2); text-transform: uppercase; margin-bottom: 12px; }
.mu-stats-col ol { list-style: none; counter-reset: r; }
.mu-stats-col li { counter-increment: r; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--m-line); }
.mu-stats-col li::before { content: counter(r); font-size: 13px; font-weight: 700; color: var(--m-a); width: 20px; flex-shrink: 0; }
.mu-stats-col li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mu-stats-col li em { font-size: 12px; color: var(--m-dim-2); font-style: normal; flex-shrink: 0; }

.mu-menu {
  position: fixed; z-index: 90; width: 244px; max-height: 60vh; overflow-y: auto;
  background: rgba(18, 10, 32, 0.94); border: 1px solid var(--m-line-2); border-radius: 16px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.65); padding: 6px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); animation: fadeIn 0.12s ease-out;
}
.mu-menu-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--m-ink); font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mu-menu-item:hover { background: rgba(255, 255, 255, 0.09); }
.mu-menu-sep { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--m-dim-2); padding: 9px 12px 4px; }

.mu-toast {
  position: absolute; left: 50%; bottom: calc(var(--m-dock) + 108px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 40; max-width: 84%; padding: 13px 20px; border-radius: 14px;
  background: rgba(22, 12, 38, 0.97); border: 1px solid var(--m-line-2); color: var(--m-ink);
  font-size: 14px; line-height: 1.45; box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; text-align: center;
}
.mu-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* Rodapé do mapeamento de músicas (só quando há trabalho a decorrer) */
.mu-mapa {
  position: absolute; left: 50%; bottom: calc(var(--m-dock) + 96px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 40; max-width: min(560px, 92%); text-align: center;
  padding: 8px 15px; border-radius: 999px; font-size: 12px; color: var(--m-dim);
  background: rgba(18, 10, 32, 0.85); border: 1px solid var(--m-line);
  backdrop-filter: blur(10px); pointer-events: none;
}
/* Caixa de texto própria (o window.prompt está morto no WKWebView) */
.mu-prompt { position: fixed; inset: 0; z-index: 130; display: flex; align-items: center; justify-content: center; background: rgba(7, 4, 14, 0.72); backdrop-filter: blur(8px); animation: fadeIn 0.15s; }
.mu-prompt-box { width: min(420px, 88vw); background: rgba(20, 11, 36, 0.96); border: 1px solid var(--m-line-2); border-radius: 22px; padding: 24px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65); }
.mu-prompt-msg { font-size: 15px; line-height: 1.5; margin-bottom: 16px; color: var(--m-ink); }
.mu-prompt-in { width: 100%; height: 48px; border-radius: 13px; border: 1px solid var(--m-line-2); background: rgba(0, 0, 0, 0.3); color: var(--m-ink); font: inherit; font-size: 15px; padding: 0 16px; outline: none; }
.mu-prompt-in:focus { border-color: rgba(180, 124, 255, 0.7); }
.mu-prompt-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.mu-prompt-btns button { height: 44px; padding: 0 20px; border-radius: 13px; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--m-line); background: var(--m-card); color: var(--m-ink); }
.mu-prompt-btns button:hover { background: var(--m-card-2); }
.mu-prompt-ok { background: var(--m-grad) !important; color: #fff !important; border: none !important; }

/* ===== 10. TELEMÓVEL — dock em baixo + pastilha de reprodução ============= */
/* Era aqui que a app se desfazia no .ipa: a barra de baixo tinha regras de
   grelha em conflito (colunas de um lado, áreas do outro), metade dos botões
   escondia-se e as abas eram texto minúsculo a rolar. Passa a ser o que se
   espera de uma app de música no telefone: dock com ícones + mini-leitor. */
@media (max-width: 900px) {
  .music-app { --m-pad: 18px; --m-dock: 70px; }
  /* Véu por baixo do rodapé: o conteúdo a rolar deixa de "bater" na pastilha e no
     dock. Sem isto os dois pareciam encavalitados um no outro. */
  .mu-body::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 29; pointer-events: none;
    height: calc(var(--m-dock) + var(--safe-bottom) + 96px);
    background: linear-gradient(180deg, transparent, rgba(7, 4, 14, 0.55) 38%, rgba(7, 4, 14, 0.92) 72%);
  }
  .mu-head { padding-top: calc(12px + var(--safe-top)); padding-bottom: 12px; gap: 12px; }
  .mu-hi-2 { font-size: 22px; }
  .mu-side { display: none; }

  /* O cartão do DJ ocupava meio ecrã: as seis vibes empilhavam-se em cinco
     linhas. Passam a deslizar na horizontal, como as prateleiras. */
  .mu-dj { padding: 22px 0 20px; border-radius: 22px; }
  .mu-dj-title, .mu-dj-sub, .mu-dj-row { padding: 0 20px; }
  .mu-dj-title { font-size: 21px; }
  .mu-dj-sub { margin-bottom: 16px; }
  .mu-dj-row { flex-direction: column; }
  .mu-dj .mu-vibe, .mu-dj .mu-dj-go { width: 100%; min-width: 0; }
  .mu-chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding: 0 20px; margin-top: 14px; scroll-padding-left: 20px;
  }
  .mu-chips::-webkit-scrollbar { display: none; }
  .mu-chip { flex-shrink: 0; }

  /* espaço no fim do conteúdo para o dock + a pastilha não taparem a última linha */
  .mu-home, .mu-results, .mu-stats { padding-bottom: calc(var(--m-dock) + 116px + var(--safe-bottom)); }

  /* NAV → dock fixo em baixo, com ícone por cima do rótulo */
  .mu-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; gap: 0; justify-content: space-around; align-items: stretch;
    padding: 8px 6px calc(8px + var(--safe-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(10, 5, 20, 0.96);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    overflow: visible;
  }
  .mu-navb {
    flex: 1; min-width: 0; flex-direction: column; gap: 4px; justify-content: center;
    background: none; border: none; border-radius: 14px; padding: 6px 2px;
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.1px; color: var(--m-dim-2);
    box-shadow: none;
  }
  .mu-navb-ic svg { width: 21px; height: 21px; }
  .mu-navb:hover { background: none; color: var(--m-dim); }
  .mu-navb.on { background: none; color: var(--m-a); box-shadow: none; }
  .mu-navb.on .mu-navb-ic { filter: drop-shadow(0 0 10px rgba(180, 124, 255, 0.65)); }

  /* BARRA → pastilha flutuante por cima do dock */
  .mu-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(var(--m-dock) + var(--safe-bottom) + 14px);
    z-index: 31; display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 12px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(38, 21, 66, 0.94);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 6px rgba(7, 4, 14, 0.35);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  }
  .mu-bar-left { flex: 1; min-width: 0; gap: 10px; }
  .mu-art { width: 42px; height: 42px; border-radius: 10px; }
  .mu-title { font-size: 13.5px; }
  .mu-artist { font-size: 11.5px; }
  #muAdd { display: none; }                 /* vive no ⋯ da lista e no ecrã «A tocar» */
  .mu-bar-left #muLike { width: 36px; height: 36px; }
  .mu-bar-center { flex-direction: row; width: auto; gap: 0; flex-shrink: 0; }
  .mu-bar-center .mu-ctrls { gap: 2px; }
  /* na pastilha só há ▶/⏸ e ⏭ — o resto está no ecrã «A tocar», a um toque */
  #muShuffle, #muRepeat, #muPrev { display: none; }
  .mu-play, #muToggle { width: 42px; height: 42px; font-size: 16px; }
  .mu-bar-right { display: none; }
  /* barra de tempo: fio fino colado ao fundo da pastilha (sem números) */
  .mu-bar-center .mu-prog {
    position: absolute; left: 12px; right: 12px; bottom: 5px; width: auto;
    display: flex; gap: 0; pointer-events: auto;
  }
  .mu-bar-center .mu-prog > span { display: none; }
  .mu-bar-center .mu-track { height: 3.5px; border-radius: 3px; }
  .mu-bar-center .mu-fill::after { display: none; }
  /* sem faixa carregada não há pastilha → o dock volta a ser o único rodapé */
  .mu-bar.hidden { display: none; }

  .mu-now-inner { padding-left: 18px; padding-right: 18px; }
  .mu-now-title { font-size: 23px; }
  .mu-now-ctrls { gap: 8px; }
  .mu-now-ctrls .mu-icon { width: 48px; height: 48px; }
  .mu-now-ctrls #muNowToggle { width: 66px; height: 66px; }
  .mu-stats-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--m-pad)); padding: 2px var(--m-pad); }
  .mu-stats-tabs::-webkit-scrollbar { display: none; }
  .mu-tab { flex-shrink: 0; }
  .mu-stats-head { gap: 10px; }
  .mu-stats-title { font-size: 20px; }
  .mu-stats-big { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mu-stats-big > div:last-child { grid-column: 1 / -1; }   /* sem meia-medida órfã */
  .mu-stats-big > div { padding: 14px 10px; }
  .mu-stats-big b { font-size: 21px; }
  .mu-stats-cols { grid-template-columns: 1fr; gap: 20px; }
  .mu-spbox { flex-direction: column; }
  .mu-import { flex: 1; min-width: 46%; justify-content: center; }
}

@media (max-width: 560px) {
  .music-app { --m-pad: 16px; }
  .mu-card { width: 138px; }
  .mu-card img, .mu-tile, .mu-skel::before { height: 138px; }
  .mu-card::after { top: 92px; }
  .mu-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 14px; }
  .mu-item { gap: 10px; padding: 8px 6px; }
  .mu-item img { width: 46px; height: 46px; }
  .mu-item-dur { display: none; }           /* a duração não vale o espaço no telemóvel */
  .mu-lyrics-line { font-size: 19px; }
  .mu-import { font-size: 12.5px; padding: 10px 12px; }
}

/* Ecrã de toque: alvos maiores, sem depender de hover. */
@media (pointer: coarse) {
  .mu-item-q { min-width: 36px; min-height: 36px; }
  .mu-card::after { display: none; }        /* o ▶ de hover não faz sentido ao dedo */
  .mu-side-pin { opacity: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .music-app, .mu-now, .mu-menu, .mu-prompt { animation: none; }
  .mu-eq i, .mu-skel::before, .mu-item-agora .mu-item-dur { animation: none; }
  .mu-card:hover img, .mu-card:hover .mu-tile { transform: none; }
}

/* ---------- Cartão "Wrapped" das estatísticas (31 jul 2026) ----------
   Um cartão com vida — gradiente da casa, minutos em grande, top 5 — em vez das
   três caixas cinzentas. Os totais medidos continuam nas listas por baixo. */
.mu-wrap-card {
  position: relative; overflow: hidden;
  border-radius: calc(var(--m-r) + 6px);
  padding: 26px 26px 18px;
  margin-bottom: 26px;
  background:
    radial-gradient(120% 140% at 8% 0%, rgba(160, 107, 255, 0.55), transparent 55%),
    radial-gradient(120% 150% at 100% 12%, rgba(227, 100, 216, 0.45), transparent 60%),
    radial-gradient(140% 160% at 60% 115%, rgba(84, 220, 255, 0.35), transparent 55%),
    #17102e;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 50px rgba(90, 40, 180, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.mu-wrap-top { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.mu-wrap-art {
  width: 108px; height: 108px; object-fit: cover; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.mu-wrap-min b {
  display: block; font-size: clamp(40px, 7vw, 64px); line-height: 1; font-weight: 800;
  letter-spacing: -1.5px; color: #fff; text-shadow: 0 2px 18px rgba(160, 107, 255, 0.5);
}
.mu-wrap-min span {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, 0.8);
}
.mu-wrap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 26px; }
.mu-wrap-cols h5 {
  margin: 0 0 8px; font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.mu-wrap-cols ol { list-style: none; margin: 0; padding: 0; }
.mu-wrap-cols li {
  display: flex; align-items: baseline; gap: 10px; padding: 3.5px 0;
  font-size: 14.5px; font-weight: 600; color: #fff;
}
.mu-wrap-cols li i { font-style: normal; font-weight: 800; color: rgba(255, 255, 255, 0.55); min-width: 14px; }
.mu-wrap-cols li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-wrap-cols li em { font-style: normal; font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.mu-wrap-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12.5px; color: rgba(255, 255, 255, 0.85);
}
.mu-wrap-logo { margin-left: auto; font-size: 11px; letter-spacing: 2.5px; color: rgba(255, 255, 255, 0.6); }
@media (max-width: 640px) {
  .mu-wrap-cols { grid-template-columns: 1fr; }
  .mu-wrap-top { gap: 14px; }
  .mu-wrap-art { width: 76px; height: 76px; }
}
