:root {
  --bg: #0e0d12;
  --surface: #16141c;
  --surface-2: #1f1c28;
  --line: #2a2735;
  --text: #f2efe9;
  --muted: #8b8794;
  --accent: #e8a84c;
  --accent-soft: rgba(232, 168, 76, 0.14);
  --live: #e0533a;
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(900px 500px at 50% -10%, rgba(232, 168, 76, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wordmark .accent { color: var(--accent); }

button { font-family: var(--body); cursor: pointer; }
.btn {
  background: var(--accent);
  color: #1a1407;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.btn:hover { box-shadow: 0 6px 22px rgba(232, 168, 76, 0.28); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--accent); }

/* ---------------- LOGIN ---------------- */
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
}
.login-card h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 46px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.field { display: flex; flex-direction: column; gap: 12px; }
.input {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: var(--body);
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}
.input:focus { border-color: var(--accent); }
.error { color: var(--live); font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ---------------- APP ---------------- */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
  flex-wrap: wrap;
}
.topbar .brand { font-size: 19px; }
.topbar .brand .dot { color: var(--muted); margin: 0 8px; }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.online {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 83, 58, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(224, 83, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 83, 58, 0); }
}
.linkish { background: none; border: none; color: var(--muted); font-size: 13px; text-decoration: none; }
.linkish:hover { color: var(--accent); }

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  padding: 18px 22px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.player-shell {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(232, 168, 76, 0.06);
}
.player-shell video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.tap-hint {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.55);
  color: var(--text);
  font-family: var(--display); font-size: 18px;
  cursor: pointer; z-index: 2;
}
.player-empty {
  aspect-ratio: 16/9;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.player-empty .big { font-family: var(--display); font-size: 22px; color: var(--text); margin-bottom: 6px; }
.sync-status {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 10px 14px;
}
.sync-status .ok { color: var(--accent); }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 12px;
}
.section-head h2 {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--muted); font-weight: 400;
}
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone strong { color: var(--text); }

.uploads { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.up-row { background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.up-row .name { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--muted); }
.bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }

.playlist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.track {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 13px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.track:hover { background: var(--surface-2); }
.track.active { border-color: var(--accent); background: var(--accent-soft); }
.track .idx { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 22px; }
.track.active .idx { color: var(--accent); }
.track .tname { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .del { color: var(--muted); background: none; border: none; font-size: 16px; opacity: 0.4; }
.track:hover .del { opacity: 1; }
.track .del:hover { color: var(--live); }
.empty-note { color: var(--muted); font-size: 13px; padding: 8px 2px; }

.chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 116px);
  min-height: 360px;
}
@media (max-width: 900px) { .chat { height: 420px; } }
.chat .head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--muted);
}
.chat .msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.msg .who { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.msg .body { font-size: 14px; color: var(--text); line-height: 1.4; word-break: break-word; }
.chat .compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat .compose input { flex: 1; }
.chat .compose .btn { padding: 12px 14px; }

.hidden { display: none !important; }

/* ---- dvonivovski ulaz ---- */
.switch-link {
  background: none; border: none; color: var(--muted);
  font-size: 13px; margin-top: 18px; text-decoration: underline; cursor: pointer;
}
.switch-link:hover { color: var(--accent); }
.code-input {
  text-align: center; letter-spacing: 0.4em; font-family: var(--mono);
  text-transform: uppercase; font-size: 22px;
}

.role-badge {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px;
}

.code-panel {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
}
.code-panel .code-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--muted);
}
.code-panel .code-value {
  font-family: var(--mono); font-weight: 700; font-size: 26px;
  letter-spacing: 0.22em; color: var(--accent); margin-right: auto;
}
.btn.small { padding: 8px 12px; font-size: 13px; }

/* ---- titlovi u plejlisti ---- */
.sub-badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 1px 5px; letter-spacing: 0.05em;
}
.subbtn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 5px 9px; font-size: 12px; opacity: 0.5;
}
.track:hover .subbtn { opacity: 1; }
.subbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- status obrade ---- */
.track.busy { opacity: 0.8; cursor: default; }
.track .status { font-family: var(--mono); font-size: 11px; }
.track .status.proc { color: var(--accent); }
.track .status.err { color: var(--live); }
