:root {
  color-scheme: light;
  background: #fff;
  dynamic-range-limit: no-limit;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fff;
}

body {
  min-width: 320px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  dynamic-range-limit: no-limit;
  isolation: isolate;
  touch-action: manipulation;
  user-select: none;
}

@supports (background: color(rec2100-pq 1 1 1)) {
  html,
  body,
  .stage {
    background: color(rec2100-pq 1 1 1);
  }
}

.hdr-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  opacity: 0;
  dynamic-range-limit: no-limit;
}

.hdr-canvas.is-active {
  opacity: 1;
}

.controls {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgb(0 0 0 / 14%);
  border-radius: 8px;
  background: rgb(255 255 255 / 86%);
  box-shadow: 0 8px 26px rgb(0 0 0 / 14%);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.stage.clean .controls {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
}

.stage.show-controls .controls,
.controls:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%);
}

.button {
  min-width: 72px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

.button:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.button-secondary {
  background: #fff;
  color: #111;
}

.status {
  min-width: 86px;
  color: #111;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .controls {
    width: calc(100vw - 24px);
    justify-content: center;
  }

  .button {
    flex: 1 1 0;
    min-width: 0;
  }

  .status {
    position: absolute;
    top: -24px;
    left: 50%;
    min-width: 0;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgb(255 255 255 / 86%);
    box-shadow: 0 3px 14px rgb(0 0 0 / 10%);
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .controls,
  .status {
    background: #fff;
    backdrop-filter: none;
  }
}
