/* General */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans&display=swap');

/* Color scheme */
:root {
    --bg: #101010;
    --bg-t: rgba(16, 16, 16, 0);
    --bg-button-bright: #1f1f1f;
    --bg-button-bright-hover: #303030;
    --bg-button: #1b1b1b;
    --bg-button-hover: #363668;
    --bg-rec: #801010;
    --bg-rec-hover: #bf3030;
    --bg-label: #262626;
    --bg-label-t: rgba(38, 38, 38, 0);
    --bg-status: #ccc;
    --bg-status-t: rgba(204, 204, 204, 0.85);
    --bg-dim: #151504;
    --bg-dimmish: #333;
    --fg: #fff;
    --fg-dim: #7d7d7d;
    --fg-dimmish: #aaa;
    --fg-dimmish-t: rgba(152, 152, 152, 0);
    --fg-selected: #fff;
    --fg-status: #000;

    --user-list-silent: #101010;
    --user-list-speaking: #108010;
    --user-list-conn-unknown: #101010;
    --user-list-conn-unreliable: #801010;
    --user-list-conn-semireliable: #804010;
    --user-list-conn-reliable: #108010;
    --video-silent: #000;
    --video-silent-sel: #333;
    --video-speaking: #050;
    --video-speaking-sel: #080;

    --wave-too-soft: #1f1f1f;
    --wave-too-loud: #900;
    --nopeak-1: #200;
    --peak-1:   #800;
    --nopeak-2: #220;
    --peak-2:   #880;
    --nopeak-3: #020;
    --peak-3:   #080;

    --scale-main: 32px;
    --scale-main-2: 16px;
    --scale-main-3: 11px;
    --scale-main-4: 8px;
    --scale-main-8: 4px;
    --scale-main-16: 2px;
    --scale-main2: 64px;
    --scale-main3: 96px;
    --scale-main4: 128px;
    --scale-main6: 192px;
    --scale-main8: 256px;
}

/* Generic */
* {
    transition: background-color 0.1s ease-in-out,
                border-color 0.1s ease-in-out,
                color 0.1s ease-in-out;
}

*:active {
    transition: none;
}

*::-webkit-scrollbar {
    transition: background-color 0.1s ease-in-out;
    width: 4px;
    height: 4px;
    background-color: var(--bg-t);
}

*:hover::-webkit-scrollbar {
    background-color: var(--bg);
}

*::-webkit-scrollbar-thumb {
    transition: background-color 0.1s ease-in-out;
    border-radius: 2px;
    background-color: var(--bg-t);
}

*:hover::-webkit-scrollbar-thumb {
    background-color: var(--fg-dim);
}

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    position: relative;
    width: var(--scale-main-2);
    height: var(--scale-main-2);
    background-color: var(--bg);
}

input[type="checkbox"]:after {
    font-family: boxicons;
    font-weight: 400;
    font-size: var(--scale-main);
    color: var(--fg-dimmish);
    content: "\ea42";
    position: absolute;
    left: calc(0px - var(--scale-main-4));
    top: calc(0px - var(--scale-main-4));
}

input[type="checkbox"]:checked:after {
    color: var(--fg-selected);
    content: "\ea43";
}

input[type="checkbox"]:hover:after {
    color: var(--fg);
}

  /* Range generated by range.css */
input[type=range] {
  width: 100%;
  margin: 9px 0;
  background-color: transparent;
  -webkit-appearance: none;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
  background: rgba(48, 48, 48, 0.78);
  border: 0.2px solid #000000;
  border-radius: 1.3px;
  width: 100%;
  height: 8px;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  margin-top: -9.2px;
  width: 26px;
  height: 26px;
  background: #aaaaaa;
  border: 1.8px solid #000000;
  border-radius: 15px;
  cursor: pointer;
  -webkit-appearance: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
  background: #3d3d3d;
}
input[type=range]::-moz-range-track {
  background: rgba(48, 48, 48, 0.78);
  border: 0.2px solid #000000;
  border-radius: 1.3px;
  width: 100%;
  height: 8px;
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  background: #aaaaaa;
  border: 1.8px solid #000000;
  border-radius: 15px;
  cursor: pointer;
}

input[type="text"], input[type="password"], select {
    background-color: var(--bg);
    color: var(--fg-dimmish);
    border: 1px solid var(--fg-dimmish);
    border-radius: var(--scale-main-16);
    padding: var(--scale-main-4) var(--scale-main-4) var(--scale-main-4) var(--scale-main-4);
}

input[type="text"]:hover, input[type="password"], select:hover {
    color: var(--fg);
}

label {
    flex: auto;
    min-width: 5em;
    color: var(--fg-dimmish);
}

