* { box-sizing: border-box; }

body {
  margin: 0;
  background: #111;
  color: #eee;
  font-family: system-ui, sans-serif;
}

header {
  padding: 14px 18px;
  border-bottom: 1px solid #333;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

h1 {
  font-size: 18px;
  margin: 0 20px 0 0;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 9px 14px;
  background: #287cff;
  color: white;
  cursor: pointer;
}

button:disabled { opacity: 0.4; }

.status {
  font-size: 13px;
  color: #aaa;
}

main {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  padding: 16px;
}

.panel {
  background: #191919;
  border: 1px solid #333;
  border-radius: 12px;
  overflow: hidden;
}

.title {
  padding: 11px 14px;
  border-bottom: 1px solid #333;
  font-weight: 600;
  font-size: 14px;
}

.stage {
  position: relative;
  background: #080808;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#video,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#video {
  object-fit: contain;
  transform: scaleX(-1);
  background: #080808;
}

#overlay { pointer-events: none; }

#face-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stats { padding: 14px; }

.row {
  display: grid;
  grid-template-columns: 100px 1fr 55px;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  font-size: 12px;
}

.bar {
  position: relative;
  height: 10px;
  background: #333;
  border-radius: 8px;
  overflow: hidden;
}

.fill.signed {
  position: absolute;
  left: 50%;
  width: 0;
}

.fill {
  height: 100%;
  width: 0;
  background: #55d98b;
}

pre {
  margin: 0;
  padding: 14px;
  font: 12px ui-monospace, monospace;
  line-height: 1.6;
  color: #bbb;
}

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; }
  .stage { min-height: 400px; }
}
