/* ==========================================================================
   AETHERLISM LIVE STREAM — gleiche Bauweise wie die Sprachchat-Ansicht:
   füllt den ganzen Inhaltsbereich, bündig, eckig, dünne Tintenblau-Kopfleiste,
   Glas-Bühne links, helle Seitenspalte rechts. Marken-Form nur an Knöpfen und Feldern.
   Tintenblau #0d3747, Eisblau #94c2cd, Roboto Mono. Rot nur für "live".
   Zum Zurückdrehen: alte streamdata45925.css wieder einsetzen.
   ========================================================================== */

:root {
    --s-ink: #0d3747;
    --s-ice: #94c2cd;
    --s-red: #dc3545;
    --s-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    /* Höhe des Inhaltsbereichs: dieselbe Rechnung wie beim Forum (Fenster minus Kopf, Fuß und Player) */
    --s-area-h: calc(100vh - var(--head-h, 62px) - var(--footer-h, 100px) - var(--player-h, 0px));
    --glass-blur: blur(18px) saturate(140%);
}

/* ---------- Der ganze Bereich: bündig wie die Sprachansicht ---------- */

.stream-test-container {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: 100%;
    height: var(--s-area-h);
    min-height: 480px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    background: transparent;
    color: var(--s-ink);
    font-family: 'Roboto Mono', monospace;
    border: 1px solid var(--s-ice);
    border-left: 6px solid var(--s-ink);
    border-radius: 0;
    animation: streamIn 0.4s var(--s-ease) both;
}

/* Hintergrund wie im Sprachchat: dasselbe Bild (voice-bg.png), weich verschwommen, helle Tönung darüber.
   Zum Wechseln auf ein eigenes Bild: nur die Adresse in url(...) ändern. */
.stream-test-container::before {
    content: "";
    position: absolute;
    inset: -40px;                /* größer als das Fenster, damit der Weichzeichner keine hellen Ränder zieht */
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(244, 249, 251, 0.5), rgba(244, 249, 251, 0.5)),
        url('/engine/load/data/network/aetherlism/net/aetherlism/center/voice-bg.png') center / cover no-repeat;
    filter: blur(26px) saturate(1.15);
}

@keyframes streamIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Kopfleiste (wie "SPRACHCHAT · REDEN?") ---------- */

.stream-header {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px 8px 18px;
    background: var(--s-ink);
    box-shadow: inset 4px 0 0 var(--s-ice);
    color: #ffffff;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--s-red);
    border-radius: 0 6px 0 6px;
    font-size: 0.66rem;
    letter-spacing: 3px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background: var(--s-red);
    border-radius: 0;
    animation: streamPulse 1.5s ease-out infinite;
}

