/* GOLF★STARS: Design-System
   Identität der Gilde: Schwarz, Neon-Cyan (#00F8FF), Gold-Stern (#F0C018).
   Dunkel ist Standard; Hell über data-theme="light". Keine externen Schriften (DSGVO). */

:root {
  --bg: #04090a;
  --surface: #0a1315;
  --surface-2: #0f1c1f;
  --line: #16292d;
  --text: #e3f6f7;
  --muted: #7fa3a7;
  --accent: #00f8ff;
  --accent-dim: #00becc;
  --accent-soft: rgba(0, 248, 255, .12);
  --accent-ink: #001a1c;
  --gold: #f0c018;
  --gold-soft: rgba(240, 192, 24, .14);
  --ok: #19ff84;
  --warn: #ffc816;
  --err: #ff2861;
  --glow: 0 0 0 1px rgba(0, 248, 255, .35), 0 0 18px rgba(0, 248, 255, .18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", var(--font);
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --nav-h: 64px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef5f5;
  --surface: #ffffff;
  --surface-2: #f4f9f9;
  --line: #d5e4e5;
  --text: #0a1b1d;
  --muted: #4f6b6e;
  --accent: #007d86;
  --accent-dim: #00656d;
  --accent-soft: rgba(0, 125, 134, .1);
  --accent-ink: #ffffff;
  --gold: #a67c00;
  --gold-soft: rgba(166, 124, 0, .12);
  --ok: #0f8a4a;
  --warn: #9a6a00;
  --err: #c4163f;
  --glow: 0 1px 2px rgba(10, 27, 29, .08), 0 4px 16px rgba(10, 27, 29, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: clamp(24px, 4.5vw, 32px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ───────────── App-Rahmen ───────────── */
.app { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
main.view > * { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand img { height: 34px; width: auto; }
.topbar .spacer { flex: 1; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); cursor: pointer; color: var(--text);
}
.icon-btn:hover { border-color: var(--accent-dim); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--err); border: 2px solid var(--bg); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 14px;
  overflow: hidden;
}
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

main.view { padding-inline: 16px; padding-block: 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); max-width: 1120px; width: 100%; margin: 0 auto; display: grid; gap: 18px; align-content: start; }

/* Mobile: Leiste unten */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.bottomnav a {
  display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.bottomnav a.active { color: var(--accent); }
.bottomnav a.active svg { filter: drop-shadow(0 0 6px rgba(0, 248, 255, .55)); }

.sidenav { display: none; }

@media (min-width: 900px) {
  .app { grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .bottomnav { display: none; }
  .sidenav {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 61px; align-self: start; height: calc(100vh - 61px); overflow-y: auto;
    padding: 16px 10px; border-right: 1px solid var(--line);
  }
  .sidenav a {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 600; text-decoration: none;
  }
  .sidenav a:hover { color: var(--text); background: var(--surface-2); }
  .sidenav a.active { color: var(--accent); background: var(--accent-soft); }
  .sidenav .group { margin: 14px 12px 4px; }
  main.view { padding-block: 26px 48px; }
}

/* ───────────── Bausteine ───────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card.glow { box-shadow: var(--glow); border-color: transparent; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid.dash { grid-template-columns: 1.4fr 1fr; } }

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--accent-dim); background: transparent; color: var(--accent);
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 0 12px rgba(0, 248, 255, .2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.gold { border-color: var(--gold); color: var(--gold); }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; line-height: 1.6; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.err { color: var(--err); } .chip.info { color: var(--accent); } .chip.mute { color: var(--muted); }
.role-admin, .role-leader { color: #ff4d6d; } .role-procurator { color: #a78bfa; } .role-deputy { color: #ffc816; }
.role-member { color: var(--accent); } .role-friend { color: var(--ok); } .role-guest { color: var(--muted); }

.form-pills { display: inline-flex; gap: 3px; }
.form-pills i { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 800; color: #001; }
.form-pills .S { background: var(--ok); } .form-pills .N { background: var(--err); color: #fff; } .form-pills .U { background: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); font-weight: 700; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; background: var(--surface-2); }
.seg button { border: 0; background: none; border-radius: 999px; padding: 7px 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-dim); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 84px; resize: vertical; }

.list { display: grid; }
.list > * { padding: 10px 0; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; }
.item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { font-size: 13px; color: var(--muted); }

.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-size: 14px; }
.notice.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.me td { background: var(--accent-soft); }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.rank { font-family: var(--font-display); font-weight: 700; font-size: 18px; width: 34px; text-align: center; }
.rank.p1 { color: var(--gold); text-shadow: 0 0 10px rgba(240, 192, 24, .5); }
.rank.p2 { color: #cfd8dc; } .rank.p3 { color: #d08a4a; }
:root[data-theme="light"] .rank.p2 { color: #6b7c80; }
:root[data-theme="light"] .rank.p3 { color: #a8632a; }
.pts { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--accent); }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag { font-size: 12px; color: var(--muted); font-weight: 700; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .tbl th, .tbl td { padding-inline: 4px; }
  .tbl .player .avatar { display: none; }
  .rank { width: 26px; font-size: 16px; }
  .pts { font-size: 16px; }
}

/* Statistik-Kacheln */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.1; color: var(--accent); }
.stat span { font-size: 12px; color: var(--muted); }

/* Hero der Startseite */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); padding: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 248, 255, .16), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(240, 192, 24, .10), transparent 60%),
    var(--surface);
  display: grid; gap: 14px;
}
.hero .greet { display: flex; align-items: center; gap: 14px; }
.hero .greet img { width: 56px; height: 56px; }

