:root {
  --bg: #0c0509;
  --bg-glow-a: #4a0e2c;
  --bg-glow-b: #1f0512;
  --panel: #170a12;
  --panel-alt: #22101b;
  --panel-raised: #2c1522;
  --pink: #ff2f74;
  --pink-soft: #ff8fb8;
  --wine: #7a1a3d;
  --live: #ffcf6b;
  --text: #fbeef2;
  --muted: #b5899b;
  --border: rgba(255, 143, 184, 0.12);
  --border-bright: rgba(255, 47, 116, 0.4);
  --danger: #ff4d6d;

  --font-display: 'Bebas Neue', '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;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23ff2f74' fill-opacity='0.035'%3E%3Cellipse cx='20' cy='30' rx='5' ry='4'/%3E%3Cellipse cx='15' cy='23' rx='1.8' ry='2.4'/%3E%3Cellipse cx='19' cy='20' rx='1.8' ry='2.4'/%3E%3Cellipse cx='23' cy='20' rx='1.8' ry='2.6'/%3E%3Cellipse cx='26.5' cy='23.5' rx='1.6' ry='2.2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-glow-a) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 90% 100%, var(--bg-glow-b) 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

@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(--pink); }
code {
  font-family: var(--font-mono);
  background: var(--panel-alt);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---- Kot orientalny (ikonka + dekoracyjne tło) ---- */
.icon-cat {
  width: 44px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(255, 47, 116, 0.35));
}
.icon-cat-small { width: 34px; height: 29px; }
.login-box .icon-cat { width: 56px; height: 48px; margin: 0 auto 14px; display: block; }

.corner-ears {
  position: fixed;
  width: 260px;
  height: auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
.corner-ears-left { top: -60px; left: -60px; transform: rotate(-8deg); }
.corner-ears-right { top: -60px; right: -60px; transform: rotate(8deg) scaleX(-1); }

/* ---- Equalizer signature element ---- */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}
.eq span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--pink), var(--wine));
  height: 6px;
  transition: height 0.25s ease;
}
.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.5; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 44px 40px;
  width: 320px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 61, 129, 0.18), 0 20px 60px rgba(0,0,0,0.5);
}
.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: 2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  -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(--pink);
  box-shadow: 0 0 0 3px rgba(255, 61, 129, 0.15);
}
.login-box button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--wine));
  color: #fff;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
}
.login-box button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.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);
}
.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.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.35);
  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(--live); border-color: rgba(255, 207, 107, 0.35); }
.mode-badge.live::before { background: var(--live); box-shadow: 0 0 8px var(--live); }
.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.brand-text h1 .accent {
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  -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(--live); box-shadow: 0 0 8px var(--live); }
.led-off { background: #4a4458; }

.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, var(--panel) 0%, rgba(22, 16, 34, 0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  backdrop-filter: blur(6px);
}
.card.wide { grid-column: 1 / -1; }
.chat-card { display: flex; flex-direction: column; padding-bottom: 14px; }
.chat-frame-wrap {
  flex: 1;
  min-height: 420px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-alt);
}
.chat-frame { width: 100%; height: 100%; min-height: 420px; display: block; color-scheme: dark; }

.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(--wine);
  border-left: 2px solid var(--pink);
  padding-left: 10px;
}
.paw-tag {
  width: 14px; height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  opacity: 0.85;
}
.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(--pink); background: var(--panel-raised); }
.btn-pink {
  background: linear-gradient(135deg, var(--pink), var(--wine));
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}
.btn-pink:hover { filter: brightness(1.1); }
.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(--pink); border-color: var(--pink); }

/* 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(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 129, 0.12); }
.add-song-row .btn { white-space: nowrap; }

/* Current song */
.current-song {
  background: var(--panel-alt);
  border-left: 3px solid var(--pink);
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

/* 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;
  transition: transform 0.35s ease;
}
.queue-list li.entering {
  animation: queue-item-enter 0.35s ease;
}
@keyframes queue-item-enter {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.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: 8px;
}
.empty-cat { width: 46px; height: 40px; opacity: 0.55; }

.queue-list::-webkit-scrollbar { width: 8px; }
.queue-list::-webkit-scrollbar-track { background: transparent; }
.queue-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pink), var(--wine));
  border-radius: 4px;
}
.queue-list { scrollbar-width: thin; scrollbar-color: var(--pink) transparent; }
.queue-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.bump-btn {
  border: none;
  background: transparent;
  color: var(--live);
  cursor: pointer;
  font-size: 1.05rem;
  opacity: 0.75;
  transition: opacity 0.15s, transform 0.15s;
}
.bump-btn:hover { opacity: 1; transform: translateY(-2px); }
.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(--pink);
  font-weight: 500;
}
.control-row input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 143, 184, 0.15);
  outline: none;
}
.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='16' rx='6' ry='5' fill='%23ff2f74'/%3E%3Cellipse cx='5' cy='8' rx='2.2' ry='3' fill='%23ff2f74'/%3E%3Cellipse cx='10' cy='4.5' rx='2.2' ry='3' fill='%23ff2f74'/%3E%3Cellipse cx='15' cy='4.5' rx='2.2' ry='3.2' fill='%23ff2f74'/%3E%3Cellipse cx='19.5' cy='8.5' rx='2' ry='2.8' fill='%23ff2f74'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 47, 116, 0.6));
}
.control-row input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='16' rx='6' ry='5' fill='%23ff2f74'/%3E%3Cellipse cx='5' cy='8' rx='2.2' ry='3' fill='%23ff2f74'/%3E%3Cellipse cx='10' cy='4.5' rx='2.2' ry='3' fill='%23ff2f74'/%3E%3Cellipse cx='15' cy='4.5' rx='2.2' ry='3.2' fill='%23ff2f74'/%3E%3Cellipse cx='19.5' cy='8.5' rx='2' ry='2.8' fill='%23ff2f74'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
.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: #332c47; border-radius: 24px; transition: 0.2s;
}
.slider-toggle::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; border-radius: 50%; transition: 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='16' rx='6' ry='5' fill='%23170a12'/%3E%3Cellipse cx='5' cy='8' rx='2.2' ry='3' fill='%23170a12'/%3E%3Cellipse cx='10' cy='4.5' rx='2.2' ry='3' fill='%23170a12'/%3E%3Cellipse cx='15' cy='4.5' rx='2.2' ry='3.2' fill='%23170a12'/%3E%3Cellipse cx='19.5' cy='8.5' rx='2' ry='2.8' fill='%23170a12'/%3E%3C/svg%3E");
  background-size: 65%;
  background-repeat: no-repeat;
  background-position: center;
}
.switch input:checked + .slider-toggle { background: linear-gradient(135deg, var(--pink), var(--wine)); }
.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: 12px; height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cellipse cx='12' cy='16' rx='6' ry='5' fill='%23ff8fb8'/%3E%3Cellipse cx='5' cy='8' rx='2.2' ry='3' fill='%23ff8fb8'/%3E%3Cellipse cx='10' cy='4.5' rx='2.2' ry='3' fill='%23ff8fb8'/%3E%3Cellipse cx='15' cy='4.5' rx='2.2' ry='3.2' fill='%23ff8fb8'/%3E%3Cellipse cx='19.5' cy='8.5' rx='2' ry='2.8' fill='%23ff8fb8'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  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(--pink); }

/* 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(--live);
  font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.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(--pink); }

@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; }
}
