* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#frame {
  width: 78vw;
  max-width: 420px;
  height: 45vw;
  max-height: 240px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
}

#hint {
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  text-align: center;
}

#result {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12%;
  display: none;
  justify-content: center;
  pointer-events: none;
}

#result.visible {
  display: flex;
}

#result span {
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(30, 170, 90, 0.92);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

#error {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  text-align: center;
}

#error.visible {
  display: flex;
}

#error-text {
  color: #fff;
  font-size: 16px;
  max-width: 320px;
}

#close-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: #2ea6ff;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
