* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: #111; color: #eee;
  font-family: system-ui, sans-serif;
  overscroll-behavior: none;
}
.hidden { display: none !important; }

.panel {
  max-width: 320px; width: 90vw; margin: 10vh auto; padding: 24px;
  background: #1c1c1c; border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.panel h1 { font-size: 1.2rem; margin: 0 0 12px; }
.panel label { font-size: 0.85rem; color: #aaa; margin-top: 8px; }
.panel input, .panel select {
  padding: 10px 8px; border-radius: 4px; border: 1px solid #444;
  background: #222; color: #eee; font-size: 1rem;
}
.panel button {
  margin-top: 16px; padding: 12px; border: none; border-radius: 4px;
  background: #2d6cdf; color: white; font-size: 1rem; cursor: pointer;
}
.panel button:hover { background: #1f57bd; }
.status { min-height: 1.2em; color: #e55; font-size: 0.85rem; }

#session {
  height: 100%; height: 100dvh; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
#bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #1c1c1c; gap: 8px; flex-wrap: wrap;
}
#sessionStatus { font-size: 0.85rem; color: #ccc; }
#barButtons { display: flex; gap: 8px; }
#bar button {
  padding: 8px 12px; border: none; border-radius: 4px;
  background: #444; color: #eee; cursor: pointer;
  font-size: 1rem; min-width: 40px; min-height: 40px;
}
#disconnectBtn { background: #5a2323; }
#bar button:active { background: #666; }

#remoteVideo {
  flex: 1; width: 100%; height: 100%; object-fit: contain;
  background: black; outline: none; cursor: none;
  touch-action: none; -webkit-user-select: none; user-select: none;
}

#mobileKeyInput {
  position: absolute; opacity: 0; height: 0; width: 0;
  pointer-events: none; border: none;
}

@media (max-width: 480px) {
  .panel { margin: 20vh auto; padding: 20px; }
  #sessionStatus { font-size: 0.75rem; }
}
