@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Creepster&family=Bebas+Neue&family=Roboto+Mono:wght@400;500;600&family=Roboto:wght@400;500;700&family=Black+Ops+One&display=swap');

:root {
  /* "Blut & Beton" - Standardpalette (7 Days to Die-Horror-Look) */
  --bg: #141414;
  --bg-panel: #191919;
  --bg-raised: #1f2320;
  --border: #2e332f;
  --border-strong: #3c4238;
  --toxic: #a60606;
  --toxic-dim: #8a0505;
  --blood: #8b0000;
  --rust: #cf8433;
  --bone: #e5e5e5;
  --bone-dim: #8ca38f;
  --shadow-drip: rgba(166, 6, 6, 0.1);
  /* Rahmen-/Akzentfarbe, folgt dem Theme (anders als --blood, das bewusst
     immer Rot bleibt, weil es "Gefahr/Fehler" bedeutet) */
  --frame: #8b0000;
  --frame-rgb: 139, 0, 0;
  --toxic-rgb: 166, 6, 6;
  /* Signalfarben mit fester Bedeutung, unabhängig vom Theme */
  --ok: #4fae5b;
  --ok-rgb: 79, 174, 91;
  --alert: #e04848;
  --radius: 8px;
  --radius-sm: 5px;
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ---------- Farb-Themes (Dashboard -> System -> Design) ---------- */
/* 'red' ist die Standardpalette oben (Blut & Beton) und braucht deshalb
   keinen eigenen Block. 'green' ist der ursprüngliche Toxic-Look als
   Alternative, 'blue' eine weitere Option. */
:root[data-theme='green'] {
  --toxic: #9fc73c;
  --toxic-dim: #6f8f2a;
  --shadow-drip: rgba(159, 199, 60, 0.08);
  --frame: #6f8f2a;
  --frame-rgb: 111, 143, 42;
  --toxic-rgb: 159, 199, 60;
}
:root[data-theme='blue'] {
  --toxic: #3ca7d9;
  --toxic-dim: #2a7ea8;
  --shadow-drip: rgba(60, 167, 217, 0.08);
  --frame: #2a7ea8;
  --frame-rgb: 42, 126, 168;
  --toxic-rgb: 60, 167, 217;
}

/* ---------- Schrift-Themes ---------- */
:root[data-font='creepster'] {
  --font-heading: 'Creepster', cursive;
}
:root[data-font='bebas'] {
  --font-heading: 'Bebas Neue', sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
}
:root[data-font='blackops'] {
  --font-heading: 'Black Ops One', 'Oswald', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  color: var(--bone);
  font-family: var(--font-body);
  min-height: 100vh;
}

h1, h2, h3, h4, .brand, .nav-item, .btn {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
}

.hidden { display: none !important; }

/* ---------- Login ---------- */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 360px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  padding: 2.5rem 2rem;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--toxic), var(--blood));
}

.brand { text-align: center; margin-bottom: 1.75rem; }
.brand-mark-img { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto 0.5rem; filter: drop-shadow(0 0 12px rgba(178,59,50,0.35)); }
.brand-wordmark-img { max-width: 260px; width: 100%; height: auto; display: block; margin: 0 auto; }
.brand-sub { color: var(--bone-dim); font-size: 0.85rem; margin: 0.5rem 0 0; }

#login-form label {
  display: block;
  font-size: 0.75rem;
  color: var(--bone-dim);
  margin-bottom: 1rem;
  text-transform: none;
}
#login-form input {
  width: 100%;
  margin-top: 0.35rem;
}
.error-text { color: var(--blood); font-size: 0.8rem; min-height: 1.2em; }

/* ---------- Inputs / Buttons ---------- */
input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--bone);
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--toxic);
}

