body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

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

#mirror-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure no cropping */
    transform: scaleX(-1);
    /* Default mirror effect */
}

#mirror-video.no-flip {
    transform: scaleX(1);
}

.overlay-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to video if needed */
    z-index: 10;
}

.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: auto;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.back-link:hover {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.controls-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s;
}

/* Hide controls when inactive for a while (optional, but good for mirror) */
.mirror-container:hover .controls-panel {
    opacity: 1;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

select {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    max-width: 200px;
}

select option {
    background: #222;
    color: white;
}

.btn-icon {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    z-index: 20;
}

.message.hidden {
    display: none;
}

.message p {
    margin-bottom: 15px;
}