:root {
  --bg: #0e0d0c;
  --panel: #181614;
  --line: #2a2723;
  --text: #f1ebe2;
  --muted: #8f877c;
  --accent: #ff4b2b;
  --amber: #ffb547;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a1a12 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  min-height: 100vh;
}
a { color: var(--amber); }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; color: var(--muted); }
.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }

/* header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.tag { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 99px; }
.onair {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .14em;
  padding: 5px 9px; border-radius: 6px; border: 1px solid #4a2a22; color: #8a5a4e;
}
body.on-air .onair { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 18px #ff4b2b80; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 4px #ff4b2b40; } }
.meta { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; display: inline-block; }

/* deck */
.deck { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
@media (max-width: 760px) { .deck { grid-template-columns: 1fr; } }
.screen { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #000; }
.thumb { position: absolute; inset: 0; background: #111 center/cover no-repeat; filter: saturate(.9); }
.video { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.video iframe { width: 100%; height: 100%; display: block; }
body.is-listening .video { opacity: 1; }
.info { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.label { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--amber); }
#np-title { margin: 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.author { margin: 6px 0 16px; color: var(--muted); }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
#np-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--accent)); }
.row { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 13px; }
#np-time { white-space: nowrap; flex: none; }
.upnext { color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upnext b { color: var(--text); font-weight: 600; }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

button {
  font: inherit; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; padding: 11px 18px; font-weight: 600;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: .35; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.small { padding: 6px 12px; font-size: 13px; }
.listen .when-on { display: none; }
body.is-listening .listen { background: #2a2723; }
body.is-listening .listen .when-on { display: inline; }
body.is-listening .listen .when-off { display: none; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); }
input[type=range] { accent-color: var(--amber); width: 120px; }

/* panels */
.panel { margin-top: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.count { color: var(--amber); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list img { width: 64px; height: 36px; object-fit: cover; border-radius: 5px; flex: none; }
.list .empty { color: var(--muted); }
.queue .num { font-family: 'JetBrains Mono', monospace; color: var(--muted); width: 22px; text-align: right; flex: none; }
.queue .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.queue .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .t small { color: var(--muted); }
.acts { display: flex; gap: 4px; flex: none; }
.acts button { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 5px 9px; font-size: 13px; }
.acts button[data-act=remove]:hover { border-color: var(--accent); color: var(--accent); }

.add { display: flex; gap: 10px; }
.add textarea {
  flex: 1; resize: vertical; font: inherit; color: var(--text); background: #0f0e0d;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.add textarea:focus, .login input:focus { outline: 2px solid var(--amber); outline-offset: -1px; }
.msg { margin: 8px 0 0; font-size: 14px; min-height: 1em; color: var(--muted); }
.msg.ok { color: #3fd17a; }
.err { color: var(--accent); }

/* admin login */
.login { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 10; }
body.authed .login { display: none; }
body.admin:not(.authed) .wrap { visibility: hidden; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; width: min(360px, 90vw); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.login-box h2 { margin: 4px 0; }
.login input { width: 100%; font: inherit; color: var(--text); background: #0f0e0d; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.login button { width: 100%; }

/* ---------- štúdio: knižnica a hromadné akcie ---------- */
.wrap.wide { max-width: 1320px; }
.cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }
.cols .panel { margin-top: 20px; }
.pill { font-size: 10px; letter-spacing: .1em; padding: 2px 7px; border-radius: 99px; background: #2a2723; color: var(--amber); margin-left: 6px; vertical-align: 1px; }
.source { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.source .field { width: auto; padding: 7px 10px; font-size: 13px; }
.small-select { width: auto !important; padding: 5px 8px !important; font-size: 13px; margin-left: 4px; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: #2a2723; position: relative; flex: none; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: #4a2a12; }
.switch input:checked + span::after { transform: translateX(14px); background: var(--amber); }

.tabs { display: flex; gap: 4px; background: #0f0e0d; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tab { background: transparent; color: var(--muted); padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.tab.active { background: #2a2723; color: var(--text); }
.field {
  font: inherit; color: var(--text); background: #0f0e0d; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.field:focus { outline: 2px solid var(--amber); outline-offset: -1px; }
textarea.field { resize: vertical; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.5; }
select.field { width: auto; }
.add-form { display: flex; flex-direction: column; gap: 10px; }
.add-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
input[type=checkbox] { accent-color: var(--amber); width: 16px; height: 16px; cursor: pointer; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.toolbar + .toolbar { padding-top: 0; }
.toolbar .search { flex: 1; min-width: 160px; }
.grow { flex: 1; }
.sel { font-size: 13px; color: var(--amber); }
.danger:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btnlike { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btnlike:hover { filter: brightness(1.2); }
.lib-tools { display: flex; gap: 6px; }

.queue, .library { max-height: 620px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a352f transparent; }
.list li { cursor: default; border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.list li.selected { background: #2a1c12; }
.list li .t { cursor: pointer; }
.library .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.library .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library .t small, .queue .t small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library em { color: var(--amber); font-style: normal; }
.live { color: var(--accent); font-style: normal; }
.queue li[draggable=true] { cursor: grab; }
.queue li.dragging { opacity: .4; }
.queue li.drop { box-shadow: inset 0 2px 0 var(--amber); }
.more { display: block; margin: 10px auto 0; }
.cols > * { min-width: 0; }

/* ---------- účty ---------- */
.login-box input + input { margin-top: -2px; }
.userchip { margin-left: 10px; color: var(--text); }
.meta { flex-wrap: wrap; }
.meta .small { margin-left: 4px; }
.owner-only { display: none; }
body.is-owner .owner-only { display: grid; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; }
.row-form .field { flex: 1; min-width: 150px; }
.pill.red { color: var(--accent); }
.by { text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.users li.inactive { opacity: .5; }
.users .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.users .t small { color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #2a1c12; color: var(--amber); font-weight: 700; flex: none; }
.audit { max-height: 420px; overflow-y: auto; }
.audit li { align-items: baseline; font-size: 14px; }
.audit .when { flex: none; width: 130px; font-size: 12px; }
.audit .t { flex: 1; min-width: 0; }
.audit small { color: var(--muted); }

/* ---------- playlisty ---------- */
.playlists-panel { margin-top: 20px; }
.pl-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
@media (max-width: 900px) { .pl-grid { grid-template-columns: 1fr; } }
.pl-side, .pl-detail { min-width: 0; }
.pl-list { margin-top: 10px; max-height: 520px; overflow-y: auto; }
.pl-list li { cursor: pointer; }
.pl-list li:hover { background: #1f1b18; }
.pl-list .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-list .t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-list small { color: var(--muted); }
.pl-list em { color: var(--accent); font-style: normal; }
.pl-icon { width: 34px; height: 34px; border-radius: 8px; background: #2a1c12; display: grid; place-items: center; flex: none; }
.pl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pl-head h4 { margin: 0 0 4px; font-size: 20px; }
.pl-head small { color: var(--muted); }
.pl-head em { color: var(--amber); font-style: normal; }
.pl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.pl-songs { max-height: 520px; overflow-y: auto; }
.pl-songs .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-songs .t b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-songs .t small { color: var(--muted); }
.pl-songs .num { font-family: 'JetBrains Mono', monospace; color: var(--muted); width: 22px; text-align: right; flex: none; }
.pl-songs.editable li { cursor: grab; }
.pl-songs li.dragging { opacity: .4; }
.pl-songs li.drop { box-shadow: inset 0 2px 0 var(--amber); }
.pl-detail > .empty { color: var(--muted); padding: 30px 0; text-align: center; }
