/* ============================================================
   Dynamic Lyrics — UI premium, dark-first.
   ============================================================ */
:root {
  --bg: #0b0b14;
  --bg-soft: #14141f;
  --panel: rgba(22, 22, 34, 0.72);
  --panel-solid: #161622;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f3f8;
  --muted: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #ff5c9d;
  --glow: 124, 92, 255;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* El atributo [hidden] SIEMPRE gana, aunque la clase fije display:flex/grid.
   (Sin esto, .player y .transport se asomarían vacíos al estar ocultos.) */
[hidden] { display: none !important; }
/* #appRoot envuelve la app por el login, pero NO debe afectar el layout:
   display:contents hace que header/main/footer sean hijos directos del body
   (flex column), restaurando que .layout llene la pantalla con flex:1. */
#appRoot { display: contents; }
html, body { height: 100%; }

/* Foco visible accesible (WCAG 2.4.7) — teclado sí, ratón no. */
:where(button, a, input, select, summary, [tabindex], .track):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Enlace "saltar al reproductor" (visible solo al tabular). */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 90;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; transform: translateY(-180%); transition: transform .2s;
}
.skip-link:focus { transform: translateY(0); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Fondo difuminado con portada del tema activo */
.backdrop {
  position: fixed; inset: -10% ;
  background-size: cover; background-position: center;
  filter: blur(60px) saturate(1.4) brightness(0.5);
  transform: scale(1.2);
  opacity: 0; transition: opacity .8s ease, background-image .4s;
  z-index: -2;
}
.backdrop.show { opacity: .9; }
body::after {
  content: ""; position: fixed; inset: 0;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(255,92,157,.16), transparent 55%),
    linear-gradient(180deg, rgba(11,11,20,.6), rgba(11,11,20,.92));
  z-index: -1;
}

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(var(--glow), .45);
}
.brand-name { font-size: 1.15rem; font-weight: 500; letter-spacing: .2px; }
.brand-name b { font-weight: 800; }

.search { flex: 1; display: flex; align-items: center; max-width: 560px; }
.search input {
  flex: 1; height: 44px; padding: 0 16px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  border-radius: 12px 0 0 12px; color: var(--text); font-size: .98rem; outline: none;
  transition: border-color .2s, background .2s;
}
.search input:focus { border-color: rgba(var(--glow), .7); background: rgba(255,255,255,.09); }
.search input::placeholder { color: var(--muted); }
.search button {
  height: 44px; width: 50px; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 12px 12px 0; background: rgba(255,255,255,.06);
  color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: background .2s;
}
.search button:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.search button:active { transform: scale(.95); }

