body {
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

#container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-wrapper {
    position: relative;
    width: 90%;
    max-width: 600px;
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
    background: white;
    border: 1px solid #f26522;
    z-index: 100;
    margin: auto;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    overflow-y: hidden; /* Default: no scrolling */
    
    /* For browsers that don't support dvh */
    height: auto;
    max-height: 90vh;
}

/* Enable vertical scrolling ONLY in landscape mode */
@media (orientation: landscape) {
    .start-wrapper {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
        max-height: 80vh; /* Slightly smaller to ensure scrollability */
    }
}

/* Modern browser support */
@supports (height: 100dvh) {
    .start-wrapper {
        max-height: 90dvh;
    }
    @media (orientation: landscape) {
        .start-wrapper {
            max-height: 80dvh;
        }
    }
}

.start-wrapper img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.start-wrapper h1, 
.start-wrapper h3, 
.start-wrapper h4, 
.start-wrapper span {
    margin: 10px 0;
    word-wrap: break-word;
}

.video-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.localVideo {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.remoteVideo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30%;
    max-width: 300px;
    border: 2px solid white;
    border-radius: 5px;
    z-index: 10;
}

#control-box {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

button {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

#status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10;
}

.canvas-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#photoCanvas {
    display: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .start-wrapper {
        width: 90%;
        padding: 15px;
    }
    
    /* Landscape-specific mobile rules */
    @media (orientation: landscape) {
        .start-wrapper {
            max-height: 70vh; /* More compact in landscape */
            padding: 10px; /* Less padding in landscape */
        }
    }
    
    .start-wrapper h1 {
        font-size: 1.5rem;
    }
    
    .start-wrapper h3, 
    .start-wrapper h4 {
        font-size: 1.1rem;
    }
    
    .remoteVideo {
        width: 25%;
        top: 10px;
        right: 10px;
    }
    
    #control-box {
        left: 10px;
        gap: 8px;
    }
    
    button {
        padding: 8px 12px;
        font-size: 14px;
    }
}