:root {
  --bg: #001428;          /* NSYNK dunkles Blau-Schwarz (rgb 0,20,40) */
  --bg2: #041a30;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.14);
  --text: #F9F7F4;        /* Off-White */
  --muted: rgba(249, 247, 244, 0.62);
  --accent: rgb(0, 0, 255);        /* NSYNK Primär-Blau (#0000FF) */
  --accent-2: rgb(255, 50, 255);   /* Magenta */
  --accent-soft: rgba(0, 0, 255, 0.16);
  --magenta-soft: rgba(255, 50, 255, 0.16);
  --ok: rgb(0, 255, 140);
  --danger: rgb(255, 80, 80);
  --font: 'Mallory', 'Work Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand { display: contents; }
.brand .logo { height: 24px; width: auto; display: block; order: 2; margin-left: auto; }
.brand .brand-txt { order: 1; }
.brand .wordmark { font-size: 20px; font-weight: 700; letter-spacing: 0.14em; }
.brand-sep { display: none; }
.brand h1 { font-size: 20px; margin: 0; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
#conn { display: none; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.conn {
  font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 0;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.12em;
}
.conn.idle { color: var(--muted); }
.conn.connecting { color: var(--accent-2); border-color: var(--accent-2); }
.conn.live { color: var(--ok); border-color: var(--ok); background: transparent; }
.conn.error { color: var(--danger); border-color: var(--danger); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Stage */
.stage { position: relative; }
.stage-inner {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #03182e;
}
.visual-wrap { margin: 0; position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.visual-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage-inner.has-visual .visual-wrap { opacity: 1; }
.stage-inner.has-visual .idle-card { opacity: 0; pointer-events: none; }

.idle-card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding: 30px 30px 40px; gap: 10px; transition: opacity .4s ease;
}
.stage-inner.call-active .idle-card { opacity: 0; pointer-events: none; }
.idle-card h2 { margin: 6px 0 0; font-size: 34px; font-weight: 300; text-transform: uppercase; letter-spacing: 0.01em; }

/* Orb – groß im Grafikfenster; dockt bei aktivem Thema klein in die Zeile.
   Positionswechsel wird per FLIP (JS) animiert; hier nur die Zielgrößen. */
.orb-home-stage {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 120px;
  pointer-events: none;
}
.orb-home-row { display: flex; align-items: center; }
.orb { width: 220px; height: 220px; flex: none; will-change: transform; }
.orb.docked { width: 76px; height: 76px; }
.orb canvas { width: 100%; height: 100%; display: block; }
.idle-card p { margin: 0; color: var(--muted); font-size: 15px; max-width: 480px; line-height: 1.5; }

/* Controls: Orb + Call-Button als eine Zeile */
.controls { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.call-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.call-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 500; color: #fff;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 15px 32px; border-radius: 9999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.call-btn .call-ico { font-size: 20px; }
.call-btn:active { transform: scale(0.97); }
.call-btn.start { background: rgb(0, 0, 255); }
.call-btn.start:hover { background: rgb(0, 0, 169); }
.call-btn.stop { background: transparent; border-color: var(--line); }
.call-btn.stop:hover { border-color: var(--accent-2); }
.call-btn.busy { background: rgba(255, 255, 255, 0.08); cursor: default; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }

/* Chips */
.chips { display: grid; gap: 18px; }
.chips-group h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.12em; color: var(--accent-2); font-weight: 700; text-transform: uppercase; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 22px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-size: 13px; transition: all .18s ease;
}
.chip:hover { border-color: var(--accent-2); }
.chip.active { background: var(--magenta-soft); border-color: var(--accent-2); color: var(--text); font-weight: 700; }
.chip .emoji { font-size: 15px; }

/* Quellen */
.sources h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.12em; color: var(--accent-2); font-weight: 700; text-transform: uppercase; }
.source-list { display: flex; flex-wrap: wrap; gap: 10px; }
.source-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border-radius: 0; min-width: 190px; max-width: 300px;
  background: var(--panel); border: 1px solid var(--line);
}
.source-card .s-label { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.source-card .s-domain { color: var(--muted); font-size: 12px; word-break: break-all; }
.source-card .s-actions { display: flex; gap: 8px; margin-top: 4px; }
.source-card a, .source-card button {
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 0;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text);
  text-decoration: none; transition: all .16s ease;
}
.source-card a:hover, .source-card button:hover { border-color: var(--accent-2); color: var(--accent-2); }
.source-card .s-embed { border-color: var(--accent-2); color: var(--accent-2); background: var(--magenta-soft); }

/* IFrame-Overlay */
.frame-overlay[hidden] { display: none; }
.frame-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 6, 14, 0.82); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 3vh 2vw;
}
.frame-box {
  width: min(1200px, 96vw); height: min(92vh, 900px);
  background: var(--bg2); border: 1px solid var(--line); border-radius: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.frame-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.frame-title { font-weight: 700; font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame-open { color: var(--muted); font-size: 13px; text-decoration: none; }
.frame-open:hover { color: var(--accent); }
.frame-close { background: transparent; border: none; color: var(--text); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 0; }
.frame-close:hover { background: rgba(255,255,255,0.08); }
#frame { flex: 1; width: 100%; border: none; background: #fff; }

@media (max-width: 640px) {
  .brand p { display: none; }
  main { padding: 18px 14px 50px; }
  .source-card { min-width: 100%; }
}
