/* Radio-Clips - Bedienoberflaeche
   Helles, freundliches Sendepult: ruhige Flächen, klare Zustände, große
   Schaltflaechen. Nur die Bildfenster bleiben dunkel - davor wirkt Video
   richtig, und das Auge bleibt beim Bild.
   Bewusst ohne Schreibmaschinenschrift, auch bei Zahlen. */

:root {
    /* Flächen */
    --bg: #f4f6f9;
    --bg-panel: #ffffff;
    --bg-raised: #eef1f6;
    --bg-input: #ffffff;
    --bg-soft: #e9edf3;
    --line: #dde3ea;
    --line-strong: #c2cbd6;

    /* Schrift */
    --text: #1e2733;
    --text-muted: #5d6b7c;
    --link: #0b5cab;

    /* Akzent - in den Einstellungen aenderbar. --accent-ink wird dazu
       passend berechnet, damit Schrift auf dem Akzent immer lesbar bleibt. */
    --accent: #ffb020;
    --accent-ink: #1e2733;

    /* Zustände */
    --live: #d92d20;
    --ok: #10803f;
    --warn: #9a6700;

    /* Bildfenster: dunkel, mit eigener Schriftfarbe darauf */
    --stage: #10151b;
    --stage-deep: #080c11;
    --stage-ink: #eef3f8;
    --stage-ink-muted: #a4b3c3;
    --stage-veil: rgba(10, 14, 19, 0.84);
    --stage-veil-strong: rgba(10, 14, 19, 0.94);

    --radius: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    margin: 0;
    font-weight: 600;
}

a {
    color: var(--link);
}

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

/* ------------------------------------------------------------ Kopfleiste */

.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.topbar__station {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.topbar__name {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.platforms {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    gap: 0.75rem;
}

.platform {
    padding: 0.6rem 0.75rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.platform__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.2rem;
}

.platform__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    flex: none;
}

.platform[data-status="live"] {
    border-color: var(--live);
}

.platform[data-status="live"] .platform__dot {
    background: var(--live);
    animation: puls 2s ease-in-out infinite;
}

.platform[data-status="starting"] .platform__dot,
.platform[data-status="stopping"] .platform__dot {
    background: var(--warn);
    animation: puls 1.2s ease-in-out infinite;
}

.platform[data-status="error"] {
    border-color: var(--live);
}

.platform[data-status="error"] .platform__dot {
    background: var(--live);
}

@keyframes puls {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .platform__dot {
        animation: none !important;
    }
}

.platform__label {
    font-weight: 600;
}

.platform__status {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.platform[data-status="live"] .platform__status {
    color: var(--live);
    font-weight: 600;
}

.platform__viewers {
    margin: 0.15rem 0 0.45rem;
    font-size: 0.86rem;
    min-height: 1.3em;
}

.platform__hint {
    margin: 0.3rem 0 0;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.total {
    text-align: right;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
}

.total__value {
    display: block;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.total__label {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.total__note {
    display: block;
    max-width: 22ch;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ---------------------------------------------------------------- Aufbau */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 1.25rem;
    padding: 1.25rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        grid-template-columns: 1fr;
        position: static;
    }

    .platforms {
        grid-auto-flow: row;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .total {
        text-align: left;
        padding: 0.75rem 0 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

.column__title {
    margin: 1.25rem 0 0.6rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.column__title:first-child {
    margin-top: 0;
}

/* ------------------------------------------------------------- Sendebild */

.monitor {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--stage);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Was im Sendebild steht, liegt auf dunklem Grund - daher eigene Schriftfarbe. */
.monitor__cover {
    color: var(--stage-ink);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 35%, #1b2430 0%, var(--stage-deep) 70%);
}

.monitor__art {
    width: 42%;
    max-width: 220px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.monitor__placeholder {
    width: 42%;
    max-width: 220px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

/* Steht auf dem dunklen Sendebild. */
.monitor__station {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stage-ink);
}

.monitor__meta {
    text-align: center;
}

.monitor__artist {
    margin: 0;
    color: var(--stage-ink-muted);
    font-size: 0.9rem;
}

.monitor__song {
    margin: 0.1rem 0 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.monitor__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--stage);
}

.monitor__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    margin: 0;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--stage-veil);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--stage-ink-muted);
}

.monitor__badge--live {
    background: var(--live);
    border-color: var(--live);
    color: #fff;
}

.monitor__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.monitor__note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --------------------------------------------------------- Eigene Kamera */

.preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--stage);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.preview__video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scaleX(-1);
    background: var(--stage);
}

.preview__overlay {
    color: var(--stage-ink);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.25rem;
    text-align: center;
    background: var(--stage-veil-strong);
}

.preview__overlay p {
    margin: 0;
    max-width: 38ch;
    color: var(--stage-ink-muted);
}

.preview__help {
    max-width: 44ch;
    padding: 0.8rem 1rem;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.4);
    border-radius: var(--radius);
    text-align: left;
}

.preview__help-title {
    color: var(--live) !important;
    font-weight: 700;
    margin-bottom: 0.3rem !important;
}

.preview__state {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--stage-veil);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stage-ink-muted);
}

