:root {
    --bg: #0f1115;
    --panel: #1a1d24;
    --panel-border: #2a2e38;
    --text: #e6e8eb;
    --text-dim: #8a8f9a;
    --accent: #4f8cff;
    --danger: #ff5c5c;
    --ok: #3ddc84;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, Segoe UI, Roboto, sans-serif;
    min-height: 100vh;
}

.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 28px;
}

.login-card { width: 320px; }
.login-card h1 { font-size: 20px; margin: 0 0 20px; }

input, button {
    font-family: inherit;
    font-size: 14px;
}

input[type=text], input[type=password], input[type=range] {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    background: #10131a;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    background: var(--accent);
    color: white;
    font-weight: 600;
}
button:hover { opacity: 0.9; }
button.danger { background: var(--danger); }
button.secondary { background: #2a2e38; }

.error { color: var(--danger); font-size: 13px; margin-top: -6px; margin-bottom: 12px; min-height: 16px; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--panel-border);
}
header h1 { font-size: 18px; margin: 0; }

main { padding: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 1000px; margin: 0 auto; }

.device-card { display: flex; flex-direction: column; gap: 16px; }
.device-head { display: flex; justify-content: space-between; align-items: center; }
.device-head h2 { margin: 0; font-size: 17px; }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.status-dot.online { background: var(--ok); }
.status-dot.offline { background: var(--text-dim); }

.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

.volume-row, .keyboard-row { display: flex; align-items: center; gap: 10px; }
.volume-row input[type=range] { margin: 0; flex: 1; }

.live-keyboard {
    flex: 1;
    padding: 12px;
    background: #10131a;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    outline: none;
}
.live-keyboard:focus { border-color: var(--accent); color: var(--text); }

.streams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stream-box { position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; }
.stream-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.stream-box .placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 13px; }
.stream-controls { display: flex; gap: 8px; margin-top: 8px; }

.log { font-size: 12px; color: var(--text-dim); max-height: 100px; overflow-y: auto; font-family: monospace; }

@media (max-width: 900px) {
    .streams-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    main { padding: 12px; }
    .card { padding: 16px; }
    .actions-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
