:root {
  --bg: #0b0910;
  --surface: #14111c;
  --surface-2: #1b1726;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #eeebf6;
  --muted: #9a93ad;
  --faint: #6b6580;
  --accent: #8b5cf6;
  --accent-2: #c084fc;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 16px;
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(139, 92, 246, 0.16), transparent 70%),
    radial-gradient(500px 380px at 20% 110%, rgba(192, 132, 252, 0.08), transparent 70%);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar); z-index: 10;
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 14px;
  background: rgba(16, 13, 23, 0.85);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font: 700 19px "Space Grotesk", sans-serif; color: #fff;
  box-shadow: 0 6px 20px -6px rgba(139, 92, 246, 0.7);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-title { font: 700 16px "Space Grotesk", sans-serif; }
.brand-sub { font-size: 12px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a.active svg { color: var(--accent-2); }
.nav-live {
  display: none; margin-left: auto; font-style: normal;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 6px; background: var(--red); color: #fff;
}
.nav-live.on { display: inline-block; }

.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); }
.foot-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.foot-links a {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--muted);
}
.foot-links a:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Main ---------- */
.main {
  position: relative; z-index: 1;
  margin-left: var(--sidebar);
  padding: 34px 40px 60px;
  max-width: calc(1280px + var(--sidebar));
}
.view { display: none; flex-direction: column; gap: 20px; animation: fade .25s ease; }
.view.active { display: flex; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.eyebrow {
  margin: 0 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: var(--accent-2);
}
.updated { font-size: 12px; color: var(--faint); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { margin: 10px 0 -4px; }
.link { font-size: 13px; color: var(--accent-2); }
.link:hover { text-decoration: underline; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
#dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  transition: border-color .15s, transform .15s;
}
a.tile:hover { border-color: rgba(139, 92, 246, 0.5); transform: translateY(-2px); }
.tile-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tile-value { font: 600 24px "Space Grotesk", sans-serif; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Status ---------- */
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
.dot.off { background: var(--red); }
.dot.idle { background: var(--amber); }
.dot.dnd { background: var(--red); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.pill.on { background: rgba(52, 211, 153, .12); color: var(--green); }
.pill.off { background: rgba(248, 113, 113, .12); color: var(--red); }
.pill.neutral { background: rgba(255, 255, 255, .06); color: var(--muted); }
.pill.live { background: var(--red); color: #fff; }

/* ---------- Live-Hero ---------- */
.hero {
  display: flex; gap: 22px; align-items: center;
  padding: 16px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .04));
  border: 1px solid rgba(139, 92, 246, .35);
}
.hero img { width: 280px; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; flex: none; }
.hero-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.hero-body h2 { font-size: 21px; }
.hero-meta { color: var(--muted); font-size: 13.5px; }
.btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }

/* ---------- Twitch ---------- */
.channel-card { display: flex; align-items: center; gap: 16px; }
.channel-card img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--accent); }
.channel-card p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.player-wrap:empty { display: none; }
.player-wrap iframe {
  width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius);
  background: #000; display: block;
}
.offline-box {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  aspect-ratio: 21/7; border-radius: var(--radius); color: var(--muted);
  background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 12px, var(--surface-2) 12px, var(--surface-2) 24px);
  border: 1px solid var(--border);
}
.offline-box strong { color: var(--text); font-size: 17px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.media {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.media:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, .5); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute; bottom: 8px; right: 8px; font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75);
}
.media-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.media-title { font-weight: 600; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-meta { font-size: 12.5px; color: var(--faint); }

.mini-list { display: flex; flex-direction: column; gap: 10px; }
.mini { display: flex; gap: 12px; align-items: center; padding: 6px; margin: -6px; border-radius: 10px; }
.mini:hover { background: rgba(255, 255, 255, .03); }
.mini img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; flex: none; }
.mini div { min-width: 0; }
.mini .media-title { -webkit-line-clamp: 1; }