/* Botón Spotify */
.spotify-btn {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(29, 185, 84, .5); color: #1ed760;
  background: rgba(29, 185, 84, .12); font-size: .9rem; font-weight: 600;
  white-space: nowrap; transition: background .2s, border-color .2s, color .2s;
}
.spotify-btn:hover { background: rgba(29, 185, 84, .22); }
.spotify-btn.connected { background: #1db954; border-color: #1db954; color: #062b14; }
.spotify-btn.connected:hover { background: #1ed760; }
/* Versión compacta dentro de la barra de usuario */
.user-area .spotify-btn { height: 34px; padding: 0 12px; font-size: .84rem; gap: 6px; }
.tag.live { color: #1ed760; background: rgba(29, 185, 84, .16); border-color: rgba(29, 185, 84, .5); }

/* ---- Layout de 2 columnas ---- */
.layout {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px; padding: 18px;
  flex: 1; min-height: 0; overflow: hidden;
}
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(18px); overflow: hidden;
  display: flex; flex-direction: column;
}

/* ---- Resultados ---- */
.results { min-height: 0; }
.panel-head { padding: 16px 18px 8px; }
.panel-head h2 { margin: 0; font-size: .95rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.track-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.track-list::-webkit-scrollbar { width: 8px; }
.track-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.track {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px;
  border-radius: 12px; cursor: pointer; transition: background .15s;
}
.track:hover { background: rgba(255,255,255,.06); }
.track.active { background: linear-gradient(90deg, rgba(var(--glow),.22), rgba(255,92,157,.12)); }
.track img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #222; }
.track-info { min-width: 0; }
.track-title { font-weight: 600; font-size: .94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-dur { margin-left: auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.list-msg { list-style: none; padding: 24px 18px; text-align: center; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.list-msg p { margin: 0; }
.hint { padding: 18px; color: var(--text); }
.hint p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: .88rem; }
.recent { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--text); font-size: .82rem; cursor: pointer;
}
.chip:hover { border-color: rgba(var(--glow),.7); }

/* ---- Stage / reproductor ---- */
.stage { position: relative; align-items: center; justify-content: center; }
.stage-empty { text-align: center; padding: 30px; }
.stage-empty h1 { font-size: 2rem; margin: 18px 0 8px; font-weight: 800; letter-spacing: -.5px; }
.pulse {
  width: 90px; height: 90px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--glow),.5), transparent 70%);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{ transform: scale(.85); opacity:.6 } 50%{ transform: scale(1.1); opacity:1 } }

.player { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 18px 26px 16px; min-height: 0; }
.np { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.np-cover { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; box-shadow: var(--shadow); background: #222; }
.np-meta { min-width: 0; }
.np-meta h1 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta p { margin: 2px 0 8px; }
.np-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag {
  font-size: .74rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: #b9ffd0; background: rgba(60,220,130,.14); border: 1px solid rgba(60,220,130,.4);
  padding: 3px 9px; border-radius: 999px;
}
.ghost-btn {
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 5px 13px; font-size: .82rem; cursor: pointer; transition: .15s;
}
.ghost-btn:hover { border-color: rgba(var(--glow),.7); background: rgba(255,255,255,.1); }
.ghost-btn.is-fav { color: #ffd86b; border-color: rgba(255,216,107,.5); }
.ghost-btn.icon { padding: 7px; display: grid; place-items: center; }

/* ---- Letras ---- */
.lyrics {
  position: relative;  /* offsetParent de las líneas = esta caja (centrado correcto del autoscroll) */
  flex: 1; min-height: 0; overflow-y: auto; margin: 16px 0 14px; padding: 12vh 8px 22vh;
  scroll-behavior: smooth; outline: none;
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 84%, transparent);
          mask-image: linear-gradient(transparent, #000 14%, #000 84%, transparent);
}
.lyrics::-webkit-scrollbar { width: 0; }
.line {
  font-size: 1.55rem; font-weight: 800; line-height: 1.32; padding: 8px 6px; margin: 0;
  color: rgba(255, 255, 255, .26); letter-spacing: -.3px;
  transition: color .25s, transform .35s cubic-bezier(.2, .7, .2, 1), opacity .25s, filter .25s;
  transform-origin: left center; will-change: transform;
}
.lyrics.synced .line { cursor: pointer; }
.lyrics.synced .line:not(.active):hover { color: rgba(255, 255, 255, .5); }
.line.past { color: rgba(255, 255, 255, .42); }
/* Línea activa: barrido karaoke — la parte ya cantada se ilumina (var --fill, JS por frame). */
.line.active {
  transform: scale(1.07);
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    90deg,
    #ffffff calc(var(--fill, 0%) - 1.5%),
    rgba(255, 255, 255, .34) calc(var(--fill, 0%) + 3%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 18px rgba(var(--glow), .4));
}
.line.plain { font-size: 1.12rem; font-weight: 500; color: rgba(255,255,255,.82); cursor: default; }
.lyrics.plain { padding: 24px 8px; mask-image: none; -webkit-mask-image: none; }
.line.note { font-size: .95rem; color: var(--muted); font-weight: 500; }

/* ---- Barra de progreso (tu reproducción de Spotify) ---- */
.live-bar { display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 2px 4px 6px; }
.time { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.seek {
  flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2) var(--played, 0%), rgba(255,255,255,.15) var(--played, 0%));
  outline: none; cursor: pointer; transition: background .08s linear;
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(var(--glow), .4);
}
.seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }

/* Controles "Spotify en vivo" */
.live-ctl { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 8px 0 4px; }
.live-ctl button {
  display: grid; place-items: center; border: 0; cursor: pointer; color: var(--text);
  width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .07);
  transition: background .15s, transform .1s;
}
.live-ctl button:hover { background: rgba(255, 255, 255, .14); }
.live-ctl button:active { transform: scale(.92); }
.live-ctl .live-play {
  width: 60px; height: 60px; color: #062b14;
  background: linear-gradient(135deg, #1ed760, #1db954);
  box-shadow: 0 10px 26px rgba(29, 185, 84, .45);
}
.live-ctl .live-play:hover { background: linear-gradient(135deg, #25e368, #1db954); }

/* Botón "Conectar Spotify" en el estado vacío */
.stage-connect {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 1rem; font-weight: 700; color: #062b14;
  background: linear-gradient(135deg, #1ed760, #1db954);
  box-shadow: 0 12px 30px rgba(29, 185, 84, .45); transition: transform .12s, filter .15s;
}
.stage-connect:hover { filter: brightness(1.06); }
.stage-connect:active { transform: scale(.96); }

/* Pulso de atención del botón Spotify de la barra */
@keyframes flashPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); } 50% { box-shadow: 0 0 0 6px rgba(29, 185, 84, .55); } }
.spotify-btn.flash { animation: flashPulse .7s ease 2; }

/* ============================================================
   Modo pantalla completa de la letra (para el coche / montado)
   ============================================================ */
.focus-exit {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 100;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 1.15rem; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(10px);
}
.focus-exit[hidden] { display: none; }
body.lyrics-focus { overflow: hidden; }
body.lyrics-focus .topbar,
body.lyrics-focus .results,
body.lyrics-focus .legal,
body.lyrics-focus .skip-link,
body.lyrics-focus .np-tags .ghost-btn { display: none !important; }
body.lyrics-focus .layout { padding: 0; gap: 0; grid-template-columns: 1fr; }
body.lyrics-focus .stage { height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
body.lyrics-focus .player { padding: max(16px, env(safe-area-inset-top)) 22px 16px; }
body.lyrics-focus .np-cover { width: 52px; height: 52px; }
body.lyrics-focus .np-meta h1 { font-size: 1.1rem; }
body.lyrics-focus .np-meta p { font-size: .82rem; }
body.lyrics-focus .lyrics { padding: 30vh 16px; }
body.lyrics-focus .lyrics .line { font-size: clamp(1.9rem, 6.2vw, 3rem); padding: 12px 4px; }

/* ---- Compartir letra por QR ---- */
.qr-wrap { display: grid; place-items: center; margin: 16px 0 6px; }
.qr-wrap img { width: 220px; height: 220px; max-width: 70vw; border-radius: 14px; background: #fff; padding: 8px; }
.share-code { text-align: center; font-size: .95rem; margin: 6px 0 14px; color: var(--muted); }
.share-code b { color: var(--text); letter-spacing: 3px; font-size: 1.2rem; font-family: ui-monospace, monospace; }
.share-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.share-followers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; font-size: .9rem; color: var(--text); }
.follow-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; width: 100%; }
.follow-list li { background: rgba(29, 185, 84, .14); border: 1px solid rgba(29, 185, 84, .3); border-radius: 8px; padding: 3px 9px; font-size: .8rem; }
.ghost-btn.is-stop { color: #ffb4c0; border-color: rgba(255, 80, 110, .35); }
#shareBtn.sharing { color: #1ed760; border-color: rgba(29, 185, 84, .5); background: rgba(29, 185, 84, .12); }

/* ---- Barra de invitado (siguiendo a alguien) ---- */
.guest-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: max(10px, env(safe-area-inset-top)); z-index: 85;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); font-size: .9rem;
}
.guest-banner[hidden] { display: none; }
.guest-dot { width: 9px; height: 9px; border-radius: 50%; background: #1ed760; box-shadow: 0 0 10px #1ed760; flex-shrink: 0; }
.guest-banner #guestText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-banner .ghost-btn { padding: 6px 12px; flex-shrink: 0; }

/* ---- Footer legal + crédito ---- */
.legal {
  flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 6px 18px;
  padding: 9px 22px; padding-bottom: max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); backdrop-filter: blur(14px);
  font-size: .78rem; color: var(--muted);
}
.legal a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, .25);
}
.legal a:hover { color: var(--text); }
.legal .sep { opacity: .35; margin: 0 2px; }
.legal-sources { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--muted); border-bottom: 1px dotted rgba(255, 255, 255, .25);
}
.link-btn:hover { color: var(--text); }

