/* Ocupamos toda la pantalla */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: #000;
    color: #eee;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Barra superior fija */
header {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: #222;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #eee;
}

header span.title {
    font-weight: bold;
}

#status {
    font-weight: bold;
}
#status.ok {
    color: #4caf50;
}
#status.err {
    color: #f44336;
}

/* Zona principal: el canvas centrado y escalado */
#main {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    overflow: hidden;
}

/* El canvas se ajusta al espacio disponible conservando aspecto */
#screen {
    background: #000;
    max-width: 100%;
    max-height: 100%;
    width: 100%;      /* ocupa todo el ancho disponible */
    height: auto;     /* altura proporcional a la resolución remota */
    border: 1px solid #333;
    outline: none;    /* para que no se vea borde de foco feo */
}

/* Ocultamos el log por ahora */
#log {
    display: none;
}

/* Controles */
button {
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
}

input {
    font-size: 12px;
    padding: 2px 4px;
}