.btn {
  display: inline-block;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--bone);
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  border-radius: var(--radius-sm);
}
.btn:hover { border-color: var(--toxic); }
.btn-primary { background: var(--toxic-dim); border-color: var(--toxic); color: #0e1207; }
.btn-primary:hover { background: var(--toxic); }
.btn-secondary { background: var(--bg-raised); }
.btn-danger {
  position: relative;
  border-color: var(--blood);
  color: var(--blood);
  background: transparent;
  overflow: hidden;
  z-index: 0;
}
.btn-danger:hover { background: rgba(178,59,50,0.15); }
/* Splatter-Hover: Blutspritzer-Effekt bei kritischen Aktionen (Löschen,
   Zurücksetzen, Deaktivieren, ...) - reine CSS-Radial-Gradients statt
   einer SVG-Datei, damit es sich sofort und ohne Ladezeit auslöst. */
.btn-danger::before {
  content: '';
  position: absolute;
  inset: -40%;
  z-index: -1;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease-out, transform 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  background:
    radial-gradient(circle at 20% 30%, rgba(139,0,0,0.9) 0%, transparent 14%),
    radial-gradient(circle at 75% 20%, rgba(166,6,6,0.85) 0%, transparent 10%),
    radial-gradient(circle at 55% 70%, rgba(139,0,0,0.9) 0%, transparent 16%),
    radial-gradient(circle at 85% 80%, rgba(166,6,6,0.8) 0%, transparent 11%),
    radial-gradient(circle at 30% 85%, rgba(139,0,0,0.7) 0%, transparent 9%);
}
.btn-danger:hover::before { opacity: 1; transform: scale(1); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-link { background: none; border: none; color: var(--bone-dim); cursor: pointer; text-decoration: underline; font-family: inherit; }
.btn-link:hover { color: var(--toxic); }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-mark-img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.sidebar-brand-wordmark-img { display: block; max-width: 140px; width: 100%; height: auto; margin-bottom: 0.15rem; }
.sidebar-brand small { color: var(--bone-dim); font-size: 0.7rem; }

.nav { display: flex; flex-direction: column; padding: 0.75rem 0.5rem; gap: 0.15rem; flex: 1; overflow-y: auto; }
.nav-section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bone-dim); padding: 0.9rem 0.6rem 0.25rem; }
.nav-section-label:first-child { padding-top: 0.25rem; }
.nav-item {
  text-align: left;
  background: none;
  border: none;
  color: var(--bone-dim);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--bone); background: rgba(var(--toxic-rgb), 0.06); }
.nav-item.active { color: var(--toxic); border-left-color: var(--toxic); background: rgba(var(--toxic-rgb), 0.08); }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--border); }
.pill { font-size: 0.7rem; padding: 0.25rem 0.6rem; border: 1px solid var(--border-strong); display: inline-block; margin-bottom: 0.6rem; border-radius: 999px; }
.pill-on { color: var(--toxic); border-color: var(--toxic); }
.pill-off { color: var(--blood); border-color: var(--blood); }
.user-box { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--bone-dim); }

.content { flex: 1; padding: 2rem 2.5rem; overflow-y: auto; height: 100vh; }

.view { display: none; }
.view.active { display: block; }

.view-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.view-header h2 { margin: 0 0 0.25rem; font-size: 1.5rem; color: var(--bone); }
.view-header p { margin: 0; color: var(--bone-dim); font-size: 0.85rem; }

/* ---------- Panels / cards ---------- */
.panel {
  position: relative;
  background: var(--bg-panel);
  border: 2px solid var(--frame);
  box-shadow: 0 0 12px rgba(var(--frame-rgb), 0.25);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
}
/* Verwitterte Metall-Ecken: Rost-/Blutschleier per CSS statt einem
   handgezeichneten border-image-Asset (dafür hätten wir kein echtes
   Design-Bild - das hier ist die robustere Annäherung ohne Bilddatei). */
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--frame-rgb), 0.35) 0%, transparent 22%),
    radial-gradient(circle at 100% 0%, rgba(46, 51, 47, 0.5) 0%, transparent 26%),
    radial-gradient(circle at 100% 100%, rgba(var(--frame-rgb), 0.3) 0%, transparent 24%),
    radial-gradient(circle at 0% 100%, rgba(46, 51, 47, 0.55) 0%, transparent 28%);
}
.panel h3 { margin-top: 0; font-size: 1.05rem; color: var(--toxic); }
.panel h4 { color: var(--bone-dim); font-size: 0.85rem; margin-bottom: 0.5rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
@media (max-width: 980px) { .three-col { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.status-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
}
.status-card.ok { border-left-color: var(--toxic); }
.status-card.bad { border-left-color: var(--blood); }
.status-card .label { color: var(--bone-dim); font-size: 0.75rem; }
.status-card .value { font-family: var(--font-heading); font-size: 1.4rem; margin-top: 0.2rem; }

.muted { color: var(--bone-dim); }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.85rem; }
.data-table.small { font-size: 0.78rem; }
.data-table th {
  text-align: left;
  color: var(--bone-dim);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding: 0.4rem 0.5rem;
}
.data-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); }
.data-table tr:hover td { background: rgba(var(--toxic-rgb), 0.04); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.form-grid label, .inline-form label { display: flex; flex-direction: column; font-size: 0.75rem; color: var(--bone-dim); gap: 0.3rem; }
.inline-form { display: flex; gap: 0.6rem; align-items: end; margin-bottom: 0.5rem; flex-wrap: wrap; }
.checkbox-line { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--bone-dim); }

