/* Radio-Chat – eigenes Fenster */

:root {
  --nc-accent: #f97316;
  --nc-bg: #0f141c;
  --nc-bg-2: #151c27;
  --nc-surface: #1b2432;
  --nc-surface-2: #222d3e;
  --nc-line: #2b3749;
  --nc-text: #e7edf6;
  --nc-soft: #9aa8bc;
  --nc-admin: #f87171;
  --nc-mod: #fbbf24;
  --nc-member: #60a5fa;
  --nc-guest: #a3b1c6;
  --nc-ok: #22c55e;
  --nc-away: #f59e0b;
  --nc-busy: #ef4444;
  --nc-radius: 12px;
  --nc-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

:root[data-mode="light"] {
  --nc-bg: #eef2f7;
  --nc-bg-2: #e5eaf2;
  --nc-surface: #ffffff;
  --nc-surface-2: #f3f6fa;
  --nc-line: #d8e0ea;
  --nc-text: #18212f;
  --nc-soft: #5d6b80;
  --nc-admin: #dc2626;
  --nc-mod: #b45309;
  --nc-member: #2563eb;
  --nc-guest: #64748b;
  --nc-shadow: 0 18px 50px rgba(20, 35, 70, .16);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root[data-mode="auto"] {
    --nc-bg: #eef2f7;
    --nc-bg-2: #e5eaf2;
    --nc-surface: #ffffff;
    --nc-surface-2: #f3f6fa;
    --nc-line: #d8e0ea;
    --nc-text: #18212f;
    --nc-soft: #5d6b80;
    --nc-admin: #dc2626;
    --nc-mod: #b45309;
    --nc-member: #2563eb;
    --nc-guest: #64748b;
    --nc-shadow: 0 18px 50px rgba(20, 35, 70, .16);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

.nc-body {
  margin: 0;
  background: var(--nc-bg);
  color: var(--nc-text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* --------------------------------------------------------- Knöpfe */
.nc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--nc-line); border-radius: 10px;
  background: var(--nc-surface-2); color: var(--nc-text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.nc-btn:hover { border-color: var(--nc-accent); }
.nc-btn:active { transform: translateY(1px); }
.nc-btn-primary { background: var(--nc-accent); border-color: var(--nc-accent); color: #fff; }
.nc-btn-primary:hover { filter: brightness(1.08); }
.nc-btn-wide { width: 100%; margin-top: 6px; }
.nc-btn:focus-visible, .nc-icon-btn:focus-visible, .nc-select:focus-visible, .nc-input:focus-visible,
.nc-tab:focus-visible, .nc-person-btn:focus-visible, .nc-nick:focus-visible {
  outline: 2px solid var(--nc-accent); outline-offset: 2px;
}

.nc-icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--nc-soft);
  font: inherit; cursor: pointer;
}
.nc-icon-btn:hover { background: var(--nc-surface-2); color: var(--nc-text); }
.nc-icon-btn.is-on { background: color-mix(in srgb, var(--nc-accent) 18%, transparent); color: var(--nc-accent); border-color: color-mix(in srgb, var(--nc-accent) 45%, transparent); }
.nc-icon-btn.is-off { opacity: .55; }
.nc-icon-btn.is-all { color: var(--nc-accent); }
.nc-fmt { font-size: 16px; }
.nc-emoji-icon { font-size: 18px; line-height: 1; }
.nc-color-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--nc-line); }

.nc-select {
  height: 38px; padding: 0 30px 0 12px;
  border: 1px solid var(--nc-line); border-radius: 10px;
  background: var(--nc-surface-2); color: var(--nc-text);
  font: inherit; font-size: 14px; cursor: pointer;
}

.nc-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--nc-accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* --------------------------------------------------------- Eingang */
.nc-entry-body { display: flex; min-height: 100%; padding: 24px 16px; }
.nc-entry { width: 100%; display: flex; justify-content: center; margin: auto; }
.nc-entry-card {
  width: 100%; max-width: 440px;
  padding: 30px 28px;
  background: var(--nc-surface);
  border: 1px solid var(--nc-line); border-radius: 18px;
  box-shadow: var(--nc-shadow);
}
.nc-entry-logo {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--nc-accent) 16%, transparent);
  color: var(--nc-accent);
}
.nc-entry-card h1 { margin: 0 0 8px; font-size: 24px; text-align: center; letter-spacing: -.01em; }
.nc-entry-welcome { margin: 0 0 18px; color: var(--nc-soft); text-align: center; }
.nc-entry-as { margin: 0 0 6px; text-align: center; }
.nc-entry-note { color: var(--nc-soft); text-align: center; }
.nc-entry-form, .nc-login form { display: flex; flex-direction: column; gap: 6px; }
.nc-entry-form label, .nc-login label { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--nc-soft); }
.nc-entry-form input[type="text"], .nc-entry-form select,
.nc-login input {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--nc-line); border-radius: 10px;
  background: var(--nc-bg-2); color: var(--nc-text);
  font: inherit;
}
.nc-entry-form input:focus, .nc-entry-form select:focus, .nc-login input:focus { outline: none; border-color: var(--nc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-accent) 25%, transparent); }
.nc-hint { color: var(--nc-soft); font-size: 12.5px; }
.nc-check { display: flex !important; gap: 10px; align-items: flex-start; margin: 10px 0 4px !important; font-weight: 500 !important; color: var(--nc-text) !important; font-size: 14px !important; cursor: pointer; }
.nc-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--nc-accent); flex: none; }
.nc-rules { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--nc-line); border-radius: 10px; background: var(--nc-bg-2); font-size: 14px; }
.nc-rules summary { cursor: pointer; font-weight: 600; }
.nc-rules p { margin: 10px 0 0; color: var(--nc-soft); }
.nc-login { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--nc-line); font-size: 14px; }
.nc-login summary { cursor: pointer; color: var(--nc-soft); font-weight: 600; }
.nc-alert {
  margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--nc-busy) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--nc-busy) 14%, transparent);
  font-size: 14px;
}
.nc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* -------------------------------------------------------- Chat */
.nc-app-body { overflow: hidden; }
.nc-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.nc-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--nc-surface);
  border-bottom: 1px solid var(--nc-line);
}
.nc-head-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.nc-head-title strong { font-size: 16px; }
.nc-topic { color: var(--nc-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-head-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nc-btn-leave { min-height: 38px; }

.nc-onair {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 2 1 260px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nc-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--nc-accent) 40%, transparent);
  font-size: 13px;
}
.nc-onair-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; flex: none; animation: nc-blink 1.4s ease-in-out infinite; }
.nc-onair-label { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--nc-accent); flex: none; }
.nc-onair-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes nc-blink { 50% { opacity: .25; } }

