:root {
  --color-background: #000;
  --color-surface: rgb(20 20 20 / 0.72);
  --color-surface-pressed: rgb(255 255 255 / 0.28);
  --color-foreground: #fff;
  --color-muted: rgb(255 255 255 / 0.7);
  --radius: 14px;
  --gap: 8px;
  --control-size: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--color-background);
  color: var(--color-foreground);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

/* The video is centered and sized by app.js: at 90/270 degrees its box
   swaps width and height so that the rotated picture still fills the screen. */
#video {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  object-fit: cover;
  transform: translate(-50%, -50%);
  background: var(--color-background);
}

body.fit #video { object-fit: contain; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.overlay[hidden] { display: none; }

.primary {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  padding: 16px 28px;
  background: var(--color-foreground);
  color: var(--color-background);
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
}

.message {
  margin: 0;
  max-width: 32em;
  color: var(--color-muted);
}

.controls {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: var(--gap);
  padding: var(--gap);
  border-radius: calc(var(--radius) + var(--gap));
  background: var(--color-surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity 300ms ease;
}

.controls[hidden] { display: none; }

body.idle .controls {
  opacity: 0;
  pointer-events: none;
}

body.idle { cursor: none; }

.controls button {
  appearance: none;
  display: grid;
  place-items: center;
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-foreground);
  cursor: pointer;
}

.controls button[hidden] { display: none; }

.controls button:hover,
.controls button[aria-pressed="true"] {
  background: var(--color-surface-pressed);
}

.controls button:focus-visible,
.primary:focus-visible {
  outline: 2px solid var(--color-foreground);
  outline-offset: 2px;
}

.controls svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
