:root {
  --bg: #0b0b14;
  --bg2: #141428;
  --card: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #f1f1f8;
  --muted: #9a9ab5;
  --accent: #8b5cf6;
  --accent2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 18px;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 600px at 10% -10%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(800px 600px at 110% 10%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(236, 72, 153, 0.14), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(60px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.wrap.narrow { max-width: 560px; }
.wrap.wide { max-width: 1480px; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
#panel > .grid, #panel > .card { margin-bottom: 16px; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.logo {
  width: 40px; height: 40px; border-radius: 12px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 8px 30px rgba(139, 92, 246, 0.45);
}
.logo svg { width: 22px; height: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--card-border); font-size: 13px; color: var(--muted); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 10px currentColor; flex: none; }
.dot.on { background: var(--ok); color: var(--ok); }
.dot.warn { background: var(--warn); color: var(--warn); }
.dot.off { color: var(--bad); }

.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.card h2 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 18px; }
.stat .v { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.five .stat:last-child { grid-column: 1 / -1; } }
.stat .v.ok { color: var(--ok); }
.stat .v.warn { color: var(--warn); }
.stat .v.bad { color: var(--bad); }
.stat .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

button, .btn {
  font: inherit; border: 0; cursor: pointer; border-radius: 12px; padding: 11px 18px; font-weight: 650; font-size: 14.5px;
  color: var(--text); background: rgba(255, 255, 255, 0.08); border: 1px solid var(--card-border);
  transition: transform 0.08s ease, background 0.2s, opacity 0.2s, box-shadow 0.2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover { background: rgba(255, 255, 255, 0.13); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: var(--grad); border-color: transparent; box-shadow: 0 8px 26px rgba(139, 92, 246, 0.4); color: #fff; }
button.primary:hover { box-shadow: 0 10px 34px rgba(139, 92, 246, 0.6); }
button.danger { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }
button.ghost { background: transparent; }
button.icon { padding: 8px; width: 36px; height: 36px; border-radius: 10px; }
button.big { padding: 16px 26px; font-size: 16px; border-radius: 14px; }
button svg { width: 18px; height: 18px; }

input[type=text], input[type=password] {
  font: inherit; width: 100%; padding: 13px 15px; border-radius: 12px; color: var(--text);
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border); outline: none; font-size: 15px;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25); }
input[type=range] { width: 100%; accent-color: var(--accent); }
label.small { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }

.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }

/* Now playing */
.now { display: flex; align-items: center; gap: 18px; }
.art {
  width: 84px; height: 84px; border-radius: 18px; background: var(--grad); flex: none; display: grid; place-items: center;
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.45); position: relative; overflow: hidden;
}
.art .bars { display: flex; gap: 4px; align-items: flex-end; height: 34px; }
.art .bars i { width: 6px; background: rgba(255, 255, 255, 0.92); border-radius: 3px; height: 30%; }
.playing .art .bars i { animation: eq 0.9s ease-in-out infinite; }
.art .bars i:nth-child(2) { animation-delay: -0.3s !important; }
.art .bars i:nth-child(3) { animation-delay: -0.6s !important; }
.art .bars i:nth-child(4) { animation-delay: -0.15s !important; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.now .title { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.now .meta { min-width: 0; flex: 1; }
.status-badge { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); margin-top: 6px; }
.status-badge.playing { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.status-badge.preparing { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.status-badge.paused { background: rgba(34, 211, 238, 0.15); color: var(--accent2); }

.progress { margin-top: 16px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--grad); border-radius: 6px; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.transport { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.transport #btn-play { grid-column: 1 / -1; }
.split { display: flex; }
.split > button { flex: 1; min-width: 0; }
.split > button { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split > select {
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--text); cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); border-left: 0;
  border-radius: 0 14px 14px 0; padding: 0 10px; outline: none; -webkit-appearance: none; appearance: none;
}
.split > select:disabled, .split > button:disabled + select { opacity: 0.4; cursor: not-allowed; }
.split > select option { background: #1a1a2e; }

.master { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--card-border); }
.master .row { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.master b { color: var(--text); font-variant-numeric: tabular-nums; }
.master .vol-ico { width: 18px; height: 18px; color: var(--accent2); flex: none; }
.host-vol { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid transparent; transition: background 0.2s, border-color 0.2s;
}
.item:hover { background: rgba(255, 255, 255, 0.06); }
.item.active { border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.12); }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .grow { flex: 1; min-width: 0; }
.num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.item.active .num { background: var(--grad); color: #fff; }
.tag { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.tag.ready { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.tag.loaded { background: rgba(34, 211, 238, 0.14); color: var(--accent2); }
.tag.loading { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.tag.waiting { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.tag.bad { background: rgba(248, 113, 113, 0.15); color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }

/* Upload */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.16); border-radius: 15px; padding: 26px 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color 0.2s, background 0.2s; margin-bottom: 14px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(139, 92, 246, 0.08); color: var(--text); }
.drop .drop-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 4px;
  background: rgba(139, 92, 246, 0.16); color: #c4b5fd; transition: transform 0.2s;
}
.drop:hover .drop-icon, .drop.over .drop-icon { transform: translateY(-2px); }
.drop .drop-icon svg { width: 22px; height: 22px; }
.drop .drop-title { font-size: 15px; color: var(--muted); }
.drop .drop-title b { color: var(--text); }
.drop .drop-sub { font-size: 12.5px; color: var(--muted); opacity: 0.8; }
.upl { font-size: 13px; margin-bottom: 12px; }
.upl .bar { margin-top: 6px; }

/* Devices table */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 10px; }
td { padding: 11px 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; font-variant-numeric: tabular-nums; }
td .dname { font-weight: 650; }
td .dsub { font-size: 11.5px; color: var(--muted); }
#devices td { white-space: nowrap; }
#devices td.c-dev { min-width: 200px; white-space: normal; }
#devices td.c-sys, #devices td.c-net { white-space: normal; min-width: 150px; }
#devices td.c-act { width: 1%; }
.compact-only { display: none; }
@media (max-width: 1100px) {
  .wide-only { display: none !important; }
  .compact-only { display: block; }
}
.scroll-list { max-height: 380px; overflow-y: auto; padding-right: 4px; margin-right: -4px; }

/* App updates */
.upd-ver { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.upd-pct { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.upd-bar { height: 10px; margin-top: 12px; }
.upd-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.upd-legend span { display: inline-flex; align-items: center; gap: 7px; }
.upd-legend b { color: var(--text); }
.upd-legend .dot { box-shadow: none; }
.upd-note { font-size: 12.5px; margin: 14px 0 0; line-height: 1.5; }
#self-outdated { cursor: pointer; }
.ver-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; opacity: 0.7; }
.overlay.resume { z-index: 70; padding: 20px; cursor: pointer; }
.dev { display: flex; align-items: flex-start; gap: 10px; }
.dev-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(139, 92, 246, 0.14); color: #c4b5fd; }
.dev-ico.phone, .dev-ico.tablet { background: rgba(34, 211, 238, 0.12); color: #67e8f9; }
.dev-ico svg { width: 19px; height: 19px; }
.dmodel { font-size: 12px; color: #c9c9dd; margin-top: 1px; }
.table-wrap { overflow-x: auto; }
.you { font-size: 10.5px; padding: 2px 6px; border-radius: 6px; background: var(--grad); color: #fff; margin-left: 6px; font-weight: 700; }

/* Countdown overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; flex-direction: column;
  background: rgba(8, 8, 18, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.overlay.show { display: flex; }
.count {
  font-size: min(42vw, 260px); font-weight: 900; line-height: 1; letter-spacing: -0.05em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 60px rgba(139, 92, 246, 0.6));
}
.count.pop { animation: pop 0.9s ease-out; }
@keyframes pop { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.85); opacity: 0.85; } }
.overlay .hint { color: var(--muted); margin-top: 10px; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Join / login screens */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.join-card { width: 100%; max-width: 420px; text-align: center; padding: 34px 28px; }
.join-card .logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px; }
.join-card .logo svg { width: 34px; height: 34px; }
.join-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.join-card p { margin: 0 0 22px; color: var(--muted); }
.join-card .stack { display: flex; flex-direction: column; gap: 12px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 18px; }

.banner {
  display: none; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; margin-bottom: 16px;
  background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.35); color: #fde68a; font-size: 14px;
}
.banner.show { display: flex; }
.banner.info { background: rgba(34, 211, 238, 0.1); border-color: rgba(34, 211, 238, 0.35); color: #a5f3fc; }

.sync-meter { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sync-meter b { color: var(--text); font-variant-numeric: tabular-nums; }
.settings { display: grid; gap: 16px; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; transition: all 0.3s;
  background: rgba(20, 20, 40, 0.95); border: 1px solid var(--card-border); padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 60;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .wrap { padding-top: max(16px, env(safe-area-inset-top)); }
  header.top { margin-bottom: 16px; flex-wrap: wrap; }
  header.top > .row { gap: 6px; }
  .brand { font-size: 18px; gap: 10px; }
  .logo { width: 36px; height: 36px; border-radius: 11px; }
  .pill { padding: 6px 11px; font-size: 12.5px; }
  #share-url-pill { display: none; }

  .card { padding: 16px; border-radius: 16px; }
  .card h2 { margin-bottom: 12px; }
  .grid { gap: 12px; }

  .stats { gap: 10px; margin-bottom: 12px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 26px; }
  .stat .l { font-size: 12px; }

  .now { gap: 14px; }
  .art { width: 64px; height: 64px; border-radius: 15px; }
  .art .bars { height: 26px; }
  .art .bars i { width: 5px; }
  .now .title { font-size: 17px; }

  .transport { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .transport button.big { padding: 14px 10px; font-size: 15px; }
  .transport #btn-play { grid-column: 1 / -1; }
  .split { display: flex; }
  .split > button { flex: 1; min-width: 0; }

  .drop { padding: 20px 14px; }
  .drop .drop-sub { font-size: 12px; }

  .item { padding: 10px; gap: 10px; }
  .num { width: 26px; height: 26px; font-size: 12px; }
  .item .tag { padding: 4px 7px; font-size: 11px; }
  .item .name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.3; }
  .item button.icon { width: 32px; height: 32px; padding: 6px; }

  /* devices table becomes stacked cards */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  #devices tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.06);
    grid-template-areas: "dev act" "track sync" "ver ping";
  }
  #devices tr:first-child { border-top: 0; padding-top: 0; }
  #devices td { padding: 0; border: 0; width: auto; min-width: 0; }
  #devices td.c-dev { grid-area: dev; min-width: 0; }
  #devices td.c-dev .dname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #devices td.c-track { grid-area: track; display: flex; align-items: center; gap: 8px; }
  #devices td.c-track .dsub, #devices td.c-ver .dsub { margin: 0; }
  #devices td.c-sync { grid-area: sync; text-align: right; }
  #devices td.c-sync .row { justify-content: flex-end; }
  #devices td.c-ver { grid-area: ver; display: flex; align-items: center; gap: 8px; }
  #devices td.c-ping { grid-area: ping; text-align: right; font-size: 12px; color: var(--muted); align-self: center; }
  #devices td.c-ping::before { content: 'Ping '; }
  #devices td.c-act { grid-area: act; width: auto; }
  #devices td.empty { grid-area: auto; grid-column: 1 / -1; }
  .wrap.wide { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  #ver-pill { display: none; }

  .settings .row.wrap-row { gap: 10px 16px !important; }
  input[type=text], input[type=password] { font-size: 16px; } /* stops iOS zoom on focus */
  .join-card { padding: 28px 20px; }
}

/* ---------- Waveform ---------- */
.wave { display: block; width: 100%; height: 72px; touch-action: none; }
.wave.small { height: 48px; margin-top: 10px; }
.wave.seekable { cursor: pointer; }
.times #seek-hint { font-size: 11.5px; }
.up-next-line { margin-top: 12px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-next-line b { color: var(--text); font-weight: 600; }
#btn-resync { grid-column: 1 / -1; }

/* ---------- Queue / suggestions ---------- */
.small-btn { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; text-transform: none; letter-spacing: 0; }
.ok-btn { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.4); color: #a7f3d0; }
.q-item.next { border-color: rgba(34, 211, 238, 0.45); background: rgba(34, 211, 238, 0.08); }
.q-item.next .num { background: rgba(34, 211, 238, 0.25); color: #a5f3fc; }
.tag.queued { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.tag.sugg { background: rgba(251, 191, 36, 0.12); padding: 4px 6px; }
.count-badge { background: var(--grad); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 12px; letter-spacing: 0; }
.sugg-note { font-size: 12.5px; color: #d6d6ea; margin-top: 4px; font-style: italic; overflow-wrap: anywhere; }
.sugg-item { align-items: flex-start; }
.sugg-item > button { margin-top: 2px; }
.item button.icon { width: 32px; height: 32px; padding: 6px; font-size: 14px; }

.suggest { display: grid; gap: 10px; }
.file-pick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; cursor: pointer;
  border: 2px dashed rgba(255, 255, 255, 0.16); color: var(--muted); font-size: 14px; transition: border-color 0.2s, background 0.2s;
}
.file-pick:hover { border-color: var(--accent); background: rgba(139, 92, 246, 0.08); color: var(--text); }
.file-pick .drop-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(139, 92, 246, 0.16); color: #c4b5fd; flex: none; }
.file-pick .drop-icon svg { width: 18px; height: 18px; }
#suggest-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Preview dock (admin only hears it) ---------- */
.preview-dock {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  width: min(640px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 18px;
  background: rgba(22, 20, 44, 0.92); border: 1px solid rgba(139, 92, 246, 0.45);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.preview-dock .row { gap: 12px; }
.pv-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #c4b5fd; font-weight: 700; }
.pv-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-mute { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.pv-mute input { accent-color: var(--accent); }
body.previewing .wrap { padding-bottom: 170px; }

/* ---------- Reactions ---------- */
.react-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: rgba(22, 20, 44, 0.88); border: 1px solid var(--card-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.react-bar button {
  width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 0; background: transparent; font-size: 22px; line-height: 1;
  transition: transform 0.12s, background 0.2s;
}
.react-bar button:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-3px) scale(1.12); }
.react-bar button.tap { animation: tap 0.35s ease-out; }
@keyframes tap { 50% { transform: scale(1.35); } }
.msg-row { display: flex; gap: 8px; margin-top: 14px; }
.msg-row input { flex: 1; min-width: 0; }
.react-bar.inline { position: static; transform: none; margin-top: 14px; justify-content: space-between; box-shadow: none; background: rgba(255, 255, 255, 0.04); }
.react-bar.inline button { width: 38px; height: 38px; font-size: 20px; }
.react-spacer { height: 70px; }
.react-bar.cool button { opacity: 0.4; transform: none; }
.react-bar.cool::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; border-radius: 3px;
  background: var(--accent, #a78bfa); transform-origin: left; animation: announceTimer var(--cool, 3s) linear forwards;
}
.react-bar.inline { position: relative; left: auto; bottom: auto; }
.react-bar.shake { animation: shake 0.35s; }
@keyframes shake { 25% { margin-left: -6px; } 75% { margin-left: 6px; } }
.react-bar.hidden { display: none; }

#react-layer { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.react-float {
  position: absolute; bottom: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: floatUp 4.2s cubic-bezier(.2, .7, .3, 1) forwards;
}
.react-float .e { font-size: 38px; line-height: 1; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4)); }
.react-float .n {
  font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.55); color: #fff;
}
@keyframes floatUp {
  0% { transform: translate(0, 40px) scale(0.4); opacity: 0; }
  12% { transform: translate(calc(var(--drift) * 0.2), 0) scale(1.1); opacity: 1; }
  30% { transform: translate(calc(var(--drift) * -0.5), -18vh) scale(1); }
  55% { transform: translate(var(--drift), -36vh) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--drift) * -0.3), -62vh) scale(0.9); opacity: 0; }
}

.react-burst { position: fixed; inset: 0; z-index: 85; pointer-events: none; display: grid; place-items: center; }
.react-burst .big { position: absolute; font-size: min(46vw, 260px); line-height: 1; animation: burstBig 2.6s cubic-bezier(.2, .9, .3, 1.2) forwards; filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.45)); }
.react-burst .p { position: absolute; font-size: 40px; animation: burstPart 1.6s ease-out var(--d) forwards; opacity: 0; }
.react-burst .cap {
  position: absolute; top: calc(50% + min(26vw, 150px)); font-weight: 800; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); animation: burstCap 2.6s ease forwards;
}
@keyframes burstBig {
  0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  18% { transform: scale(1.15) rotate(6deg); opacity: 1; }
  30% { transform: scale(0.95) rotate(-3deg); }
  42% { transform: scale(1.05) rotate(0); }
  75% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes burstPart {
  0% { transform: translate(0, 0) scale(0.3) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1.1) rotate(var(--r)); opacity: 0; }
}
@keyframes burstCap { 0%, 15% { opacity: 0; transform: translateY(10px); } 30%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Admin message popup ---------- */
.announce {
  position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; z-index: 90; width: min(520px, calc(100vw - 32px));
  transform: translate(-50%, -24px) scale(0.96); opacity: 0; transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.2), opacity 0.3s;
  padding: 16px 18px 18px; border-radius: 18px; overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.96), rgba(219, 39, 119, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); color: #fff;
}
.announce.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.announce .a-head { font-size: 12px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.announce .a-text { margin-top: 6px; font-size: 20px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.announce .a-hint { margin-top: 10px; font-size: 13px; opacity: 0.9; }
.announce.rtl .a-head { letter-spacing: 0; text-transform: none; }
.announce.rtl .a-text { font-size: 21px; line-height: 1.7; font-family: Tahoma, "Vazirmatn", "Segoe UI", system-ui, sans-serif; }
.announce .a-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, 0.75); transform-origin: left; animation: announceTimer linear forwards; }
.announce.rtl .a-timer { transform-origin: right; }
@keyframes announceTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.react-bar.nudge { animation: nudge 0.9s ease-in-out 2 0.4s; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.55), 0 12px 40px rgba(0, 0, 0, 0.45); }
}

@media (max-width: 600px) {
  .wave { height: 60px; }
  .react-bar button { width: 38px; height: 38px; font-size: 20px; }
  .react-bar.inline button { width: 34px; height: 34px; font-size: 18px; }
  .item .tag.queued, .item .tag.sugg { display: none; }
  .preview-dock { padding: 12px; }
  .pv-mute { display: none; }
}
