/* Нейтральная палитра, один акцентный цвет, без градиентов и теней. Тёмная тема по умолчанию, светлая — по настройке системы. */
:root {
  color-scheme: dark light;
  --bg: #101215; --surface: #171a1f; --surface2: #1e2228; --line: #2b3038;
  --text: #e5e7eb; --muted: #8b93a1; --accent: #5b8def; --accent-ink: #0b1220;
  --ok: #4cc38a; --err: #ef7b74; --radius: 6px;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7; --surface: #ffffff; --surface2: #f0f2f5; --line: #dde1e7;
    --text: #1a1d23; --muted: #646d7a; --accent: #2a5bd7; --accent-ink: #ffffff;
    --ok: #17794a; --err: #b3261e;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { margin: 0; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; display: block; }

/* формы и кнопки */
.field { display: block; margin: 0 0 14px; }
.field > span:first-child { display: block; margin-bottom: 5px; font-weight: 500; }
.hint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: inherit; background: var(--surface2);
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; font: inherit; color: inherit; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: none; }
.btn.block { width: 100%; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--muted); }
.check.inline { margin: 0; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; }
.alert { padding: 10px 12px; margin: 0 0 14px; border-radius: var(--radius); border: 1px solid var(--line); }
.alert-error { border-color: var(--err); color: var(--err); }

/* авторизация */
.auth-body { display: grid; place-items: center; min-height: 100%; padding: 24px; }
.auth { width: 100%; max-width: 380px; }
.auth-brand { font-weight: 600; font-size: 15px; margin: 0 0 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card > .muted { margin: 0 0 20px; }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); }
.pass { position: relative; display: block; }
.pass input { padding-right: 84px; }
.pass .link { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; }

/* каркас панели */
.app { display: flex; min-height: 100%; }
.side { width: 224px; flex-shrink: 0; display: flex; flex-direction: column; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { font-weight: 600; padding: 0 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 8px 10px; border-radius: var(--radius); color: var(--muted); }
.nav a:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--surface2); color: var(--text); font-weight: 500; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top h1 { font-size: 16px; margin-right: auto; }
.status { display: flex; gap: 16px; }
.dot-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dot-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--err); }
.dot-label.on i { background: var(--ok); }
.content { padding: 24px; max-width: 1040px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-size: 14px; }
.pad { padding: 16px; }
.hint-box { margin: 0; color: var(--muted); font-size: 13px; }