label:hover {
    color: var(--fg);
}

label.left-label {
    flex: 1;
    text-align: right;
    margin-top: 0.25em;
}

/* Standard classes */
.row {
    display: block;
    width: 100%;
    margin-top: var(--scale-main-4);
}

.cflex {
    display: flex;
    flex-direction: column;
}

.rflex {
    display: flex;
    flex-direction: row;
}

/* multi-flexors that depend on screen size */
.crflex {
    display: flex;
    flex-direction: column;
}

.rcflex {
    display: flex;
    flex-direction: row;
}

.fauto {
    flex: auto;
}

.fwidth {
    width: 100%;
}

.vcenter {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* vertically center on wide screens, horizontally center on narrow screens */
.vhcenter {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.smallshow {
    display: none;
}

.icon-button {
    background-color: inherit;
    color: var(--fg-dimmish);
    border-radius: 0;
    border: 0;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    font-size: var(--scale-main-2);
    line-height: var(--scale-main);
}

.icon-button:hover {
    color: var(--fg);
}

.icon-button:active {
    color: var(--fg-dimmish);
}

.pill-button {
    border-radius: 0.5em;
    border: 0;
    cursor: pointer;
    font-size: 1em;
    text-transform: uppercase;
    line-height: 2.5em;
    padding: 0 1em 0 1em;
    background-color: var(--bg-button);
    color: var(--fg-dimmish);
}

.pill-button.nouppercase {
    text-transform: none;
}

.pill-button:hover {
    background-color: var(--bg-button-hover);
    color: var(--fg);
}

.pill-button:active {
    background-color: var(--bg-button);
}

button.bright {
    background-color: var(--bg-button-bright);
    color: var(--fg);
}

button.bright:hover {
    background-color: var(--bg-button-bright-hover);
}

button.bright:active {
    background-color: var(--bg-button-bright);
}

.rec-button {
    background-color: var(--bg-rec) !important;
    color: var(--fg);
}

.rec-button:hover {
    background-color: var(--bg-rec-hover) !important;
}

.rec-button:active {
    background-color: var(--bg-rec) !important;
}

.round-button {
    border-radius: 1.25em;
    border: 0;
    cursor: pointer;
    font-size: 1em;
    width: 2.5em;
    height: 2.5em;
    line-height: 2.5em;
    text-align: center;
    background-color: var(--bg-button);
    color: var(--fg-dimmish);
}

.round-button:hover {
    background-color: var(--bg-button-hover);
    color: var(--fg);
}

.round-button:active {
    background-color: var(--bg-button);
}

.menu-button {
    position: relative;
    padding-top: calc(var(--scale-main) - var(--scale-main-3));
    --bg-label-m: var(--bg-label-t);
    --fg-dimmish-m: var(--fg-dimmish-t);
}

.menu-button:hover {
    --bg-label-m: var(--bg-label);
    --fg-dimmish-m: var(--fg-dimmish);
}

.menu-button.menu-selected {
    color: var(--fg-selected);
    --bg-label-m: var(--bg-label);
    --fg-dimmish-m: var(--fg);
}

.menu-button-lbox {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - var(--scale-main-2) - var(--scale-main-8));
    display: block;
    white-space: normal;
    line-height: normal;
}

.menu-button-label {
    position: relative;
    z-index: -1;
    display: inline-block;
    box-sizing: border-box;
    max-width: var(--scale-main2);
    background-color: var(--bg-label-m);
    border-radius: var(--scale-main-8);
    color: var(--fg-dimmish-m);
    font-size: var(--scale-main-3);
    text-align: center;
    padding: var(--scale-main-16) var(--scale-main-4) var(--scale-main-16) var(--scale-main-4);
    margin: auto;
}

.menu-button-label:after {
    content: '';
    position: absolute;
    top: 100%;
    left: calc(50% - 6px);
    border-top: 6px solid var(--bg-label-m);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

button.streamer-interface {
    display: none;
}

[data-streamer-interface="show"] button.streamer-interface {
    display: inline-block;
}

.panel {
    display: none;
    position: absolute;
    left: calc(var(--scale-main2) + var(--scale-main-2));
    top: var(--scale-main2);
    min-width: var(--scale-main8);
    max-width: calc(min(100% - var(--scale-main4), 52em));
    max-height: calc(100vh - var(--scale-main4));
    margin: 0;
    background-color: var(--bg);
    color: var(--fg-dimmish);
    border: 1px solid var(--bg-dimmish);
    padding: calc(var(--scale-main) + var(--scale-main-8)) var(--scale-main-2) var(--scale-main-2) var(--scale-main-2);
    border-radius: var(--scale-main-4);
    box-shadow: var(--scale-main-8) var(--scale-main-8) rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.panel-title {
    position: absolute;
    left: -1px;
    top: -1px;
    max-width: calc(100% - var(--scale-main2));
    background-color: var(--bg-dimmish);
    padding: var(--scale-main-8) var(--scale-main-4) var(--scale-main-8) var(--scale-main-4);
    border-radius: var(--scale-main-4) 0 var(--scale-main-4) 0;
}

.close-button {
    position: absolute;
    top: 0;
    right: var(--scale-main-4);
    background-color: transparent;
}

.ec3-video {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 1em;
}

.ec3-video-container {
    flex: auto;
    display: flex;
    flex-direction: column;
}

.ec3-video-video, .ec3-video-standin {
    flex: auto;
    border-radius: 1em;
}

.ec3-video .ec3-name-label {
    position: absolute;
    left: 0;
    bottom: 0;
    background-color: #333;
    color: #ccc;
    padding: 0.2em;
    border-top-right-radius: 0.2em;
    border-bottom-left-radius: 0.2em;
}

.ec3-studio-admin-button, .ec3-studio-video-waveform {
    /* Only visible in studio mode */
    display: none;
}

.ec3-individual-popout-button {
    position: absolute;
    right: 0;
    bottom: 0;
}

#ec3-side-video-wrappera .ec3-individual-popout-button {
    font-size: 0.75em;
}

.caption {
    display: none;
    position: absolute;
    left: 1em;
    right: 1em;
    bottom: 1em;
    text-align: center;
    font-size: 1.25rem;
    color: #aaa;
}

[data-captions="show"] .caption {
    display: block;
}

.caption span {
    display: inline-block;
    background-color: #111;
    padding: 0.15em 0.25em 0.15em 0.25em;
}

.ec3-waveform-label {
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

.ec3-waveform-label:hover {
    opacity: 1;
}

[data-persist-peak-labels="yes"] .ec3-waveform-label {
    opacity: 1;
}

[data-ec3-host="yes"] .ec3-guest-only {
    display: none;
}

[data-ec3-host="no"] .ec3-host-only {
    display: none;
}

/* Main body */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'Noto Sans', sans-serif;
    font-size: var(--scale-main-2);
}

#ec3-outer-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 100%;
    min-height: 100%;
}

#ec3-menu-button-wrapper {
    color: var(--fg-dim);
    min-width: var(--scale-main2);
    text-align: center;
}

