html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  font-family: Arial, Helvetica, sans-serif;
}

#app {
  position: relative;
}

#inputVideo,
#outputCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#inputVideo {
  display: none;
}

#outputCanvas {
  z-index: 1;
}

#ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

#topUi {
  position: absolute;
  top: 28px;
  left: 50%;
  width: min(560px, calc(100vw - 48px));
  transform: translateX(-50%);
  text-align: center;
}

#statusText {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 1),
    0 0 14px rgba(0, 0, 0, 0.85),
    0 0 26px rgba(0, 0, 0, 0.75);
}

#progressShell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
}

#progressTrack {
  width: min(380px, 68vw);
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.6);
}

#progressBar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #63d26f, #d5ff64);
  transition: width 0.15s linear;
}

#progressText {
  min-width: 58px;
  text-align: right;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 1),
    0 0 12px rgba(0, 0, 0, 0.85);
}

#centerMessage {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: min(720px, 82vw);
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 68px;
  line-height: 1.08;
  text-shadow:
    0 4px 8px rgba(0, 0, 0, 1),
    0 0 18px rgba(0, 0, 0, 0.9),
    0 0 38px rgba(0, 0, 0, 0.8);
  display: none;
}

#centerMessage.small {
  font-size: 34px;
}

#startButton {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 16px 26px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

#startButton:hover {
  transform: translateX(-50%) scale(1.02);
}

#changeDirectoryButton {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  pointer-events: auto;
  opacity: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(5px);
  transition: opacity 0.2s ease, background 0.2s ease;
}

#changeDirectoryButton:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.55);
}

#ui:hover #changeDirectoryButton {
  opacity: 0.25;
}

#ui:hover #changeDirectoryButton:hover {
  opacity: 1;
}