:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --fg: #1d232b;
  --muted: #5f6873;
  --ring: #e0a526;
  --field: #ffffff;
  --line: #d5d2cb;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181c;
    --fg: #e6e8eb;
    --muted: #9aa3ad;
    --field: #1f242a;
    --line: #353c45;
    --error: #ff8a80;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

header { padding: 16px 0 8px; text-align: center; }
.brand { font-size: 28px; font-weight: 300; letter-spacing: .02em; }
.brand .o {
  display: inline-block;
  width: .62em; height: .62em;
  margin: 0 .04em;
  border: .12em solid var(--ring);
  border-radius: 50%;
  color: transparent;
  overflow: hidden;
  vertical-align: -.02em;
}

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; }
h1 { font-size: 22px; font-weight: 500; margin: 16px 0 8px; }
p { margin: 8px 0; }
.quiet { color: var(--muted); text-align: center; }
.error { color: var(--error); min-height: 1.5em; }

form { display: flex; gap: 8px; margin-top: 16px; }
input[type="text"], #code {
  flex: 1; min-width: 0;
  font: inherit; font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: var(--fg);
}
button {
  font: inherit;
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--field); color: var(--fg);
  cursor: pointer;
}
#watch { background: var(--ring); border-color: var(--ring); color: #1d232b; font-weight: 600; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

#view { display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
#stage { position: relative; display: inline-block; max-width: 100%; }
#picture {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto; height: auto;
}
#notice {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 15%;
  text-align: center;
  color: #fff;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  pointer-events: none;
}
#status { color: var(--muted); text-align: center; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.controls label { display: flex; gap: 6px; align-items: center; color: var(--muted); }

footer { max-width: 720px; margin: 24px auto 0; padding: 16px 0; color: var(--muted); font-size: 13px; text-align: center; }
[hidden] { display: none !important; }
