
:root {
    --loader-color: #FFF;
    --loader-second-color: #FF3D00;
}

* {
    color: #FFD;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    /* outline: 2px solid red; */
    max-width: 100vw;
    max-height: 100vh;
    box-sizing: border-box;
    padding: 0;
}

body {
    background: #191919;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

form {
    position: absolute;
    top: calc(50% - (128px + 24px));
    left: max(0px, calc(50% - (256px + 24px)));
    width: min(100vw, 512px);
    margin: 0;
    height: max(256px, fit-content);
    background: #FFFFFF24;
    border-radius: 16px;
    box-shadow: 0 4px 30px #00000001;
    backdrop-filter: blur(4.8px);
    border-top: 2px solid #a1a1a1;
    border-left: 1px solid #868686;
    padding: 24px;

    max-width: 100vw !important;

    transition: all .2s linear;
}

.hide {
    top: 24%;
    opacity: 0;
    display: none;
}

form h1 {
    text-align: center;
    font-size: 72px;
}

.input-block {
    position: relative;
    color: #191919;
    font-size: 16px;
}

.input-block input {
    background: #a1a1a1;
    border: none;
    padding: 10px;
    border-radius: 12px;
    width: -webkit-fill-available;
    color: #191919;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 16px;
}

.app-code-activation-wrapper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    align-items: baseline;
    
}

input.code-input {
    border: 2px solid #868686;
    display: block;
    width: 32px;
    text-align: center;
    aspect-ratio: 3/4;
    margin: auto;
    font-weight: bold;
    font-size: 32px;
}

input.code-input:focus {
    border: 2px solid cornflowerblue;
}

input:focus, input:active {
    outline: 0;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance:textfield; /* Firefox */
}

.input-block label {
    position: absolute;
    color: #191919;
    top: 8px;
    left: 10px;
    background: #a1a1a1;
    padding: 0 5px;
    font-size: 18px;
}

.input-block input:focus + label, .input-block input:not(:placeholder-shown) + label {
    position: absolute;
    top: -12px;
    left: 10px;
    border-radius: 4px;
    transition: all .05s;
}

input[type="submit"] {
    display: block;
    margin: 2rem auto;
    font-size: 24px;
    border-radius: 12px;
    background: #0ba10b;
    border: none;
    outline: 0;
    padding: 4px 12px;

}

nav {
    z-index: 9;
    position: fixed;
    display: flex;
    height: fit-content;
    left: 12px;
    top: 50%;
    transform: translate(0, -50%);
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
}

nav .button {
    width: 42px;
    margin: 4px 0;
    aspect-ratio: 1;
    background: #1a72de;
    border-radius: 16px;
    text-align: center;
    line-height: 100%;
    padding: 4px;
    box-sizing: border-box;
}

.button svg {
    display: block;
    transition: all .2s;
    fill: currentColor;
}

.button #micOff, .button #camOff {
    display: block;
    fill: #FF3D00;
}
.button #micOn, .button #camOn {
    display: none;
}

.button.on #micOff, .button.on #camOff {
    display: none;
}
.button.on #micOn, .button.on #camOn {
    display: block;
}

nav hr {
    width: 100%;
    height: 2px;
    border: 0;
    background: #919191;
}

main.chat {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    gap: 8px;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    scale: 1;
    box-sizing: border-box;
}

main video {
    margin: auto;
    aspect-ratio: auto;
    width: 100%;
    outline: 1px solid green;
}

main video:empty {
    background: linear-gradient(116deg, #ffffff24, #191919);
}

@media all and (max-width: 800px) {
    html, body {
        height: 100vh;
        height: 100dvh;
    }
    body {
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        padding: 0;
        margin: 0;

    }
    main.chat {
        display: block;
        padding: 0;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        margin: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    video.mini {
        position: absolute;
        width: 180px;
        right: 8px;
        bottom: 8px;
        border-radius: 8px;
        object-fit: contain;
        z-index: 10;
        box-sizing: border-box;
    }
    video:not(.mini) {
        height: 100%;
        object-fit: cover;
    }
}

.object-fit-contain {
    object-fit: contain !important;
}

.loader {
    display: inline;
    display: none;
    transform: rotateZ(45deg);
    /* perspective: 1000px; */
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: var(--loader-color);
    z-index: -100;
    transform: scale(10px);
}
.loader:before,
.loader:after {
    content: '';
    display: block;
    position: absolute;
    top: calc(50% - 24px);
    left: calc(50% - 24px);
    width: inherit;
    height: inherit;
    border-radius: 50%;
    transform: rotateX(35deg);
    animation: .6s spin linear infinite;
}
.loader:after {
    color: var(--loader-second-color);
    transform: rotateY(70deg);
    animation-delay: .4s;
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotateZ(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotateZ(360deg);
    }
}

@keyframes rotateccw {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-360deg);
    }
}

@keyframes spin {
    0%,
    100% {
        box-shadow: .2em 0px 0 0px currentcolor;
    }
    12% {
        box-shadow: .2em .2em 0 0 currentcolor;
    }
    25% {
        box-shadow: 0 .2em 0 0px currentcolor;
    }
    37% {
        box-shadow: -.2em .2em 0 0 currentcolor;
    }
    50% {
        box-shadow: -.2em 0 0 0 currentcolor;
    }
    62% {
        box-shadow: -.2em -.2em 0 0 currentcolor;
    }
    75% {
        box-shadow: 0px -.2em 0 0 currentcolor;
    }
    87% {
        box-shadow: .2em -.2em 0 0 currentcolor;
    }
}



.camera-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-menu {
    background: #222;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 250px;
}

.camera-menu button {
    background: #333;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

.camera-menu button:hover {
    background: #444;
}

.camera-menu button.active {
    background: #4CAF50;
}