html, body {
    position: relative; 
    margin: 0; 
    width: 100%; 
    height: 100%; 
    overflow: hidden;
    /* background-color: #fff; */
    font-family: 'Roboto', sans-serif;
}

#container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#scanning {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: transparent;
    z-index: 2;
}

.guide {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 25px;
    font-weight: bold;
    color: #fff;
    width: 80%;
    text-shadow: 2px 2px 4px #000;
}

@media (min-aspect-ratio: 1/1) {
    #scanning .inner {
    width: 50vh;
    height: 50vh;
    }
}
@media (max-aspect-ratio: 1/1) {
    #scanning .inner {
    width: 80vw;
    height: 60vw;
    }
}

#preload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #006885;
    color: white;
}   

#preload .inner {
    padding-top: 40%;
    text-align: center;
}

#preload .inner .loading{
    font-size: 40px;
    font-weight: bold;
    margin-left: calc(50% - 40px);
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#preload .inner img{
    width: 90%;
}


#scanning .inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;

    background:
    linear-gradient(to right, white 10px, transparent 10px) 0 0,
    linear-gradient(to right, white 10px, transparent 10px) 0 100%,
    linear-gradient(to left, white 10px, transparent 10px) 100% 0,
    linear-gradient(to left, white 10px, transparent 10px) 100% 100%,
    linear-gradient(to bottom, white 10px, transparent 10px) 0 0,
    linear-gradient(to bottom, white 10px, transparent 10px) 100% 0,
    linear-gradient(to top, white 10px, transparent 10px) 0 100%,
    linear-gradient(to top, white 10px, transparent 10px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 40px 40px;
}

#scanning.hidden {    
    display: none;
}

#scanning img {
    opacity: 0.4;
    width: 90%;
    align-self: center;
}

#scanning .inner .scanline {
    position: absolute;
    width: 100%;
    height: 10px;
    background: white;
    animation: move 2s linear infinite;
}

@keyframes move {
    0%, 100% { top: 0% }
    50% { top: calc(100% - 10px) }
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    /* background-color: rgba(255, 255, 255, 0.5); Set the background overlay to 50% opacity */
    pointer-events: none; /* Ensure the canvas doesn't intercept clicks */
}

  
#record-btn {
    position: absolute; /* Ensure it is not inside the canvas rendering layer */
    z-index: 9999;       /* Set a higher z-index than the canvas */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
  
}
  
  #record-btn:hover {
    background-color: darkred;
  }

.record-btn {
    display: none;
}