/* BaladeiraGroups — estilos */
:root {
  --ink: #22232a;
  --muted: #696c77;
  --line: rgba(34, 35, 42, 0.09);
  --gray-0: #f6f6f8;
  --gray-1: #e6e7eb;
  --gray-2: #d2d4da;
  --gray-3: #a9acb6;
  --surface: rgba(248, 248, 251, 0.8);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 18px 40px -24px rgba(34, 35, 60, 0.35);
  --r-panel: 22px;
  --r-item: 14px;
  --field: rgba(255, 255, 255, 0.88);
  --card: rgba(255, 255, 255, 0.82);
  --pop: #fbfbfd;
  --mix: #fff;
  --ring: rgba(255, 255, 255, 0.9);
  --danger-ink: #9a2a36;
  --danger-soft: #fbe5e7;
  --btn-dark: #5b5e68;
  --btn-dark-hover: #474951;
  --lead: #3d3f48;
  --bg-base: linear-gradient(135deg, #e3e4e9, #d9dbe1 55%, #e1e2e7);
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="roxo"] { --accent: #7c4ddb; --accent-2: #a184ea; --accent-soft: #ebe3fb; --accent-ink: #4b2896; --wash: #b9a0f0; }
[data-theme="azul"] { --accent: #2d77d1; --accent-2: #6aa4e6; --accent-soft: #dfebf9; --accent-ink: #184a87; --wash: #8fbbee; }
[data-theme="vermelho"] { --accent: #d03a4b; --accent-2: #e9737f; --accent-soft: #f9e0e3; --accent-ink: #8a1f2c; --wash: #efa0a8; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background:
    radial-gradient(60vw 60vw at -10% -20%, color-mix(in srgb, var(--wash) 70%, transparent), transparent 60%),
    radial-gradient(55vw 55vw at 110% 120%, color-mix(in srgb, var(--wash) 75%, transparent), transparent 60%),
    var(--bg-base);
  background-attachment: fixed;
  transition: background 0.4s;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 4px 16px 14px; margin: 0; }
img { display: block; }

.ico, .icon-btn svg, .ctrl svg, .brand-mark svg, .chev {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
svg .fill { fill: currentColor; stroke: none; }

/* ---------- Botões ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform 0.12s, background 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-accent {
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px -12px var(--accent);
}
.btn-accent:hover { box-shadow: 0 12px 26px -10px var(--accent); }
.btn-danger { color: #fff; background: var(--btn-dark); }
.btn-danger:hover { background: var(--btn-dark-hover); }
.btn-ghost { background: var(--gray-1); color: var(--ink); }
.btn-ghost:hover { background: var(--gray-2); }
.btn-block { width: 100%; padding: 14px 18px; font-size: 16px; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  border: 0; background: transparent; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--gray-1); color: var(--ink); }
.link-muted { color: var(--muted); font-size: 13px; text-decoration: none; }
.link-muted:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { font-weight: 800; color: var(--accent-ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-lg { font-size: 34px; justify-content: center; }
.brand-lg .brand-mark { width: 56px; height: 56px; border-radius: 16px; }
.brand-lg .brand-mark svg { width: 32px; height: 32px; }

/* ---------- Login ---------- */
.landing { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.landing-card {
  max-width: 460px; text-align: center; background: var(--surface); backdrop-filter: blur(18px);
  border-radius: 28px; padding: 44px 36px; box-shadow: var(--shadow);
}
.landing-lead { font-size: 18px; color: var(--lead); margin: 22px 0 28px; }
.landing-note { color: var(--muted); font-size: 13px; margin: 22px 0 0; }
.landing-error { background: var(--danger-soft); color: var(--danger-ink); border-radius: 12px; padding: 10px 14px; margin: 20px 0 0; font-size: 14px; text-align: left; }

/* ---------- Layout ---------- */
.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(380px, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "top top top" "left center right";
  gap: 18px 22px;
  padding: 16px 22px 18px;
}
.topbar { grid-area: top; display: grid; grid-template-columns: 270px 1fr auto; gap: 22px; align-items: center; }
.left { grid-area: left; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.center { grid-area: center; display: flex; flex-direction: column; align-items: center; gap: 18px; min-height: 0; overflow: auto; padding-bottom: 4px; }
.right { grid-area: right; display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.panel {
  background: var(--surface); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: var(--r-panel); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 18px 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
}
.panel-toggle { border: 0; background: transparent; text-align: left; width: 100%; border-radius: var(--r-panel); }
.panel-toggle .chev { transition: transform 0.2s; color: var(--muted); }
.panel-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }

/* ---------- Topo ---------- */
.search { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; border: 1px solid var(--line); background: var(--field);
  border-radius: 999px; padding: 12px 18px 12px 46px; font-size: 15px; box-shadow: var(--shadow);
}
.search input:focus { outline: none; border-color: var(--accent); }
.search-results {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--pop); border-radius: 18px; padding: 6px; box-shadow: 0 24px 60px -20px rgba(30, 30, 50, 0.45);
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.themes {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 7px 10px 7px 14px; box-shadow: var(--shadow);
}
.themes-label { font-size: 14px; font-weight: 600; margin-right: 2px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; border: 0; padding: 0; transition: transform 0.15s; }
.swatch[data-theme-btn="roxo"] { background: linear-gradient(140deg, #7c4ddb, #a9abb5); }
.swatch[data-theme-btn="azul"] { background: linear-gradient(140deg, #2d77d1, #a9abb5); }
.swatch[data-theme-btn="vermelho"] { background: linear-gradient(140deg, #d03a4b, #a9abb5); }
.swatch:hover { transform: translateY(-1px); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--pop), 0 0 0 4px var(--ink); }
.me { display: flex; align-items: center; gap: 8px; }
.me-name { font-weight: 600; font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Avatares ---------- */
.avatar {
  --size: 56px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--size) * 0.38);
  background: var(--avatar-bg, var(--accent)); background-size: cover; background-position: center;
}
.avatar-sm { --size: 30px; }
.avatar-xs { --size: 28px; }

/* ---------- Esquerda ---------- */
.playlists { flex: 1; }
.playlists.collapsed { flex: 0 0 auto; }
.playlists.collapsed .playlist-grid { display: none; }
.playlist-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 14px; overflow: auto; min-height: 0; align-content: start;
}
.pl-tile {
  border: 0; padding: 0; background: none; text-align: left; display: flex; flex-direction: column; gap: 6px; border-radius: var(--r-item);
}
.pl-art {
  aspect-ratio: 1; width: 100%; border-radius: var(--r-item); background: var(--gray-2) center/cover;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; padding: 8px; text-align: center; line-height: 1.1;
  box-shadow: 0 8px 18px -12px rgba(30, 30, 50, 0.5); transition: transform 0.15s;
}
.pl-tile:hover .pl-art { transform: translateY(-2px); }
.pl-art.liked { background: linear-gradient(140deg, var(--accent), var(--accent-2)); }
.pl-art.liked svg { width: 34px; height: 34px; fill: #fff; stroke: none; }
.pl-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

.room-box { display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 0; }
.room-code-row { display: flex; flex-direction: column; gap: 2px; }
.room-code {
  border: 0; background: none; padding: 0; text-align: left; font-size: 32px; font-weight: 800; letter-spacing: 0.08em; color: var(--accent-ink);
}
.room-code:hover { text-decoration: underline dotted; text-underline-offset: 6px; }
.join { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--field); border-radius: 999px;
  padding: 9px 14px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.join-row input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.attribution { margin: 0; font-size: 12px; color: var(--muted); }

/* ---------- Centro: tocando agora ---------- */
.now {
  width: min(520px, 100%); background: var(--surface); backdrop-filter: blur(16px); border-radius: 28px;
  box-shadow: var(--shadow); padding: 26px 30px 22px; text-align: center; margin-top: 6px;
}
.now-empty { padding: 60px 10px; }
.now-empty h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.1; }
.now-empty p { color: var(--muted); max-width: 34ch; margin: 0 auto; }
.now-label { margin: 0 0 16px; font-size: 14px; color: var(--muted); font-weight: 500; }
.cover-wrap { position: relative; width: min(280px, 70vw); aspect-ratio: 1; margin: 0 auto 22px; }
.cover, .cover-halo { position: absolute; inset: 0; border-radius: 20px; background: var(--gray-2) center/cover; }
.cover-halo { inset: 8% 4% -6%; filter: blur(30px) saturate(1.4); opacity: 0.7; transform: translateZ(0); transition: background-image 0.5s; }
.cover { box-shadow: 0 22px 40px -22px rgba(20, 20, 40, 0.6); display: grid; place-items: center; color: rgba(255, 255, 255, 0.85); }
.cover.placeholder { background: linear-gradient(140deg, var(--accent-2), var(--gray-3)); }
.cover.placeholder svg { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.track-title { font-size: 28px; line-height: 1.12; letter-spacing: -0.02em; font-weight: 750; margin: 0 0 4px; overflow-wrap: anywhere; }
.track-artist { margin: 0 0 18px; color: var(--muted); font-size: 16px; }
.progress { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; height: 5px; border-radius: 9px; background: var(--gray-2); }
.bar-fill { position: absolute; left: 0; height: 5px; border-radius: 9px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; }
.bar-knob { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); transform: translateX(-50%); left: 0; opacity: 0; transition: opacity 0.15s; }
.bar:hover .bar-knob, .bar.dragging .bar-knob { opacity: 1; }
.bar.locked { cursor: default; }
.bar.locked .bar-knob { display: none; }
.controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 4px; }
.ctrl { border: 0; background: transparent; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.ctrl svg { width: 24px; height: 24px; }
.ctrl:hover { background: var(--gray-1); }
.ctrl-main { width: 62px; height: 62px; color: #fff; background: linear-gradient(140deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 24px -12px var(--accent); }
.ctrl-main:hover { background: linear-gradient(140deg, var(--accent-ink), var(--accent)); }
.ctrl-main svg { width: 28px; height: 28px; }
.ctrl[disabled] { opacity: 0.35; cursor: not-allowed; }
.control-hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.sync-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.device { color: var(--muted); text-align: right; }
.device.warn { color: var(--danger-ink); font-weight: 600; }
.device-box { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.device-box select {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--field); border-radius: 999px;
  padding: 6px 10px; font-size: 13px; color: var(--ink);
}
.link-btn { border: 0; background: none; padding: 4px 2px; color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.device-box input[type="range"] { flex: 1; accent-color: var(--accent); }
.device-tools { display: flex; justify-content: flex-end; margin-top: 4px; }
.muted-link { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- Participantes ---------- */
.people { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.people-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; position: relative; }
.person .avatar { --size: 60px; box-shadow: 0 0 0 3px var(--ring), 0 10px 20px -12px rgba(20, 20, 40, 0.6); }
.person-name { font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-badge {
  position: absolute; top: -4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--pop); color: var(--accent);
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.host-badge svg { width: 13px; height: 13px; fill: currentColor; }

/* ---------- Fila ---------- */
.queue { flex: 1 1 52%; }
.queue-list { list-style: none; margin: 0; padding: 0 12px 12px; overflow: auto; display: flex; flex-direction: column; gap: 7px; min-height: 0; }
.q-item {
  display: grid; grid-template-columns: 22px 42px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-item); padding: 6px 6px 6px 4px;
  position: relative; user-select: none;
}
.q-item.next { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.q-item.dragging { z-index: 5; box-shadow: 0 16px 30px -12px rgba(20, 20, 40, 0.45); border-color: var(--accent); }
.q-item.anim { transition: transform 0.18s; }
.handle { cursor: grab; color: var(--gray-3); display: grid; place-items: center; height: 100%; touch-action: none; border: 0; background: none; padding: 0; }
.handle:hover { color: var(--ink); }
.handle svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.q-art { width: 42px; height: 42px; border-radius: 9px; background: var(--gray-2) center/cover; }
.q-text { min-width: 0; line-height: 1.25; }
.q-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-del { width: 32px; height: 32px; }
.q-del:hover { color: var(--danger-ink); background: var(--danger-soft); }
.q-del svg { width: 17px; height: 17px; }

/* ---------- Chat ---------- */
.chat { flex: 1 1 48%; position: relative; }
.chat-log { flex: 1; overflow: auto; padding: 2px 14px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: color-mix(in srgb, var(--accent-soft) 85%, var(--mix)); border-radius: 16px 16px 16px 5px; padding: 7px 12px; font-size: 14px; overflow-wrap: anywhere; }
.msg.mine .bubble { background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 22%, var(--mix)), color-mix(in srgb, var(--accent-2) 30%, var(--mix))); border-radius: 16px 16px 5px 16px; }
.bubble .who { display: block; font-size: 11px; font-weight: 700; color: var(--accent-ink); }
.bubble.big { font-size: 34px; line-height: 1.1; background: none; padding: 0 2px; }
.bubble.big .who { font-size: 11px; }
.event { align-self: center; text-align: center; font-size: 12.5px; color: var(--muted); max-width: 95%; padding: 2px 8px; }
.event b { color: var(--ink); font-weight: 650; }
.chat-form { display: flex; align-items: center; gap: 4px; padding: 8px 10px 12px; }
.chat-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--field); border-radius: 999px; padding: 9px 14px; }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.send { color: var(--accent); }
.emoji-pop {
  position: absolute; bottom: 62px; left: 10px; right: 10px; z-index: 20; background: var(--pop); border-radius: 16px; padding: 8px;
  box-shadow: 0 20px 50px -18px rgba(30, 30, 50, 0.5); display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
}
.emoji-pop button { border: 0; background: none; font-size: 22px; border-radius: 10px; padding: 4px 0; }
.emoji-pop button:hover { background: var(--gray-1); }

.host-option, .guest-option { padding: 0 6px; font-size: 13px; margin: 0; }
.host-option { background: var(--surface); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }

/* ---------- Switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; line-height: 1.3; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--gray-2); position: relative; flex: none; transition: background 0.2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* ---------- Resultados (busca e playlist) ---------- */
.row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 12px;
}
.row:hover { background: var(--gray-1); }
.row-art { width: 44px; height: 44px; border-radius: 8px; background: var(--gray-2) center/cover; }
.row-text { min-width: 0; line-height: 1.25; }
.row-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.add-btn { border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650; background: var(--accent-soft); color: var(--accent-ink); }
.add-btn:hover { background: var(--accent); color: #fff; }
.add-btn[disabled] { opacity: 0.5; cursor: not-allowed; background: var(--gray-1); color: var(--muted); }
.add-btn.done { background: var(--accent); color: #fff; }
.results-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px 12px; font-size: 13px; font-weight: 650; color: var(--muted); }
.results-note { padding: 10px 12px; margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(30, 30, 40, 0.35); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal-card { width: min(620px, 100%); max-height: 86vh; background: var(--pop); border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 40px 80px -30px rgba(20, 20, 40, 0.6); }
.modal-head { display: flex; gap: 18px; padding: 20px; align-items: flex-end; position: relative; border-bottom: 1px solid var(--line); }
.pl-cover { width: 110px; height: 110px; border-radius: 16px; background: var(--gray-2) center/cover; flex: none; display: grid; place-items: center; }
.pl-cover svg { width: 44px; height: 44px; fill: #fff; }
.pl-meta { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pl-meta h3 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
.pl-meta p { margin: 0 0 4px; }
.modal-x { position: absolute; top: 12px; right: 12px; }
.pl-tracks { list-style: none; margin: 0; padding: 8px; overflow: auto; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; pointer-events: none; }
.toast { background: #2a2b33; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5); animation: toast-in 0.2s ease-out; max-width: 90vw; }
.toast.err { background: #8a1f2c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }


/* ---------- Modo escuro (mantém a cor do tema) ---------- */
:root[data-mode="dark"] {
  color-scheme: dark;
  --ink: #ecedf2;
  --muted: #a2a5b1;
  --line: rgba(255, 255, 255, 0.08);
  --gray-0: #1c1d23;
  --gray-1: #2b2c34;
  --gray-2: #3b3d47;
  --gray-3: #646774;
  --surface: rgba(32, 33, 40, 0.84);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 44px -24px rgba(0, 0, 0, 0.8);
  --field: rgba(20, 21, 26, 0.85);
  --card: rgba(44, 45, 54, 0.9);
  --pop: #23242c;
  --mix: #1e1f26;
  --ring: #2b2c34;
  --danger-ink: #ff9aa5;
  --danger-soft: rgba(208, 58, 75, 0.18);
  --btn-dark: #3b3d47;
  --btn-dark-hover: #4a4c57;
  --lead: #c9cbd4;
  --bg-base: linear-gradient(135deg, #16171c, #1b1c22 55%, #15161b);
}
:root[data-mode="dark"][data-theme="roxo"] { --accent-ink: #c8b2fa; --accent-soft: #3a2f58; --wash: #4b3285; }
:root[data-mode="dark"][data-theme="azul"] { --accent-ink: #9fc6f4; --accent-soft: #233a58; --wash: #1f4a80; }
:root[data-mode="dark"][data-theme="vermelho"] { --accent-ink: #f5a6af; --accent-soft: #4f2730; --wash: #7a2532; }
:root[data-mode="dark"] .search input { color: var(--ink); }
:root[data-mode="dark"] .toast { background: #3b3d47; }
:root[data-mode="dark"] .cover-halo { opacity: 0.5; }

.mode-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.mode-btn:hover { color: var(--accent-ink); }
.mode-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Telas menores ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 16px; padding: 14px 16px; }
  .topbar { grid-template-columns: 240px 1fr auto; }
  .themes-label, .me-name { display: none; }
}
@media (max-width: 960px) {
  .app { height: auto; min-height: 100vh; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "left" "center" "right"; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .topbar-right { gap: 10px; }
  .themes { padding: 6px 8px; gap: 6px; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .queue, .chat, .playlists { flex: none; }
  .queue-list { max-height: 360px; }
  .chat-log { height: 300px; flex: none; }
  .playlist-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); max-height: 300px; }
}
@media (max-width: 520px) {
  .app { padding: 12px 16px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 30px; height: 30px; }
  .now { padding: 20px 16px; }
  .track-title { font-size: 23px; }
  .row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .row-time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