/* Wordmark SP.Digital */
.spd {
  border: 0 !important; font-weight: 800; letter-spacing: -.3px; font-size: .86rem;
  transition: filter .15s;
}
.spd:hover { filter: brightness(1.18); }
.spd-a { color: #aebfd9; }
.spd-b { color: #4f9dff; }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 60; padding: 20px;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px);
  animation: fade .2s ease;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 100%; max-width: 560px; max-height: 85vh; overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); padding: 26px 28px;
}
.modal-card h2 { margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; }
.modal-card p { color: var(--muted); font-size: .9rem; line-height: 1.65; margin: 0 0 12px; }
.modal-card a { color: #8ea9ff; }
.modal-close { margin-top: 6px; }

/* ---- Loader overlay premium ---- */
.loader-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(8, 8, 16, .72); backdrop-filter: blur(12px) saturate(1.2);
  animation: fade .25s ease;
}
.loader-overlay[hidden] { display: none; }
.loader-box { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.loader-mark {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 36px rgba(var(--glow), .55);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.eq { display: flex; align-items: flex-end; gap: 6px; height: 40px; }
.eq span {
  width: 7px; height: 100%; border-radius: 6px; transform-origin: bottom;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  animation: eq 0.9s ease-in-out infinite;
}
.eq span:nth-child(1) { animation-delay: -.9s; }
.eq span:nth-child(2) { animation-delay: -.7s; }
.eq span:nth-child(3) { animation-delay: -.5s; }
.eq span:nth-child(4) { animation-delay: -.2s; }
.eq span:nth-child(5) { animation-delay: -.6s; }
.eq span:nth-child(6) { animation-delay: -.35s; }
.eq span:nth-child(7) { animation-delay: -.8s; }
@keyframes eq { 0%, 100% { transform: scaleY(.28); } 50% { transform: scaleY(1); } }
.loader-msg { margin: 0; color: var(--text); font-weight: 600; letter-spacing: .3px; font-size: 1rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--panel-solid); border: 1px solid var(--line); color: var(--text);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50;
  font-size: .9rem; max-width: 90vw; text-align: center;
}

/* ---- Loader ---- */
.loader { display: grid; place-items: center; padding: 40px; color: var(--muted); gap: 14px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Pantalla de acceso ---- */
.auth-screen {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 24px;
}
.auth-screen[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 400px; padding: 30px 26px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-brand .brand-name { font-size: 1.4rem; font-weight: 800; }
.auth-tag { text-align: center; color: var(--muted); font-size: .9rem; margin: 12px 0 20px; }
.auth-tabs { display: flex; gap: 4px; background: rgba(255,255,255,.05); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 9px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-radius: 9px; cursor: pointer; transition: .15s; }
.auth-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=text] {
  height: 46px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--text); font-size: .95rem; outline: none;
}
.auth-form input:focus { border-color: rgba(var(--glow), .7); background: rgba(255,255,255,.09); }
.auth-remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; cursor: pointer; }
.auth-remember input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-submit {
  height: 48px; margin-top: 4px; border: 0; border-radius: 12px; cursor: pointer;
  color: #fff; font-weight: 700; font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(var(--glow), .45); transition: transform .12s;
}
.auth-submit:active { transform: scale(.97); }
.auth-setup { font-size: .82rem; color: var(--muted); }
.auth-setup summary { cursor: pointer; padding: 4px 0; }
.auth-setup input { margin-top: 8px; width: 100%; }
.auth-msg { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: .86rem; text-align: center; }
.auth-msg.err { color: #ffb4c0; background: rgba(255,80,110,.12); border: 1px solid rgba(255,80,110,.35); }
.auth-msg.ok { color: #b9ffd0; background: rgba(60,220,130,.12); border: 1px solid rgba(60,220,130,.35); }
.auth-foot { color: var(--muted); font-size: .82rem; }
.auth-foot .spd { font-weight: 800; text-decoration: none; }

/* ---- Área de usuario (topbar) ---- */
.user-area { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-chip {
  font-size: .85rem; font-weight: 600; color: var(--text); padding: 0 4px;
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#adminLink { text-decoration: none; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  /* En móvil el contenido fluye y la página hace scroll (nada se exprime). */
  html, body { height: auto; }
  body { overflow-y: auto; min-height: 100dvh; }
  .layout {
    display: block; flex: 0 0 auto; height: auto; overflow: visible;
    padding: 14px;
  }
  .results { max-height: none; margin-bottom: 14px; }
  .results .track-list { max-height: 52vh; }
  .stage { min-height: 0; height: 80vh; height: 80dvh; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 11px 14px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  /* Barra de usuario compacta: botones solo ícono, sin nombre. */
  .user-area { order: 2; margin-left: auto; gap: 6px; }
  .user-area .btn-lbl { display: none; }
  .user-chip { display: none; }
  /* Áreas táctiles ≥44px (WCAG 2.5.5 / Apple). */
  .user-area .ghost-btn { min-height: 44px; padding: 8px 11px; display: inline-flex; align-items: center; }
  .user-area .spotify-btn { min-height: 44px; padding: 0 12px; }
  .chip { min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; }
  .mini { min-height: 40px; padding: 8px 12px; }
  .line { font-size: 1.3rem; }
  .lyrics { padding: 26vh 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .lyrics { scroll-behavior: auto; }
  .pulse, .eq span, .loader-mark, .spotify-btn.flash { animation: none; }
  .line.active { transform: none; background-image: none; color: #fff; -webkit-text-fill-color: #fff; }
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   Panel de administrador
   ============================================================ */
.admin-body { overflow-y: auto; }
.admin-main { max-width: 1100px; width: 100%; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; backdrop-filter: blur(12px); }
.stat-card.warn { border-color: rgba(255, 180, 80, .4); }
.stat-card.ok { border-color: rgba(60, 220, 130, .4); }
.stat-num { font-size: 1.9rem; font-weight: 800; }
.stat-lbl { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 14px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-card-head h2 { margin: 0; font-size: 1.05rem; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters .chip.active { border-color: rgba(var(--glow), .7); background: rgba(var(--glow), .18); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mini { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font-size: .78rem; cursor: pointer; transition: .15s; }
.mini:hover { background: rgba(255, 255, 255, .12); }
.mini.ok { color: #b9ffd0; border-color: rgba(60, 220, 130, .4); }
.mini.bad { color: #ffb4c0; border-color: rgba(255, 80, 110, .35); }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.badge.ok { color: #b9ffd0; background: rgba(60, 220, 130, .14); }
.badge.warn { color: #ffd9a8; background: rgba(255, 180, 80, .14); }
.badge.bad { color: #ffb4c0; background: rgba(255, 80, 110, .14); }
.badge.admin { color: #cdbbff; background: rgba(124, 92, 255, .18); }
.evt { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--muted); }
.audit-select { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 6px 10px; outline: none; }
.audit-more { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.reg-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; cursor: pointer; white-space: nowrap; }
.reg-toggle input { accent-color: var(--accent); }
