.camera-widget {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: white;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-name {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0.25rem;
    font-size: 1.25rem;
    word-break: break-word;
    pointer-events: none;
    z-index: 6;
}

.camera-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
}

.camera-stream.stretch {
    object-fit: fill;
}

.camera-stream.flip-h {
    transform: scaleX(-1);
}

.camera-stream.flip-v {
    transform: scaleY(-1);
}

.camera-stream.flip-h.flip-v {
    transform: scale(-1, -1);
}

.widget-template.camera-stream {
    width: 60vmin;
    height: 40vmin;
}

.template-panel .widget-template.camera-stream {
    width: 40vmin;
    height: 30vmin;
/*    overflow: hidden;*/
}

/* keep a small margin inside the template so the dashed border is visible */
.template-panel .widget-template.camera-stream .template-content {
    height: calc(100% - 0.5rem);
}

.camera-preview-container {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.camera-preview.flip-h {
    transform: scaleX(-1);
}

.camera-preview.flip-v {
    transform: scaleY(-1);
}

.camera-preview.flip-h.flip-v {
    transform: scale(-1, -1);
}

/* camera settings panel should stay fully visible */
.camera-customization .widget-customize-panel {
    max-height: calc(100dvh - 14vh);
}

/* make the preview column wider than the settings */
.camera-customization .widget-customize-panel.two-column {
    grid-template-columns: 1fr 1.5fr;
    align-items: stretch;
}

.camera-customization .custom-column:last-child {
    height: 100%;
}

.camera-steering {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 15% auto 15%;
    grid-template-rows: 15% auto 15%;
    gap: 0;
    z-index: 7;
    pointer-events: none;
}

.camera-steering.hidden {
    display: none;
}

.camera-steering .steer-area {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.camera-steering .center {
    position: relative;
    background: none;
    border: none;
    pointer-events: auto;
}

.camera-steering .zoom-controls {
    position: absolute;
    bottom: 0.2rem;
    right: 0.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.camera-steering .tl { grid-area: 1 / 1; }
.camera-steering .t  { grid-area: 1 / 2; }
.camera-steering .tr { grid-area: 1 / 3; }
.camera-steering .l  { grid-area: 2 / 1; }
.camera-steering .c  { grid-area: 2 / 2; }
.camera-steering .r  { grid-area: 2 / 3; }
.camera-steering .bl { grid-area: 3 / 1; }
.camera-steering .b  { grid-area: 3 / 2; }
.camera-steering .br { grid-area: 3 / 3; }

.camera-steering .center .steer-area.zoom {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1rem;
}





/* === MEDIA === */

/* Mobile  */

@media (max-width: 699px) {
    .camera-name {
        padding: 0.25rem 0.5rem;
        font-size: 0.95rem;
    }
}

/* WVGA / WVGA-Narrow (720x480, 800x480) */

@media (min-width: 700px) and (max-width: 880px) {
}

/* WSVGA / XGA (1024x600, 1024x768) */

@media (min-width: 881px) and (max-width: 1150px) {
    .camera-name {
        padding: 0.25rem 0.5rem;
        font-size: 0.95rem;
    }
}

/* WXGA / HD720 / SXGA (1280x720/800/1024) */

@media (min-width: 1151px) and (max-width: 1600px) {
    .camera-name {
        padding: 0.25rem 0.5rem;
        font-size: 0.95rem;
    }
}

/* HD / WUXGA (1920x1080, 1920x1200) */

@media (min-width: 1601px) and (max-width: 2879px) {
    /* standard styles */
}

/* 4K (3840x2160) */

@media (min-width: 2880px) {
    .camera-name {
        padding: 0.5rem 1rem;
        font-size: 2rem;
    }
}