:root {
  --bg: #0b0816;
  --bg-2: #120c24;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f2eefc;
  --muted: #a79cc4;
  --purple: #8b5cf6;
  --pink: #ff2fb3;
  --green: #7CFF6B;
  --cyan: #38e8ff;
  --grad: linear-gradient(135deg, var(--purple), var(--pink));
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f3ff;
    --bg-2: #ebe4ff;
    --panel: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(90, 60, 160, 0.12);
    --text: #1a1330;
    --muted: #5d5478;
    --shadow: 0 10px 30px rgba(90, 60, 160, 0.12);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(139, 92, 246, 0.35), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(255, 47, 179, 0.25), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--green); }

/* Kopfzeile */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 8, 22, 0.55);
  border-bottom: 1px solid var(--panel-border);
}
@media (prefers-color-scheme: light) {
  .topbar { background: rgba(255, 255, 255, 0.6); }
}
.brand {
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: .02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand:hover { color: transparent; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s ease, color .2s ease;
}
.topbar nav a:hover { background: var(--panel); color: var(--green); }
.topbar nav a.cta {
  background: var(--grad);
  color: #fff;
}
.topbar nav a.cta:hover { filter: brightness(1.1); color: #fff; }

/* Hero */
.hero {
  text-align: center;
  padding: 72px 20px 48px;
  animation: fadeUp .8s ease both;
}
.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(124, 255, 107, 0.1);
  border: 1px solid rgba(124, 255, 107, 0.3);
}
.hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* Container & Abschnitte */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px 64px; }
h2 { font-size: 1.4rem; margin: 0 0 16px; }

/* Listen-Tabs */
.list-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.list-tabs button {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.list-tabs button:hover { transform: translateY(-1px); border-color: var(--purple); }
.list-tabs button.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 47, 179, 0.3);
}