/* сейчас играет */
.now { display: flex; gap: 20px; padding: 20px; }
.cover { width: 168px; height: 168px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); overflow: hidden; }
.cover .i { width: 40px; height: 40px; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.now-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.now h2 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; margin-top: 6px; }
.tag { padding: 2px 8px; font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--line); border-radius: 4px; }
.progress { margin-top: auto; padding: 8px 0; cursor: pointer; }
.progress::before { content: ""; display: block; height: 4px; background: var(--surface2); border-radius: 2px; }
.progress { position: relative; }
.progress-fill { position: absolute; left: 0; top: 8px; height: 4px; background: var(--accent); border-radius: 2px; width: 0; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn.main { width: 44px; height: 44px; background: var(--text); color: var(--bg); }
.icon-btn.main:hover { background: var(--text); filter: brightness(.9); }
.volume { margin-left: auto; display: flex; align-items: center; gap: 6px; width: 170px; }

/* статистика */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.stat small { display: block; color: var(--muted); font-size: 12px; }
.stat b { display: block; margin-top: 2px; font-size: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* очередь */
.add { display: flex; gap: 8px; }
.panel > .add { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.note { padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.note.ok { color: var(--ok); } .note.err { color: var(--err); }
.queue { list-style: none; margin: 0; padding: 0; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: 0; }
.q-item.over { background: var(--surface2); }
.q-item.drag { opacity: .4; }
.q-grip { color: var(--muted); cursor: grab; } .q-grip .i { width: 16px; height: 16px; }
.q-num { width: 18px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-cover { width: 40px; height: 40px; flex-shrink: 0; border-radius: 4px; background: var(--surface2); object-fit: cover; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.q-cover img { width: 100%; height: 100%; object-fit: cover; }
.q-text { flex: 1; min-width: 0; }
.q-text div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-text small { color: var(--muted); }
.q-by { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.q-actions { display: flex; }
.q-actions button { width: 30px; height: 30px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--radius); color: var(--muted); cursor: pointer; }
.q-actions button:hover:not(:disabled) { background: var(--surface2); color: var(--text); }
.q-actions button:disabled { opacity: .3; cursor: default; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.pick { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cand { display: flex; align-items: center; gap: 10px; padding: 6px; text-align: left; color: inherit; font: inherit; background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-width: 0; }
.cand:hover { border-color: var(--accent); }
.cand img { width: 72px; height: 40px; object-fit: cover; border-radius: 3px; }
.cand span { min-width: 0; font-size: 12px; color: var(--muted); }
.cand b { display: block; font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* чат */
.chat-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.chat { display: flex; flex-direction: column; }
.messages { height: calc(100vh - 250px); min-height: 360px; overflow-y: auto; padding: 8px 0; }
.msg { padding: 3px 16px 3px 13px; border-left: 3px solid transparent; word-break: break-word; }
.msg.request { border-left-color: var(--accent); background: var(--surface2); }
.msg.bot { background: var(--surface2); border-left-color: var(--muted); }
.msg.bot.ok { border-left-color: var(--ok); } .msg.bot.no { border-left-color: var(--err); }
.msg.system { text-align: center; color: var(--muted); font-size: 12px; border: 0; }
.nick { font-weight: 600; }
.badge { display: inline-block; margin-right: 6px; padding: 0 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer select { width: 150px; flex-shrink: 0; }
.presets { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.presets .btn { justify-content: flex-start; font-size: 12px; padding: 6px 10px; white-space: normal; text-align: left; }
.label-gap { margin-top: 14px; }
.users { list-style: none; margin: 0 0 12px; padding: 0; }
.users li { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.users button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.users button:hover { color: var(--err); }

/* настройки */
.settings { display: flex; flex-direction: column; gap: 20px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; cursor: pointer; }
.switch small { display: block; color: var(--muted); font-weight: 400; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.save-bar { display: flex; align-items: center; justify-content: flex-end; gap: 14px; position: sticky; bottom: 0; padding: 12px 0; background: var(--bg); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--muted); }

/* плеер OBS */
.player-body { background: transparent; color: #fff; }
.yt-host { position: fixed; left: -9999px; top: 0; width: 320px; height: 180px; }
#card-root { padding: 16px; }
.pcard { width: 420px; max-width: 100%; padding: 12px; background: rgba(12, 14, 18, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; }
.pcard-top { display: flex; align-items: center; gap: 12px; }
.pcard-cover { width: 64px; height: 64px; flex-shrink: 0; border-radius: 4px; object-fit: cover; background: #232830; }
.pcard-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-artist { color: rgba(255, 255, 255, .75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-by { font-size: 12px; color: rgba(255, 255, 255, .55); }
.pcard-bar { margin-top: 10px; height: 4px; background: rgba(255, 255, 255, .15); border-radius: 2px; overflow: hidden; }
.pcard-fill { height: 100%; width: 0; background: #7aa2ff; }
.pcard-next { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: rgba(255, 255, 255, .7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(0, 0, 0, .8); border: 0; cursor: pointer; color: #fff; font: inherit; }
.gate-box { max-width: 320px; padding: 20px 24px; text-align: center; background: #171a1f; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; }
.gate-box small { display: block; margin-top: 6px; color: rgba(255, 255, 255, .6); }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .brand { padding: 0; } .nav { flex-direction: row; } .nav a { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .who { display: none; }
  .top { flex-wrap: wrap; padding: 10px 16px; } .status { order: 3; width: 100%; }
  .content { padding: 16px; }
  .cols, .chat-grid, .pick-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .now { flex-direction: column; } .cover { width: 100%; height: 200px; }
  .volume { width: 140px; }
  .q-by { display: none; }
  .messages { height: 50vh; }
}

/* Атмосферная тёмная тема: глубокий индиго, мятный акцент и мягкие подсветки. */
:root {
  color-scheme: dark;
  --bg: #0b0d12; --surface: #11151e; --surface2: #181e2a; --line: #252d3b;
  --text: #f1f4fb; --muted: #8c96aa; --accent: #a5f36b; --accent-ink: #10150c;
  --ok: #79e0b0; --err: #ff858b; --radius: 12px;
}
@media (prefers-color-scheme: light) { :root { color-scheme: dark; } }
body {
  background: radial-gradient(ellipse at 82% -12%, rgba(117, 91, 255, .17), transparent 38%),
    radial-gradient(ellipse at 12% 0%, rgba(165, 243, 107, .08), transparent 32%), var(--bg);
  background-attachment: fixed;
}
.side { background: rgba(15, 18, 26, .88); backdrop-filter: blur(18px); border-color: rgba(255,255,255,.07); }
.brand { font-size: 16px; letter-spacing: -.035em; }
.brand::before { content: '♫'; display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 9px; vertical-align: middle; border-radius: 10px; color: var(--accent-ink); background: var(--accent); box-shadow: 0 0 25px rgba(165,243,107,.22); }
.nav { gap: 5px; }
.nav a { border-radius: 10px; transition: background .2s ease, color .2s ease, transform .2s ease; }
.nav a:hover { transform: translateX(3px); background: rgba(255,255,255,.045); text-decoration: none; }
.nav a.active { background: linear-gradient(100deg, rgba(165,243,107,.16), rgba(165,243,107,.035)); color: var(--accent); box-shadow: inset 2px 0 var(--accent); }
.top { background: rgba(11,13,18,.58); backdrop-filter: blur(18px); border-color: rgba(255,255,255,.07); }
.top h1 { letter-spacing: -.04em; }
.content { animation: page-in .48s cubic-bezier(.2,.75,.25,1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.panel, .stat, .auth-card { background: linear-gradient(145deg, rgba(22,27,38,.96), rgba(16,20,29,.96)); border-color: rgba(255,255,255,.08); border-radius: 16px; box-shadow: 0 14px 44px rgba(0,0,0,.18); }
.panel { overflow: hidden; }
.panel h2, .panel h3 { letter-spacing: -.025em; }
.stat { transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }
.stat:hover { transform: translateY(-3px); border-color: rgba(165,243,107,.3); box-shadow: 0 16px 36px rgba(0,0,0,.24); }
.stat b { letter-spacing: -.04em; }
.btn { border-radius: 10px; transition: transform .18s ease, border-color .18s ease, background .18s ease, filter .18s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary { box-shadow: 0 5px 18px rgba(165,243,107,.17); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea { border-radius: 10px; transition: border-color .2s ease, box-shadow .2s ease; }
input:focus, select:focus, textarea:focus { border-color: rgba(165,243,107,.65); box-shadow: 0 0 0 4px rgba(165,243,107,.09); }
.q-item { transition: background .2s ease; }
.q-item:hover { background: rgba(255,255,255,.025); }
.q-cover { border-radius: 9px; }
.q-cover img, .cover { box-shadow: 0 8px 28px rgba(0,0,0,.28); }
.cover { border-radius: 14px; }
.now { border-radius: 16px; }
.dot-label i { box-shadow: 0 0 10px currentColor; }
.auth-body { background: radial-gradient(ellipse at 50% 38%, rgba(117,91,255,.15), transparent 42%), var(--bg); }
.auth-card { padding: 32px; }
.pcard { border-radius: 16px; backdrop-filter: blur(16px); box-shadow: 0 12px 42px rgba(0,0,0,.28); animation: card-in .42s ease both; }
.pcard-cover { border-radius: 10px; }
.pcard-fill { background: linear-gradient(90deg, #a5f36b, #6ce5bd); }
@keyframes card-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
