/* Bopwire web player — Discover. Dark, compact, no framework. */
:root {
  --bg:        #0c0d10;
  --bg-elev:   #15171c;
  --bg-elev2:  #1c1f26;
  --line:      #262a33;
  --text:      #e7e9ee;
  --text-dim:  #9aa0ab;
  --accent:    #6ee7b7;   /* mint, echoes the brand mark */
  --accent-2:  #38bdf8;
  --danger:    #f87171;
  --chip:      #20242c;
  --chip-hot:  #2c3a39;
  --radius:    10px;
  --np-h:      72px;
  --cta-h:     44px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ───────── Topbar ───────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3px; }
.brand-mark { color: var(--accent); font-size: 18px; }
.brand-name { font-size: 16px; }
.search { flex: 1 1 auto; max-width: 520px; }
.search input {
  width: 100%; padding: 8px 12px;
  background: var(--bg-elev2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; outline: none;
}
.search input:focus { border-color: var(--accent-2); }
.status { display: flex; align-items: center; gap: 7px; color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); box-shadow: 0 0 0 0 rgba(110,231,183,.6); }
.dot.ok      { background: var(--accent);  animation: pulse 2.2s infinite; }
.dot.warn    { background: #fbbf24; }
.dot.err     { background: var(--danger); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(110,231,183,.5)} 70%{box-shadow:0 0 0 6px rgba(110,231,183,0)} 100%{box-shadow:0 0 0 0 rgba(110,231,183,0)} }

/* ───────── Controls ───────── */
.controls {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
}
.segmented { display: inline-flex; background: var(--bg-elev2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg {
  border: 0; background: transparent; color: var(--text-dim);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg[aria-selected="true"] { background: var(--accent); color: #06231a; font-weight: 600; }
.seg-ico { font-size: 13px; }
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--text-dim); font-size: 13px; min-height: 20px; }
.crumb { color: var(--accent-2); cursor: pointer; }
.crumb:hover { text-decoration: underline; }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.crumb-sep { opacity: .5; }

/* ───────── Two-pane body ───────── */
.panes { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.pane { overflow: auto; }
.pane-chips { flex: 0 0 45%; padding: 14px 16px; }
.pane-tracks { flex: 1 1 auto; padding: 8px 16px 16px; }
.divider {
  flex: 0 0 10px; cursor: row-resize; position: relative;
  background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.divider::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 42px; height: 3px; border-radius: 3px; background: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--chip); border: 1px solid var(--line); color: var(--text);
  padding: 8px 13px; border-radius: 999px; cursor: pointer; user-select: none;
  max-width: 320px;
}
.chip:hover { border-color: var(--accent-2); }
.chip.active { background: var(--chip-hot); border-color: var(--accent); }
.chip .c-ico { opacity: .8; }
.chip .c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .c-count { color: var(--text-dim); font-size: 12px; }

/* ───────── Track list ───────── */
.track-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.track-head .th-title { font-weight: 700; font-size: 15px; }
.track-head .th-sub { color: var(--text-dim); font-size: 12px; }
.track-head .th-close { margin-left: auto; cursor: pointer; color: var(--text-dim); border: 1px solid var(--line); border-radius: 8px; padding: 3px 9px; background: transparent; }
.track-head .th-close:hover { color: var(--text); border-color: var(--text-dim); }

.tracks { display: flex; flex-direction: column; }
.track {
  display: grid; grid-template-columns: 28px 1fr auto auto 40px;
  align-items: center; gap: 12px;
  padding: 9px 8px; border-radius: 8px; cursor: pointer;
}
.track:hover { background: var(--bg-elev); }
.track.playing { background: var(--chip-hot); }
.track .t-num { color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.track .t-main { min-width: 0; }
.track .t-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .t-artist { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .t-plays { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.track .t-dur { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.track .t-play { opacity: 0; color: var(--accent); font-size: 16px; text-align: center; }
.track:hover .t-play, .track.playing .t-play { opacity: 1; }

.empty { color: var(--text-dim); padding: 24px 8px; text-align: center; }

/* ───────── Now playing ───────── */
.nowplaying {
  flex: 0 0 var(--np-h); display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: var(--bg-elev); border-top: 1px solid var(--line);
}
.np-art { width: 46px; height: 46px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06231a; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.np-meta { min-width: 0; width: 200px; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { color: var(--text-dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-controls { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; }
.np-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #06231a; font-size: 15px; cursor: pointer; flex: 0 0 auto; }
.np-seek { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 12px; }
.np-seek input[type=range] { flex: 1 1 auto; accent-color: var(--accent); }
.np-spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── CTA ───────── */
.cta {
  flex: 0 0 var(--cta-h); display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(90deg, rgba(110,231,183,.12), rgba(56,189,248,.12));
  border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text); position: relative;
}
.cta-menu { position: relative; }
.cta-click { background: transparent; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.cta-dropdown {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--bg-elev2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 6px; min-width: 170px; z-index: 20;
}
.cta-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.cta-opt:hover { background: var(--bg-elev); }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--np-h) + var(--cta-h) + 16px);
  transform: translateX(-50%); background: var(--bg-elev2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 50; max-width: 80vw;
}

@media (max-width: 640px) {
  .np-meta { width: 120px; }
  .track { grid-template-columns: 24px 1fr auto 36px; }
  .track .t-plays { display: none; }
  .cta { font-size: 12px; padding: 0 10px; text-align: center; }
}