.nc-main { flex: 1; display: flex; min-height: 0; }
.nc-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.nc-tabs { display: flex; gap: 4px; padding: 8px 10px 0; overflow-x: auto; border-bottom: 1px solid var(--nc-line); background: var(--nc-bg); scrollbar-width: thin; }
.nc-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin-bottom: -1px;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: transparent; color: var(--nc-soft);
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.nc-tab:hover { color: var(--nc-text); }
.nc-tab.is-active { background: var(--nc-bg-2); border-color: var(--nc-line); color: var(--nc-text); }
.nc-tab.is-gone .nc-tab-name { text-decoration: line-through; opacity: .6; }
.nc-tab-badge:not(:empty) { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--nc-accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.nc-tab-close { margin-left: 2px; padding: 0 4px; border-radius: 6px; opacity: .6; }
.nc-tab-close:hover { opacity: 1; background: var(--nc-surface-2); }

.nc-panes { flex: 1; min-height: 0; position: relative; background: var(--nc-bg-2); }
.nc-pane { position: absolute; inset: 0; overflow-y: auto; padding: 12px 16px 16px; overscroll-behavior: contain; }

.nc-msg {
  position: relative;
  padding: 3px 34px 3px 0;
  line-height: 1.55;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.nc-msg + .nc-msg { margin-top: 2px; }
.nc-time { color: var(--nc-soft); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.nc-nick {
  padding: 0; border: 0; background: none;
  font: inherit; font-weight: 700; cursor: pointer;
}
.nc-nick:hover { text-decoration: underline; }
.nc-colon { margin-right: 6px; color: var(--nc-soft); }
.nc-role-admin { color: var(--nc-admin); }
.nc-role-mod { color: var(--nc-mod); }
.nc-role-member { color: var(--nc-member); }
.nc-role-guest { color: var(--nc-guest); }
.nc-kind-sys, .nc-kind-info { color: var(--nc-soft); font-size: 13.5px; font-style: italic; }
.nc-kind-info { padding: 6px 10px; margin: 4px 0; border-radius: 8px; background: var(--nc-surface); font-style: normal; }
.nc-kind-dice .nc-sys { font-weight: 600; color: var(--nc-accent); }
.nc-kind-dice .nc-sys::before { content: "🎲 "; }
.nc-kind-me .nc-me { font-style: italic; }
.nc-me-star { color: var(--nc-accent); }
.nc-kind-priv { padding: 4px 34px 4px 10px; border-left: 3px solid var(--nc-accent); border-radius: 6px; background: color-mix(in srgb, var(--nc-accent) 7%, transparent); }
.nc-priv-note { margin-left: 6px; color: var(--nc-soft); font-size: 12px; }
.nc-msg.is-mine .nc-nick { opacity: .9; }
.nc-text a { color: var(--nc-accent); }
.nc-smiley { vertical-align: middle; max-height: 80px; width: auto; }
.nc-del {
  position: absolute; right: 2px; top: 2px;
  width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--nc-soft);
  font-size: 18px; line-height: 1; cursor: pointer; opacity: 0;
}
.nc-msg:hover .nc-del, .nc-del:focus-visible { opacity: 1; }
.nc-del:hover { background: color-mix(in srgb, var(--nc-busy) 20%, transparent); color: var(--nc-busy); }
.nc-divider { margin: 10px 0; border-top: 1px dashed var(--nc-line); }

/* Wer ist da */
.nc-list {
  width: 250px; flex: none;
  overflow-y: auto;
  border-left: 1px solid var(--nc-line);
  background: var(--nc-surface);
  padding: 12px 10px;
}
.nc-list h2 { margin: 2px 6px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--nc-soft); }
.nc-list-room { margin: 12px 6px 4px; font-size: 12px; color: var(--nc-soft); font-weight: 700; }
.nc-people { list-style: none; margin: 0; padding: 0; }
.nc-person-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--nc-text);
  font: inherit; text-align: left; cursor: pointer;
}
.nc-person-btn:hover { background: var(--nc-surface-2); }
.nc-person.is-me .nc-person-btn { background: color-mix(in srgb, var(--nc-accent) 10%, transparent); }
.nc-ava { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.nc-ava-letter { display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.nc-role-bg-admin { background: var(--nc-admin); }
.nc-role-bg-mod { background: var(--nc-mod); }
.nc-role-bg-member { background: var(--nc-member); }
.nc-role-bg-guest { background: var(--nc-guest); }
.nc-person-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nc-person-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-person-sub { color: var(--nc-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--nc-ok); flex: none; }
.nc-st-away .nc-dot { background: var(--nc-away); }
.nc-st-busy .nc-dot { background: var(--nc-busy); }
.nc-st-invisible .nc-dot { background: transparent; border: 2px solid var(--nc-soft); }
.nc-st-invisible .nc-person-btn { opacity: .6; }

/* Eingabe */
.nc-foot { position: relative; padding: 8px 12px 12px; background: var(--nc-surface); border-top: 1px solid var(--nc-line); }
.nc-toolbar { display: flex; gap: 2px; margin-bottom: 6px; flex-wrap: wrap; }
.nc-form { display: flex; gap: 8px; align-items: center; }
.nc-to {
  flex: none; padding: 6px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--nc-accent) 16%, transparent);
  color: var(--nc-accent); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.nc-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--nc-line); border-radius: 12px;
  background: var(--nc-bg-2); color: var(--nc-text);
  font: inherit; font-size: 15px;
}
.nc-input:focus { outline: none; border-color: var(--nc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc-accent) 22%, transparent); }
.nc-form .nc-btn { height: 44px; }
.nc-error { margin: 8px 0 0; font-size: 13px; color: var(--nc-busy); }

