:root {
  --bg: #07040f;
  --bg-glow-a: #3d0f7a;
  --bg-glow-b: #0e0a2e;
  --panel: #100a1e;
  --panel-alt: #191029;
  --panel-raised: #221636;
  --purple: #a855f7;
  --purple-soft: #d7b3ff;
  --magenta: #ff2fd3;
  --cyan: #00e5ff;
  --live: #00e5ff;
  --text: #f3ecff;
  --muted: #9c8fc2;
  --border: rgba(168, 85, 247, 0.22);
  --border-bright: rgba(168, 85, 247, 0.5);
  --danger: #ff3b5c;

  --font-display: 'Audiowide', 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 85% 55% at 15% -10%, var(--bg-glow-a) 0%, transparent 55%),
    radial-gradient(ellipse 75% 60% at 100% 100%, var(--bg-glow-b) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.accent { color: var(--magenta); }
code {
  font-family: var(--font-mono);
  background: var(--panel-alt);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---- Neonowy napis w tle: "luvi4_" ---- */
.bg-wordmark {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20vw;
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(168, 85, 247, 0.35);
  text-shadow:
    0 0 30px rgba(168, 85, 247, 0.25),
    0 0 70px rgba(255, 47, 211, 0.15);
  pointer-events: none;
  z-index: 0;
  user-select: none;
  white-space: nowrap;
  animation: wordmark-flicker 6s ease-in-out infinite;
}
@keyframes wordmark-flicker {
  0%, 100% { opacity: 0.9; }
  4% { opacity: 0.4; }
  6% { opacity: 0.9; }
  45% { opacity: 0.9; }
  47% { opacity: 0.5; }
  49% { opacity: 0.85; }
  90% { opacity: 0.9; }
}
.login-screen, .dashboard { position: relative; z-index: 1; }

/* ---- Equalizer sygnaturowy (neonowy, wielokolorowy) ---- */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.eq span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--magenta), var(--purple));
  height: 6px;
  transition: height 0.25s ease;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.6);
}
.eq.is-playing span { animation: eq-bounce 0.9s ease-in-out infinite; }
.eq.is-playing span:nth-child(1) { animation-delay: 0s; }
.eq.is-playing span:nth-child(2) { animation-delay: 0.15s; }
.eq.is-playing span:nth-child(3) { animation-delay: 0.3s; }
.eq.is-playing span:nth-child(4) { animation-delay: 0.1s; }
.eq.is-playing span:nth-child(5) { animation-delay: 0.25s; }
@keyframes eq-bounce {
  0%, 100% { height: 5px; }
  50% { height: 20px; }
}
.eq-static span { height: 10px; opacity: 0.6; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 44px 40px;
  width: 320px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.1),
    0 0 40px rgba(168, 85, 247, 0.35),
    0 0 80px rgba(255, 47, 211, 0.15),
    0 20px 60px rgba(0,0,0,0.6);
}
.login-box .eq { justify-content: center; margin: 0 auto 18px; }
.login-box h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--cyan), var(--purple-soft), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-box input {
  width: 100%;
  padding: 12px 14px;
  margin: 20px 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}
.login-box input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}
.login-box button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  color: #fff;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
}
.login-box button:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 0 30px rgba(255, 47, 211, 0.6); }
.error { color: var(--danger); margin-top: 12px; }

/* ---- Dashboard ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 4, 15, 0.55);
  backdrop-filter: blur(4px);
}
.brand { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.mode-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
}
.mode-badge.live { color: var(--cyan); border-color: rgba(0, 229, 255, 0.4); }
.mode-badge.live::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-text h1 .accent {
  background: linear-gradient(135deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.status-line {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  box-shadow: none;
}
.led-on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.led-off { background: #453a5c; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  padding: 28px 32px 60px;
  max-width: 1120px;
  margin: 0 auto;
}

.card {
  background: linear-gradient(180deg, rgba(16, 10, 30, 0.9) 0%, rgba(10, 6, 20, 0.75) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.05), 0 0 24px rgba(168, 85, 247, 0.08);
}
.card.wide { grid-column: 1 / -1; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-header h2 { margin: 0; }
.module-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--purple-soft);
  border-left: 2px solid var(--magenta);
  padding-left: 10px;
  text-shadow: 0 0 8px rgba(255, 47, 211, 0.4);
}
.header-actions { display: flex; gap: 8px; }

/* Buttons */
.btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-body);
  transition: all 0.15s;
}
.btn:hover { border-color: var(--purple); background: var(--panel-raised); box-shadow: 0 0 14px rgba(168, 85, 247, 0.3); }
.btn-pink {
  background: linear-gradient(135deg, var(--magenta), var(--purple));
  border-color: transparent;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
}
.btn-pink:hover { filter: brightness(1.15); box-shadow: 0 0 22px rgba(255, 47, 211, 0.55); }
.btn-outline { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.ghost-btn:hover { color: var(--cyan); border-color: var(--cyan); }

/* Add song from panel */
.add-song-row { display: flex; gap: 10px; margin-bottom: 14px; }
.add-song-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.add-song-row input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18); }
.add-song-row .btn { white-space: nowrap; }

