/* Elektro Board – Dark Electro Theme */
:root {
  --color-bg: #0a1628;
  --color-bg-elevated: #0f1f38;
  --color-bg-card: #122a4a;
  --color-surface: #163356;
  --color-border: rgba(30, 144, 255, 0.22);
  --color-border-strong: rgba(30, 144, 255, 0.45);
  --color-text: #e8f0fa;
  --color-text-muted: #94a8c4;
  --color-text-dim: #6b829e;
  --color-blue: #1e90ff;
  --color-blue-glow: rgba(30, 144, 255, 0.35);
  --color-amber: #f0b429;
  --color-amber-glow: rgba(240, 180, 41, 0.3);
  --color-copper: #c47a2c;
  --color-copper-dim: #9a5f24;
  --color-success: #2ecc71;
  --color-warning: #f0b429;
  --color-error: #e74c3c;
  --font-ui: "Bahnschrift", "DIN Alternate", "Segoe UI", "Trebuchet MS", Geneva, Verdana, sans-serif;
  --font-display: "Bahnschrift", "DIN Alternate", "Segoe UI", sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow-blue: 0 0 20px var(--color-blue-glow);
  --shadow-glow-amber: 0 0 18px var(--color-amber-glow);
  --header-h: 72px;
  --nav-h: 52px;
  --ticker-h: 36px;
  --transition: 0.25s ease;
  --max-width: 1200px;
  --float-size: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 144, 255, 0.12), transparent),
    linear-gradient(180deg, var(--color-bg) 0%, #071018 100%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-amber);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75em;
  color: var(--color-text);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* —— News ticker —— */
.news-ticker {
  position: sticky;
  top: 0;
  z-index: 120;
  height: var(--ticker-h);
  background: linear-gradient(90deg, #061018, var(--color-bg-elevated) 20%, var(--color-bg-elevated) 80%, #061018);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.news-ticker__label {
  flex-shrink: 0;
  padding: 0 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: linear-gradient(135deg, var(--color-amber), var(--color-copper));
}

.news-ticker__track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.news-ticker__inner {
  display: flex;
  width: max-content;
  animation: ticker-scroll 45s linear infinite;
}

.news-ticker__inner:hover {
  animation-play-state: paused;
}

.news-ticker__item {
  padding: 0 2.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.news-ticker__item strong {
  color: var(--color-amber);
  font-weight: 600;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 110;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

body.has-ticker .site-header {
  top: var(--ticker-h);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  min-height: var(--header-h);
  flex-wrap: nowrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, 280px);
}

.site-logo:hover {
  color: var(--color-text);
}

.site-logo .protected-media.brand-logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  align-self: center;
  margin: 0;
  background: transparent;
}

.site-logo .brand-logo canvas,
.site-logo .brand-logo .protected-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.site-logo img,
.site-logo svg {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: block;
}

.brand-word {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  line-height: 1.2;
  min-width: 0;
}

.brand-word strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-logo__tag {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--color-text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: normal;
}

@media (min-width: 901px) {
  :root {
    --header-h: 84px;
  }

  .site-logo {
    max-width: none;
    gap: 0.7rem;
  }

  .site-header__inner {
    height: var(--header-h);
    min-height: var(--header-h);
  }

  .site-logo .protected-media.brand-logo {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    margin: 0;
    align-self: center;
  }

  .site-logo img,
  .site-logo svg {
    width: 72px;
    height: 72px;
  }

  .nav-menu {
    flex-wrap: nowrap;
  }

  .brand-word strong {
    font-size: 1.15rem;
  }

  .site-logo__tag {
    font-size: 0.68rem;
  }
}


/* —— Nav —— */
.main-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: rgba(15, 31, 56, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.main-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.nav-toggle:hover {
  border-color: var(--color-blue);
  box-shadow: var(--shadow-glow-blue);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-amber);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-menu {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-menu a:hover,
.nav-menu a.is-active {
  color: var(--color-text);
  background: rgba(30, 144, 255, 0.12);
}

.nav-menu a.is-active {
  box-shadow: inset 0 -2px 0 var(--color-amber);
}

.nav-menu a.btn--primary {
  color: #061018;
  background: linear-gradient(135deg, #ffe08a, var(--color-amber) 55%, var(--color-copper));
  border: 1px solid #ffe08a;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(6, 16, 24, 0.35), 0 4px 16px rgba(240, 180, 41, 0.45);
}

.nav-menu a.btn--primary:hover {
  color: #ffffff;
  background: #122a4a;
  border-color: #1e4a7a;
  box-shadow: none;
}

.nav-menu a.btn--primary.is-active {
  color: #061018;
  background: linear-gradient(135deg, #fff1c2, #ffe08a 40%, var(--color-amber));
  box-shadow: 0 0 0 1px rgba(6, 16, 24, 0.35), var(--shadow-glow-amber);
}

/* —— Hero —— */
.hero {
  position: relative;
  min-height: clamp(320px, 55vh, 520px);
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(10, 22, 40, 0.85) 0%, rgba(10, 22, 40, 0.55) 50%, rgba(10, 22, 40, 0.9) 100%),
    var(--hero-circuit, url("../img/hero-circuit.svg")) center/cover no-repeat;
}

.hero__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(30, 144, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 144, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent);
}

.hero__spark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero__spark::before,
.hero__spark::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--color-amber), var(--color-blue), transparent);
  opacity: 0.6;
  filter: blur(0.5px);
  animation: spark-flicker 4s ease-in-out infinite;
}

.hero__spark::before {
  top: 15%;
  left: 22%;
  transform: rotate(25deg);
  animation-delay: 0s;
}

.hero__spark::after {
  top: 30%;
  right: 18%;
  transform: rotate(-15deg);
  animation-delay: 1.8s;
  height: 90px;
}

.hero__bolt {
  position: absolute;
  right: 8%;
  bottom: 10%;
  width: min(180px, 28vw);
  height: min(180px, 28vw);
  opacity: 0.15;
  animation: bolt-pulse 3s ease-in-out infinite;
}

@keyframes spark-flicker {
  0%, 100% { opacity: 0.2; transform: scaleY(0.8); }
  15% { opacity: 0.85; transform: scaleY(1.1); }
  30% { opacity: 0.35; }
  45% { opacity: 0.9; }
  60% { opacity: 0.25; }
}

@keyframes bolt-pulse {
  0%, 100% { opacity: 0.12; filter: drop-shadow(0 0 8px var(--color-blue-glow)); }
  50% { opacity: 0.22; filter: drop-shadow(0 0 16px var(--color-amber-glow)); }
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 3rem 0;
  max-width: 640px;
}

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-amber);
  border: 1px solid var(--color-copper);
  border-radius: 999px;
  background: rgba(196, 122, 44, 0.15);
}

