.camera-page {
  overflow: hidden;
  background: #0f0f12;
}

.camera-page::before {
  display: none;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #0f0f12;
}

/* The video element only feeds frames; the canvas shows the picture the model worked on. */
.stage-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

.stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--stage);
}

.stage-start-card {
  display: grid;
  justify-items: start;
  gap: 14px;
  width: min(100%, 520px);
}

.stage-start-card h1 {
  font-size: var(--text-xl);
}

.stage-start-card p {
  color: var(--mist);
}

.stage-start-card .button {
  margin-top: 8px;
}

/* Controls float over the video and fade out when the mouse is still. */
[data-chrome] {
  transition: opacity 0.25s;
}

.camera-page:not([data-live]) [data-chrome],
.camera-page[data-idle] [data-chrome],
.camera-page[data-clean] [data-chrome] {
  opacity: 0;
  pointer-events: none;
}

.camera-page[data-idle],
.camera-page[data-clean] {
  cursor: none;
}

.stage-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 16px;
  background: rgb(22 22 26 / 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.stage-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.modes {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.07);
}

.modes button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--mist);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.modes button:hover {
  color: var(--paper);
}

.modes button[aria-checked='true'] {
  background: var(--paper);
  color: var(--ink);
}

.stage-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.stage-tools .status {
  padding-inline: 8px;
}

.tool {
  appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.08);
  color: var(--paper);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.tool:hover {
  background: rgb(255 255 255 / 0.14);
}

.tool[aria-pressed='true'] {
  background: rgb(255 255 255 / 0.22);
}

select.tool {
  max-width: 220px;
}

.stage-keys {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgb(22 22 26 / 0.7);
  font-size: 0.8125rem;
  color: var(--mist);
}

.stage-keys span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* A hint for the presenter: it hides with the other controls. */
.stage-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  max-width: min(440px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 12px;
  background: rgb(22 22 26 / 0.86);
  box-shadow: inset 3px 0 0 var(--sticker-red);
  font-size: 0.875rem;
  color: var(--paper);
}

.stage-toast {
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 720px) {
  .stage-note {
    left: 16px;
    bottom: 76px;
  }
}
