:root { --w: min(92vw, 720px); }

body {
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  padding: 2rem;
  background: #fafafa;
  color: #222;
}

.wrap {
  margin: 0 auto;
  width: var(--w);
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.controls {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

button, .file {
  padding: .5rem .75rem;
  border: none;
  border-radius: 6px;
  background: #0057e7;
  color: white;
  cursor: pointer;
  font-size: .9rem;
  transition: background .2s;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button:hover:enabled,
.file:hover {
  background: #003f9e;
}

.file {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.file input {
  display: none;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}

video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlayContainer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.result {
  margin-top: .75rem;
  font-size: 1.05rem;
  padding: .5rem;
  background: #f0f0f0;
  border-radius: 6px;
}