.hero__title {
  margin-bottom: 0.5em;
  background: linear-gradient(120deg, var(--color-text) 30%, var(--color-blue) 70%, var(--color-amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  color: #061018;
  background: linear-gradient(135deg, var(--color-amber), var(--color-copper));
  border-color: var(--color-copper-dim);
  box-shadow: 0 4px 14px rgba(240, 180, 41, 0.25);
}

.btn--primary:hover {
  box-shadow: var(--shadow-glow-amber);
  color: #061018;
}

.btn--secondary {
  color: var(--color-text);
  background: rgba(30, 144, 255, 0.15);
  border-color: var(--color-border-strong);
}

.btn--secondary:hover {
  background: rgba(30, 144, 255, 0.28);
  box-shadow: var(--shadow-glow-blue);
  color: var(--color-text);
}

a.btn[href*="registrieren.php"]:hover {
  color: #ffffff;
  background: #122a4a;
  border-color: #1e4a7a;
  box-shadow: none;
}

.btn--ghost {
  color: var(--color-text-muted);
  background: transparent;
  border-color: var(--color-border);
}

.btn--ghost:hover {
  color: var(--color-text);
  border-color: var(--color-blue);
}

.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

.btn--icon {
  padding: 0.5rem;
  width: 40px;
  height: 40px;
}

.btn.is-liked,
.btn[data-like-post].is-liked {
  color: var(--color-amber);
  border-color: var(--color-amber);
  background: rgba(240, 180, 41, 0.12);
}

.btn.is-following,
.btn[data-follow-user].is-following {
  color: var(--color-blue);
  border-color: var(--color-blue);
}

/* —— Cards —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-md);
}

.card--clickable {
  position: relative;
  cursor: pointer;
}

.card__stretch-link {
  position: absolute;
  inset: 0;
  z-index: 4;
  text-indent: -9999px;
  overflow: hidden;
}

.card--clickable:focus-within {
  border-color: var(--color-amber);
  box-shadow: var(--shadow-glow-amber);
}

.card--clickable .card__title {
  color: var(--color-text);
}

.news-filter {
  margin: 0 0 1.5rem;
  max-width: 420px;
}

.news-filter__hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.news-detail__body {
  line-height: 1.75;
}

.news-detail__body a {
  color: var(--color-amber);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.news-detail__body a:hover {
  color: var(--color-blue);
}

.card[hidden] {
  display: none !important;
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-elevated);
  overflow: hidden;
}

.card__body {
  padding: 1.15rem 1.25rem 1.25rem;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  color: var(--color-text-dim);
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: 0.5em;
}

.card__title a {
  color: var(--color-text);
}

.card__title a:hover {
  color: var(--color-blue);
}

.card__excerpt {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* —— Protected media —— */
.protected-media {
  position: relative;
  display: inline-block;
  max-width: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.protected-media canvas {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.card__media > .protected-media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.card__media canvas {
  width: 100%;
  height: 100%;
}

.protected-media__shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

.protected-media--loading {
  min-height: 120px;
  background: linear-gradient(110deg, var(--color-bg-elevated) 8%, var(--color-surface) 18%, var(--color-bg-elevated) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* —— Forms —— */
.form-section {
  margin-bottom: 2.5rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px var(--color-blue-glow);
}

.form-control::placeholder {
  color: var(--color-text-dim);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-check input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: var(--color-blue);
}

.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-captcha {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(30, 144, 255, 0.08);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
}

.form-captcha.is-visible {
  display: block;
  animation: fade-in 0.35s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-captcha__question {
  font-weight: 600;
  color: var(--color-amber);
  margin-bottom: 0.5rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: 0.35rem;
}

.form-error {
  font-size: 0.85rem;
  color: var(--color-error);
  margin-top: 0.35rem;
}

/* —— Contact / icon rows —— */
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.contact-row__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  color: var(--color-amber);
}

.contact-row__icon img,
.contact-row__icon svg {
  width: 100%;
  height: 100%;
}

.obf-mail {
  display: inline-block;
  cursor: pointer;
  color: var(--color-blue);
  border-bottom: 1px dotted var(--color-border-strong);
  user-select: none;
}

.obf-mail:hover {
  color: var(--color-amber);
}

.obf-rev {
  direction: rtl;
  unicode-bidi: bidi-override;
}

/* —— Flash messages —— */
#flash-msg,
.flash-msg,
.flash {
  position: relative;
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  margin: 0.75rem calc(50% - 50vw) 1rem;
  padding: 0.95rem max(1.25rem, calc((100vw - var(--max-width)) / 2 + 1.25rem));
  border-radius: 0;
  scroll-margin-top: calc(var(--header-h) + var(--nav-h) + var(--ticker-h) + 1rem);
  font-size: 0.95rem;
  border-left: 0;
  border-right: 0;
  animation: flash-in 0.4s ease;
}

.admin-login .flash {
  width: auto;
  max-width: none;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border-left: 1px solid;
  border-right: 1px solid;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-msg--success,
#flash-msg.flash-success {
  background: rgba(46, 204, 113, 0.12);
  border-color: rgba(46, 204, 113, 0.45);
  color: #a8e6c4;
}

.flash-msg--error,
#flash-msg.flash-error {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.45);
  color: #f5b7b1;
}

.flash-msg--info,
#flash-msg.flash-info {
  background: rgba(30, 144, 255, 0.12);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.flash-msg__close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

/* —— Chat —— */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: min(520px, 70vh);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-header {
  padding: 0.85rem 1.15rem;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-header__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

#chat-thread,
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  line-height: 1.45;
}

.chat-msg--in {
  align-self: flex-start;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
}

.chat-msg--out {
  align-self: flex-end;
  background: rgba(30, 144, 255, 0.2);
  border: 1px solid var(--color-border-strong);
}

.chat-msg__time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--color-text-dim);
}

.chat-compose {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.chat-compose input {
  flex: 1;
}

.chat-compose .btn {
  flex-shrink: 0;
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--color-text-dim);
  font-size: 0.9rem;
}

/* —— User search —— */
.user-search-wrap {
  position: relative;
}

.user-search-results {
  position: absolute;
  z-index: 50;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: none;
}

.user-search-results.is-open {
  display: block;
}

.user-search-results li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-search-results a,
.user-search-results button {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  text-align: left;
  background: none;
  border: none;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.user-search-results a:hover,
.user-search-results button:hover {
  background: rgba(30, 144, 255, 0.12);
}

/* —— Cookie notice —— */
.cookie-notice {
  position: fixed;
  z-index: 1000;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: rgba(15, 31, 56, 0.97);
  border-top: 1px solid var(--color-border-strong);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-notice.is-visible {
  transform: translateY(0);
}

.nl-prompt {
  position: fixed;
  z-index: 980;
  right: 1.25rem;
  bottom: 1.25rem;
  width: min(360px, calc(100vw - 2rem));
  padding: 1.15rem 1.2rem 1.2rem;
  background: rgba(13, 31, 53, 0.98);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
}

.nl-prompt[hidden] {
  display: none;
}

.nl-prompt h2 {
  margin: 0 2rem 0.4rem 0;
  font-size: 1.15rem;
}

.nl-prompt p {
  margin: 0 0 0.9rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.nl-prompt .form-group {
  margin-bottom: 0.7rem;
}

.nl-prompt .form-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.nl-prompt__close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.nl-prompt__close:hover {
  color: var(--color-text);
}

.cookie-notice__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-notice p {
  flex: 1 1 280px;
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.cookie-notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* —— Sound toggle (bottom left) —— */
.sound-toggle {
  position: fixed;
  z-index: 890;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  color: var(--color-amber);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow var(--transition);
}

.sound-toggle:hover {
  box-shadow: var(--shadow-glow-amber);
}

.sound-toggle.is-playing {
  border-color: var(--color-amber);
  box-shadow: var(--shadow-glow-amber);
}

.sound-toggle svg {
  display: block;
}

.sound-toggle__on[hidden],
.sound-toggle__off[hidden] {
  display: none;
}

.sound-toggle.is-playing .sound-wave {
  transform-origin: 14px 12px;
  animation: sound-wave 1.15s ease-in-out infinite;
}

.sound-toggle.is-playing .sound-wave--2 {
  animation-delay: 0.18s;
}

@keyframes sound-wave {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (max-width: 700px) {
  .sound-toggle {
    left: max(0.85rem, env(safe-area-inset-left));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }
}

/* —— Footer —— */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 0.7rem;
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 2rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.footer-about {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.footer-links {
  justify-self: end;
  width: 100%;
  text-align: right;
}

.footer-links h4,
.footer-links a {
  text-align: right;
}

.footer-links ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.85rem;
}

.footer-links li {
  margin: 0;
}

.site-footer h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-amber);
  margin: 0 0 0.3rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.15rem;
}

.site-footer a {
  color: var(--color-text-muted);
  font-size: 0.84rem;
}

.site-footer a:hover {
  color: var(--color-blue);
}

.site-footer__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-dim);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
}

.site-footer__copy {
  margin: 0;
}

.site-footer__copy a {
  color: var(--color-text-dim);
  text-decoration: none;
}

.site-footer__copy a:hover {
  color: var(--color-amber);
}

.visitor-count {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}

.visitor-count strong {
  color: var(--color-copper);
  font-weight: 600;
}

.footer-credit a {
  color: var(--color-text-dim);
}

.footer-credit a:hover {
  color: var(--color-blue);
}

/* —— Admin —— */
.admin-bar {
  background: linear-gradient(90deg, var(--color-copper-dim), var(--color-copper));
  color: #fff;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  text-align: center;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 40px);
  gap: 0;
}

.admin-sidebar {
  background: var(--color-bg-elevated);
  border-right: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.admin-sidebar nav a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.is-active {
  color: var(--color-text);
  background: rgba(30, 144, 255, 0.1);
  border-left-color: var(--color-amber);
}

.admin-main {
  padding: 1.5rem 2rem;
  background: var(--color-bg);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-dim);
  background: var(--color-bg-elevated);
}

.admin-table tr:hover td {
  background: rgba(30, 144, 255, 0.05);
}

.admin-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(30, 144, 255, 0.2);
  color: var(--color-blue);
}

.admin-login {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-stat {
  padding: 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.admin-stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-amber);
  font-family: var(--font-display);
}

.admin-stat__label {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* —— Main content sections —— */
.main-content {
  padding: 2rem 0 3rem;
}

.section-title {
  margin-bottom: 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--color-border);
}

.section-title span {
  color: var(--color-copper);
}

.page-header {
  margin-bottom: 2rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-dim);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--color-text-muted);
}

/* —— Mobile —— */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
  }

  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .section {
    padding-left: 0;
    padding-right: 0;
  }

  .section.container,
  .container.section,
  article.container,
  main .container {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
    box-sizing: border-box;
  }

  .hero__content {
    padding: 2rem 1.35rem;
    box-sizing: border-box;
  }

  .site-header__inner {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .news-detail__body,
  .news-detail h1,
  .card__body,
  .form-section,
  .chat-panel {
    word-wrap: break-word;
    overflow-wrap: anywhere;
  }

  .nav-toggle {
    display: flex;
  }

  .site-footer__grid,
  .site-footer__bottom {
    grid-template-columns: 1fr;
  }

  .site-footer__legal {
    justify-content: flex-start;
  }

  .footer-links,
  .footer-links h4,
  .footer-links a {
    text-align: left;
  }

  .footer-links ul {
    justify-content: flex-start;
  }

  .visitor-count {
    justify-self: start;
  }

  .nav-menu {
    position: fixed;
    top: calc(var(--header-h) + var(--nav-h));
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.35rem;
    background: rgba(10, 22, 40, 0.98);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
  }

  body.has-ticker .nav-menu {
    top: calc(var(--ticker-h) + var(--header-h));
  }

  .nav-menu.is-open {
    max-height: 80vh;
    opacity: 1;
    overflow-y: auto;
  }

  .nav-menu a {
    padding: 0.85rem 1rem;
  }

  .cookie-notice {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .cookie-notice__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-notice__actions {
    justify-content: stretch;
  }

  .cookie-notice__actions .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .container,
  .section.container,
  .container.section,
  article.container,
  main .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero__content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .news-ticker__label {
    padding: 0 0.6rem;
    font-size: 0.6rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Compat aliases */
.btn-primary,
.btn-accent {
  background: linear-gradient(135deg, var(--color-amber), var(--color-copper));
  color: #0a1628;
  border: 0;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.btn-sm { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
.copyright-admin-link { text-decoration: none !important; color: inherit; }
.flash {
  scroll-margin-top: 5rem;
}
.flash-success { background: rgba(46, 204, 113, 0.15); border: 1px solid var(--color-success); }
.flash-error { background: rgba(231, 76, 60, 0.15); border: 1px solid var(--color-error); }
.flash-info { background: rgba(30, 144, 255, 0.15); border: 1px solid var(--color-blue); }
.footer-logo { display: inline-block; width: 22px; height: 32px; }
.footer-logo .protected-canvas { width: 22px !important; height: 32px !important; }
.protected-media.footer-logo {
  width: 22px;
  height: 32px;
  flex-shrink: 0;
  background: transparent;
}
@media (min-width: 901px) {
  .footer-logo,
  .protected-media.footer-logo {
    width: 22px;
    height: 32px;
  }
  .footer-logo .protected-canvas {
    width: 22px !important;
    height: 32px !important;
  }
}
.footer-contact p {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.84rem;
}
.footer-contact img { flex-shrink: 0; }
.protected-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--color-bg-card);
}
.protected-canvas { width: 100%; height: auto; display: block; }
.protected-overlay { position: absolute; inset: 0; z-index: 2; }
.site-header .site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  width: 100%;
}
.nav-menu {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 1rem;
  min-width: 0;
}
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  background: var(--color-amber);
  color: #0a1628;
  padding: 0.5rem 1rem;
}
.nav-msg-badge {
  display: inline-flex;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-amber);
  color: #0a1628;
  font-size: 0.7rem;
  font-weight: 700;
}
.nav-msg-badge[hidden] { display: none; }
.obf-rev { unicode-bidi: bidi-override; direction: rtl; }
.obf-mail-at::before { content: "@"; }
.text-muted { color: var(--color-text-muted); }
.section { padding: 2.5rem 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 901px) {
  .card-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 1.5rem 0 3rem; }
