:root {
  --accent: #ffffff;
  --accent-2: #cfcfd6;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --logo-1: #ffffff;
  --logo-2: #d8d8de;
  --logo-soft: rgba(255, 255, 255, 0.22);
  --logo-text: #0a0a0c;
  --music: #ffffff;
  --music-2: #d8d8de;
  --music-soft: rgba(255, 255, 255, 0.18);
  --music-text: #0a0a0c;
  --bg: #050507;
  --panel: rgba(23, 23, 29, 0.86);
  --panel-2: rgba(33, 33, 41, 0.9);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f5f8;
  --muted: #9d9daa;
  --faint: #6c6c78;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  --radius: 30px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  padding: 16px;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1000px 640px at 8% -12%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(820px 560px at 106% 112%, rgba(255, 255, 255, 0.05), transparent 62%),
    var(--bg);
  overflow-x: hidden;
  overflow-y: hidden;
  transition: background 0.8s ease;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.8; fill-rule: evenodd; }

/* ---------- casca arredondada do Activity ---------- */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  height: calc(100vh - 32px);
  min-height: 0;
  margin: 0 auto;
  padding: 22px 24px 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(255, 255, 255, 0.06), transparent 70%),
    linear-gradient(180deg, #0d0d15 0%, #08080d 45%, #050507 100%);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1100px 640px at 50% 0%, transparent 42%, rgba(0, 0, 0, 0.4) 100%);
}

/* Fundo animado */
.fx {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.fx span {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(85px);
  will-change: transform;
}
.fx span:nth-child(1) {
  width: 620px;
  height: 620px;
  top: -14%;
  left: -10%;
  opacity: 0.22;
  background: radial-gradient(circle, var(--logo-1), transparent 66%);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.fx span:nth-child(2) {
  width: 720px;
  height: 720px;
  right: -14%;
  bottom: -28%;
  opacity: 0.55;
  background: radial-gradient(circle, rgba(88, 112, 255, 0.36), transparent 66%);
  animation: drift-b 28s ease-in-out infinite alternate;
  animation-delay: -7s;
}
.fx span:nth-child(3) {
  width: 520px;
  height: 520px;
  top: 26%;
  left: 40%;
  opacity: 0.4;
  background: radial-gradient(circle, rgba(190, 120, 255, 0.26), transparent 66%);
  animation: drift-c 19s ease-in-out infinite alternate;
  animation-delay: -11s;
}
@keyframes drift-a {
  0% { transform: translate3d(-6%, -4%, 0) scale(1); }
  50% { transform: translate3d(9%, 10%, 0) scale(1.18); }
  100% { transform: translate3d(-2%, 15%, 0) scale(0.96); }
}
@keyframes drift-b {
  0% { transform: translate3d(4%, 6%, 0) scale(1.04); }
  50% { transform: translate3d(-10%, -7%, 0) scale(1.2); }
  100% { transform: translate3d(2%, -13%, 0) scale(0.97); }
}
@keyframes drift-c {
  0% { transform: translate3d(0, 10%, 0) scale(0.95); }
  50% { transform: translate3d(-14%, -8%, 0) scale(1.16); }
  100% { transform: translate3d(10%, -2%, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .fx span { animation: none; }
}
.topbar, .connect-gate, .layout { position: relative; z-index: 1; }

/* ---------- topo ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex: none;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-name { font-size: 21px; letter-spacing: -0.03em; color: var(--muted); }
.brand-name b { color: var(--text); }

/* Quadrado com "N": branco inicialmente e puxa a cor da capa */
.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(120% 120% at 30% 14%, rgba(255, 255, 255, 0.55), transparent 46%),
    linear-gradient(145deg, var(--logo-1), var(--logo-2));
  color: var(--logo-text);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 5px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -4px 8px rgba(0, 0, 0, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.5),
    0 0 24px var(--logo-soft);
  transform: perspective(320px) rotateX(6deg);
}

/* Símbolo grande no cartão de conexão (fundo transparente) */
.connect-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.6));
}

/* Ícone do app (logo pack), sem caixa extra em volta */
.connect-logo {
  display: block;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 23px;
  object-fit: cover;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 12px rgba(74, 222, 128, 0.75); }