/* ---------- Chat center ---------- */
.chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; height: calc(100vh - 220px); }
.chat-sidebar { background: var(--bg-panel); border: 1px solid var(--border); padding: 1rem; display: flex; flex-direction: column; gap: 0.85rem; border-radius: var(--radius); }
.chat-identity { font-size: 0.75rem; color: var(--toxic); border: 1px dashed var(--border-strong); padding: 0.5rem; border-radius: var(--radius-sm); font-family: var(--font-mono); }

.chat-avatar-wrap {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}
.chat-channel-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--toxic);
  background: var(--bg);
  display: block;
}
.chat-channel-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* ---------- Mini-Avatare (Dashboard, Kanal-Karten, Statistik-Listen) ---------- */
.mini-avatar {
  display: inline-block;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-raised) center/cover no-repeat;
  border: 1px solid var(--border-strong);
  vertical-align: middle;
  margin-right: 0.4rem;
  flex: none;
}
.mini-avatar.lg { width: 38px; height: 38px; border: 2px solid var(--border-strong); margin-right: 0.6rem; }
.channel-card.is-primary .mini-avatar.lg { border-color: var(--toxic); }
.chat-main { display: flex; flex-direction: column; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 0.75rem 1rem; font-size: 0.85rem; font-family: var(--font-mono); }
.chat-msg { margin-bottom: 0.4rem; line-height: 1.4; }
.chat-msg .u { color: var(--toxic); font-weight: 600; }
.chat-msg .u.mod { color: var(--rust); }
.chat-msg .t { color: var(--bone-dim); font-size: 0.7rem; margin-right: 0.4rem; }
.chat-input-row { display: flex; border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; border: none; border-radius: 0; }
.chat-input-row button { border-radius: 0; }

/* ---------- Event feed / logs ---------- */
.event-feed, .simple-list { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; max-height: 320px; overflow-y: auto; }
.event-feed li, .simple-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--border); color: var(--bone-dim); }
.event-feed li strong { color: var(--toxic); }

/* ---------- Horror-Panel: Live-Streamer (Dashboard) ---------- */
.panel-horror {
  position: relative;
  border-color: var(--blood);
  background: linear-gradient(180deg, rgba(178,59,50,0.06), transparent 40%), var(--bg-panel);
  overflow: visible;
  padding-top: 2.75rem;
  align-self: start;
}
.panel-horror .drip-border {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 48px;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.55));
}
.panel-horror h3 {
  color: var(--blood);
  text-shadow: 0 0 10px rgba(178, 59, 50, 0.45);
  letter-spacing: 0.03em;
}

.live-streamer-item {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem !important;
  margin-bottom: 0.45rem;
  background: rgba(178, 59, 50, 0.07);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blood);
  border-radius: var(--radius-sm);
}
.live-streamer-item .mini-avatar {
  border-color: var(--blood);
  box-shadow: 0 0 9px rgba(178, 59, 50, 0.55);
}
.live-streamer-name {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--bone);
  text-shadow: 0 0 6px rgba(178, 59, 50, 0.35);
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blood);
  flex: none;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 3px 0 rgba(178, 59, 50, 0.7); }
  50% { box-shadow: 0 0 12px 3px rgba(178, 59, 50, 0.9); }
}