.admin-nav a { display: block; padding: 0.4rem 0; color: var(--color-text-muted); }
.admin-nav a.is-active,
.admin-nav a:hover { color: var(--color-amber); }
@media (max-width: 800px) {
  .admin-layout { grid-template-columns: 1fr; }
  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg-elevated);
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
  }
  body.has-ticker .nav-menu {
    top: calc(var(--ticker-h) + var(--header-h));
  }
  .nav-menu.is-open { display: flex; }
  .nav-toggle { display: flex; }
}

/* Logo: rundes Blitz-Zeichen */
@media (min-width: 901px) {
  .site-header .site-logo .protected-media.brand-logo,
  .site-header .site-logo .brand-logo canvas,
  .site-header .site-logo .brand-logo .protected-canvas {
    width: 72px !important;
    height: 72px !important;
    max-width: none !important;
    max-height: none !important;
  }
  .site-header .site-logo .protected-media.brand-logo {
    flex: 0 0 72px !important;
    align-self: center !important;
    margin-top: 0 !important;
    background: transparent !important;
    overflow: hidden;
  }
}
@media (max-width: 900px) {
  .site-header .site-logo .protected-media.brand-logo,
  .site-header .site-logo .brand-logo canvas,
  .site-header .site-logo .brand-logo .protected-canvas {
    width: 56px !important;
    height: 56px !important;
    max-width: none !important;
    max-height: none !important;
  }
  .site-header .site-logo .protected-media.brand-logo {
    flex: 0 0 56px !important;
    align-self: center !important;
    margin-top: 0 !important;
    background: transparent !important;
  }
}
