:root{--bg:#0f0f14;--text:#f2f3f5;--muted:#aab0bd;--border:#262838;--accent:#6c8cff}
*{box-sizing:border-box}
body{
  margin:0;
  background:#000;
  color:var(--text);
  font:16px/1.6 system-ui,-apple-system,sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wrap {
  width: 100%;
  max-width: 1000px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
}

.container {
  position: relative;
  width: 100%;
  /* Aspect ratio 16:9 for widescreen video */
  aspect-ratio: 16/9; 
  background: #10121a;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hud {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
}

.back {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 13, 18, 0.8);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(4px);
}
.back:hover {
  border-color: #3a3e58;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #d48c28;
  font-size: 24px;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  text-shadow: 0 0 10px #ff6600;
}
.hide {
  display: none;
}

.input_video {
  display: none;
}

#output_canvas {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
  display: block;
}