.preview__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.preview__state--preview {
    border-color: var(--warn);
    color: var(--warn);
}

.preview__state--live {
    background: var(--live);
    border-color: var(--live);
    color: #fff;
}

.preview__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.level {
    margin-top: 0.85rem;
}

.level__label {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.level__bar {
    position: relative;
    height: 12px;
    margin-top: 0.3rem;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.level__bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 70%;
    width: 1px;
    background: var(--line-strong);
}

.level__fill {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--ok) 0%, var(--accent) 70%, var(--live) 100%);
    transition: width 90ms linear;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

@media (max-width: 600px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

.field {
    display: block;
}

.field__label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

select,
input[type="text"],
input[type="url"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
}

select:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* --------------------------------------------------------- Kameraplätze */

.slots {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.slot__name {
    font-weight: 600;
}

.slot__state {
    flex: 1;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.slot--live {
    border-color: var(--live);
}

.slot--preview {
    border-color: var(--warn);
}

.slot--empty {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ----------------------------------------------------------------- Chat */

.chat {
    height: min(46vh, 420px);
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.6rem;
}

.chat__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.message {
    padding: 0.5rem 0.65rem;
    background: var(--bg-raised);
    border-left: 3px solid var(--line);
    border-radius: 7px;
}

.message--youtube   { border-left-color: #ff0033; }
.message--facebook  { border-left-color: #1877f2; }
.message--instagram { border-left-color: #d6249f; }
.message--tiktok    { border-left-color: #25f4ee; }

.message--own {
    background: color-mix(in srgb, var(--accent) 14%, var(--bg-panel));
    border-left-color: var(--accent);
}

.message__head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.15rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Abzeichen der Plattform - im Chat, auf der Merkliste und im Fenster
   für die Homepage dasselbe Bild. Die Farbe kommt je Nachricht mit. */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: var(--badge-colour, #6b7a90);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-transform: none;
    flex: none;
}

.message__author {
    font-weight: 700;
    color: var(--text);
}

.message__time {
    margin-left: auto;
}

.message__text {
    margin: 0;
    overflow-wrap: anywhere;
}

.message__actions {
    display: flex;
    gap: 0.75rem;
    margin: 0.3rem 0 0;
}

.link {
    padding: 0;
    background: none;
    border: 0;
    color: var(--link);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

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

.reply {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
}

.reply__target {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
}

.reply__scope {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.pick {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.84rem;
    cursor: pointer;
}

.pick:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--bg-panel));
    font-weight: 600;
}

.pick:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}

.pick input {
    margin: 0;
    accent-color: var(--accent);
}

.reply__where {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

.reply__input {
    flex: 1 1 200px;
}

.reply__state {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.reply__state--ok {
    color: var(--ok);
}

.reply__state--error {
    color: var(--live);
}

.reply__state--warn {
    color: var(--warn);
}

/* Ergebnis je Plattform: gesendet, offen oder gescheitert. */
.result {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--bg-raised);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
}

.result--sent {
    border-color: color-mix(in srgb, var(--ok) 45%, transparent);
    background: color-mix(in srgb, var(--ok) 12%, var(--bg-panel));
    color: var(--ok);
}

.result--failed {
    border-color: color-mix(in srgb, var(--live) 45%, transparent);
    background: color-mix(in srgb, var(--live) 12%, var(--bg-panel));
    color: var(--live);
}

.reply__reason {
    display: block;
    margin-top: 0.3rem;
    color: var(--live);
}

.noted {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.note {
    padding: 0.55rem 0.7rem;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.note--done {
    opacity: 0.55;
}

.note--empty {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.note__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.15rem;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.note__text {
    margin: 0 0 0.3rem;
}

/* ----------------------------------------------------------- Bedienteile */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--bg-raised);
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn--primary:hover:not(:disabled) {
    filter: brightness(1.08);
    color: var(--accent-ink);
}

.btn--stop {
    border-color: var(--live);
    color: var(--live);
}

.btn--off {
    border-color: var(--live);
    color: var(--live);
}

.btn--small {
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.6);
}

.hint {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.6rem 1.1rem;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 12px 32px rgba(23, 33, 48, 0.16);
    z-index: 50;
}

.toast--error {
    border-color: var(--live);
    color: var(--live);
}

.studio__footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--line);
}

/* ------------------------------------------------------- Einzelne Seiten */

.plain {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.plain__box {
    width: min(460px, 100%);
    padding: 1.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.plain__box h1 {
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.plain__hint {
    color: var(--text-muted);
    font-size: 0.88rem;
}

[hidden] {
    display: none !important;
}

/* ---------------------------------------------------------- Anmeldeseite */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    width: min(400px, 100%);
    padding: 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.login-card__title {
    margin-bottom: 0.2rem;
    font-size: 1.4rem;
}

.login-card__subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-card .field {
    margin-bottom: 1rem;
}

.notice {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--line);
    background: var(--bg-raised);
    font-size: 0.9rem;
}

.notice--error {
    border-left-color: var(--live);
    color: var(--live);
}

.notice--success {
    border-left-color: var(--ok);
    color: var(--ok);
}

.notice--info {
    border-left-color: var(--accent);
}
