:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #ddd;
  font: 14px/1.4 Tahoma, "Segoe UI", system-ui, sans-serif;
}

/* ---------- app ---------- */

body.app {
  display: grid;
  place-items: center;
  overflow: hidden;
}

#stage {
  position: relative;
  width: min(1024px, calc(100vw - 32px), calc((100vh - 32px) * 4 / 3));
  aspect-ratio: 4 / 3;
  background: #000;
  box-shadow: 0 0 0 1px #161616, 0 24px 80px rgba(0, 0, 0, 0.8);
  user-select: none;
  -webkit-user-select: none;
}

#screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

#screen > div {
  background: #000 !important;
}

#input {
  position: absolute;
  inset: 0;
  z-index: 2;
  outline: none;
  touch-action: none;
  cursor: default;
}

#status {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: #777;
  font-size: 13px;
  letter-spacing: 0.02em;
  pointer-events: none;
  transition: opacity 0.3s;
}

#status.hidden {
  opacity: 0;
}

#notice {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  color: #ccc;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

#notice[hidden] {
  display: none;
}

/* ---------- login ---------- */

body.login {
  display: grid;
  place-items: center;
}

.login form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 260px;
}

.login .logo {
  align-self: center;
}

.login h1 {
  margin: -4px 0 8px;
  color: #fff;
  font-size: 20px;
  font-weight: normal;
  text-align: center;
  letter-spacing: 0.01em;
}

.login label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #8a8a8a;
  font-size: 12px;
}

.login input {
  padding: 9px 10px;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  background: #0b0b0b;
  color: #eee;
  font: inherit;
}

.login input:focus {
  outline: none;
  border-color: #3d74b3;
  box-shadow: 0 0 0 3px rgba(61, 116, 179, 0.3);
}

.login button {
  margin-top: 6px;
  padding: 9px;
  border: 1px solid #2f6b2f;
  border-radius: 4px;
  background: linear-gradient(#45a845, #2f842f);
  color: #fff;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
}

.login button:hover {
  background: linear-gradient(#4fb84f, #349134);
}

.login button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 184, 79, 0.35);
}

.error {
  margin: 0;
  color: #ff6b6b;
  font-size: 12px;
  text-align: center;
}

.login .hint {
  margin: -14px 0 4px;
  color: #777;
  font-size: 12px;
  text-align: center;
}
