.modal-overlay .modal:has([data-tela-builder]) {
    max-width: min(1100px, 96vw);
    width: 100%;
}


.tela-slide {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.tela-slide--present {
    max-width: min(96vw, 1400px);
    width: 100%;
    border-radius: var(--radius-md);
}

.tela-slide-inner {
    position: absolute;
    inset: 0;
}

.tela-el {
    position: absolute;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
}

.tela-el-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    line-height: 1.25;
    word-break: break-word;
    white-space: pre-wrap;
}

.tela-el img,
.tela-el-video,
.tela-el-video-embed {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
    object-fit: cover;
}

.tela-el-video-embed {
    border: 0;
}

.tela-el-audio-title {
    font-size: 0.75rem;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

.tela-el-audio {
    width: 100%;
}

.tela-el--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Participante */
.interaction-view--tela {
    padding: 1rem;
    min-height: auto;
}

.interaction-view--tela .interaction-title {
    margin-bottom: 1rem;
}

/* Apresentação */
.presentation-slide--tela {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem 1rem;
}

.presentation-slide--tela .presentation-question,
.presentation-slide--tela .presentation-results {
    display: none;
}

/* Editor */
.tela-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tela-builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.tela-builder-add-group,
.tela-builder-bg-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tela-bg-color-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.tela-file-btn {
    cursor: pointer;
    margin: 0;
}

.tela-builder-body {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 280px);
    gap: 1rem;
    align-items: start;
}

.tela-canvas-wrap {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.tela-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a2e;
    cursor: default;
}

.tela-el--editor {
    cursor: grab;
    outline: 2px solid transparent;
    outline-offset: 1px;
    transition: outline-color 0.15s ease;
}

.tela-el--editor.is-selected {
    outline-color: var(--primary-color);
    z-index: 5;
}

.tela-el--editor:active {
    cursor: grabbing;
}

.tela-props {
    padding: 1rem;
    max-height: 420px;
    overflow-y: auto;
}

.tela-props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.tela-props-empty {
    margin: 0;
    font-size: 0.9rem;
}

.tela-prop-preview {
    display: block;
    max-width: 100%;
    max-height: 100px;
    margin-top: 0.5rem;
    border-radius: 6px;
}

.modal .tela-builder-body {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .modal .tela-builder-body {
        grid-template-columns: 1fr minmax(220px, 280px);
    }
}

@media (max-width: 768px) {
    .tela-builder-body {
        grid-template-columns: 1fr;
    }

    .tela-slide {
        border-radius: var(--radius-md);
    }
}
