/* yNETGESTALT — dunkles Theme passend zum Banner (Cyan → Violett) */

:root {
  --bg: #05070d;
  --surface: #0c111e;
  --surface-2: #111827;
  --border: #1d2840;
  --text: #e2e8f0;
  --text-dim: #8294b0;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --green: #34d399;
  --red: #f87171;
  --grad: linear-gradient(90deg, var(--cyan), var(--violet));
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 500px at 80% -10%, rgba(168, 85, 247, 0.08), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(34, 211, 238, 0.07), transparent 60%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 560px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.9em;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

.muted { color: var(--text-dim); }
.meta { color: var(--text-dim); font-size: 0.82rem; }
.accent-cyan { color: var(--cyan); }
.accent-violet { color: var(--violet); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand-emblem { height: 38px; border-radius: 8px; }
.brand-name { font-weight: 800; letter-spacing: 0.04em; font-size: 1.1rem; color: var(--text); }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--cyan); }

.nav-user { display: flex; align-items: center; gap: 10px; }
.username { font-weight: 600; font-size: 0.92rem; }

/* ---------- Buttons & Badges ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: filter 0.15s, transform 0.05s;
}
.btn:hover { filter: brightness(1.2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad);
  border: none;
  color: #04101a;
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 12px; font-size: 0.85rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 2px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  vertical-align: middle;
}
.badge-admin {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--violet);
  color: #d8b4fe;
}

/* ---------- Flash ---------- */
.flashes { margin-top: 14px; }
.flash {
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.flash-success { border-color: var(--green); }
.flash-error { border-color: var(--red); }

/* ---------- Community-Chat (Hero-Bereich) ---------- */
.chat-hero {
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(5, 7, 13, 0.78), rgba(5, 7, 13, 0.92)),
    url("../img/banner.png") center / cover no-repeat;
  padding: 26px 0;
}
.chat-window {
  display: flex;
  flex-direction: column;
  height: 300px;
  background: rgba(12, 17, 30, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 45px rgba(34, 211, 238, 0.07), 0 0 90px rgba(168, 85, 247, 0.07);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(5, 7, 13, 0.55);
  border-bottom: 2px solid;
  border-image: var(--grad) 1;
}
.chat-emblem { height: 26px; }
.chat-title { font-weight: 800; letter-spacing: 0.04em; }
.chat-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green);
}
.chat-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: chat-pulse 2s infinite;
}
@keyframes chat-pulse {
  50% { opacity: 0.4; }
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
}
.chat-messages:empty::before {
  content: "Noch keine Nachrichten — schreib doch die erste! 👋";
  color: var(--text-dim);
  margin: auto;
}
.chat-msg { display: flex; align-items: baseline; gap: 8px; }
.chat-msg .time { color: var(--text-dim); font-size: 0.74rem; flex: 0 0 auto; }
.chat-msg .who { font-weight: 700; color: var(--cyan); flex: 0 0 auto; }
.chat-msg.is-admin .who { color: var(--violet); text-shadow: 0 0 12px rgba(168, 85, 247, 0.45); }
.chat-msg .body { color: var(--text); word-break: break-word; white-space: pre-wrap; }
.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.55);
}
.chat-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  padding: 9px 13px;
}
.chat-form input:focus { outline: none; border-color: var(--cyan); }

/* Gast-Ansicht: Chat gesperrt */
.chat-locked {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 24px;
}
.chat-locked h2 { margin: 10px 0 2px; letter-spacing: 0.04em; }
.chat-locked p { margin: 4px 0 0; color: var(--text-dim); }
.chat-lock-emblem {
  height: 64px;
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.35));
}
.chat-lock-actions { display: flex; gap: 10px; margin-top: 16px; }

.hero-intro {
  text-align: center;
  padding: 30px 20px 4px;
}
.hero-intro h1 { font-size: clamp(1.4rem, 3.5vw, 2.3rem); margin: 0; }
.hero-intro p { color: var(--text-dim); margin: 8px 0 0; }
.hero-intro::after {
  content: "";
  display: block;
  width: 120px;
  height: 2px;
  margin: 22px auto 0;
  border-radius: 2px;
  background: var(--grad);
  opacity: 0.7;
}

/* ---------- Cards / Grid ---------- */
.grid-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 26px auto 40px;
}
.span-2 { grid-column: span 2; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; }
.refresh-hint { color: var(--text-dim); font-size: 0.78rem; }