/* Spielkarten (Postfach) */
.match { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); }
.match.attention { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-soft); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.versus .side { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.versus .side.b { justify-content: flex-end; text-align: right; }
.versus .vs { font-family: var(--font-display); color: var(--muted); font-size: 13px; }
.score { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }

/* Bracket */
.bracket { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.bracket .round { display: grid; gap: 12px; align-content: space-around; }
.bracket .round h3 { font-size: 13px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.bslot { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.bslot div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 14px; }
.bslot div + div { border-top: 1px solid var(--line); }
.bslot .win { color: var(--accent); font-weight: 800; }
.bslot .tbd { color: var(--muted); font-style: italic; }

/* Bottom-Sheet / Dialog */
dialog.sheet {
  border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px;
  background: var(--surface); color: var(--text); max-height: 92vh;
}
@media (min-width: 640px) { dialog.sheet { border-radius: 18px; margin: auto; } }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); }
dialog.sheet form { display: grid; gap: 14px; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
dialog.sheet header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  background: var(--surface); border: 1px solid var(--accent-dim); color: var(--text); padding: 10px 16px; border-radius: 999px; box-shadow: var(--glow); font-weight: 600; max-width: calc(100% - 32px); }
.toast.err { border-color: var(--err); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Weitenrechner */
.calc { display: grid; gap: 16px; }
@media (min-width: 900px) { .calc { grid-template-columns: 340px 1fr; align-items: start; } }
.calc-inputs { display: grid; gap: 12px; }
.calc-inputs .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit-input { position: relative; }
.unit-input input { padding-right: 42px; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; font-weight: 700; }
.windrose { width: 100%; max-width: 240px; margin: 0 auto; display: block; }
.windrose path { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; cursor: pointer; transition: fill .12s; }
.windrose path:hover { fill: var(--accent-soft); }
.windrose path.on { fill: var(--accent); }
.windrose text { fill: var(--muted); font-size: 9px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.windrose .ball { fill: #fff; stroke: var(--line); }
.calc-results .tbl td { font-family: var(--font-display); font-size: 17px; }
.calc-results .tbl td:first-child { font-weight: 700; color: var(--accent); }
.calc-results .best td { background: var(--gold-soft); }

/* Profil */
.hc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hc { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.hc b { font-family: var(--font-display); color: var(--accent); }

.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.member { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.member:hover { border-color: var(--accent-dim); text-decoration: none; }

.md { line-height: 1.65; max-width: 72ch; }
.md h1, .md h2, .md h3 { margin: 1.2em 0 .4em; }
.md img { border-radius: var(--radius-sm); margin: 8px 0; }
.md ul { padding-left: 1.2em; }

.ts3 .chan { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.ts3 .client { font-size: 14px; padding-left: 26px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ts3 .client::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } * { transition: none !important; } }

/* ───────────── Community: Forum, Chat, Neuigkeiten ───────────── */
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.sm { width: 32px; height: 32px; }
.forum-row, .topic-row { color: var(--text); text-decoration: none; }
.forum-row:hover, .topic-row:hover { text-decoration: none; }
.forum-row:hover .title, .topic-row:hover .title { color: var(--accent); }
.forum-ic { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.forum-count { display: grid; justify-items: center; min-width: 52px; line-height: 1.1; }
.forum-count b { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
.forum-count span { font-size: 11px; color: var(--muted); }
.topic-row .title svg, .page-head .chip svg { vertical-align: -2px; }

.posts { display: grid; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-head .grow { flex: 1; min-width: 0; }
.post-head .name { font-weight: 700; color: var(--text); }
.post-head .sub { font-size: 12px; color: var(--muted); }
.post-actions { display: flex; gap: 6px; }
.post-body { max-width: none; overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--accent-dim); color: var(--muted); }
.md code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.md pre { overflow-x: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.md pre code { border: 0; padding: 0; background: none; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.md ol { padding-left: 1.4em; }
.reply-box { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); scroll-margin-bottom: calc(var(--nav-h) + 16px); }
.reply-box textarea { min-height: 64px; }

/* Chat */
.chat {
  display: flex; flex-direction: column; min-height: 340px;
  height: calc(100dvh - 61px - env(safe-area-inset-top, 0px) - 18px - var(--nav-h) - 28px - env(safe-area-inset-bottom, 0px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative;
}
@media (min-width: 900px) { .chat { height: calc(100dvh - 61px - 26px - 48px); } }
.chat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 20px; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.chat-list > .empty { margin: auto 0; }
.chat-day { text-align: center; margin: 10px 0 6px; }
.chat-day span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.msg:not(.cont) { margin-top: 6px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 32px; flex: none; }
.msg-av .avatar { width: 32px; height: 32px; font-size: 12px; }
.bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 6px 10px 4px; min-width: 0; }
.msg.mine .bubble { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 14px 14px 4px 14px; }
.msg-name { font-size: 12px; font-weight: 700; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.msg-del { background: none; border: 0; padding: 2px; color: var(--muted); cursor: pointer; opacity: .6; display: inline-grid; }
.msg-del:hover { color: var(--err); opacity: 1; }
@media (hover: hover) { .msg-del { opacity: 0; } .msg:hover .msg-del, .msg-del:focus-visible { opacity: .8; } }
.chat-new { position: absolute; left: 50%; transform: translateX(-50%); bottom: 72px; background: var(--surface); box-shadow: var(--glow); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 22px; padding: 10px 16px; line-height: 1.4; }
.chat-send { width: 44px; min-height: 44px; padding: 0; flex: none; }

/* Neuigkeiten */
.feed { display: grid; gap: 12px; }
.news-post.pinned { border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.news-post.news { box-shadow: var(--glow); }
.news-post.system .post-body { font-size: 16px; }
.chip.gold-chip { color: var(--gold); }
.reactions { display: flex; flex-wrap: wrap; gap: 6px; }
.react { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 15px; }
.react b { font-size: 12px; color: var(--muted); }
.react.on { border-color: var(--accent); background: var(--accent-soft); }
.react.on b { color: var(--accent); }
.react:disabled { cursor: default; }
.news-mini { max-width: none; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-mini > * { margin: 0; }

/* ───────────── Konto: Registrierung, Profil bearbeiten, Benachrichtigungen, Punkte ───────────── */
.auth-card { max-width: 440px; width: 100%; margin: 24px auto; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
label.check input { width: 20px; min-height: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.icon-btn .count { position: absolute; top: -5px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--err); color: #fff; font-size: 11px; font-weight: 800; line-height: 15px; text-align: center; border: 2px solid var(--bg); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); box-shadow: 0 0 10px rgba(0, 248, 255, .35); }
.hc-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.hc-edit label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 10px; min-width: 0;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.hc-edit label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-edit input { width: 64px; min-height: 34px; padding: 4px 8px; text-align: right; flex: none; font-family: var(--font-display); font-weight: 700; }
.privacy-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: end; }
@media (max-width: 480px) { .privacy-row { grid-template-columns: 1fr; } }
.save-bar { position: sticky; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border: 1px solid var(--accent-dim); box-shadow: var(--glow); font-size: 14px; }
@media (min-width: 900px) { .save-bar { bottom: 16px; } }
.notif { color: var(--text); text-decoration: none; }
.notif:hover { text-decoration: none; background: var(--surface-2); }
.notif .title { font-weight: 600; }
.notif.unread .title { font-weight: 800; }
.notif .notif-text { white-space: normal; }
.notif-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.notif.unread .notif-ic { color: var(--accent); border-color: var(--accent-dim); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }

/* Kurse & Kurs-Guides */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.course-card { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; overflow: hidden; min-width: 0; }
.course-card:hover { border-color: var(--accent-dim); text-decoration: none; box-shadow: var(--glow); }
.course-img { aspect-ratio: 250 / 78; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.course-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-body { display: grid; gap: 6px; padding: 10px 12px 12px; }
.course-body .title { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.course-facts svg { vertical-align: -2px; }
.diff { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.diff-bar { width: 90px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.diff-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn) 60%, var(--err)); border-radius: inherit; }
.course-hero .course-banner { width: 100%; max-width: 520px; aspect-ratio: 250 / 78; object-fit: cover; border-radius: var(--radius); }
.hole-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.hole-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font-size: 14px; min-width: 0; }
.hole-card:hover, .hole-card:focus-visible { border-color: var(--accent-dim); box-shadow: var(--glow); outline: none; }
.hole-img { aspect-ratio: 17 / 25; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; color: var(--muted); }
.hole-img img { width: 100%; height: 100%; object-fit: contain; }
.hole-card .chip { padding: 0 6px; font-size: 11px; }
.hole-flags { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: var(--accent); min-height: 14px; }
.hole-flags svg { vertical-align: -2px; }
.hole-video video { width: 100%; max-height: 50vh; border-radius: var(--radius-sm); background: #000; display: block; }
.pin-tbl tr[data-pin] { cursor: pointer; }
.pin-tbl tr[data-pin]:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: -2px; }
.pin-view { display: grid; gap: 10px; }
.pin-view img { width: 100%; border-radius: var(--radius-sm); background: var(--surface-2); }
a.hc { color: var(--text); text-decoration: none; }
a.hc:hover { border-color: var(--accent-dim); text-decoration: none; }

/* ── Community-Erweiterungen: Bilder, Folgen, Startseite (Twitch, Discord, Geburtstage) ── */
.post-image { display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.post-image img { width: 100%; max-height: 70vh; object-fit: contain; }
.img-attach { position: relative; width: fit-content; max-width: 100%; }
.img-attach img { max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.img-attach .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.feed-filter { max-width: 100%; }
.feed-filter button { white-space: normal; line-height: 1.25; }
.evidence { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.evidence img { width: 96px; height: 60px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.follow-bar { flex-wrap: wrap; }
.follow-ui { flex-wrap: wrap; }
.follow-count { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.follow-count b { color: var(--accent); }
.follow-count:disabled { cursor: default; }
.follow-count:not(:disabled):hover { border-color: var(--accent-dim); }
.follow-list { max-height: 60vh; overflow: auto; }
.hero .welcome { margin: 0; white-space: pre-line; color: var(--text); }
.birthday-note { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); font-weight: 600; }
.birthday-note a { color: var(--gold); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { filter: brightness(1.08); text-decoration: none; }
.twitch-embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: linear-gradient(135deg, #1f1033, var(--surface-2)); }
.twitch-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.twitch-consent { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 16px; text-align: center; }
.twitch-consent p { margin: 0; max-width: 460px; font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .twitch-embed { aspect-ratio: auto; min-height: 220px; } .twitch-embed:has(iframe) { aspect-ratio: 16 / 9; min-height: 0; } }

/* ───────────── Minispiele & Punkte ───────────── */
.game-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.game-card { color: var(--text); text-decoration: none; grid-template-columns: auto 1fr; align-items: start; }
.game-card:hover { text-decoration: none; border-color: var(--accent-dim); box-shadow: var(--glow); }
.game-card h2 { margin-bottom: 4px; }
.game-card p { margin: 0; font-size: 14px; }
.game-card .game-status { grid-column: 1 / -1; font-size: 13px; color: var(--muted); min-height: 1em; }
.game-card.off { opacity: .6; }
.game-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.wheel-card { justify-items: center; }
.wheel-wrap { position: relative; width: 100%; max-width: 420px; display: grid; place-items: center; padding-top: 8px; }
.wheel-wrap canvas { display: block; max-width: 100%; }
.wheel-pointer { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid var(--gold); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.wheel-card #wheel-result { width: 100%; }
.pac-hud { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.pac-hud .stat { padding: 6px 8px; } .pac-hud .stat b { font-size: 18px; } .pac-hud .stat span { font-size: 11px; line-height: 1.2; display: block; }
.pac-wrap { display: grid; place-items: center; width: 100%; }
.pac-wrap canvas { display: block; max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); touch-action: none; background: #04090a; }
.dpad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 48px); gap: 6px; justify-content: center; }
.dpad .btn { padding: 0; min-height: 0; font-size: 18px; }
.dpad [data-d="up"] { grid-column: 2; grid-row: 1; } .dpad [data-d="left"] { grid-column: 1; grid-row: 2; }
.dpad [data-d="down"] { grid-column: 2; grid-row: 2; } .dpad [data-d="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }
.advent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .advent-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.door { position: relative; aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 4px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.door .door-no { font-family: var(--font-display); font-size: clamp(22px, 5vw, 30px); font-weight: 700; }
.door .door-state { font-size: 12px; font-weight: 700; color: var(--gold); display: inline-flex; }
.door.open { border-color: var(--gold); background: var(--gold-soft); }
.door.open:hover { box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(240, 192, 24, .25); }
.door.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.door.locked { cursor: not-allowed; color: var(--muted); background: var(--surface-2); }
.door.locked .door-state { color: var(--muted); }
.door.answered.right .door-state { color: var(--ok); } .door.answered.wrong .door-state { color: var(--err); }
.item .door-no { width: 30px; text-align: center; font-family: var(--font-display); font-weight: 700; color: var(--gold); flex: none; }
fieldset.quiz { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
fieldset.quiz legend { margin-bottom: 8px; }
.quiz-opt { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.quiz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.item.off { opacity: .55; }
.prize-row { padding: 6px 0; } .prize-row.done { opacity: .6; }
.mg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
b.neg, td.neg { color: var(--err); } b.pos { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .game-card:hover, .door.open:hover { box-shadow: none; } }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.notice.err { background: color-mix(in srgb, var(--err) 12%, transparent); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
