:root {
    --backgroundColor: #41abd4;
    --buttonColor: #0f52b6;
    --buttonColor2:rgb(30, 96, 194)6;
    --pColor: white;
    --hColor: white;
    --bColor: white;
    --font: 'Bebas Neue', sans-serif;
}

html, body {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    overflow: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font);
    font-weight: 200;
    display: flex;
    background-color: var(--backgroundColor);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

img, video {
    width: 100%;
    height: 100%;
}

#renderCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

* {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important; 
    -webkit-focus-ring-color: rgba(255, 255, 255, 0) !important; 
    outline: none !important;
}

/* Preview Container */

#overlay {
    z-index: 35;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

#previewContainer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    z-index: 30;
    opacity: 0.0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    box-sizing: border-box;
    pointer-events: none;
}

#previewContainer.fade-in {
    transition: 0.5s opacity;
    opacity: 1;
}

#videoPreview, #imagePreview {
    display: none;
    max-width: 90vw;
    max-height: calc(88vh - 12vmin);
    border-radius: 10px;
    border: 1vmin solid white;
    background-color: white;
}

.icon-button img, #videoPreview, #imagePreview {
    filter: drop-shadow(0 0 2px #333);
}

.video-preview #videoPreview {
    display: block;
}

.image-preview #imagePreview {
    display: block;
}

/* Top Bar */

.top-bar {
    position: relative;
    flex: 1 0 0;
}

.preview-box {
    position: absolute;
    width: 80%;
    height: 90%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.icon-button {
    padding: 4vmin;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.icon-button img {
    display: block;
    height: 7.5vmin;
}

#toggleMuteButton, #closePreviewButton {
    position: absolute;
    z-index: 1;
}

#toggleMuteButton {
    left: 0;
    bottom: 0;
    display: none;
}

.video-preview #toggleMuteButton {
    display: block;
}

#closePreviewButton {
    top: 0;
    right: 0;
}

/* Bottom Bar */

.bottom-bar {
    display: flex;
    justify-content: center;
    position: relative;
    margin: 0 5vmin;
}

.style-reset {
    background: none;
    border: none;
    outline: none;
    box-shadow: none !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.style-reset:focus { outline:0; }

#actionButton {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    padding: 0.3em 0.5em 0.3em 0.5em;
    user-select: none;
    -webkit-user-select: none;
    text-align: right;
    color: white;
    background-color: #AD50FF;
    border-radius: 0.5em;
    font-size: 5vmin;
    min-width: 3.25em;
}

#actionButton img {
    height: 0.8em;
    margin-left: 0.4em;
}

.disabled-download.video-preview #openSafariText {
    display: block;
    font-size: 5vmin;
}

.disabled-download.image-preview #tapAndHoldText {
    display: block;
    font-size: 7.5vmin;
}

#openSafariText, #tapAndHoldText {
    display: none;
    padding: 0.3em 0.5em 0.3em 0.5em;
    user-select: none;
    -webkit-user-select: none;
    text-align: center;
    color: white;
    filter: drop-shadow(0px 1px 2px #333);
}

#previewContainer:not(.downloaded) .show-after-download {
    display: none;
}

/* splash screen */
/* grid is logo/toptext - loadinggif - centertext - bottomlogo */
.splashGrid {
    display: grid;
    height: 100%;
    grid-template-rows: 30% 20% 20% 30%;
    margin-left: auto;
    margin-right: auto;
    color: transparent;
    animation: blurFadeIn 0.5s ease-in backwards;
}

#splash {
    z-index: 40;
    background-color: var(--backgroundColor);
    opacity: 1;
    transition: opacity 1s;
}
  
#splash.fade {
    opacity: 0;
}

.splashImg img{
    object-fit: contain;
}

.top_text {
    bottom: 0%;
    margin-top: 5px;
    margin-bottom: 5px;
    color: var(--hColor);
    font-size: 60pt;
    text-align: center;
    animation: blurFadeIn 0.5s ease-in backwards;
}

.loading_gif {
    display: block;
    color: transparent;
    margin-left: auto;
    margin-right: auto;
    animation: blurFadeIn 0.5s ease-in backwards;
}

.center_text {
    bottom: 0%;
    margin-top: 5px;
    margin-bottom: 5px;
    color: var(--pColor);
    font-size: 30pt;
    text-align: center;
    animation: blurFadeIn 0.5s ease-in backwards;
}
   
@keyframes blurFadeIn{
    0%{
        opacity: 0;
        text-shadow: 0px 0px 40px #474344;
        transform: scale(1.3);
    }
    50%{
        opacity: 0.5;
        text-shadow: 0px 0px 10px #474344;
        transform: scale(1.1);
    }
    100%{
        opacity: 1;
        text-shadow: 0px 0px 1px #474344;
        transform: scale(1);
    }
}

/* 8thwall splash */

#loadImage {
    z-index: -1 !important;
    display: none;
}

#loadBackground {
    background-color: transparent !important;
}

#requestingCameraPermissions {
    visibility: hidden
}

#requestingCameraIcon {
    visibility: hidden
}

/* custom overlay */

#overlayDiv {
    z-index: 35;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 10vmin;
    text-align: center;
    pointer-events: none;
    animation: blurFadeIn 0.5s ease-in backwards;
    transition: opacity 1s;
}

#overlayDiv.fadeout {
    opacity: 0;
}

#overlayBody {
    color: var(--pColor);
    display: flex;
    padding-left: 5%;
    padding-right: 5%;
    font-size: 25pt;
    align-items: center;
    justify-content: center;
}

#overlayHeader {
    color: var(--hColor);
    top: 5%
}

#overlayHeaderImage {
    max-width: 40%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10%;
}

#overlayBodyImage {
    max-width: 75%;
    height: auto;
}

#overlayButton {
    background-image: linear-gradient(90deg, var(--buttonColor), var(--buttonColor2));
    height: fit-content;
    max-width: 70%;
    margin-left: 10%;
    margin-right: 10%;
    border: var(--buttonColor);
    border-radius: 2px;
    color: var(--bColor);
    font-size: 40px;
    -webkit-tap-highlight-color: transparent;
}

.buttonGrid {
    display: grid;
    grid-template-columns: 50% 50%;
}

.moduleBackground {
    background-color: var(--backgroundColor);
    display: grid;
    height: 100%;
    grid-template-rows: 25% 50% 25%;
}

#overlayDiv #module, #overlayDiv #cameraModule {
    height: 100%;
    width: 100%;
    animation: blurFadeIn 0.5s ease-in backwards;
    transition: opacity 1s;
}

#module {
    pointer-events: all !important;
}

#overlayDiv #module.fade, #overlayDiv #cameraModule.fade {
    opacity: 0;
}