﻿:root {
    --bg: #0b0f14;
    --panel: #111826;
    --muted: #7b8794;
    --text: #e6edf3;
    --accent: #4f8cff;
    --danger: #ff4f6d;
    --border: rgba(255,255,255,.08);
    --panel2: #0c121d;
    --good: #65e6a5;
    --warn: #ffd27a;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(11,15,20,.85);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.topbar__title {
    font-weight: 800
}

.topbar__sub {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.layout {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 12px;
    padding: 12px;
    max-width: 1300px;
    margin: 0 auto;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}

.btn, select, input {
    background: #0e1522;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.btn {
    cursor: pointer
}

    .btn:disabled, select:disabled, input:disabled {
        opacity: .55;
        cursor: not-allowed;
    }

.btn--primary {
    background: linear-gradient(180deg,#2e6bff,#2250c4);
    border-color: rgba(79,140,255,.35);
}

.btn--danger {
    background: rgba(255,79,109,.12);
    border-color: rgba(255,79,109,.35);
    color: #ffd5dd;
}

.btn--ghost {
    background: transparent;
    border-color: rgba(255,255,255,.12);
    color: var(--text);
}

.pill {
    font-size: 12px;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 8px;
    border-radius: 999px;
}

.pill--ok {
    color: var(--good);
    border-color: rgba(101,230,165,.25);
}

.pill--warn {
    color: var(--warn);
    border-color: rgba(255,210,122,.25);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.controls__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.field {
    min-width: 180px
}

.label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.small {
    font-size: 12px;
    color: var(--muted);
}

.hr {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.mediaGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

video {
    width: 100%;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    object-fit: cover;
}

.hint {
    margin-top: 10px;
    color: var(--warn);
    font-size: 12px;
    line-height: 1.35;
}

.h3 {
    margin: 14px 0 8px 0
}

.peers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.peer {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: var(--panel2);
}

.peerTop {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.peerName {
    font-weight: 700
}

.range {
    width: 100%
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tinyRow {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255,255,255,.03);
}

.chat {
    display: flex;
    flex-direction: column;
    height: 520px;
}

.chat__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.messages {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: var(--panel2);
    margin: 10px 0;
}

.msg {
    margin: 0 0 10px 0
}

.msgMeta {
    font-size: 12px;
    color: var(--muted)
}

.msgText {
    white-space: pre-wrap
}

.chatForm {
    display: flex;
    gap: 10px
}

    .chatForm input {
        flex: 1
    }

/* Fullscreen screen container */
#screenWrap:fullscreen {
    background: #000;
    padding: 0;
}

    #screenWrap:fullscreen video {
        border-radius: 0;
        border: 0;
        height: 100vh;
        width: 100vw;
        object-fit: contain;
    }

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr
    }

    .chat {
        height: 380px
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start
    }

    .btn, select, input {
        width: 100%
    }

    .controls__row > * {
        flex: 1 1 180px
    }

    .mediaGrid {
        grid-template-columns: 1fr
    }

    .grid2 {
        grid-template-columns: 1fr
    }
}

/* ✅ НЕОНОВАЯ ПОДСВЕТКА АКТИВНЫХ ЭЛЕМЕНТОВ */
.btn.is-active {
    border-color: rgba(0,255,213,0.55);
    box-shadow: 0 0 0 2px rgba(0,255,213,0.30), 0 0 14px rgba(0,255,213,0.25), 0 0 28px rgba(0,167,255,0.10);
}

.btn.is-active.btn--danger {
    border-color: rgba(255,80,80,0.55);
    box-shadow: 0 0 0 2px rgba(255,80,80,0.22), 0 0 14px rgba(255,80,80,0.18);
}