/* ZWNG - wspolny styl interfejsu */
:root {
  --bg: #0f1115;
  --bg-2: #171a21;
  --bg-3: #1f232c;
  --line: #2a2f3a;
  --txt: #e8eaed;
  --txt-dim: #9aa2af;
  --accent: #4f8cff;
  --accent-2: #2f6fe0;
  --green: #34c759;
  --red: #ff453a;
  --amber: #ffb020;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.topbar .brand small { color: var(--txt-dim); font-weight: 400; font-size: 13px; margin-left: 6px; }
.topbar .spacer { flex: 1; }
.topbar nav a {
  color: var(--txt-dim); padding: 7px 12px; border-radius: 8px; font-size: 14px;
}
.topbar nav a:hover { background: var(--bg-3); color: var(--txt); text-decoration: none; }
.topbar nav a.active { background: var(--accent); color: #fff; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge.operator { background: rgba(52,199,89,.16); color: var(--green); }
.badge.viewer { background: rgba(154,162,175,.16); color: var(--txt-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

button, .btn {
  font-family: var(--font); font-size: 14px; font-weight: 600;
  color: var(--txt); background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 14px; cursor: pointer; transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { background: #262b35; }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-danger { background: rgba(255,69,58,.14); border-color: rgba(255,69,58,.4); color: var(--red); }
.btn-danger:hover { background: rgba(255,69,58,.24); }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-block { width: 100%; }

input[type=text], input[type=password], input[type=number], textarea, select {
  font-family: var(--font); font-size: 15px; color: var(--txt);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
label { font-size: 13px; color: var(--txt-dim); display: block; margin-bottom: 5px; }

.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.muted { color: var(--txt-dim); }
.small { font-size: 13px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; width: 360px; max-width: 92vw;
}
.modal h3 { margin: 0 0 14px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--line); color: var(--txt);
  padding: 12px 18px; border-radius: 10px; z-index: 200; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { border-color: rgba(255,69,58,.5); }

/* Waski pasek gorny z przyciskiem Cofnij (oszczedza miejsce, gl. mobile) */
.minibar {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 4px 8px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  padding-top: max(4px, env(safe-area-inset-top));
}
.minibar .spacer { flex: 1; }
.minibar .mb-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar .mb-title small { color: var(--txt-dim); font-weight: 400; }
.back {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; font-size: 14px; font-weight: 600;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 9px; color: var(--txt); cursor: pointer;
  text-decoration: none; flex: none;
}
.back:hover { background: #262b35; text-decoration: none; }
.iconbtn { padding: 7px 9px; font-size: 14px; }
.iconbtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Ekran wyboru na wejsciu */
.chooser-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 28px; }
.chooser-head { text-align: center; }
.brand-logo { width: 300px; max-width: 80vw; height: auto; display: block; margin: 0 auto 10px; }
.chooser-head h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: .3px; }
.chooser-head p { color: var(--txt-dim); margin: 0; }
@media (max-width: 720px) { .brand-logo { width: 230px; height: auto; } }
.chooser { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.choice {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  width: 220px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 32px 18px; color: var(--txt); cursor: pointer; transition: transform .08s, border-color .12s, background .12s;
}
.choice:hover { border-color: var(--accent); background: var(--bg-3); text-decoration: none; transform: translateY(-2px); }
.choice .ico { font-size: 46px; line-height: 1; }
.choice .t { font-weight: 700; font-size: 19px; }
.choice .d { color: var(--txt-dim); font-size: 13px; }
.chooser-extra { display: flex; gap: 14px; align-items: center; }
@media (max-width: 720px) {
  .chooser { flex-direction: column; width: 100%; max-width: 360px; }
  .choice { width: 100%; flex-direction: row; text-align: left; padding: 18px; gap: 14px; }
  .choice .ico { font-size: 34px; }
  .chooser-head h1 { font-size: 24px; }
}

/* Notatki dla zespolu (operator + widok); nie pojawiaja sie na projekcji) */
.note-cue {
  color: var(--amber); font-size: 13px; line-height: 1.4; white-space: pre-wrap;
  background: rgba(255,176,32,.10); border: 1px solid rgba(255,176,32,.30);
  border-radius: 8px; padding: 7px 10px;
}
.note-cue::before { content: "📝 "; }
.song-note-bar {
  margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--line);
  background: rgba(255,176,32,.07); color: var(--amber); font-size: 13px; white-space: pre-wrap;
}
.song-note-bar::before { content: "📝 Notatka: "; font-weight: 700; }
