* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #0d1117; color: #e6edf3;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; align-items: center;
}
[hidden] { display: none !important; }
h1 { font-size: 20px; margin: 0 0 8px; }
.card {
  margin: 12vh auto 0; width: min(92vw, 360px); padding: 24px;
  background: #161b22; border: 1px solid #30363d; border-radius: 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.card p { margin: 0; color: #9da7b3; }
input, button {
  font: inherit; color: inherit; border-radius: 8px; border: 1px solid #30363d;
  background: #0d1117; padding: 9px 12px;
}
button { background: #21262d; cursor: pointer; }
button:hover { background: #30363d; }
button[type=submit] { background: #1f6feb; border-color: #1f6feb; }
.error { color: #ff7b72 !important; min-height: 1.4em; }

main { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; }
header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
#details { color: #9da7b3; font-size: 13px; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #30363d; }
.pill.online { background: #238636; }
.pill.offline { background: #8e1519; }
#stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; justify-content: center; }
#screen {
  height: 100%; max-width: 100%; object-fit: contain; background: #000;
  border: 1px solid #30363d; border-radius: 10px; touch-action: none; outline: none; cursor: crosshair;
}
#screen:focus { border-color: #1f6feb; }
#overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #9da7b3; pointer-events: none; text-align: center; padding: 16px;
}
#buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
#textbar { display: flex; gap: 6px; width: min(96vw, 560px); }
#textbar input { flex: 1; }
.hint { margin: 0; color: #6e7681; font-size: 12px; text-align: center; }
