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

body {
  background: #0b0d12;
  color: #e6e6e6;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #11141a;
  border-bottom: 1px solid #222;
}

h1 { font-size: 1rem; font-weight: 600; letter-spacing: 0.5px; }

.status {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}
.status.disconnected { background: #3a1d22; color: #ff8b95; }
.status.connecting   { background: #3a331d; color: #ffd36b; }
.status.connected    { background: #1d3a25; color: #6bff98; }

button {
  background: #1e88ff;
  color: white;
  border: 0;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
button:hover { background: #1876e0; }
#btn-logout { background: #333a44; }
#btn-logout:hover { background: #444d59; }

#monitor-select {
  background: #1a1f2b;
  color: #e6e6e6;
  border: 1px solid #333a44;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}
#monitor-select.hidden { display: none; }

.stats {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.stats span {
  background: #1a1f2b;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: #a8b1c0;
}
.stats .dc-open  { color: #6bff98; }
.stats .dc-closed { color: #ff8b95; }
.stats.hidden { display: none; }

main {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
  pointer-events: none; /* todos los eventos van al overlay */
}

#video:fullscreen { object-fit: contain; }

#input-surface {
  position: absolute;
  inset: 0;
  outline: none;
  cursor: none;
  z-index: 2;
  background: transparent;
}

.click-prompt {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  pointer-events: none;
}
.click-prompt.hidden { display: none; }

/* ---- Login overlay ---- */

.login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10;
}
.login.hidden { display: none; }

.login form {
  background: #151921;
  border: 1px solid #262b36;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  width: min(420px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.login h2 { font-size: 1.1rem; font-weight: 600; }
.login p  { font-size: 0.9rem; color: #a8b1c0; }
.login p code {
  background: #0b0d12;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.login input {
  background: #0b0d12;
  color: #e6e6e6;
  border: 1px solid #262b36;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  outline: none;
}
.login input:focus { border-color: #1e88ff; }
.login .hint { font-size: 0.75rem; color: #6b7280; }