/* Level-Karten */
.level-list { display: grid; gap: 12px; }
.level {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeUp .5s ease both;
  transition: transform .2s ease, border-color .2s ease;
}
.level:hover { transform: translateY(-2px); border-color: rgba(56, 232, 255, 0.4); }
.rank {
  display: grid;
  place-items: center;
  height: 52px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 1.2rem;
  color: #0b0816;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}
.level:nth-child(1) .rank { background: linear-gradient(135deg, #ffe066, #ff9f1c); }
.level:nth-child(2) .rank { background: linear-gradient(135deg, #e0e6ff, #9aa8d6); }
.level:nth-child(3) .rank { background: linear-gradient(135deg, #ffb38a, #ff5e8a); }
.level h3 { margin: 0 0 2px; font-size: 1.1rem; }
.level p { margin: 0; color: var(--muted); font-size: .92rem; }
.status { color: var(--muted); padding: 24px 0; text-align: center; }

/* Einreichen-Seite */
.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}
.card p { color: var(--muted); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .hero { padding: 48px 16px 32px; }
  .container { padding: 0 16px 48px; }
  .level { grid-template-columns: 52px 1fr; padding: 14px; }
  .rank { height: 44px; }
}

/* Logo in der Kopfzeile */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(56, 232, 255, 0.35);
}

/* Verifizierung */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(255, 47, 179, 0.3);
  transition: transform .15s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); color: #fff; }
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--green);
  background: rgba(124, 255, 107, 0.08);
  border: 1px dashed rgba(124, 255, 107, 0.4);
  border-radius: 12px;
  padding: 12px 18px;
  display: inline-block;
}
.hint { color: var(--muted); font-size: .9rem; }
.card h2 { margin-top: 0; }

/* Discord-Button */
.topbar nav a.discord {
  color: #fff;
  background: #5865F2;
}
.topbar nav a.discord:hover { background: #4752c4; color: #fff; }
.hero-actions { margin-top: 22px; }
.hero-actions .btn { background: #5865F2; box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35); }

/* ---------- Verwaltung ---------- */
.admin-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.admin-grid h2 { margin-top: 0; }
.admin-grid h3 { margin: 22px 0 10px; font-size: 1rem; }
.role-list { display: grid; gap: 8px; margin-bottom: 8px; }
.role-row, .member {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,0.02);
}
.role-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.role-info small { color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 10px currentColor; }
.role-form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 600; }
.role-form input[type="text"], .role-form input:not([type]), .search {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px;
}
.role-form input[type="color"] { width: 64px; height: 40px; border: 0; background: none; padding: 0; cursor: pointer; }
.role-form fieldset { border: 1px solid var(--panel-border); border-radius: 12px; margin: 0 0 16px; padding: 12px; }
.role-form legend { font-weight: 700; padding: 0 6px; }
.check { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin-bottom: 10px; }
.check small { color: var(--muted); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.ghost { background: transparent; border: 1px solid var(--panel-border); box-shadow: none; color: var(--text); }
.search { width: 100%; margin-bottom: 14px; }
.results { display: grid; gap: 10px; }
.member img { border-radius: 50%; flex: none; }
.member-body { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn {
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  color: var(--text); background: transparent;
  border: 1px solid var(--panel-border); border-radius: 999px; padding: 5px 11px;
  transition: background .2s ease, border-color .2s ease;
}
.chip-btn:hover { border-color: var(--purple); }
.chip-btn.on { background: color-mix(in srgb, var(--c, var(--purple)) 25%, transparent); border-color: var(--c, var(--purple)); }
.chip-btn.danger { color: #ff7a9c; }
.chip-btn.danger:hover { border-color: #ff7a9c; }

/* ---------- Listen, Einreichen, Moderation ---------- */
a.level-link { color: inherit; text-decoration: none; display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 16px; }
a.level-link:hover { color: inherit; }
.level-detail { display: grid; gap: 22px; }
@media (min-width: 720px) { .level-detail { grid-template-columns: 320px 1fr; align-items: start; } }
.level-img { width: 100%; border-radius: 14px; border: 1px solid var(--panel-border); object-fit: cover; aspect-ratio: 16 / 9; }
.level-meta h1 { margin: 6px 0 8px; font-size: 1.8rem; }
.level-meta p { margin: 4px 0; color: var(--muted); }
.records { display: grid; gap: 8px; margin-top: 12px; }
.record-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); }
.tabs-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs-row .chip-btn { font-size: .95rem; padding: 8px 16px; }
.tabs-row .chip-btn.on { background: var(--grad); border-color: transparent; color: #fff; }
.queue { display: grid; gap: 14px; margin: 12px 0 26px; }
.queue-item { display: flex; gap: 16px; align-items: flex-start; }
.queue-item .thumb { width: 160px; height: 90px; object-fit: cover; border-radius: 10px; flex: none; }
.queue-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.queue-body small { color: var(--muted); }
.queue-body .form-actions { margin-top: 8px; align-items: center; }
.inline { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.inline input { width: 90px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 10px; }
.danger-btn { color: #ff7a9c !important; }
.rank-mini { font-weight: 900; color: var(--accent, #f5b400); min-width: 36px; }
.hook-row { display: flex; gap: 8px; align-items: center; }
.hook-row input { flex: 1; }
.role-form select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }
.role-form input[type="file"] { color: var(--muted); }
.role-form input[type="number"] { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }
@media (max-width: 600px) { .queue-item { flex-direction: column; } .queue-item .thumb { width: 100%; height: auto; aspect-ratio: 16/9; } }

/* ---------- Profil-Menü ---------- */
.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: inherit; font-weight: 700; color: var(--text); cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 4px 14px 4px 4px;
  transition: border-color .2s ease, transform .15s ease;
}
.user-btn:hover { border-color: var(--purple); transform: translateY(-1px); }
.user-btn img { border-radius: 50%; display: block; }
.user-btn span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 20;
  min-width: 230px; display: flex; flex-direction: column; padding: 8px;
  background: var(--bg-2); border: 1px solid var(--panel-border);
  border-radius: 14px; box-shadow: var(--shadow);
  animation: fadeUp .18s ease both;
}
.user-dropdown[hidden] { display: none; }
.user-dropdown a, .user-dropdown .ud-logout {
  font: inherit; color: var(--text); text-align: left; background: none; border: 0;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; text-decoration: none;
}
.user-dropdown a:hover, .user-dropdown .ud-logout:hover { background: var(--panel); color: var(--green); }
.user-dropdown .ud-logout { color: #ff7a9c; }
.ud-head { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--panel-border); margin-bottom: 6px; }
.ud-head small { color: var(--muted); }
.btn.small { padding: 8px 16px; font-size: .9rem; }
.settings-card { margin-bottom: 18px; }
.settings-card h2, .settings-card h3 { margin-top: 0; }
.profile { display: flex; align-items: center; gap: 18px; }
.profile img { border-radius: 50%; border: 2px solid var(--purple); }
.profile h2 { margin: 0 0 4px; }
.perm-list { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.perm-list li { margin-bottom: 6px; }
@media (max-width: 600px) { .user-btn span { display: none; } .user-btn { padding: 3px; } }

/* ---------- Layout mit Seitenleiste ---------- */
.page-grid { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .page-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.page-grid .main-col { padding: 0; max-width: none; }
.sidebar { display: grid; gap: 16px; }
.side-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.side-card .hint { margin: 0 0 14px; }
.btn.full { display: block; text-align: center; width: 100%; box-sizing: border-box; }
.btn.discord { background: #5865F2; box-shadow: 0 6px 20px rgba(88,101,242,.35); }
.search { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 11px 14px; margin: 4px 0 16px; }
.list-tabs button { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.list-tabs button small { font-size: .72rem; font-weight: 600; opacity: .75; margin-top: 2px; }

/* Level-Karten mit Bild und Punkten */
.level { grid-template-columns: 96px 1fr; }
.level .thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--panel-border); }
.level .rank { height: 54px; }
.level-text h3 { margin-bottom: 4px; }
.level-text h3 .pos { color: var(--accent, #f5b400); margin-right: 4px; }
.level-text .points { color: var(--green); font-weight: 700; }
@media (max-width: 600px) { .level { grid-template-columns: 72px 1fr; } .level .thumb { width: 72px; height: 42px; } }

/* Level-Detail */
.level-hero { display: grid; gap: 22px; margin-bottom: 18px; }
@media (min-width: 720px) { .level-hero { grid-template-columns: 320px 1fr; align-items: center; } }
.points-big { font-size: 1.6rem; font-weight: 900; color: var(--green); margin: 10px 0; }
.points-big span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.info-grid { display: grid; gap: 18px; margin-bottom: 18px; }
@media (min-width: 720px) { .info-grid { grid-template-columns: 1fr 1fr; } }
.info-grid h2, .card h2 { margin-top: 0; font-size: 1.2rem; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--panel-border); }
.info-table th { color: var(--muted); font-weight: 600; width: 45%; }
.info-table td { font-weight: 700; text-align: right; }
.video-box { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--panel-border); display: grid; place-items: center; }
.video-box .hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; margin: 0; font-size: .8rem; }
.video-play { width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.6rem; color: #fff; background: var(--grad); box-shadow: 0 10px 30px rgba(255,47,179,.4); transition: transform .15s ease; }
.video-play:hover { transform: scale(1.06); }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Regeln */
.rules ol { padding-left: 22px; margin: 0; display: grid; gap: 12px; }
.rules li { color: var(--text); }
.rules li strong { color: var(--accent, #f5b400); }
.rules-hint { margin: 0 0 14px; }

/* Statistik */
.table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; min-width: 460px; }
.stats-table th, .stats-table td { padding: 11px 8px; text-align: left; border-bottom: 1px solid var(--panel-border); }
.stats-table th { color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .rank-cell { font-weight: 900; color: var(--accent, #f5b400); width: 48px; }
.stats-table tbody tr:hover { background: rgba(255,255,255,.03); }

/* ---------- Überarbeitung Listen-Layout (flexibel, Solar-Flare-Stil) ---------- */
/* Hauptspalte füllt die Breite aus (auto-Ränder hatten sie schrumpfen lassen) */
.page-grid .main-col { margin: 0; width: 100%; justify-self: stretch; max-width: none; }

/* Level-Karte: großes Bild links, Infos rechts; auf dem Handy untereinander */
a.level-link.level {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 14px;
  align-items: start;
}
@media (min-width: 600px) {
  a.level-link.level { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding: 16px; align-items: center; }
}
a.level-link .thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--panel-border);
}
a.level-link .rank { min-height: 56px; height: auto; }
.level-text { min-width: 0; }
.level-text h3 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 6px; overflow-wrap: anywhere; }
.level-text p { font-size: .95rem; margin: 2px 0; overflow-wrap: anywhere; }
.level-text .points { font-size: 1.05rem; margin-top: 10px; }
.level-text h3 .pos { color: var(--accent, #f5b400); margin-right: 6px; }

/* Suche und Tabs passen sich der Breite an */
.list-tabs { flex-wrap: wrap; }
.list-tabs button { min-width: 0; }
.search { max-width: 100%; }

/* ---------- Bereichs-Navigation, Support, Gruppen im Menü ---------- */
.subnav { max-width: 1180px; margin: 0 auto 22px; padding: 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.subnav a { font-weight: 700; color: var(--text); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--panel-border); text-decoration: none; background: var(--panel); }
.subnav a:hover { border-color: var(--purple); color: var(--green); }
.subnav a.on { background: var(--grad); border-color: transparent; color: #fff; }
.ud-group { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; }
.support-card { margin-bottom: 18px; }
.support-card h2 { margin-top: 0; }
.support-card details { border-bottom: 1px solid var(--panel-border); padding: 12px 0; }
.support-card details:last-child { border-bottom: 0; }
.support-card summary { cursor: pointer; font-weight: 700; list-style: none; }
.support-card summary::-webkit-details-marker { display: none; }
.support-card summary::after { content: "+"; float: right; color: var(--accent, #f5b400); font-size: 1.2rem; line-height: 1; }
.support-card details[open] summary::after { content: "–"; }
.support-card details p { color: var(--muted); margin: 10px 0 0; }
.support-card details a { color: var(--cyan); }

/* ---------- Discord-Zahlen in der Seitenleiste ---------- */
.dstats { display: flex; gap: 12px; margin-bottom: 12px; }
.dstat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); }
.dstat strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.dstat small { color: var(--muted); font-size: .8rem; }
.dot-online { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); margin-right: 8px; vertical-align: middle; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--panel-border); background: rgba(0,0,0,.22); padding: 22px 18px; }
.foot-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.foot-inner nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot-inner a { color: var(--muted); text-decoration: none; transition: color .2s ease; }
.foot-inner a:hover { color: var(--green); }
.legal h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }

/* ---------- Responsive ---------- */
.topbar { padding: 12px 22px; }
.topbar nav { align-items: center; }
@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 1.05rem; }
  .brand img { width: 28px; height: 28px; }
  .topbar nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; padding-bottom: 2px; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; font-size: .88rem; padding: 7px 11px; }
  .hero { padding: 40px 16px 24px; }
  .hero h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); }
  .page-grid { padding: 0 14px 40px; gap: 18px; }
  .card { padding: 18px; border-radius: 14px; }
  .search { font-size: 16px; }
  .btn { padding: 10px 18px; }
  .subnav { padding: 0 14px; }
  .foot-inner { flex-direction: column; text-align: center; }
  .foot-inner nav { justify-content: center; }
  .info-table th { width: 42%; }
  .level-hero { gap: 16px; }
}
@media (max-width: 380px) {
  .user-btn span { display: none; }
  .level-text h3 { font-size: 1.1rem; }
}

/* ---------- Profil-Platz ohne Springen beim Laden ---------- */
.user-slot { display: flex; align-items: center; justify-content: flex-end; min-width: 170px; min-height: 42px; flex: none; }
.user-skel { display: inline-block; width: 170px; height: 42px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.user-btn { white-space: nowrap; }
.user-btn span { display: inline-block; }
@media (max-width: 760px) { .user-slot { min-width: 44px; } .user-skel { width: 44px; } }

/* ---------- Glocke & Benachrichtigungen ---------- */
.bell-wrap { position: relative; margin-right: 10px; }
.bell { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); transition: border-color .2s ease, transform .15s ease; }
.bell:hover { border-color: var(--purple); transform: translateY(-1px); }
.bell .badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; font-size: .72rem; font-weight: 800; color: #fff; background: var(--pink); display: grid; place-items: center; box-shadow: 0 0 12px rgba(255,47,179,.6); }
.bell .badge[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: min(360px, calc(100vw - 28px)); background: var(--bg-2); border: 1px solid var(--panel-border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: fadeUp .18s ease both; }
.bell-panel[hidden] { display: none; }
.bp-head { padding: 14px 16px; border-bottom: 1px solid var(--panel-border); }
.bp-list { max-height: 360px; overflow-y: auto; }
.bp-list .hint { padding: 16px; margin: 0; }
.bp-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--panel-border); transition: background .2s ease; }
.bp-item:hover { background: var(--panel); color: var(--text); }
.bp-item.unread { background: rgba(139,92,246,.10); }
.bp-icon { font-size: 1.2rem; line-height: 1.3; }
.bp-text { display: flex; flex-direction: column; min-width: 0; }
.bp-text strong { font-size: .95rem; overflow-wrap: anywhere; }
.bp-text small { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- Abo-Knopf bei Listen ---------- */
.sub-area { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.sub-area:empty { display: none; }
.sub-btn { padding: 8px 16px; font-size: .92rem; }
.sub-btn.on { background: var(--grad); border-color: transparent; color: #fff; }
.sub-hint { margin: 0; }
@media (max-width: 760px) { .bell-wrap { margin-right: 4px; } .bell { width: 38px; height: 38px; } .bell-panel { right: -6px; } }

.player-cell { display: flex; align-items: center; gap: 10px; }
.player-cell img { border-radius: 50%; flex: none; border: 1px solid var(--panel-border); }

/* ---------- Verwaltung: Mitglieder, Protokoll ---------- */
.m-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.m-head h2 { margin: 0; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.letters .chip-btn { padding: 5px 10px; font-size: .8rem; min-width: 34px; }
.member-body .m-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.gd-tag { color: var(--green); font-weight: 600; }
.chip-btn .x { margin-left: 4px; font-size: .8em; opacity: .85; }
.chip-btn.on .x { color: #fff; }
.audit-list { display: grid; gap: 8px; margin-top: 10px; }
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--panel-border); background: rgba(255,255,255,.02); }
.audit-row .sign { font-weight: 900; width: 22px; text-align: center; }
.audit-row.add .sign { color: var(--green); }
.audit-row.remove .sign { color: #ff7a9c; }
.audit-row small { display: block; color: var(--muted); margin-top: 2px; }

/* ---------- Listenteam ---------- */
.team-title { margin: 12px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.team-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-weight: 700; }
.team-row img { border-radius: 50%; border: 1px solid var(--panel-border); }
.role-form-select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }

/* ---------- Regeln: Abschnitte ---------- */
.rules h2 { margin: 26px 0 8px; font-size: 1.1rem; color: var(--accent, #f5b400); }
.rules h2:first-child { margin-top: 0; }
.rules p, .rules li { color: var(--text); }
.rules ul { padding-left: 20px; margin: 0; }
.rules li { margin-bottom: 6px; }
.rules-intro { margin-bottom: 18px; border-left: 4px solid var(--accent, #f5b400); }
.rules-intro p { margin: 0; }
.tip { margin: 22px 0 6px; padding: 14px 16px; border-radius: 12px; background: rgba(124,255,107,.08); border: 1px solid rgba(124,255,107,.35); color: var(--text); }

/* ---------- Sprache DE / EN ---------- */
.en, .en-block { display: none; }
html[data-lang="en"] .en { display: inline; }
html[data-lang="en"] .en-block { display: block; }
html[data-lang="en"] .de, html[data-lang="en"] .de-block { display: none; }
.lang-btn {
  font: inherit; font-weight: 800; font-size: .8rem; cursor: pointer; color: var(--text);
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 7px 12px; margin-right: 6px; transition: border-color .2s ease;
}
.lang-btn:hover { border-color: var(--purple); }

/* ---------- Erweiterte Level-Infos ---------- */
details.more { margin-top: 14px; border-top: 1px solid var(--panel-border); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--accent, #f5b400); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " ▾"; }
details.more[open] summary::after { content: " ▴"; }
details.more .info-table { margin-top: 10px; }

.warn { display: block; color: #ffb36b; margin-top: 4px; }

/* ---------- Startseite: farbiger, lebendiger Hintergrund ---------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; animation: hueShift 28s linear infinite; }
.bg-fx .orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform;
}
.bg-fx .o1 { width: 52vmax; height: 52vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, #8b5cf6, transparent 65%); animation: float1 26s ease-in-out infinite; }
.bg-fx .o2 { width: 46vmax; height: 46vmax; right: -14vmax; top: 8vh; background: radial-gradient(circle, #ff2fb3, transparent 65%); animation: float2 32s ease-in-out infinite; opacity: .45; }
.bg-fx .o3 { width: 40vmax; height: 40vmax; left: 30vw; bottom: -18vmax; background: radial-gradient(circle, #38e8ff, transparent 65%); animation: float3 36s ease-in-out infinite; opacity: .35; }
.bg-fx .o4 { width: 26vmax; height: 26vmax; left: 60vw; top: 40vh; background: radial-gradient(circle, #7CFF6B, transparent 65%); animation: float2 22s ease-in-out infinite reverse; opacity: .25; }
.bg-fx .grid {
  position: absolute; inset: -40px;
  background-image: linear-gradient(rgba(139,92,246,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,47,179,.14) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  animation: gridMove 40s linear infinite;
  opacity: .8;
}
.bg-fx .sweep {
  position: absolute; left: -50%; top: 0; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.05) 45%, rgba(255,255,255,.09) 50%, transparent 60%);
  animation: sweep 14s ease-in-out infinite;
}
@media (prefers-color-scheme: light) {
  .bg-fx .orb { opacity: .28; }
  .bg-fx .grid { opacity: .5; }
}
@keyframes hueShift { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(360deg); } }
@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw,6vh) scale(1.12); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-7vw,8vh) scale(1.08); } }
@keyframes float3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-6vw,-9vh) scale(1.15); } }
@keyframes gridMove { from { transform: translate(0,0); } to { transform: translate(56px,56px); } }
@keyframes sweep { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 60%,100% { transform: translateX(260%); opacity: 0; } }

/* Schimmernder Titel auf der Startseite */
.home .hero h1 {
  background-size: 200% 200%;
  animation: titleShine 8s ease-in-out infinite;
  filter: drop-shadow(0 0 22px rgba(255,47,179,.35));
}
@keyframes titleShine { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.home .hero .eyebrow { box-shadow: 0 0 18px rgba(124,255,107,.25); }

@media (prefers-reduced-motion: reduce) {
  .bg-fx, .bg-fx *, .home .hero h1 { animation: none !important; }
}

.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 10px 0; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--purple); }
#sync-now:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Team-Editor: Abschnitte, Suchfelder pro Person ---------- */
.team-section { border: 1px solid var(--panel-border); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: rgba(255,255,255,.02); }
.team-section h3 { margin: 0 0 10px; }
.team-people { display: grid; gap: 8px; margin-bottom: 10px; }
.team-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-border); }
.team-person img { border-radius: 50%; }
.team-person span { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-pickers { display: grid; gap: 10px; margin-bottom: 10px; }
.team-picker { display: grid; gap: 8px; padding: 10px; border-radius: 12px; border: 1px dashed var(--purple); background: rgba(139,92,246,.06); }
.team-picker .search { margin: 0; }
.team-results { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.team-result { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; font-weight: 700; color: var(--text); background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.team-result:hover { border-color: var(--green); }
.team-result img { border-radius: 50%; }

/* ---------- Cookie-Hinweis ---------- */
.consent {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 100;
  width: min(520px, calc(100vw - 28px)); display: flex; flex-wrap: wrap; gap: 12px 16px;
  align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 16px; font-size: .88rem;
  background: var(--bg-2); border: 1px solid var(--panel-border); box-shadow: var(--shadow);
  animation: fadeUp .4s ease both; transition: opacity .3s ease, transform .3s ease;
}
.consent p { margin: 0; color: var(--muted); flex: 1 1 260px; line-height: 1.45; }
.consent.gone { opacity: 0; transform: translateX(-50%) translateY(12px); }
.consent-actions { display: flex; gap: 8px; flex: none; }
.consent .chip-btn { padding: 7px 12px; font-size: .82rem; }

/* ---------- Profil ---------- */
.profile-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.profile-avatar { border-radius: 50%; border: 3px solid var(--purple); box-shadow: 0 0 24px rgba(139,92,246,.4); }
.profile-hero h1 { margin: 0 0 6px; }
.profile-stats { display: flex; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.profile-stats div { display: flex; flex-direction: column; }
.profile-stats strong { font-size: 1.4rem; }
.profile-stats small { color: var(--muted); }
.link-row { color: var(--text); text-decoration: none; justify-content: space-between; gap: 12px; }
.link-row:hover { border-color: var(--green); color: var(--text); }
.link-row small { color: var(--muted); }
.type-link { color: var(--cyan); text-decoration: none; }
.type-link:hover { color: var(--green); }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.tag { display: inline-block; font-size: .8rem; font-weight: 800; padding: 4px 11px; border-radius: 999px; color: var(--c, var(--purple)); border: 1px solid var(--c, var(--purple)); background: color-mix(in srgb, var(--c, var(--purple)) 14%, transparent); }

.team-link { color: var(--text); text-decoration: none; border-radius: 10px; padding: 6px 8px; margin: 0 -8px; transition: background .2s ease; }
.team-link:hover { background: var(--panel); color: var(--green); }

/* ---------- Mitglieder einer Rolle ---------- */
.role-members { display: grid; gap: 6px; margin: -2px 0 10px 24px; padding: 10px 12px; border-left: 2px solid var(--purple); }
.rm-item { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rm-item img { border-radius: 50%; }
.rm-src { color: var(--muted); font-weight: 600; }

/* =========================================================
   Responsive Feinschliff: Handy (bis 600px), Tablet (bis 960px), Desktop
   ========================================================= */
html, body { max-width: 100%; overflow-x: hidden; }
img, iframe, video { max-width: 100%; height: auto; }
input, select, textarea, button { max-width: 100%; }

/* Kopfzeile: auf kleinen Bildschirmen klappt die Navigation sauber um */
.topbar { flex-wrap: wrap; }
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
@media (max-width: 960px) {
  .topbar { padding: 10px 16px; }
  .topbar nav a { padding: 7px 10px; font-size: .9rem; }
}

/* Tabellen dürfen seitlich scrollen, statt die Seite zu sprengen */
.table-wrap, .records, .info-table { max-width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* Karten und Abstände passen sich an */
.card { min-width: 0; }
.page-grid, .container { box-sizing: border-box; }

@media (max-width: 960px) {
  .hero { padding: 48px 18px 28px; }
  .hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .admin-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .level-hero { grid-template-columns: 1fr; }
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { gap: 8px; }
  .topbar nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .lang-btn, .user-btn { flex: none; }
  .user-dropdown { right: -4px; left: auto; max-width: calc(100vw - 24px); }
  .bell-panel { right: -6px; }

  /* Formulare untereinander, Buttons volle Breite */
  .role-form { display: grid; gap: 12px; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn, .form-actions .chip-btn { width: 100%; text-align: center; }
  .role-row { flex-wrap: wrap; }
  .role-row .chip-btn { flex: 1 1 auto; }
  .level-hero img, .level-img { width: 100%; }

  /* Listen-Karten */
  .level-list { gap: 10px; }
  .level { padding: 12px; }

  /* Rangliste und Mitglieder: weniger Spalten sichtbar */
  .stats-table { min-width: 0; font-size: .9rem; }
  .stats-table th, .stats-table td { padding: 9px 6px; }
  .stats-table th:nth-child(5), .stats-table td:nth-child(5) { display: none; }

  /* Verwaltung: Chips umbrechen */
  .chips { gap: 5px; }
  .chip-btn { font-size: .8rem; }
  .member { flex-wrap: wrap; }
  .member img { width: 34px; height: 34px; }

  /* Profil */
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; gap: 16px; }
  .link-row { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Fußzeile */
  .foot-inner { font-size: .85rem; }
  .site-footer { padding: 18px 14px; }

  /* Cookie-Hinweis nimmt volle Breite */
  .consent { bottom: 10px; width: calc(100vw - 20px); }

  /* Bereichs-Navigation */
  .subnav { padding: 0 12px; }
  .subnav a { font-size: .85rem; padding: 7px 12px; }
}

@media (max-width: 420px) {
  .hero { padding: 36px 14px 22px; }
  .hero p { font-size: .95rem; }
  .card { padding: 14px; }
  .stats-table th:nth-child(4), .stats-table td:nth-child(4) { display: none; }
  .profile-avatar { width: 80px; height: 80px; }
  .topbar .brand span { display: none; }
}

/* Große Bildschirme: Inhalte nicht zu breit auseinanderziehen */
@media (min-width: 1400px) {
  .page-grid, .container { max-width: 1240px; }
}

/* Touch-Geräte: größere Trefferflächen */
@media (pointer: coarse) {
  .chip-btn, .btn, .topbar nav a, .bell, .user-btn, .lang-btn { min-height: 40px; }
  .level, .record-row, .team-result { min-height: 48px; }
}
