* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #f7f8fa;
  color: #17202a;
  font: 1rem/1.5 system-ui, sans-serif;
}
#entry {
  max-width: 32rem;
  margin-inline: auto;
  padding: clamp(1rem, 3vh, 2rem) 1rem 0;
}
h1 { margin: 0 0 .75rem; font-size: 1.65rem; }
form { padding: .85rem 0; border-top: 1px solid #d9dfe5; }
label { display: block; margin-bottom: .45rem; font-weight: 600; }
.fields, footer { display: flex; align-items: center; gap: .5rem; }
input, button {
  min-height: 44px;
  padding: .55rem .9rem;
  border-radius: .5rem;
  font: inherit;
}
input { flex: 1; min-width: 0; border: 1px solid #a5b0bb; }
button { border: 0; background: #265ab1; color: white; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: #e2e8ef; color: #243747; }
#status { margin: .5rem auto; max-width: 32rem; padding-inline: 1rem; }
#status:empty { display: none; }

#session {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0e1014;
  color: #f5f6f8;
}
header, footer { background: #202329; padding: .4rem .8rem; }
h2 { margin: 0; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage { min-height: 0; display: grid; place-items: center; }
#view { width: 100%; height: 100%; min-height: 0; background: #0e1014; }
#session #status { margin: 0; color: #d5d9df; text-align: center; }
header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
header #status { font-size: .875rem; }
footer { justify-content: center; padding-bottom: max(.4rem, env(safe-area-inset-bottom)); }
#leave { background: #774048; }
#full { background: #424b59; }

.stage { position: relative; overflow: hidden; }
#view { object-fit: contain; }
#route { background: transparent; min-height: 24px; padding: 0 .25rem; user-select: none; touch-action: manipulation; font-size: .875rem; color: #cae9ff; }
footer { flex-wrap: wrap; }
#quality { margin: 0; font-size: .875rem; font-weight: 500; }
select { min-height: 40px; padding-inline: .45rem; border-radius: .4rem; font: inherit; }
#debug { position: absolute; top: .6rem; right: .6rem; max-width: calc(100% - 1.2rem);
  max-height: calc(100% - 1.2rem); overflow: auto; background: rgb(25 31 39 / 94%); color: #edf3fa; border-radius: .5rem; font-size: .82rem; }
#debug summary { padding: .5rem .75rem; cursor: pointer; }
#metrics { padding: 0 .75rem .75rem; min-width: min(18rem, 76vw); white-space: pre-line;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