#ec3-recording-info {
    min-width: 5em;
}

#ec3-recording-title {
    font-size: 1.25em;
    font-weight: bold;
}

#ec3-recording-timer {
    color: var(--fg-dim);
}

#ec3-interface-buttons {
    padding-right: var(--scale-main-2);
}

#ec3-main-menu-wrapper {
    position: relative;
    width: var(--scale-main2);
    overflow: auto;
}

#ec3-main-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-top: var(--scale-main-2);
    justify-content: space-evenly;
}

#ec3-main-video-wrapper {
    padding: var(--scale-main-4);
}

#ec3-main-video-wrapper .ec3-video {
    flex: auto;
    height: 100%;
}

#ec3-side-video-wrappera {
    position: relative;
    min-width: var(--scale-main4);
    min-height: var(--scale-main4);
}

#ec3-side-video-wrapperb {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: var(--scale-main-4);
}

#ec3-side-video-wrapperb .ec3-video {
    min-height: var(--scale-main3);
}

#ec3-side-video-wrapperb .ec3-name-label {
    font-size: var(--scale-main-3);
}

#ec3-chat-wrapper {
    width: var(--scale-main6);
    max-width: var(--scale-main6);
}

#ec3-chat-incoming {
    flex: auto;
    height: var(--scale-main4);
    border: solid 1px;
    padding: 0.5em;
    overflow: auto;
}

#ec3-chat-outgoing-txt {
    box-sizing: border-box;
    width: var(--scale-main6);
}

#ec3-waveform-row {
    position: relative;
    border-top: 1px solid var(--fg-dim);
    height: var(--scale-main3);
}

#ec3-waveform-row > canvas {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

#ec3-status {
    position: fixed;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: var(--bg-status-t);
    color: var(--fg-status);
    text-align: center;
}

#ec3-layer-separator {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.75);
}

#ec3-startstop-button2 {
    width: 100%;
}

#ec3-waveform-watcher {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
}