.dot.off { background: #5a5a63; box-shadow: none; }

/* ---------- telas ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
  align-content: stretch;
  flex: 1;
  min-height: 0;
}
#appLayout[hidden], .connect-gate[hidden], #cover[hidden], .cover-empty[hidden], .results[hidden] {
  display: none !important;
}

.connect-gate { display: grid; place-items: center; flex: 1; min-height: 0; }
.connect-card {
  position: relative;
  width: min(100%, 450px);
  padding: 38px 34px 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(30, 30, 38, 0.86), rgba(14, 14, 19, 0.96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
}
.connect-card h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -0.035em; }
.connect-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.connect-card select { text-align: left; }
.connect-card .primary { margin-top: 12px; }

/* Seletor de canal personalizado */
.voice-picker { position: relative; text-align: left; }
.voice-trigger {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.voice-trigger:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); }
.voice-trigger:focus-visible { outline: none; border-color: var(--music); box-shadow: 0 0 0 3px var(--music-soft); }
.voice-trigger-icon { filter: grayscale(1); opacity: 0.85; font-size: 15px; }
.voice-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.voice-chevron { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform 0.2s ease; }
.voice-trigger.open .voice-chevron { transform: rotate(180deg); }
.voice-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  max-height: 250px;
  overflow: auto;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 16, 22, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.voice-menu[hidden] { display: none !important; }
.voice-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.voice-option:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.voice-option.selected { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.voice-option-icon { filter: grayscale(1); opacity: 0.8; }
.voice-option-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-option-check { opacity: 0; color: var(--text); font-size: 12px; }
.voice-option.selected .voice-option-check { opacity: 1; }
.voice-empty { padding: 12px; color: var(--faint); font-size: 13px; text-align: center; }

/* ---------- player ---------- */
.player-card {
  position: relative;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 28px;
  padding: 26px;
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(25, 25, 32, 0.94), rgba(10, 10, 14, 0.985));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.player-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 70%;
  background: radial-gradient(closest-side, var(--music-soft), transparent 70%);
  pointer-events: none;
  opacity: 0.85;
}

.cover-wrap {
  position: relative;
  align-self: start;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  z-index: 1;
}
#cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.cover-empty svg { width: 60px; height: 60px; fill: none; stroke-width: 1.3; opacity: 0.8; }

.player-body { min-width: 0; position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  margin-bottom: 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--music-soft);
  color: var(--music);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}
h1 {
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist { margin: 0 0 24px; color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.progress-row span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#pos { text-align: right; }
#dur { text-align: left; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  outline: none;
  background: linear-gradient(
    90deg,
    var(--music) 0%,
    var(--music-2) var(--fill, 0%),
    rgba(255, 255, 255, 0.12) var(--fill, 0%),
    rgba(255, 255, 255, 0.12) 100%
  );
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--music);
  box-shadow: 0 0 0 4px var(--music-soft);
  transition: transform 0.12s ease;
}
input[type="range"]:not(:disabled)::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--music);
}
input[type="range"]::-moz-range-progress { background: var(--music); }
input[type="range"]:disabled { opacity: 0.45; cursor: default; }

.controls { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease;
}
.ctrl:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.ctrl:active { transform: scale(0.96); }
.ctrl:disabled { opacity: 0.32; cursor: not-allowed; transform: none; }
.ctrl.play {
  width: 60px;
  height: 60px;
  border: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 46%),
    linear-gradient(145deg, var(--music-2), var(--music));
  color: var(--music-text);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -3px 6px rgba(0, 0, 0, 0.25),
    0 6px 0 rgba(0, 0, 0, 0.32),
    0 14px 30px var(--music-soft);
}
.ctrl.play:hover { filter: brightness(1.05); }
.ctrl.play svg { width: 27px; height: 27px; }
.ctrl.active { color: var(--music); border-color: var(--music); background: var(--music-soft); }