@keyframes streamPulse {
    0%   { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70%  { box-shadow: 0 0 0 7px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* ---------- Raster: Bühne links, Seitenspalte rechts, volle Höhe ---------- */

.stream-grid {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
}

/* Bühne: das Video sitzt bündig oben, links und rechts, wie die Übertragungen im Sprachchat */
.player-glass {
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.video-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    background: #06202a;
    overflow: hidden;
}

.video-wrapper:fullscreen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    background: #000;
}

#live-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #06202a;
    object-fit: contain;
    border: none;
}

.video-wrapper:fullscreen #live-player { height: 100%; aspect-ratio: auto; }

/* ---------- Offline-Platzhalter: liegt über dem Player, solange kein Stream läuft ---------- */

.stream-offline {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        url('stream-offline.png') center / cover no-repeat,
        linear-gradient(135deg, #0d3747 0%, #14566f 100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.video-wrapper.is-offline .stream-offline {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0s;
}

/* Text nur, wenn das Platzhalterbild fehlt */
.stream-offline-text {
    display: none;
    padding: 10px 22px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 6px;
}
.stream-offline.no-img .stream-offline-text { display: block; }

/* kleines Glasschild unten links, wie das Namensschild der Übertragungen im Sprachchat */
.stream-offline-tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 12px;
    background: rgba(13, 55, 71, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 3px;
}

/* Im Offline-Zustand keine Steuerleiste */
.video-wrapper.is-offline .custom-video-controls { display: none; }

/* LIVE-Abzeichen oben: im Offline-Zustand grau und ruhig */
.stream-test-container.is-offline .live-indicator {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}
.stream-test-container.is-offline .pulse-dot { background: rgba(255, 255, 255, 0.55); animation: none; }

/* ---------- Steuerleiste im Video: Glas, erscheint beim Drüberfahren ---------- */

.custom-video-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 54px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: rgba(13, 55, 71, 0.55);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.3s var(--s-ease);
    z-index: 10;
}

.video-wrapper:hover .custom-video-controls,
.video-wrapper:focus-within .custom-video-controls { opacity: 1; transform: none; }

@media (hover: none) {
    .custom-video-controls { opacity: 1; transform: none; }
}

.custom-video-controls .control-btn {
    appearance: none;
    position: relative;
    overflow: hidden;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 10px 0 10px !important;
    background: transparent !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

.custom-video-controls .control-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
    pointer-events: none;
}

.custom-video-controls .control-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.custom-video-controls .control-btn:hover { background: var(--s-ice) !important; color: var(--s-ink) !important; }
.custom-video-controls .control-btn:hover::before { left: 125%; }
.custom-video-controls .control-btn:active { transform: translateY(1px); }
.custom-video-controls .control-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* Symbole wechseln über Klassen aus dem Script */
#custom-play-btn .ic-pause { display: none; }
#custom-play-btn.is-playing .ic-play { display: none; }
#custom-play-btn.is-playing .ic-pause { display: block; }
#custom-mute-btn .ic-mute { display: none; }
#custom-mute-btn.is-muted .ic-vol { display: none; }
#custom-mute-btn.is-muted .ic-mute { display: block; }

.control-spacer { flex: 1; }

/* Lautstärke: fährt beim Drüberfahren aus */
.volume-wrap { display: flex; align-items: center; }

#custom-volume {
    --pct: 100%;
    appearance: none;
    -webkit-appearance: none;
    width: 0;
    height: 12px;
    margin: 0;
    padding: 0;
    opacity: 0;
    outline: none;
    cursor: pointer;
    border-radius: 0;
    background: linear-gradient(to right, #ffffff var(--pct), rgba(255, 255, 255, 0.28) var(--pct));
    transition: width 0.3s var(--s-ease), opacity 0.2s ease, margin 0.3s var(--s-ease);
}

.volume-wrap:hover #custom-volume,
.volume-wrap:focus-within #custom-volume { width: 88px; opacity: 1; margin: 0 8px 0 4px; }

@media (hover: none) {
    #custom-volume { width: 88px; opacity: 1; margin: 0 8px 0 4px; }
}

#custom-volume::-webkit-slider-runnable-track { height: 12px; background: transparent; }
#custom-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 0; height: 12px; border: 0; background: transparent; }
#custom-volume::-moz-range-track { height: 12px; background: transparent; border: 0; }
#custom-volume::-moz-range-thumb { width: 0; height: 12px; border: 0; background: transparent; }

/* ---------- Kanal-Banner und Beschreibung unter dem Video ---------- */

/* Banner: genau so breit wie das Video, Seitenverhältnis 2919 x 480. Bild: stream-banner.png (im Ordner dieser CSS-Datei).
   Fehlt das Bild, steht eine tintenblaue Fläche mit Eisblau-Kante da. */
.channel-banner {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 2919 / 480;
    background: url('stream-banner.png') center / cover no-repeat, var(--s-ink);
    border-top: 1px solid rgba(148, 194, 205, 0.95);
    border-bottom: 3px solid var(--s-ice);
}

.channel-info {
    flex: 0 0 auto;
    box-sizing: border-box;
    padding: 18px 22px 22px;
    background: rgba(244, 249, 251, 0.55);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--s-ink);
}

.channel-info .channel-kicker {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.65;
}

.channel-info .channel-title {
    margin: 4px 0 10px;
    padding: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.25;
    color: var(--s-ink);
}

.channel-info .channel-text {
    margin: 0 0 10px;
    max-width: 78ch;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--s-ink);
}