/* Current song */
.current-song {
  background: var(--panel-alt);
  border-left: 3px solid var(--magenta);
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  box-shadow: -3px 0 12px -4px rgba(255, 47, 211, 0.5);
}

/* Queue */
.queue-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.queue-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.queue-list li:last-child { border-bottom: none; }
.queue-info { display: flex; flex-direction: column; overflow: hidden; gap: 2px; }
.queue-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.queue-meta { font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono); }
.queue-list li.queue-empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-icon {
  width: 34px; height: 34px;
  border: 2px solid var(--purple);
  border-radius: 50%;
  opacity: 0.6;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

.queue-list::-webkit-scrollbar { width: 8px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--magenta), var(--purple));
  border-radius: 4px;
}
.queue-list { scrollbar-width: thin; scrollbar-color: var(--purple) transparent; }
.queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bump-btn {
  border: none;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-size: 1.05rem;
  opacity: 0.8;
  transition: opacity 0.15s, transform 0.15s;
}
.bump-btn:hover { opacity: 1; transform: translateY(-2px); text-shadow: 0 0 8px var(--cyan); }
.remove-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.remove-btn:hover { opacity: 1; }

/* Controls */
.control-row { margin-bottom: 22px; }
.control-row:last-child { margin-bottom: 0; }
.control-row label { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 0.88rem; color: var(--muted); }
.readout {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-weight: 500;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}
.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--purple);
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(168, 85, 247, 0.2);
  outline: none;
}
.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 35% 35%, var(--cyan), var(--magenta) 70%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 18px rgba(255, 47, 211, 0.5);
}
.control-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 35% 35%, var(--cyan), var(--magenta) 70%);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 18px rgba(255, 47, 211, 0.5);
}
.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-row label:first-child { margin-bottom: 0; }

.switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
  position: absolute; cursor: pointer; inset: 0;
  background-color: #241a3d; border-radius: 24px; transition: 0.2s;
  border: 1px solid var(--border);
}
.slider-toggle::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 2px;
  background: radial-gradient(circle at 35% 35%, #fff, var(--purple-soft));
  border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider-toggle { background: linear-gradient(135deg, var(--magenta), var(--purple)); box-shadow: 0 0 14px rgba(168, 85, 247, 0.6); }
.switch input:checked + .slider-toggle::before { transform: translateX(22px); }

.ban-add { display: flex; gap: 8px; margin-bottom: 10px; }
.ban-add input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-family: var(--font-body);
}
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.chip-list li {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip-list li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 6px var(--magenta);
  flex-shrink: 0;
}
.chip-list button {
  background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.9rem;
}

/* Permissions table */
.perm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.perm-table th {
  text-align: left; color: var(--muted); font-weight: 500; padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.perm-table td { padding: 9px 4px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.85rem; }
.perm-table select {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.perm-table select:focus { outline: none; border-color: var(--purple); }

/* Aliases */
.aliases-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.alias-group {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
}
.alias-group h3 {
  margin: 0 0 9px; font-size: 0.72rem; color: var(--cyan);
  font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}
.alias-triggers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.alias-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  display: flex; align-items: center; gap: 6px;
}
.alias-chip button { background: none; border: none; color: var(--danger); cursor: pointer; }
.alias-add { display: flex; gap: 6px; }
.alias-add input {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.8rem;
  font-family: var(--font-body);
}
.alias-add input:focus { outline: none; border-color: var(--purple); }

@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; padding: 20px 18px 48px; }
  .aliases-body { grid-template-columns: 1fr; }
  .topbar { padding: 18px 20px; flex-wrap: wrap; gap: 12px; }
  .bg-wordmark { font-size: 26vw; }
}