.log-output {
  position: relative;
  background: #050705;
  border: 1px solid var(--border-strong);
  padding: 0.75rem;
  height: 320px;
  overflow-y: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
  color: #4ade6a;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  text-shadow: 0 0 3px rgba(74, 222, 106, 0.35);
}
/* Scanline-Overlay - klassischer kaputter Röhrenmonitor-Look */
.log-output::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.25) 0px,
    rgba(0, 0, 0, 0.25) 1px,
    transparent 1px,
    transparent 3px
  );
}
.log-line-ERROR { color: #ff4d4d; text-shadow: 0 0 4px rgba(255,77,77,0.4); }
.log-line-WARN { color: var(--rust); text-shadow: 0 0 4px rgba(207,132,51,0.35); }
.log-line-INFO { color: #4ade6a; }
.log-line-DEBUG { color: #2f8f45; }

/* ---------- Rank lists ---------- */
.rank-list { padding-left: 1.4rem; font-size: 0.9rem; }
.rank-list li { margin-bottom: 0.4rem; }

.stats-row { display: flex; gap: 1.5rem; margin: 1rem 0; font-size: 0.85rem; color: var(--bone-dim); }
.stats-row strong { color: var(--toxic); display: block; font-family: var(--font-heading); font-size: 1.3rem; }

/* ---------- Fischarten-Karten ---------- */
/* Browser-Standard-Spinner bei number-Inputs entfernen - sehen in diesem
   Theme fremd aus und fressen unnötig Breite in den engen Feldern. */
input[type='number'] { -moz-appearance: textfield; }
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.fish-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.fish-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
}
.fish-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.fish-card-header .fish-emoji-input {
  width: 46px;
  flex: none;
  text-align: center;
  font-size: 1.3rem;
  padding: 0.4rem 0.2rem;
}
.fish-card-remove {
  flex: none;
  line-height: 1;
  padding: 0.4rem 0.6rem;
}
.fish-card .fish-name-input {
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
}
.fish-card .fish-field-label {
  display: block;
  font-size: 0.68rem;
  color: var(--bone-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.fish-card .fish-rarity-input { width: 100%; margin-bottom: 0.75rem; }
.fish-card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.75rem; }
.fish-card-grid-2 input { width: 100%; }
.fish-card-grid-2 .fish-weight-row { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

/* ---------- Kanal-Karten (Twitch -> Kanäle) ---------- */
.channel-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.channel-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
}
.channel-card.is-primary { border-color: var(--toxic); }
.channel-card-header {
  margin-bottom: 0.3rem;
}
.channel-card-title { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; }
.channel-name { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; color: var(--bone); }
.channel-card-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.channel-card-badges .pill { margin-bottom: 0; }
.channel-card-meta { color: var(--bone-dim); font-size: 0.78rem; margin-bottom: 0.85rem; }

/* Einheitliche An/Aus-Darstellung, überall im Dashboard wiederverwendbar */
.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--bone-dim);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  border-radius: 999px;
}
.toggle-pill:hover { border-color: var(--bone-dim); }
.toggle-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--blood); flex: none; }
.toggle-pill.is-on { color: var(--toxic); border-color: var(--toxic); }
.toggle-pill.is-on::before { background: var(--toxic); }

.channel-card-toggles { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.85rem; }
.channel-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

/* ---------- Statistiken: Titel-Zeile mit Reset-Button ---------- */
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.panel-title-row h3 { margin: 0; }

/* ---------- Themed Bestätigungs-Modal (statt Browser-confirm()) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modal-fade-in 0.15s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--blood);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(178, 59, 50, 0.25);
}
.modal-box h3 {
  margin: 0 0 0.75rem;
  color: var(--blood);
  font-family: var(--font-heading);
  text-shadow: 0 0 8px rgba(178, 59, 50, 0.35);
}
.modal-box p {
  margin: 0 0 1.5rem;
  color: var(--bone-dim);
  font-size: 0.9rem;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* ---------- Design-Panel: Theme-Swatches ---------- */
.theme-swatch-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--bone-dim);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
}
.theme-swatch:hover { border-color: var(--bone-dim); }
.theme-swatch.is-active { border-color: var(--toxic); color: var(--bone); box-shadow: 0 0 8px rgba(var(--toxic-rgb), 0.25); }
.theme-swatch-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,0.3); }

/* ---------- Next-Stream-Countdown-Widget (Dashboard) ---------- */
.next-stream-widget {
  border: 2px solid var(--frame);
  box-shadow: 0 0 15px rgba(var(--frame-rgb), 0.35);
  margin-bottom: 1.5rem;
}
.next-stream-widget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.next-stream-widget-header h3 { margin: 0; color: var(--frame); letter-spacing: 0.08em; }
.next-stream-countdown {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--bone);
  text-align: center;
  padding: 0.4rem 0;
}
.next-stream-settings-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.next-stream-settings-panel .form-grid { margin-bottom: 0; }

/* Kritische Phase: pulsierendes Blut-Glow ("gleich geht's los") */
.next-stream-widget.is-critical {
  border-color: var(--blood);
  animation: bloodPulse 2s infinite ease-in-out;
  background: linear-gradient(180deg, rgba(139,0,0,0.15), transparent 60%), var(--bg-panel);
}
.next-stream-widget.is-critical .next-stream-countdown { color: #ff5555; }
@keyframes bloodPulse {
  0% { box-shadow: 0 0 15px rgba(139, 0, 0, 0.6); }
  50% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.9); }
  100% { box-shadow: 0 0 15px rgba(139, 0, 0, 0.6); }
}

