:root {
  --bg: #0f1116;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --accent: #00a4dc;
  --accent-2: #5865f2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
}

.hidden {
  display: none !important;
}

/* ── Логин ── */
.login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 300px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.login-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}
.login-card input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.login-card button {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.login-error {
  color: #ffb4b4;
  font-size: 13px;
  text-align: center;
}

/* ── Шапка ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand {
  font-weight: 600;
  font-size: 16px;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  padding: 4px 10px;
  border-radius: 999px;
}

main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  padding: 14px 16px;
  height: calc(100vh - 58px);
}
section.left,
section.right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.row label {
  color: var(--muted);
  font-size: 12px;
}

select,
input[type="text"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  font-size: 14px;
}
input[type="text"] {
  flex: 1;
}
select {
  cursor: pointer;
}
#channel {
  flex: 1;
}

button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
button:hover {
  background: #262b36;
}
button.icon {
  padding: 8px 10px;
}

.results,
.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.results li.result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.results li.result:last-child {
  border-bottom: none;
}
.result img,
.result .noimg {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
}
.result .meta {
  flex: 1;
  min-width: 0;
}
.result .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result .sub {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playbtn {
  flex: 0 0 auto;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
.playbtn:hover {
  filter: brightness(1.1);
}
.muted {
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.nowplaying {
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 96px;
}
.np-empty {
  color: var(--muted);
  margin: auto;
}
.np-art {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}
.np-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.np-title {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-artist {
  color: var(--muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar {
  height: 6px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.5s linear;
}
.times {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.paused {
  color: #ffd27a;
  font-size: 12px;
  margin-top: 4px;
}

.controls {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.controls button {
  flex: 1;
  font-size: 18px;
}

h3 {
  margin: 6px 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.queue li {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue li:last-child {
  border-bottom: none;
}
.qn {
  color: var(--muted);
}
.qsub {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-2);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
