:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: #1a1d24;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #8a8f99;
  --accent: #4f8cff;
  --danger: #ff5c5c;
}

* { box-sizing: border-box; }

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

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

.screen.hidden { display: none; }

#login-form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-form h1 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

#login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

#login-form .hint { font-size: 11px; }

#login-form input {
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 15px;
}

#login-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 12px;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

#login-form button:hover { opacity: 0.9; }

.status {
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
  margin: 0;
}

#remote-screen {
  flex-direction: column;
  background: black;
  position: relative;
}

#toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

#toolbar button {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  color: white;
  cursor: pointer;
  font-size: 13px;
}

#fullscreen-btn,
#fit-toggle-btn,
#match-res-btn,
#mouse-mode-btn {
  background: #3a3f4b;
}

#disconnect-btn {
  background: var(--danger);
}

#remote-video {
  flex: 1;
  width: 100%;
  height: calc(100vh - 41px);
  object-fit: contain;
  background: black;
  cursor: none;
}

#control-overlay {
  position: absolute;
  inset: 41px 0 0 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}

#control-overlay.hidden {
  display: none;
}

.control-overlay-inner {
  color: white;
  text-align: center;
  font-size: 17px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-overlay-inner .hint {
  font-size: 12px;
  color: var(--muted);
}

#cursor-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 4;
  display: none;
}
