:root {
  --bone: #e6dcc4;
  --dim: rgba(230, 220, 196, 0.55);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050506;
  color: var(--bone);
  font: 13px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Only ?slider shows this bar now. Viewers just get the fan. */
.control:not(.testing) {
  display: none;
}

.control {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  border-radius: 22px;
  background: rgba(8, 8, 9, 0.62);
}

.control p {
  margin: 0;
  color: var(--dim);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}

.control output {
  margin: 0 2px 0 6px;
  color: var(--bone);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  transition: opacity 0.3s;
}

.control[data-state="waiting"] .cap-label {
  display: none;
}

.control[data-state="waiting"] #cap {
  margin-left: 0;
  font-size: 13px;
}

.control[data-state="stale"] #cap {
  opacity: 0.5;
}

.control.testing {
  flex-wrap: wrap;
  gap: 2px 14px;
}

#stream {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050506;
  visibility: hidden;
}

body[data-stream="live"] #stream {
  visibility: visible;
}

.ca {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  padding: 9px 0;
  border: 0;
  background: none;
  color: var(--bone);
  font: 13px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
  cursor: pointer;
}

.ca:disabled {
  cursor: default;
}

.ca-label {
  margin-right: 8px;
  color: var(--dim);
  letter-spacing: 0.08em;
  font-size: 11px;
  text-transform: uppercase;
}

#speed {
  flex-basis: 100%;
  height: 26px;
  margin: 0;
  accent-color: var(--bone);
  cursor: pointer;
}
