:root {
    color-scheme: dark;
    font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
    background: #08090d;
    color: #f6f7fb;
}

* { box-sizing: border-box; }

html, body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: radial-gradient(circle at top, #1d2340 0, #0a0c14 48%, #050609 100%);
}

body {
    display: grid;
    place-items: center;
    padding: 18px;
}

.shell {
    width: min(1400px, 100%);
    display: grid;
    gap: 12px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brandBlock {
    min-width: 0;
}

.brand {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.playbackStatus {
    margin-top: 3px;
    color: #b9c0d9;
    font-size: 14px;
}

.networkIndicator {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    min-width: 142px;
    padding: 8px 11px;
    border: 1px solid currentColor;
    border-radius: 999px;
    background: rgba(5, 7, 12, 0.72);
    color: #8f96ac;
    font: 750 13px/1 "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.035em;
    transition: color 160ms ease, box-shadow 160ms ease;
}

.networkIndicator.good {
    color: #37d67a;
    box-shadow: 0 0 16px rgba(55, 214, 122, 0.18);
}

.networkIndicator.slow,
.networkIndicator.disconnected {
    color: #ff5c67;
    box-shadow: 0 0 16px rgba(255, 92, 103, 0.18);
}

.wifiIcon {
    width: 24px;
    height: 24px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
}

.wifiIcon circle {
    fill: currentColor;
    stroke: none;
}

#networkLatency {
    min-width: 88px;
    text-align: center;
}

.viewer {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid #343b5c;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 24px 80px rgba(0,0,0,0.38);
}

video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.emptyState {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    color: #c7cce0;
    text-align: center;
    font-size: clamp(16px, 2.2vw, 25px);
    pointer-events: none;
    background: linear-gradient(145deg, rgba(10,12,20,0.92), rgba(22,27,51,0.88));
}

.emptyState.hidden { display: none; }

.controls {
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(220px, 1fr);
    gap: 16px;
    align-items: end;
    padding: 14px 16px;
    border: 1px solid #303752;
    border-radius: 10px;
    background: rgba(19, 23, 38, 0.94);
}

label {
    display: grid;
    gap: 6px;
    color: #c7cce0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input[type="text"] {
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid #56608b;
    border-radius: 7px;
    background: #080a12;
    color: #fff;
    font: 800 20px/1 monospace;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

input[type="range"] {
    width: 100%;
    min-height: 42px;
    accent-color: #7b8cff;
}

input:focus-visible {
    outline: 3px solid rgba(123, 140, 255, 0.4);
    outline-offset: 2px;
}

@media (max-width: 680px) {
    body { padding: 8px; }
    header { align-items: flex-start; }
    .networkIndicator { min-width: 0; }
    #networkLatency { min-width: 76px; }
    .controls { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    header { display: grid; }
    .networkIndicator { justify-self: start; }
}