/* ---------- Ankündigungen ---------- */
.announcement {
  border-left: 3px solid;
  border-image: var(--grad) 1;
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.announcement-head { display: flex; align-items: baseline; gap: 12px; }
.announcement-head h3 { margin: 0; flex: 1; }
.announcement p { margin: 6px 0 0; white-space: pre-line; }

.admin-announce { margin-top: 14px; }
.admin-announce summary { cursor: pointer; color: var(--cyan); font-weight: 600; }
.admin-announce form { margin-top: 12px; }

/* ---------- Server-Status ---------- */
.server-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.server-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.server-head .game { font-weight: 700; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 3px 12px;
  border: 1px solid var(--border);
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}
.status-pill.online { border-color: var(--green); color: var(--green); }
.status-pill.online::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-pill.offline { border-color: var(--red); color: var(--red); }
.status-pill.offline::before { background: var(--red); }

.server-name { margin: 6px 0 2px; font-weight: 600; }
.server-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-dim); font-size: 0.85rem; }
.server-address { margin-top: 8px; display: flex; align-items: center; gap: 8px; }

.player-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: 0.88rem; }
.player-list li { padding: 2px 0; color: var(--text-dim); }
.player-list .lvl { color: var(--cyan); }

/* ---------- TeamSpeak ---------- */
.ts-tree { font-size: 0.9rem; }
.ts-channel { padding: 2px 0 2px 0; }
.ts-channel-name { color: var(--text-dim); font-weight: 600; }
.ts-channel-name.has-clients { color: var(--text); }
.ts-spacer { color: #3b4a6b; font-size: 0.78rem; letter-spacing: 0.05em; }
.ts-children { margin-left: 16px; border-left: 1px solid var(--border); padding-left: 12px; }
.ts-client {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 16px;
  color: var(--cyan);
}
.ts-client::before { content: "🟢"; font-size: 0.6rem; }
.ts-connect { margin-top: 12px; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.news-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 14px 16px;
}
.news-item h3 { margin: 4px 0 6px; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--cyan); }
.news-item p { margin: 0; color: var(--text-dim); font-size: 0.88rem; }
.news-tags { display: flex; gap: 8px; align-items: center; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.form input, .form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: 10px 13px;
  font: inherit;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.form button { align-self: flex-start; }

/* ---------- Forum ---------- */
.page-head { margin: 28px 0 20px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.breadcrumb { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 8px; }

.forum-categories { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }
.forum-category {
  display: grid;
  grid-template-columns: 1fr auto 220px;
  gap: 20px;
  align-items: center;
  color: var(--text);
  transition: border-color 0.15s;
}
.forum-category:hover { text-decoration: none; border-color: var(--cyan); }
.forum-category h3 { margin: 0 0 2px; }
.forum-category p { margin: 0; font-size: 0.88rem; }
.forum-category-stats { display: flex; flex-direction: column; gap: 2px; font-size: 0.85rem; color: var(--text-dim); white-space: nowrap; }
.forum-category-latest { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.latest-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.88rem; }

.thread-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.thread-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: var(--text);
  transition: border-color 0.15s;
}
.thread-row:hover { text-decoration: none; border-color: var(--cyan); }
.thread-row h3 { margin: 0 0 2px; }
.thread-stats { text-align: right; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }

.post-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.post { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.post-author { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; border-right: 1px solid var(--border); padding-right: 16px; }
.post-username { font-weight: 700; }
.post-body p { margin: 6px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 20px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-main { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .news-grid { grid-template-columns: 1fr; }
  .forum-category { grid-template-columns: 1fr; gap: 8px; }
  .post { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 8px; align-items: center; gap: 10px; }
  .nav { gap: 0; }
  .brand-name { display: none; }
}

/* ---------- CAPTCHA (Registrierung) ---------- */
.captcha-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-block img {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
#captcha-refresh { font-size: 1.1rem; line-height: 1; }

/* ---------- Mitglieder-Tabelle (Admin) ---------- */
.member-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.member-table th {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.member-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.member-table tr:last-child td { border-bottom: none; }
.member-name { font-weight: 600; }
.member-table form { margin: 0; }
.chat-msg.system { color: var(--text-dim); font-style: italic; font-size: 0.85rem; }
.member-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.member-search input[type="search"] {
  flex: 1;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  padding: 9px 13px;
}
.member-search input[type="search"]:focus { outline: none; border-color: var(--cyan); }
.member-search select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  padding: 9px 13px;
}
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }
.form input.pw-ok {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}
.form input.pw-bad { border-color: var(--red); }
.flash { cursor: pointer; transition: opacity 0.4s ease, transform 0.4s ease; }
.flash.hide { opacity: 0; transform: translateY(-6px); }
.pw-rules { list-style: none; margin: -4px 0 0; padding: 0; font-size: 0.85rem; }
.pw-rules li { color: var(--text-dim); padding: 2px 0; }
.pw-rules li::before { content: "✕ "; color: var(--red); font-weight: 700; }
.pw-rules li.ok { color: var(--text); }
.pw-rules li.ok::before { content: "✓ "; color: var(--cyan); }
