.vnc-display {
    width: 1280px;
    height: 720px;
    max-width: 100%;
    max-height: 80vh; /* Limit to 80% of viewport height */
    background-color: #2e2e2e;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    aspect-ratio: 16/9; /* Maintain 1280:720 ratio */
}

.vnc-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 760px;
}

/* Scale VNC content to fit while maintaining aspect ratio */
.vnc-display canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}

.vnc-display > div:not(.welcome-screen) {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media (max-width: 1320px) {
    .vnc-display {
        width: calc(100vw - 40px);
        height: calc((100vw - 40px) * 9 / 16);
    }
}