* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.container { width: 100%; max-width: 80vw; }

.login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20vh;
}
.login-section h1 { font-size: 1.6rem; }
.login-section form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 320px;
}
.login-section input {
    flex: 1;
    padding: 10px 14px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.95rem;
    outline: none;
}
.login-section input:focus { border-color: #7c5cbf; }
.login-section button {
    padding: 10px 20px;
    background: #7c5cbf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
.login-section button:hover { background: #6a4eab; }
.error { color: #e74c3c; font-size: 0.85rem; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1 { font-size: 1.4rem; font-weight: 600; }

.status { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #e74c3c; }
.status.connected .dot { background: #2ecc71; }
.status.connected .text::after { content: 'connected'; }
.status.disconnected .text::after { content: 'disconnected'; }
.status .text { font-size: 0; }

.drop-zone {
    border: 2px dashed #444;
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: #7c5cbf;
    background: rgba(124, 92, 191, 0.1);
}
.drop-zone p { color: #888; font-size: 0.95rem; line-height: 1.6; }

.clear-btn {
    margin-top: 16px;
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
}
.clear-btn:hover { background: #c0392b; }

.stream-section { margin-top: 24px; }
.stream-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.stream-header h3 { font-size: 0.9rem; color: #888; }
.stream-toggle {
    padding: 6px 14px;
    background: #7c5cbf;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}
.stream-toggle:hover { background: #6a4eab; }
.stream-container {
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
    background: #111;
}
.stream-container img {
    width: 100%;
    display: block;
}

.screen-section { margin-top: 24px; }
.screen-section h3 { font-size: 0.9rem; margin-bottom: 10px; color: #888; }

.screen-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #111;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
}

.img-handle {
    position: absolute;
    border: 2px solid #7c5cbf;
    cursor: move;
    min-width: 20px;
    min-height: 20px;
}
.img-handle.selected { border-color: #e0e0e0; }
.img-handle img {
    width: 100%; height: 100%;
    object-fit: fill; display: block; pointer-events: none;
}
.resize-handle {
    position: absolute; right: -4px; bottom: -4px;
    width: 12px; height: 12px;
    background: #7c5cbf; border-radius: 2px;
    cursor: nwse-resize;
}

.layers { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

.layer-card {
    background: #222;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.layer-card.selected { outline: 1px solid #7c5cbf; }
.layer-card img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.layer-controls { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.layer-controls label { font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
.layer-controls input[type="range"] { flex: 1; accent-color: #7c5cbf; }
.layer-remove {
    background: none; border: none; color: #e74c3c;
    font-size: 1.2rem; cursor: pointer; padding: 4px 8px;
}
.layer-remove:hover { color: #ff6b6b; }
