:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #07090b;
  color: #f2f4f5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main, #gate, #screen, #message { position: fixed; inset: 0; }
main { background: black; }
#screen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
main.reserve-controls #screen {
  --band: calc(max(12px, env(safe-area-inset-top)) + 54px);
  top: var(--band);
  height: calc(100% - var(--band));
}
#gate, #message {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
}
#gate { background: #090b0d; }
#pair-form { width: min(360px, 85vw); }
#pair-form label { display: block; margin-bottom: 8px; color: #bcc3c9; font-size: 15px; }
.pair-row { display: flex; align-items: stretch; gap: 8px; }
#pair-wait { text-align: center; }
#pair-code { display: block; margin-bottom: 12px; font: 600 40px/1.2 "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
input, button {
  min-height: 48px;
  border: 1px solid #474c53;
  border-radius: 9px;
  font: inherit;
  font-size: 16px;
}
input { min-width: 0; flex: 1; padding: 0 14px; background: #171a1e; color: #f4f6f8; }
input::placeholder { color: #a1a7ad; }
button { padding: 0 18px; cursor: pointer; color: #111418; background: #e6ebef; border-color: transparent; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid #8dc4ff; outline-offset: 3px; }
.notice { font-size: 15px; line-height: 1.5; margin: 0; text-align: center; }
.notice:empty { display: none; }
#gate-status { max-width: min(400px, 85vw); color: #c4cbd0; }
#logout {
  position: fixed;
  z-index: 2;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  background: rgb(18 20 24 / 85%);
  border-color: rgb(255 255 255 / 28%);
  color: white;
}
#message { background: rgb(0 0 0 / 78%); }
#tap-status { position: fixed; bottom: 14px; left: 14px; padding: 6px 12px; background: #15171b; border-radius: 6px; pointer-events: none; }
noscript { position: fixed; inset: auto 0 10%; text-align: center; }
#measurement {
  position: fixed;
  z-index: 3;
  bottom: 8px;
  left: 8px;
  margin: 0;
  max-width: min(90vw, 46em);
  padding: 7px 11px;
  border-radius: 6px;
  background: #111e;
  color: white;
  font: 14px/1.4 "Segoe UI", sans-serif;
  white-space: pre-line;
}