/* SMALL SCREEN */
@media screen and (max-width: 640px) {
    .crflex {
        flex-direction: row;
    }

    .rcflex {
        flex-direction: column;
    }

    .vhcenter {
        flex-direction: row;
    }

    .smallhide {
        display: none;
    }

    .smallshow {
        display: block;
    }

    .icon-button {
        font-size: calc(var(--scale-main-2) + var(--scale-main-4));
    }

    .panel {
        left: var(--scale-main-2);
        top: var(--scale-main-2);
        min-width: auto;
        max-width: 100%;
        right: var(--scale-main-2);
    }

    #ec3-main-menu-wrapper {
        width: auto;
        height: calc(var(--scale-main2) + var(--scale-main-4));
    }

    .menu-button-label:after {
        border: none;
    }

    #ec3-side-video-wrappera {
        min-width: var(--scale-main2);
        min-height: var(--scale-main2);
    }

    #ec3-side-video-wrapperb {
        flex-direction: row;
    }

    #ec3-side-video-wrapperb .ec3-video {
        min-width: var(--scale-main3);
        min-height: auto;
    }

    #ec3-chat-outgoing-txt {
        width: 100%;
    }

    #ec3-waveform-row {
        height: var(--scale-main2);
    }
}

/* View modes */

[data-view-mode="gallery"] #ec3-main-video-wrapper {
    display: none;
}

[data-view-mode="gallery"] #ec3-side-video-wrappera {
    flex: auto;
}

[data-view-mode="gallery"] #ec3-side-video-wrapperb {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
}

[data-view-mode="gallery"] .ec3-name-label {
    font-size: inherit;
}

[data-view-mode="small"] #ec3-main-row {
    flex-direction: column;
}

[data-view-mode="small"] #ec3-main-menu-wrapper {
    width: auto;
    height: auto;
}

[data-view-mode="small"] #ec3-main-menu {
    position: relative;
    flex-direction: row;
}

[data-view-mode="small"] #ec3-main-menu .smallhide {
    display: none;
}

[data-view-mode="small"] .menu-button-label:after {
    border: none;
}

[data-view-mode="small"] .icon-button {
    font-size: calc(var(--scale-main-2) + var(--scale-main-4));
}

[data-view-mode="small"] #ec3-side-video-wrappera, [data-view-mode="small"] #ec3-main-video-wrapper {
    display: none;
}

[data-view-mode="small"] #ec3-status-spacer {
    display: none;
}

[data-view-mode="small"] #ec3-status {
    position: relative;
}

[data-view-mode="studio"] #ec3-main-row {
    flex-direction: column;
}

[data-view-mode="studio"] #ec3-video-wrapper {
    flex-direction: column;
}

[data-view-mode="studio"] #ec3-main-menu-wrapper {
    width: auto;
    height: auto;
}

[data-view-mode="studio"] #ec3-main-menu {
    position: relative;
    flex-direction: row;
}

[data-view-mode="studio"] #ec3-main-menu .smallhide {
    display: none;
}

[data-view-mode="studio"] .menu-button-label:after {
    border: none;
}

[data-view-mode="studio"] .icon-button {
    font-size: calc(var(--scale-main-2) + var(--scale-main-4));
}

[data-view-mode="studio"] #ec3-main-video-wrapper {
    display: none;
}

[data-view-mode="studio"] #ec3-side-video-wrappera {
    min-height: auto;
}

[data-view-mode="studio"] #ec3-side-video-wrapperb {
    position: relative;
    bottom: auto;
    flex-direction: column;
    gap: 6px;
}

@media screen and (max-width: 640px) {
    [data-view-mode="studio"] #ec3-side-video-wrapperb {
        bottom: 0;
    }
}

[data-view-mode="studio"] .ec3-video {
    display: flex;
    flex-direction: row;
    height: 90px;
    max-height: 90px;
    flex: 1;
}

[data-view-mode="studio"] .ec3-video-container, [data-view-mode="studio"] .ec3-video-standin {
    position: relative;
    width: 120px;
    max-width: 120px;
    height: var(--scale-main3);
    max-height: var(--scale-main3);
    flex: 1;
}

[data-view-mode="studio"] .ec3-video, [data-view-mode="studio"] .ec3-video-video, [data-view-mode="studio"] .ec3-video-standin {
    border-radius: 0;
}

[data-view-mode="studio"] .ec3-studio-video-waveform {
    display: block;
    flex: auto;
}

[data-view-mode="studio"] .ec3-studio-admin-button {
    display: block;
    height: var(--scale-main3);
}

[data-view-mode="studio"] #ec3-waveform-row {
    display: none;
}

[data-view-mode="studio"] #ec3-chat-wrapper {
    flex: auto;
}

[data-view-mode="studio"] #ec3-chat-outgoing-txt {
    width: 100%;
}

[data-view-mode="studio"] #ec3-status-spacer {
    display: none;
}

[data-view-mode="studio"] #ec3-status {
    position: relative;
}