/* Equalizador */
.eq-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.eq-overlay[hidden] { display: none !important; }
.eq-panel {
  width: min(620px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px 24px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(255, 255, 255, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(28, 28, 36, 0.985), rgba(11, 11, 16, 0.995));
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color-scheme: dark;
}
.eq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.eq-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.eq-sub { margin: 4px 0 0; color: var(--faint); font-size: 12px; }

.eq-switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.eq-switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.eq-switch-track {
  width: 46px;
  height: 26px;
  padding: 3px;
  display: flex;
  align-items: center;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.18s ease;
}
.eq-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease;
}
.eq-switch input:checked + .eq-switch-track { background: var(--music); }
.eq-switch input:checked + .eq-switch-track .eq-switch-thumb { transform: translateX(20px); }
.eq-switch input:focus-visible + .eq-switch-track { outline: 2px solid var(--music); outline-offset: 3px; }

.eq-presets { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.eq-presets-label { color: var(--muted); font-size: 13px; }
.eq-presets select {
  height: 34px;
  min-width: 150px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.eq-presets select:focus-visible { border-color: var(--music); box-shadow: 0 0 0 3px var(--music-soft); }

.eq-chart-wrap { position: relative; padding-left: 44px; }
.eq-scale {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px 0 21px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1;
  text-align: right;
}
.eq-chart-col { min-width: 0; }
.eq-chart {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 220;
  overflow: visible;
  touch-action: none;
  user-select: none;
}
.eq-grid-line { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.eq-grid-line.zero { stroke: rgba(255, 255, 255, 0.22); }
.eq-area { fill: url(#eqFill); pointer-events: none; }
#eqFill stop { stop-color: var(--music); }
.eq-line {
  fill: none;
  stroke: var(--music);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.eq-point { cursor: grab; outline: none; }
.eq-point:active, .eq-point.dragging { cursor: grabbing; }
.eq-point .eq-hit { fill: transparent; }
.eq-point .eq-dot {
  fill: #fff;
  stroke: var(--music);
  stroke-width: 3;
  transition: stroke-width 0.12s ease;
}
.eq-point:hover .eq-dot, .eq-point.dragging .eq-dot { stroke-width: 4; }
.eq-point:focus-visible .eq-dot { stroke: #fff; stroke-width: 4; }
.eq-panel.off .eq-chart-col { opacity: 0.42; }
.eq-freqs { position: relative; height: 18px; margin-top: 5px; }
.eq-freqs span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}
.eq-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.eq-reset, .eq-close {
  height: 36px;
  padding: 0 17px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.eq-reset:hover, .eq-close:hover { background: rgba(255, 255, 255, 0.1); }
.eq-close { border-color: var(--music); background: var(--music-soft); color: var(--music); }
.eq-panel::-webkit-scrollbar { width: 9px; }
.eq-panel::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 99px; }
.eq-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}
body.eq-open { overflow: hidden; }

@media (max-width: 640px) {
  .eq-panel { padding: 17px 16px 14px; border-radius: 20px; }
  .eq-head { margin-bottom: 14px; }
  .eq-head h2 { font-size: 18px; }
  .eq-presets { flex-wrap: wrap; gap: 8px; }
  .eq-presets select { flex: 1; min-width: 0; }
  .eq-chart-wrap { padding-left: 34px; }
  .eq-scale { width: 28px; font-size: 9px; }
  .eq-freqs span { font-size: 9px; }
}

.queue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.queue-head h2 { margin: 0; font-size: 14px; letter-spacing: 0.02em; }
.pill {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
}
.queue {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  max-height: 210px;
  overflow: auto;
  align-content: start;
  grid-auto-rows: min-content;
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.05);
}
/* A fila cresce para baixo e usa o espaço livre do player. */
.player-body .queue {
  flex: 1;
  min-height: 0;
  max-height: none;
}
.queue li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 26px;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
}
.queue li.draggable { cursor: grab; }
.queue li.draggable.dragging { opacity: 0.4; }
.queue li.drag-over { background: var(--music-soft); outline: 1px dashed var(--music); outline-offset: -1px; }
.qhandle { display: flex; align-items: center; gap: 4px; cursor: grab; user-select: none; }
.qgrip { display: grid; place-items: center; color: var(--faint); }
.qgrip svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.queue li.draggable:hover .qgrip { color: var(--music); }
.queue li:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.queue li .idx { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.queue li .qtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue li .qdur { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.qdel {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  opacity: 0.55;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.qdel svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.qdel:hover { background: rgba(255, 90, 90, 0.12); color: #ffb4b4; opacity: 1; }
.qdel:disabled { opacity: 0.3; cursor: wait; }
.queue-empty { color: var(--faint); font-size: 13px; padding: 10px 0; }
.queue li.queue-empty { display: block; grid-column: 1 / -1; padding: 10px; }

/* ---------- coluna lateral ---------- */
.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  max-height: 100%;
}
.side .card { flex: none; }
.side .search-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.search-card .results {
  flex: 1;
  min-height: 0;
  max-height: none;
}
.card {
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 26, 33, 0.92), rgba(13, 13, 18, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card h2 { margin: 0 0 4px; font-size: 15px; letter-spacing: -0.01em; }
.hint { margin: 0 0 12px; color: var(--faint); font-size: 12px; line-height: 1.45; }
select, input[type="text"] {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, input[type="text"]:focus { border-color: var(--music); box-shadow: 0 0 0 3px var(--music-soft); }
select option { background: #17171c; color: var(--text); }
.primary {
  width: 100%;
  height: 44px;
  margin-top: 10px;
  border: none;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 46%),
    linear-gradient(145deg, var(--music-2), var(--music));
  color: var(--music-text);
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 8px 20px var(--music-soft);
  transition: transform 0.12s ease, filter 0.2s ease;
}
.primary:hover { filter: brightness(1.05); }
.primary:active { transform: scale(0.99); }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.secondary {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
}
.secondary:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.secondary:disabled { opacity: 0.35; cursor: not-allowed; }
.msg { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.msg:empty { min-height: 0; margin-top: 0; }
.msg.error { color: #ffb4b4; }
.msg.ok { color: #e8e8ec; }
.connected { color: #e8e8ec; }

/* ---------- busca ---------- */
.search-field { position: relative; }
.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--faint);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}
.search-field input { padding-left: 38px; padding-right: 38px; }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.search-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--text); }
.search-clear[hidden] { display: none !important; }
.results {
  display: grid;
  gap: 6px;
  max-height: 380px;
  margin-top: 12px;
  padding-right: 2px;
  overflow: auto;
  align-content: start;
  grid-auto-rows: min-content;
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.05);
}
.result {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.result:hover { background: rgba(255, 255, 255, 0.075); border-color: var(--line); transform: translateY(-1px); }
.result:active { transform: scale(0.995); }
.result.loading { opacity: 0.55; pointer-events: none; }
.result-thumb {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.result-thumb-empty {
  display: grid;
  place-items: center;
  color: var(--faint);
}
.result-thumb-empty svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.result-meta { min-width: 0; display: grid; gap: 2px; }
.result-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-sub { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--music-soft);
  color: var(--music);
}
.result-play svg { width: 14px; height: 14px; }

/* Barras de rolagem visíveis (dá para arrastar) */
.results::-webkit-scrollbar,
.queue::-webkit-scrollbar,
.voice-menu::-webkit-scrollbar {
  width: 9px;
}
.results::-webkit-scrollbar-track,
.queue::-webkit-scrollbar-track,
.voice-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
}
.results::-webkit-scrollbar-thumb,
.queue::-webkit-scrollbar-thumb,
.voice-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: padding-box;
}
.results::-webkit-scrollbar-thumb:hover,
.queue::-webkit-scrollbar-thumb:hover,
.voice-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
  background-clip: padding-box;
}
.results,
.queue {
  scrollbar-gutter: stable;
}

/* ---------- responsivo ---------- */
@media (max-width: 960px) {
  body { overflow-y: auto; }
  .app { height: auto; min-height: calc(100vh - 32px); }
  .layout { grid-template-columns: 1fr; align-content: stretch; }
  .player-card { grid-template-columns: 240px minmax(0, 1fr); align-self: stretch; }
  .side { max-height: none; }
}
@media (max-width: 640px) {
  body { padding: 8px; }
  .app { height: auto; min-height: calc(100vh - 16px); padding: 16px 14px 22px; border-radius: 24px; }
  .player-card { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .cover-wrap { width: min(100%, 260px); margin: 0 auto; }
  .player-body { text-align: center; }
  .eyebrow, .artist { text-align: center; }
  .progress-row { text-align: left; }
  .controls { justify-content: center; flex-wrap: wrap; }
  .queue-head { justify-content: center; }
  .queue li { text-align: left; }
  .side { grid-template-columns: 1fr; }
  .connect-card { padding: 30px 22px 24px; }
}
@media (max-height: 760px) and (min-width: 961px) {
  .app { padding: 16px 20px 20px; }
  .topbar { margin-bottom: 14px; }
  .player-card { grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding: 20px; }
  h1 { font-size: 27px; }
  .artist { margin-bottom: 16px; }
  .progress-row { margin-bottom: 16px; }
  .controls { margin-bottom: 18px; }
  .queue { max-height: 150px; }
  .cover-empty svg { width: 48px; height: 48px; }
}
@media (max-height: 700px) and (min-width: 700px) {
  .app { padding: 14px 18px 18px; }
  .topbar { margin-bottom: 12px; }
  .player-card { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 18px; }
  h1 { font-size: 24px; }
  .artist { margin-bottom: 14px; }
  .progress-row { margin-bottom: 14px; }
  .controls { margin-bottom: 16px; }
  .queue { max-height: 120px; }
  .cover-empty svg { width: 42px; height: 42px; }
  .side .card { padding: 16px; }
}
@media (max-height: 560px) {
  body { overflow-y: auto; }
  .app { height: auto; min-height: calc(100vh - 32px); }
}

/* ---------- modo compacto (Activity minimizada) ---------- */
@media (max-height: 380px), (max-width: 420px) {
  body { padding: 6px; overflow: hidden; background: #050507; }
  .app {
    height: calc(100vh - 12px);
    min-height: 0;
    padding: 10px 12px;
    border-radius: 20px;
    border-color: rgba(255, 255, 255, 0.08);
  }
  .app::after { display: none; }
  .fx span { filter: blur(55px); }

  .topbar { margin-bottom: 8px; gap: 8px; }
  .brand { gap: 0; }
  .brand-name { display: none; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
  .status { font-size: 0; gap: 0; }
  .status #statusText { display: none; }
  .dot { width: 7px; height: 7px; }

  .layout { display: block; flex: 1; min-height: 0; overflow: hidden; }
  .side { display: none; }
  .player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 10px;
    border-radius: 16px;
    align-self: stretch;
  }
  .player-card::before { display: none; }
  .cover-wrap {
    width: 72px;
    height: 72px;
    aspect-ratio: auto;
    flex: none;
    border-radius: 10px;
  }
  .cover-empty svg { width: 26px; height: 26px; }
  .player-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
  }
  .eyebrow { display: none; }
  h1 { font-size: 14px; margin: 0; }
  .artist { font-size: 11px; margin: 2px 0 0; }
  .progress-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
  }
  .progress-row span { font-size: 10px; min-width: auto; }
  input[type="range"] { height: 4px; }
  .controls { display: flex; align-items: center; gap: 3px; margin: 6px 0 0; flex: none; }
  .controls .ctrl { display: grid; width: 22px; height: 22px; }
  .controls .ctrl svg { width: 11px; height: 11px; }
  .controls .ctrl.play { width: 28px; height: 28px; }
  .controls .ctrl.play svg { width: 14px; height: 14px; }
  .queue-head, .queue { display: none; }

  .connect-gate { min-height: 0; flex: 1; }
  .connect-card { padding: 10px 12px; border-radius: 16px; }
  .connect-logo { width: 36px; height: 36px; margin-bottom: 4px; }
  .connect-card h2 { font-size: 14px; margin-bottom: 2px; }
  .connect-card p { display: none; }
  .voice-trigger { height: 30px; font-size: 12px; }
  .connect-card .primary { height: 30px; margin-top: 6px; font-size: 12px; }
  .msg { font-size: 10px; margin-top: 4px; }
}