/* ---------- Ranglisten ---------- */
.rank { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: grid; grid-template-columns: 24px 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.rank-pos { color: var(--faint); font-weight: 600; font-size: 13px; text-align: right; }
.rank-row:nth-child(1) .rank-pos { color: var(--accent-2); }
.rank-name { min-width: 0; }
.rank-name span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rank-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.goal { margin-bottom: 16px; }
.goal:last-child { margin-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; }
.goal-top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal .bar { height: 10px; border-radius: 6px; }
.goal .bar i { border-radius: 6px; }

.emote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.emote {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.emote img { width: 44px; height: 44px; object-fit: contain; }
.emote b { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emote small { color: var(--muted); font-size: 12px; }

/* ---------- Bots & Gameserver ---------- */
.status-card { display: flex; flex-direction: column; gap: 16px; }
.status-top { display: flex; align-items: center; gap: 14px; }
.status-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-2); overflow: hidden;
}
.status-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.status-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.status-top h3 { font-size: 17px; }
.status-top p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.status-top .pill { margin-left: auto; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border-radius: 11px; padding: 10px 12px; min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.players-bar { display: flex; flex-direction: column; gap: 7px; }
.players-bar .goal-top { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.chip img { width: 20px; height: 20px; border-radius: 5px; image-rendering: pixelated; }
.copy {
  display: inline-flex; align-items: center; gap: 8px; font: 500 13px ui-monospace, Consolas, monospace;
  padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong);
  color: var(--text); cursor: pointer; align-self: flex-start;
}
.copy:hover { border-color: var(--accent); }

/* ---------- Discord ---------- */
.discord-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.discord-head h2 { font-size: 22px; }
.discord-head .btn { margin-left: auto; background: #5865f2; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: var(--surface-2); min-width: 0; }
.member .av { position: relative; flex: none; }
.member .av img { width: 34px; height: 34px; border-radius: 50%; display: block; }
.member .av .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid var(--surface-2); animation: none; box-shadow: none; }
.member div { min-width: 0; }
.member b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Setup ---------- */
.setup-list { display: flex; flex-direction: column; }
.setup-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.setup-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setup-row span { color: var(--muted); }
.setup-row b { font-weight: 600; text-align: right; }
.setup-row a { color: var(--accent-2); }

/* ---------- Hinweise ---------- */
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.notice {
  font-size: 13.5px; color: var(--muted); padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.notice code { color: var(--accent-2); }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero img { width: 200px; }
}
@media (max-width: 860px) {
  #dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar {
    top: auto; right: 0; width: auto; height: auto; flex-direction: row;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border);
  }
  .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; overflow-x: auto; }
  .nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 10px; flex: 1; min-width: 0; white-space: nowrap; }
  .nav a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a.active::before { display: none; }
  .nav-live { position: absolute; top: 2px; right: 6px; margin: 0; padding: 0; width: 8px; height: 8px; font-size: 0; border-radius: 50%; }
  .main { margin-left: 0; padding: 22px 16px 100px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: stretch; }
  .hero img { width: 100%; }
  h1 { font-size: 25px; }
}

/* ---------- Clip-Liste ---------- */
.clip-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.clip-count { font: 500 14px Inter, sans-serif; color: var(--muted); margin-left: 6px; }
.clip-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.clip-controls input, .clip-controls select {
  height: 38px; padding: 0 12px; border-radius: 10px; font: 500 14px Inter, sans-serif;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); outline: none;
}
.clip-controls input { width: 230px; }
.clip-controls select { cursor: pointer; padding-right: 8px; }
.clip-controls select option { background: var(--surface-2); }
.clip-controls input:focus, .clip-controls select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.more-btn { align-self: center; }
.more-btn[hidden] { display: none; }
@media (max-width: 860px) {
  .clip-controls, .clip-controls input, .clip-controls select { width: 100%; }
}

/* ---------- Clip im Player ---------- */
.player-wrap { scroll-margin-top: 20px; }
.player-wrap iframe + .clip-info { margin-top: 12px; }
.clip-info {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
}
.clip-info > div { flex: 1; }
.clip-info .media-title { -webkit-line-clamp: 1; }
.clip-info .btn { padding: 8px 14px; flex: none; }
.media.playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -10px rgba(139, 92, 246, .6); }
.media.playing .thumb::after {
  content: "▶ Läuft"; position: absolute; top: 8px; left: 8px; font-size: 11.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff;
}
@media (max-width: 860px) {
  .clip-info { flex-wrap: wrap; }
  .clip-info > div { flex-basis: 100%; }
}

/* ---------- Bot-Dashboard-Link ---------- */
.bot-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding: 11px 14px; border-radius: 11px;
  background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .35);
  font-weight: 600; font-size: 14px; color: #fff; transition: background .15s, border-color .15s;
}
.bot-link:hover { background: rgba(139, 92, 246, .24); border-color: var(--accent); }
.bot-link-host { font-weight: 500; font-size: 13px; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