/* ---------- Module (Kartenraster mit Ein/Aus-Schalter) ---------- */
.module-summary { margin: 0 0 0.25rem; font-size: 0.9rem; color: var(--bone-dim); }
.module-summary strong { color: var(--toxic); font-family: var(--font-heading); font-size: 1.15rem; }
.module-summary-error { color: var(--alert); font-weight: 600; }
.module-group-title {
  margin: 1.5rem 0 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.module-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.module-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 0.6rem; padding: 1rem 1.15rem; }
.module-card-top { display: flex; align-items: center; gap: 0.75rem; }
.module-icon {
  flex: 0 0 auto;
  width: 2.6rem; height: 2.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.module-card-title { flex: 1 1 auto; min-width: 0; }
.module-card-title h4 { margin: 0; font-size: 1.05rem; color: var(--bone); font-family: var(--font-heading); letter-spacing: 0.02em; }
.module-tech { font-size: 0.7rem; color: var(--bone-dim); opacity: 0.8; }
.module-status {
  flex: 0 0 auto;
  font-size: 0.72rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--bone-dim);
  white-space: nowrap;
}
.module-status::before { content: '● '; }
.module-status.is-running { color: var(--ok); border-color: var(--ok); }
.module-status.is-error { color: #fff; background: var(--alert); border-color: var(--alert); font-weight: 600; }
.module-desc { margin: 0; flex: 1 1 auto; font-size: 0.82rem; line-height: 1.4; color: var(--bone-dim); }
.module-card-actions { display: flex; align-items: center; gap: 0.7rem; padding-top: 0.7rem; border-top: 1px dashed var(--border-strong); }
.module-toggle-label { font-size: 0.8rem; color: var(--bone-dim); }
.module-hint { margin-top: 1.5rem; font-size: 0.8rem; }

/* Gestoppte Module wirken zurückgenommen, fehlerhafte fallen rot auf */
.module-card.is-stopped { border-color: var(--border-strong); box-shadow: none; }
.module-card.is-stopped .module-icon { filter: grayscale(1); opacity: 0.6; }
.module-card.is-stopped .module-card-title h4 { color: var(--bone-dim); }
.module-card.is-error { border-color: var(--alert); box-shadow: 0 0 14px rgba(224, 72, 72, 0.45); }
.module-card.is-error .module-icon { border-color: var(--alert); }

/* Ein/Aus-Schalter */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider {
  position: absolute; inset: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bone-dim);
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-slider { background: rgba(var(--ok-rgb), 0.25); border-color: var(--ok); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: var(--ok); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: wait; }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--toxic); outline-offset: 2px; }

/* ---------- Kill-Counter-Anzeige mit Spiel-Covern (Statistiken) ---------- */
.kill-list { list-style: none; padding: 0; margin: 0; counter-reset: kill; }
.kill-game {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: kill;
}
.kill-game:last-child { border-bottom: none; }
.kill-game::before {
  content: counter(kill);
  flex: 0 0 1.4rem; text-align: right;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--bone-dim);
}
.game-cover {
  flex: 0 0 auto;
  width: 42px; height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
}
.game-cover-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.kill-game-name { flex: 1 1 auto; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kill-game-count { flex: 0 0 auto; font-family: var(--font-heading); font-size: 1.05rem; color: var(--toxic); }

.kill-game-more { padding-top: 0.5rem; font-size: 0.78rem; }

/* Sub-Statistik */
.sub-heading { margin: 1rem 0 0.4rem; font-size: 0.85rem; color: var(--bone-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); font-size: 0.88rem; }
.sub-row:last-child { border-bottom: none; }
.sub-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sub-row-main strong, .sub-row-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-row-main span { font-size: 0.75rem; }
.sub-badge { flex-shrink: 0; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; border: 1px solid currentColor; }
.sub-badge.sub-new { color: #b78cff; }
.sub-badge.sub-resub { color: #5fb3ff; }
.sub-badge.sub-gift { color: #ffb347; }
.sub-time { flex-shrink: 0; font-size: 0.72rem; }
#stat-subs .mini-avatar { width: 28px; height: 28px; flex-shrink: 0; vertical-align: middle; margin-right: 0.4rem; }
#stat-subs .sub-row .mini-avatar { margin-right: 0; }

.panel-wide { grid-column: 1 / -1; }
.sub-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .sub-columns { grid-template-columns: 1fr; } }

/* Rolle "user" (nur ansehen): deaktivierte Bedienelemente deutlich abgesetzt */
body.role-user .view button:disabled, body.role-user .view input:disabled, body.role-user .view select:disabled, body.role-user .view textarea:disabled { opacity: 0.45; cursor: not-allowed; }
body.role-user .view a.btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