.channel-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.channel-fact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(244, 249, 251, 0.62);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(148, 194, 205, 0.95);
    border-left: 4px solid var(--s-ice);
    border-radius: 0;
}

.channel-fact-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.65;
}

.channel-fact-text { font-size: 0.82rem; line-height: 1.5; }

/* ---------- Seitenspalte: Chat (hell, wie die Spalte im Sprachchat) ---------- */

.chat-glass {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: rgba(244, 249, 251, 0.55);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-left: 1px solid rgba(148, 194, 205, 0.95);
}

.chat-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 14px;
    background: rgba(230, 241, 245, 0.72);
    border-bottom: 1px solid rgba(148, 194, 205, 0.95);
    color: var(--s-ink);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.online-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 9px;
    background: var(--s-ink);
    color: #ffffff;
    border-radius: 0 7px 0 7px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: none;
    white-space: nowrap;
}

.online-count::before {
    content: "";
    width: 13px;
    height: 13px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5s-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.82rem;
    scrollbar-width: thin;
    scrollbar-color: var(--s-ink) transparent;
}

.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: rgba(13, 55, 71, 0.08); }
.chat-messages::-webkit-scrollbar-thumb { background: var(--s-ink); border-radius: 4px 0 4px 0; }

.chat-msg {
    padding: 8px 12px;
    background: rgba(244, 249, 251, 0.62);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(148, 194, 205, 0.95);
    border-left: 4px solid var(--s-ice);
    border-radius: 0;
    color: var(--s-ink);
    line-height: 1.5;
    word-break: break-word;
    animation: streamMsg 0.25s var(--s-ease) both;
}

@keyframes streamMsg {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.chat-msg.system {
    background: rgba(230, 241, 245, 0.72);
    border-left-color: var(--s-ink);
    font-style: italic;
}

.msg-user { color: var(--s-ink); font-weight: 700; }
.msg-time { margin-right: 6px; font-size: 0.72rem; opacity: 0.55; }

.chat-del-btn {
    appearance: none;
    margin: 0 6px 0 0;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--s-red);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s linear, background 0.15s linear, color 0.15s linear;
}

.chat-del-btn:hover { opacity: 1; background: var(--s-red); color: #ffffff; }

.chat-input-wrapper {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding: 8px;
    background: rgba(230, 241, 245, 0.72);
    border-top: 1px solid rgba(148, 194, 205, 0.95);
}

#chat-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid rgba(148, 194, 205, 0.95);
    border-radius: 0 10px 0 10px;
    color: var(--s-ink);
    font-family: inherit;
    font-size: 0.82rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#chat-input::placeholder { color: rgba(13, 55, 71, 0.5); }

#chat-input:focus {
    outline: none;
    border-color: var(--s-ink);
    box-shadow: 0 0 0 3px rgba(148, 194, 205, 0.5);
}

#chat-send {
    appearance: none;
    position: relative;
    overflow: hidden;
    padding: 0 16px;
    border: 0;
    border-radius: 0 10px 0 10px;
    background: var(--s-ink);
    color: #ffffff;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}

#chat-send::before {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

#chat-send:hover { background: var(--s-ice); color: var(--s-ink); }
#chat-send:hover::before { left: 125%; }
#chat-send:active { transform: translateY(1px); }
#chat-send:focus-visible { outline: 2px solid var(--s-ink); outline-offset: 2px; }

.system-divider {
    width: 100%;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(148, 194, 205, 0.5);
    text-align: center;
    color: var(--s-ink);
    opacity: 0.55;
}

/* ---------- Schmale Fenster und Handy ---------- */

@media (max-width: 900px) {
    .stream-test-container { height: auto; min-height: 0; }
    .stream-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
    .player-glass { overflow: visible; }
    .chat-glass { height: 420px; border-left: 0; border-top: 1px solid var(--s-ice); }
}

@media (max-width: 600px) {
    .stream-header { padding: 8px 10px 8px 14px; letter-spacing: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .stream-test-container, .chat-msg, .pulse-dot { animation: none !important; }
    .custom-video-controls, #custom-volume, .control-btn, #chat-send { transition: none !important; }
}