:root {
  --bg: #05070d;
  --bg-2: #0b0f1a;
  --card: #0e1322;
  --card-2: #151b2e;
  --border: #1f2740;
  --border-2: #2b3556;
  --text: #e8edf7;
  --muted: #8a94ad;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --accent: #5b8cff;
  --accent-soft: rgba(91, 140, 255, .14);
  --grad: linear-gradient(135deg, #22d3ee 0%, #3b82f6 50%, #8b5cf6 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --discord: #5865f2;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(900px 500px at 0% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(139, 92, 246, .12), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: #7dd3fc; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .9rem; margin: 1.3rem 0 .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: .5rem 0 0; }
.count { color: var(--muted); font-weight: 400; font-size: .9em; }
.grow { flex: 1; min-width: 0; }
.small-note { font-size: .85rem; margin-top: .4rem; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .6rem .75rem;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { color: var(--muted); }
label { display: block; font-size: .9rem; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: .3rem; color: var(--text); }
label small, .field small { display: block; margin-top: .3rem; font-size: .8rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: 10px;
  padding: .6rem 1rem; cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--text);
  transition: filter .15s, background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: var(--border-2); }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { background: rgba(248, 113, 113, .15); border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.btn.danger:hover { background: rgba(248, 113, 113, .25); }
.btn.discord { background: var(--discord); color: #fff; font-weight: 600; padding: .8rem 1rem; }
.btn.discord:hover { filter: brightness(1.1); }
.btn.discord svg { width: 22px; height: 22px; fill: currentColor; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card + .card, .card + form.card, form.card + .card, form.card + form.card, .stack > * + * { margin-top: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-head input { max-width: 240px; }
.row { display: flex; gap: .6rem; align-items: flex-end; }
.row + .row { margin-top: .7rem; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: var(--card-2); color: var(--muted); vertical-align: middle; }
.badge.premium { background: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(139, 92, 246, .25)); color: #e9d5ff; border: 1px solid rgba(139, 92, 246, .45); }
.badge.ok { background: rgba(52, 211, 153, .14); color: var(--ok); }
.badge.bad { background: rgba(248, 113, 113, .14); color: var(--danger); }
.badge.warn { background: rgba(251, 191, 36, .14); color: var(--warn); }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 440px; padding: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-logo { width: 100%; max-width: 320px; margin: 0 auto .5rem; }
.auth-card h1, .auth-card p { margin: 0; text-align: center; }
.pw-login { border: 1px solid var(--border); border-radius: 12px; padding: .2rem .9rem; }
.pw-login summary { cursor: pointer; padding: .6rem 0; color: var(--muted); font-size: .92rem; }
.pw-login[open] { padding-bottom: .9rem; }
.pw-login form { display: flex; flex-direction: column; gap: .8rem; }
.auth-foot { font-size: .85rem; }
.auth-foot a { color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.5rem;
  background: rgba(5, 7, 13, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-size: 1.1rem; letter-spacing: .04em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.user-chip { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .9rem; max-width: 200px; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem; border-radius: 99px; background: var(--card); border: 1px solid var(--border); font-size: .85rem; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.online .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.pill.connecting .dot { background: var(--warn); animation: pulse 1s infinite; }
.pill.error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.banner { margin: 1rem 1.5rem 0; padding: .8rem 1rem; border-radius: 12px; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; }
.warn-box { margin-bottom: 1rem; padding: .75rem 1rem; border-radius: 12px; background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .3); color: #fde68a; font-size: .92rem; }
.warn-box ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.info-box { padding: .75rem 1rem; border-radius: 12px; background: rgba(59, 130, 246, .08); border: 1px solid rgba(59, 130, 246, .3); font-size: .92rem; margin-bottom: 1rem; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 290px 1fr; gap: 1.25rem; padding: 1.25rem 1.5rem; max-width: 1400px; margin: 0 auto; align-items: start; }
.sidebar { position: sticky; top: 76px; display: flex; flex-direction: column; gap: .7rem; max-height: calc(100vh - 96px); }
.owner-nav { display: flex; flex-direction: column; gap: 2px; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.nav-item { text-align: left; background: none; border: 1px solid transparent; padding: .55rem .7rem; border-radius: 10px; cursor: pointer; color: var(--text); }
.nav-item:hover { background: var(--card-2); }
.nav-item.active { background: var(--accent-soft); border-color: rgba(91, 140, 255, .4); }
.section-title { font-weight: 600; }
.guild-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.guild-item { display: flex; align-items: center; gap: .65rem; padding: .45rem .55rem; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.guild-item:hover { background: var(--card-2); }
.guild-item.active { background: var(--accent-soft); border-color: rgba(91, 140, 255, .4); }
.guild-item.absent { opacity: .65; }
.guild-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-item .tag { font-size: .75rem; }
.guild-item .playing { color: var(--ok); }
.guild-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--card-2); font-weight: 600; font-size: .8rem; color: var(--muted); }
.guild-icon img { width: 100%; height: 100%; object-fit: cover; }
.guild-icon.large { width: 56px; height: 56px; border-radius: 16px; font-size: 1.2rem; }
.guild-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.guild-header h2 { margin: 0; }
.main { min-width: 0; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-icon { font-size: 2.5rem; }

.module-tabs { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.module-tab { flex: none; background: none; border: 0; padding: .55rem .85rem; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.module-tab:hover { color: var(--text); }
.module-tab.active { color: var(--text); border-bottom-color: var(--cyan); background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .07)); }

/* ---------- Musik ---------- */
.now-playing { background: linear-gradient(160deg, rgba(34, 211, 238, .12), rgba(139, 92, 246, .08) 50%, transparent 75%), var(--card); }
.now-label { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--muted); }
.now-title { font-size: 1.45rem; font-weight: 700; margin: .2rem 0; overflow-wrap: anywhere; }
.elapsed { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--cyan); border-radius: 2px; height: 30%; }
.eq.on i { animation: eq .9s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: .2s; }
.eq.on i:nth-child(3) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.ctrl { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--card-2); cursor: pointer; display: grid; place-items: center; }
.ctrl:hover { background: var(--accent-soft); border-color: var(--accent); }
.ctrl svg { width: 20px; height: 20px; fill: currentColor; }
.ctrl.small { width: 36px; height: 36px; }
#btnPause { width: 52px; height: 52px; background: var(--grad); border: 0; color: #fff; }
.loop-select { display: flex; align-items: center; gap: .35rem; color: var(--text); }
.loop-select svg { width: 18px; height: 18px; fill: var(--muted); }
.loop-select select { width: auto; margin: 0; padding: .4rem .5rem; }
.controls .leave { margin-left: auto; }
.volume { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.volume output { min-width: 3.5rem; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; padding: 0; height: 6px; border: 0; border-radius: 6px; background: linear-gradient(to right, var(--cyan) var(--fill, 25%), var(--card-2) var(--fill, 25%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
.add-form label { margin: 0; }
.queue, .library, .backup-list { list-style: none; margin: 0; padding: 0; }
.queue { counter-reset: q; }
.queue li, .library li, .backup-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem .4rem; border-top: 1px solid var(--border); }
.queue li:first-child, .library li:first-child, .backup-list li:first-child { border-top: 0; }
.queue li { counter-increment: q; }
.queue li::before { content: counter(q); width: 1.6rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.queue .empty-row::before { content: none; }
.q-main, .l-main { flex: 1; min-width: 0; }
.q-title, .l-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-meta, .l-meta { font-size: .8rem; color: var(--muted); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: .3rem .5rem; border-radius: 8px; white-space: nowrap; }
.icon-btn:hover { color: var(--danger); background: rgba(248, 113, 113, .1); }
.icon-btn.play:hover { color: var(--ok); background: rgba(52, 211, 153, .1); }

/* ---------- Modul-Formulare ---------- */
.module-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.module-head p { margin: .2rem 0 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { min-width: 0; }
.field.wide, .field[data-type=textarea], .field[data-type=list], .field[data-type=flags], .field[data-type=roles], .field[data-type=channels], .field[data-type=image] { grid-column: 1 / -1; }
.field > .label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); margin-bottom: .3rem; }
.field.locked { opacity: .6; }
.switch { display: flex; align-items: center; gap: .7rem; cursor: pointer; color: var(--text); font-size: .95rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; padding: 0; margin: 0; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border-2); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1; transition: transform .2s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }
.color-row { display: flex; gap: .5rem; }
.color-row input[type=color] { width: 52px; padding: .2rem; height: 42px; }
.picker { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .45rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.picker select { width: auto; min-width: 180px; padding: .35rem .5rem; border: 0; background: transparent; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .4rem .25rem .6rem; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border-2); font-size: .85rem; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 .2rem; font-size: 1rem; line-height: 1; }
.chip button:hover { color: var(--danger); }
.flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem .8rem; }
.flags label { display: flex; gap: .5rem; align-items: flex-start; color: var(--text); }
.flags input { width: auto; margin-top: .2rem; }
.list-items { display: flex; flex-direction: column; gap: .8rem; }
.list-item { border: 1px solid var(--border-2); border-radius: 12px; padding: .9rem 1rem; background: var(--bg-2); }
.list-item-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.list-item-head strong { flex: 1; }
.list-item .fields { gap: .8rem 1rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.form-actions .spacer { flex: 1; }
.preview-img { width: 100%; max-width: 640px; border-radius: 12px; border: 1px solid var(--border); display: block; margin-top: .6rem; background: var(--bg-2); min-height: 80px; }
.feed-status { font-size: .8rem; }

/* ---------- Premium ---------- */
.premium-hero { background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(139, 92, 246, .18)), var(--card); border-color: rgba(139, 92, 246, .35); }
.limit-table { width: 100%; border-collapse: collapse; margin-top: .6rem; }
.limit-table th, .limit-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
.limit-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.limit-table td:not(:first-child), .limit-table th:not(:first-child) { text-align: center; }

/* ---------- Bibliothek ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; padding: 1.75rem 1rem; border: 2px dashed var(--border-2); border-radius: var(--radius); color: var(--text); cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--cyan); background: rgba(34, 211, 238, .06); }
.dropzone input { display: none; }
.progress { height: 6px; background: var(--card-2); border-radius: 6px; margin-top: .75rem; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--grad); transition: width .2s; }

/* ---------- Einstellungen ---------- */
.settings { max-width: 900px; }
.settings h3 { margin-bottom: .75rem; }
.bot-card { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.bot-card img { width: 56px; height: 56px; border-radius: 50%; }
.bot-name { font-weight: 700; font-size: 1.1rem; }
.check { display: flex; align-items: flex-start; gap: .5rem; margin-top: .8rem; color: var(--text); }
.check input { width: auto; margin: .2rem 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin: .6rem 0 1rem; }
.form-grid .span-2 { grid-column: span 2; }

/* ---------- Dialog & Toast ---------- */
.dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); }
.dialog-card { width: 100%; max-width: 460px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--card-2); border: 1px solid var(--border-2); border-radius: 12px; padding: .7rem 1.1rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); }
.toast.error { border-color: var(--danger); color: #fecaca; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .topbar { padding: .6rem 16px; flex-wrap: wrap; }
  .user-chip span { display: none; }
  .layout { grid-template-columns: 1fr; padding: 1rem 16px; }
  .sidebar { position: static; max-height: 300px; }
  .banner { margin: 1rem 16px 0; }
  .fields, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .row { flex-wrap: wrap; }
  .row .btn { flex: 1; }
  .controls .leave { margin-left: 0; }
  .card-head input { max-width: none; }
}

/* ---------- Konto & Nutzer ---------- */
.center { text-align: center; }
.account-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.account-head h2 { margin: 0; }
.acc-avatar { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--border-2); }
.acc-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 0 0 1rem; }
.acc-facts div { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; }
.acc-facts dt { font-size: .8rem; color: var(--muted); }
.acc-facts dd { margin: .2rem 0 0; font-weight: 600; }
.danger-zone { border-color: rgba(248, 113, 113, .35); }
.table-wrap { overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.users-table th, .users-table td { padding: .6rem .5rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.users-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.users-table .u-cell { display: flex; align-items: center; gap: .55rem; }
.users-table .u-cell img { width: 28px; height: 28px; border-radius: 50%; }
.users-table .u-id { color: var(--muted); font-size: .78rem; }
.users-table td:last-child { text-align: right; }
@media (max-width: 900px) { .acc-facts { grid-template-columns: 1fr 1fr; } }
