/* GIAR-Digital-Markenfarben: Navy #0c1525, GIAR-Blau #61AEFA; Schriften Syne (Marke) und Manrope (Text) */
:root {
  --bg: #0c1525;
  --bg-2: #0f1a2d;
  --card: #111e30;
  --card-2: #18283f;
  --line: #22344e;
  --text: #f0f6fc;
  --muted: #9fb0c6;
  --faint: #6a7d96;
  --accent: #61aefa;
  --accent-2: #93c5fd;
  --accent-soft: rgba(97, 174, 250, 0.16);
  --on-accent: #06101e;
  --brand-strong: #f0f6fc;
  --danger: #f05252;
  --ok: #34d399;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --font-brand: "Syne", "Manrope", system-ui, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f7fc;
    --bg-2: #e8eff8;
    --card: #ffffff;
    --card-2: #eef4fb;
    --line: #d9e4f0;
    --text: #0c1525;
    --muted: #4f6079;
    --faint: #8394ab;
    --accent: #2b7fd6;
    --accent-2: #1f6dbf;
    --accent-soft: rgba(43, 127, 214, 0.1);
    --on-accent: #ffffff;
    --brand-strong: #0c1525;
    --shadow: 0 8px 24px rgba(12, 21, 37, 0.08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
code { background: var(--card-2); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
h1, h2 { margin: 0; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: 0.01em; }
svg { display: block; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  max-width: 420px; text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px 28px; box-shadow: var(--shadow);
}
.login-card h1 { font: 700 24px/1.2 var(--font-brand); margin: 14px 0 8px; }
.login-card p { color: var(--muted); margin: 0; }
.logo { display: block; width: 72px; height: 72px; margin: 0 auto; filter: drop-shadow(0 0 18px rgba(97, 174, 250, 0.3)); }
.brand-name b { color: var(--brand-strong); font-weight: 800; }
.brand-name span { color: var(--accent); font-weight: 700; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font: 700 17px/1 var(--font-brand); letter-spacing: 0.01em; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; }
.guild-picker { display: flex; align-items: center; gap: 8px; min-width: 0; }
.guild-picker img { width: 24px; height: 24px; border-radius: 50%; }
.guild-picker select {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; max-width: 220px;
}
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-left: auto; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.conn.live .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.me { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.me img { width: 28px; height: 28px; border-radius: 50%; }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px;
  max-width: 1280px; margin: 0 auto; padding: 20px;
}
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.head-actions { display: flex; gap: 6px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius-sm); padding: 9px 16px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.ghost {
  background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer;
  text-decoration: none; color: var(--muted);
}
.ghost:hover { color: var(--text); border-color: var(--faint); }
.ghost.small, .small { font-size: 13px; padding: 4px 10px; }
.ghost.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.primary { width: 56px; height: 56px; background: var(--accent); color: var(--on-accent); }
.icon-btn.primary:hover { background: var(--accent-2); }
.icon-btn.active { color: var(--accent-2); background: var(--accent-soft); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.primary svg { width: 26px; height: 26px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.icon-btn .badge {
  position: absolute; font-size: 9px; font-weight: 800; transform: translate(9px, 8px);
}
.icon-btn { position: relative; }

/* ---------- Now playing ---------- */
.np-top { display: flex; gap: 18px; align-items: center; }
.art {
  width: 132px; height: 132px; flex: none; border-radius: 14px; overflow: hidden; background: var(--card-2);
  position: relative; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.art img { width: 100%; height: 100%; object-fit: cover; }
.art-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.art-empty img { width: 58%; height: 58%; opacity: 0.45; }
.art.has-img .art-empty { display: none; }
.art:not(.has-img) > img { display: none; }
.np-info { min-width: 0; flex: 1; }
.np-status { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-2); font-weight: 700; }
.np-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 20px; font-weight: 700; text-decoration: none; margin: 4px 0 2px; line-height: 1.25;
}
a.np-title[href]:hover { text-decoration: underline; }
.np-author { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  background: var(--card-2); border-radius: 999px; padding: 3px 10px 3px 4px;
}
.chip.plain { padding: 3px 10px; }
.chip img { width: 18px; height: 18px; border-radius: 50%; }

.progress { display: flex; align-items: center; gap: 12px; margin: 20px 0 8px; }
.time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 40px; }
.time:last-child { text-align: right; }
.bar { position: relative; flex: 1; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.bar-track { width: 100%; height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.bar-knob {
  position: absolute; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--text);
  transform: translateX(-50%); opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.bar:hover .bar-knob, .bar.dragging .bar-knob { opacity: 1; }
.bar.disabled { cursor: default; }
.bar.disabled .bar-knob { display: none; }
.bar-tip {
  position: absolute; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  font-size: 11px; padding: 2px 6px; border-radius: 6px; pointer-events: none; font-variant-numeric: tabular-nums;
}
.controls { display: flex; justify-content: center; align-items: center; gap: 10px; }
.np-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.volume { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 300px; }
.volume input { flex: 1; accent-color: var(--accent); }
.volume-val { font-size: 12px; color: var(--muted); min-width: 40px; font-variant-numeric: tabular-nums; }

/* ---------- Hinzufügen / Suche ---------- */
.add-row {
  display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px 4px 4px 12px;
}
.add-row:focus-within { border-color: var(--accent); }
.add-icon { color: var(--faint); display: grid; }
.add-icon svg { width: 18px; height: 18px; }
#add-input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 8px 0; font-size: 15px; }
.add-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--faint); margin: 10px 0 0; }
.results:not(:empty) { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.results .loading, .results .none { color: var(--muted); font-size: 14px; padding: 10px 4px; }

/* ---------- Titellisten ---------- */
.tracks { list-style: none; margin: 0; padding: 0; }
.track {
  display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 6px 6px; border-radius: 10px; position: relative;
}
.track:hover { background: var(--card-2); }
.track .idx { width: 22px; text-align: right; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.track .grip { cursor: grab; color: var(--faint); display: grid; place-items: center; width: 22px; touch-action: none; }
.track .grip svg { width: 16px; height: 16px; }
.track .grip:hover { color: var(--text); }
.track .lead { display: flex; align-items: center; }
.track .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--card-2); }
.track .meta { min-width: 0; }
.track .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.track .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.track .a img { width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.track .d { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track .acts { display: flex; gap: 2px; opacity: 0.35; transition: opacity 0.15s; }
.track:hover .acts, .track:focus-within .acts { opacity: 1; }
.track .acts .icon-btn { width: 32px; height: 32px; }
.track .acts .icon-btn svg { width: 17px; height: 17px; }
.track .acts .icon-btn.del:hover { color: var(--danger); }
.track.dragging { background: var(--card-2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); z-index: 2; opacity: 0.95; }
.track.dragging .grip { cursor: grabbing; }
.tracks.sorting .track:not(.dragging) { transition: transform 0.12s; }
.live { color: var(--danger); font-weight: 700; font-size: 11px; letter-spacing: 0.05em; }
.src { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-left: 6px; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; font-size: 14px; }
.history summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.history summary::before { content: '▸'; color: var(--faint); transition: transform 0.15s; }
.history details[open] summary::before { transform: rotate(90deg); }
.history details[open] summary { margin-bottom: 10px; }
.queue .tracks { max-height: calc(100vh - 230px); overflow: auto; margin: 0 -6px; padding: 0 6px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(440px, calc(100vw - 32px)); }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow); animation: toast-in 0.2s ease-out;
}
.toast.error { background: var(--danger); color: white; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Mobil ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .queue .tracks { max-height: none; }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 16px; gap: 10px; flex-wrap: wrap; }
  .brand-name, .me span, .conn-label { display: none; }
  .guild-picker select { max-width: 160px; }
  .card { padding: 14px; }
  .art { width: 96px; height: 96px; }
  .np-title { font-size: 17px; }
  .track { grid-template-columns: auto 40px minmax(0, 1fr) auto; gap: 8px; }
  .track .d { display: none; }
  .track .thumb { width: 40px; height: 40px; }
  .track .acts { opacity: 1; }
  .track .acts .icon-btn.opt { display: none; }
}
