:root {
  --bg: #0d1326;
  --bg-elev: #131a30;
  --bg-card: #161e38;
  --border: #243150;
  --text: #e8ecf5;
  --text-dim: #9aa6c0;
  --accent: #6b6bff;
  --accent-2: #8a7bff;
  --live: #ff3b5c;
  --blue: #4da3ff;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* Das hidden-Attribut muss display-Regeln (z. B. flex) schlagen,
   sonst bleiben per JS ausgeblendete Elemente sichtbar. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
}

a { color: inherit; text-decoration: none; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
.brand-channel { color: var(--text-dim); font-size: 1.1rem; }
.brand-channel:not(:empty)::before { content: "– "; color: var(--text-dim); }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: var(--text-dim); font-size: 0.95rem; transition: color .15s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 28px; }
.page-title { font-size: 1.6rem; margin: 6px 0 4px; }
.page-intro { color: var(--text-dim); margin: 0 0 26px; }

/* Übersicht: Grid */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, border-color .15s;
  display: flex;
  flex-direction: column;
}
.channel-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a2340, #0e1428);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}
.play-hint {
  font-size: 2.4rem;
  color: rgba(255,255,255,0.75);
  width: 70px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  z-index: 2;
}
/* Bei aktiver Vorschau das Play-Symbol ausblenden (Video spricht fuer sich) */
.channel-card.has-preview .play-hint { display: none; }
/* Badges ueber der Vorschau halten */
.card-thumb .status-badge,
.card-thumb .viewer-badge { z-index: 3; }
.card-body { padding: 14px 16px 18px; }
.card-title { margin: 0 0 4px; font-size: 1.1rem; }
.card-meta { margin: 0; color: var(--text-dim); font-size: 0.9rem; }

/* Badges */
.status-badge {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(13,19,38,0.78);
  border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: .04em;
}
.status-badge .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-dim);
}
.status-badge.is-live { background: var(--live); border-color: var(--live); color: #fff; }
.status-badge.is-live .dot { background: #fff; animation: pulse 1.4s infinite; }
.is-live .status-badge { background: var(--live); border-color: var(--live); color: #fff; }
.is-live .status-badge .dot { background: #fff; animation: pulse 1.4s infinite; }

.viewer-badge {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(13,19,38,0.78);
  border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 20px;
  font-size: 0.78rem;
}
.dot-blue { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.channel-card.is-offline { opacity: 0.82; }

/* About */
.about { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.about h2 { font-size: 1.2rem; }
.about p { color: var(--text-dim); max-width: 640px; }

/* Stream-Seite */
.stream-page { max-width: 1024px; }
.player-wrap {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.player { width: 100%; height: 100%; display: block; background: #000; }
.player-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.player-overlay .status-badge,
.player-overlay .viewer-badge { pointer-events: auto; }
.badge-top-left { top: 14px; left: 14px; }
.badge-top-right { top: 14px; right: 14px; }

.offline-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 8px;
  background: linear-gradient(135deg, #141c34, #0b1020);
}
.offline-title { font-size: 1.25rem; font-weight: 600; margin: 0; }
.offline-sub { color: var(--text-dim); margin: 0; }

.stream-info { margin-top: 22px; }
.stream-heading { font-size: 1.5rem; margin: 0 0 12px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
  background: rgba(107,107,255,0.15);
  color: #c3c3ff;
  padding: 4px 12px; border-radius: 14px; font-size: 0.85rem;
}
.stream-desc { color: var(--text-dim); line-height: 1.55; max-width: 720px; }

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 22px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 560px) {
  .site-header { padding: 14px 18px; }
  .container { padding: 18px; }
  .channel-grid { grid-template-columns: 1fr; }
}