.nc-panel {
  position: absolute; left: 12px; bottom: calc(100% + 6px);
  width: min(460px, calc(100vw - 24px)); max-height: 320px; overflow-y: auto;
  padding: 10px;
  background: var(--nc-surface);
  border: 1px solid var(--nc-line); border-radius: 14px;
  box-shadow: var(--nc-shadow);
  z-index: 20;
}
.nc-panel-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--nc-line); scrollbar-width: thin; }
.nc-panel-tab { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px; border: 1px solid var(--nc-line); border-radius: 999px; background: transparent; color: var(--nc-soft); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
.nc-panel-tab:hover { color: var(--nc-text); border-color: var(--nc-accent); }
.nc-panel-tab-icon { width: 20px; height: 20px; object-fit: contain; }
.nc-panel-tab.is-active { background: var(--nc-accent); border-color: var(--nc-accent); color: #fff; }
.nc-grid { display: grid; gap: 4px; }
.nc-grid-emoji { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); }
.nc-grid-smiley { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.nc-grid-color { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); align-items: center; }
.nc-grid-btn {
  display: grid; place-items: center; min-height: 38px; padding: 4px;
  border: 0; border-radius: 8px; background: transparent;
  font-size: 22px; cursor: pointer;
}
.nc-grid-btn:hover { background: var(--nc-surface-2); }
.nc-grid-btn img { max-width: 48px; max-height: 48px; }
.nc-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--nc-line); cursor: pointer; background: var(--nc-text); }
.nc-swatch.is-default { background: linear-gradient(135deg, var(--nc-text) 50%, var(--nc-bg) 50%); }
.nc-swatch.is-active { outline: 2px solid var(--nc-accent); outline-offset: 2px; }
.nc-color-input { width: 32px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }

/* Menü zu einem Namen */
.nc-menu {
  position: fixed; z-index: 40;
  min-width: 190px; padding: 6px;
  background: var(--nc-surface);
  border: 1px solid var(--nc-line); border-radius: 12px;
  box-shadow: var(--nc-shadow);
  display: flex; flex-direction: column;
}
.nc-menu-title { padding: 6px 10px 8px; border-bottom: 1px solid var(--nc-line); margin-bottom: 4px; }
.nc-menu-note { padding: 6px 10px; color: var(--nc-soft); font-size: 13px; }
.nc-menu-item { padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--nc-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.nc-menu-item:hover { background: var(--nc-surface-2); }
.nc-menu-item.is-warn { color: var(--nc-away); }
.nc-menu-item.is-danger { color: var(--nc-busy); }

/* Abschied */
.nc-gone { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--nc-bg) 82%, transparent); backdrop-filter: blur(4px); }
.nc-gone p { margin: 0 0 14px; text-align: center; font-size: 16px; }

.nc-only-mobile { display: none; }

/* Schmale Fenster und Handy */
@media (max-width: 760px) {
  .nc-only-mobile { display: inline-flex; }
  .nc-list {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
    width: min(300px, 86vw);
    transform: translateX(100%); transition: transform .2s ease;
    box-shadow: var(--nc-shadow);
  }
  .nc-app.show-list .nc-list { transform: none; }
  .nc-head { gap: 8px; padding: 8px 10px; }
  .nc-onair { order: 3; flex-basis: 100%; }
  .nc-head-tools .nc-select { max-width: 130px; }
  .nc-pane { padding: 10px 10px 14px; }
  .nc-form .nc-btn { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .nc-onair-dot { animation: none; }
  .nc-list { transition: none; }
}

/* „ON AIR" hinter dem Moderator, der gerade sendet (1.4.0) – Neon wie ein Studioschild */
.nc-person-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.nc-person-line .nc-person-name { flex: 0 1 auto; }
.nc-onair-badge {
  flex: none;
  padding: 1px 7px 0;
  border: 2px solid #22d3ee;
  border-radius: 6px;
  color: #ff4fd8;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; line-height: 1.35;
  text-transform: uppercase; white-space: nowrap;
  background: rgba(10, 6, 30, .55);
  box-shadow: 0 0 4px #22d3ee, 0 0 10px rgba(34, 211, 238, .55), inset 0 0 6px rgba(34, 211, 238, .35);
  text-shadow: 0 0 2px #fff, 0 0 6px #ff4fd8, 0 0 12px #ff4fd8;
  animation: nc-neon 2.4s ease-in-out infinite;
}
.nc-person.is-onair .nc-person-btn { background: color-mix(in srgb, #ff4fd8 9%, transparent); }
.nc-person.is-onair .nc-ava { box-shadow: 0 0 0 2px #22d3ee, 0 0 10px rgba(34, 211, 238, .6); }
@keyframes nc-neon {
  0%, 100% { opacity: 1; }
  46% { opacity: 1; }
  48% { opacity: .55; }
  50% { opacity: 1; }
  52% { opacity: .7; }
  54% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .nc-onair-badge { animation: none; } }
:root[data-mode="light"] .nc-onair-badge { background: #12082b; }
